@agentex/agent 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/README.md +405 -87
  2. package/dist/index.d.ts +18 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +11 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/providers/claude/execute.d.ts.map +1 -1
  7. package/dist/providers/claude/execute.js +51 -18
  8. package/dist/providers/claude/execute.js.map +1 -1
  9. package/dist/providers/claude/index.d.ts.map +1 -1
  10. package/dist/providers/claude/index.js +37 -8
  11. package/dist/providers/claude/index.js.map +1 -1
  12. package/dist/providers/claude/parse.d.ts.map +1 -1
  13. package/dist/providers/claude/parse.js +2 -1
  14. package/dist/providers/claude/parse.js.map +1 -1
  15. package/dist/providers/claude/session.d.ts +10 -0
  16. package/dist/providers/claude/session.d.ts.map +1 -0
  17. package/dist/providers/claude/session.js +549 -0
  18. package/dist/providers/claude/session.js.map +1 -0
  19. package/dist/providers/claude/test.d.ts.map +1 -1
  20. package/dist/providers/claude/test.js +38 -11
  21. package/dist/providers/claude/test.js.map +1 -1
  22. package/dist/providers/codex/execute.d.ts.map +1 -1
  23. package/dist/providers/codex/execute.js +122 -74
  24. package/dist/providers/codex/execute.js.map +1 -1
  25. package/dist/providers/codex/index.d.ts.map +1 -1
  26. package/dist/providers/codex/index.js +56 -2
  27. package/dist/providers/codex/index.js.map +1 -1
  28. package/dist/providers/codex/parse.d.ts.map +1 -1
  29. package/dist/providers/codex/parse.js +25 -3
  30. package/dist/providers/codex/parse.js.map +1 -1
  31. package/dist/providers/codex/session.d.ts +3 -0
  32. package/dist/providers/codex/session.d.ts.map +1 -0
  33. package/dist/providers/codex/session.js +553 -0
  34. package/dist/providers/codex/session.js.map +1 -0
  35. package/dist/providers/codex/test.d.ts.map +1 -1
  36. package/dist/providers/codex/test.js +28 -12
  37. package/dist/providers/codex/test.js.map +1 -1
  38. package/dist/providers/codex/usage-scanner.d.ts +18 -0
  39. package/dist/providers/codex/usage-scanner.d.ts.map +1 -0
  40. package/dist/providers/codex/usage-scanner.js +148 -0
  41. package/dist/providers/codex/usage-scanner.js.map +1 -0
  42. package/dist/providers/cursor/codec.d.ts +3 -0
  43. package/dist/providers/cursor/codec.d.ts.map +1 -0
  44. package/dist/providers/cursor/codec.js +43 -0
  45. package/dist/providers/cursor/codec.js.map +1 -0
  46. package/dist/providers/cursor/execute.d.ts +3 -0
  47. package/dist/providers/cursor/execute.d.ts.map +1 -0
  48. package/dist/providers/cursor/execute.js +248 -0
  49. package/dist/providers/cursor/execute.js.map +1 -0
  50. package/dist/providers/cursor/index.d.ts +3 -0
  51. package/dist/providers/cursor/index.d.ts.map +1 -0
  52. package/dist/providers/cursor/index.js +28 -0
  53. package/dist/providers/cursor/index.js.map +1 -0
  54. package/dist/providers/cursor/parse.d.ts +26 -0
  55. package/dist/providers/cursor/parse.d.ts.map +1 -0
  56. package/dist/providers/cursor/parse.js +224 -0
  57. package/dist/providers/cursor/parse.js.map +1 -0
  58. package/dist/providers/cursor/test.d.ts +3 -0
  59. package/dist/providers/cursor/test.d.ts.map +1 -0
  60. package/dist/providers/cursor/test.js +58 -0
  61. package/dist/providers/cursor/test.js.map +1 -0
  62. package/dist/providers/gemini/codec.d.ts +3 -0
  63. package/dist/providers/gemini/codec.d.ts.map +1 -0
  64. package/dist/providers/gemini/codec.js +47 -0
  65. package/dist/providers/gemini/codec.js.map +1 -0
  66. package/dist/providers/gemini/execute.d.ts +3 -0
  67. package/dist/providers/gemini/execute.d.ts.map +1 -0
  68. package/dist/providers/gemini/execute.js +236 -0
  69. package/dist/providers/gemini/execute.js.map +1 -0
  70. package/dist/providers/gemini/index.d.ts +3 -0
  71. package/dist/providers/gemini/index.d.ts.map +1 -0
  72. package/dist/providers/gemini/index.js +62 -0
  73. package/dist/providers/gemini/index.js.map +1 -0
  74. package/dist/providers/gemini/parse.d.ts +20 -0
  75. package/dist/providers/gemini/parse.d.ts.map +1 -0
  76. package/dist/providers/gemini/parse.js +207 -0
  77. package/dist/providers/gemini/parse.js.map +1 -0
  78. package/dist/providers/gemini/test.d.ts +3 -0
  79. package/dist/providers/gemini/test.d.ts.map +1 -0
  80. package/dist/providers/gemini/test.js +67 -0
  81. package/dist/providers/gemini/test.js.map +1 -0
  82. package/dist/providers/openclaw/execute.d.ts.map +1 -1
  83. package/dist/providers/openclaw/execute.js +10 -5
  84. package/dist/providers/openclaw/execute.js.map +1 -1
  85. package/dist/providers/openclaw/index.d.ts.map +1 -1
  86. package/dist/providers/openclaw/index.js +15 -2
  87. package/dist/providers/openclaw/index.js.map +1 -1
  88. package/dist/providers/openclaw/test.d.ts.map +1 -1
  89. package/dist/providers/openclaw/test.js +4 -0
  90. package/dist/providers/openclaw/test.js.map +1 -1
  91. package/dist/providers/opencode/codec.d.ts +3 -0
  92. package/dist/providers/opencode/codec.d.ts.map +1 -0
  93. package/dist/providers/opencode/codec.js +47 -0
  94. package/dist/providers/opencode/codec.js.map +1 -0
  95. package/dist/providers/opencode/execute.d.ts +3 -0
  96. package/dist/providers/opencode/execute.d.ts.map +1 -0
  97. package/dist/providers/opencode/execute.js +225 -0
  98. package/dist/providers/opencode/execute.js.map +1 -0
  99. package/dist/providers/opencode/index.d.ts +3 -0
  100. package/dist/providers/opencode/index.d.ts.map +1 -0
  101. package/dist/providers/opencode/index.js +62 -0
  102. package/dist/providers/opencode/index.js.map +1 -0
  103. package/dist/providers/opencode/parse.d.ts +19 -0
  104. package/dist/providers/opencode/parse.d.ts.map +1 -0
  105. package/dist/providers/opencode/parse.js +145 -0
  106. package/dist/providers/opencode/parse.js.map +1 -0
  107. package/dist/providers/opencode/test.d.ts +3 -0
  108. package/dist/providers/opencode/test.d.ts.map +1 -0
  109. package/dist/providers/opencode/test.js +60 -0
  110. package/dist/providers/opencode/test.js.map +1 -0
  111. package/dist/providers/pi/codec.d.ts +7 -0
  112. package/dist/providers/pi/codec.d.ts.map +1 -0
  113. package/dist/providers/pi/codec.js +45 -0
  114. package/dist/providers/pi/codec.js.map +1 -0
  115. package/dist/providers/pi/execute.d.ts +3 -0
  116. package/dist/providers/pi/execute.d.ts.map +1 -0
  117. package/dist/providers/pi/execute.js +300 -0
  118. package/dist/providers/pi/execute.js.map +1 -0
  119. package/dist/providers/pi/index.d.ts +3 -0
  120. package/dist/providers/pi/index.d.ts.map +1 -0
  121. package/dist/providers/pi/index.js +64 -0
  122. package/dist/providers/pi/index.js.map +1 -0
  123. package/dist/providers/pi/parse.d.ts +18 -0
  124. package/dist/providers/pi/parse.d.ts.map +1 -0
  125. package/dist/providers/pi/parse.js +182 -0
  126. package/dist/providers/pi/parse.js.map +1 -0
  127. package/dist/providers/pi/test.d.ts +3 -0
  128. package/dist/providers/pi/test.d.ts.map +1 -0
  129. package/dist/providers/pi/test.js +60 -0
  130. package/dist/providers/pi/test.js.map +1 -0
  131. package/dist/providers/process/execute.d.ts.map +1 -1
  132. package/dist/providers/process/execute.js +45 -7
  133. package/dist/providers/process/execute.js.map +1 -1
  134. package/dist/providers/process/index.d.ts.map +1 -1
  135. package/dist/providers/process/index.js +27 -30
  136. package/dist/providers/process/index.js.map +1 -1
  137. package/dist/registry.d.ts.map +1 -1
  138. package/dist/registry.js +8 -0
  139. package/dist/registry.js.map +1 -1
  140. package/dist/types.d.ts +379 -22
  141. package/dist/types.d.ts.map +1 -1
  142. package/dist/types.js +23 -1
  143. package/dist/types.js.map +1 -1
  144. package/dist/utils/ask-user-question.d.ts +50 -0
  145. package/dist/utils/ask-user-question.d.ts.map +1 -0
  146. package/dist/utils/ask-user-question.js +32 -0
  147. package/dist/utils/ask-user-question.js.map +1 -0
  148. package/dist/utils/auth.d.ts +22 -0
  149. package/dist/utils/auth.d.ts.map +1 -0
  150. package/dist/utils/auth.js +497 -0
  151. package/dist/utils/auth.js.map +1 -0
  152. package/dist/utils/binary.d.ts.map +1 -1
  153. package/dist/utils/binary.js +29 -6
  154. package/dist/utils/binary.js.map +1 -1
  155. package/dist/utils/env.d.ts.map +1 -1
  156. package/dist/utils/env.js +18 -0
  157. package/dist/utils/env.js.map +1 -1
  158. package/dist/utils/execute-all.d.ts +20 -0
  159. package/dist/utils/execute-all.d.ts.map +1 -0
  160. package/dist/utils/execute-all.js +46 -0
  161. package/dist/utils/execute-all.js.map +1 -0
  162. package/dist/utils/instructions.d.ts +7 -0
  163. package/dist/utils/instructions.d.ts.map +1 -0
  164. package/dist/utils/instructions.js +21 -0
  165. package/dist/utils/instructions.js.map +1 -0
  166. package/dist/utils/model-cache.d.ts +11 -0
  167. package/dist/utils/model-cache.d.ts.map +1 -0
  168. package/dist/utils/model-cache.js +17 -0
  169. package/dist/utils/model-cache.js.map +1 -0
  170. package/dist/utils/process.d.ts +4 -0
  171. package/dist/utils/process.d.ts.map +1 -1
  172. package/dist/utils/process.js +46 -5
  173. package/dist/utils/process.js.map +1 -1
  174. package/dist/utils/runtime-config.d.ts +34 -0
  175. package/dist/utils/runtime-config.d.ts.map +1 -0
  176. package/dist/utils/runtime-config.js +71 -0
  177. package/dist/utils/runtime-config.js.map +1 -0
  178. package/dist/utils/runtime-homes.d.ts +13 -0
  179. package/dist/utils/runtime-homes.d.ts.map +1 -0
  180. package/dist/utils/runtime-homes.js +41 -0
  181. package/dist/utils/runtime-homes.js.map +1 -0
  182. package/dist/utils/skills.d.ts +152 -1
  183. package/dist/utils/skills.d.ts.map +1 -1
  184. package/dist/utils/skills.js +352 -0
  185. package/dist/utils/skills.js.map +1 -1
  186. package/dist/utils/workspace.d.ts +55 -0
  187. package/dist/utils/workspace.d.ts.map +1 -0
  188. package/dist/utils/workspace.js +89 -0
  189. package/dist/utils/workspace.js.map +1 -0
  190. package/package.json +5 -2
package/dist/types.d.ts CHANGED
@@ -1,9 +1,38 @@
1
+ /** Static declaration of what a provider supports. */
2
+ export interface ProviderCapabilities {
3
+ sessions: boolean;
4
+ modelDiscovery: boolean;
5
+ quotaProbing: boolean;
6
+ mcp: boolean;
7
+ skills: boolean;
8
+ instructions: boolean;
9
+ workspace: boolean;
10
+ }
1
11
  export interface ProviderModule {
2
12
  type: string;
13
+ capabilities: ProviderCapabilities;
3
14
  execute(ctx: ExecutionContext): Promise<ExecutionResult>;
4
- testEnvironment(ctx: EnvironmentTestContext): Promise<EnvironmentTestResult>;
15
+ createSession?(ctx: SessionContext): Promise<AgentSession>;
16
+ /**
17
+ * Single source of truth for "is this provider usable?" Returns binary
18
+ * status, every supported auth path with present: boolean, and (when
19
+ * available) rich identity info (email, org, subscription tier).
20
+ *
21
+ * Prefers the CLI's own status subcommand (e.g. `claude auth status --json`,
22
+ * `codex login status`) for definitive truth, falling back to filesystem
23
+ * heuristics if the binary is missing or too old.
24
+ *
25
+ * Results are cached for 60s per provider+env; pass `{ fresh: true }` to
26
+ * bypass the cache.
27
+ */
28
+ resolveAuth(ctx?: AuthResolveContext): Promise<AuthReport>;
5
29
  sessionCodec?: SessionCodec;
6
- listModels?(): Promise<ProviderModel[]>;
30
+ /** List available models. Pass cacheTtlMs to cache results (0 = no cache, default). */
31
+ listModels?(options?: {
32
+ cacheTtlMs?: number;
33
+ }): Promise<ProviderModel[]>;
34
+ /** Check current quota/rate limit status. Not all providers support this. */
35
+ checkQuota?(ctx: QuotaContext): Promise<QuotaStatus>;
7
36
  }
8
37
  export interface ExecutionContext {
9
38
  prompt: string;
@@ -15,6 +44,12 @@ export interface ExecutionContext {
15
44
  config?: ProviderConfig;
16
45
  onOutput?: (stream: "stdout" | "stderr", chunk: string) => void | Promise<void>;
17
46
  onEvent?: (event: StreamEvent) => void | Promise<void>;
47
+ onStart?: (pid: number) => void;
48
+ /** AbortSignal to cancel execution. When aborted, the process receives SIGTERM
49
+ * followed by SIGKILL after the grace period. */
50
+ signal?: AbortSignal;
51
+ /** Called at key execution lifecycle phases (preparing, spawning, running, etc.). */
52
+ onLifecycle?: (event: LifecycleEvent) => void;
18
53
  }
19
54
  export interface ProviderConfig {
20
55
  command?: string;
@@ -28,30 +63,71 @@ export interface ProviderConfig {
28
63
  instructionsFile?: string;
29
64
  mcpServers?: McpServerConfig[];
30
65
  extraArgs?: string[];
66
+ search?: boolean;
67
+ sandbox?: boolean;
68
+ thinking?: string;
69
+ mode?: string;
70
+ /** Run the agent in an isolated workspace. The library creates a worktree
71
+ * before execution and uses it as the working directory. */
72
+ workspace?: {
73
+ strategy: "worktree";
74
+ baseBranch?: string;
75
+ branchName?: string;
76
+ };
77
+ }
78
+ export interface QuotaStatus {
79
+ /** Whether the provider currently has available capacity */
80
+ available: boolean;
81
+ /** Remaining tokens in current window, if known */
82
+ remainingTokens?: number;
83
+ /** When the current rate limit window resets, if known */
84
+ resetAt?: string;
85
+ /** Billing type detected */
86
+ billingType: "api" | "subscription" | "metered_api";
87
+ /** Additional provider-specific info */
88
+ detail?: Record<string, unknown>;
89
+ }
90
+ export interface QuotaContext {
91
+ config?: ProviderConfig;
92
+ env?: Record<string, string>;
31
93
  }
94
+ /** Final outcome of a single-turn execution. */
95
+ export type ExecutionStatus = "completed" | "failed" | "aborted" | "timeout" | "blocked";
96
+ /** Live state of an interactive session. */
97
+ export type SessionState = "idle" | "thinking" | "tool_executing" | "waiting_for_approval" | "waiting_for_input" | "closed";
98
+ /** Token usage for a single model within a run. */
99
+ export interface TokenUsage {
100
+ inputTokens: number;
101
+ outputTokens: number;
102
+ cachedInputTokens?: number;
103
+ cacheCreationInputTokens?: number;
104
+ }
105
+ /**
106
+ * Get aggregate usage across all models. Convenience for when you don't
107
+ * care about per-model breakdown.
108
+ */
109
+ export declare function aggregateUsage(usage: Record<string, TokenUsage> | undefined): TokenUsage | null;
32
110
  export interface ExecutionResult {
33
111
  runId: string;
34
112
  exitCode: number | null;
35
113
  signal: string | null;
36
- timedOut: boolean;
114
+ status: ExecutionStatus;
37
115
  startedAt: string;
38
116
  completedAt: string;
39
117
  durationMs: number;
40
118
  errorMessage: string | null;
41
119
  errorCode: string | null;
42
- usage?: {
43
- inputTokens: number;
44
- outputTokens: number;
45
- cachedInputTokens?: number;
46
- };
120
+ usage?: Record<string, TokenUsage>;
47
121
  costUsd: number | null;
48
122
  model: string | null;
49
123
  summary: string | null;
50
124
  sessionParams: Record<string, unknown> | null;
51
125
  sessionDisplayId: string | null;
52
126
  clearSession: boolean;
53
- billingType: "api" | "subscription" | null;
127
+ billingType: "api" | "subscription" | "metered_api" | null;
54
128
  raw?: Record<string, unknown> | null;
129
+ /** If the run used a workspace, this contains the workspace handle for diffing/cleanup */
130
+ workspace?: import("./utils/workspace.js").PreparedWorkspace;
55
131
  }
56
132
  export type StreamEvent = {
57
133
  type: "system";
@@ -69,6 +145,7 @@ export type StreamEvent = {
69
145
  timestamp: string;
70
146
  } | {
71
147
  type: "tool_call";
148
+ callId?: string;
72
149
  name: string;
73
150
  input: unknown;
74
151
  timestamp: string;
@@ -85,27 +162,133 @@ export type StreamEvent = {
85
162
  isError: boolean;
86
163
  timestamp: string;
87
164
  };
165
+ export type LifecycleEvent = {
166
+ phase: "preparing";
167
+ step: "workspace" | "skills" | "auth" | "instructions" | "binary";
168
+ } | {
169
+ phase: "spawning";
170
+ } | {
171
+ phase: "running";
172
+ pid: number;
173
+ } | {
174
+ phase: "waiting_for_input";
175
+ request: UserInputRequest;
176
+ } | {
177
+ phase: "completed";
178
+ } | {
179
+ phase: "cancelled";
180
+ } | {
181
+ phase: "error";
182
+ message: string;
183
+ };
88
184
  export interface SessionCodec {
89
185
  deserialize(raw: unknown): Record<string, unknown> | null;
90
186
  serialize(params: Record<string, unknown> | null): Record<string, unknown> | null;
91
187
  getDisplayId?(params: Record<string, unknown> | null): string | null;
92
188
  }
93
- export interface EnvironmentTestContext {
94
- providerType: string;
95
- config?: Record<string, unknown>;
189
+ /** How a provider is authenticated. Determines billing behavior at runtime. */
190
+ export type AuthMethod = "api_key" | "bedrock" | "subscription";
191
+ /** Where an auth credential lives. */
192
+ export type AuthSource =
193
+ /** Single environment variable, e.g. OPENAI_API_KEY. */
194
+ {
195
+ kind: "env";
196
+ var: string;
197
+ }
198
+ /** Multiple env vars that together form one credential, e.g. AWS creds. */
199
+ | {
200
+ kind: "env_combo";
201
+ vars: string[];
202
+ }
203
+ /** A file on disk, e.g. ~/.codex/auth.json. Path is already resolved. */
204
+ | {
205
+ kind: "file";
206
+ path: string;
207
+ }
208
+ /** macOS keychain entry. */
209
+ | {
210
+ kind: "keychain";
211
+ service: string;
212
+ account?: string;
213
+ }
214
+ /** Determined by spawning a CLI status command. */
215
+ | {
216
+ kind: "cli";
217
+ command: string;
218
+ };
219
+ /**
220
+ * One auth path this provider supports, with its current presence state.
221
+ *
222
+ * `present` is boolean: true if the credential is confirmed present,
223
+ * false otherwise. Previously `"unknown"` was a third state for macOS
224
+ * keychain; the CLI-status approach replaces it with definitive truth.
225
+ */
226
+ export interface AuthOption {
227
+ method: AuthMethod;
228
+ source: AuthSource;
229
+ present: boolean;
230
+ }
231
+ /** Binary status for a provider's CLI. */
232
+ export interface BinaryStatus {
233
+ installed: boolean;
234
+ /** Resolved absolute path to the binary, when installed. */
235
+ resolvedPath?: string;
236
+ /** Version string from `<cli> --version`, when we could parse one. */
237
+ version?: string;
238
+ /** Error message when installed=false (e.g. "command not found"). */
239
+ error?: string;
96
240
  }
97
- export interface EnvironmentTestResult {
241
+ /**
242
+ * Rich identity info reported by the CLI's own auth-status command.
243
+ * Only populated for providers that expose this (currently Claude;
244
+ * Codex exposes a limited version).
245
+ */
246
+ export interface AuthIdentity {
247
+ /** Email address of the logged-in account, when known. */
248
+ email?: string;
249
+ /** Organization / team name, when known. */
250
+ orgName?: string;
251
+ /**
252
+ * Subscription tier as reported by the CLI (e.g. "max", "pro", "team",
253
+ * "enterprise"). Provider-specific free-form string.
254
+ */
255
+ subscriptionType?: string;
256
+ /**
257
+ * Active auth method as reported by the CLI (e.g. "claude.ai",
258
+ * "chatgpt", "api_key", "bedrock"). Provider-specific free-form string.
259
+ * Distinct from AuthMethod, which is the normalized billing-mode
260
+ * category.
261
+ */
262
+ authMethod?: string;
263
+ }
264
+ /** Full auth report for a provider. */
265
+ export interface AuthReport {
98
266
  providerType: string;
99
- status: "pass" | "warn" | "fail";
100
- checks: EnvironmentCheck[];
101
- testedAt: string;
267
+ /** Whether the CLI binary is installed and what we know about it. */
268
+ binary: BinaryStatus;
269
+ /**
270
+ * Every auth path this provider supports, with current presence state.
271
+ * Empty when the binary is missing (there's nothing to report against).
272
+ */
273
+ options: AuthOption[];
274
+ /** Rich identity info from the CLI's status output, when available. */
275
+ identity?: AuthIdentity;
276
+ /**
277
+ * Where the presence data came from:
278
+ * - "cli": parsed from a live `<cli> auth status` call (definitive)
279
+ * - "filesystem": best-effort heuristic from env vars and files
280
+ * (used when the binary is missing or its status subcommand failed)
281
+ */
282
+ source: "cli" | "filesystem";
102
283
  }
103
- export interface EnvironmentCheck {
104
- code: string;
105
- level: "info" | "warn" | "error";
106
- message: string;
107
- detail?: string;
108
- hint?: string;
284
+ /** Optional context for auth resolution. */
285
+ export interface AuthResolveContext {
286
+ /** Additional env vars layered on top of process.env. */
287
+ env?: Record<string, string>;
288
+ /** Override the CLI binary path (passed through to findBinary). */
289
+ command?: string;
290
+ /** Bypass the 60s result cache and refresh from source. */
291
+ fresh?: boolean;
109
292
  }
110
293
  export interface ProviderModel {
111
294
  id: string;
@@ -118,4 +301,178 @@ export interface McpServerConfig {
118
301
  args?: string[];
119
302
  env?: Record<string, string>;
120
303
  }
304
+ /** Context for creating a persistent multi-turn session. */
305
+ export interface SessionContext {
306
+ cwd?: string;
307
+ env?: Record<string, string>;
308
+ config?: ProviderConfig;
309
+ /** Resume an existing session. If omitted, starts fresh. */
310
+ sessionParams?: Record<string, unknown> | null;
311
+ /** AbortSignal to cancel the session. When aborted, the session is closed
312
+ * and the underlying process is terminated. */
313
+ signal?: AbortSignal;
314
+ /** Called for every stream event across all turns. */
315
+ onEvent?: (event: StreamEvent) => void | Promise<void>;
316
+ /** Called for raw stdout/stderr output across all turns. */
317
+ onOutput?: (stream: "stdout" | "stderr", chunk: string) => void | Promise<void>;
318
+ /** Called at key execution lifecycle phases (preparing, spawning, running, etc.). */
319
+ onLifecycle?: (event: LifecycleEvent) => void;
320
+ /**
321
+ * Called when the agent needs confirmation or user input before proceeding
322
+ * with a tool call. This covers both regular tool permissions (e.g. Bash,
323
+ * Write) and interactive tools like AskUserQuestion.
324
+ *
325
+ * Use `parseAskUserQuestion(req)` to detect structured question prompts
326
+ * and return answers via `updatedInput`.
327
+ *
328
+ * Return `{ allow: true }` to proceed, `{ allow: false }` to deny.
329
+ * If not provided, all tool calls are auto-allowed.
330
+ */
331
+ onUserInputRequest?: (req: UserInputRequest) => Promise<UserInputResponse>;
332
+ /**
333
+ * Called when an MCP server requests user input (form fields, multiple
334
+ * choice, URL, etc.). Return `{ action: "accept", content: {...} }` to
335
+ * provide the input, `{ action: "decline" }` to refuse, or
336
+ * `{ action: "cancel" }` to abort the current turn.
337
+ *
338
+ * If not provided, all elicitations are declined.
339
+ */
340
+ onElicitation?: (req: ElicitationRequest) => Promise<ElicitationResponse>;
341
+ /**
342
+ * Called when the CLI needs the host to run a hook callback.
343
+ * If not provided, hook callbacks return an empty result.
344
+ */
345
+ onHookCallback?: (req: HookCallbackRequest) => Promise<HookCallbackResponse>;
346
+ }
347
+ /** A persistent session handle for multi-turn conversations. */
348
+ export interface AgentSession {
349
+ readonly sessionId: string | null;
350
+ readonly state: SessionState;
351
+ /** Send a user message and wait for the agent's turn to complete. */
352
+ send(message: string): Promise<TurnResult>;
353
+ /** Gracefully interrupt the current turn. */
354
+ interrupt(): Promise<void>;
355
+ /** Terminate the session and kill the underlying process. */
356
+ close(): Promise<void>;
357
+ }
358
+ /** Result of a single turn within a session. */
359
+ export interface TurnResult {
360
+ summary: string | null;
361
+ usage?: Record<string, TokenUsage>;
362
+ costUsd: number | null;
363
+ status: "completed" | "failed" | "max_turns" | "max_budget" | "aborted";
364
+ errorCode: string | null;
365
+ errorMessage: string | null;
366
+ }
367
+ /**
368
+ * Describes a tool the agent wants to use and needs confirmation or user
369
+ * input before proceeding. This is the unified callback for both regular
370
+ * tool permissions (Bash, Write, etc.) and interactive tools like
371
+ * AskUserQuestion.
372
+ *
373
+ * For AskUserQuestion, use `parseAskUserQuestion(req)` to extract the
374
+ * structured questions and return answers via `updatedInput`.
375
+ */
376
+ export interface UserInputRequest {
377
+ toolName: string;
378
+ input: Record<string, unknown>;
379
+ toolUseId: string;
380
+ /** Human-readable title for the tool action. */
381
+ title?: string;
382
+ /** Display name of the tool. */
383
+ displayName?: string;
384
+ /** Why the agent decided to use this tool. */
385
+ description?: string;
386
+ /** ID of the sub-agent making the request, if any. */
387
+ agentId?: string;
388
+ }
389
+ /** Host response to a tool request. */
390
+ export interface UserInputResponse {
391
+ allow: boolean;
392
+ message?: string;
393
+ /** Optionally modify the tool's input before execution (e.g. answers for AskUserQuestion). */
394
+ updatedInput?: Record<string, unknown>;
395
+ }
396
+ /**
397
+ * Sent when a server (typically an MCP tool-server running inside the Claude
398
+ * process) needs user input. The request can represent anything from a simple
399
+ * yes/no confirmation to a rich multi-field form combining dropdowns,
400
+ * checkboxes, text fields, and number inputs.
401
+ *
402
+ * The `requestedSchema` is a standard JSON Schema (type: "object") whose
403
+ * `properties` define the form fields. Supported property types:
404
+ *
405
+ * | Schema pattern | Renders as |
406
+ * |---|---|
407
+ * | `{ "type": "string", "oneOf": [{ "const": "a", "title": "A" }, ...] }` | Single-select dropdown / radio |
408
+ * | `{ "type": "string", "enum": ["x", "y"] }` | Single-select (legacy) |
409
+ * | `{ "type": "array", "items": { "anyOf": [{ "const": "a" }, ...] } }` | Multi-select checkboxes |
410
+ * | `{ "type": "string" }` | Freeform text input |
411
+ * | `{ "type": "string", "format": "email" \| "uri" \| "date" }` | Validated text input |
412
+ * | `{ "type": "integer", "minimum": 1, "maximum": 10 }` | Number input |
413
+ * | `{ "type": "boolean" }` | Toggle / checkbox |
414
+ *
415
+ * A single form can mix all of these — e.g., a dropdown for language, checkboxes
416
+ * for features, and a freeform "notes" field.
417
+ *
418
+ * **Example — multiple choice + freeform:**
419
+ * ```json
420
+ * { "type": "object", "properties": {
421
+ * "framework": { "type": "string", "oneOf": [
422
+ * { "const": "express", "title": "Express" },
423
+ * { "const": "fastify", "title": "Fastify" },
424
+ * { "const": "hono", "title": "Hono" }
425
+ * ]},
426
+ * "features": { "type": "array", "items": {
427
+ * "anyOf": [
428
+ * { "const": "auth", "title": "Authentication" },
429
+ * { "const": "db", "title": "Database" },
430
+ * { "const": "ws", "title": "WebSockets" }
431
+ * ]
432
+ * }},
433
+ * "notes": { "type": "string" }
434
+ * },
435
+ * "required": ["framework"]
436
+ * }
437
+ * ```
438
+ */
439
+ export interface ElicitationRequest {
440
+ /**
441
+ * Name of the MCP server requesting input. Maps to the `mcp_server_name`
442
+ * field in the Claude protocol. Display this so the user knows which
443
+ * server is asking for input.
444
+ */
445
+ mcpServerName: string;
446
+ /** Human-readable prompt describing what input is needed. */
447
+ message: string;
448
+ /** How to present the request: "form" for inline input, "url" to open a browser. */
449
+ mode?: "form" | "url";
450
+ /** URL to open when mode is "url". */
451
+ url?: string;
452
+ /** Unique ID for this elicitation, used for deduplication. */
453
+ elicitationId?: string;
454
+ /**
455
+ * JSON Schema (type: "object") describing the expected input. Each property
456
+ * in `properties` is a form field. See the type-level JSDoc for the full
457
+ * list of supported property types and examples.
458
+ */
459
+ requestedSchema?: Record<string, unknown>;
460
+ }
461
+ /** Host response to an elicitation request. */
462
+ export interface ElicitationResponse {
463
+ /** "accept" to provide content, "decline" to refuse, "cancel" to abort the turn. */
464
+ action: "accept" | "decline" | "cancel";
465
+ /** The user's input, matching the requestedSchema. Only required when action is "accept". */
466
+ content?: Record<string, unknown>;
467
+ }
468
+ /** Sent when the CLI needs the host to execute a hook callback. */
469
+ export interface HookCallbackRequest {
470
+ callbackId: string;
471
+ input: Record<string, unknown>;
472
+ toolUseId?: string;
473
+ }
474
+ /** Host response to a hook callback. */
475
+ export interface HookCallbackResponse {
476
+ result?: Record<string, unknown>;
477
+ }
121
478
  //# sourceMappingURL=types.d.ts.map
@@ -1 +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,MAAM,CAAC;CAClB;AAED,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACtB,sCAAsC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IAClC,oFAAoF;IACpF,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACxC,6FAA6F;IAC7F,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAMD,mEAAmE;AACnE,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wCAAwC;AACxC,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC"}
package/dist/types.js CHANGED
@@ -1,2 +1,24 @@
1
- export {};
1
+ /**
2
+ * Get aggregate usage across all models. Convenience for when you don't
3
+ * care about per-model breakdown.
4
+ */
5
+ export function aggregateUsage(usage) {
6
+ if (!usage)
7
+ return null;
8
+ const entries = Object.values(usage);
9
+ if (entries.length === 0)
10
+ return null;
11
+ const result = { inputTokens: 0, outputTokens: 0 };
12
+ for (const u of entries) {
13
+ result.inputTokens += u.inputTokens;
14
+ result.outputTokens += u.outputTokens;
15
+ if (u.cachedInputTokens != null) {
16
+ result.cachedInputTokens = (result.cachedInputTokens ?? 0) + u.cachedInputTokens;
17
+ }
18
+ if (u.cacheCreationInputTokens != null) {
19
+ result.cacheCreationInputTokens = (result.cacheCreationInputTokens ?? 0) + u.cacheCreationInputTokens;
20
+ }
21
+ }
22
+ return result;
23
+ }
2
24
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAyIA;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAA6C;IAC1E,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,MAAM,GAAe,EAAE,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;IAC/D,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,CAAC;QACpC,MAAM,CAAC,YAAY,IAAI,CAAC,CAAC,YAAY,CAAC;QACtC,IAAI,CAAC,CAAC,iBAAiB,IAAI,IAAI,EAAE,CAAC;YAChC,MAAM,CAAC,iBAAiB,GAAG,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,iBAAiB,CAAC;QACnF,CAAC;QACD,IAAI,CAAC,CAAC,wBAAwB,IAAI,IAAI,EAAE,CAAC;YACvC,MAAM,CAAC,wBAAwB,GAAG,CAAC,MAAM,CAAC,wBAAwB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,wBAAwB,CAAC;QACxG,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,50 @@
1
+ import type { UserInputRequest } from "../types.js";
2
+ /**
3
+ * Structured option within an AskUserQuestion prompt.
4
+ */
5
+ export interface QuestionOption {
6
+ label: string;
7
+ description: string;
8
+ /** Optional preview/detail content for the option. */
9
+ preview?: string;
10
+ }
11
+ /**
12
+ * A single question from the AskUserQuestion tool.
13
+ *
14
+ * Claude uses this tool to ask the user structured questions — for example,
15
+ * choosing between implementation approaches in plan mode. Each question has
16
+ * 2-4 predefined options. Apps typically add a freeform "Other" option when
17
+ * rendering.
18
+ */
19
+ export interface AskUserQuestion {
20
+ question: string;
21
+ header: string;
22
+ options: QuestionOption[];
23
+ /** When true, the user can select multiple options. */
24
+ multiSelect?: boolean;
25
+ }
26
+ /**
27
+ * Parse an AskUserQuestion tool call from a UserInputRequest.
28
+ *
29
+ * Returns the structured questions array if this is an AskUserQuestion request,
30
+ * or `null` if it's a regular tool request.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * onUserInputRequest: async (req) => {
35
+ * const questions = parseAskUserQuestion(req);
36
+ * if (questions) {
37
+ * // Render choices UI, collect answers
38
+ * const answers: Record<string, string> = {};
39
+ * for (const q of questions) {
40
+ * answers[q.question] = await showChoiceUI(q.options);
41
+ * }
42
+ * return { allow: true, updatedInput: { ...req.input, answers } };
43
+ * }
44
+ * // Handle as regular tool request
45
+ * return { allow: true };
46
+ * }
47
+ * ```
48
+ */
49
+ export declare function parseAskUserQuestion(req: UserInputRequest): AskUserQuestion[] | null;
50
+ //# sourceMappingURL=ask-user-question.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask-user-question.d.ts","sourceRoot":"","sources":["../../src/utils/ask-user-question.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,uDAAuD;IACvD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,gBAAgB,GAAG,eAAe,EAAE,GAAG,IAAI,CAKpF"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Parse an AskUserQuestion tool call from a UserInputRequest.
3
+ *
4
+ * Returns the structured questions array if this is an AskUserQuestion request,
5
+ * or `null` if it's a regular tool request.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * onUserInputRequest: async (req) => {
10
+ * const questions = parseAskUserQuestion(req);
11
+ * if (questions) {
12
+ * // Render choices UI, collect answers
13
+ * const answers: Record<string, string> = {};
14
+ * for (const q of questions) {
15
+ * answers[q.question] = await showChoiceUI(q.options);
16
+ * }
17
+ * return { allow: true, updatedInput: { ...req.input, answers } };
18
+ * }
19
+ * // Handle as regular tool request
20
+ * return { allow: true };
21
+ * }
22
+ * ```
23
+ */
24
+ export function parseAskUserQuestion(req) {
25
+ if (req.toolName !== "AskUserQuestion")
26
+ return null;
27
+ const questions = req.input["questions"];
28
+ if (!Array.isArray(questions) || questions.length === 0)
29
+ return null;
30
+ return questions;
31
+ }
32
+ //# sourceMappingURL=ask-user-question.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask-user-question.js","sourceRoot":"","sources":["../../src/utils/ask-user-question.ts"],"names":[],"mappings":"AA4BA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAqB;IACxD,IAAI,GAAG,CAAC,QAAQ,KAAK,iBAAiB;QAAE,OAAO,IAAI,CAAC;IACpD,MAAM,SAAS,GAAI,GAAG,CAAC,KAAiC,CAAC,WAAW,CAAC,CAAC;IACtE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrE,OAAO,SAA8B,CAAC;AACxC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { AuthReport, AuthResolveContext, ProviderModule } from "../types.js";
2
+ export interface ResolvedAuth {
3
+ method: "api_key" | "bedrock" | "oauth" | "subscription";
4
+ billingType: "api" | "metered_api" | "subscription";
5
+ resolveModelId?(requestedModel: string): string;
6
+ region?: string;
7
+ }
8
+ export declare function detectAuth(providerType: string, env: Record<string, string>): ResolvedAuth;
9
+ /**
10
+ * Resolve the auth report for a provider by type. Cached for 60s per
11
+ * (providerType, env, command). Pass `{ fresh: true }` to bypass the cache.
12
+ */
13
+ export declare function resolveAuthForProvider(providerType: string, ctx?: AuthResolveContext): Promise<AuthReport>;
14
+ /** Clear the resolveAuth cache. Primarily for tests and explicit refresh. */
15
+ export declare function clearAuthCache(): void;
16
+ /** True only if a subscription credential is confirmed present. */
17
+ export declare function hasSubscription(provider: ProviderModule, ctx?: AuthResolveContext): Promise<boolean>;
18
+ /** True only if an API key is confirmed set in the env. */
19
+ export declare function hasApiKey(provider: ProviderModule, ctx?: AuthResolveContext): Promise<boolean>;
20
+ /** True only if Bedrock credentials are confirmed present in the env. */
21
+ export declare function hasBedrock(provider: ProviderModule, ctx?: AuthResolveContext): Promise<boolean>;
22
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/utils/auth.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,UAAU,EACV,kBAAkB,EAElB,cAAc,EACf,MAAM,aAAa,CAAC;AAUrB,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC;IACzD,WAAW,EAAE,KAAK,GAAG,aAAa,GAAG,cAAc,CAAC;IACpD,cAAc,CAAC,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAAC;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAoCD,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,YAAY,CAyC1F;AAuaD;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,YAAY,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,kBAAkB,GACvB,OAAO,CAAC,UAAU,CAAC,CAcrB;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,IAAI,IAAI,CAErC;AAWD,mEAAmE;AACnE,wBAAsB,eAAe,CACnC,QAAQ,EAAE,cAAc,EACxB,GAAG,CAAC,EAAE,kBAAkB,GACvB,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED,2DAA2D;AAC3D,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,cAAc,EACxB,GAAG,CAAC,EAAE,kBAAkB,GACvB,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED,yEAAyE;AACzE,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,cAAc,EACxB,GAAG,CAAC,EAAE,kBAAkB,GACvB,OAAO,CAAC,OAAO,CAAC,CAGlB"}