feat(S-201): Create src/types.ts with shared type definitions
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user