feat(S-201): Define job types and storage interfaces

This commit is contained in:
2026-05-19 19:58:48 -05:00
parent 21c13562a7
commit abf7726071
2 changed files with 54 additions and 12 deletions
+1 -12
View File
@@ -1,8 +1,6 @@
import type { ChildProcess } from "node:child_process";
import { spawn as defaultSpawn } from "node:child_process";
import type { PathLike } from "node:fs";
import { existsSync as defaultExistsSync } from "node:fs";
import type { ClientName, ExecResult, DebugInfo } from "./types.js";
import type { ClientName, ExecResult, DebugInfo, ExecuteOptions } from "./types.js";
import { ClientNotFoundError, ExecError } from "./types.js";
const CLIENT_ARGS: Record<ClientName, (prompt: string) => string[]> = {
@@ -11,15 +9,6 @@ const CLIENT_ARGS: Record<ClientName, (prompt: string) => string[]> = {
opencode: (p) => ["run", "--dangerously-skip-permissions", p],
};
export interface ExecuteOptions {
clientPath?: string;
timeoutMs?: number;
debug?: boolean;
onDebug?: (info: DebugInfo) => void;
spawn?: (command: string, args: string[], options?: { shell?: boolean }) => ChildProcess;
existsSync?: (path: PathLike) => boolean;
}
export async function executePrompt(
client: ClientName,
prompt: string,