@witqq/agent-sdk 0.6.1 → 0.8.0

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 (145) hide show
  1. package/README.md +539 -6
  2. package/dist/{types-BvwNzZCj.d.cts → agent-CW9XbmG_.d.ts} +148 -95
  3. package/dist/{types-BvwNzZCj.d.ts → agent-DxY68NZL.d.cts} +148 -95
  4. package/dist/auth/index.cjs +260 -2
  5. package/dist/auth/index.cjs.map +1 -1
  6. package/dist/auth/index.d.cts +21 -138
  7. package/dist/auth/index.d.ts +21 -138
  8. package/dist/auth/index.js +260 -3
  9. package/dist/auth/index.js.map +1 -1
  10. package/dist/backends/claude.cjs +653 -140
  11. package/dist/backends/claude.cjs.map +1 -1
  12. package/dist/backends/claude.d.cts +4 -1
  13. package/dist/backends/claude.d.ts +4 -1
  14. package/dist/backends/claude.js +653 -140
  15. package/dist/backends/claude.js.map +1 -1
  16. package/dist/backends/copilot.cjs +428 -88
  17. package/dist/backends/copilot.cjs.map +1 -1
  18. package/dist/backends/copilot.d.cts +13 -4
  19. package/dist/backends/copilot.d.ts +13 -4
  20. package/dist/backends/copilot.js +428 -88
  21. package/dist/backends/copilot.js.map +1 -1
  22. package/dist/backends/vercel-ai.cjs +349 -77
  23. package/dist/backends/vercel-ai.cjs.map +1 -1
  24. package/dist/backends/vercel-ai.d.cts +3 -1
  25. package/dist/backends/vercel-ai.d.ts +3 -1
  26. package/dist/backends/vercel-ai.js +349 -77
  27. package/dist/backends/vercel-ai.js.map +1 -1
  28. package/dist/backends-BSrsBYFn.d.cts +39 -0
  29. package/dist/backends-BSrsBYFn.d.ts +39 -0
  30. package/dist/chat/accumulator.cjs +147 -0
  31. package/dist/chat/accumulator.cjs.map +1 -0
  32. package/dist/chat/accumulator.d.cts +64 -0
  33. package/dist/chat/accumulator.d.ts +64 -0
  34. package/dist/chat/accumulator.js +145 -0
  35. package/dist/chat/accumulator.js.map +1 -0
  36. package/dist/chat/backends.cjs +3524 -0
  37. package/dist/chat/backends.cjs.map +1 -0
  38. package/dist/chat/backends.d.cts +66 -0
  39. package/dist/chat/backends.d.ts +66 -0
  40. package/dist/chat/backends.js +3512 -0
  41. package/dist/chat/backends.js.map +1 -0
  42. package/dist/chat/context.cjs +280 -0
  43. package/dist/chat/context.cjs.map +1 -0
  44. package/dist/chat/context.d.cts +191 -0
  45. package/dist/chat/context.d.ts +191 -0
  46. package/dist/chat/context.js +277 -0
  47. package/dist/chat/context.js.map +1 -0
  48. package/dist/chat/core.cjs +305 -0
  49. package/dist/chat/core.cjs.map +1 -0
  50. package/dist/chat/core.d.cts +84 -0
  51. package/dist/chat/core.d.ts +84 -0
  52. package/dist/chat/core.js +282 -0
  53. package/dist/chat/core.js.map +1 -0
  54. package/dist/chat/errors.cjs +273 -0
  55. package/dist/chat/errors.cjs.map +1 -0
  56. package/dist/chat/errors.d.cts +97 -0
  57. package/dist/chat/errors.d.ts +97 -0
  58. package/dist/chat/errors.js +266 -0
  59. package/dist/chat/errors.js.map +1 -0
  60. package/dist/chat/events.cjs +203 -0
  61. package/dist/chat/events.cjs.map +1 -0
  62. package/dist/chat/events.d.cts +245 -0
  63. package/dist/chat/events.d.ts +245 -0
  64. package/dist/chat/events.js +196 -0
  65. package/dist/chat/events.js.map +1 -0
  66. package/dist/chat/index.cjs +5550 -0
  67. package/dist/chat/index.cjs.map +1 -0
  68. package/dist/chat/index.d.cts +77 -0
  69. package/dist/chat/index.d.ts +77 -0
  70. package/dist/chat/index.js +5505 -0
  71. package/dist/chat/index.js.map +1 -0
  72. package/dist/chat/react/theme.css +2517 -0
  73. package/dist/chat/react.cjs +3589 -0
  74. package/dist/chat/react.cjs.map +1 -0
  75. package/dist/chat/react.d.cts +1088 -0
  76. package/dist/chat/react.d.ts +1088 -0
  77. package/dist/chat/react.js +3547 -0
  78. package/dist/chat/react.js.map +1 -0
  79. package/dist/chat/runtime.cjs +1245 -0
  80. package/dist/chat/runtime.cjs.map +1 -0
  81. package/dist/chat/runtime.d.cts +182 -0
  82. package/dist/chat/runtime.d.ts +182 -0
  83. package/dist/chat/runtime.js +1243 -0
  84. package/dist/chat/runtime.js.map +1 -0
  85. package/dist/chat/server.cjs +2668 -0
  86. package/dist/chat/server.cjs.map +1 -0
  87. package/dist/chat/server.d.cts +648 -0
  88. package/dist/chat/server.d.ts +648 -0
  89. package/dist/chat/server.js +2628 -0
  90. package/dist/chat/server.js.map +1 -0
  91. package/dist/chat/sessions.cjs +380 -0
  92. package/dist/chat/sessions.cjs.map +1 -0
  93. package/dist/chat/sessions.d.cts +158 -0
  94. package/dist/chat/sessions.d.ts +158 -0
  95. package/dist/chat/sessions.js +376 -0
  96. package/dist/chat/sessions.js.map +1 -0
  97. package/dist/chat/sqlite.cjs +441 -0
  98. package/dist/chat/sqlite.cjs.map +1 -0
  99. package/dist/chat/sqlite.d.cts +128 -0
  100. package/dist/chat/sqlite.d.ts +128 -0
  101. package/dist/chat/sqlite.js +435 -0
  102. package/dist/chat/sqlite.js.map +1 -0
  103. package/dist/chat/state.cjs +190 -0
  104. package/dist/chat/state.cjs.map +1 -0
  105. package/dist/chat/state.d.cts +95 -0
  106. package/dist/chat/state.d.ts +95 -0
  107. package/dist/chat/state.js +180 -0
  108. package/dist/chat/state.js.map +1 -0
  109. package/dist/chat/storage.cjs +249 -0
  110. package/dist/chat/storage.cjs.map +1 -0
  111. package/dist/chat/storage.d.cts +197 -0
  112. package/dist/chat/storage.d.ts +197 -0
  113. package/dist/chat/storage.js +245 -0
  114. package/dist/chat/storage.js.map +1 -0
  115. package/dist/errors-C-so0M4t.d.cts +33 -0
  116. package/dist/errors-C-so0M4t.d.ts +33 -0
  117. package/dist/errors-CmVvczxZ.d.cts +28 -0
  118. package/dist/errors-CmVvczxZ.d.ts +28 -0
  119. package/dist/in-process-transport-C1JnJGVR.d.ts +228 -0
  120. package/dist/in-process-transport-C7DSqPyX.d.cts +228 -0
  121. package/dist/index.cjs +365 -59
  122. package/dist/index.cjs.map +1 -1
  123. package/dist/index.d.cts +322 -125
  124. package/dist/index.d.ts +322 -125
  125. package/dist/index.js +359 -60
  126. package/dist/index.js.map +1 -1
  127. package/dist/provider-types-PTSlRPNB.d.cts +39 -0
  128. package/dist/provider-types-PTSlRPNB.d.ts +39 -0
  129. package/dist/refresh-manager-B81PpYBr.d.cts +153 -0
  130. package/dist/refresh-manager-Dlv_iNZi.d.ts +153 -0
  131. package/dist/testing.cjs +383 -0
  132. package/dist/testing.cjs.map +1 -0
  133. package/dist/testing.d.cts +132 -0
  134. package/dist/testing.d.ts +132 -0
  135. package/dist/testing.js +377 -0
  136. package/dist/testing.js.map +1 -0
  137. package/dist/token-store-CSUBgYwn.d.ts +48 -0
  138. package/dist/token-store-CuC4hB9Z.d.cts +48 -0
  139. package/dist/transport-Cdh3M0tS.d.cts +68 -0
  140. package/dist/transport-Ciap4PWK.d.ts +68 -0
  141. package/dist/types-4vbcmPTp.d.cts +143 -0
  142. package/dist/types-BxggH0Yh.d.ts +143 -0
  143. package/dist/types-DRgd_9R7.d.cts +363 -0
  144. package/dist/types-ajANVzf7.d.ts +363 -0
  145. package/package.json +178 -6
@@ -1,34 +1,11 @@
1
1
  import { z } from 'zod';
2
-
3
- /** Pluggable store for persisting permission (scope) decisions across runs. */
4
- interface IPermissionStore {
5
- /** Check if tool is already approved */
6
- isApproved(toolName: string): Promise<boolean>;
7
- /** Store an approval decision */
8
- approve(toolName: string, scope: PermissionScope): Promise<void>;
9
- /** Revoke approval for a tool */
10
- revoke(toolName: string): Promise<void>;
11
- /** Clear all approvals */
12
- clear(): Promise<void>;
13
- /** Dispose resources */
14
- dispose(): Promise<void>;
15
- }
2
+ import { E as ErrorCode } from './errors-C-so0M4t.js';
16
3
 
17
4
  /** JSON-serializable value used for tool arguments and results */
18
5
  type JSONValue = string | number | boolean | null | JSONValue[] | {
19
6
  [key: string]: JSONValue;
20
7
  };
21
- /** Message content — plain string or array of text/image parts */
22
- type MessageContent = string | Array<ContentPart>;
23
- /** Individual content part within a multi-part message */
24
- type ContentPart = {
25
- type: "text";
26
- text: string;
27
- } | {
28
- type: "image";
29
- data: string;
30
- mimeType: string;
31
- };
8
+
32
9
  /** What the LLM sees — name, description, schema. Passed to all backends. */
33
10
  interface ToolDeclaration<TParams = unknown> {
34
11
  name: string;
@@ -42,9 +19,19 @@ interface ToolDeclaration<TParams = unknown> {
42
19
  };
43
20
  }
44
21
  /** Full tool with execute function. Required for API-based backends.
45
- * CLI backends extract declaration; execute map held internally. */
22
+ * CLI backends extract declaration; execute map held internally.
23
+ * The optional second parameter receives request-scoped context
24
+ * when invoked through ChatRuntime (session ID, user data, custom metadata). */
46
25
  interface ToolDefinition<TParams = unknown> extends ToolDeclaration<TParams> {
47
- execute: (params: TParams) => Promise<JSONValue> | JSONValue;
26
+ execute: (params: TParams, context?: ToolContext) => Promise<unknown> | unknown;
27
+ }
28
+ /** Request-scoped context passed to tool execute functions via ChatRuntime.
29
+ * Contains session identity and user-defined metadata from the current session. */
30
+ interface ToolContext {
31
+ /** Active chat session ID */
32
+ sessionId: string;
33
+ /** Custom metadata from the session (e.g. user ID, tenant, permissions) */
34
+ custom?: Record<string, unknown>;
48
35
  }
49
36
  /** A tool call made by the LLM during execution */
50
37
  interface ToolCall {
@@ -59,6 +46,18 @@ interface ToolResult {
59
46
  result: JSONValue;
60
47
  isError?: boolean;
61
48
  }
49
+
50
+ /** Message content — plain string or array of text/image parts */
51
+ type MessageContent = string | Array<ContentPart>;
52
+ /** Individual content part within a multi-part message */
53
+ type ContentPart = {
54
+ type: "text";
55
+ text: string;
56
+ } | {
57
+ type: "image";
58
+ data: string;
59
+ mimeType: string;
60
+ };
62
61
  /** Conversation message — discriminated union on `role` */
63
62
  type Message = {
64
63
  role: "user";
@@ -75,12 +74,15 @@ type Message = {
75
74
  role: "system";
76
75
  content: string;
77
76
  };
77
+
78
78
  /** Scope for "remember this decision" */
79
79
  type PermissionScope = "once" | "session" | "project" | "always";
80
80
  /** What the permission callback receives */
81
81
  interface PermissionRequest {
82
82
  toolName: string;
83
83
  toolArgs: Record<string, unknown>;
84
+ /** Unique identifier for this specific tool call */
85
+ toolCallId?: string;
84
86
  /** SDK-suggested scope (from Claude CLI's suggestions) */
85
87
  suggestedScope?: PermissionScope;
86
88
  /** Original SDK permission request (for pass-through) */
@@ -118,12 +120,32 @@ interface SupervisorHooks {
118
120
  onPermission?: PermissionCallback;
119
121
  onAskUser?: (request: UserInputRequest, signal: AbortSignal) => Promise<UserInputResponse>;
120
122
  }
121
- /** Configuration for typed structured output from LLM */
122
- interface StructuredOutputConfig<T = unknown> {
123
- schema: z.ZodType<T>;
123
+
124
+ /** Model metadata returned by listModels() */
125
+ interface ModelInfo {
126
+ id: string;
124
127
  name?: string;
125
- description?: string;
128
+ provider?: string;
129
+ /** Model tier for UI categorization and cost hints */
130
+ tier?: "fast" | "standard" | "premium";
131
+ /** Context window size in tokens */
132
+ contextWindow?: number;
133
+ /** Model capabilities (e.g. "vision", "tools", "structured") */
134
+ capabilities?: string[];
135
+ }
136
+ /** LLM model parameters */
137
+ interface ModelParams {
138
+ temperature?: number;
139
+ maxTokens?: number;
140
+ topP?: number;
141
+ stopSequences?: string[];
142
+ }
143
+ /** Result of backend validation check */
144
+ interface ValidationResult {
145
+ valid: boolean;
146
+ errors: string[];
126
147
  }
148
+
127
149
  /** Usage data from LLM execution — tokens consumed plus optional metadata */
128
150
  interface UsageData {
129
151
  promptTokens: number;
@@ -182,24 +204,78 @@ type AgentEvent = {
182
204
  type: "error";
183
205
  error: string;
184
206
  recoverable: boolean;
207
+ code?: ErrorCode;
185
208
  } | {
186
209
  type: "done";
187
210
  finalOutput: string | null;
188
211
  structuredOutput?: unknown;
212
+ streamed?: boolean;
189
213
  };
190
- /** Options passed to agent.run() / agent.stream() */
191
- interface RunOptions {
192
- /** AbortSignal for cancellation */
214
+
215
+ /** Pluggable store for persisting permission (scope) decisions across runs. */
216
+ interface IPermissionStore {
217
+ /** Check if tool is already approved */
218
+ isApproved(toolName: string): Promise<boolean>;
219
+ /** Store an approval decision */
220
+ approve(toolName: string, scope: PermissionScope): Promise<void>;
221
+ /** Revoke approval for a tool */
222
+ revoke(toolName: string): Promise<void>;
223
+ /** Clear all approvals */
224
+ clear(): Promise<void>;
225
+ /** Dispose resources */
226
+ dispose(): Promise<void>;
227
+ }
228
+
229
+ /** Per-call overrides passed to run(), stream(), runStructured().
230
+ * Allows overriding the model, tools, signal, and other parameters
231
+ * on a per-request basis without modifying the agent configuration. */
232
+ interface CallOptions {
233
+ /** Override the default model for this call */
234
+ model?: string;
235
+ /** Override/extend tools for this call */
236
+ tools?: ToolDefinition[];
237
+ /** Per-call abort signal */
193
238
  signal?: AbortSignal;
239
+ /** Override system message for this call */
240
+ systemMessage?: string;
241
+ /** Provider-specific options passed through to the underlying SDK */
242
+ providerOptions?: Record<string, unknown>;
243
+ /** Per-call timeout in milliseconds */
244
+ timeout?: number;
245
+ /** Per-call token limit */
246
+ maxTokens?: number;
247
+ /** Retry configuration for this call */
248
+ retry?: RetryConfig;
249
+ }
250
+ /** Configuration for automatic retries on transient errors */
251
+ interface RetryConfig {
252
+ /** Maximum number of retries (default: 0 — no retry) */
253
+ maxRetries?: number;
254
+ /** Initial delay in ms before first retry (default: 1000) */
255
+ initialDelayMs?: number;
256
+ /** Backoff multiplier (default: 2) */
257
+ backoffMultiplier?: number;
258
+ /** Which error codes to retry (default: all recoverable codes) */
259
+ retryableErrors?: ErrorCode[];
260
+ }
261
+ /** Configuration for typed structured output from LLM */
262
+ interface StructuredOutputConfig<T = unknown> {
263
+ schema: z.ZodType<T>;
264
+ name?: string;
265
+ description?: string;
266
+ }
267
+ /** Options passed to agent.run() / agent.stream().
268
+ * Extends CallOptions with run-specific fields (context, activityTimeoutMs).
269
+ * model is REQUIRED — every agent call must specify the model explicitly. */
270
+ interface RunOptions extends CallOptions {
271
+ /** Model to use for this call (required — no implicit defaults) */
272
+ model: string;
194
273
  /** Arbitrary context passed to the agent run */
195
274
  context?: Record<string, unknown>;
196
- }
197
- /** LLM model parameters */
198
- interface ModelParams {
199
- temperature?: number;
200
- maxTokens?: number;
201
- topP?: number;
202
- stopSequences?: string[];
275
+ /** Inactivity timeout for streaming (ms). When set, the stream aborts if no
276
+ * event (including heartbeats/progress) arrives within this period. Resets on
277
+ * every received event. Default: no timeout. Only affects stream()/streamWithContext(). */
278
+ activityTimeoutMs?: number;
203
279
  }
204
280
  /** Timeout configuration for agent operations */
205
281
  interface TimeoutConfig {
@@ -224,12 +300,10 @@ interface ErrorHandlingConfig {
224
300
  phase: "tool" | "llm" | "permission" | "ask-user";
225
301
  }) => void;
226
302
  }
227
- /** Configuration for creating an agent */
303
+ /** Identity-only agent configuration defines the agent's behavior, NOT per-call defaults.
304
+ * For creating an agent with model/tools defaults, use FullAgentConfig. */
228
305
  interface AgentConfig {
229
- model?: string;
230
- modelParams?: ModelParams;
231
306
  systemPrompt: string;
232
- tools: ToolDefinition[];
233
307
  supervisor?: SupervisorHooks;
234
308
  maxTurns?: number;
235
309
  timeout?: TimeoutConfig;
@@ -239,8 +313,14 @@ interface AgentConfig {
239
313
  /** How to apply systemPrompt: "append" adds to backend default, "replace" overrides it.
240
314
  * Default: "append". Currently used by the Copilot backend. */
241
315
  systemMessageMode?: "append" | "replace";
242
- /** Filter for backend built-in tools (e.g. ["web_search", "web_fetch"] for Copilot).
243
- * When set, only listed built-in tools are available. Backend-specific. */
316
+ /**
317
+ * Filter for backend built-in tools (e.g. `["web_search", "web_fetch"]` for Copilot).
318
+ * When set, only listed built-in tools are available. Backend-specific.
319
+ *
320
+ * **Security note**: This is a trust boundary — it controls which backend-native tools
321
+ * the AI agent can invoke. By default, backends expose ALL their built-in tools.
322
+ * Set this to restrict access (e.g. prevent file system access in a web-facing agent).
323
+ */
244
324
  availableTools?: string[];
245
325
  /** Callback invoked with usage data after run completion or during streaming.
246
326
  * Fire-and-forget: errors are logged but not propagated. */
@@ -254,11 +334,24 @@ interface AgentConfig {
254
334
  * "persistent": reuses the same CLI session across calls, preserving conversation
255
335
  * history natively in the CLI backend. Session is destroyed on agent dispose(). */
256
336
  sessionMode?: "per-call" | "persistent";
337
+ }
338
+ /** Per-call defaults that can be provided at agent creation time.
339
+ * Each field can also be overridden on individual calls via RunOptions. */
340
+ interface CallDefaults {
341
+ /** Default model (overridable per-call via RunOptions.model) */
342
+ model?: string;
343
+ /** Default model parameters */
344
+ modelParams?: ModelParams;
345
+ /** Default tools (overridable per-call via RunOptions.tools) */
346
+ tools?: ToolDefinition[];
257
347
  /** Provider-specific options passed through to the underlying SDK.
258
348
  * For Vercel AI: passed as providerOptions to generateText/streamText.
259
349
  * Example: { google: { thinkingConfig: { thinkingBudget: 1024 } } } */
260
350
  providerOptions?: Record<string, Record<string, unknown>>;
261
351
  }
352
+ /** Full agent configuration: identity + per-call defaults.
353
+ * This is what createAgent() accepts. Backward-compatible with the old AgentConfig shape. */
354
+ type FullAgentConfig = AgentConfig & CallDefaults;
262
355
  /** Result of an agent run, generic over structured output type T */
263
356
  interface AgentResult<T = void> {
264
357
  output: string | null;
@@ -280,15 +373,15 @@ interface IAgent {
280
373
  * or before the first call. Can be stored externally for session resume. */
281
374
  readonly sessionId: string | undefined;
282
375
  /** Run a single prompt and return the result. Wraps prompt in a user message. */
283
- run(prompt: MessageContent, options?: RunOptions): Promise<AgentResult>;
376
+ run(prompt: MessageContent, options: RunOptions): Promise<AgentResult>;
284
377
  /** Run with full conversation history. Messages are passed directly to the backend. */
285
- runWithContext(messages: Message[], options?: RunOptions): Promise<AgentResult>;
378
+ runWithContext(messages: Message[], options: RunOptions): Promise<AgentResult>;
286
379
  /** Run with structured output validated against a Zod schema. */
287
- runStructured<T>(prompt: MessageContent, schema: StructuredOutputConfig<T>, options?: RunOptions): Promise<AgentResult<T>>;
380
+ runStructured<T>(prompt: MessageContent, schema: StructuredOutputConfig<T>, options: RunOptions): Promise<AgentResult<T>>;
288
381
  /** Stream events for a single prompt. Wraps prompt in a user message. */
289
- stream(prompt: MessageContent, options?: RunOptions): AsyncIterable<AgentEvent>;
382
+ stream(prompt: MessageContent, options: RunOptions): AsyncIterable<AgentEvent>;
290
383
  /** Stream events with full conversation history. Messages are passed directly to the backend. */
291
- streamWithContext(messages: Message[], options?: RunOptions): AsyncIterable<AgentEvent>;
384
+ streamWithContext(messages: Message[], options: RunOptions): AsyncIterable<AgentEvent>;
292
385
  /** Abort the current operation. No-op if not running. */
293
386
  abort(): void;
294
387
  /** Gracefully interrupt the current operation. Resolves when the backend acknowledges. */
@@ -296,57 +389,17 @@ interface IAgent {
296
389
  /** Get current agent lifecycle state. */
297
390
  getState(): AgentState;
298
391
  /** Get frozen agent configuration. */
299
- getConfig(): Readonly<AgentConfig>;
392
+ getConfig(): Readonly<FullAgentConfig>;
300
393
  /** Release resources. After dispose(), agent must not be used. */
301
394
  dispose(): void;
302
395
  }
303
- /** Model metadata returned by listModels() */
304
- interface ModelInfo {
305
- id: string;
306
- name?: string;
307
- provider?: string;
308
- }
309
- /** Result of backend validation check */
310
- interface ValidationResult {
311
- valid: boolean;
312
- errors: string[];
313
- }
314
396
  /** Backend service interface — creates agents, lists models, validates config */
315
397
  interface IAgentService {
316
398
  readonly name: string;
317
- createAgent(config: AgentConfig): IAgent;
399
+ createAgent(config: FullAgentConfig): IAgent;
318
400
  listModels(): Promise<ModelInfo[]>;
319
401
  validate(): Promise<ValidationResult>;
320
402
  dispose(): Promise<void>;
321
403
  }
322
- /** Options for Copilot CLI backend */
323
- interface CopilotBackendOptions {
324
- cliPath?: string;
325
- workingDirectory?: string;
326
- githubToken?: string;
327
- useLoggedInUser?: boolean;
328
- /** Extra CLI arguments passed to the Copilot subprocess (e.g. ["--allow-all"]) */
329
- cliArgs?: string[];
330
- /** Timeout in milliseconds for sendAndWait() calls. When undefined, uses copilot-sdk default (60s). */
331
- timeout?: number;
332
- /** Custom environment variables merged into the subprocess env */
333
- env?: Record<string, string | undefined>;
334
- }
335
- /** Options for Claude CLI backend */
336
- interface ClaudeBackendOptions {
337
- cliPath?: string;
338
- workingDirectory?: string;
339
- maxTurns?: number;
340
- /** OAuth token for Claude authentication (set as CLAUDE_CODE_OAUTH_TOKEN env var) */
341
- oauthToken?: string;
342
- /** Custom environment variables merged into the subprocess env */
343
- env?: Record<string, string | undefined>;
344
- }
345
- /** Options for Vercel AI SDK backend */
346
- interface VercelAIBackendOptions {
347
- apiKey: string;
348
- provider?: string;
349
- baseUrl?: string;
350
- }
351
404
 
352
- export type { CopilotBackendOptions as C, IAgentService as I, VercelAIBackendOptions as V, ClaudeBackendOptions as a };
405
+ export type { AgentEvent as A, FullAgentConfig as F, IAgentService as I, ModelInfo as M, RunOptions as R, ToolDefinition as T, UsageData as U, ValidationResult as V, MessageContent as a, AgentResult as b, IAgent as c, Message as d, ToolResult as e };