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