Agents: add pluggable CLIs
Co-authored-by: RealSid08 <RealSid08@users.noreply.github.com>
This commit is contained in:
1 parent
52c311e47f
commit
f31e89d5af
15 files changed
+624
-150
No files matched your search
@@ -0,0 +1,42 @@
|
||||
export type AgentKind = "claude" | "opencode" | "pi" | "codex";
|
||||
|
||||
export type AgentMeta = {
|
||||
model?: string;
|
||||
provider?: string;
|
||||
stopReason?: string;
|
||||
usage?: {
|
||||
input?: number;
|
||||
output?: number;
|
||||
cacheRead?: number;
|
||||
cacheWrite?: number;
|
||||
total?: number;
|
||||
};
|
||||
extra?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export type AgentParseResult = {
|
||||
text?: string;
|
||||
mediaUrls?: string[];
|
||||
meta?: AgentMeta;
|
||||
};
|
||||
|
||||
export type BuildArgsContext = {
|
||||
argv: string[];
|
||||
bodyIndex: number; // index of prompt/body argument in argv
|
||||
isNewSession: boolean;
|
||||
sessionId?: string;
|
||||
sendSystemOnce: boolean;
|
||||
systemSent: boolean;
|
||||
identityPrefix?: string;
|
||||
format?: "text" | "json";
|
||||
sessionArgNew?: string[];
|
||||
sessionArgResume?: string[];
|
||||
};
|
||||
|
||||
export interface AgentSpec {
|
||||
kind: AgentKind;
|
||||
isInvocation: (argv: string[]) => boolean;
|
||||
buildArgs: (ctx: BuildArgsContext) => string[];
|
||||
parseOutput: (rawStdout: string) => AgentParseResult;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user