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 {
1212} from "./coreServices";
1313import { type ProcessRunOptions, type ProcessRunResult, runProcess } from "./processRunner";
1414
15type ProcessRunner = (
16 command: string,
17 args: readonly string[],
18 options?: ProcessRunOptions,
19) => Promise<ProcessRunResult>;
15interface ProcessRunner {
16 (
17 command: string,
18 args: readonly string[],
19 options?: ProcessRunOptions,
20 ): Promise<ProcessRunResult>;
21}
2022
2123const CODEX_MODEL = "gpt-5.3-codex";
2224const CODEX_REASONING_EFFORT = "low";
apps/server/src/git.ts+6-6
......@@ -29,7 +29,7 @@ export interface TerminalCommandInput {
2929 maxOutputBytes?: number;
3030}
3131
32export type TerminalCommandResult = ProcessRunResult;
32
3333
3434export interface GitStatusDetails extends Omit<GitStatusResult, "openPr"> {
3535 upstreamRef: string | null;
......@@ -159,7 +159,7 @@ function normalizeGitSpawnError(cwd: string, error: unknown): Error {
159159 return new Error(`Failed to run git command: ${error.message}`);
160160}
161161
162function normalizeGitExecutionError(args: readonly string[], result: TerminalCommandResult): Error {
162function normalizeGitExecutionError(args: readonly string[], result: ProcessRunResult): Error {
163163 const stderr = result.stderr.trim();
164164 if (stderr.toLowerCase().includes("not a git repository")) {
165165 return new Error("Current folder is not a git repository.");
......@@ -176,8 +176,8 @@ async function runGitOrThrow(
176176 cwd: string,
177177 args: readonly string[],
178178 options: RunGitOptions = {},
179): Promise<TerminalCommandResult> {
180 let result: TerminalCommandResult;
179): Promise<ProcessRunResult> {
180 let result: ProcessRunResult;
181181 try {
182182 result = await runGit(args, cwd, options.timeoutMs);
183183 } catch (error) {
......@@ -197,7 +197,7 @@ async function executeGit(
197197 cwd: string,
198198 args: readonly string[],
199199 options: ExecuteGitOptions = {},
200): Promise<TerminalCommandResult> {
200): Promise<ProcessRunResult> {
201201 const result = await runGitOrThrow(cwd, args, {
202202 timeoutMs: options.timeoutMs,
203203 allowNonZeroExit: true,
......@@ -680,7 +680,7 @@ const defaultGitCoreService = new GitCoreService();
680680
681681export async function runTerminalCommand(
682682 input: TerminalCommandInput,
683): Promise<TerminalCommandResult> {
683): Promise<ProcessRunResult> {
684684 const maxOutputBytes = input.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES;
685685 const shellPath =
686686 process.platform === "win32"
apps/server/src/orchestration/Layer.ts+2-2
......@@ -17,10 +17,10 @@ import {
1717import { createEmptyReadModel, reduceEvent } from "./reducer.ts";
1818import { OrchestrationEngineService, type OrchestrationEngineShape } from "./Service.ts";
1919
20type CommandEnvelope = {
20interface CommandEnvelope {
2121 command: OrchestrationCommand;
2222 result: Deferred.Deferred<{ sequence: number }, OrchestrationDispatchError>;
23};
23}
2424
2525function mapCommandToEvent(command: OrchestrationCommand): Omit<OrchestrationEvent, "sequence"> {
2626 const eventId = crypto.randomUUID();
apps/server/src/persistence/Layers/OrchestrationEvents.ts+1-3
......@@ -30,8 +30,6 @@ const EventRowSchema = Schema.Struct({
3030 payloadJson: Schema.String,
3131});
3232
33type EventRow = Schema.Schema.Type<typeof EventRowSchema>;
34
3533const AppendEventRequestSchema = Schema.Struct({
3634 eventId: Schema.String,
3735 type: Schema.String,
......@@ -48,7 +46,7 @@ const ReadFromSequenceRequestSchema = Schema.Struct({
4846});
4947
5048function eventRowToOrchestrationEvent(
51 row: EventRow,
49 row: Schema.Schema.Type<typeof EventRowSchema>,
5250 operation: string,
5351): Effect.Effect<OrchestrationEvent, OrchestrationEventRepositoryError> {
5452 return Effect.try({
apps/server/src/persistence/Layers/Projects.ts+1-3
......@@ -44,8 +44,6 @@ const ProjectRowSchema = Schema.Struct({
4444 updatedAt: Schema.String,
4545});
4646
47type ProjectRow = Schema.Schema.Type<typeof ProjectRowSchema>;
48
4947const FindByIdRequestSchema = Schema.Struct({
5048 id: Schema.String,
5149});
......@@ -137,7 +135,7 @@ function decodeScriptsJson(
137135}
138136
139137function rowToProjectRecord(
140 row: ProjectRow,
138 row: Schema.Schema.Type<typeof ProjectRowSchema>,
141139 operation: string,
142140): Effect.Effect<ProjectRecord, ProjectRepositoryError> {
143141 return decodeScriptsJson(row.scriptsJson, `${operation}:scripts`).pipe(
apps/server/src/terminalManager.ts+4-1
......@@ -69,7 +69,10 @@ interface ShellCandidate {
6969 args?: string[];
7070}
7171
72type TerminalStartInput = TerminalOpenInput & { cols: number; rows: number };
72interface TerminalStartInput extends TerminalOpenInput {
73 cols: number;
74 rows: number
75};
7376
7477function defaultShellResolver(): string {
7578 if (process.platform === "win32") {