@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.ts DELETED
@@ -1,676 +0,0 @@
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';
5
-
6
- /**
7
- * Status of a tool call execution
8
- */
9
- declare enum ToolCallStatus {
10
- InProgress = "inProgress",
11
- Executing = "executing",
12
- Complete = "complete"
13
- }
14
- type CopilotRuntimeTransport = "rest" | "single";
15
- /**
16
- * Context passed to a frontend tool handler
17
- */
18
- type FrontendToolHandlerContext = {
19
- toolCall: ToolCall;
20
- agent: AbstractAgent;
21
- };
22
- 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;
33
- };
34
- type Suggestion = {
35
- title: string;
36
- message: string;
37
- /** Indicates whether this suggestion is still being generated. */
38
- isLoading: boolean;
39
- };
40
- type SuggestionAvailability = "before-first-message" | "after-first-message" | "always" | "disabled";
41
- 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;
68
- };
69
- 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;
82
- };
83
- type SuggestionsConfig = DynamicSuggestionsConfig | StaticSuggestionsConfig;
84
-
85
- interface CopilotKitCoreAddAgentParams {
86
- id: string;
87
- agent: AbstractAgent;
88
- }
89
- /**
90
- * Manages agent registration, lifecycle, and runtime connectivity for CopilotKitCore.
91
- * Handles both local development agents and remote runtime agents.
92
- */
93
- 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;
175
- }
176
-
177
- interface CopilotKitCoreRunAgentParams {
178
- agent: AbstractAgent;
179
- }
180
- interface CopilotKitCoreConnectAgentParams {
181
- agent: AbstractAgent;
182
- }
183
- interface CopilotKitCoreGetToolParams {
184
- toolName: string;
185
- agentId?: string;
186
- }
187
- /**
188
- * Handles agent execution, tool calling, and agent connectivity for CopilotKitCore.
189
- * Manages the complete lifecycle of agent runs including tool execution and follow-ups.
190
- */
191
- 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;
249
- }
250
-
251
- /** Configuration options for `CopilotKitCore`. */
252
- 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
- }
270
-
271
- interface CopilotKitCoreStopAgentParams {
272
- agent: AbstractAgent;
273
- }
274
- type CopilotKitCoreGetSuggestionsResult = {
275
- suggestions: Suggestion[];
276
- isLoading: boolean;
277
- };
278
- 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"
292
- }
293
- 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>;
352
- }
353
- interface CopilotKitCoreSubscription {
354
- unsubscribe: () => void;
355
- }
356
- declare enum CopilotKitCoreRuntimeConnectionStatus {
357
- Disconnected = "disconnected",
358
- Connected = "connected",
359
- Connecting = "connecting",
360
- Error = "error"
361
- }
362
- /**
363
- * Internal interface for delegate classes to access CopilotKitCore methods.
364
- * This provides type safety while allowing controlled access to private functionality.
365
- */
366
- 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
- };
383
- }
384
- 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;
472
- }
473
-
474
- /**
475
- * Manages context storage and lifecycle for CopilotKitCore.
476
- * Context represents additional information available to agents during execution.
477
- */
478
- 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;
499
- }
500
-
501
- /**
502
- * Manages suggestion generation, streaming, and lifecycle for CopilotKitCore.
503
- * Handles both dynamic (AI-generated) and static suggestions.
504
- */
505
- 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;
573
- }
574
-
575
- /**
576
- * Manages state and message tracking by run for CopilotKitCore.
577
- * Tracks agent state snapshots and message-to-run associations.
578
- */
579
- 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;
654
- }
655
-
656
- interface ProxiedCopilotRuntimeAgentConfig extends Omit<HttpAgentConfig, "url"> {
657
- runtimeUrl?: string;
658
- transport?: CopilotRuntimeTransport;
659
- credentials?: RequestCredentials;
660
- }
661
- 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;
672
- }
673
-
674
- 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 };