@copilotkit/react-core 1.50.1-next.0 → 1.50.1-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/CHANGELOG.md +8 -0
- package/dist/{chunk-BTZ3TJVX.mjs → chunk-4RRMC7L2.mjs} +4 -4
- package/dist/{chunk-JZN7YOPM.mjs → chunk-4YZA2BZC.mjs} +13 -13
- package/dist/{chunk-U2ZRVVKT.mjs → chunk-BUSWSDYO.mjs} +2 -2
- package/dist/{chunk-T2VBHAAP.mjs → chunk-CDUIA2WM.mjs} +11 -3
- package/dist/chunk-CDUIA2WM.mjs.map +1 -0
- package/dist/{chunk-4HRUQH6U.mjs → chunk-E7SE25ZU.mjs} +2 -2
- package/dist/{chunk-EG56H77V.mjs → chunk-GPEJNVE5.mjs} +2 -2
- package/dist/{chunk-7HI6VLJJ.mjs → chunk-HE22TZMF.mjs} +4 -4
- package/dist/{chunk-FESRCHUE.mjs → chunk-LCZZ7YGZ.mjs} +2 -2
- package/dist/{chunk-SNON4QA6.mjs → chunk-LHERIF3L.mjs} +4 -4
- package/dist/{chunk-IUNU4CUG.mjs → chunk-YTQHRJUA.mjs} +4 -4
- package/dist/components/copilot-provider/copilot-messages.mjs +2 -2
- package/dist/components/copilot-provider/copilotkit.mjs +7 -7
- package/dist/components/copilot-provider/index.mjs +7 -7
- package/dist/components/error-boundary/error-boundary.mjs +2 -2
- package/dist/components/index.mjs +7 -7
- package/dist/context/index.mjs +5 -5
- package/dist/hooks/index.js +9 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +11 -11
- package/dist/hooks/use-coagent-state-render-bridge.mjs +1 -1
- package/dist/hooks/use-coagent-state-render.mjs +2 -2
- package/dist/hooks/use-copilot-action.js +9 -1
- package/dist/hooks/use-copilot-action.js.map +1 -1
- package/dist/hooks/use-copilot-action.mjs +2 -2
- package/dist/hooks/use-copilot-authenticated-action.js +9 -1
- package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
- package/dist/hooks/use-copilot-authenticated-action.mjs +3 -3
- package/dist/hooks/use-copilot-chat-headless_c.mjs +3 -3
- package/dist/hooks/use-copilot-chat.mjs +3 -3
- package/dist/hooks/use-copilot-chat_internal.mjs +3 -3
- package/dist/hooks/use-default-tool.js +9 -1
- package/dist/hooks/use-default-tool.js.map +1 -1
- package/dist/hooks/use-default-tool.mjs +3 -3
- package/dist/hooks/use-frontend-tool.js +9 -1
- package/dist/hooks/use-frontend-tool.js.map +1 -1
- package/dist/hooks/use-frontend-tool.mjs +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.mjs +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +2 -2
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -36
- package/dist/lib/copilot-task.mjs +8 -8
- package/dist/lib/index.mjs +8 -8
- package/package.json +3 -3
- package/src/hooks/use-frontend-tool.ts +13 -2
- package/dist/chunk-T2VBHAAP.mjs.map +0 -1
- /package/dist/{chunk-BTZ3TJVX.mjs.map → chunk-4RRMC7L2.mjs.map} +0 -0
- /package/dist/{chunk-JZN7YOPM.mjs.map → chunk-4YZA2BZC.mjs.map} +0 -0
- /package/dist/{chunk-U2ZRVVKT.mjs.map → chunk-BUSWSDYO.mjs.map} +0 -0
- /package/dist/{chunk-4HRUQH6U.mjs.map → chunk-E7SE25ZU.mjs.map} +0 -0
- /package/dist/{chunk-EG56H77V.mjs.map → chunk-GPEJNVE5.mjs.map} +0 -0
- /package/dist/{chunk-7HI6VLJJ.mjs.map → chunk-HE22TZMF.mjs.map} +0 -0
- /package/dist/{chunk-FESRCHUE.mjs.map → chunk-LCZZ7YGZ.mjs.map} +0 -0
- /package/dist/{chunk-SNON4QA6.mjs.map → chunk-LHERIF3L.mjs.map} +0 -0
- /package/dist/{chunk-IUNU4CUG.mjs.map → chunk-YTQHRJUA.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CopilotContext
|
|
3
|
-
} from "./chunk-AFNWX62Q.mjs";
|
|
4
1
|
import {
|
|
5
2
|
useToast
|
|
6
3
|
} from "./chunk-EFL5OBKN.mjs";
|
|
4
|
+
import {
|
|
5
|
+
CopilotContext
|
|
6
|
+
} from "./chunk-AFNWX62Q.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__spreadProps,
|
|
9
9
|
__spreadValues
|
|
@@ -29,4 +29,4 @@ function useLangGraphInterrupt(action, dependencies) {
|
|
|
29
29
|
export {
|
|
30
30
|
useLangGraphInterrupt
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
32
|
+
//# sourceMappingURL=chunk-4RRMC7L2.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotErrorBoundary
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LHERIF3L.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CopilotMessages,
|
|
6
6
|
MessagesTapProvider
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HE22TZMF.mjs";
|
|
8
8
|
import {
|
|
9
9
|
shouldShowDevConsole
|
|
10
10
|
} from "./chunk-ICIK2BSB.mjs";
|
|
@@ -14,19 +14,9 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
use_flat_category_store_default
|
|
16
16
|
} from "./chunk-YYN33GSG.mjs";
|
|
17
|
-
import {
|
|
18
|
-
UsageBanner,
|
|
19
|
-
getErrorActions
|
|
20
|
-
} from "./chunk-6ZLPNY7X.mjs";
|
|
21
17
|
import {
|
|
22
18
|
CoAgentStateRenderBridge
|
|
23
19
|
} from "./chunk-QNUAXSDP.mjs";
|
|
24
|
-
import {
|
|
25
|
-
CoAgentStateRendersProvider
|
|
26
|
-
} from "./chunk-FDOMAPJY.mjs";
|
|
27
|
-
import {
|
|
28
|
-
CopilotContext
|
|
29
|
-
} from "./chunk-AFNWX62Q.mjs";
|
|
30
20
|
import {
|
|
31
21
|
ThreadsProvider,
|
|
32
22
|
useThreads
|
|
@@ -37,6 +27,16 @@ import {
|
|
|
37
27
|
import {
|
|
38
28
|
ToastProvider
|
|
39
29
|
} from "./chunk-EFL5OBKN.mjs";
|
|
30
|
+
import {
|
|
31
|
+
UsageBanner,
|
|
32
|
+
getErrorActions
|
|
33
|
+
} from "./chunk-6ZLPNY7X.mjs";
|
|
34
|
+
import {
|
|
35
|
+
CoAgentStateRendersProvider
|
|
36
|
+
} from "./chunk-FDOMAPJY.mjs";
|
|
37
|
+
import {
|
|
38
|
+
CopilotContext
|
|
39
|
+
} from "./chunk-AFNWX62Q.mjs";
|
|
40
40
|
import {
|
|
41
41
|
__async,
|
|
42
42
|
__objRest,
|
|
@@ -548,4 +548,4 @@ export {
|
|
|
548
548
|
CopilotKitInternal,
|
|
549
549
|
defaultCopilotContextCategories
|
|
550
550
|
};
|
|
551
|
-
//# sourceMappingURL=chunk-
|
|
551
|
+
//# sourceMappingURL=chunk-4YZA2BZC.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotAction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GPEJNVE5.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__spreadProps,
|
|
6
6
|
__spreadValues
|
|
@@ -14,4 +14,4 @@ function useDefaultTool(tool, dependencies) {
|
|
|
14
14
|
export {
|
|
15
15
|
useDefaultTool
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-BUSWSDYO.mjs.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-SKC7AJIV.mjs";
|
|
5
5
|
|
|
6
6
|
// src/hooks/use-frontend-tool.ts
|
|
7
|
-
import React from "react";
|
|
7
|
+
import React, { useEffect, useRef } from "react";
|
|
8
8
|
import { getZodParameters } from "@copilotkit/shared";
|
|
9
9
|
import { parseJson } from "@copilotkit/shared";
|
|
10
10
|
import {
|
|
@@ -36,11 +36,19 @@ function useFrontendTool(tool, dependencies) {
|
|
|
36
36
|
return rendered != null ? rendered : null;
|
|
37
37
|
};
|
|
38
38
|
})();
|
|
39
|
+
const handlerRef = useRef(tool.handler);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
handlerRef.current = tool.handler;
|
|
42
|
+
}, [tool.handler, ...dependencies != null ? dependencies : []]);
|
|
43
|
+
const normalizedHandler = tool.handler ? (args) => {
|
|
44
|
+
var _a;
|
|
45
|
+
return (_a = handlerRef.current) == null ? void 0 : _a.call(handlerRef, args);
|
|
46
|
+
} : void 0;
|
|
39
47
|
useFrontendToolVNext({
|
|
40
48
|
name,
|
|
41
49
|
description,
|
|
42
50
|
parameters: zodParameters,
|
|
43
|
-
handler:
|
|
51
|
+
handler: normalizedHandler,
|
|
44
52
|
followUp,
|
|
45
53
|
render: normalizedRender
|
|
46
54
|
});
|
|
@@ -49,4 +57,4 @@ function useFrontendTool(tool, dependencies) {
|
|
|
49
57
|
export {
|
|
50
58
|
useFrontendTool
|
|
51
59
|
};
|
|
52
|
-
//# sourceMappingURL=chunk-
|
|
60
|
+
//# sourceMappingURL=chunk-CDUIA2WM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-frontend-tool.ts"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\nimport { ActionRenderProps, FrontendAction } from \"../types/frontend-action\";\nimport { Parameter, getZodParameters, MappedParameterTypes } from \"@copilotkit/shared\";\nimport { parseJson } from \"@copilotkit/shared\";\nimport { ToolCallStatus } from \"@copilotkitnext/core\";\nimport {\n type ReactFrontendTool,\n useFrontendTool as useFrontendToolVNext,\n} from \"@copilotkitnext/react\";\n\ntype FrontendToolOptions<T extends Parameter[] | []> = ReactFrontendTool<MappedParameterTypes<T>>;\ntype FrontendToolRenderArgs<T extends Parameter[] | []> =\n | {\n name: string;\n args: Partial<MappedParameterTypes<T>>;\n status: ToolCallStatus.InProgress;\n result: undefined;\n }\n | {\n name: string;\n args: MappedParameterTypes<T>;\n status: ToolCallStatus.Executing;\n result: undefined;\n }\n | {\n name: string;\n args: MappedParameterTypes<T>;\n status: ToolCallStatus.Complete;\n result: string;\n };\n\nexport type UseFrontendToolArgs<T extends Parameter[] | [] = []> = {\n available?: \"disabled\" | \"enabled\";\n} & Pick<\n FrontendAction<T>,\n \"name\" | \"description\" | \"parameters\" | \"handler\" | \"followUp\" | \"render\"\n>;\n\nexport function useFrontendTool<const T extends Parameter[] = []>(\n tool: UseFrontendToolArgs<T>,\n dependencies?: any[],\n) {\n const { name, description, parameters, render, followUp } = tool;\n const zodParameters = getZodParameters(parameters);\n\n const normalizedRender: FrontendToolOptions<T>[\"render\"] | undefined = (() => {\n if (typeof render === \"undefined\") {\n return undefined;\n }\n\n if (typeof render === \"string\") {\n const staticRender = render;\n return (() =>\n React.createElement(\n React.Fragment,\n null,\n staticRender,\n )) as FrontendToolOptions<T>[\"render\"];\n }\n\n return ((args: FrontendToolRenderArgs<T>) => {\n const renderArgs = {\n ...args,\n result: typeof args.result === \"string\" ? parseJson(args.result, args.result) : args.result,\n } as ActionRenderProps<T>;\n\n const rendered = render(renderArgs);\n\n if (typeof rendered === \"string\") {\n return React.createElement(React.Fragment, null, rendered);\n }\n\n return rendered ?? null;\n }) as FrontendToolOptions<T>[\"render\"];\n })();\n\n // Handler ref to avoid stale closures\n const handlerRef = useRef<typeof tool.handler>(tool.handler);\n\n useEffect(() => {\n handlerRef.current = tool.handler;\n }, [tool.handler, ...(dependencies ?? [])]);\n\n const normalizedHandler = tool.handler\n ? (args: MappedParameterTypes<T>) => handlerRef.current?.(args)\n : undefined;\n\n useFrontendToolVNext<MappedParameterTypes<T>>({\n name,\n description,\n parameters: zodParameters,\n handler: normalizedHandler,\n followUp,\n render: normalizedRender,\n });\n}\n"],"mappings":";;;;;;AAAA,OAAO,SAAS,WAAW,cAAc;AAEzC,SAAoB,wBAA8C;AAClE,SAAS,iBAAiB;AAE1B;AAAA,EAEE,mBAAmB;AAAA,OACd;AA8BA,SAAS,gBACd,MACA,cACA;AACA,QAAM,EAAE,MAAM,aAAa,YAAY,QAAQ,SAAS,IAAI;AAC5D,QAAM,gBAAgB,iBAAiB,UAAU;AAEjD,QAAM,oBAAkE,MAAM;AAC5E,QAAI,OAAO,WAAW,aAAa;AACjC,aAAO;AAAA,IACT;AAEA,QAAI,OAAO,WAAW,UAAU;AAC9B,YAAM,eAAe;AACrB,aAAQ,MACN,MAAM;AAAA,QACJ,MAAM;AAAA,QACN;AAAA,QACA;AAAA,MACF;AAAA,IACJ;AAEA,WAAQ,CAAC,SAAoC;AAC3C,YAAM,aAAa,iCACd,OADc;AAAA,QAEjB,QAAQ,OAAO,KAAK,WAAW,WAAW,UAAU,KAAK,QAAQ,KAAK,MAAM,IAAI,KAAK;AAAA,MACvF;AAEA,YAAM,WAAW,OAAO,UAAU;AAElC,UAAI,OAAO,aAAa,UAAU;AAChC,eAAO,MAAM,cAAc,MAAM,UAAU,MAAM,QAAQ;AAAA,MAC3D;AAEA,aAAO,8BAAY;AAAA,IACrB;AAAA,EACF,GAAG;AAGH,QAAM,aAAa,OAA4B,KAAK,OAAO;AAE3D,YAAU,MAAM;AACd,eAAW,UAAU,KAAK;AAAA,EAC5B,GAAG,CAAC,KAAK,SAAS,GAAI,sCAAgB,CAAC,CAAE,CAAC;AAE1C,QAAM,oBAAoB,KAAK,UAC3B,CAAC,SAA+B;AApFtC;AAoFyC,4BAAW,YAAX,oCAAqB;AAAA,MACxD;AAEJ,uBAA8C;AAAA,IAC5C;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,SAAS;AAAA,IACT;AAAA,IACA,QAAQ;AAAA,EACV,CAAC;AACH;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotAction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GPEJNVE5.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useCopilotContext
|
|
6
6
|
} from "./chunk-AFNWX62Q.mjs";
|
|
@@ -56,4 +56,4 @@ function useCopilotAuthenticatedAction_c(action, dependencies) {
|
|
|
56
56
|
export {
|
|
57
57
|
useCopilotAuthenticatedAction_c
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-E7SE25ZU.mjs.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-NBK4KBLX.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useFrontendTool
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CDUIA2WM.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useHumanInTheLoop
|
|
9
9
|
} from "./chunk-7DTB7S5V.mjs";
|
|
@@ -77,4 +77,4 @@ function useCopilotAction(action, dependencies) {
|
|
|
77
77
|
export {
|
|
78
78
|
useCopilotAction
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-GPEJNVE5.mjs.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
shouldShowDevConsole
|
|
3
3
|
} from "./chunk-ICIK2BSB.mjs";
|
|
4
|
+
import {
|
|
5
|
+
useToast
|
|
6
|
+
} from "./chunk-EFL5OBKN.mjs";
|
|
4
7
|
import {
|
|
5
8
|
useCopilotContext
|
|
6
9
|
} from "./chunk-AFNWX62Q.mjs";
|
|
7
10
|
import {
|
|
8
11
|
CopilotMessagesContext
|
|
9
12
|
} from "./chunk-DMLQZG75.mjs";
|
|
10
|
-
import {
|
|
11
|
-
useToast
|
|
12
|
-
} from "./chunk-EFL5OBKN.mjs";
|
|
13
13
|
import {
|
|
14
14
|
__async
|
|
15
15
|
} from "./chunk-SKC7AJIV.mjs";
|
|
@@ -183,4 +183,4 @@ export {
|
|
|
183
183
|
MessagesTapProvider,
|
|
184
184
|
CopilotMessages
|
|
185
185
|
};
|
|
186
|
-
//# sourceMappingURL=chunk-
|
|
186
|
+
//# sourceMappingURL=chunk-HE22TZMF.mjs.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-4CEQJ2X6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
defaultCopilotContextCategories
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4YZA2BZC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__async,
|
|
9
9
|
__spreadValues
|
|
@@ -117,4 +117,4 @@ ${instructions}
|
|
|
117
117
|
export {
|
|
118
118
|
CopilotTask
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-LCZZ7YGZ.mjs.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StatusChecker
|
|
3
3
|
} from "./chunk-PMAFHQ7P.mjs";
|
|
4
|
+
import {
|
|
5
|
+
useErrorToast
|
|
6
|
+
} from "./chunk-6PUNP7CD.mjs";
|
|
4
7
|
import {
|
|
5
8
|
UsageBanner,
|
|
6
9
|
getErrorActions
|
|
7
10
|
} from "./chunk-6ZLPNY7X.mjs";
|
|
8
|
-
import {
|
|
9
|
-
useErrorToast
|
|
10
|
-
} from "./chunk-6PUNP7CD.mjs";
|
|
11
11
|
|
|
12
12
|
// src/components/error-boundary/error-boundary.tsx
|
|
13
13
|
import React, { useEffect } from "react";
|
|
@@ -80,4 +80,4 @@ export {
|
|
|
80
80
|
CopilotErrorBoundary,
|
|
81
81
|
ErrorToast
|
|
82
82
|
};
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-LHERIF3L.mjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useToast
|
|
3
|
+
} from "./chunk-EFL5OBKN.mjs";
|
|
1
4
|
import {
|
|
2
5
|
useCoAgentStateRenders
|
|
3
6
|
} from "./chunk-FDOMAPJY.mjs";
|
|
4
7
|
import {
|
|
5
8
|
CopilotContext
|
|
6
9
|
} from "./chunk-AFNWX62Q.mjs";
|
|
7
|
-
import {
|
|
8
|
-
useToast
|
|
9
|
-
} from "./chunk-EFL5OBKN.mjs";
|
|
10
10
|
|
|
11
11
|
// src/hooks/use-coagent-state-render.ts
|
|
12
12
|
import { useRef, useContext, useEffect } from "react";
|
|
@@ -83,4 +83,4 @@ function useCoAgentStateRender(action, dependencies) {
|
|
|
83
83
|
export {
|
|
84
84
|
useCoAgentStateRender
|
|
85
85
|
};
|
|
86
|
-
//# sourceMappingURL=chunk-
|
|
86
|
+
//# sourceMappingURL=chunk-YTQHRJUA.mjs.map
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
CopilotMessages,
|
|
3
3
|
MessagesTapProvider,
|
|
4
4
|
useMessagesTap
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-HE22TZMF.mjs";
|
|
6
6
|
import "../../chunk-ICIK2BSB.mjs";
|
|
7
|
+
import "../../chunk-EFL5OBKN.mjs";
|
|
7
8
|
import "../../chunk-AFNWX62Q.mjs";
|
|
8
9
|
import "../../chunk-DMLQZG75.mjs";
|
|
9
|
-
import "../../chunk-EFL5OBKN.mjs";
|
|
10
10
|
import "../../chunk-SKC7AJIV.mjs";
|
|
11
11
|
export {
|
|
12
12
|
CopilotMessages,
|
|
@@ -2,26 +2,26 @@ import {
|
|
|
2
2
|
CopilotKit,
|
|
3
3
|
CopilotKitInternal,
|
|
4
4
|
defaultCopilotContextCategories
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-4YZA2BZC.mjs";
|
|
6
|
+
import "../../chunk-LHERIF3L.mjs";
|
|
7
|
+
import "../../chunk-HE22TZMF.mjs";
|
|
8
8
|
import "../../chunk-CYDWEPFL.mjs";
|
|
9
9
|
import "../../chunk-2IDV5OHF.mjs";
|
|
10
10
|
import "../../chunk-ICIK2BSB.mjs";
|
|
11
11
|
import "../../chunk-RKTVJRK7.mjs";
|
|
12
12
|
import "../../chunk-PMAFHQ7P.mjs";
|
|
13
13
|
import "../../chunk-YYN33GSG.mjs";
|
|
14
|
-
import "../../chunk-6ZLPNY7X.mjs";
|
|
15
14
|
import "../../chunk-6PUNP7CD.mjs";
|
|
16
15
|
import "../../chunk-O7ARI5CV.mjs";
|
|
17
16
|
import "../../chunk-QNUAXSDP.mjs";
|
|
18
17
|
import "../../chunk-NB2FKV2V.mjs";
|
|
19
|
-
import "../../chunk-FDOMAPJY.mjs";
|
|
20
|
-
import "../../chunk-AFNWX62Q.mjs";
|
|
21
|
-
import "../../chunk-DMLQZG75.mjs";
|
|
22
18
|
import "../../chunk-F555TVE4.mjs";
|
|
23
19
|
import "../../chunk-WF65O6HX.mjs";
|
|
24
20
|
import "../../chunk-EFL5OBKN.mjs";
|
|
21
|
+
import "../../chunk-6ZLPNY7X.mjs";
|
|
22
|
+
import "../../chunk-FDOMAPJY.mjs";
|
|
23
|
+
import "../../chunk-AFNWX62Q.mjs";
|
|
24
|
+
import "../../chunk-DMLQZG75.mjs";
|
|
25
25
|
import "../../chunk-SKC7AJIV.mjs";
|
|
26
26
|
export {
|
|
27
27
|
CopilotKit,
|
|
@@ -2,26 +2,26 @@ import "../../chunk-SPCZTZCY.mjs";
|
|
|
2
2
|
import {
|
|
3
3
|
CopilotKit,
|
|
4
4
|
defaultCopilotContextCategories
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-4YZA2BZC.mjs";
|
|
6
|
+
import "../../chunk-LHERIF3L.mjs";
|
|
7
|
+
import "../../chunk-HE22TZMF.mjs";
|
|
8
8
|
import "../../chunk-CYDWEPFL.mjs";
|
|
9
9
|
import "../../chunk-2IDV5OHF.mjs";
|
|
10
10
|
import "../../chunk-ICIK2BSB.mjs";
|
|
11
11
|
import "../../chunk-RKTVJRK7.mjs";
|
|
12
12
|
import "../../chunk-PMAFHQ7P.mjs";
|
|
13
13
|
import "../../chunk-YYN33GSG.mjs";
|
|
14
|
-
import "../../chunk-6ZLPNY7X.mjs";
|
|
15
14
|
import "../../chunk-6PUNP7CD.mjs";
|
|
16
15
|
import "../../chunk-O7ARI5CV.mjs";
|
|
17
16
|
import "../../chunk-QNUAXSDP.mjs";
|
|
18
17
|
import "../../chunk-NB2FKV2V.mjs";
|
|
19
|
-
import "../../chunk-FDOMAPJY.mjs";
|
|
20
|
-
import "../../chunk-AFNWX62Q.mjs";
|
|
21
|
-
import "../../chunk-DMLQZG75.mjs";
|
|
22
18
|
import "../../chunk-F555TVE4.mjs";
|
|
23
19
|
import "../../chunk-WF65O6HX.mjs";
|
|
24
20
|
import "../../chunk-EFL5OBKN.mjs";
|
|
21
|
+
import "../../chunk-6ZLPNY7X.mjs";
|
|
22
|
+
import "../../chunk-FDOMAPJY.mjs";
|
|
23
|
+
import "../../chunk-AFNWX62Q.mjs";
|
|
24
|
+
import "../../chunk-DMLQZG75.mjs";
|
|
25
25
|
import "../../chunk-SKC7AJIV.mjs";
|
|
26
26
|
export {
|
|
27
27
|
CopilotKit,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotErrorBoundary,
|
|
3
3
|
ErrorToast
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-LHERIF3L.mjs";
|
|
5
5
|
import "../../chunk-PMAFHQ7P.mjs";
|
|
6
|
-
import "../../chunk-6ZLPNY7X.mjs";
|
|
7
6
|
import "../../chunk-6PUNP7CD.mjs";
|
|
8
7
|
import "../../chunk-O7ARI5CV.mjs";
|
|
9
8
|
import "../../chunk-EFL5OBKN.mjs";
|
|
9
|
+
import "../../chunk-6ZLPNY7X.mjs";
|
|
10
10
|
import "../../chunk-SKC7AJIV.mjs";
|
|
11
11
|
export {
|
|
12
12
|
CopilotErrorBoundary,
|
|
@@ -3,26 +3,26 @@ import "../chunk-SPCZTZCY.mjs";
|
|
|
3
3
|
import {
|
|
4
4
|
CopilotKit,
|
|
5
5
|
defaultCopilotContextCategories
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-4YZA2BZC.mjs";
|
|
7
|
+
import "../chunk-LHERIF3L.mjs";
|
|
8
|
+
import "../chunk-HE22TZMF.mjs";
|
|
9
9
|
import "../chunk-CYDWEPFL.mjs";
|
|
10
10
|
import "../chunk-2IDV5OHF.mjs";
|
|
11
11
|
import "../chunk-ICIK2BSB.mjs";
|
|
12
12
|
import "../chunk-RKTVJRK7.mjs";
|
|
13
13
|
import "../chunk-PMAFHQ7P.mjs";
|
|
14
14
|
import "../chunk-YYN33GSG.mjs";
|
|
15
|
-
import "../chunk-6ZLPNY7X.mjs";
|
|
16
15
|
import "../chunk-6PUNP7CD.mjs";
|
|
17
16
|
import "../chunk-O7ARI5CV.mjs";
|
|
18
17
|
import "../chunk-QNUAXSDP.mjs";
|
|
19
18
|
import "../chunk-NB2FKV2V.mjs";
|
|
20
|
-
import "../chunk-FDOMAPJY.mjs";
|
|
21
|
-
import "../chunk-AFNWX62Q.mjs";
|
|
22
|
-
import "../chunk-DMLQZG75.mjs";
|
|
23
19
|
import "../chunk-F555TVE4.mjs";
|
|
24
20
|
import "../chunk-WF65O6HX.mjs";
|
|
25
21
|
import "../chunk-EFL5OBKN.mjs";
|
|
22
|
+
import "../chunk-6ZLPNY7X.mjs";
|
|
23
|
+
import "../chunk-FDOMAPJY.mjs";
|
|
24
|
+
import "../chunk-AFNWX62Q.mjs";
|
|
25
|
+
import "../chunk-DMLQZG75.mjs";
|
|
26
26
|
import "../chunk-SKC7AJIV.mjs";
|
|
27
27
|
export {
|
|
28
28
|
CopilotKit,
|
package/dist/context/index.mjs
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import "../chunk-NB2FKV2V.mjs";
|
|
2
|
+
import {
|
|
3
|
+
ThreadsContext,
|
|
4
|
+
ThreadsProvider,
|
|
5
|
+
useThreads
|
|
6
|
+
} from "../chunk-F555TVE4.mjs";
|
|
2
7
|
import {
|
|
3
8
|
CoAgentStateRendersContext,
|
|
4
9
|
CoAgentStateRendersProvider,
|
|
@@ -12,11 +17,6 @@ import {
|
|
|
12
17
|
CopilotMessagesContext,
|
|
13
18
|
useCopilotMessagesContext
|
|
14
19
|
} from "../chunk-DMLQZG75.mjs";
|
|
15
|
-
import {
|
|
16
|
-
ThreadsContext,
|
|
17
|
-
ThreadsProvider,
|
|
18
|
-
useThreads
|
|
19
|
-
} from "../chunk-F555TVE4.mjs";
|
|
20
20
|
import "../chunk-SKC7AJIV.mjs";
|
|
21
21
|
export {
|
|
22
22
|
CoAgentStateRendersContext,
|
package/dist/hooks/index.js
CHANGED
|
@@ -1069,11 +1069,19 @@ function useFrontendTool(tool, dependencies) {
|
|
|
1069
1069
|
return rendered != null ? rendered : null;
|
|
1070
1070
|
};
|
|
1071
1071
|
})();
|
|
1072
|
+
const handlerRef = (0, import_react16.useRef)(tool.handler);
|
|
1073
|
+
(0, import_react16.useEffect)(() => {
|
|
1074
|
+
handlerRef.current = tool.handler;
|
|
1075
|
+
}, [tool.handler, ...dependencies != null ? dependencies : []]);
|
|
1076
|
+
const normalizedHandler = tool.handler ? (args) => {
|
|
1077
|
+
var _a;
|
|
1078
|
+
return (_a = handlerRef.current) == null ? void 0 : _a.call(handlerRef, args);
|
|
1079
|
+
} : void 0;
|
|
1072
1080
|
(0, import_react17.useFrontendTool)({
|
|
1073
1081
|
name,
|
|
1074
1082
|
description,
|
|
1075
1083
|
parameters: zodParameters,
|
|
1076
|
-
handler:
|
|
1084
|
+
handler: normalizedHandler,
|
|
1077
1085
|
followUp,
|
|
1078
1086
|
render: normalizedRender
|
|
1079
1087
|
});
|