authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-22 11:13:45-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-02-26 13:20:36-08:00
log060a8cef00dee1728be2fa7cd96ad0332ad15353
treec0135ae4f6158347d7ced1980e5f3f078b6a6da7
parent5e3678c0af5023d02d938931b9efbb75b7c53f7e

fmt


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";
13import { type ProcessRunOptions, type ProcessRunResult, runProcess } from "./processRunner";13import { type ProcessRunOptions, type ProcessRunResult, runProcess } from "./processRunner";
1414
15type ProcessRunner = (15interface 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}
2022
21const CODEX_MODEL = "gpt-5.3-codex";23const CODEX_MODEL = "gpt-5.3-codex";
22const CODEX_REASONING_EFFORT = "low";24const 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}
3131
32export type TerminalCommandResult = ProcessRunResult;32
3333
34export interface GitStatusDetails extends Omit<GitStatusResult, "openPr"> {34export 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}
161161
162function normalizeGitExecutionError(args: readonly string[], result: TerminalCommandResult): Error {162function 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();
680680
681export async function runTerminalCommand(681export 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 {
17import { createEmptyReadModel, reduceEvent } from "./reducer.ts";17import { createEmptyReadModel, reduceEvent } from "./reducer.ts";
18import { OrchestrationEngineService, type OrchestrationEngineShape } from "./Service.ts";18import { OrchestrationEngineService, type OrchestrationEngineShape } from "./Service.ts";
1919
20type CommandEnvelope = {20interface CommandEnvelope {
21 command: OrchestrationCommand;21 command: OrchestrationCommand;
22 result: Deferred.Deferred<{ sequence: number }, OrchestrationDispatchError>;22 result: Deferred.Deferred<{ sequence: number }, OrchestrationDispatchError>;
23};23}
2424
25function mapCommandToEvent(command: OrchestrationCommand): Omit<OrchestrationEvent, "sequence"> {25function 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});
3232
33type EventRow = Schema.Schema.Type<typeof EventRowSchema>;
34
35const AppendEventRequestSchema = Schema.Struct({33const 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});
4947
50function eventRowToOrchestrationEvent(48function 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});
4646
47type ProjectRow = Schema.Schema.Type<typeof ProjectRowSchema>;
48
49const FindByIdRequestSchema = Schema.Struct({47const 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}
138136
139function rowToProjectRecord(137function 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}
7171
72type TerminalStartInput = TerminalOpenInput & { cols: number; rows: number };72interface TerminalStartInput extends TerminalOpenInput {
73 cols: number;
74 rows: number
75};
7376
74function defaultShellResolver(): string {77function defaultShellResolver(): string {
75 if (process.platform === "win32") {78 if (process.platform === "win32") {