@yourgpt/copilot-sdk 2.1.5-alpha.8 → 2.1.7
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-KYVWKMUT.js → chunk-H3LX6FTP.js} +3 -3
- package/dist/{chunk-KYVWKMUT.js.map → chunk-H3LX6FTP.js.map} +1 -1
- package/dist/{chunk-JV2L3WZS.cjs → chunk-IDAQU3FP.cjs} +18 -3
- package/dist/chunk-IDAQU3FP.cjs.map +1 -0
- package/dist/{chunk-FDZVDGNR.js → chunk-ISOMZAYN.js} +18 -3
- package/dist/chunk-ISOMZAYN.js.map +1 -0
- package/dist/{chunk-KLSKP6AZ.cjs → chunk-JFVTY757.cjs} +16 -16
- package/dist/{chunk-KLSKP6AZ.cjs.map → chunk-JFVTY757.cjs.map} +1 -1
- package/dist/experimental/index.cjs +2 -2
- package/dist/experimental/index.js +1 -1
- package/dist/react/index.cjs +62 -62
- package/dist/react/index.d.cts +4 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.js +2 -2
- package/dist/styles.css +21 -0
- package/dist/ui/index.cjs +5 -5
- package/dist/ui/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-FDZVDGNR.js.map +0 -1
- package/dist/chunk-JV2L3WZS.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkIDAQU3FP_cjs = require('./chunk-IDAQU3FP.cjs');
|
|
4
4
|
var chunk7GWEW2DU_cjs = require('./chunk-7GWEW2DU.cjs');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var z = require('zod');
|
|
@@ -26,7 +26,7 @@ function _interopNamespace(e) {
|
|
|
26
26
|
var z__namespace = /*#__PURE__*/_interopNamespace(z);
|
|
27
27
|
|
|
28
28
|
function useAIActions(actions) {
|
|
29
|
-
const { registerAction, unregisterAction } =
|
|
29
|
+
const { registerAction, unregisterAction } = chunkIDAQU3FP_cjs.useCopilot();
|
|
30
30
|
react.useEffect(() => {
|
|
31
31
|
for (const action of actions) {
|
|
32
32
|
registerAction(action);
|
|
@@ -305,7 +305,7 @@ function convertZodSchema(schema, _toolName) {
|
|
|
305
305
|
return chunk7GWEW2DU_cjs.zodObjectToInputSchema(schema);
|
|
306
306
|
}
|
|
307
307
|
function useToolWithSchema(config, dependencies = []) {
|
|
308
|
-
const { registerTool, unregisterTool } =
|
|
308
|
+
const { registerTool, unregisterTool } = chunkIDAQU3FP_cjs.useCopilot();
|
|
309
309
|
const configRef = react.useRef(config);
|
|
310
310
|
configRef.current = config;
|
|
311
311
|
const inputSchema = react.useMemo(() => {
|
|
@@ -341,7 +341,7 @@ function useToolWithSchema(config, dependencies = []) {
|
|
|
341
341
|
}, [config.name, inputSchema, ...dependencies]);
|
|
342
342
|
}
|
|
343
343
|
function useToolsWithSchema(tools, dependencies = []) {
|
|
344
|
-
const { registerTool, unregisterTool } =
|
|
344
|
+
const { registerTool, unregisterTool } = chunkIDAQU3FP_cjs.useCopilot();
|
|
345
345
|
const toolsRef = react.useRef(tools);
|
|
346
346
|
toolsRef.current = tools;
|
|
347
347
|
react.useEffect(() => {
|
|
@@ -734,7 +734,7 @@ function formatKnowledgeResultsForAI(results) {
|
|
|
734
734
|
|
|
735
735
|
// src/react/hooks/useKnowledgeBase.ts
|
|
736
736
|
function useKnowledgeBase(config) {
|
|
737
|
-
const { registerTool, unregisterTool } =
|
|
737
|
+
const { registerTool, unregisterTool } = chunkIDAQU3FP_cjs.useCopilot();
|
|
738
738
|
const configRef = react.useRef(config);
|
|
739
739
|
configRef.current = config;
|
|
740
740
|
const handleSearch = react.useCallback(
|
|
@@ -1382,7 +1382,7 @@ function useThreadManager(config) {
|
|
|
1382
1382
|
|
|
1383
1383
|
// src/react/hooks/useThread.ts
|
|
1384
1384
|
function useThread() {
|
|
1385
|
-
const { threadId, setActiveThread, renewSession, sessionStatus } =
|
|
1385
|
+
const { threadId, setActiveThread, renewSession, sessionStatus } = chunkIDAQU3FP_cjs.useCopilot();
|
|
1386
1386
|
return {
|
|
1387
1387
|
threadId,
|
|
1388
1388
|
sessionStatus,
|
|
@@ -1501,7 +1501,7 @@ function getLastResponseUsage(messages) {
|
|
|
1501
1501
|
return null;
|
|
1502
1502
|
}
|
|
1503
1503
|
function useContextStats() {
|
|
1504
|
-
const { contextChars, contextUsage, registeredTools, messages } =
|
|
1504
|
+
const { contextChars, contextUsage, registeredTools, messages } = chunkIDAQU3FP_cjs.useCopilot();
|
|
1505
1505
|
const toolCount = react.useMemo(() => registeredTools.length, [registeredTools]);
|
|
1506
1506
|
const messageCount = react.useMemo(
|
|
1507
1507
|
() => messages.filter((m) => m.role !== "system").length,
|
|
@@ -1531,7 +1531,7 @@ function useContextStats() {
|
|
|
1531
1531
|
}
|
|
1532
1532
|
var DEV_CONTENT_WARN_THRESHOLD = 2e3;
|
|
1533
1533
|
function useSkill(skill) {
|
|
1534
|
-
const { register, unregister } =
|
|
1534
|
+
const { register, unregister } = chunkIDAQU3FP_cjs.useSkillContext();
|
|
1535
1535
|
if (process.env.NODE_ENV !== "production" && skill.source.type === "inline" && skill.source.content.length > DEV_CONTENT_WARN_THRESHOLD) {
|
|
1536
1536
|
console.warn(
|
|
1537
1537
|
`[copilot-sdk/skills] Inline skill "${skill.name}" has ${skill.source.content.length} characters. Inline skills are sent on every request \u2014 keep them under ${DEV_CONTENT_WARN_THRESHOLD} characters. Consider using a file or URL skill instead.`
|
|
@@ -1560,7 +1560,7 @@ function useSkill(skill) {
|
|
|
1560
1560
|
]);
|
|
1561
1561
|
}
|
|
1562
1562
|
function useSkillStatus() {
|
|
1563
|
-
const { skills, registry } =
|
|
1563
|
+
const { skills, registry } = chunkIDAQU3FP_cjs.useSkillContext();
|
|
1564
1564
|
const has = react.useCallback(
|
|
1565
1565
|
(name) => registry.has(name),
|
|
1566
1566
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1573,7 +1573,7 @@ function useSkillStatus() {
|
|
|
1573
1573
|
};
|
|
1574
1574
|
}
|
|
1575
1575
|
function useMessageCheckpoints() {
|
|
1576
|
-
const { messages, setMessages } =
|
|
1576
|
+
const { messages, setMessages } = chunkIDAQU3FP_cjs.useCopilot();
|
|
1577
1577
|
const checkpointMapRef = react.useRef(/* @__PURE__ */ new Map());
|
|
1578
1578
|
const prevUserMsgCountRef = react.useRef(0);
|
|
1579
1579
|
const [revision, bump] = react.useReducer((n) => n + 1, 0);
|
|
@@ -1746,9 +1746,9 @@ function createSessionPermissionCache() {
|
|
|
1746
1746
|
}
|
|
1747
1747
|
|
|
1748
1748
|
// src/react/internal/ReactChat.ts
|
|
1749
|
-
var ReactChat = class extends
|
|
1749
|
+
var ReactChat = class extends chunkIDAQU3FP_cjs.AbstractChat {
|
|
1750
1750
|
constructor(config) {
|
|
1751
|
-
const reactState = new
|
|
1751
|
+
const reactState = new chunkIDAQU3FP_cjs.ReactChatState(config.initialMessages);
|
|
1752
1752
|
const init = {
|
|
1753
1753
|
runtimeUrl: config.runtimeUrl,
|
|
1754
1754
|
systemPrompt: config.systemPrompt,
|
|
@@ -1997,7 +1997,7 @@ function defineSkill(def) {
|
|
|
1997
1997
|
return def;
|
|
1998
1998
|
}
|
|
1999
1999
|
function useCopilotEvent(eventType, handler) {
|
|
2000
|
-
const { subscribeToStreamEvents } =
|
|
2000
|
+
const { subscribeToStreamEvents } = chunkIDAQU3FP_cjs.useCopilot();
|
|
2001
2001
|
const handlerRef = react.useRef(handler);
|
|
2002
2002
|
handlerRef.current = handler;
|
|
2003
2003
|
react.useEffect(() => {
|
|
@@ -2011,7 +2011,7 @@ function useCopilotEvent(eventType, handler) {
|
|
|
2011
2011
|
}
|
|
2012
2012
|
var EMPTY_META = {};
|
|
2013
2013
|
function useMessageMeta(messageId) {
|
|
2014
|
-
const { messageMeta } =
|
|
2014
|
+
const { messageMeta } = chunkIDAQU3FP_cjs.useCopilot();
|
|
2015
2015
|
const meta = react.useSyncExternalStore(
|
|
2016
2016
|
messageMeta.subscribe,
|
|
2017
2017
|
() => messageId ? messageMeta.getMeta(messageId) : EMPTY_META,
|
|
@@ -2073,5 +2073,5 @@ exports.useThreadManager = useThreadManager;
|
|
|
2073
2073
|
exports.useToolExecutor = useToolExecutor;
|
|
2074
2074
|
exports.useToolWithSchema = useToolWithSchema;
|
|
2075
2075
|
exports.useToolsWithSchema = useToolsWithSchema;
|
|
2076
|
-
//# sourceMappingURL=chunk-
|
|
2077
|
-
//# sourceMappingURL=chunk-
|
|
2076
|
+
//# sourceMappingURL=chunk-JFVTY757.cjs.map
|
|
2077
|
+
//# sourceMappingURL=chunk-JFVTY757.cjs.map
|