feat(S-201): Define job types and storage interfaces
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user