From 47f555a367169fd5e535da394d92d8a624299c87 Mon Sep 17 00:00:00 2001 From: Stefano Fiorini Date: Mon, 18 May 2026 17:38:35 -0500 Subject: [PATCH] feat(S-201): Create src/types.ts with shared type definitions --- tools/ai-cli-dispatch/src/types.ts | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tools/ai-cli-dispatch/src/types.ts diff --git a/tools/ai-cli-dispatch/src/types.ts b/tools/ai-cli-dispatch/src/types.ts new file mode 100644 index 0000000..3338814 --- /dev/null +++ b/tools/ai-cli-dispatch/src/types.ts @@ -0,0 +1,36 @@ +export type ClientName = "codex" | "claude" | "opencode"; + +export interface ClientInfo { + name: ClientName; + path?: string; + version?: string; + found: boolean; +} + +export interface ExecResult { + stdout: string; + stderr: string; + exitCode: number; +} + +export interface ToolConfig { + clients: ClientName[]; + defaultClient?: ClientName; +} + +export class ClientNotFoundError extends Error { + constructor(client: string) { + super(`Client "${client}" not found or not installed.`); + this.name = "ClientNotFoundError"; + } +} + +export class ExecError extends Error { + readonly result: ExecResult; + + constructor(message: string, result: ExecResult) { + super(message); + this.name = "ExecError"; + this.result = result; + } +}