diff --git a/apps/server/src/codexTextGenerator.ts b/apps/server/src/codexTextGenerator.ts index 51166b380f..ebc92ac9a8 100644 --- a/apps/server/src/codexTextGenerator.ts +++ b/apps/server/src/codexTextGenerator.ts @@ -12,11 +12,13 @@ import type { } from "./coreServices"; import { type ProcessRunOptions, type ProcessRunResult, runProcess } from "./processRunner"; -type ProcessRunner = ( - command: string, - args: readonly string[], - options?: ProcessRunOptions, -) => Promise; +interface ProcessRunner { + ( + command: string, + args: readonly string[], + options?: ProcessRunOptions, + ): Promise; +} const CODEX_MODEL = "gpt-5.3-codex"; const CODEX_REASONING_EFFORT = "low"; diff --git a/apps/server/src/git.ts b/apps/server/src/git.ts index a9a7aa062e..bf84176a05 100644 --- a/apps/server/src/git.ts +++ b/apps/server/src/git.ts @@ -29,7 +29,7 @@ export interface TerminalCommandInput { maxOutputBytes?: number; } -export type TerminalCommandResult = ProcessRunResult; + export interface GitStatusDetails extends Omit { upstreamRef: string | null; @@ -159,7 +159,7 @@ function normalizeGitSpawnError(cwd: string, error: unknown): Error { return new Error(`Failed to run git command: ${error.message}`); } -function normalizeGitExecutionError(args: readonly string[], result: TerminalCommandResult): Error { +function normalizeGitExecutionError(args: readonly string[], result: ProcessRunResult): Error { const stderr = result.stderr.trim(); if (stderr.toLowerCase().includes("not a git repository")) { return new Error("Current folder is not a git repository."); @@ -176,8 +176,8 @@ async function runGitOrThrow( cwd: string, args: readonly string[], options: RunGitOptions = {}, -): Promise { - let result: TerminalCommandResult; +): Promise { + let result: ProcessRunResult; try { result = await runGit(args, cwd, options.timeoutMs); } catch (error) { @@ -197,7 +197,7 @@ async function executeGit( cwd: string, args: readonly string[], options: ExecuteGitOptions = {}, -): Promise { +): Promise { const result = await runGitOrThrow(cwd, args, { timeoutMs: options.timeoutMs, allowNonZeroExit: true, @@ -680,7 +680,7 @@ const defaultGitCoreService = new GitCoreService(); export async function runTerminalCommand( input: TerminalCommandInput, -): Promise { +): Promise { const maxOutputBytes = input.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES; const shellPath = process.platform === "win32" diff --git a/apps/server/src/orchestration/Layer.ts b/apps/server/src/orchestration/Layer.ts index bd36e701c2..1edacd925c 100644 --- a/apps/server/src/orchestration/Layer.ts +++ b/apps/server/src/orchestration/Layer.ts @@ -17,10 +17,10 @@ import { import { createEmptyReadModel, reduceEvent } from "./reducer.ts"; import { OrchestrationEngineService, type OrchestrationEngineShape } from "./Service.ts"; -type CommandEnvelope = { +interface CommandEnvelope { command: OrchestrationCommand; result: Deferred.Deferred<{ sequence: number }, OrchestrationDispatchError>; -}; +} function mapCommandToEvent(command: OrchestrationCommand): Omit { const eventId = crypto.randomUUID(); diff --git a/apps/server/src/persistence/Layers/OrchestrationEvents.ts b/apps/server/src/persistence/Layers/OrchestrationEvents.ts index bbbc26c842..bd9f0bd7c3 100644 --- a/apps/server/src/persistence/Layers/OrchestrationEvents.ts +++ b/apps/server/src/persistence/Layers/OrchestrationEvents.ts @@ -30,8 +30,6 @@ const EventRowSchema = Schema.Struct({ payloadJson: Schema.String, }); -type EventRow = Schema.Schema.Type; - const AppendEventRequestSchema = Schema.Struct({ eventId: Schema.String, type: Schema.String, @@ -48,7 +46,7 @@ const ReadFromSequenceRequestSchema = Schema.Struct({ }); function eventRowToOrchestrationEvent( - row: EventRow, + row: Schema.Schema.Type, operation: string, ): Effect.Effect { return Effect.try({ diff --git a/apps/server/src/persistence/Layers/Projects.ts b/apps/server/src/persistence/Layers/Projects.ts index e38ef34587..fd6426ecb2 100644 --- a/apps/server/src/persistence/Layers/Projects.ts +++ b/apps/server/src/persistence/Layers/Projects.ts @@ -44,8 +44,6 @@ const ProjectRowSchema = Schema.Struct({ updatedAt: Schema.String, }); -type ProjectRow = Schema.Schema.Type; - const FindByIdRequestSchema = Schema.Struct({ id: Schema.String, }); @@ -137,7 +135,7 @@ function decodeScriptsJson( } function rowToProjectRecord( - row: ProjectRow, + row: Schema.Schema.Type, operation: string, ): Effect.Effect { return decodeScriptsJson(row.scriptsJson, `${operation}:scripts`).pipe( diff --git a/apps/server/src/terminalManager.ts b/apps/server/src/terminalManager.ts index dcdf78615d..05217e90a4 100644 --- a/apps/server/src/terminalManager.ts +++ b/apps/server/src/terminalManager.ts @@ -69,7 +69,10 @@ interface ShellCandidate { args?: string[]; } -type TerminalStartInput = TerminalOpenInput & { cols: number; rows: number }; +interface TerminalStartInput extends TerminalOpenInput { + cols: number; + rows: number +}; function defaultShellResolver(): string { if (process.platform === "win32") {