fmt
This commit is contained in:
1 parent
5e3678c0af
commit
060a8cef00
6 files changed
+21
-20
No files matched your search
@@ -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<ProcessRunResult>;
|
||||
interface ProcessRunner {
|
||||
(
|
||||
command: string,
|
||||
args: readonly string[],
|
||||
options?: ProcessRunOptions,
|
||||
): Promise<ProcessRunResult>;
|
||||
}
|
||||
|
||||
const CODEX_MODEL = "gpt-5.3-codex";
|
||||
const CODEX_REASONING_EFFORT = "low";
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface TerminalCommandInput {
|
||||
maxOutputBytes?: number;
|
||||
}
|
||||
|
||||
export type TerminalCommandResult = ProcessRunResult;
|
||||
|
||||
|
||||
export interface GitStatusDetails extends Omit<GitStatusResult, "openPr"> {
|
||||
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<TerminalCommandResult> {
|
||||
let result: TerminalCommandResult;
|
||||
): Promise<ProcessRunResult> {
|
||||
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<TerminalCommandResult> {
|
||||
): Promise<ProcessRunResult> {
|
||||
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<TerminalCommandResult> {
|
||||
): Promise<ProcessRunResult> {
|
||||
const maxOutputBytes = input.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES;
|
||||
const shellPath =
|
||||
process.platform === "win32"
|
||||
|
||||
@@ -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<OrchestrationEvent, "sequence"> {
|
||||
const eventId = crypto.randomUUID();
|
||||
|
||||
@@ -30,8 +30,6 @@ const EventRowSchema = Schema.Struct({
|
||||
payloadJson: Schema.String,
|
||||
});
|
||||
|
||||
type EventRow = Schema.Schema.Type<typeof EventRowSchema>;
|
||||
|
||||
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<typeof EventRowSchema>,
|
||||
operation: string,
|
||||
): Effect.Effect<OrchestrationEvent, OrchestrationEventRepositoryError> {
|
||||
return Effect.try({
|
||||
|
||||
@@ -44,8 +44,6 @@ const ProjectRowSchema = Schema.Struct({
|
||||
updatedAt: Schema.String,
|
||||
});
|
||||
|
||||
type ProjectRow = Schema.Schema.Type<typeof ProjectRowSchema>;
|
||||
|
||||
const FindByIdRequestSchema = Schema.Struct({
|
||||
id: Schema.String,
|
||||
});
|
||||
@@ -137,7 +135,7 @@ function decodeScriptsJson(
|
||||
}
|
||||
|
||||
function rowToProjectRecord(
|
||||
row: ProjectRow,
|
||||
row: Schema.Schema.Type<typeof ProjectRowSchema>,
|
||||
operation: string,
|
||||
): Effect.Effect<ProjectRecord, ProjectRepositoryError> {
|
||||
return decodeScriptsJson(row.scriptsJson, `${operation}:scripts`).pipe(
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in new issue
Block a user