| author | |
| committer | |
| log | 060a8cef00dee1728be2fa7cd96ad0332ad15353 |
| tree | c0135ae4f6158347d7ced1980e5f3f078b6a6da7 |
| parent | 5e3678c0af5023d02d938931b9efbb75b7c53f7e |
6 files changed, 21 insertions(+), 20 deletions(-)
apps/server/src/codexTextGenerator.ts+7-5| ... | ... | @@ -12,11 +12,13 @@ import type { |
| 12 | 12 | } from "./coreServices"; |
| 13 | 13 | import { type ProcessRunOptions, type ProcessRunResult, runProcess } from "./processRunner"; |
| 14 | 14 | |
| 15 | type ProcessRunner = ( | |
| 16 | command: string, | |
| 17 | args: readonly string[], | |
| 18 | options?: ProcessRunOptions, | |
| 19 | ) => Promise<ProcessRunResult>; | |
| 15 | interface ProcessRunner { | |
| 16 | ( | |
| 17 | command: string, | |
| 18 | args: readonly string[], | |
| 19 | options?: ProcessRunOptions, | |
| 20 | ): Promise<ProcessRunResult>; | |
| 21 | } | |
| 20 | 22 | |
| 21 | 23 | const CODEX_MODEL = "gpt-5.3-codex"; |
| 22 | 24 | const CODEX_REASONING_EFFORT = "low"; |
apps/server/src/git.ts+6-6| ... | ... | @@ -29,7 +29,7 @@ export interface TerminalCommandInput { |
| 29 | 29 | maxOutputBytes?: number; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | export type TerminalCommandResult = ProcessRunResult; | |
| 32 | ||
| 33 | 33 | |
| 34 | 34 | export interface GitStatusDetails extends Omit<GitStatusResult, "openPr"> { |
| 35 | 35 | upstreamRef: string | null; |
| ... | ... | @@ -159,7 +159,7 @@ function normalizeGitSpawnError(cwd: string, error: unknown): Error { |
| 159 | 159 | return new Error(`Failed to run git command: ${error.message}`); |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | function normalizeGitExecutionError(args: readonly string[], result: TerminalCommandResult): Error { | |
| 162 | function normalizeGitExecutionError(args: readonly string[], result: ProcessRunResult): Error { | |
| 163 | 163 | const stderr = result.stderr.trim(); |
| 164 | 164 | if (stderr.toLowerCase().includes("not a git repository")) { |
| 165 | 165 | return new Error("Current folder is not a git repository."); |
| ... | ... | @@ -176,8 +176,8 @@ async function runGitOrThrow( |
| 176 | 176 | cwd: string, |
| 177 | 177 | args: readonly string[], |
| 178 | 178 | options: RunGitOptions = {}, |
| 179 | ): Promise<TerminalCommandResult> { | |
| 180 | let result: TerminalCommandResult; | |
| 179 | ): Promise<ProcessRunResult> { | |
| 180 | let result: ProcessRunResult; | |
| 181 | 181 | try { |
| 182 | 182 | result = await runGit(args, cwd, options.timeoutMs); |
| 183 | 183 | } catch (error) { |
| ... | ... | @@ -197,7 +197,7 @@ async function executeGit( |
| 197 | 197 | cwd: string, |
| 198 | 198 | args: readonly string[], |
| 199 | 199 | options: ExecuteGitOptions = {}, |
| 200 | ): Promise<TerminalCommandResult> { | |
| 200 | ): Promise<ProcessRunResult> { | |
| 201 | 201 | const result = await runGitOrThrow(cwd, args, { |
| 202 | 202 | timeoutMs: options.timeoutMs, |
| 203 | 203 | allowNonZeroExit: true, |
| ... | ... | @@ -680,7 +680,7 @@ const defaultGitCoreService = new GitCoreService(); |
| 680 | 680 | |
| 681 | 681 | export async function runTerminalCommand( |
| 682 | 682 | input: TerminalCommandInput, |
| 683 | ): Promise<TerminalCommandResult> { | |
| 683 | ): Promise<ProcessRunResult> { | |
| 684 | 684 | const maxOutputBytes = input.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES; |
| 685 | 685 | const shellPath = |
| 686 | 686 | process.platform === "win32" |
apps/server/src/orchestration/Layer.ts+2-2| ... | ... | @@ -17,10 +17,10 @@ import { |
| 17 | 17 | import { createEmptyReadModel, reduceEvent } from "./reducer.ts"; |
| 18 | 18 | import { OrchestrationEngineService, type OrchestrationEngineShape } from "./Service.ts"; |
| 19 | 19 | |
| 20 | type CommandEnvelope = { | |
| 20 | interface CommandEnvelope { | |
| 21 | 21 | command: OrchestrationCommand; |
| 22 | 22 | result: Deferred.Deferred<{ sequence: number }, OrchestrationDispatchError>; |
| 23 | }; | |
| 23 | } | |
| 24 | 24 | |
| 25 | 25 | function mapCommandToEvent(command: OrchestrationCommand): Omit<OrchestrationEvent, "sequence"> { |
| 26 | 26 | const eventId = crypto.randomUUID(); |
apps/server/src/persistence/Layers/OrchestrationEvents.ts+1-3| ... | ... | @@ -30,8 +30,6 @@ const EventRowSchema = Schema.Struct({ |
| 30 | 30 | payloadJson: Schema.String, |
| 31 | 31 | }); |
| 32 | 32 | |
| 33 | type EventRow = Schema.Schema.Type<typeof EventRowSchema>; | |
| 34 | ||
| 35 | 33 | const AppendEventRequestSchema = Schema.Struct({ |
| 36 | 34 | eventId: Schema.String, |
| 37 | 35 | type: Schema.String, |
| ... | ... | @@ -48,7 +46,7 @@ const ReadFromSequenceRequestSchema = Schema.Struct({ |
| 48 | 46 | }); |
| 49 | 47 | |
| 50 | 48 | function eventRowToOrchestrationEvent( |
| 51 | row: EventRow, | |
| 49 | row: Schema.Schema.Type<typeof EventRowSchema>, | |
| 52 | 50 | operation: string, |
| 53 | 51 | ): Effect.Effect<OrchestrationEvent, OrchestrationEventRepositoryError> { |
| 54 | 52 | return Effect.try({ |
apps/server/src/persistence/Layers/Projects.ts+1-3| ... | ... | @@ -44,8 +44,6 @@ const ProjectRowSchema = Schema.Struct({ |
| 44 | 44 | updatedAt: Schema.String, |
| 45 | 45 | }); |
| 46 | 46 | |
| 47 | type ProjectRow = Schema.Schema.Type<typeof ProjectRowSchema>; | |
| 48 | ||
| 49 | 47 | const FindByIdRequestSchema = Schema.Struct({ |
| 50 | 48 | id: Schema.String, |
| 51 | 49 | }); |
| ... | ... | @@ -137,7 +135,7 @@ function decodeScriptsJson( |
| 137 | 135 | } |
| 138 | 136 | |
| 139 | 137 | function rowToProjectRecord( |
| 140 | row: ProjectRow, | |
| 138 | row: Schema.Schema.Type<typeof ProjectRowSchema>, | |
| 141 | 139 | operation: string, |
| 142 | 140 | ): Effect.Effect<ProjectRecord, ProjectRepositoryError> { |
| 143 | 141 | return decodeScriptsJson(row.scriptsJson, `${operation}:scripts`).pipe( |
apps/server/src/terminalManager.ts+4-1| ... | ... | @@ -69,7 +69,10 @@ interface ShellCandidate { |
| 69 | 69 | args?: string[]; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | type TerminalStartInput = TerminalOpenInput & { cols: number; rows: number }; | |
| 72 | interface TerminalStartInput extends TerminalOpenInput { | |
| 73 | cols: number; | |
| 74 | rows: number | |
| 75 | }; | |
| 73 | 76 | |
| 74 | 77 | function defaultShellResolver(): string { |
| 75 | 78 | if (process.platform === "win32") { |