@yourgpt/copilot-sdk 1.4.32 → 1.4.34
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 +9 -1
- package/dist/{chunk-CVKN4H62.cjs → chunk-4PRWNAXQ.cjs} +161 -52
- package/dist/chunk-4PRWNAXQ.cjs.map +1 -0
- package/dist/{chunk-B7SF5SGS.cjs → chunk-BLSI67J6.cjs} +40 -40
- package/dist/chunk-BLSI67J6.cjs.map +1 -0
- package/dist/{chunk-VZ4RYZQT.js → chunk-CJ7UWN2Y.js} +16 -16
- 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.js +2 -2
- package/dist/styles.css +92 -0
- package/dist/ui/index.cjs +190 -320
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.cts +2 -2
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +186 -316
- package/dist/ui/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-55EABH45.js.map +0 -1
- package/dist/chunk-B7SF5SGS.cjs.map +0 -1
- package/dist/chunk-CVKN4H62.cjs.map +0 -1
- package/dist/chunk-VZ4RYZQT.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThreadManager, isConsoleCaptureActive, startConsoleCapture, isNetworkCaptureActive, startNetworkCapture, stopConsoleCapture, stopNetworkCapture, isScreenshotSupported, captureScreenshot, getConsoleLogs, getNetworkRequests, clearConsoleLogs, clearNetworkRequests, formatLogsForAI, formatRequestsForAI, detectIntent, streamSSE, zodObjectToInputSchema } from './chunk-
|
|
1
|
+
import { ThreadManager, isConsoleCaptureActive, startConsoleCapture, isNetworkCaptureActive, startNetworkCapture, stopConsoleCapture, stopNetworkCapture, isScreenshotSupported, captureScreenshot, getConsoleLogs, getNetworkRequests, clearConsoleLogs, clearNetworkRequests, formatLogsForAI, formatRequestsForAI, detectIntent, streamSSE, zodObjectToInputSchema } from './chunk-JM7PB2LP.js';
|
|
2
2
|
import { createContext, useContext, useCallback, useEffect, useState, useRef, useSyncExternalStore, useMemo } from 'react';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import * as z from 'zod';
|
|
@@ -2509,16 +2509,6 @@ function useTools(tools) {
|
|
|
2509
2509
|
};
|
|
2510
2510
|
}, [toolsKey]);
|
|
2511
2511
|
}
|
|
2512
|
-
var CopilotContext2 = createContext(null);
|
|
2513
|
-
function useCopilotContext() {
|
|
2514
|
-
const context = useContext(CopilotContext2);
|
|
2515
|
-
if (!context) {
|
|
2516
|
-
throw new Error("useCopilotContext must be used within a CopilotProvider");
|
|
2517
|
-
}
|
|
2518
|
-
return context;
|
|
2519
|
-
}
|
|
2520
|
-
|
|
2521
|
-
// src/react/hooks/useToolWithSchema.ts
|
|
2522
2512
|
function convertZodSchema(schema, _toolName) {
|
|
2523
2513
|
try {
|
|
2524
2514
|
const zodWithJsonSchema = z;
|
|
@@ -2539,7 +2529,7 @@ function convertZodSchema(schema, _toolName) {
|
|
|
2539
2529
|
return zodObjectToInputSchema(schema);
|
|
2540
2530
|
}
|
|
2541
2531
|
function useToolWithSchema(config, dependencies = []) {
|
|
2542
|
-
const { registerTool, unregisterTool } =
|
|
2532
|
+
const { registerTool, unregisterTool } = useCopilot();
|
|
2543
2533
|
const configRef = useRef(config);
|
|
2544
2534
|
configRef.current = config;
|
|
2545
2535
|
const inputSchema = useMemo(() => {
|
|
@@ -2575,7 +2565,7 @@ function useToolWithSchema(config, dependencies = []) {
|
|
|
2575
2565
|
}, [config.name, inputSchema, ...dependencies]);
|
|
2576
2566
|
}
|
|
2577
2567
|
function useToolsWithSchema(tools, dependencies = []) {
|
|
2578
|
-
const { registerTool, unregisterTool } =
|
|
2568
|
+
const { registerTool, unregisterTool } = useCopilot();
|
|
2579
2569
|
const toolsRef = useRef(tools);
|
|
2580
2570
|
toolsRef.current = tools;
|
|
2581
2571
|
useEffect(() => {
|
|
@@ -2617,6 +2607,16 @@ function useToolsWithSchema(tools, dependencies = []) {
|
|
|
2617
2607
|
};
|
|
2618
2608
|
}, [tools.map((t) => t.name).join(","), ...dependencies]);
|
|
2619
2609
|
}
|
|
2610
|
+
var CopilotContext2 = createContext(null);
|
|
2611
|
+
function useCopilotContext() {
|
|
2612
|
+
const context = useContext(CopilotContext2);
|
|
2613
|
+
if (!context) {
|
|
2614
|
+
throw new Error("useCopilotContext must be used within a CopilotProvider");
|
|
2615
|
+
}
|
|
2616
|
+
return context;
|
|
2617
|
+
}
|
|
2618
|
+
|
|
2619
|
+
// src/react/hooks/useToolExecutor.ts
|
|
2620
2620
|
function useToolExecutor() {
|
|
2621
2621
|
const {
|
|
2622
2622
|
registeredTools,
|
|
@@ -2957,7 +2957,7 @@ function formatKnowledgeResultsForAI(results) {
|
|
|
2957
2957
|
|
|
2958
2958
|
// src/react/hooks/useKnowledgeBase.ts
|
|
2959
2959
|
function useKnowledgeBase(config) {
|
|
2960
|
-
const { registerTool, unregisterTool } =
|
|
2960
|
+
const { registerTool, unregisterTool } = useCopilot();
|
|
2961
2961
|
const configRef = useRef(config);
|
|
2962
2962
|
configRef.current = config;
|
|
2963
2963
|
const handleSearch = useCallback(
|
|
@@ -3863,5 +3863,5 @@ function useChat(config) {
|
|
|
3863
3863
|
}
|
|
3864
3864
|
|
|
3865
3865
|
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 };
|
|
3866
|
-
//# sourceMappingURL=chunk-
|
|
3867
|
-
//# sourceMappingURL=chunk-
|
|
3866
|
+
//# sourceMappingURL=chunk-CJ7UWN2Y.js.map
|
|
3867
|
+
//# sourceMappingURL=chunk-CJ7UWN2Y.js.map
|