@copilotkitnext/core 1.51.4 → 1.51.5-next.1

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.
package/dist/index.d.mts CHANGED
@@ -1,676 +1,709 @@
1
- import * as _ag_ui_client from '@ag-ui/client';
2
- import { ToolCall, AbstractAgent, RunAgentResult, Tool, Context, State, Message, HttpAgent, HttpAgentConfig, RunAgentInput, BaseEvent } from '@ag-ui/client';
3
- import { z } from 'zod';
4
- import { Observable } from 'rxjs';
1
+ import * as _ag_ui_client0 from "@ag-ui/client";
2
+ import { AbstractAgent, BaseEvent, Context, HttpAgent, HttpAgentConfig, Message, RunAgentInput, RunAgentResult, State, Tool, ToolCall } from "@ag-ui/client";
3
+ import { Observable } from "rxjs";
4
+ import { z } from "zod";
5
5
 
6
+ //#region src/types.d.ts
6
7
  /**
7
8
  * Status of a tool call execution
8
9
  */
9
10
  declare enum ToolCallStatus {
10
- InProgress = "inProgress",
11
- Executing = "executing",
12
- Complete = "complete"
11
+ InProgress = "inProgress",
12
+ Executing = "executing",
13
+ Complete = "complete"
13
14
  }
14
15
  type CopilotRuntimeTransport = "rest" | "single";
15
16
  /**
16
17
  * Context passed to a frontend tool handler
17
18
  */
18
19
  type FrontendToolHandlerContext = {
19
- toolCall: ToolCall;
20
- agent: AbstractAgent;
20
+ toolCall: ToolCall;
21
+ agent: AbstractAgent;
21
22
  };
22
23
  type FrontendTool<T extends Record<string, unknown> = Record<string, unknown>> = {
23
- name: string;
24
- description?: string;
25
- parameters?: z.ZodType<T>;
26
- handler?: (args: T, context: FrontendToolHandlerContext) => Promise<unknown>;
27
- followUp?: boolean;
28
- /**
29
- * Optional agent ID to constrain this tool to a specific agent.
30
- * If specified, this tool will only be available to the specified agent.
31
- */
32
- agentId?: string;
24
+ name: string;
25
+ description?: string;
26
+ parameters?: z.ZodType<T>;
27
+ handler?: (args: T, context: FrontendToolHandlerContext) => Promise<unknown>;
28
+ followUp?: boolean;
29
+ /**
30
+ * Optional agent ID to constrain this tool to a specific agent.
31
+ * If specified, this tool will only be available to the specified agent.
32
+ */
33
+ agentId?: string;
34
+ /**
35
+ * Whether this tool is available to the agent.
36
+ * Set to false to hide the tool from the agent without unregistering it.
37
+ * Defaults to true when not specified.
38
+ */
39
+ available?: boolean;
33
40
  };
34
41
  type Suggestion = {
35
- title: string;
36
- message: string;
37
- /** Indicates whether this suggestion is still being generated. */
38
- isLoading: boolean;
42
+ title: string;
43
+ message: string; /** Indicates whether this suggestion is still being generated. */
44
+ isLoading: boolean;
39
45
  };
40
46
  type SuggestionAvailability = "before-first-message" | "after-first-message" | "always" | "disabled";
41
47
  type DynamicSuggestionsConfig = {
42
- /**
43
- * A prompt or instructions for the GPT to generate suggestions.
44
- */
45
- instructions: string;
46
- /**
47
- * The minimum number of suggestions to generate. Defaults to `1`.
48
- * @default 1
49
- */
50
- minSuggestions?: number;
51
- /**
52
- * The maximum number of suggestions to generate. Defaults to `3`.
53
- * @default 1
54
- */
55
- maxSuggestions?: number;
56
- /**
57
- * When the suggestions are available. Defaults to "after-first-message".
58
- */
59
- available?: SuggestionAvailability;
60
- /**
61
- * The agent ID of the provider of the suggestions. Defaults to `"default"`.
62
- */
63
- providerAgentId?: string;
64
- /**
65
- * The agent ID of the consumer of the suggestions. Defaults to `"*"` (all agents).
66
- */
67
- consumerAgentId?: string;
48
+ /**
49
+ * A prompt or instructions for the GPT to generate suggestions.
50
+ */
51
+ instructions: string;
52
+ /**
53
+ * The minimum number of suggestions to generate. Defaults to `1`.
54
+ * @default 1
55
+ */
56
+ minSuggestions?: number;
57
+ /**
58
+ * The maximum number of suggestions to generate. Defaults to `3`.
59
+ * @default 1
60
+ */
61
+ maxSuggestions?: number;
62
+ /**
63
+ * When the suggestions are available. Defaults to "after-first-message".
64
+ */
65
+ available?: SuggestionAvailability;
66
+ /**
67
+ * The agent ID of the provider of the suggestions. Defaults to `"default"`.
68
+ */
69
+ providerAgentId?: string;
70
+ /**
71
+ * The agent ID of the consumer of the suggestions. Defaults to `"*"` (all agents).
72
+ */
73
+ consumerAgentId?: string;
68
74
  };
69
75
  type StaticSuggestionsConfig = {
70
- /**
71
- * The suggestions to display.
72
- */
73
- suggestions: Omit<Suggestion, "isLoading">[];
74
- /**
75
- * When the suggestions are available. Defaults to "before-first-message".
76
- */
77
- available?: SuggestionAvailability;
78
- /**
79
- * The agent ID of the consumer of the suggestions. Defaults to `"*"` (all agents).
80
- */
81
- consumerAgentId?: string;
76
+ /**
77
+ * The suggestions to display.
78
+ */
79
+ suggestions: Omit<Suggestion, "isLoading">[];
80
+ /**
81
+ * When the suggestions are available. Defaults to "before-first-message".
82
+ */
83
+ available?: SuggestionAvailability;
84
+ /**
85
+ * The agent ID of the consumer of the suggestions. Defaults to `"*"` (all agents).
86
+ */
87
+ consumerAgentId?: string;
82
88
  };
83
89
  type SuggestionsConfig = DynamicSuggestionsConfig | StaticSuggestionsConfig;
84
-
90
+ //#endregion
91
+ //#region src/core/agent-registry.d.ts
85
92
  interface CopilotKitCoreAddAgentParams {
86
- id: string;
87
- agent: AbstractAgent;
93
+ id: string;
94
+ agent: AbstractAgent;
88
95
  }
89
96
  /**
90
97
  * Manages agent registration, lifecycle, and runtime connectivity for CopilotKitCore.
91
98
  * Handles both local development agents and remote runtime agents.
92
99
  */
93
100
  declare class AgentRegistry {
94
- private core;
95
- private _agents;
96
- private localAgents;
97
- private remoteAgents;
98
- private _runtimeUrl?;
99
- private _runtimeVersion?;
100
- private _runtimeConnectionStatus;
101
- private _runtimeTransport;
102
- private _audioFileTranscriptionEnabled;
103
- constructor(core: CopilotKitCore);
104
- /**
105
- * Get all agents as a readonly record
106
- */
107
- get agents(): Readonly<Record<string, AbstractAgent>>;
108
- get runtimeUrl(): string | undefined;
109
- get runtimeVersion(): string | undefined;
110
- get runtimeConnectionStatus(): CopilotKitCoreRuntimeConnectionStatus;
111
- get runtimeTransport(): CopilotRuntimeTransport;
112
- get audioFileTranscriptionEnabled(): boolean;
113
- /**
114
- * Initialize agents from configuration
115
- */
116
- initialize(agents: Record<string, AbstractAgent>): void;
117
- /**
118
- * Set the runtime URL and update connection
119
- */
120
- setRuntimeUrl(runtimeUrl: string | undefined): void;
121
- setRuntimeTransport(runtimeTransport: CopilotRuntimeTransport): void;
122
- /**
123
- * Set all agents at once (for development use)
124
- */
125
- setAgents__unsafe_dev_only(agents: Record<string, AbstractAgent>): void;
126
- /**
127
- * Add a single agent (for development use)
128
- */
129
- addAgent__unsafe_dev_only({ id, agent }: CopilotKitCoreAddAgentParams): void;
130
- /**
131
- * Remove an agent by ID (for development use)
132
- */
133
- removeAgent__unsafe_dev_only(id: string): void;
134
- /**
135
- * Get an agent by ID
136
- */
137
- getAgent(id: string): AbstractAgent | undefined;
138
- /**
139
- * Apply current headers to an agent
140
- */
141
- applyHeadersToAgent(agent: AbstractAgent): void;
142
- /**
143
- * Apply current headers to all agents
144
- */
145
- applyHeadersToAgents(agents: Record<string, AbstractAgent>): void;
146
- /**
147
- * Apply current credentials to an agent
148
- */
149
- applyCredentialsToAgent(agent: AbstractAgent): void;
150
- /**
151
- * Apply current credentials to all agents
152
- */
153
- applyCredentialsToAgents(agents: Record<string, AbstractAgent>): void;
154
- /**
155
- * Update runtime connection and fetch remote agents
156
- */
157
- private updateRuntimeConnection;
158
- private fetchRuntimeInfo;
159
- /**
160
- * Assign agent IDs to a record of agents
161
- */
162
- private assignAgentIds;
163
- /**
164
- * Validate and assign an agent ID
165
- */
166
- private validateAndAssignAgentId;
167
- /**
168
- * Notify subscribers of runtime status changes
169
- */
170
- private notifyRuntimeStatusChanged;
171
- /**
172
- * Notify subscribers of agent changes
173
- */
174
- private notifyAgentsChanged;
101
+ private core;
102
+ private _agents;
103
+ private localAgents;
104
+ private remoteAgents;
105
+ private _runtimeUrl?;
106
+ private _runtimeVersion?;
107
+ private _runtimeConnectionStatus;
108
+ private _runtimeTransport;
109
+ private _audioFileTranscriptionEnabled;
110
+ constructor(core: CopilotKitCore);
111
+ /**
112
+ * Get all agents as a readonly record
113
+ */
114
+ get agents(): Readonly<Record<string, AbstractAgent>>;
115
+ get runtimeUrl(): string | undefined;
116
+ get runtimeVersion(): string | undefined;
117
+ get runtimeConnectionStatus(): CopilotKitCoreRuntimeConnectionStatus;
118
+ get runtimeTransport(): CopilotRuntimeTransport;
119
+ get audioFileTranscriptionEnabled(): boolean;
120
+ /**
121
+ * Initialize agents from configuration
122
+ */
123
+ initialize(agents: Record<string, AbstractAgent>): void;
124
+ /**
125
+ * Set the runtime URL and update connection
126
+ */
127
+ setRuntimeUrl(runtimeUrl: string | undefined): void;
128
+ setRuntimeTransport(runtimeTransport: CopilotRuntimeTransport): void;
129
+ /**
130
+ * Set all agents at once (for development use)
131
+ */
132
+ setAgents__unsafe_dev_only(agents: Record<string, AbstractAgent>): void;
133
+ /**
134
+ * Add a single agent (for development use)
135
+ */
136
+ addAgent__unsafe_dev_only({
137
+ id,
138
+ agent
139
+ }: CopilotKitCoreAddAgentParams): void;
140
+ /**
141
+ * Remove an agent by ID (for development use)
142
+ */
143
+ removeAgent__unsafe_dev_only(id: string): void;
144
+ /**
145
+ * Get an agent by ID
146
+ */
147
+ getAgent(id: string): AbstractAgent | undefined;
148
+ /**
149
+ * Apply current headers to an agent
150
+ */
151
+ applyHeadersToAgent(agent: AbstractAgent): void;
152
+ /**
153
+ * Apply current headers to all agents
154
+ */
155
+ applyHeadersToAgents(agents: Record<string, AbstractAgent>): void;
156
+ /**
157
+ * Apply current credentials to an agent
158
+ */
159
+ applyCredentialsToAgent(agent: AbstractAgent): void;
160
+ /**
161
+ * Apply current credentials to all agents
162
+ */
163
+ applyCredentialsToAgents(agents: Record<string, AbstractAgent>): void;
164
+ /**
165
+ * Update runtime connection and fetch remote agents
166
+ */
167
+ private updateRuntimeConnection;
168
+ private fetchRuntimeInfo;
169
+ /**
170
+ * Assign agent IDs to a record of agents
171
+ */
172
+ private assignAgentIds;
173
+ /**
174
+ * Validate and assign an agent ID
175
+ */
176
+ private validateAndAssignAgentId;
177
+ /**
178
+ * Notify subscribers of runtime status changes
179
+ */
180
+ private notifyRuntimeStatusChanged;
181
+ /**
182
+ * Notify subscribers of agent changes
183
+ */
184
+ private notifyAgentsChanged;
175
185
  }
176
-
186
+ //#endregion
187
+ //#region src/core/run-handler.d.ts
177
188
  interface CopilotKitCoreRunAgentParams {
178
- agent: AbstractAgent;
189
+ agent: AbstractAgent;
179
190
  }
180
191
  interface CopilotKitCoreConnectAgentParams {
181
- agent: AbstractAgent;
192
+ agent: AbstractAgent;
182
193
  }
183
194
  interface CopilotKitCoreGetToolParams {
184
- toolName: string;
185
- agentId?: string;
195
+ toolName: string;
196
+ agentId?: string;
186
197
  }
187
198
  /**
188
199
  * Handles agent execution, tool calling, and agent connectivity for CopilotKitCore.
189
200
  * Manages the complete lifecycle of agent runs including tool execution and follow-ups.
190
201
  */
191
202
  declare class RunHandler {
192
- private core;
193
- private _tools;
194
- constructor(core: CopilotKitCore);
195
- /**
196
- * Get all tools as a readonly array
197
- */
198
- get tools(): Readonly<FrontendTool<any>[]>;
199
- /**
200
- * Initialize with tools
201
- */
202
- initialize(tools: FrontendTool<any>[]): void;
203
- /**
204
- * Add a tool to the registry
205
- */
206
- addTool<T extends Record<string, unknown> = Record<string, unknown>>(tool: FrontendTool<T>): void;
207
- /**
208
- * Remove a tool by name and optionally by agentId
209
- */
210
- removeTool(id: string, agentId?: string): void;
211
- /**
212
- * Get a tool by name and optionally by agentId.
213
- * If agentId is provided, it will first look for an agent-specific tool,
214
- * then fall back to a global tool with the same name.
215
- */
216
- getTool(params: CopilotKitCoreGetToolParams): FrontendTool<any> | undefined;
217
- /**
218
- * Set all tools at once. Replaces existing tools.
219
- */
220
- setTools(tools: FrontendTool<any>[]): void;
221
- /**
222
- * Connect an agent (establish initial connection)
223
- */
224
- connectAgent({ agent, }: CopilotKitCoreConnectAgentParams): Promise<RunAgentResult>;
225
- /**
226
- * Run an agent
227
- */
228
- runAgent({ agent, }: CopilotKitCoreRunAgentParams): Promise<RunAgentResult>;
229
- /**
230
- * Process agent result and execute tools
231
- */
232
- private processAgentResult;
233
- /**
234
- * Execute a specific tool
235
- */
236
- private executeSpecificTool;
237
- /**
238
- * Execute a wildcard tool
239
- */
240
- private executeWildcardTool;
241
- /**
242
- * Build frontend tools for an agent
243
- */
244
- buildFrontendTools(agentId?: string): Tool[];
245
- /**
246
- * Create an agent error subscriber
247
- */
248
- private createAgentErrorSubscriber;
203
+ private core;
204
+ private _tools;
205
+ constructor(core: CopilotKitCore);
206
+ /**
207
+ * Get all tools as a readonly array
208
+ */
209
+ get tools(): Readonly<FrontendTool<any>[]>;
210
+ /**
211
+ * Initialize with tools
212
+ */
213
+ initialize(tools: FrontendTool<any>[]): void;
214
+ /**
215
+ * Add a tool to the registry
216
+ */
217
+ addTool<T extends Record<string, unknown> = Record<string, unknown>>(tool: FrontendTool<T>): void;
218
+ /**
219
+ * Remove a tool by name and optionally by agentId
220
+ */
221
+ removeTool(id: string, agentId?: string): void;
222
+ /**
223
+ * Get a tool by name and optionally by agentId.
224
+ * If agentId is provided, it will first look for an agent-specific tool,
225
+ * then fall back to a global tool with the same name.
226
+ */
227
+ getTool(params: CopilotKitCoreGetToolParams): FrontendTool<any> | undefined;
228
+ /**
229
+ * Set all tools at once. Replaces existing tools.
230
+ */
231
+ setTools(tools: FrontendTool<any>[]): void;
232
+ /**
233
+ * Connect an agent (establish initial connection)
234
+ */
235
+ connectAgent({
236
+ agent
237
+ }: CopilotKitCoreConnectAgentParams): Promise<RunAgentResult>;
238
+ /**
239
+ * Run an agent
240
+ */
241
+ runAgent({
242
+ agent
243
+ }: CopilotKitCoreRunAgentParams): Promise<RunAgentResult>;
244
+ /**
245
+ * Process agent result and execute tools
246
+ */
247
+ private processAgentResult;
248
+ /**
249
+ * Execute a specific tool
250
+ */
251
+ private executeSpecificTool;
252
+ /**
253
+ * Execute a wildcard tool
254
+ */
255
+ private executeWildcardTool;
256
+ /**
257
+ * Build frontend tools for an agent
258
+ */
259
+ buildFrontendTools(agentId?: string): Tool[];
260
+ /**
261
+ * Create an agent error subscriber
262
+ */
263
+ private createAgentErrorSubscriber;
249
264
  }
250
-
265
+ //#endregion
266
+ //#region src/core/core.d.ts
251
267
  /** Configuration options for `CopilotKitCore`. */
252
268
  interface CopilotKitCoreConfig {
253
- /** The endpoint of the CopilotRuntime. */
254
- runtimeUrl?: string;
255
- /** Transport style for CopilotRuntime endpoints. Defaults to REST. */
256
- runtimeTransport?: CopilotRuntimeTransport;
257
- /** Mapping from agent name to its `AbstractAgent` instance. For development only - production requires CopilotRuntime. */
258
- agents__unsafe_dev_only?: Record<string, AbstractAgent>;
259
- /** Headers appended to every HTTP request made by `CopilotKitCore`. */
260
- headers?: Record<string, string>;
261
- /** Credentials mode for fetch requests (e.g., "include" for HTTP-only cookies). */
262
- credentials?: RequestCredentials;
263
- /** Properties sent as `forwardedProps` to the AG-UI agent. */
264
- properties?: Record<string, unknown>;
265
- /** Ordered collection of frontend tools available to the core. */
266
- tools?: FrontendTool<any>[];
267
- /** Suggestions config for the core. */
268
- suggestionsConfig?: SuggestionsConfig[];
269
+ /** The endpoint of the CopilotRuntime. */
270
+ runtimeUrl?: string;
271
+ /** Transport style for CopilotRuntime endpoints. Defaults to REST. */
272
+ runtimeTransport?: CopilotRuntimeTransport;
273
+ /** Mapping from agent name to its `AbstractAgent` instance. For development only - production requires CopilotRuntime. */
274
+ agents__unsafe_dev_only?: Record<string, AbstractAgent>;
275
+ /** Headers appended to every HTTP request made by `CopilotKitCore`. */
276
+ headers?: Record<string, string>;
277
+ /** Credentials mode for fetch requests (e.g., "include" for HTTP-only cookies). */
278
+ credentials?: RequestCredentials;
279
+ /** Properties sent as `forwardedProps` to the AG-UI agent. */
280
+ properties?: Record<string, unknown>;
281
+ /** Ordered collection of frontend tools available to the core. */
282
+ tools?: FrontendTool<any>[];
283
+ /** Suggestions config for the core. */
284
+ suggestionsConfig?: SuggestionsConfig[];
269
285
  }
270
-
271
286
  interface CopilotKitCoreStopAgentParams {
272
- agent: AbstractAgent;
287
+ agent: AbstractAgent;
273
288
  }
274
289
  type CopilotKitCoreGetSuggestionsResult = {
275
- suggestions: Suggestion[];
276
- isLoading: boolean;
290
+ suggestions: Suggestion[];
291
+ isLoading: boolean;
277
292
  };
278
293
  declare enum CopilotKitCoreErrorCode {
279
- RUNTIME_INFO_FETCH_FAILED = "runtime_info_fetch_failed",
280
- AGENT_CONNECT_FAILED = "agent_connect_failed",
281
- AGENT_RUN_FAILED = "agent_run_failed",
282
- AGENT_RUN_FAILED_EVENT = "agent_run_failed_event",
283
- AGENT_RUN_ERROR_EVENT = "agent_run_error_event",
284
- TOOL_ARGUMENT_PARSE_FAILED = "tool_argument_parse_failed",
285
- TOOL_HANDLER_FAILED = "tool_handler_failed",
286
- TRANSCRIPTION_FAILED = "transcription_failed",
287
- TRANSCRIPTION_SERVICE_NOT_CONFIGURED = "transcription_service_not_configured",
288
- TRANSCRIPTION_INVALID_AUDIO = "transcription_invalid_audio",
289
- TRANSCRIPTION_RATE_LIMITED = "transcription_rate_limited",
290
- TRANSCRIPTION_AUTH_FAILED = "transcription_auth_failed",
291
- TRANSCRIPTION_NETWORK_ERROR = "transcription_network_error"
294
+ RUNTIME_INFO_FETCH_FAILED = "runtime_info_fetch_failed",
295
+ AGENT_CONNECT_FAILED = "agent_connect_failed",
296
+ AGENT_RUN_FAILED = "agent_run_failed",
297
+ AGENT_RUN_FAILED_EVENT = "agent_run_failed_event",
298
+ AGENT_RUN_ERROR_EVENT = "agent_run_error_event",
299
+ TOOL_ARGUMENT_PARSE_FAILED = "tool_argument_parse_failed",
300
+ TOOL_HANDLER_FAILED = "tool_handler_failed",
301
+ TRANSCRIPTION_FAILED = "transcription_failed",
302
+ TRANSCRIPTION_SERVICE_NOT_CONFIGURED = "transcription_service_not_configured",
303
+ TRANSCRIPTION_INVALID_AUDIO = "transcription_invalid_audio",
304
+ TRANSCRIPTION_RATE_LIMITED = "transcription_rate_limited",
305
+ TRANSCRIPTION_AUTH_FAILED = "transcription_auth_failed",
306
+ TRANSCRIPTION_NETWORK_ERROR = "transcription_network_error"
292
307
  }
293
308
  interface CopilotKitCoreSubscriber {
294
- onRuntimeConnectionStatusChanged?: (event: {
295
- copilotkit: CopilotKitCore;
296
- status: CopilotKitCoreRuntimeConnectionStatus;
297
- }) => void | Promise<void>;
298
- onToolExecutionStart?: (event: {
299
- copilotkit: CopilotKitCore;
300
- toolCallId: string;
301
- agentId: string;
302
- toolName: string;
303
- args: unknown;
304
- }) => void | Promise<void>;
305
- onToolExecutionEnd?: (event: {
306
- copilotkit: CopilotKitCore;
307
- toolCallId: string;
308
- agentId: string;
309
- toolName: string;
310
- result: string;
311
- error?: string;
312
- }) => void | Promise<void>;
313
- onAgentsChanged?: (event: {
314
- copilotkit: CopilotKitCore;
315
- agents: Readonly<Record<string, AbstractAgent>>;
316
- }) => void | Promise<void>;
317
- onContextChanged?: (event: {
318
- copilotkit: CopilotKitCore;
319
- context: Readonly<Record<string, Context>>;
320
- }) => void | Promise<void>;
321
- onSuggestionsConfigChanged?: (event: {
322
- copilotkit: CopilotKitCore;
323
- suggestionsConfig: Readonly<Record<string, SuggestionsConfig>>;
324
- }) => void | Promise<void>;
325
- onSuggestionsChanged?: (event: {
326
- copilotkit: CopilotKitCore;
327
- agentId: string;
328
- suggestions: Suggestion[];
329
- }) => void | Promise<void>;
330
- onSuggestionsStartedLoading?: (event: {
331
- copilotkit: CopilotKitCore;
332
- agentId: string;
333
- }) => void | Promise<void>;
334
- onSuggestionsFinishedLoading?: (event: {
335
- copilotkit: CopilotKitCore;
336
- agentId: string;
337
- }) => void | Promise<void>;
338
- onPropertiesChanged?: (event: {
339
- copilotkit: CopilotKitCore;
340
- properties: Readonly<Record<string, unknown>>;
341
- }) => void | Promise<void>;
342
- onHeadersChanged?: (event: {
343
- copilotkit: CopilotKitCore;
344
- headers: Readonly<Record<string, string>>;
345
- }) => void | Promise<void>;
346
- onError?: (event: {
347
- copilotkit: CopilotKitCore;
348
- error: Error;
349
- code: CopilotKitCoreErrorCode;
350
- context: Record<string, any>;
351
- }) => void | Promise<void>;
309
+ onRuntimeConnectionStatusChanged?: (event: {
310
+ copilotkit: CopilotKitCore;
311
+ status: CopilotKitCoreRuntimeConnectionStatus;
312
+ }) => void | Promise<void>;
313
+ onToolExecutionStart?: (event: {
314
+ copilotkit: CopilotKitCore;
315
+ toolCallId: string;
316
+ agentId: string;
317
+ toolName: string;
318
+ args: unknown;
319
+ }) => void | Promise<void>;
320
+ onToolExecutionEnd?: (event: {
321
+ copilotkit: CopilotKitCore;
322
+ toolCallId: string;
323
+ agentId: string;
324
+ toolName: string;
325
+ result: string;
326
+ error?: string;
327
+ }) => void | Promise<void>;
328
+ onAgentsChanged?: (event: {
329
+ copilotkit: CopilotKitCore;
330
+ agents: Readonly<Record<string, AbstractAgent>>;
331
+ }) => void | Promise<void>;
332
+ onContextChanged?: (event: {
333
+ copilotkit: CopilotKitCore;
334
+ context: Readonly<Record<string, Context>>;
335
+ }) => void | Promise<void>;
336
+ onSuggestionsConfigChanged?: (event: {
337
+ copilotkit: CopilotKitCore;
338
+ suggestionsConfig: Readonly<Record<string, SuggestionsConfig>>;
339
+ }) => void | Promise<void>;
340
+ onSuggestionsChanged?: (event: {
341
+ copilotkit: CopilotKitCore;
342
+ agentId: string;
343
+ suggestions: Suggestion[];
344
+ }) => void | Promise<void>;
345
+ onSuggestionsStartedLoading?: (event: {
346
+ copilotkit: CopilotKitCore;
347
+ agentId: string;
348
+ }) => void | Promise<void>;
349
+ onSuggestionsFinishedLoading?: (event: {
350
+ copilotkit: CopilotKitCore;
351
+ agentId: string;
352
+ }) => void | Promise<void>;
353
+ onPropertiesChanged?: (event: {
354
+ copilotkit: CopilotKitCore;
355
+ properties: Readonly<Record<string, unknown>>;
356
+ }) => void | Promise<void>;
357
+ onHeadersChanged?: (event: {
358
+ copilotkit: CopilotKitCore;
359
+ headers: Readonly<Record<string, string>>;
360
+ }) => void | Promise<void>;
361
+ onError?: (event: {
362
+ copilotkit: CopilotKitCore;
363
+ error: Error;
364
+ code: CopilotKitCoreErrorCode;
365
+ context: Record<string, any>;
366
+ }) => void | Promise<void>;
352
367
  }
353
368
  interface CopilotKitCoreSubscription {
354
- unsubscribe: () => void;
369
+ unsubscribe: () => void;
355
370
  }
356
371
  declare enum CopilotKitCoreRuntimeConnectionStatus {
357
- Disconnected = "disconnected",
358
- Connected = "connected",
359
- Connecting = "connecting",
360
- Error = "error"
372
+ Disconnected = "disconnected",
373
+ Connected = "connected",
374
+ Connecting = "connecting",
375
+ Error = "error"
361
376
  }
362
377
  /**
363
378
  * Internal interface for delegate classes to access CopilotKitCore methods.
364
379
  * This provides type safety while allowing controlled access to private functionality.
365
380
  */
366
381
  interface CopilotKitCoreFriendsAccess {
367
- notifySubscribers(handler: (subscriber: CopilotKitCoreSubscriber) => void | Promise<void>, errorMessage: string): Promise<void>;
368
- emitError(params: {
369
- error: Error;
370
- code: CopilotKitCoreErrorCode;
371
- context?: Record<string, any>;
372
- }): Promise<void>;
373
- readonly headers: Readonly<Record<string, string>>;
374
- readonly credentials: RequestCredentials | undefined;
375
- readonly properties: Readonly<Record<string, unknown>>;
376
- readonly context: Readonly<Record<string, Context>>;
377
- buildFrontendTools(agentId?: string): _ag_ui_client.Tool[];
378
- getAgent(id: string): AbstractAgent | undefined;
379
- readonly suggestionEngine: {
380
- clearSuggestions(agentId: string): void;
381
- reloadSuggestions(agentId: string): void;
382
- };
382
+ notifySubscribers(handler: (subscriber: CopilotKitCoreSubscriber) => void | Promise<void>, errorMessage: string): Promise<void>;
383
+ emitError(params: {
384
+ error: Error;
385
+ code: CopilotKitCoreErrorCode;
386
+ context?: Record<string, any>;
387
+ }): Promise<void>;
388
+ readonly headers: Readonly<Record<string, string>>;
389
+ readonly credentials: RequestCredentials | undefined;
390
+ readonly properties: Readonly<Record<string, unknown>>;
391
+ readonly context: Readonly<Record<string, Context>>;
392
+ buildFrontendTools(agentId?: string): _ag_ui_client0.Tool[];
393
+ getAgent(id: string): AbstractAgent | undefined;
394
+ readonly suggestionEngine: {
395
+ clearSuggestions(agentId: string): void;
396
+ reloadSuggestions(agentId: string): void;
397
+ };
383
398
  }
384
399
  declare class CopilotKitCore {
385
- private _headers;
386
- private _credentials?;
387
- private _properties;
388
- private subscribers;
389
- private agentRegistry;
390
- private contextStore;
391
- private suggestionEngine;
392
- private runHandler;
393
- private stateManager;
394
- constructor({ runtimeUrl, runtimeTransport, headers, credentials, properties, agents__unsafe_dev_only, tools, suggestionsConfig, }: CopilotKitCoreConfig);
395
- /**
396
- * Internal method used by delegate classes and subclasses to notify subscribers
397
- */
398
- protected notifySubscribers(handler: (subscriber: CopilotKitCoreSubscriber) => void | Promise<void>, errorMessage: string): Promise<void>;
399
- /**
400
- * Internal method used by delegate classes to emit errors
401
- */
402
- private emitError;
403
- /**
404
- * Snapshot accessors
405
- */
406
- get context(): Readonly<Record<string, Context>>;
407
- get agents(): Readonly<Record<string, AbstractAgent>>;
408
- get tools(): Readonly<FrontendTool<any>[]>;
409
- get runtimeUrl(): string | undefined;
410
- setRuntimeUrl(runtimeUrl: string | undefined): void;
411
- get runtimeTransport(): CopilotRuntimeTransport;
412
- setRuntimeTransport(runtimeTransport: CopilotRuntimeTransport): void;
413
- get runtimeVersion(): string | undefined;
414
- get headers(): Readonly<Record<string, string>>;
415
- get credentials(): RequestCredentials | undefined;
416
- get properties(): Readonly<Record<string, unknown>>;
417
- get runtimeConnectionStatus(): CopilotKitCoreRuntimeConnectionStatus;
418
- get audioFileTranscriptionEnabled(): boolean;
419
- /**
420
- * Configuration updates
421
- */
422
- setHeaders(headers: Record<string, string>): void;
423
- setCredentials(credentials: RequestCredentials | undefined): void;
424
- setProperties(properties: Record<string, unknown>): void;
425
- /**
426
- * Agent management (delegated to AgentRegistry)
427
- */
428
- setAgents__unsafe_dev_only(agents: Record<string, AbstractAgent>): void;
429
- addAgent__unsafe_dev_only(params: CopilotKitCoreAddAgentParams): void;
430
- removeAgent__unsafe_dev_only(id: string): void;
431
- getAgent(id: string): AbstractAgent | undefined;
432
- /**
433
- * Context management (delegated to ContextStore)
434
- */
435
- addContext(context: Context): string;
436
- removeContext(id: string): void;
437
- /**
438
- * Suggestions management (delegated to SuggestionEngine)
439
- */
440
- addSuggestionsConfig(config: SuggestionsConfig): string;
441
- removeSuggestionsConfig(id: string): void;
442
- reloadSuggestions(agentId: string): void;
443
- clearSuggestions(agentId: string): void;
444
- getSuggestions(agentId: string): CopilotKitCoreGetSuggestionsResult;
445
- /**
446
- * Tool management (delegated to RunHandler)
447
- */
448
- addTool<T extends Record<string, unknown> = Record<string, unknown>>(tool: FrontendTool<T>): void;
449
- removeTool(id: string, agentId?: string): void;
450
- getTool(params: CopilotKitCoreGetToolParams): FrontendTool<any> | undefined;
451
- setTools(tools: FrontendTool<any>[]): void;
452
- /**
453
- * Subscription lifecycle
454
- */
455
- subscribe(subscriber: CopilotKitCoreSubscriber): CopilotKitCoreSubscription;
456
- /**
457
- * Agent connectivity (delegated to RunHandler)
458
- */
459
- connectAgent(params: CopilotKitCoreConnectAgentParams): Promise<_ag_ui_client.RunAgentResult>;
460
- stopAgent(params: CopilotKitCoreStopAgentParams): void;
461
- runAgent(params: CopilotKitCoreRunAgentParams): Promise<_ag_ui_client.RunAgentResult>;
462
- /**
463
- * State management (delegated to StateManager)
464
- */
465
- getStateByRun(agentId: string, threadId: string, runId: string): State | undefined;
466
- getRunIdForMessage(agentId: string, threadId: string, messageId: string): string | undefined;
467
- getRunIdsForThread(agentId: string, threadId: string): string[];
468
- /**
469
- * Internal method used by RunHandler to build frontend tools
470
- */
471
- private buildFrontendTools;
400
+ private _headers;
401
+ private _credentials?;
402
+ private _properties;
403
+ private subscribers;
404
+ private agentRegistry;
405
+ private contextStore;
406
+ private suggestionEngine;
407
+ private runHandler;
408
+ private stateManager;
409
+ constructor({
410
+ runtimeUrl,
411
+ runtimeTransport,
412
+ headers,
413
+ credentials,
414
+ properties,
415
+ agents__unsafe_dev_only,
416
+ tools,
417
+ suggestionsConfig
418
+ }: CopilotKitCoreConfig);
419
+ /**
420
+ * Internal method used by delegate classes and subclasses to notify subscribers
421
+ */
422
+ protected notifySubscribers(handler: (subscriber: CopilotKitCoreSubscriber) => void | Promise<void>, errorMessage: string): Promise<void>;
423
+ /**
424
+ * Internal method used by delegate classes to emit errors
425
+ */
426
+ private emitError;
427
+ /**
428
+ * Snapshot accessors
429
+ */
430
+ get context(): Readonly<Record<string, Context>>;
431
+ get agents(): Readonly<Record<string, AbstractAgent>>;
432
+ get tools(): Readonly<FrontendTool<any>[]>;
433
+ get runtimeUrl(): string | undefined;
434
+ setRuntimeUrl(runtimeUrl: string | undefined): void;
435
+ get runtimeTransport(): CopilotRuntimeTransport;
436
+ setRuntimeTransport(runtimeTransport: CopilotRuntimeTransport): void;
437
+ get runtimeVersion(): string | undefined;
438
+ get headers(): Readonly<Record<string, string>>;
439
+ get credentials(): RequestCredentials | undefined;
440
+ get properties(): Readonly<Record<string, unknown>>;
441
+ get runtimeConnectionStatus(): CopilotKitCoreRuntimeConnectionStatus;
442
+ get audioFileTranscriptionEnabled(): boolean;
443
+ /**
444
+ * Configuration updates
445
+ */
446
+ setHeaders(headers: Record<string, string>): void;
447
+ setCredentials(credentials: RequestCredentials | undefined): void;
448
+ setProperties(properties: Record<string, unknown>): void;
449
+ /**
450
+ * Agent management (delegated to AgentRegistry)
451
+ */
452
+ setAgents__unsafe_dev_only(agents: Record<string, AbstractAgent>): void;
453
+ addAgent__unsafe_dev_only(params: CopilotKitCoreAddAgentParams): void;
454
+ removeAgent__unsafe_dev_only(id: string): void;
455
+ getAgent(id: string): AbstractAgent | undefined;
456
+ /**
457
+ * Context management (delegated to ContextStore)
458
+ */
459
+ addContext(context: Context): string;
460
+ removeContext(id: string): void;
461
+ /**
462
+ * Suggestions management (delegated to SuggestionEngine)
463
+ */
464
+ addSuggestionsConfig(config: SuggestionsConfig): string;
465
+ removeSuggestionsConfig(id: string): void;
466
+ reloadSuggestions(agentId: string): void;
467
+ clearSuggestions(agentId: string): void;
468
+ getSuggestions(agentId: string): CopilotKitCoreGetSuggestionsResult;
469
+ /**
470
+ * Tool management (delegated to RunHandler)
471
+ */
472
+ addTool<T extends Record<string, unknown> = Record<string, unknown>>(tool: FrontendTool<T>): void;
473
+ removeTool(id: string, agentId?: string): void;
474
+ getTool(params: CopilotKitCoreGetToolParams): FrontendTool<any> | undefined;
475
+ setTools(tools: FrontendTool<any>[]): void;
476
+ /**
477
+ * Subscription lifecycle
478
+ */
479
+ subscribe(subscriber: CopilotKitCoreSubscriber): CopilotKitCoreSubscription;
480
+ /**
481
+ * Agent connectivity (delegated to RunHandler)
482
+ */
483
+ connectAgent(params: CopilotKitCoreConnectAgentParams): Promise<_ag_ui_client0.RunAgentResult>;
484
+ stopAgent(params: CopilotKitCoreStopAgentParams): void;
485
+ runAgent(params: CopilotKitCoreRunAgentParams): Promise<_ag_ui_client0.RunAgentResult>;
486
+ /**
487
+ * State management (delegated to StateManager)
488
+ */
489
+ getStateByRun(agentId: string, threadId: string, runId: string): State | undefined;
490
+ getRunIdForMessage(agentId: string, threadId: string, messageId: string): string | undefined;
491
+ getRunIdsForThread(agentId: string, threadId: string): string[];
492
+ /**
493
+ * Internal method used by RunHandler to build frontend tools
494
+ */
495
+ private buildFrontendTools;
472
496
  }
473
-
497
+ //#endregion
498
+ //#region src/core/context-store.d.ts
474
499
  /**
475
500
  * Manages context storage and lifecycle for CopilotKitCore.
476
501
  * Context represents additional information available to agents during execution.
477
502
  */
478
503
  declare class ContextStore {
479
- private core;
480
- private _context;
481
- constructor(core: CopilotKitCore);
482
- /**
483
- * Get all context entries as a readonly record
484
- */
485
- get context(): Readonly<Record<string, Context>>;
486
- /**
487
- * Add a new context entry
488
- * @returns The ID of the created context entry
489
- */
490
- addContext({ description, value }: Context): string;
491
- /**
492
- * Remove a context entry by ID
493
- */
494
- removeContext(id: string): void;
495
- /**
496
- * Notify all subscribers of context changes
497
- */
498
- private notifySubscribers;
504
+ private core;
505
+ private _context;
506
+ constructor(core: CopilotKitCore);
507
+ /**
508
+ * Get all context entries as a readonly record
509
+ */
510
+ get context(): Readonly<Record<string, Context>>;
511
+ /**
512
+ * Add a new context entry
513
+ * @returns The ID of the created context entry
514
+ */
515
+ addContext({
516
+ description,
517
+ value
518
+ }: Context): string;
519
+ /**
520
+ * Remove a context entry by ID
521
+ */
522
+ removeContext(id: string): void;
523
+ /**
524
+ * Notify all subscribers of context changes
525
+ */
526
+ private notifySubscribers;
499
527
  }
500
-
528
+ //#endregion
529
+ //#region src/core/suggestion-engine.d.ts
501
530
  /**
502
531
  * Manages suggestion generation, streaming, and lifecycle for CopilotKitCore.
503
532
  * Handles both dynamic (AI-generated) and static suggestions.
504
533
  */
505
534
  declare class SuggestionEngine {
506
- private core;
507
- private _suggestionsConfig;
508
- private _suggestions;
509
- private _runningSuggestions;
510
- constructor(core: CopilotKitCore);
511
- /**
512
- * Initialize with suggestion configs
513
- */
514
- initialize(suggestionsConfig: SuggestionsConfig[]): void;
515
- /**
516
- * Add a suggestion configuration
517
- * @returns The ID of the created config
518
- */
519
- addSuggestionsConfig(config: SuggestionsConfig): string;
520
- /**
521
- * Remove a suggestion configuration by ID
522
- */
523
- removeSuggestionsConfig(id: string): void;
524
- /**
525
- * Reload suggestions for a specific agent
526
- * This triggers generation of new suggestions based on current configs
527
- */
528
- reloadSuggestions(agentId: string): void;
529
- /**
530
- * Clear all suggestions for a specific agent
531
- */
532
- clearSuggestions(agentId: string): void;
533
- /**
534
- * Get current suggestions for an agent
535
- */
536
- getSuggestions(agentId: string): CopilotKitCoreGetSuggestionsResult;
537
- /**
538
- * Generate suggestions using a provider agent
539
- */
540
- private generateSuggestions;
541
- /**
542
- * Finalize suggestions by marking them as no longer loading
543
- */
544
- private finalizeSuggestions;
545
- /**
546
- * Extract suggestions from messages (called during streaming)
547
- */
548
- extractSuggestions(messages: Message[], suggestionId: string, consumerAgentId: string, isRunning: boolean): void;
549
- /**
550
- * Notify subscribers of suggestions config changes
551
- */
552
- private notifySuggestionsConfigChanged;
553
- /**
554
- * Notify subscribers of suggestions changes
555
- */
556
- private notifySuggestionsChanged;
557
- /**
558
- * Notify subscribers that suggestions started loading
559
- */
560
- private notifySuggestionsStartedLoading;
561
- /**
562
- * Notify subscribers that suggestions finished loading
563
- */
564
- private notifySuggestionsFinishedLoading;
565
- /**
566
- * Check if suggestions should be shown based on availability and message count
567
- */
568
- private shouldShowSuggestions;
569
- /**
570
- * Add static suggestions directly without AI generation
571
- */
572
- private addStaticSuggestions;
535
+ private core;
536
+ private _suggestionsConfig;
537
+ private _suggestions;
538
+ private _runningSuggestions;
539
+ constructor(core: CopilotKitCore);
540
+ /**
541
+ * Initialize with suggestion configs
542
+ */
543
+ initialize(suggestionsConfig: SuggestionsConfig[]): void;
544
+ /**
545
+ * Add a suggestion configuration
546
+ * @returns The ID of the created config
547
+ */
548
+ addSuggestionsConfig(config: SuggestionsConfig): string;
549
+ /**
550
+ * Remove a suggestion configuration by ID
551
+ */
552
+ removeSuggestionsConfig(id: string): void;
553
+ /**
554
+ * Reload suggestions for a specific agent
555
+ * This triggers generation of new suggestions based on current configs
556
+ */
557
+ reloadSuggestions(agentId: string): void;
558
+ /**
559
+ * Clear all suggestions for a specific agent
560
+ */
561
+ clearSuggestions(agentId: string): void;
562
+ /**
563
+ * Get current suggestions for an agent
564
+ */
565
+ getSuggestions(agentId: string): CopilotKitCoreGetSuggestionsResult;
566
+ /**
567
+ * Generate suggestions using a provider agent
568
+ */
569
+ private generateSuggestions;
570
+ /**
571
+ * Finalize suggestions by marking them as no longer loading
572
+ */
573
+ private finalizeSuggestions;
574
+ /**
575
+ * Extract suggestions from messages (called during streaming)
576
+ */
577
+ extractSuggestions(messages: Message[], suggestionId: string, consumerAgentId: string, isRunning: boolean): void;
578
+ /**
579
+ * Notify subscribers of suggestions config changes
580
+ */
581
+ private notifySuggestionsConfigChanged;
582
+ /**
583
+ * Notify subscribers of suggestions changes
584
+ */
585
+ private notifySuggestionsChanged;
586
+ /**
587
+ * Notify subscribers that suggestions started loading
588
+ */
589
+ private notifySuggestionsStartedLoading;
590
+ /**
591
+ * Notify subscribers that suggestions finished loading
592
+ */
593
+ private notifySuggestionsFinishedLoading;
594
+ /**
595
+ * Check if suggestions should be shown based on availability and message count
596
+ */
597
+ private shouldShowSuggestions;
598
+ /**
599
+ * Add static suggestions directly without AI generation
600
+ */
601
+ private addStaticSuggestions;
573
602
  }
574
-
603
+ //#endregion
604
+ //#region src/core/state-manager.d.ts
575
605
  /**
576
606
  * Manages state and message tracking by run for CopilotKitCore.
577
607
  * Tracks agent state snapshots and message-to-run associations.
578
608
  */
579
609
  declare class StateManager {
580
- private core;
581
- private stateByRun;
582
- private messageToRun;
583
- private agentSubscriptions;
584
- constructor(core: CopilotKitCore);
585
- /**
586
- * Initialize state tracking for an agent
587
- */
588
- initialize(): void;
589
- /**
590
- * Subscribe to an agent's events to track state and messages
591
- */
592
- subscribeToAgent(agent: AbstractAgent): void;
593
- /**
594
- * Unsubscribe from an agent's events
595
- */
596
- unsubscribeFromAgent(agentId: string): void;
597
- /**
598
- * Get state for a specific run
599
- * Returns a deep copy to prevent external mutations
600
- */
601
- getStateByRun(agentId: string, threadId: string, runId: string): State | undefined;
602
- /**
603
- * Get runId associated with a message
604
- */
605
- getRunIdForMessage(agentId: string, threadId: string, messageId: string): string | undefined;
606
- /**
607
- * Get all states for an agent's thread
608
- */
609
- getStatesForThread(agentId: string, threadId: string): Map<string, State>;
610
- /**
611
- * Get all run IDs for an agent's thread
612
- */
613
- getRunIdsForThread(agentId: string, threadId: string): string[];
614
- /**
615
- * Handle run started event
616
- */
617
- private handleRunStarted;
618
- /**
619
- * Handle run finished event
620
- */
621
- private handleRunFinished;
622
- /**
623
- * Handle state snapshot event
624
- */
625
- private handleStateSnapshot;
626
- /**
627
- * Handle state delta event
628
- */
629
- private handleStateDelta;
630
- /**
631
- * Handle messages snapshot event
632
- */
633
- private handleMessagesSnapshot;
634
- /**
635
- * Handle new message event
636
- */
637
- private handleNewMessage;
638
- /**
639
- * Save state for a specific run
640
- */
641
- private saveState;
642
- /**
643
- * Associate a message with a run
644
- */
645
- private associateMessageWithRun;
646
- /**
647
- * Clear all state for an agent
648
- */
649
- clearAgentState(agentId: string): void;
650
- /**
651
- * Clear all state for a thread
652
- */
653
- clearThreadState(agentId: string, threadId: string): void;
610
+ private core;
611
+ private stateByRun;
612
+ private messageToRun;
613
+ private agentSubscriptions;
614
+ constructor(core: CopilotKitCore);
615
+ /**
616
+ * Initialize state tracking for an agent
617
+ */
618
+ initialize(): void;
619
+ /**
620
+ * Subscribe to an agent's events to track state and messages
621
+ */
622
+ subscribeToAgent(agent: AbstractAgent): void;
623
+ /**
624
+ * Unsubscribe from an agent's events
625
+ */
626
+ unsubscribeFromAgent(agentId: string): void;
627
+ /**
628
+ * Get state for a specific run
629
+ * Returns a deep copy to prevent external mutations
630
+ */
631
+ getStateByRun(agentId: string, threadId: string, runId: string): State | undefined;
632
+ /**
633
+ * Get runId associated with a message
634
+ */
635
+ getRunIdForMessage(agentId: string, threadId: string, messageId: string): string | undefined;
636
+ /**
637
+ * Get all states for an agent's thread
638
+ */
639
+ getStatesForThread(agentId: string, threadId: string): Map<string, State>;
640
+ /**
641
+ * Get all run IDs for an agent's thread
642
+ */
643
+ getRunIdsForThread(agentId: string, threadId: string): string[];
644
+ /**
645
+ * Handle run started event
646
+ */
647
+ private handleRunStarted;
648
+ /**
649
+ * Handle run finished event
650
+ */
651
+ private handleRunFinished;
652
+ /**
653
+ * Handle state snapshot event
654
+ */
655
+ private handleStateSnapshot;
656
+ /**
657
+ * Handle state delta event
658
+ */
659
+ private handleStateDelta;
660
+ /**
661
+ * Handle messages snapshot event
662
+ */
663
+ private handleMessagesSnapshot;
664
+ /**
665
+ * Handle new message event
666
+ */
667
+ private handleNewMessage;
668
+ /**
669
+ * Save state for a specific run
670
+ */
671
+ private saveState;
672
+ /**
673
+ * Associate a message with a run
674
+ */
675
+ private associateMessageWithRun;
676
+ /**
677
+ * Clear all state for an agent
678
+ */
679
+ clearAgentState(agentId: string): void;
680
+ /**
681
+ * Clear all state for a thread
682
+ */
683
+ clearThreadState(agentId: string, threadId: string): void;
654
684
  }
655
-
685
+ //#endregion
686
+ //#region src/agent.d.ts
656
687
  interface ProxiedCopilotRuntimeAgentConfig extends Omit<HttpAgentConfig, "url"> {
657
- runtimeUrl?: string;
658
- transport?: CopilotRuntimeTransport;
659
- credentials?: RequestCredentials;
688
+ runtimeUrl?: string;
689
+ transport?: CopilotRuntimeTransport;
690
+ credentials?: RequestCredentials;
660
691
  }
661
692
  declare class ProxiedCopilotRuntimeAgent extends HttpAgent {
662
- runtimeUrl?: string;
663
- credentials?: RequestCredentials;
664
- private transport;
665
- private singleEndpointUrl?;
666
- constructor(config: ProxiedCopilotRuntimeAgentConfig);
667
- abortRun(): void;
668
- connect(input: RunAgentInput): Observable<BaseEvent>;
669
- run(input: RunAgentInput): Observable<BaseEvent>;
670
- clone(): ProxiedCopilotRuntimeAgent;
671
- private createSingleRouteRequestInit;
693
+ runtimeUrl?: string;
694
+ credentials?: RequestCredentials;
695
+ private transport;
696
+ private singleEndpointUrl?;
697
+ constructor(config: ProxiedCopilotRuntimeAgentConfig);
698
+ abortRun(): void;
699
+ connect(input: RunAgentInput): Observable<BaseEvent>;
700
+ run(input: RunAgentInput): Observable<BaseEvent>;
701
+ clone(): ProxiedCopilotRuntimeAgent;
702
+ private createSingleRouteRequestInit;
672
703
  }
673
-
704
+ //#endregion
705
+ //#region src/utils/markdown.d.ts
674
706
  declare function completePartialMarkdown(input: string): string;
675
-
676
- export { AgentRegistry, ContextStore, CopilotKitCore, type CopilotKitCoreAddAgentParams, type CopilotKitCoreConfig, type CopilotKitCoreConnectAgentParams, CopilotKitCoreErrorCode, type CopilotKitCoreFriendsAccess, type CopilotKitCoreGetSuggestionsResult, type CopilotKitCoreGetToolParams, type CopilotKitCoreRunAgentParams, CopilotKitCoreRuntimeConnectionStatus, type CopilotKitCoreStopAgentParams, type CopilotKitCoreSubscriber, type CopilotKitCoreSubscription, type CopilotRuntimeTransport, type DynamicSuggestionsConfig, type FrontendTool, type FrontendToolHandlerContext, ProxiedCopilotRuntimeAgent, type ProxiedCopilotRuntimeAgentConfig, RunHandler, StateManager, type StaticSuggestionsConfig, type Suggestion, type SuggestionAvailability, SuggestionEngine, type SuggestionsConfig, ToolCallStatus, completePartialMarkdown };
707
+ //#endregion
708
+ export { AgentRegistry, ContextStore, CopilotKitCore, type CopilotKitCoreAddAgentParams, CopilotKitCoreConfig, type CopilotKitCoreConnectAgentParams, CopilotKitCoreErrorCode, CopilotKitCoreFriendsAccess, CopilotKitCoreGetSuggestionsResult, type CopilotKitCoreGetToolParams, type CopilotKitCoreRunAgentParams, CopilotKitCoreRuntimeConnectionStatus, CopilotKitCoreStopAgentParams, CopilotKitCoreSubscriber, CopilotKitCoreSubscription, CopilotRuntimeTransport, DynamicSuggestionsConfig, FrontendTool, FrontendToolHandlerContext, ProxiedCopilotRuntimeAgent, ProxiedCopilotRuntimeAgentConfig, RunHandler, StateManager, StaticSuggestionsConfig, Suggestion, SuggestionAvailability, SuggestionEngine, SuggestionsConfig, ToolCallStatus, completePartialMarkdown };
709
+ //# sourceMappingURL=index.d.mts.map