@yourgpt/copilot-sdk 1.4.31 → 1.4.33
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/README.md +7 -1
- package/dist/{chunk-CVKN4H62.cjs → chunk-4PRWNAXQ.cjs} +161 -52
- package/dist/chunk-4PRWNAXQ.cjs.map +1 -0
- package/dist/{chunk-FCWLHNLI.cjs → chunk-BLSI67J6.cjs} +166 -62
- package/dist/chunk-BLSI67J6.cjs.map +1 -0
- package/dist/{chunk-CGBPUUOT.js → chunk-CJ7UWN2Y.js} +142 -38
- package/dist/chunk-CJ7UWN2Y.js.map +1 -0
- package/dist/{chunk-55EABH45.js → chunk-JM7PB2LP.js} +161 -52
- package/dist/chunk-JM7PB2LP.js.map +1 -0
- package/dist/core/index.cjs +76 -76
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/react/index.cjs +42 -42
- package/dist/react/index.d.cts +39 -4
- package/dist/react/index.d.ts +39 -4
- package/dist/react/index.js +2 -2
- package/dist/ui/index.cjs +6 -6
- package/dist/ui/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-55EABH45.js.map +0 -1
- package/dist/chunk-CGBPUUOT.js.map +0 -1
- package/dist/chunk-CVKN4H62.cjs.map +0 -1
- package/dist/chunk-FCWLHNLI.cjs.map +0 -1
package/dist/react/index.d.cts
CHANGED
|
@@ -638,11 +638,21 @@ declare class AbstractChat<T extends UIMessage = UIMessage> {
|
|
|
638
638
|
* Type guard for async iterable
|
|
639
639
|
*/
|
|
640
640
|
private isAsyncIterable;
|
|
641
|
-
private
|
|
641
|
+
private _isDisposed;
|
|
642
|
+
/**
|
|
643
|
+
* Whether this instance has been disposed
|
|
644
|
+
*/
|
|
645
|
+
get disposed(): boolean;
|
|
642
646
|
/**
|
|
643
647
|
* Dispose and cleanup
|
|
648
|
+
* Note: Event handlers are NOT cleared to support React StrictMode revive()
|
|
644
649
|
*/
|
|
645
650
|
dispose(): void;
|
|
651
|
+
/**
|
|
652
|
+
* Revive a disposed instance (for React StrictMode compatibility)
|
|
653
|
+
* This allows reusing an instance after dispose() was called
|
|
654
|
+
*/
|
|
655
|
+
revive(): void;
|
|
646
656
|
}
|
|
647
657
|
|
|
648
658
|
/**
|
|
@@ -707,15 +717,17 @@ declare class AbstractAgentLoop implements AgentLoopActions {
|
|
|
707
717
|
private addToolExecution;
|
|
708
718
|
private updateToolExecution;
|
|
709
719
|
/**
|
|
710
|
-
* Register a tool
|
|
720
|
+
* Register a tool (reference counted for React StrictMode compatibility)
|
|
721
|
+
* Tools are never fully removed - ref counting ensures StrictMode works correctly
|
|
711
722
|
*/
|
|
712
723
|
registerTool(tool: ToolDefinition): void;
|
|
713
724
|
/**
|
|
714
|
-
* Unregister a tool
|
|
725
|
+
* Unregister a tool (reference counted for React StrictMode compatibility)
|
|
726
|
+
* Tool is only marked inactive when refCount reaches 0, never deleted
|
|
715
727
|
*/
|
|
716
728
|
unregisterTool(name: string): void;
|
|
717
729
|
/**
|
|
718
|
-
* Get a registered tool
|
|
730
|
+
* Get a registered tool (returns active tools, or inactive if forExecution=true)
|
|
719
731
|
*/
|
|
720
732
|
getTool(name: string): ToolDefinition | undefined;
|
|
721
733
|
/**
|
|
@@ -772,7 +784,21 @@ declare class AbstractAgentLoop implements AgentLoopActions {
|
|
|
772
784
|
/**
|
|
773
785
|
* Dispose of resources
|
|
774
786
|
*/
|
|
787
|
+
private _isDisposed;
|
|
788
|
+
/**
|
|
789
|
+
* Whether this instance has been disposed
|
|
790
|
+
*/
|
|
791
|
+
get disposed(): boolean;
|
|
792
|
+
/**
|
|
793
|
+
* Dispose and cleanup
|
|
794
|
+
* Note: Tools are NOT cleared to support React StrictMode revive()
|
|
795
|
+
*/
|
|
775
796
|
dispose(): void;
|
|
797
|
+
/**
|
|
798
|
+
* Revive a disposed instance (for React StrictMode compatibility)
|
|
799
|
+
* Tools are preserved across dispose/revive cycle
|
|
800
|
+
*/
|
|
801
|
+
revive(): void;
|
|
776
802
|
}
|
|
777
803
|
|
|
778
804
|
interface CopilotProviderProps {
|
|
@@ -2097,6 +2123,11 @@ declare class ReactChatState<T extends UIMessage = UIMessage> implements ChatSta
|
|
|
2097
2123
|
* Cleanup subscriptions
|
|
2098
2124
|
*/
|
|
2099
2125
|
dispose(): void;
|
|
2126
|
+
/**
|
|
2127
|
+
* Revive after dispose (for React StrictMode compatibility)
|
|
2128
|
+
* Subscribers will be re-added automatically via useSyncExternalStore
|
|
2129
|
+
*/
|
|
2130
|
+
revive(): void;
|
|
2100
2131
|
}
|
|
2101
2132
|
/**
|
|
2102
2133
|
* Create a ReactChatState instance
|
|
@@ -2184,6 +2215,10 @@ declare class ReactChat extends AbstractChat<UIMessage> {
|
|
|
2184
2215
|
*/
|
|
2185
2216
|
onError(handler: ChatEventHandler<"error">): () => void;
|
|
2186
2217
|
dispose(): void;
|
|
2218
|
+
/**
|
|
2219
|
+
* Revive a disposed instance (for React StrictMode compatibility)
|
|
2220
|
+
*/
|
|
2221
|
+
revive(): void;
|
|
2187
2222
|
}
|
|
2188
2223
|
/**
|
|
2189
2224
|
* Create a ReactChat instance
|
package/dist/react/index.d.ts
CHANGED
|
@@ -638,11 +638,21 @@ declare class AbstractChat<T extends UIMessage = UIMessage> {
|
|
|
638
638
|
* Type guard for async iterable
|
|
639
639
|
*/
|
|
640
640
|
private isAsyncIterable;
|
|
641
|
-
private
|
|
641
|
+
private _isDisposed;
|
|
642
|
+
/**
|
|
643
|
+
* Whether this instance has been disposed
|
|
644
|
+
*/
|
|
645
|
+
get disposed(): boolean;
|
|
642
646
|
/**
|
|
643
647
|
* Dispose and cleanup
|
|
648
|
+
* Note: Event handlers are NOT cleared to support React StrictMode revive()
|
|
644
649
|
*/
|
|
645
650
|
dispose(): void;
|
|
651
|
+
/**
|
|
652
|
+
* Revive a disposed instance (for React StrictMode compatibility)
|
|
653
|
+
* This allows reusing an instance after dispose() was called
|
|
654
|
+
*/
|
|
655
|
+
revive(): void;
|
|
646
656
|
}
|
|
647
657
|
|
|
648
658
|
/**
|
|
@@ -707,15 +717,17 @@ declare class AbstractAgentLoop implements AgentLoopActions {
|
|
|
707
717
|
private addToolExecution;
|
|
708
718
|
private updateToolExecution;
|
|
709
719
|
/**
|
|
710
|
-
* Register a tool
|
|
720
|
+
* Register a tool (reference counted for React StrictMode compatibility)
|
|
721
|
+
* Tools are never fully removed - ref counting ensures StrictMode works correctly
|
|
711
722
|
*/
|
|
712
723
|
registerTool(tool: ToolDefinition): void;
|
|
713
724
|
/**
|
|
714
|
-
* Unregister a tool
|
|
725
|
+
* Unregister a tool (reference counted for React StrictMode compatibility)
|
|
726
|
+
* Tool is only marked inactive when refCount reaches 0, never deleted
|
|
715
727
|
*/
|
|
716
728
|
unregisterTool(name: string): void;
|
|
717
729
|
/**
|
|
718
|
-
* Get a registered tool
|
|
730
|
+
* Get a registered tool (returns active tools, or inactive if forExecution=true)
|
|
719
731
|
*/
|
|
720
732
|
getTool(name: string): ToolDefinition | undefined;
|
|
721
733
|
/**
|
|
@@ -772,7 +784,21 @@ declare class AbstractAgentLoop implements AgentLoopActions {
|
|
|
772
784
|
/**
|
|
773
785
|
* Dispose of resources
|
|
774
786
|
*/
|
|
787
|
+
private _isDisposed;
|
|
788
|
+
/**
|
|
789
|
+
* Whether this instance has been disposed
|
|
790
|
+
*/
|
|
791
|
+
get disposed(): boolean;
|
|
792
|
+
/**
|
|
793
|
+
* Dispose and cleanup
|
|
794
|
+
* Note: Tools are NOT cleared to support React StrictMode revive()
|
|
795
|
+
*/
|
|
775
796
|
dispose(): void;
|
|
797
|
+
/**
|
|
798
|
+
* Revive a disposed instance (for React StrictMode compatibility)
|
|
799
|
+
* Tools are preserved across dispose/revive cycle
|
|
800
|
+
*/
|
|
801
|
+
revive(): void;
|
|
776
802
|
}
|
|
777
803
|
|
|
778
804
|
interface CopilotProviderProps {
|
|
@@ -2097,6 +2123,11 @@ declare class ReactChatState<T extends UIMessage = UIMessage> implements ChatSta
|
|
|
2097
2123
|
* Cleanup subscriptions
|
|
2098
2124
|
*/
|
|
2099
2125
|
dispose(): void;
|
|
2126
|
+
/**
|
|
2127
|
+
* Revive after dispose (for React StrictMode compatibility)
|
|
2128
|
+
* Subscribers will be re-added automatically via useSyncExternalStore
|
|
2129
|
+
*/
|
|
2130
|
+
revive(): void;
|
|
2100
2131
|
}
|
|
2101
2132
|
/**
|
|
2102
2133
|
* Create a ReactChatState instance
|
|
@@ -2184,6 +2215,10 @@ declare class ReactChat extends AbstractChat<UIMessage> {
|
|
|
2184
2215
|
*/
|
|
2185
2216
|
onError(handler: ChatEventHandler<"error">): () => void;
|
|
2186
2217
|
dispose(): void;
|
|
2218
|
+
/**
|
|
2219
|
+
* Revive a disposed instance (for React StrictMode compatibility)
|
|
2220
|
+
*/
|
|
2221
|
+
revive(): void;
|
|
2187
2222
|
}
|
|
2188
2223
|
/**
|
|
2189
2224
|
* Create a ReactChat instance
|
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-
|
|
2
|
-
export { createLocalStorageAdapter, createMemoryAdapter, createServerAdapter, generateSuggestionReason } 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-CJ7UWN2Y.js';
|
|
2
|
+
export { createLocalStorageAdapter, createMemoryAdapter, createServerAdapter, generateSuggestionReason } from '../chunk-JM7PB2LP.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/ui/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkBLSI67J6_cjs = require('../chunk-BLSI67J6.cjs');
|
|
4
|
+
var chunk4PRWNAXQ_cjs = require('../chunk-4PRWNAXQ.cjs');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -5133,7 +5133,7 @@ function useInternalThreadManager(config = {}) {
|
|
|
5133
5133
|
saveDebounce,
|
|
5134
5134
|
autoRestoreLastThread
|
|
5135
5135
|
};
|
|
5136
|
-
const threadManager =
|
|
5136
|
+
const threadManager = chunkBLSI67J6_cjs.useThreadManager(threadManagerConfig);
|
|
5137
5137
|
const {
|
|
5138
5138
|
currentThread,
|
|
5139
5139
|
currentThreadId,
|
|
@@ -5143,7 +5143,7 @@ function useInternalThreadManager(config = {}) {
|
|
|
5143
5143
|
clearCurrentThread,
|
|
5144
5144
|
refreshThreads
|
|
5145
5145
|
} = threadManager;
|
|
5146
|
-
const { messages, setMessages, status, isLoading } =
|
|
5146
|
+
const { messages, setMessages, status, isLoading } = chunkBLSI67J6_cjs.useCopilot();
|
|
5147
5147
|
const isLoadingMessagesRef = React18.useRef(false);
|
|
5148
5148
|
const savingToThreadRef = React18.useRef(null);
|
|
5149
5149
|
const lastSavedSnapshotRef = React18.useRef("");
|
|
@@ -5304,7 +5304,7 @@ function parsePersistenceConfig(persistence, onThreadChange) {
|
|
|
5304
5304
|
};
|
|
5305
5305
|
case "server":
|
|
5306
5306
|
return {
|
|
5307
|
-
adapter:
|
|
5307
|
+
adapter: chunk4PRWNAXQ_cjs.createServerAdapter({
|
|
5308
5308
|
endpoint: persistence.endpoint,
|
|
5309
5309
|
headers: persistence.headers
|
|
5310
5310
|
}),
|
|
@@ -5354,7 +5354,7 @@ function CopilotChatBase(props) {
|
|
|
5354
5354
|
approveToolExecution,
|
|
5355
5355
|
rejectToolExecution,
|
|
5356
5356
|
registeredTools
|
|
5357
|
-
} =
|
|
5357
|
+
} = chunkBLSI67J6_cjs.useCopilot();
|
|
5358
5358
|
const toolExecutions = rawToolExecutions.map(
|
|
5359
5359
|
(exec) => ({
|
|
5360
5360
|
id: exec.id,
|
package/dist/ui/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useCopilot, useThreadManager } from '../chunk-
|
|
2
|
-
import { createServerAdapter } from '../chunk-
|
|
1
|
+
import { useCopilot, useThreadManager } from '../chunk-CJ7UWN2Y.js';
|
|
2
|
+
import { createServerAdapter } from '../chunk-JM7PB2LP.js';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|