@copilotkit/react-core 1.50.1-next.0 → 1.50.1-next.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/CHANGELOG.md +16 -0
- package/dist/{chunk-BTZ3TJVX.mjs → chunk-4RRMC7L2.mjs} +4 -4
- package/dist/{chunk-JZN7YOPM.mjs → chunk-4YZA2BZC.mjs} +13 -13
- package/dist/{chunk-ZE4JVTEP.mjs → chunk-53K6WNJG.mjs} +2 -2
- 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-5J7RRLRO.mjs → chunk-FQFXYAV7.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-LDEWO5XH.mjs → chunk-LSHFN2Y5.mjs} +28 -7
- package/dist/chunk-LSHFN2Y5.mjs.map +1 -0
- 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.d.ts +1 -1
- package/dist/hooks/index.js +36 -7
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +14 -14
- 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.js +27 -6
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +5 -5
- package/dist/hooks/use-copilot-chat.js +27 -6
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +5 -5
- package/dist/hooks/use-copilot-chat_internal.d.ts +24 -2
- package/dist/hooks/use-copilot-chat_internal.js +27 -6
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +4 -4
- 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.d.ts +1 -1
- package/dist/index.js +36 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -39
- package/dist/lib/copilot-task.mjs +8 -8
- package/dist/lib/index.mjs +8 -8
- package/package.json +3 -3
- package/src/hooks/index.ts +6 -1
- package/src/hooks/use-copilot-chat_internal.ts +59 -3
- package/src/hooks/use-frontend-tool.ts +13 -2
- package/dist/chunk-LDEWO5XH.mjs.map +0 -1
- 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-ZE4JVTEP.mjs.map → chunk-53K6WNJG.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-5J7RRLRO.mjs.map → chunk-FQFXYAV7.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,5 +1,21 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
+
## 1.50.1-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bdc7a8f: - fix: restore message callbacks
|
|
8
|
+
- @copilotkit/runtime-client-gql@1.50.1-next.2
|
|
9
|
+
- @copilotkit/shared@1.50.1-next.2
|
|
10
|
+
|
|
11
|
+
## 1.50.1-next.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- cfa4185: - fix: fix stale state in handler
|
|
16
|
+
- @copilotkit/runtime-client-gql@1.50.1-next.1
|
|
17
|
+
- @copilotkit/shared@1.50.1-next.1
|
|
18
|
+
|
|
3
19
|
## 1.50.1-next.0
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -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
|
useCopilotChatInternal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LSHFN2Y5.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-copilot-chat.ts
|
|
6
6
|
function useCopilotChat(options = {}) {
|
|
@@ -33,4 +33,4 @@ function useCopilotChat(options = {}) {
|
|
|
33
33
|
export {
|
|
34
34
|
useCopilotChat
|
|
35
35
|
};
|
|
36
|
-
//# sourceMappingURL=chunk-
|
|
36
|
+
//# sourceMappingURL=chunk-53K6WNJG.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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChatInternal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LSHFN2Y5.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useCopilotContext
|
|
6
6
|
} from "./chunk-AFNWX62Q.mjs";
|
|
@@ -83,4 +83,4 @@ function useCopilotChatHeadless_c(options = {}) {
|
|
|
83
83
|
export {
|
|
84
84
|
useCopilotChatHeadless_c
|
|
85
85
|
};
|
|
86
|
-
//# sourceMappingURL=chunk-
|
|
86
|
+
//# sourceMappingURL=chunk-FQFXYAV7.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
|
|
@@ -31,7 +31,11 @@ import {
|
|
|
31
31
|
} from "@copilotkitnext/react";
|
|
32
32
|
import { AGUIConnectNotImplementedError } from "@ag-ui/client";
|
|
33
33
|
function useCopilotChatInternal({
|
|
34
|
-
suggestions
|
|
34
|
+
suggestions,
|
|
35
|
+
onInProgress,
|
|
36
|
+
onSubmitMessage,
|
|
37
|
+
onStopGeneration,
|
|
38
|
+
onReloadMessages
|
|
35
39
|
} = {}) {
|
|
36
40
|
var _a, _b, _c;
|
|
37
41
|
const { copilotkit } = useCopilotKit();
|
|
@@ -60,6 +64,9 @@ function useCopilotChatInternal({
|
|
|
60
64
|
return () => {
|
|
61
65
|
};
|
|
62
66
|
}, [existingConfig == null ? void 0 : existingConfig.threadId, agent, copilotkit, resolvedAgentId]);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
onInProgress == null ? void 0 : onInProgress(Boolean(agent == null ? void 0 : agent.isRunning));
|
|
69
|
+
}, [agent == null ? void 0 : agent.isRunning, onInProgress]);
|
|
63
70
|
const interrupt = useLangGraphInterruptRender(agent);
|
|
64
71
|
const reset = () => {
|
|
65
72
|
agent == null ? void 0 : agent.setMessages([]);
|
|
@@ -140,8 +147,12 @@ function useCopilotChatInternal({
|
|
|
140
147
|
console.error("CopilotChat: runAgent failed", error);
|
|
141
148
|
}
|
|
142
149
|
}
|
|
150
|
+
if (onSubmitMessage) {
|
|
151
|
+
const content = typeof message.content === "string" ? message.content : message.content && "text" in message.content ? message.content.text : message.content && "filename" in message.content ? message.content.filename : "";
|
|
152
|
+
onSubmitMessage(content);
|
|
153
|
+
}
|
|
143
154
|
}),
|
|
144
|
-
[agent, copilotkit, resolvedAgentId]
|
|
155
|
+
[agent, copilotkit, resolvedAgentId, onSubmitMessage]
|
|
145
156
|
);
|
|
146
157
|
const latestAppendFunc = useAsyncCallback(
|
|
147
158
|
(message, options) => __async(this, null, function* () {
|
|
@@ -162,14 +173,24 @@ function useCopilotChatInternal({
|
|
|
162
173
|
const latestReload = useUpdatedRef(reload);
|
|
163
174
|
const latestReloadFunc = useAsyncCallback(
|
|
164
175
|
(messageId) => __async(this, null, function* () {
|
|
176
|
+
var _a2;
|
|
177
|
+
onReloadMessages == null ? void 0 : onReloadMessages({
|
|
178
|
+
messageId,
|
|
179
|
+
currentAgentName: agent == null ? void 0 : agent.agentId,
|
|
180
|
+
messages: (_a2 = agent == null ? void 0 : agent.messages) != null ? _a2 : []
|
|
181
|
+
});
|
|
165
182
|
return yield latestReload.current(messageId);
|
|
166
183
|
}),
|
|
167
|
-
[latestReload]
|
|
184
|
+
[latestReload, agent, onReloadMessages]
|
|
168
185
|
);
|
|
169
186
|
const latestStopFunc = useCallback(() => {
|
|
170
|
-
var _a2;
|
|
171
|
-
|
|
172
|
-
|
|
187
|
+
var _a2, _b2;
|
|
188
|
+
onStopGeneration == null ? void 0 : onStopGeneration({
|
|
189
|
+
currentAgentName: agent == null ? void 0 : agent.agentId,
|
|
190
|
+
messages: (_a2 = agent == null ? void 0 : agent.messages) != null ? _a2 : []
|
|
191
|
+
});
|
|
192
|
+
return (_b2 = agent == null ? void 0 : agent.abortRun) == null ? void 0 : _b2.call(agent);
|
|
193
|
+
}, [onStopGeneration, agent]);
|
|
173
194
|
const latestReset = useUpdatedRef(reset);
|
|
174
195
|
const latestResetFunc = useCallback(() => {
|
|
175
196
|
return latestReset.current();
|
|
@@ -325,4 +346,4 @@ export {
|
|
|
325
346
|
useCopilotChatInternal,
|
|
326
347
|
defaultSystemMessage
|
|
327
348
|
};
|
|
328
|
-
//# sourceMappingURL=chunk-
|
|
349
|
+
//# sourceMappingURL=chunk-LSHFN2Y5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-copilot-chat_internal.ts"],"sourcesContent":["import { useRef, useEffect, useCallback, useMemo, useState, createElement } from \"react\";\nimport { useCopilotContext } from \"../context/copilot-context\";\nimport { SystemMessageFunction } from \"../types\";\nimport { useAsyncCallback } from \"../components/error-boundary/error-utils\";\nimport { Message } from \"@copilotkit/shared\";\nimport { gqlToAGUI, Message as DeprecatedGqlMessage } from \"@copilotkit/runtime-client-gql\";\nimport { useLangGraphInterruptRender } from \"./use-langgraph-interrupt-render\";\nimport {\n useAgent,\n useCopilotChatConfiguration,\n useCopilotKit,\n useRenderCustomMessages,\n useSuggestions,\n} from \"@copilotkitnext/react\";\nimport { Suggestion } from \"@copilotkitnext/core\";\nimport { useLazyToolRenderer } from \"./use-lazy-tool-renderer\";\nimport { AbstractAgent, AGUIConnectNotImplementedError } from \"@ag-ui/client\";\nimport {\n CoAgentStateRenderBridge,\n type CoAgentStateRenderBridgeProps,\n} from \"./use-coagent-state-render-bridge\";\n\n/**\n * The type of suggestions to use in the chat.\n *\n * `auto` - Suggestions are generated automatically.\n * `manual` - Suggestions are controlled programmatically.\n * `SuggestionItem[]` - Static suggestions array.\n */\nexport type ChatSuggestions = \"auto\" | \"manual\" | Omit<Suggestion, \"isLoading\">[];\n\nexport interface AppendMessageOptions {\n /**\n * Whether to run the chat completion after appending the message. Defaults to `true`.\n */\n followUp?: boolean;\n /**\n * Whether to clear the suggestions after appending the message. Defaults to `true`.\n */\n clearSuggestions?: boolean;\n}\n\nexport interface OnStopGenerationArguments {\n /**\n * The name of the currently executing agent.\n */\n currentAgentName: string | undefined;\n\n /**\n * The messages in the chat.\n */\n messages: Message[];\n}\n\nexport type OnReloadMessagesArguments = OnStopGenerationArguments & {\n /**\n * The message on which \"regenerate\" was pressed\n */\n messageId: string;\n};\n\nexport type OnStopGeneration = (args: OnStopGenerationArguments) => void;\n\nexport type OnReloadMessages = (args: OnReloadMessagesArguments) => void;\n\nexport interface UseCopilotChatOptions {\n /**\n * A unique identifier for the chat. If not provided, a random one will be\n * generated. When provided, the `useChat` hook with the same `id` will\n * have shared states across components.\n */\n id?: string;\n\n /**\n * HTTP headers to be sent with the API request.\n */\n headers?: Record<string, string> | Headers;\n\n /**\n * Initial messages to populate the chat with.\n */\n initialMessages?: Message[];\n\n /**\n * A function to generate the system message. Defaults to `defaultSystemMessage`.\n */\n makeSystemMessage?: SystemMessageFunction;\n\n /**\n * Disables inclusion of CopilotKit’s default system message. When true, no system message is sent (this also suppresses any custom message from <code>makeSystemMessage</code>).\n */\n disableSystemMessage?: boolean;\n /**\n * Controls the behavior of suggestions in the chat interface.\n *\n * `auto` (default) - Suggestions are generated automatically:\n * - When the chat is first opened (empty state)\n * - After each message exchange completes\n * - Uses configuration from `useCopilotChatSuggestions` hooks\n *\n * `manual` - Suggestions are controlled programmatically:\n * - Use `setSuggestions()` to set custom suggestions\n * - Use `generateSuggestions()` to trigger AI generation\n * - Access via `useCopilotChat` hook\n *\n * `SuggestionItem[]` - Static suggestions array:\n * - Always shows the same suggestions\n * - No AI generation involved\n */\n suggestions?: ChatSuggestions;\n\n onInProgress?: (isLoading: boolean) => void;\n onSubmitMessage?: (messageContent: string) => Promise<void> | void;\n onStopGeneration?: OnStopGeneration;\n onReloadMessages?: OnReloadMessages;\n}\n\nexport interface MCPServerConfig {\n endpoint: string;\n apiKey?: string;\n}\n\n// Old suggestion item interface, for returning from useCopilotChatInternal\ninterface SuggestionItem {\n title: string;\n message: string;\n partial?: boolean;\n className?: string;\n}\n\nexport interface UseCopilotChatReturn {\n /**\n * @deprecated use `messages` instead, this is an old non ag-ui version of the messages\n * Array of messages currently visible in the chat interface\n *\n * This is the visible messages, not the raw messages from the runtime client.\n */\n visibleMessages: DeprecatedGqlMessage[];\n\n /**\n * The messages that are currently in the chat in AG-UI format.\n */\n messages: Message[];\n\n /** @deprecated use `sendMessage` in `useCopilotChatHeadless_c` instead. This will be removed in a future major version. */\n appendMessage: (message: DeprecatedGqlMessage, options?: AppendMessageOptions) => Promise<void>;\n\n /**\n * Send a new message to the chat\n *\n * ```tsx\n * await sendMessage({\n * id: \"123\",\n * role: \"user\",\n * content: \"Hello, process this request\",\n * });\n * ```\n */\n sendMessage: (message: Message, options?: AppendMessageOptions) => Promise<void>;\n\n /**\n * Replace all messages in the chat\n *\n * ```tsx\n * setMessages([\n * { id: \"123\", role: \"user\", content: \"Hello, process this request\" },\n * { id: \"456\", role: \"assistant\", content: \"Hello, I'm the assistant\" },\n * ]);\n * ```\n *\n * **Deprecated** non-ag-ui version:\n *\n * ```tsx\n * setMessages([\n * new TextMessage({\n * content: \"Hello, process this request\",\n * role: gqlRole.User,\n * }),\n * new TextMessage({\n * content: \"Hello, I'm the assistant\",\n * role: gqlRole.Assistant,\n * ]);\n * ```\n *\n */\n setMessages: (messages: Message[] | DeprecatedGqlMessage[]) => void;\n\n /**\n * Remove a specific message by ID\n *\n * ```tsx\n * deleteMessage(\"123\");\n * ```\n */\n deleteMessage: (messageId: string) => void;\n\n /**\n * Regenerate the response for a specific message\n *\n * ```tsx\n * reloadMessages(\"123\");\n * ```\n */\n reloadMessages: (messageId: string) => Promise<void>;\n\n /**\n * Stop the current message generation\n *\n * ```tsx\n * if (isLoading) {\n * stopGeneration();\n * }\n * ```\n */\n stopGeneration: () => void;\n\n /**\n * Clear all messages and reset chat state\n *\n * ```tsx\n * reset();\n * console.log(messages); // []\n * ```\n */\n reset: () => void;\n\n /**\n * Whether the chat is currently generating a response\n *\n * ```tsx\n * if (isLoading) {\n * console.log(\"Loading...\");\n * } else {\n * console.log(\"Not loading\");\n * }\n */\n isLoading: boolean;\n\n /**\n * Whether the chat agent is available to generate responses\n *\n * ```tsx\n * if (isAvailable) {\n * console.log(\"Loading...\");\n * } else {\n * console.log(\"Not loading\");\n * }\n */\n isAvailable: boolean;\n\n /** Manually trigger chat completion (advanced usage) */\n runChatCompletion: () => Promise<Message[]>;\n\n /** MCP (Model Context Protocol) server configurations */\n mcpServers: MCPServerConfig[];\n\n /** Update MCP server configurations */\n setMcpServers: (mcpServers: MCPServerConfig[]) => void;\n\n /**\n * Current suggestions array\n * Use this to read the current suggestions or in conjunction with setSuggestions for manual control\n */\n suggestions: Suggestion[];\n\n /**\n * Manually set suggestions\n * Useful for manual mode or custom suggestion workflows\n */\n setSuggestions: (suggestions: Omit<Suggestion, \"isLoading\">[]) => void;\n\n /**\n * Trigger AI-powered suggestion generation\n * Uses configurations from useCopilotChatSuggestions hooks\n * Respects global debouncing - only one generation can run at a time\n *\n * ```tsx\n * generateSuggestions();\n * console.log(suggestions); // [suggestion1, suggestion2, suggestion3]\n * ```\n */\n generateSuggestions: () => Promise<void>;\n\n /**\n * Clear all current suggestions\n * Also resets suggestion generation state\n */\n resetSuggestions: () => void;\n\n /** Whether suggestions are currently being generated */\n isLoadingSuggestions: boolean;\n\n /** Interrupt content for human-in-the-loop workflows */\n interrupt: string | React.ReactElement | null;\n\n agent?: ReturnType<typeof useAgent>[\"agent\"];\n\n threadId?: string;\n}\n\nexport function useCopilotChatInternal({\n suggestions,\n onInProgress,\n onSubmitMessage,\n onStopGeneration,\n onReloadMessages,\n}: UseCopilotChatOptions = {}): UseCopilotChatReturn {\n const { copilotkit } = useCopilotKit();\n const { threadId, agentSession } = useCopilotContext();\n const existingConfig = useCopilotChatConfiguration();\n const [agentAvailable, setAgentAvailable] = useState(false);\n\n // Apply priority: props > existing config > defaults\n const resolvedAgentId = existingConfig?.agentId ?? \"default\";\n const { agent } = useAgent({ agentId: resolvedAgentId });\n\n useEffect(() => {\n const connect = async (agent: AbstractAgent) => {\n setAgentAvailable(false);\n try {\n await copilotkit.connectAgent({ agent });\n setAgentAvailable(true);\n } catch (error) {\n if (error instanceof AGUIConnectNotImplementedError) {\n // connect not implemented, ignore\n } else {\n throw error;\n }\n }\n };\n if (agent && existingConfig?.threadId && agent.threadId !== existingConfig.threadId) {\n agent.threadId = existingConfig.threadId;\n connect(agent);\n }\n return () => {};\n }, [existingConfig?.threadId, agent, copilotkit, resolvedAgentId]);\n\n useEffect(() => {\n onInProgress?.(Boolean(agent?.isRunning));\n }, [agent?.isRunning, onInProgress]);\n\n const interrupt = useLangGraphInterruptRender(agent);\n\n const reset = () => {\n agent?.setMessages([]);\n agent?.setState(null);\n };\n\n const deleteMessage = useCallback(\n (messageId: string) => {\n const filteredMessages = (agent?.messages ?? []).filter(\n (message) => message.id !== messageId,\n );\n agent?.setMessages(filteredMessages);\n },\n [agent?.setMessages, agent?.messages],\n );\n\n const latestDelete = useUpdatedRef(deleteMessage);\n const latestDeleteFunc = useCallback(\n (messageId: string) => {\n return latestDelete.current(messageId);\n },\n [latestDelete],\n );\n\n const currentSuggestions = useSuggestions({ agentId: resolvedAgentId });\n\n const reload = useAsyncCallback(\n async (reloadMessageId: string): Promise<void> => {\n const messages = agent?.messages ?? [];\n // TODO: get isLoading\n const isLoading = false;\n if (isLoading || messages.length === 0) {\n return;\n }\n\n const reloadMessageIndex = messages.findIndex((msg) => msg.id === reloadMessageId);\n if (reloadMessageIndex === -1) {\n console.warn(`Message with id ${reloadMessageId} not found`);\n return;\n }\n\n const reloadMessageRole = messages[reloadMessageIndex].role;\n if (reloadMessageRole !== \"assistant\") {\n console.warn(`Regenerate cannot be performed on ${reloadMessageRole} role`);\n return;\n }\n let historyCutoff: Message[] = [messages[0]];\n\n if (messages.length > 2 && reloadMessageIndex !== 0) {\n // message to regenerate from is now first.\n // Work backwards to find the first the closest user message\n const lastUserMessageBeforeRegenerate = messages\n .slice(0, reloadMessageIndex)\n .reverse()\n .find((msg) => msg.role === \"user\");\n\n if (!lastUserMessageBeforeRegenerate) {\n historyCutoff = [messages[0]];\n } else {\n const indexOfLastUserMessageBeforeRegenerate = messages.findIndex(\n (msg) => msg.id === lastUserMessageBeforeRegenerate.id,\n );\n // Include the user message, remove everything after it\n historyCutoff = messages.slice(0, indexOfLastUserMessageBeforeRegenerate + 1);\n }\n } else if (messages.length > 2 && reloadMessageIndex === 0) {\n historyCutoff = [messages[0], messages[1]];\n }\n\n agent?.setMessages(historyCutoff);\n\n if (agent) {\n copilotkit.runAgent({ agent });\n }\n return;\n },\n [agent?.setMessages, copilotkit?.runAgent],\n );\n\n const latestSendMessageFunc = useAsyncCallback(\n async (message: Message, options?: AppendMessageOptions) => {\n if (!agent) return;\n const followUp = options?.followUp ?? true;\n if (options?.clearSuggestions) {\n copilotkit.clearSuggestions(resolvedAgentId);\n }\n agent?.addMessage(message);\n if (followUp) {\n try {\n await copilotkit.runAgent({ agent });\n } catch (error) {\n console.error(\"CopilotChat: runAgent failed\", error);\n }\n }\n if (onSubmitMessage) {\n const content =\n typeof message.content === \"string\"\n ? message.content\n : message.content && \"text\" in message.content\n ? message.content.text\n : message.content && \"filename\" in message.content\n ? message.content.filename\n : \"\";\n onSubmitMessage(content);\n }\n },\n [agent, copilotkit, resolvedAgentId, onSubmitMessage],\n );\n\n const latestAppendFunc = useAsyncCallback(\n async (message: DeprecatedGqlMessage, options?: AppendMessageOptions) => {\n return latestSendMessageFunc(gqlToAGUI([message])[0], options);\n },\n [latestSendMessageFunc],\n );\n\n const latestSetMessagesFunc = useCallback(\n (messages: Message[] | DeprecatedGqlMessage[]) => {\n if (messages.every((message) => message instanceof DeprecatedGqlMessage)) {\n return agent?.setMessages?.(gqlToAGUI(messages));\n }\n return agent?.setMessages?.(messages);\n },\n [agent?.setMessages, agent],\n );\n\n const latestReload = useUpdatedRef(reload);\n const latestReloadFunc = useAsyncCallback(\n async (messageId: string) => {\n onReloadMessages?.({\n messageId,\n currentAgentName: agent?.agentId,\n messages: agent?.messages ?? [],\n });\n return await latestReload.current(messageId);\n },\n [latestReload, agent, onReloadMessages],\n );\n\n const latestStopFunc = useCallback(() => {\n onStopGeneration?.({\n currentAgentName: agent?.agentId,\n messages: agent?.messages ?? [],\n });\n return agent?.abortRun?.();\n }, [onStopGeneration, agent]);\n\n const latestReset = useUpdatedRef(reset);\n const latestResetFunc = useCallback(() => {\n return latestReset.current();\n }, [latestReset]);\n\n const lazyToolRendered = useLazyToolRenderer();\n const renderCustomMessage = useRenderCustomMessages();\n const legacyCustomMessageRenderer = useLegacyCoagentRenderer({\n copilotkit,\n agent,\n agentId: resolvedAgentId,\n threadId: existingConfig?.threadId ?? threadId,\n });\n const allMessages = agent?.messages ?? [];\n const resolvedMessages = useMemo(() => {\n let processedMessages = allMessages.map((message) => {\n if (message.role !== \"assistant\") {\n return message;\n }\n\n const lazyRendered = lazyToolRendered(message, allMessages);\n if (lazyRendered) {\n const renderedGenUi = lazyRendered();\n if (renderedGenUi) {\n return { ...message, generativeUI: () => renderedGenUi };\n }\n }\n\n const bridgeRenderer =\n legacyCustomMessageRenderer || renderCustomMessage\n ? () => {\n const customRender = renderCustomMessage?.({\n message,\n position: \"before\",\n });\n if (customRender) {\n return customRender;\n }\n return legacyCustomMessageRenderer?.({ message, position: \"before\" });\n }\n : null;\n\n if (bridgeRenderer) {\n return { ...message, generativeUI: bridgeRenderer };\n }\n return message;\n });\n\n const hasAssistantMessages = processedMessages.some((msg) => msg.role === \"assistant\");\n\n // TODO: what is this?\n // if (legacyCustomMessageRenderer && !hasAssistantMessages) {\n // const placeholderId = `coagent-state-render-${resolvedAgentId}`;\n // const placeholderMessage: Message = {\n // id: placeholderId,\n // role: \"assistant\",\n // content: \"\",\n // name: \"coagent-state-render\",\n // };\n // processedMessages = [\n // ...processedMessages,\n // {\n // ...placeholderMessage,\n // generativeUI: () =>\n // legacyCustomMessageRenderer({\n // message: placeholderMessage,\n // position: \"before\",\n // }),\n // } as Message,\n // ];\n // }\n\n return processedMessages;\n }, [\n agent?.messages,\n lazyToolRendered,\n allMessages,\n renderCustomMessage,\n // legacyCustomMessageRenderer,\n resolvedAgentId,\n ]);\n\n const renderedSuggestions = useMemo(() => {\n if (Array.isArray(suggestions)) {\n return {\n suggestions: suggestions.map((s) => ({ ...s, isLoading: false })),\n isLoading: false,\n };\n }\n return currentSuggestions;\n }, [suggestions, currentSuggestions]);\n\n // @ts-ignore\n return {\n messages: resolvedMessages,\n sendMessage: latestSendMessageFunc,\n appendMessage: latestAppendFunc,\n setMessages: latestSetMessagesFunc,\n reloadMessages: latestReloadFunc,\n stopGeneration: latestStopFunc,\n reset: latestResetFunc,\n deleteMessage: latestDeleteFunc,\n isAvailable: agentAvailable,\n isLoading: Boolean(agent?.isRunning),\n // mcpServers,\n // setMcpServers,\n suggestions: renderedSuggestions.suggestions,\n setSuggestions: (suggestions: Omit<Suggestion, \"isLoading\">[]) =>\n copilotkit.addSuggestionsConfig({ suggestions }),\n generateSuggestions: async () => copilotkit.reloadSuggestions(resolvedAgentId),\n resetSuggestions: () => copilotkit.clearSuggestions(resolvedAgentId),\n isLoadingSuggestions: renderedSuggestions.isLoading,\n interrupt,\n agent,\n threadId,\n };\n}\n\n// store `value` in a ref and update\n// it whenever it changes.\nfunction useUpdatedRef<T>(value: T) {\n const ref = useRef(value);\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref;\n}\n\ntype LegacyRenderParams = {\n message: Message;\n position: \"before\" | \"after\";\n};\n\ntype LegacyRenderer = ((args: LegacyRenderParams) => any) | null;\n\nfunction useLegacyCoagentRenderer({\n copilotkit,\n agent,\n agentId,\n threadId,\n}: {\n copilotkit: ReturnType<typeof useCopilotKit>[\"copilotkit\"];\n agent?: AbstractAgent;\n agentId: string;\n threadId?: string;\n}): LegacyRenderer {\n return useMemo(() => {\n if (!copilotkit || !agent) {\n return null;\n }\n\n return ({ message, position }: LegacyRenderParams) => {\n const effectiveThreadId = threadId ?? agent.threadId ?? \"default\";\n const existingRunId = copilotkit.getRunIdForMessage(agentId, effectiveThreadId, message.id);\n const runId = existingRunId || `pending:${message.id}`;\n const messageIndex = Math.max(\n agent.messages.findIndex((msg) => msg.id === message.id),\n 0,\n );\n\n const bridgeProps: CoAgentStateRenderBridgeProps = {\n message: message as any,\n position,\n runId,\n messageIndex,\n messageIndexInRun: 0,\n numberOfMessagesInRun: 1,\n agentId,\n stateSnapshot: (message as any).state,\n };\n\n return createElement(CoAgentStateRenderBridge, bridgeProps) as any;\n };\n }, [agent, agentId, copilotkit, threadId]);\n}\n\nexport function defaultSystemMessage(\n contextString: string,\n additionalInstructions?: string,\n): string {\n return (\n `\nPlease act as an efficient, competent, conscientious, and industrious professional assistant.\n\nHelp the user achieve their goals, and you do so in a way that is as efficient as possible, without unnecessary fluff, but also without sacrificing professionalism.\nAlways be polite and respectful, and prefer brevity over verbosity.\n\nThe user has provided you with the following context:\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\n\nThey have also provided you with functions you can call to initiate actions on their behalf, or functions you can call to receive more information.\n\nPlease assist them as best you can.\n\nYou can ask them for clarifying questions if needed, but don't be annoying about it. If you can reasonably 'fill in the blanks' yourself, do so.\n\nIf you would like to call a function, call it without saying anything else.\nIn case of a function error:\n- If this error stems from incorrect function parameters or syntax, you may retry with corrected arguments.\n- If the error's source is unclear or seems unrelated to your input, do not attempt further retries.\n` + (additionalInstructions ? `\\n\\n${additionalInstructions}` : \"\")\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,WAAW,aAAa,SAAS,UAAU,qBAAqB;AAKjF,SAAS,WAAW,WAAW,4BAA4B;AAE3D;AAAA,EACE;AAAA,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AAA;AAAA;AAAA;AAAA,EAQF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAaG,yBAAyB;AAAA;AAAA,EAAO,2BAA2B;AAEhE;","names":["agent","_a","_b","suggestions"]}
|
|
@@ -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.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { UseCopilotChatReturn, useCopilotChat } from './use-copilot-chat.js';
|
|
2
|
-
export { ChatSuggestions, UseCopilotChatOptions, UseCopilotChatOptions as UseCopilotChatOptions_c, UseCopilotChatReturn as UseCopilotChatReturn_c, useCopilotChatInternal } from './use-copilot-chat_internal.js';
|
|
2
|
+
export { ChatSuggestions, OnReloadMessages, OnStopGeneration, UseCopilotChatOptions, UseCopilotChatOptions as UseCopilotChatOptions_c, UseCopilotChatReturn as UseCopilotChatReturn_c, useCopilotChatInternal } from './use-copilot-chat_internal.js';
|
|
3
3
|
export { useCopilotChatHeadless_c } from './use-copilot-chat-headless_c.js';
|
|
4
4
|
export { useCopilotAction } from './use-copilot-action.js';
|
|
5
5
|
export { useCoAgentStateRender } from './use-coagent-state-render.js';
|