@yourgpt/copilot-sdk 1.2.0 → 1.2.2
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/{chunk-HPNLS3PQ.js → chunk-34LUNTCZ.js} +60 -7
- package/dist/chunk-34LUNTCZ.js.map +1 -0
- package/dist/{chunk-QAXDWNK3.cjs → chunk-DLM5KOFK.cjs} +60 -7
- package/dist/chunk-DLM5KOFK.cjs.map +1 -0
- package/dist/react/index.cjs +37 -37
- package/dist/react/index.d.cts +19 -6
- package/dist/react/index.d.ts +19 -6
- package/dist/react/index.js +1 -1
- package/dist/ui/index.cjs +4 -4
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-HPNLS3PQ.js.map +0 -1
- package/dist/chunk-QAXDWNK3.cjs.map +0 -1
package/dist/react/index.cjs
CHANGED
|
@@ -1,153 +1,153 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDLM5KOFK_cjs = require('../chunk-DLM5KOFK.cjs');
|
|
4
4
|
var chunkMTFU6EHR_cjs = require('../chunk-MTFU6EHR.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "AbstractAgentLoop", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkDLM5KOFK_cjs.AbstractAgentLoop; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "AbstractChat", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkDLM5KOFK_cjs.AbstractChat; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "CopilotProvider", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkDLM5KOFK_cjs.CopilotProvider; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "ReactChat", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkDLM5KOFK_cjs.ReactChat; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "ReactChatState", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkDLM5KOFK_cjs.ReactChatState; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "ReactThreadManager", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkDLM5KOFK_cjs.ReactThreadManager; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "ReactThreadManagerState", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkDLM5KOFK_cjs.ReactThreadManagerState; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "createPermissionStorage", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkDLM5KOFK_cjs.createPermissionStorage; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "createReactChat", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkDLM5KOFK_cjs.createReactChat; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "createReactChatState", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkDLM5KOFK_cjs.createReactChatState; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "createReactThreadManager", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkDLM5KOFK_cjs.createReactThreadManager; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "createReactThreadManagerState", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkDLM5KOFK_cjs.createReactThreadManagerState; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "createSessionPermissionCache", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkDLM5KOFK_cjs.createSessionPermissionCache; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "formatKnowledgeResultsForAI", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkDLM5KOFK_cjs.formatKnowledgeResultsForAI; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "initialAgentLoopState", {
|
|
65
65
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunkDLM5KOFK_cjs.initialAgentLoopState; }
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, "searchKnowledgeBase", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunkDLM5KOFK_cjs.searchKnowledgeBase; }
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "useAIAction", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkDLM5KOFK_cjs.useAIAction; }
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, "useAIActions", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkDLM5KOFK_cjs.useAIActions; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "useAIContext", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkDLM5KOFK_cjs.useAIContext; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "useAIContexts", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkDLM5KOFK_cjs.useAIContexts; }
|
|
87
87
|
});
|
|
88
88
|
Object.defineProperty(exports, "useAITools", {
|
|
89
89
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkDLM5KOFK_cjs.useAITools; }
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "useAgent", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkDLM5KOFK_cjs.useAgent; }
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "useCapabilities", {
|
|
97
97
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunkDLM5KOFK_cjs.useCapabilities; }
|
|
99
99
|
});
|
|
100
100
|
Object.defineProperty(exports, "useChat", {
|
|
101
101
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunkDLM5KOFK_cjs.useChat; }
|
|
103
103
|
});
|
|
104
104
|
Object.defineProperty(exports, "useCopilot", {
|
|
105
105
|
enumerable: true,
|
|
106
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunkDLM5KOFK_cjs.useCopilot; }
|
|
107
107
|
});
|
|
108
108
|
Object.defineProperty(exports, "useDevLogger", {
|
|
109
109
|
enumerable: true,
|
|
110
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunkDLM5KOFK_cjs.useDevLogger; }
|
|
111
111
|
});
|
|
112
112
|
Object.defineProperty(exports, "useFeatureSupport", {
|
|
113
113
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunkDLM5KOFK_cjs.useFeatureSupport; }
|
|
115
115
|
});
|
|
116
116
|
Object.defineProperty(exports, "useKnowledgeBase", {
|
|
117
117
|
enumerable: true,
|
|
118
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunkDLM5KOFK_cjs.useKnowledgeBase; }
|
|
119
119
|
});
|
|
120
120
|
Object.defineProperty(exports, "useSuggestions", {
|
|
121
121
|
enumerable: true,
|
|
122
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunkDLM5KOFK_cjs.useSuggestions; }
|
|
123
123
|
});
|
|
124
124
|
Object.defineProperty(exports, "useSupportedMediaTypes", {
|
|
125
125
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkDLM5KOFK_cjs.useSupportedMediaTypes; }
|
|
127
127
|
});
|
|
128
128
|
Object.defineProperty(exports, "useThreadManager", {
|
|
129
129
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkDLM5KOFK_cjs.useThreadManager; }
|
|
131
131
|
});
|
|
132
132
|
Object.defineProperty(exports, "useTool", {
|
|
133
133
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunkDLM5KOFK_cjs.useTool; }
|
|
135
135
|
});
|
|
136
136
|
Object.defineProperty(exports, "useToolExecutor", {
|
|
137
137
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunkDLM5KOFK_cjs.useToolExecutor; }
|
|
139
139
|
});
|
|
140
140
|
Object.defineProperty(exports, "useToolWithSchema", {
|
|
141
141
|
enumerable: true,
|
|
142
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunkDLM5KOFK_cjs.useToolWithSchema; }
|
|
143
143
|
});
|
|
144
144
|
Object.defineProperty(exports, "useTools", {
|
|
145
145
|
enumerable: true,
|
|
146
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunkDLM5KOFK_cjs.useTools; }
|
|
147
147
|
});
|
|
148
148
|
Object.defineProperty(exports, "useToolsWithSchema", {
|
|
149
149
|
enumerable: true,
|
|
150
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunkDLM5KOFK_cjs.useToolsWithSchema; }
|
|
151
151
|
});
|
|
152
152
|
Object.defineProperty(exports, "createLocalStorageAdapter", {
|
|
153
153
|
enumerable: true,
|
package/dist/react/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { L as LLMConfig,
|
|
4
|
-
export { A as ActionParameter, q as CloudConfig, _ as LocalStorageAdapterConfig, J as createLocalStorageAdapter, O as createMemoryAdapter, i as generateSuggestionReason } from '../ThreadManager-CUq5Ocu2.cjs';
|
|
3
|
+
import { L as LLMConfig, l as ToolsConfig, s as ActionDefinition, o as CapturedContext, m as ToolConsentRequest, T as ToolType, n as ToolConsentResponse, S as ScreenshotOptions, C as ConsoleLogOptions, N as NetworkRequestOptions, I as IntentDetectionResult, y as InternalKnowledgeBaseConfig, B as InternalKnowledgeBaseSearchResponse, z as InternalKnowledgeBaseResult, Y as ThreadManagerState, Z as LoadStatus, U as ThreadManagerConfig, F as ThreadManager, V as ThreadManagerCallbacks, W as CreateThreadOptions, X as UpdateThreadOptions } from '../ThreadManager-CUq5Ocu2.cjs';
|
|
4
|
+
export { A as ActionParameter, q as CloudConfig, r as CopilotConfig, _ as LocalStorageAdapterConfig, J as createLocalStorageAdapter, O as createMemoryAdapter, i as generateSuggestionReason } from '../ThreadManager-CUq5Ocu2.cjs';
|
|
5
5
|
import { X as AsyncThreadStorageAdapter, M as MessageAttachment, i as ToolCall, S as Source, T as ToolDefinition, x as PermissionLevel, c as ToolInputSchema, g as Message, s as ToolExecution$1, e as ToolContext, b as ToolResponse$1, n as ToolRenderProps, p as ToolSet, U as UnifiedToolCall, k as Thread, l as ThreadData, _ as ThreadStorageAdapter, z as PermissionStorageConfig, B as PermissionStorageAdapter } from '../types-BtAaOV07.cjs';
|
|
6
6
|
export { t as AgentLoopConfig, P as PersistenceConfig, m as ThreadStorageAdapter, a as ToolExecutionStatus, y as ToolPermission } from '../types-BtAaOV07.cjs';
|
|
7
7
|
|
|
@@ -518,6 +518,12 @@ declare class AbstractChat<T extends UIMessage = UIMessage> {
|
|
|
518
518
|
* Send a message
|
|
519
519
|
*/
|
|
520
520
|
sendMessage(content: string, attachments?: MessageAttachment[]): Promise<void>;
|
|
521
|
+
/**
|
|
522
|
+
* Resolve any tool_calls that don't have corresponding tool_results.
|
|
523
|
+
* This prevents Anthropic API errors when tool_use has no tool_result.
|
|
524
|
+
* Can happen when max iterations is reached or tool execution is interrupted.
|
|
525
|
+
*/
|
|
526
|
+
private resolveUnresolvedToolCalls;
|
|
521
527
|
/**
|
|
522
528
|
* Continue with tool results
|
|
523
529
|
*
|
|
@@ -738,19 +744,26 @@ declare class AbstractAgentLoop implements AgentLoopActions {
|
|
|
738
744
|
|
|
739
745
|
interface CopilotProviderProps {
|
|
740
746
|
children: React__default.ReactNode;
|
|
747
|
+
/** Runtime API endpoint URL */
|
|
741
748
|
runtimeUrl: string;
|
|
742
|
-
|
|
743
|
-
cloud?: CopilotConfig["cloud"];
|
|
749
|
+
/** System prompt sent with each request */
|
|
744
750
|
systemPrompt?: string;
|
|
745
751
|
/** @deprecated Use useTools() hook instead */
|
|
746
752
|
tools?: ToolsConfig;
|
|
753
|
+
/** Thread ID for conversation persistence */
|
|
747
754
|
threadId?: string;
|
|
755
|
+
/** Initial messages to populate the chat */
|
|
748
756
|
initialMessages?: Message[];
|
|
757
|
+
/** Callback when messages change */
|
|
749
758
|
onMessagesChange?: (messages: Message[]) => void;
|
|
759
|
+
/** Callback when an error occurs */
|
|
750
760
|
onError?: (error: Error) => void;
|
|
751
761
|
/** Enable/disable streaming (default: true) */
|
|
752
762
|
streaming?: boolean;
|
|
763
|
+
/** Enable debug logging */
|
|
753
764
|
debug?: boolean;
|
|
765
|
+
/** Max tool execution iterations (default: 20) */
|
|
766
|
+
maxIterations?: number;
|
|
754
767
|
}
|
|
755
768
|
interface CopilotContextValue {
|
|
756
769
|
messages: UIMessage[];
|
|
@@ -779,7 +792,7 @@ interface CopilotContextValue {
|
|
|
779
792
|
toolsConfig?: ToolsConfig;
|
|
780
793
|
}
|
|
781
794
|
declare function useCopilot(): CopilotContextValue;
|
|
782
|
-
declare function CopilotProvider({ children, runtimeUrl,
|
|
795
|
+
declare function CopilotProvider({ children, runtimeUrl, systemPrompt, tools: toolsConfig, threadId, initialMessages, onMessagesChange, onError, streaming, debug, maxIterations, }: CopilotProviderProps): react_jsx_runtime.JSX.Element;
|
|
783
796
|
|
|
784
797
|
/**
|
|
785
798
|
* Chat UI state interface (UI-only state, not message data)
|
|
@@ -2207,4 +2220,4 @@ interface UseChatReturn {
|
|
|
2207
2220
|
*/
|
|
2208
2221
|
declare function useChat(config: UseChatConfig): UseChatReturn;
|
|
2209
2222
|
|
|
2210
|
-
export { type AIContextItem, AbstractAgentLoop, AbstractChat, ActionDefinition, type AgentLoopActions, type AgentLoopCallbacks, type AgentLoopState, AsyncThreadStorageAdapter, type CapabilitiesResponse, CapturedContext, type ChatActions, type ChatCallbacks, type ChatConfig, type ChatState, type ChatStatus, type ToolExecution as ChatToolExecution, type ToolResponse as ChatToolResponse, type CombinedChatState,
|
|
2223
|
+
export { type AIContextItem, AbstractAgentLoop, AbstractChat, ActionDefinition, type AgentLoopActions, type AgentLoopCallbacks, type AgentLoopState, AsyncThreadStorageAdapter, type CapabilitiesResponse, CapturedContext, type ChatActions, type ChatCallbacks, type ChatConfig, type ChatState, type ChatStatus, type ToolExecution as ChatToolExecution, type ToolResponse as ChatToolResponse, type CombinedChatState, type CopilotContextValue, CopilotProvider, type CopilotProviderProps, type AgentLoopState$1 as CoreAgentLoopState, type ChatState$1 as CoreChatState, type DevLoggerState, IntentDetectionResult, type KnowledgeBaseConfig, type KnowledgeBaseResult, type KnowledgeBaseSearchResponse, LLMConfig, Message, PermissionLevel, PermissionStorageAdapter, PermissionStorageConfig, type ProviderCapabilities, ReactChat, type ReactChatConfig, ReactChatState, ReactThreadManager, type ReactThreadManagerConfig, ReactThreadManagerState, type ServerAdapterConfig, Source, type Suggestion, Thread, ThreadData, ToolConsentRequest, ToolConsentResponse, ToolContext, ToolDefinition, ToolExecution$1 as ToolExecution, ToolResponse$1 as ToolResponse, ToolType, type ToolsActions, ToolsConfig, type ToolsState, type UIMessage, UnifiedToolCall, type UseAIToolsOptions, type UseAIToolsReturn, type UseAgentOptions, type UseAgentReturn, type UseChatConfig, type UseChatReturn, type UseKnowledgeBaseConfig, type UseSuggestionsOptions, type UseSuggestionsReturn, type UseThreadManagerConfig, type UseThreadManagerReturn, type UseToolConfig, type UseToolExecutorReturn, type UseToolWithSchemaConfig, createPermissionStorage, createReactChat, createReactChatState, createReactThreadManager, createReactThreadManagerState, createServerAdapter, createSessionPermissionCache, formatKnowledgeResultsForAI, initialAgentLoopState, searchKnowledgeBase, useAIAction, useAIActions, useAIContext, useAIContexts, useAITools, useAgent, useCapabilities, useChat, useCopilot, useDevLogger, useFeatureSupport, useKnowledgeBase, useSuggestions, useSupportedMediaTypes, useThreadManager, useTool, useToolExecutor, useToolWithSchema, useTools, useToolsWithSchema };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { L as LLMConfig,
|
|
4
|
-
export { A as ActionParameter, q as CloudConfig, _ as LocalStorageAdapterConfig, J as createLocalStorageAdapter, O as createMemoryAdapter, i as generateSuggestionReason } from '../ThreadManager-JT0sqSSD.js';
|
|
3
|
+
import { L as LLMConfig, l as ToolsConfig, s as ActionDefinition, o as CapturedContext, m as ToolConsentRequest, T as ToolType, n as ToolConsentResponse, S as ScreenshotOptions, C as ConsoleLogOptions, N as NetworkRequestOptions, I as IntentDetectionResult, y as InternalKnowledgeBaseConfig, B as InternalKnowledgeBaseSearchResponse, z as InternalKnowledgeBaseResult, Y as ThreadManagerState, Z as LoadStatus, U as ThreadManagerConfig, F as ThreadManager, V as ThreadManagerCallbacks, W as CreateThreadOptions, X as UpdateThreadOptions } from '../ThreadManager-JT0sqSSD.js';
|
|
4
|
+
export { A as ActionParameter, q as CloudConfig, r as CopilotConfig, _ as LocalStorageAdapterConfig, J as createLocalStorageAdapter, O as createMemoryAdapter, i as generateSuggestionReason } from '../ThreadManager-JT0sqSSD.js';
|
|
5
5
|
import { X as AsyncThreadStorageAdapter, M as MessageAttachment, i as ToolCall, S as Source, T as ToolDefinition, x as PermissionLevel, c as ToolInputSchema, g as Message, s as ToolExecution$1, e as ToolContext, b as ToolResponse$1, n as ToolRenderProps, p as ToolSet, U as UnifiedToolCall, k as Thread, l as ThreadData, _ as ThreadStorageAdapter, z as PermissionStorageConfig, B as PermissionStorageAdapter } from '../types-BtAaOV07.js';
|
|
6
6
|
export { t as AgentLoopConfig, P as PersistenceConfig, m as ThreadStorageAdapter, a as ToolExecutionStatus, y as ToolPermission } from '../types-BtAaOV07.js';
|
|
7
7
|
|
|
@@ -518,6 +518,12 @@ declare class AbstractChat<T extends UIMessage = UIMessage> {
|
|
|
518
518
|
* Send a message
|
|
519
519
|
*/
|
|
520
520
|
sendMessage(content: string, attachments?: MessageAttachment[]): Promise<void>;
|
|
521
|
+
/**
|
|
522
|
+
* Resolve any tool_calls that don't have corresponding tool_results.
|
|
523
|
+
* This prevents Anthropic API errors when tool_use has no tool_result.
|
|
524
|
+
* Can happen when max iterations is reached or tool execution is interrupted.
|
|
525
|
+
*/
|
|
526
|
+
private resolveUnresolvedToolCalls;
|
|
521
527
|
/**
|
|
522
528
|
* Continue with tool results
|
|
523
529
|
*
|
|
@@ -738,19 +744,26 @@ declare class AbstractAgentLoop implements AgentLoopActions {
|
|
|
738
744
|
|
|
739
745
|
interface CopilotProviderProps {
|
|
740
746
|
children: React__default.ReactNode;
|
|
747
|
+
/** Runtime API endpoint URL */
|
|
741
748
|
runtimeUrl: string;
|
|
742
|
-
|
|
743
|
-
cloud?: CopilotConfig["cloud"];
|
|
749
|
+
/** System prompt sent with each request */
|
|
744
750
|
systemPrompt?: string;
|
|
745
751
|
/** @deprecated Use useTools() hook instead */
|
|
746
752
|
tools?: ToolsConfig;
|
|
753
|
+
/** Thread ID for conversation persistence */
|
|
747
754
|
threadId?: string;
|
|
755
|
+
/** Initial messages to populate the chat */
|
|
748
756
|
initialMessages?: Message[];
|
|
757
|
+
/** Callback when messages change */
|
|
749
758
|
onMessagesChange?: (messages: Message[]) => void;
|
|
759
|
+
/** Callback when an error occurs */
|
|
750
760
|
onError?: (error: Error) => void;
|
|
751
761
|
/** Enable/disable streaming (default: true) */
|
|
752
762
|
streaming?: boolean;
|
|
763
|
+
/** Enable debug logging */
|
|
753
764
|
debug?: boolean;
|
|
765
|
+
/** Max tool execution iterations (default: 20) */
|
|
766
|
+
maxIterations?: number;
|
|
754
767
|
}
|
|
755
768
|
interface CopilotContextValue {
|
|
756
769
|
messages: UIMessage[];
|
|
@@ -779,7 +792,7 @@ interface CopilotContextValue {
|
|
|
779
792
|
toolsConfig?: ToolsConfig;
|
|
780
793
|
}
|
|
781
794
|
declare function useCopilot(): CopilotContextValue;
|
|
782
|
-
declare function CopilotProvider({ children, runtimeUrl,
|
|
795
|
+
declare function CopilotProvider({ children, runtimeUrl, systemPrompt, tools: toolsConfig, threadId, initialMessages, onMessagesChange, onError, streaming, debug, maxIterations, }: CopilotProviderProps): react_jsx_runtime.JSX.Element;
|
|
783
796
|
|
|
784
797
|
/**
|
|
785
798
|
* Chat UI state interface (UI-only state, not message data)
|
|
@@ -2207,4 +2220,4 @@ interface UseChatReturn {
|
|
|
2207
2220
|
*/
|
|
2208
2221
|
declare function useChat(config: UseChatConfig): UseChatReturn;
|
|
2209
2222
|
|
|
2210
|
-
export { type AIContextItem, AbstractAgentLoop, AbstractChat, ActionDefinition, type AgentLoopActions, type AgentLoopCallbacks, type AgentLoopState, AsyncThreadStorageAdapter, type CapabilitiesResponse, CapturedContext, type ChatActions, type ChatCallbacks, type ChatConfig, type ChatState, type ChatStatus, type ToolExecution as ChatToolExecution, type ToolResponse as ChatToolResponse, type CombinedChatState,
|
|
2223
|
+
export { type AIContextItem, AbstractAgentLoop, AbstractChat, ActionDefinition, type AgentLoopActions, type AgentLoopCallbacks, type AgentLoopState, AsyncThreadStorageAdapter, type CapabilitiesResponse, CapturedContext, type ChatActions, type ChatCallbacks, type ChatConfig, type ChatState, type ChatStatus, type ToolExecution as ChatToolExecution, type ToolResponse as ChatToolResponse, type CombinedChatState, type CopilotContextValue, CopilotProvider, type CopilotProviderProps, type AgentLoopState$1 as CoreAgentLoopState, type ChatState$1 as CoreChatState, type DevLoggerState, IntentDetectionResult, type KnowledgeBaseConfig, type KnowledgeBaseResult, type KnowledgeBaseSearchResponse, LLMConfig, Message, PermissionLevel, PermissionStorageAdapter, PermissionStorageConfig, type ProviderCapabilities, ReactChat, type ReactChatConfig, ReactChatState, ReactThreadManager, type ReactThreadManagerConfig, ReactThreadManagerState, type ServerAdapterConfig, Source, type Suggestion, Thread, ThreadData, ToolConsentRequest, ToolConsentResponse, ToolContext, ToolDefinition, ToolExecution$1 as ToolExecution, ToolResponse$1 as ToolResponse, ToolType, type ToolsActions, ToolsConfig, type ToolsState, type UIMessage, UnifiedToolCall, type UseAIToolsOptions, type UseAIToolsReturn, type UseAgentOptions, type UseAgentReturn, type UseChatConfig, type UseChatReturn, type UseKnowledgeBaseConfig, type UseSuggestionsOptions, type UseSuggestionsReturn, type UseThreadManagerConfig, type UseThreadManagerReturn, type UseToolConfig, type UseToolExecutorReturn, type UseToolWithSchemaConfig, createPermissionStorage, createReactChat, createReactChatState, createReactThreadManager, createReactThreadManagerState, createServerAdapter, createSessionPermissionCache, formatKnowledgeResultsForAI, initialAgentLoopState, searchKnowledgeBase, useAIAction, useAIActions, useAIContext, useAIContexts, useAITools, useAgent, useCapabilities, useChat, useCopilot, useDevLogger, useFeatureSupport, useKnowledgeBase, useSuggestions, useSupportedMediaTypes, useThreadManager, useTool, useToolExecutor, useToolWithSchema, useTools, useToolsWithSchema };
|
package/dist/react/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AbstractAgentLoop, AbstractChat, CopilotProvider, ReactChat, ReactChatState, ReactThreadManager, ReactThreadManagerState, createPermissionStorage, createReactChat, createReactChatState, createReactThreadManager, createReactThreadManagerState, createSessionPermissionCache, formatKnowledgeResultsForAI, initialAgentLoopState, searchKnowledgeBase, useAIAction, useAIActions, useAIContext, useAIContexts, useAITools, useAgent, useCapabilities, useChat, useCopilot, useDevLogger, useFeatureSupport, useKnowledgeBase, useSuggestions, useSupportedMediaTypes, useThreadManager, useTool, useToolExecutor, useToolWithSchema, useTools, useToolsWithSchema } from '../chunk-
|
|
1
|
+
export { AbstractAgentLoop, AbstractChat, CopilotProvider, ReactChat, ReactChatState, ReactThreadManager, ReactThreadManagerState, createPermissionStorage, createReactChat, createReactChatState, createReactThreadManager, createReactThreadManagerState, createSessionPermissionCache, formatKnowledgeResultsForAI, initialAgentLoopState, searchKnowledgeBase, useAIAction, useAIActions, useAIContext, useAIContexts, useAITools, useAgent, useCapabilities, useChat, useCopilot, useDevLogger, useFeatureSupport, useKnowledgeBase, useSuggestions, useSupportedMediaTypes, useThreadManager, useTool, useToolExecutor, useToolWithSchema, useTools, useToolsWithSchema } from '../chunk-34LUNTCZ.js';
|
|
2
2
|
export { createLocalStorageAdapter, createMemoryAdapter, createServerAdapter, generateSuggestionReason } from '../chunk-CVD3X4MN.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/ui/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDLM5KOFK_cjs = require('../chunk-DLM5KOFK.cjs');
|
|
4
4
|
var chunkMTFU6EHR_cjs = require('../chunk-MTFU6EHR.cjs');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -4915,7 +4915,7 @@ function useInternalThreadManager(config = {}) {
|
|
|
4915
4915
|
saveDebounce,
|
|
4916
4916
|
autoRestoreLastThread
|
|
4917
4917
|
};
|
|
4918
|
-
const threadManager =
|
|
4918
|
+
const threadManager = chunkDLM5KOFK_cjs.useThreadManager(threadManagerConfig);
|
|
4919
4919
|
const {
|
|
4920
4920
|
currentThread,
|
|
4921
4921
|
currentThreadId,
|
|
@@ -4925,7 +4925,7 @@ function useInternalThreadManager(config = {}) {
|
|
|
4925
4925
|
clearCurrentThread,
|
|
4926
4926
|
refreshThreads
|
|
4927
4927
|
} = threadManager;
|
|
4928
|
-
const { messages, setMessages, status, isLoading } =
|
|
4928
|
+
const { messages, setMessages, status, isLoading } = chunkDLM5KOFK_cjs.useCopilot();
|
|
4929
4929
|
const isLoadingMessagesRef = React8.useRef(false);
|
|
4930
4930
|
const savingToThreadRef = React8.useRef(null);
|
|
4931
4931
|
const lastSavedSnapshotRef = React8.useRef("");
|
|
@@ -5135,7 +5135,7 @@ function CopilotChat(props) {
|
|
|
5135
5135
|
approveToolExecution,
|
|
5136
5136
|
rejectToolExecution,
|
|
5137
5137
|
registeredTools
|
|
5138
|
-
} =
|
|
5138
|
+
} = chunkDLM5KOFK_cjs.useCopilot();
|
|
5139
5139
|
const toolExecutions = rawToolExecutions.map(
|
|
5140
5140
|
(exec) => ({
|
|
5141
5141
|
id: exec.id,
|
package/dist/ui/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCopilot, useThreadManager } from '../chunk-
|
|
1
|
+
import { useCopilot, useThreadManager } from '../chunk-34LUNTCZ.js';
|
|
2
2
|
import { createServerAdapter } from '../chunk-CVD3X4MN.js';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|