@copilotkit/react-core 1.50.0-beta.2 → 1.50.0-beta.3
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-BPJ6V4YX.mjs → chunk-4HRUQH6U.mjs} +2 -2
- package/dist/{chunk-LD3MGPZB.mjs → chunk-7HI6VLJJ.mjs} +5 -5
- package/dist/{chunk-D3QSYDJR.mjs → chunk-7IBF6RBW.mjs} +2 -2
- package/dist/{chunk-OVYFRPSN.mjs → chunk-ABWT4DRT.mjs} +2 -2
- package/dist/{chunk-WVLHXIFP.mjs → chunk-AFNWX62Q.mjs} +2 -2
- package/dist/{chunk-WVLHXIFP.mjs.map → chunk-AFNWX62Q.mjs.map} +1 -1
- package/dist/{chunk-OAEX7G5G.mjs → chunk-AMUONDZ2.mjs} +2 -2
- package/dist/{chunk-SD7TUPQM.mjs → chunk-B66SA6EH.mjs} +44 -49
- package/dist/chunk-B66SA6EH.mjs.map +1 -0
- package/dist/{chunk-7BYHZLPL.mjs → chunk-BTZ3TJVX.mjs} +6 -6
- package/dist/chunk-BTZ3TJVX.mjs.map +1 -0
- package/dist/{chunk-BR5YEYZJ.mjs → chunk-IUNU4CUG.mjs} +5 -5
- package/dist/{chunk-6F7Q6CPI.mjs → chunk-M7EVKKUZ.mjs} +7 -7
- package/dist/{chunk-LHKZJ2ND.mjs → chunk-PMWUKW3Z.mjs} +3 -3
- package/dist/{chunk-TGIWTM6S.mjs → chunk-QNUAXSDP.mjs} +2 -2
- package/dist/{chunk-TGIWTM6S.mjs.map → chunk-QNUAXSDP.mjs.map} +1 -1
- package/dist/{chunk-6SK26J65.mjs → chunk-SHHPDZUK.mjs} +2 -2
- package/dist/{chunk-LHERIF3L.mjs → chunk-SNON4QA6.mjs} +4 -4
- package/dist/{chunk-ISNVEPPQ.mjs → chunk-VV56AVPB.mjs} +17 -7
- package/dist/chunk-VV56AVPB.mjs.map +1 -0
- package/dist/{chunk-EHXVGFWN.mjs → chunk-XFXT2VNX.mjs} +3 -3
- package/dist/{chunk-WMJVBMUX.mjs → chunk-YCG6SNAU.mjs} +2 -2
- package/dist/components/copilot-provider/copilot-messages.js +1 -1
- package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
- package/dist/components/copilot-provider/copilot-messages.mjs +3 -3
- package/dist/components/copilot-provider/copilotkit-props.d.ts +1 -1
- package/dist/components/copilot-provider/copilotkit.d.ts +1 -1
- package/dist/components/copilot-provider/copilotkit.js +26 -31
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +13 -13
- package/dist/components/copilot-provider/index.d.ts +1 -1
- package/dist/components/copilot-provider/index.js +26 -31
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +13 -13
- package/dist/components/dev-console/console-trigger.js +1 -1
- package/dist/components/dev-console/console-trigger.js.map +1 -1
- package/dist/components/dev-console/console-trigger.mjs +3 -3
- package/dist/components/dev-console/developer-console-modal.js +1 -1
- package/dist/components/dev-console/developer-console-modal.js.map +1 -1
- package/dist/components/dev-console/developer-console-modal.mjs +2 -2
- package/dist/components/error-boundary/error-boundary.mjs +2 -2
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +26 -31
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +13 -13
- package/dist/context/copilot-context.d.ts +1 -1
- package/dist/context/copilot-context.js +1 -1
- package/dist/context/copilot-context.js.map +1 -1
- package/dist/context/copilot-context.mjs +1 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.mjs +6 -6
- package/dist/{copilot-context-81022020.d.ts → copilot-context-ec77e921.d.ts} +2 -2
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +19 -9
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +15 -15
- package/dist/hooks/use-coagent-state-render-bridge.js +1 -1
- package/dist/hooks/use-coagent-state-render-bridge.js.map +1 -1
- package/dist/hooks/use-coagent-state-render-bridge.mjs +3 -3
- package/dist/hooks/use-coagent-state-render.js +1 -1
- package/dist/hooks/use-coagent-state-render.js.map +1 -1
- package/dist/hooks/use-coagent-state-render.mjs +3 -3
- package/dist/hooks/use-copilot-additional-instructions.js +1 -1
- package/dist/hooks/use-copilot-additional-instructions.js.map +1 -1
- package/dist/hooks/use-copilot-additional-instructions.mjs +2 -2
- package/dist/hooks/use-copilot-authenticated-action.js +1 -1
- package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
- package/dist/hooks/use-copilot-authenticated-action.mjs +2 -2
- package/dist/hooks/use-copilot-chat-headless_c.js +17 -7
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +9 -9
- package/dist/hooks/use-copilot-chat.js +17 -7
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +9 -9
- package/dist/hooks/use-copilot-chat_internal.js +17 -7
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +8 -8
- package/dist/hooks/use-langgraph-interrupt-render.js +16 -6
- package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.mjs +3 -3
- package/dist/hooks/use-langgraph-interrupt.d.ts +1 -1
- package/dist/hooks/use-langgraph-interrupt.js +3 -3
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +2 -2
- package/dist/hooks/use-make-copilot-document-readable.js +1 -1
- package/dist/hooks/use-make-copilot-document-readable.js.map +1 -1
- package/dist/hooks/use-make-copilot-document-readable.mjs +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +43 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -44
- package/dist/lib/copilot-task.d.ts +1 -1
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +14 -14
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +14 -14
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/interrupt-action.d.ts +1 -1
- package/dist/types/interrupt-action.js.map +1 -1
- package/dist/utils/index.mjs +3 -3
- package/dist/v2/index.css +4 -0
- package/dist/v2/index.css.map +1 -0
- package/dist/v2/index.js.map +1 -1
- package/dist/v2/index.mjs +2 -0
- package/dist/v2/index.mjs.map +1 -1
- package/package.json +10 -8
- package/src/components/copilot-provider/copilotkit.tsx +30 -30
- package/src/context/copilot-context.tsx +2 -2
- package/src/hooks/use-coagent-state-render-bridge.tsx +2 -2
- package/src/hooks/use-langgraph-interrupt-render.ts +15 -5
- package/src/hooks/use-langgraph-interrupt.ts +2 -3
- package/src/types/interrupt-action.ts +1 -4
- package/src/v2/index.ts +2 -0
- package/tsup.config.ts +1 -1
- package/dist/chunk-7BYHZLPL.mjs.map +0 -1
- package/dist/chunk-ISNVEPPQ.mjs.map +0 -1
- package/dist/chunk-SD7TUPQM.mjs.map +0 -1
- /package/dist/{chunk-BPJ6V4YX.mjs.map → chunk-4HRUQH6U.mjs.map} +0 -0
- /package/dist/{chunk-LD3MGPZB.mjs.map → chunk-7HI6VLJJ.mjs.map} +0 -0
- /package/dist/{chunk-D3QSYDJR.mjs.map → chunk-7IBF6RBW.mjs.map} +0 -0
- /package/dist/{chunk-OVYFRPSN.mjs.map → chunk-ABWT4DRT.mjs.map} +0 -0
- /package/dist/{chunk-OAEX7G5G.mjs.map → chunk-AMUONDZ2.mjs.map} +0 -0
- /package/dist/{chunk-BR5YEYZJ.mjs.map → chunk-IUNU4CUG.mjs.map} +0 -0
- /package/dist/{chunk-6F7Q6CPI.mjs.map → chunk-M7EVKKUZ.mjs.map} +0 -0
- /package/dist/{chunk-LHKZJ2ND.mjs.map → chunk-PMWUKW3Z.mjs.map} +0 -0
- /package/dist/{chunk-6SK26J65.mjs.map → chunk-SHHPDZUK.mjs.map} +0 -0
- /package/dist/{chunk-LHERIF3L.mjs.map → chunk-SNON4QA6.mjs.map} +0 -0
- /package/dist/{chunk-EHXVGFWN.mjs.map → chunk-XFXT2VNX.mjs.map} +0 -0
- /package/dist/{chunk-WMJVBMUX.mjs.map → chunk-YCG6SNAU.mjs.map} +0 -0
- /package/src/v2/{styles.css → index.css} +0 -0
package/dist/lib/index.mjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import "../chunk-LUGEI4YQ.mjs";
|
|
2
2
|
import {
|
|
3
3
|
CopilotTask
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-SHHPDZUK.mjs";
|
|
5
5
|
import "../chunk-4CEQJ2X6.mjs";
|
|
6
6
|
import "../chunk-JD7BAH7U.mjs";
|
|
7
7
|
import "../chunk-SPCZTZCY.mjs";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-B66SA6EH.mjs";
|
|
9
|
+
import "../chunk-SNON4QA6.mjs";
|
|
10
|
+
import "../chunk-7HI6VLJJ.mjs";
|
|
11
|
+
import "../chunk-PMWUKW3Z.mjs";
|
|
12
|
+
import "../chunk-YCG6SNAU.mjs";
|
|
11
13
|
import "../chunk-PIF5KJYI.mjs";
|
|
12
|
-
import "../chunk-CYDWEPFL.mjs";
|
|
13
|
-
import "../chunk-2IDV5OHF.mjs";
|
|
14
|
-
import "../chunk-LD3MGPZB.mjs";
|
|
15
|
-
import "../chunk-LHERIF3L.mjs";
|
|
16
|
-
import "../chunk-ICIK2BSB.mjs";
|
|
17
14
|
import "../chunk-RKTVJRK7.mjs";
|
|
18
15
|
import "../chunk-PMAFHQ7P.mjs";
|
|
16
|
+
import "../chunk-CYDWEPFL.mjs";
|
|
17
|
+
import "../chunk-ICIK2BSB.mjs";
|
|
18
|
+
import "../chunk-2IDV5OHF.mjs";
|
|
19
19
|
import "../chunk-YYN33GSG.mjs";
|
|
20
|
+
import "../chunk-6ZLPNY7X.mjs";
|
|
20
21
|
import "../chunk-6PUNP7CD.mjs";
|
|
21
22
|
import "../chunk-O7ARI5CV.mjs";
|
|
22
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-QNUAXSDP.mjs";
|
|
23
24
|
import "../chunk-NB2FKV2V.mjs";
|
|
25
|
+
import "../chunk-FDOMAPJY.mjs";
|
|
26
|
+
import "../chunk-AFNWX62Q.mjs";
|
|
27
|
+
import "../chunk-DMLQZG75.mjs";
|
|
24
28
|
import "../chunk-F555TVE4.mjs";
|
|
25
29
|
import "../chunk-WF65O6HX.mjs";
|
|
26
30
|
import "../chunk-EFL5OBKN.mjs";
|
|
27
|
-
import "../chunk-6ZLPNY7X.mjs";
|
|
28
|
-
import "../chunk-FDOMAPJY.mjs";
|
|
29
|
-
import "../chunk-WVLHXIFP.mjs";
|
|
30
|
-
import "../chunk-DMLQZG75.mjs";
|
|
31
31
|
import "../chunk-SKC7AJIV.mjs";
|
|
32
32
|
export {
|
|
33
33
|
CopilotTask
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { SystemMessageFunction } from './system-message.js';
|
|
|
3
3
|
export { ActionRenderProps, ActionRenderPropsNoArgs, ActionRenderPropsNoArgsWait, ActionRenderPropsWait, CatchAllActionRenderProps, CatchAllFrontendAction, FrontendAction, FrontendActionAvailability, RenderFunctionStatus } from './frontend-action.js';
|
|
4
4
|
export { CopilotChatSuggestionConfiguration } from './chat-suggestion-configuration.js';
|
|
5
5
|
export { CrewsAgentState, CrewsResponse, CrewsResponseStatus, CrewsStateItem, CrewsTaskStateItem, CrewsToolStateItem } from './crew.js';
|
|
6
|
-
export { f as LangGraphInterruptAction, h as LangGraphInterruptActionSetter, g as LangGraphInterruptActionSetterArgs, e as LangGraphInterruptRender, L as LangGraphInterruptRenderHandlerProps, d as LangGraphInterruptRenderProps, Q as QueuedInterruptEvent } from '../copilot-context-
|
|
6
|
+
export { f as LangGraphInterruptAction, h as LangGraphInterruptActionSetter, g as LangGraphInterruptActionSetterArgs, e as LangGraphInterruptRender, L as LangGraphInterruptRenderHandlerProps, d as LangGraphInterruptRenderProps, Q as QueuedInterruptEvent } from '../copilot-context-ec77e921.js';
|
|
7
7
|
import '@copilotkit/runtime-client-gql';
|
|
8
8
|
import '@copilotkit/shared';
|
|
9
9
|
import 'react';
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@copilotkit/runtime-client-gql';
|
|
2
|
-
export { f as LangGraphInterruptAction, h as LangGraphInterruptActionSetter, g as LangGraphInterruptActionSetterArgs, e as LangGraphInterruptRender, L as LangGraphInterruptRenderHandlerProps, d as LangGraphInterruptRenderProps, Q as QueuedInterruptEvent } from '../copilot-context-
|
|
2
|
+
export { f as LangGraphInterruptAction, h as LangGraphInterruptActionSetter, g as LangGraphInterruptActionSetterArgs, e as LangGraphInterruptRender, L as LangGraphInterruptRenderHandlerProps, d as LangGraphInterruptRenderProps, Q as QueuedInterruptEvent } from '../copilot-context-ec77e921.js';
|
|
3
3
|
import '@copilotkit/shared';
|
|
4
4
|
import './frontend-action.js';
|
|
5
5
|
import 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/interrupt-action.ts"],"sourcesContent":["import { LangGraphInterruptEvent } from \"@copilotkit/runtime-client-gql\";\nimport { AgentSession } from \"../context/copilot-context\";\n\nexport interface LangGraphInterruptRenderHandlerProps<TEventValue = any> {\n event: LangGraphInterruptEvent<TEventValue>;\n resolve: (resolution: string) => void;\n}\n\nexport interface LangGraphInterruptRenderProps<TEventValue = any> {\n result: unknown;\n event: LangGraphInterruptEvent<TEventValue>;\n resolve: (resolution: string) => void;\n}\n\nexport interface LangGraphInterruptRender<TEventValue = any> {\n id: string;\n /**\n * The handler function to handle the event.\n */\n handler?: (props: LangGraphInterruptRenderHandlerProps<TEventValue>) => any | Promise<any>;\n /**\n * The render function to handle the event.\n */\n render?: (props: LangGraphInterruptRenderProps<TEventValue>) => string | React.ReactElement;\n /**\n * Method that returns a boolean, indicating if the interrupt action should run\n * Useful when using multiple interrupts\n */\n enabled?: (args: { eventValue: TEventValue; agentMetadata: AgentSession }) => boolean;\n}\n\nexport type LangGraphInterruptAction = LangGraphInterruptRender & {\n event?: LangGraphInterruptEvent;\n};\n\nexport type LangGraphInterruptActionSetterArgs = Partial<LangGraphInterruptRender> | null;\nexport type LangGraphInterruptActionSetter = (
|
|
1
|
+
{"version":3,"sources":["../../src/types/interrupt-action.ts"],"sourcesContent":["import { LangGraphInterruptEvent } from \"@copilotkit/runtime-client-gql\";\nimport { AgentSession } from \"../context/copilot-context\";\n\nexport interface LangGraphInterruptRenderHandlerProps<TEventValue = any> {\n event: LangGraphInterruptEvent<TEventValue>;\n resolve: (resolution: string) => void;\n}\n\nexport interface LangGraphInterruptRenderProps<TEventValue = any> {\n result: unknown;\n event: LangGraphInterruptEvent<TEventValue>;\n resolve: (resolution: string) => void;\n}\n\nexport interface LangGraphInterruptRender<TEventValue = any> {\n id: string;\n /**\n * The handler function to handle the event.\n */\n handler?: (props: LangGraphInterruptRenderHandlerProps<TEventValue>) => any | Promise<any>;\n /**\n * The render function to handle the event.\n */\n render?: (props: LangGraphInterruptRenderProps<TEventValue>) => string | React.ReactElement;\n /**\n * Method that returns a boolean, indicating if the interrupt action should run\n * Useful when using multiple interrupts\n */\n enabled?: (args: { eventValue: TEventValue; agentMetadata: AgentSession }) => boolean;\n}\n\nexport type LangGraphInterruptAction = LangGraphInterruptRender & {\n event?: LangGraphInterruptEvent;\n};\n\nexport type LangGraphInterruptActionSetterArgs = Partial<LangGraphInterruptRender> | null;\nexport type LangGraphInterruptActionSetter = (action: LangGraphInterruptActionSetterArgs) => void;\n\nexport interface QueuedInterruptEvent {\n eventId: string; // Generated unique ID for tracking\n threadId: string;\n event: LangGraphInterruptEvent;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../chunk-CYDWEPFL.mjs";
|
|
2
|
-
import {
|
|
3
|
-
SUGGESTION_RETRY_CONFIG
|
|
4
|
-
} from "../chunk-2IDV5OHF.mjs";
|
|
5
2
|
import {
|
|
6
3
|
shouldShowDevConsole
|
|
7
4
|
} from "../chunk-ICIK2BSB.mjs";
|
|
5
|
+
import {
|
|
6
|
+
SUGGESTION_RETRY_CONFIG
|
|
7
|
+
} from "../chunk-2IDV5OHF.mjs";
|
|
8
8
|
import "../chunk-SKC7AJIV.mjs";
|
|
9
9
|
export {
|
|
10
10
|
SUGGESTION_RETRY_CONFIG,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/v2/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/v2/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/v2/index.ts"],"sourcesContent":["import \"./index.css\";\n\nexport * from \"@copilotkitnext/core\";\nexport * from \"@copilotkitnext/react\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAEA,uBAAc,iCAFd;AAGA,uBAAc,kCAHd;","names":[]}
|
package/dist/v2/index.mjs
CHANGED
package/dist/v2/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/v2/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/v2/index.ts"],"sourcesContent":["import \"./index.css\";\n\nexport * from \"@copilotkitnext/core\";\nexport * from \"@copilotkitnext/react\";\n"],"mappings":";;;AAEA,cAAc;AACd,cAAc;","names":[]}
|
package/package.json
CHANGED
|
@@ -9,8 +9,10 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.50.0-beta.
|
|
13
|
-
"sideEffects":
|
|
12
|
+
"version": "1.50.0-beta.3",
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"**/*.css"
|
|
15
|
+
],
|
|
14
16
|
"main": "./dist/index.js",
|
|
15
17
|
"module": "./dist/index.mjs",
|
|
16
18
|
"exports": {
|
|
@@ -24,19 +26,17 @@
|
|
|
24
26
|
"require": "./dist/v2/index.js",
|
|
25
27
|
"types": "./dist/v2/index.d.ts"
|
|
26
28
|
},
|
|
27
|
-
"./v2/styles.css": "./dist/index.css"
|
|
29
|
+
"./v2/styles.css": "./dist/v2/index.css"
|
|
28
30
|
},
|
|
29
31
|
"types": "./dist/index.d.ts",
|
|
30
32
|
"license": "MIT",
|
|
31
33
|
"peerDependencies": {
|
|
32
|
-
"@copilotkitnext/core": "0.0.23",
|
|
33
|
-
"@copilotkitnext/react": "0.0.23",
|
|
34
34
|
"react": "^18 || ^19 || ^19.0.0-rc",
|
|
35
35
|
"react-dom": "^18 || ^19 || ^19.0.0-rc",
|
|
36
36
|
"zod": ">=3.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@ag-ui/client": "^0.0.
|
|
39
|
+
"@ag-ui/client": "^0.0.41",
|
|
40
40
|
"@testing-library/react": "^16.3.0",
|
|
41
41
|
"@testing-library/react-hooks": "^8.0.1",
|
|
42
42
|
"@types/jest": "^29.5.4",
|
|
@@ -56,11 +56,13 @@
|
|
|
56
56
|
"tsconfig": "1.4.6"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
+
"@copilotkitnext/core": "0.0.23",
|
|
60
|
+
"@copilotkitnext/react": "0.0.23",
|
|
59
61
|
"@scarf/scarf": "^1.3.0",
|
|
60
62
|
"react-markdown": "^8.0.7",
|
|
61
63
|
"untruncate-json": "^0.0.1",
|
|
62
|
-
"@copilotkit/runtime-client-gql": "1.50.0-beta.
|
|
63
|
-
"@copilotkit/shared": "1.50.0-beta.
|
|
64
|
+
"@copilotkit/runtime-client-gql": "1.50.0-beta.3",
|
|
65
|
+
"@copilotkit/shared": "1.50.0-beta.3"
|
|
64
66
|
},
|
|
65
67
|
"keywords": [
|
|
66
68
|
"copilotkit",
|
|
@@ -71,11 +71,7 @@ export function CopilotKit({ children, ...props }: CopilotKitProps) {
|
|
|
71
71
|
<ToastProvider enabled={enabled}>
|
|
72
72
|
<CopilotErrorBoundary publicApiKey={publicApiKey} showUsageBanner={enabled}>
|
|
73
73
|
<ThreadsProvider threadId={props.threadId}>
|
|
74
|
-
<CopilotKitProvider
|
|
75
|
-
{...props}
|
|
76
|
-
renderCustomMessages={renderArr}
|
|
77
|
-
useSingleEndpoint={true}
|
|
78
|
-
>
|
|
74
|
+
<CopilotKitProvider {...props} renderCustomMessages={renderArr} useSingleEndpoint={true}>
|
|
79
75
|
<CopilotKitInternal {...props}>{children}</CopilotKitInternal>
|
|
80
76
|
</CopilotKitProvider>
|
|
81
77
|
</ThreadsProvider>
|
|
@@ -397,21 +393,18 @@ export function CopilotKitInternal(cpkProps: CopilotKitProps) {
|
|
|
397
393
|
const [interruptActions, _setInterruptActions] = useState<
|
|
398
394
|
Record<string, LangGraphInterruptRender>
|
|
399
395
|
>({});
|
|
400
|
-
const setInterruptAction = useCallback(
|
|
401
|
-
(
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
},
|
|
413
|
-
[],
|
|
414
|
-
);
|
|
396
|
+
const setInterruptAction = useCallback((action: LangGraphInterruptActionSetterArgs) => {
|
|
397
|
+
_setInterruptActions((prev) => {
|
|
398
|
+
if (action == null || !action.id) {
|
|
399
|
+
// Cannot set action without id
|
|
400
|
+
return prev;
|
|
401
|
+
}
|
|
402
|
+
return {
|
|
403
|
+
...prev,
|
|
404
|
+
[action.id]: { ...(prev[action.id] ?? {}), ...action } as LangGraphInterruptRender,
|
|
405
|
+
};
|
|
406
|
+
});
|
|
407
|
+
}, []);
|
|
415
408
|
const removeInterruptAction = useCallback((actionId: string): void => {
|
|
416
409
|
_setInterruptActions((prev) => {
|
|
417
410
|
const { [actionId]: _, ...rest } = prev;
|
|
@@ -433,15 +426,22 @@ export function CopilotKitInternal(cpkProps: CopilotKitProps) {
|
|
|
433
426
|
});
|
|
434
427
|
}, []);
|
|
435
428
|
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
429
|
+
const resolveInterruptEvent = useCallback(
|
|
430
|
+
(threadId: string, eventId: string, response: string) => {
|
|
431
|
+
setInterruptEventQueue((prev) => {
|
|
432
|
+
const threadQueue = prev[threadId] || [];
|
|
433
|
+
return {
|
|
434
|
+
...prev,
|
|
435
|
+
[threadId]: threadQueue.map((queuedEvent) =>
|
|
436
|
+
queuedEvent.eventId === eventId
|
|
437
|
+
? { ...queuedEvent, event: { ...queuedEvent.event, response } }
|
|
438
|
+
: queuedEvent,
|
|
439
|
+
),
|
|
440
|
+
};
|
|
441
|
+
});
|
|
442
|
+
},
|
|
443
|
+
[],
|
|
444
|
+
);
|
|
445
445
|
|
|
446
446
|
const memoizedChildren = useMemo(() => children, [children]);
|
|
447
447
|
const [bannerError, setBannerError] = useState<CopilotKitError | null>(null);
|
|
@@ -573,7 +573,7 @@ export function CopilotKitInternal(cpkProps: CopilotKitProps) {
|
|
|
573
573
|
removeInterruptAction,
|
|
574
574
|
interruptEventQueue,
|
|
575
575
|
addInterruptEvent,
|
|
576
|
-
|
|
576
|
+
resolveInterruptEvent,
|
|
577
577
|
bannerError,
|
|
578
578
|
setBannerError,
|
|
579
579
|
onError: handleErrors,
|
|
@@ -222,7 +222,7 @@ export interface CopilotContextParams {
|
|
|
222
222
|
removeInterruptAction: (actionId: string) => void;
|
|
223
223
|
interruptEventQueue: Record<string, QueuedInterruptEvent[]>;
|
|
224
224
|
addInterruptEvent: (queuedEvent: QueuedInterruptEvent) => void;
|
|
225
|
-
|
|
225
|
+
resolveInterruptEvent: (threadId: string, eventId: string, response: string) => void;
|
|
226
226
|
|
|
227
227
|
/**
|
|
228
228
|
* Optional trace handler for comprehensive debugging and observability.
|
|
@@ -308,7 +308,7 @@ const emptyCopilotContext: CopilotContextParams = {
|
|
|
308
308
|
removeInterruptAction: () => {},
|
|
309
309
|
interruptEventQueue: {},
|
|
310
310
|
addInterruptEvent: () => {},
|
|
311
|
-
|
|
311
|
+
resolveInterruptEvent: () => {},
|
|
312
312
|
onError: () => {},
|
|
313
313
|
bannerError: null,
|
|
314
314
|
setBannerError: () => {},
|
|
@@ -195,8 +195,8 @@ export function useCoagentStateRenderBridge(agentId: string, props: CoAgentState
|
|
|
195
195
|
const renderClaimedByOtherMessage = Object.values(claimsRef.current).find(
|
|
196
196
|
(c) =>
|
|
197
197
|
c.stateRenderId === stateRenderId &&
|
|
198
|
-
dataToUUID(
|
|
199
|
-
dataToUUID(
|
|
198
|
+
dataToUUID(getStateWithoutConstantKeys(c.stateSnapshot)) ===
|
|
199
|
+
dataToUUID(getStateWithoutConstantKeys(renderSnapshot)),
|
|
200
200
|
);
|
|
201
201
|
if (renderClaimedByOtherMessage) {
|
|
202
202
|
// If:
|
|
@@ -30,7 +30,7 @@ export function useLangGraphInterruptRender(
|
|
|
30
30
|
threadId,
|
|
31
31
|
interruptEventQueue,
|
|
32
32
|
addInterruptEvent,
|
|
33
|
-
|
|
33
|
+
resolveInterruptEvent,
|
|
34
34
|
} = useCopilotContext();
|
|
35
35
|
const existingConfig = useCopilotChatConfiguration();
|
|
36
36
|
const resolvedAgentId = existingConfig?.agentId ?? "default";
|
|
@@ -38,6 +38,7 @@ export function useLangGraphInterruptRender(
|
|
|
38
38
|
|
|
39
39
|
useEffect(() => {
|
|
40
40
|
if (!agent) return;
|
|
41
|
+
let localInterrupt: any = null;
|
|
41
42
|
const subscriber: AgentSubscriber = {
|
|
42
43
|
onCustomEvent: ({ event }) => {
|
|
43
44
|
if (event.name === "on_interrupt") {
|
|
@@ -46,12 +47,21 @@ export function useLangGraphInterruptRender(
|
|
|
46
47
|
type: event.type,
|
|
47
48
|
value: parseJson(event.value, event.value),
|
|
48
49
|
};
|
|
49
|
-
const eventId = dataToUUID(
|
|
50
|
-
|
|
50
|
+
const eventId = dataToUUID(eventData, "interruptEvents");
|
|
51
|
+
localInterrupt = {
|
|
51
52
|
eventId,
|
|
52
53
|
threadId,
|
|
53
54
|
event: eventData,
|
|
54
|
-
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
onRunStartedEvent: () => {
|
|
59
|
+
localInterrupt = null;
|
|
60
|
+
},
|
|
61
|
+
onRunFinalized: () => {
|
|
62
|
+
if (localInterrupt) {
|
|
63
|
+
addInterruptEvent(localInterrupt);
|
|
64
|
+
localInterrupt = null;
|
|
55
65
|
}
|
|
56
66
|
},
|
|
57
67
|
};
|
|
@@ -72,7 +82,7 @@ export function useLangGraphInterruptRender(
|
|
|
72
82
|
},
|
|
73
83
|
},
|
|
74
84
|
});
|
|
75
|
-
|
|
85
|
+
resolveInterruptEvent(threadId, eventId, response ?? "");
|
|
76
86
|
},
|
|
77
87
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
78
88
|
[agent, threadId],
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useContext, useEffect, useMemo } from "react";
|
|
2
2
|
import { CopilotContext } from "../context/copilot-context";
|
|
3
3
|
import { LangGraphInterruptRender } from "../types/interrupt-action";
|
|
4
|
-
import { useCopilotChatInternal } from "./use-copilot-chat_internal";
|
|
5
4
|
import { useToast } from "../components/toast/toast-provider";
|
|
6
5
|
import { dataToUUID } from "@copilotkit/shared";
|
|
7
6
|
|
|
@@ -13,7 +12,7 @@ export function useLangGraphInterrupt<TEventValue = any>(
|
|
|
13
12
|
useContext(CopilotContext);
|
|
14
13
|
const { addToast } = useToast();
|
|
15
14
|
|
|
16
|
-
const actionId = dataToUUID(
|
|
15
|
+
const actionId = dataToUUID(action, "lgAction");
|
|
17
16
|
|
|
18
17
|
useEffect(() => {
|
|
19
18
|
if (!action) return;
|
|
@@ -27,7 +26,7 @@ export function useLangGraphInterrupt<TEventValue = any>(
|
|
|
27
26
|
// return;
|
|
28
27
|
// }
|
|
29
28
|
|
|
30
|
-
setInterruptAction(
|
|
29
|
+
setInterruptAction({ ...action, id: actionId });
|
|
31
30
|
|
|
32
31
|
// Cleanup: remove action on unmount
|
|
33
32
|
return () => {
|
|
@@ -34,10 +34,7 @@ export type LangGraphInterruptAction = LangGraphInterruptRender & {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export type LangGraphInterruptActionSetterArgs = Partial<LangGraphInterruptRender> | null;
|
|
37
|
-
export type LangGraphInterruptActionSetter = (
|
|
38
|
-
threadId: string,
|
|
39
|
-
action: LangGraphInterruptActionSetterArgs,
|
|
40
|
-
) => void;
|
|
37
|
+
export type LangGraphInterruptActionSetter = (action: LangGraphInterruptActionSetterArgs) => void;
|
|
41
38
|
|
|
42
39
|
export interface QueuedInterruptEvent {
|
|
43
40
|
eventId: string; // Generated unique ID for tracking
|
package/src/v2/index.ts
CHANGED
package/tsup.config.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-langgraph-interrupt.ts"],"sourcesContent":["import { useContext, useEffect, useMemo } from \"react\";\nimport { CopilotContext } from \"../context/copilot-context\";\nimport { LangGraphInterruptRender } from \"../types/interrupt-action\";\nimport { useCopilotChatInternal } from \"./use-copilot-chat_internal\";\nimport { useToast } from \"../components/toast/toast-provider\";\nimport { dataToUUID } from \"@copilotkit/shared\";\n\nexport function useLangGraphInterrupt<TEventValue = any>(\n action: Omit<LangGraphInterruptRender<TEventValue>, \"id\">,\n dependencies?: any[],\n) {\n const { setInterruptAction, removeInterruptAction, interruptActions, threadId } =\n useContext(CopilotContext);\n const { addToast } = useToast();\n\n const actionId = dataToUUID(JSON.stringify(action), \"lgAction\");\n\n useEffect(() => {\n if (!action) return;\n\n // if (!action.enabled) {\n // TODO: if there are any other actions registered, we need to warn the user that a current action without \"enabled\" might render for everything\n // addToast({\n // type: \"warning\",\n // message: \"An action is already registered for the interrupt event\",\n // });\n // return;\n // }\n\n setInterruptAction(threadId, { ...action, id: actionId });\n\n // Cleanup: remove action on unmount\n return () => {\n removeInterruptAction(actionId);\n };\n }, [setInterruptAction, removeInterruptAction, threadId, actionId, ...(dependencies || [])]);\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,YAAY,iBAA0B;AAK/C,SAAS,kBAAkB;AAEpB,SAAS,sBACd,QACA,cACA;AACA,QAAM,EAAE,oBAAoB,uBAAuB,kBAAkB,SAAS,IAC5E,WAAW,cAAc;AAC3B,QAAM,EAAE,SAAS,IAAI,SAAS;AAE9B,QAAM,WAAW,WAAW,KAAK,UAAU,MAAM,GAAG,UAAU;AAE9D,YAAU,MAAM;AACd,QAAI,CAAC;AAAQ;AAWb,uBAAmB,UAAU,iCAAK,SAAL,EAAa,IAAI,SAAS,EAAC;AAGxD,WAAO,MAAM;AACX,4BAAsB,QAAQ;AAAA,IAChC;AAAA,EACF,GAAG,CAAC,oBAAoB,uBAAuB,UAAU,UAAU,GAAI,gBAAgB,CAAC,CAAE,CAAC;AAC7F;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-langgraph-interrupt-render.ts"],"sourcesContent":["import { useCopilotContext } from \"../context\";\nimport React, { useCallback, useEffect, useMemo } from \"react\";\nimport type { AbstractAgent, AgentSubscriber } from \"@ag-ui/client\";\nimport { MetaEventName } from \"@copilotkit/runtime-client-gql\";\nimport { dataToUUID, parseJson } from \"@copilotkit/shared\";\nimport { useAgentNodeName } from \"./use-agent-nodename\";\nimport { useCopilotChatConfiguration } from \"@copilotkitnext/react\";\n\ntype InterruptProps = {\n event: any;\n result: any;\n render: (props: {\n event: any;\n result: any;\n resolve: (response: string) => void;\n }) => string | React.ReactElement;\n resolve: (response: string) => void;\n};\n\nconst InterruptRenderer: React.FC<InterruptProps> = ({ event, result, render, resolve }) => {\n return render({ event, result, resolve });\n};\n\nexport function useLangGraphInterruptRender(\n agent: AbstractAgent,\n): string | React.ReactElement | null {\n const {\n interruptActions,\n agentSession,\n threadId,\n interruptEventQueue,\n addInterruptEvent,\n removeInterruptEvent,\n } = useCopilotContext();\n const existingConfig = useCopilotChatConfiguration();\n const resolvedAgentId = existingConfig?.agentId ?? \"default\";\n const nodeName = useAgentNodeName(resolvedAgentId);\n\n useEffect(() => {\n if (!agent) return;\n const subscriber: AgentSubscriber = {\n onCustomEvent: ({ event }) => {\n if (event.name === \"on_interrupt\") {\n const eventData = {\n name: MetaEventName.LangGraphInterruptEvent,\n type: event.type,\n value: parseJson(event.value, event.value),\n };\n const eventId = dataToUUID(JSON.stringify(eventData), \"interruptEvents\");\n addInterruptEvent({\n eventId,\n threadId,\n event: eventData,\n });\n }\n },\n };\n\n const { unsubscribe } = agent.subscribe(subscriber);\n return () => {\n unsubscribe();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [agent, threadId]);\n\n const handleResolve = useCallback(\n (eventId: string, response?: string) => {\n agent?.runAgent({\n forwardedProps: {\n command: {\n resume: response,\n },\n },\n });\n removeInterruptEvent(threadId, eventId);\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [agent, threadId],\n );\n\n return useMemo(() => {\n // Get the queue for this thread and find the first unresponded event\n const eventQueue = interruptEventQueue[threadId] || [];\n const currentQueuedEvent = eventQueue.find((qe) => !qe.event.response);\n\n if (!currentQueuedEvent || !agentSession) return null;\n\n // Find the first matching action from all registered actions\n const allActions = Object.values(interruptActions);\n const matchingAction = allActions.find((action) => {\n if (!action.enabled) return true; // No filter = match all\n return action.enabled({\n eventValue: currentQueuedEvent.event.value,\n agentMetadata: {\n ...agentSession,\n nodeName,\n },\n });\n });\n\n if (!matchingAction) return null;\n\n const { render, handler } = matchingAction;\n\n const resolveInterrupt = (response: string) => {\n handleResolve(currentQueuedEvent.eventId, response);\n };\n\n let result = null;\n if (handler) {\n result = handler({\n event: currentQueuedEvent.event,\n resolve: resolveInterrupt,\n });\n }\n\n if (!render) return null;\n\n return React.createElement(InterruptRenderer, {\n event: currentQueuedEvent.event,\n result,\n render,\n resolve: resolveInterrupt,\n });\n }, [interruptActions, interruptEventQueue, threadId, agentSession, handleResolve]);\n}\n"],"mappings":";;;;;;;;;;;;AACA,OAAO,SAAS,aAAa,WAAW,eAAe;AAEvD,SAAS,qBAAqB;AAC9B,SAAS,YAAY,iBAAiB;AAEtC,SAAS,mCAAmC;AAa5C,IAAM,oBAA8C,CAAC,EAAE,OAAO,QAAQ,QAAQ,QAAQ,MAAM;AAC1F,SAAO,OAAO,EAAE,OAAO,QAAQ,QAAQ,CAAC;AAC1C;AAEO,SAAS,4BACd,OACoC;AAzBtC;AA0BE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,kBAAkB;AACtB,QAAM,iBAAiB,4BAA4B;AACnD,QAAM,mBAAkB,sDAAgB,YAAhB,YAA2B;AACnD,QAAM,WAAW,iBAAiB,eAAe;AAEjD,YAAU,MAAM;AACd,QAAI,CAAC;AAAO;AACZ,UAAM,aAA8B;AAAA,MAClC,eAAe,CAAC,EAAE,MAAM,MAAM;AAC5B,YAAI,MAAM,SAAS,gBAAgB;AACjC,gBAAM,YAAY;AAAA,YAChB,MAAM,cAAc;AAAA,YACpB,MAAM,MAAM;AAAA,YACZ,OAAO,UAAU,MAAM,OAAO,MAAM,KAAK;AAAA,UAC3C;AACA,gBAAM,UAAU,WAAW,KAAK,UAAU,SAAS,GAAG,iBAAiB;AACvE,4BAAkB;AAAA,YAChB;AAAA,YACA;AAAA,YACA,OAAO;AAAA,UACT,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAEA,UA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;AAAA,IACX,CAAC;AAAA,EACH,GAAG,CAAC,kBAAkB,qBAAqB,UAAU,cAAc,aAAa,CAAC;AACnF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/copilot-provider/copilotkit.tsx"],"sourcesContent":["/**\n * This component will typically wrap your entire application (or a sub-tree of your application where you want to have a copilot). It provides the copilot context to all other components and hooks.\n *\n * ## Example\n *\n * You can find more information about self-hosting CopilotKit [here](/guides/self-hosting).\n *\n * ```tsx\n * import { CopilotKit } from \"@copilotkit/react-core\";\n *\n * <CopilotKit runtimeUrl=\"<your-runtime-url>\">\n * // ... your app ...\n * </CopilotKit>\n * ```\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState, SetStateAction } from \"react\";\nimport { CopilotChatConfigurationProvider, CopilotKitProvider } from \"@copilotkitnext/react\";\nimport {\n CopilotContext,\n CopilotApiConfig,\n ChatComponentsCache,\n AgentSession,\n AuthState,\n} from \"../../context/copilot-context\";\nimport useTree from \"../../hooks/use-tree\";\nimport { CopilotChatSuggestionConfiguration, DocumentPointer } from \"../../types\";\nimport { flushSync } from \"react-dom\";\nimport {\n COPILOT_CLOUD_CHAT_URL,\n CopilotCloudConfig,\n FunctionCallHandler,\n COPILOT_CLOUD_PUBLIC_API_KEY_HEADER,\n randomUUID,\n ConfigurationError,\n MissingPublicApiKeyError,\n CopilotKitError,\n CopilotErrorEvent,\n CopilotErrorHandler,\n} from \"@copilotkit/shared\";\nimport { FrontendAction } from \"../../types/frontend-action\";\nimport useFlatCategoryStore from \"../../hooks/use-flat-category-store\";\nimport { CopilotKitProps } from \"./copilotkit-props\";\nimport { CoagentState } from \"../../types/coagent-state\";\nimport { CopilotMessages, MessagesTapProvider } from \"./copilot-messages\";\nimport { ToastProvider } from \"../toast/toast-provider\";\nimport { getErrorActions, UsageBanner } from \"../usage-banner\";\nimport { shouldShowDevConsole } from \"../../utils\";\nimport { CopilotErrorBoundary } from \"../error-boundary/error-boundary\";\nimport { Agent, ExtensionsInput } from \"@copilotkit/runtime-client-gql\";\nimport {\n LangGraphInterruptRender,\n LangGraphInterruptActionSetterArgs,\n QueuedInterruptEvent,\n} from \"../../types/interrupt-action\";\nimport { ConsoleTrigger } from \"../dev-console/console-trigger\";\nimport { CoAgentStateRendersProvider } from \"../../context/coagent-state-renders-context\";\nimport { CoAgentStateRenderBridge } from \"../../hooks/use-coagent-state-render-bridge\";\nimport { ThreadsProvider, useThreads } from \"../../context/threads-context\";\nimport { CopilotListeners } from \"../CopilotListeners\";\n\nexport function CopilotKit({ children, ...props }: CopilotKitProps) {\n const enabled = shouldShowDevConsole(props.showDevConsole);\n\n // Use API key if provided, otherwise use the license key\n const publicApiKey = props.publicApiKey || props.publicLicenseKey;\n\n const renderArr = useMemo(() => [{ render: CoAgentStateRenderBridge }], []);\n\n return (\n <ToastProvider enabled={enabled}>\n <CopilotErrorBoundary publicApiKey={publicApiKey} showUsageBanner={enabled}>\n <ThreadsProvider threadId={props.threadId}>\n <CopilotKitProvider\n {...props}\n renderCustomMessages={renderArr}\n useSingleEndpoint={true}\n >\n <CopilotKitInternal {...props}>{children}</CopilotKitInternal>\n </CopilotKitProvider>\n </ThreadsProvider>\n </CopilotErrorBoundary>\n </ToastProvider>\n );\n}\n\nexport function CopilotKitInternal(cpkProps: CopilotKitProps) {\n const { children, ...props } = cpkProps;\n\n /**\n * This will throw an error if the props are invalid.\n */\n validateProps(cpkProps);\n\n // Use license key as API key if provided, otherwise use the API key\n const publicApiKey = props.publicLicenseKey || props.publicApiKey;\n\n const chatApiEndpoint = props.runtimeUrl || COPILOT_CLOUD_CHAT_URL;\n\n const [actions, setActions] = useState<Record<string, FrontendAction<any>>>({});\n\n // State for registered actions from useCopilotAction\n const [registeredActionConfigs, setRegisteredActionConfigs] = useState<\n Map<string, { type: string; action: any; component: any }>\n >(new Map());\n\n const chatComponentsCache = useRef<ChatComponentsCache>({\n actions: {},\n coAgentStateRenders: {},\n });\n\n const { addElement, removeElement, printTree, getAllElements } = useTree();\n const [isLoading, setIsLoading] = useState(false);\n const [chatInstructions, setChatInstructions] = useState(\"\");\n const [authStates, setAuthStates] = useState<Record<string, AuthState>>({});\n const [extensions, setExtensions] = useState<ExtensionsInput>({});\n const [additionalInstructions, setAdditionalInstructions] = useState<string[]>([]);\n\n const {\n addElement: addDocument,\n removeElement: removeDocument,\n allElements: allDocuments,\n } = useFlatCategoryStore<DocumentPointer>();\n\n // Compute all the functions and properties that we need to pass\n const setAction = useCallback((id: string, action: FrontendAction<any>) => {\n setActions((prevPoints) => {\n return {\n ...prevPoints,\n [id]: action,\n };\n });\n }, []);\n\n const removeAction = useCallback((id: string) => {\n setActions((prevPoints) => {\n const newPoints = { ...prevPoints };\n delete newPoints[id];\n return newPoints;\n });\n }, []);\n\n const getContextString = useCallback(\n (documents: DocumentPointer[], categories: string[]) => {\n const documentsString = documents\n .map((document) => {\n return `${document.name} (${document.sourceApplication}):\\n${document.getContents()}`;\n })\n .join(\"\\n\\n\");\n\n const nonDocumentStrings = printTree(categories);\n\n return `${documentsString}\\n\\n${nonDocumentStrings}`;\n },\n [printTree],\n );\n\n const addContext = useCallback(\n (\n context: string,\n parentId?: string,\n categories: string[] = defaultCopilotContextCategories,\n ) => {\n return addElement(context, categories, parentId);\n },\n [addElement],\n );\n\n const removeContext = useCallback(\n (id: string) => {\n removeElement(id);\n },\n [removeElement],\n );\n\n const getAllContext = useCallback(() => {\n return getAllElements();\n }, [getAllElements]);\n\n const getFunctionCallHandler = useCallback(\n (customEntryPoints?: Record<string, FrontendAction<any>>) => {\n return entryPointsToFunctionCallHandler(Object.values(customEntryPoints || actions));\n },\n [actions],\n );\n\n const getDocumentsContext = useCallback(\n (categories: string[]) => {\n return allDocuments(categories);\n },\n [allDocuments],\n );\n\n const addDocumentContext = useCallback(\n (documentPointer: DocumentPointer, categories: string[] = defaultCopilotContextCategories) => {\n return addDocument(documentPointer, categories);\n },\n [addDocument],\n );\n\n const removeDocumentContext = useCallback(\n (documentId: string) => {\n removeDocument(documentId);\n },\n [removeDocument],\n );\n\n // get the appropriate CopilotApiConfig from the props\n const copilotApiConfig: CopilotApiConfig = useMemo(() => {\n let cloud: CopilotCloudConfig | undefined = undefined;\n if (publicApiKey) {\n cloud = {\n guardrails: {\n input: {\n restrictToTopic: {\n enabled: Boolean(props.guardrails_c),\n validTopics: props.guardrails_c?.validTopics || [],\n invalidTopics: props.guardrails_c?.invalidTopics || [],\n },\n },\n },\n };\n }\n\n return {\n publicApiKey: publicApiKey,\n ...(cloud ? { cloud } : {}),\n chatApiEndpoint: chatApiEndpoint,\n headers: props.headers || {},\n properties: props.properties || {},\n transcribeAudioUrl: props.transcribeAudioUrl,\n textToSpeechUrl: props.textToSpeechUrl,\n credentials: props.credentials,\n };\n }, [\n publicApiKey,\n props.headers,\n props.properties,\n props.transcribeAudioUrl,\n props.textToSpeechUrl,\n props.credentials,\n props.cloudRestrictToTopic,\n props.guardrails_c,\n ]);\n\n const headers = useMemo(() => {\n const authHeaders = Object.values(authStates || {}).reduce((acc, state) => {\n if (state.status === \"authenticated\" && state.authHeaders) {\n return {\n ...acc,\n ...Object.entries(state.authHeaders).reduce(\n (headers, [key, value]) => ({\n ...headers,\n [key.startsWith(\"X-Custom-\") ? key : `X-Custom-${key}`]: value,\n }),\n {},\n ),\n };\n }\n return acc;\n }, {});\n\n return {\n ...(copilotApiConfig.headers || {}),\n ...(copilotApiConfig.publicApiKey\n ? { [COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey }\n : {}),\n ...authHeaders,\n };\n }, [copilotApiConfig.headers, copilotApiConfig.publicApiKey, authStates]);\n\n const [internalErrorHandlers, _setInternalErrorHandler] = useState<\n Record<string, CopilotErrorHandler>\n >({});\n const setInternalErrorHandler = useCallback((handler: Record<string, CopilotErrorHandler>) => {\n _setInternalErrorHandler((prev: Record<string, CopilotErrorHandler>) => ({\n ...prev,\n ...handler,\n }));\n }, []);\n const removeInternalErrorHandler = useCallback((key: string) => {\n _setInternalErrorHandler((prev) => {\n const { [key]: _removed, ...rest } = prev;\n return rest;\n });\n }, []);\n\n // Keep latest values in refs\n const onErrorRef = useRef<CopilotErrorHandler | undefined>(props.onError);\n useEffect(() => {\n onErrorRef.current = props.onError;\n }, [props.onError]);\n\n const internalHandlersRef = useRef<Record<string, CopilotErrorHandler>>({});\n useEffect(() => {\n internalHandlersRef.current = internalErrorHandlers;\n }, [internalErrorHandlers]);\n\n const handleErrors = useCallback(\n async (error: CopilotErrorEvent) => {\n if (copilotApiConfig.publicApiKey && onErrorRef.current) {\n try {\n await onErrorRef.current(error);\n } catch (e) {\n console.error(\"Error in public onError handler:\", e);\n }\n }\n const handlers = Object.values(internalHandlersRef.current);\n await Promise.all(\n handlers.map((h) =>\n Promise.resolve(h(error)).catch((e) =>\n console.error(\"Error in internal error handler:\", e),\n ),\n ),\n );\n },\n [copilotApiConfig.publicApiKey],\n );\n\n const [chatSuggestionConfiguration, setChatSuggestionConfiguration] = useState<{\n [key: string]: CopilotChatSuggestionConfiguration;\n }>({});\n\n const addChatSuggestionConfiguration = useCallback(\n (id: string, suggestion: CopilotChatSuggestionConfiguration) => {\n setChatSuggestionConfiguration((prev) => ({ ...prev, [id]: suggestion }));\n },\n [setChatSuggestionConfiguration],\n );\n\n const removeChatSuggestionConfiguration = useCallback(\n (id: string) => {\n setChatSuggestionConfiguration((prev) => {\n const { [id]: _, ...rest } = prev;\n return rest;\n });\n },\n [setChatSuggestionConfiguration],\n );\n\n const [availableAgents, setAvailableAgents] = useState<Agent[]>([]);\n const [coagentStates, setCoagentStates] = useState<Record<string, CoagentState>>({});\n const coagentStatesRef = useRef<Record<string, CoagentState>>({});\n const setCoagentStatesWithRef = useCallback(\n (\n value:\n | Record<string, CoagentState>\n | ((prev: Record<string, CoagentState>) => Record<string, CoagentState>),\n ) => {\n const newValue = typeof value === \"function\" ? value(coagentStatesRef.current) : value;\n coagentStatesRef.current = newValue;\n setCoagentStates((prev) => {\n return newValue;\n });\n },\n [],\n );\n\n let initialAgentSession: AgentSession | null = null;\n if (props.agent) {\n initialAgentSession = {\n agentName: props.agent,\n };\n }\n\n const [agentSession, setAgentSession] = useState<AgentSession | null>(initialAgentSession);\n\n // Update agentSession when props.agent changes\n useEffect(() => {\n if (props.agent) {\n setAgentSession({\n agentName: props.agent,\n });\n } else {\n setAgentSession(null);\n }\n }, [props.agent]);\n\n const { threadId, setThreadId: setInternalThreadId } = useThreads();\n\n const setThreadId = useCallback(\n (value: SetStateAction<string>) => {\n if (props.threadId) {\n throw new Error(\"Cannot call setThreadId() when threadId is provided via props.\");\n }\n setInternalThreadId(value);\n },\n [props.threadId],\n );\n\n const [runId, setRunId] = useState<string | null>(null);\n\n const chatAbortControllerRef = useRef<AbortController | null>(null);\n\n const showDevConsole = shouldShowDevConsole(props.showDevConsole);\n\n const [interruptActions, _setInterruptActions] = useState<\n Record<string, LangGraphInterruptRender>\n >({});\n const setInterruptAction = useCallback(\n (threadId: string, action: LangGraphInterruptActionSetterArgs) => {\n _setInterruptActions((prev) => {\n if (action == null || !action.id) {\n // Cannot set action without id\n return prev;\n }\n return {\n ...prev,\n [action.id]: { ...(prev[action.id] ?? {}), ...action } as LangGraphInterruptRender,\n };\n });\n },\n [],\n );\n const removeInterruptAction = useCallback((actionId: string): void => {\n _setInterruptActions((prev) => {\n const { [actionId]: _, ...rest } = prev;\n return rest;\n });\n }, []);\n\n const [interruptEventQueue, setInterruptEventQueue] = useState<\n Record<string, QueuedInterruptEvent[]>\n >({});\n\n const addInterruptEvent = useCallback((queuedEvent: QueuedInterruptEvent) => {\n setInterruptEventQueue((prev) => {\n const threadQueue = prev[queuedEvent.threadId] || [];\n return {\n ...prev,\n [queuedEvent.threadId]: [...threadQueue, queuedEvent],\n };\n });\n }, []);\n\n const removeInterruptEvent = useCallback((threadId: string, eventId: string) => {\n setInterruptEventQueue((prev) => {\n const threadQueue = prev[threadId] || [];\n return {\n ...prev,\n [threadId]: threadQueue.filter((event) => event.eventId !== eventId),\n };\n });\n }, []);\n\n const memoizedChildren = useMemo(() => children, [children]);\n const [bannerError, setBannerError] = useState<CopilotKitError | null>(null);\n\n const agentLock = useMemo(() => props.agent ?? null, [props.agent]);\n\n const forwardedParameters = useMemo(\n () => props.forwardedParameters ?? {},\n [props.forwardedParameters],\n );\n\n const updateExtensions = useCallback(\n (newExtensions: SetStateAction<ExtensionsInput>) => {\n setExtensions((prev: ExtensionsInput) => {\n const resolved = typeof newExtensions === \"function\" ? newExtensions(prev) : newExtensions;\n const isSameLength = Object.keys(resolved).length === Object.keys(prev).length;\n const isEqual =\n isSameLength &&\n // @ts-ignore\n Object.entries(resolved).every(([key, value]) => prev[key] === value);\n\n return isEqual ? prev : resolved;\n });\n },\n [setExtensions],\n );\n\n const updateAuthStates = useCallback(\n (newAuthStates: SetStateAction<Record<string, AuthState>>) => {\n setAuthStates((prev) => {\n const resolved = typeof newAuthStates === \"function\" ? newAuthStates(prev) : newAuthStates;\n const isSameLength = Object.keys(resolved).length === Object.keys(prev).length;\n const isEqual =\n isSameLength &&\n // @ts-ignore\n Object.entries(resolved).every(([key, value]) => prev[key] === value);\n\n return isEqual ? prev : resolved;\n });\n },\n [setAuthStates],\n );\n\n const handleSetRegisteredActions = useCallback((actionConfig: any): string => {\n const key = actionConfig.action.name || randomUUID();\n setRegisteredActionConfigs((prev) => {\n const newMap = new Map(prev);\n newMap.set(key, actionConfig);\n return newMap;\n });\n return key;\n }, []);\n\n const handleRemoveRegisteredAction = useCallback((actionKey: string) => {\n setRegisteredActionConfigs((prev) => {\n const newMap = new Map(prev);\n newMap.delete(actionKey);\n return newMap;\n });\n }, []);\n\n // Component to render all registered actions\n const RegisteredActionsRenderer = useMemo(() => {\n return () => (\n <>\n {Array.from(registeredActionConfigs.entries()).map(([key, config]) => {\n const Component = config.component;\n return <Component key={key} action={config.action} />;\n })}\n </>\n );\n }, [registeredActionConfigs]);\n\n return (\n <CopilotChatConfigurationProvider\n // labels={labels}\n // isModalDefaultOpen={isModalDefaultOpen}\n agentId={props.agent ?? \"default\"}\n threadId={threadId}\n >\n <CopilotContext.Provider\n value={{\n actions,\n chatComponentsCache,\n getFunctionCallHandler,\n setAction,\n removeAction,\n setRegisteredActions: handleSetRegisteredActions,\n removeRegisteredAction: handleRemoveRegisteredAction,\n getContextString,\n addContext,\n removeContext,\n getAllContext,\n getDocumentsContext,\n addDocumentContext,\n removeDocumentContext,\n copilotApiConfig: copilotApiConfig,\n isLoading,\n setIsLoading,\n chatSuggestionConfiguration,\n addChatSuggestionConfiguration,\n removeChatSuggestionConfiguration,\n chatInstructions,\n setChatInstructions,\n additionalInstructions,\n setAdditionalInstructions,\n showDevConsole,\n coagentStates,\n setCoagentStates,\n coagentStatesRef,\n setCoagentStatesWithRef,\n agentSession,\n setAgentSession,\n forwardedParameters,\n agentLock,\n threadId,\n setThreadId,\n runId,\n setRunId,\n chatAbortControllerRef,\n availableAgents,\n authConfig_c: props.authConfig_c,\n authStates_c: authStates,\n setAuthStates_c: updateAuthStates,\n extensions,\n setExtensions: updateExtensions,\n interruptActions,\n setInterruptAction,\n removeInterruptAction,\n interruptEventQueue,\n addInterruptEvent,\n removeInterruptEvent,\n bannerError,\n setBannerError,\n onError: handleErrors,\n internalErrorHandlers,\n setInternalErrorHandler,\n removeInternalErrorHandler,\n }}\n >\n <CopilotListeners />\n <CoAgentStateRendersProvider>\n <MessagesTapProvider>\n <CopilotMessages>\n {memoizedChildren}\n {showDevConsole && <ConsoleTrigger />}\n <RegisteredActionsRenderer />\n </CopilotMessages>\n </MessagesTapProvider>\n {bannerError && showDevConsole && (\n <UsageBanner\n severity={bannerError.severity}\n message={bannerError.message}\n onClose={() => setBannerError(null)}\n actions={getErrorActions(bannerError)}\n />\n )}\n </CoAgentStateRendersProvider>\n </CopilotContext.Provider>\n </CopilotChatConfigurationProvider>\n );\n}\n\nexport const defaultCopilotContextCategories = [\"global\"];\n\nfunction entryPointsToFunctionCallHandler(actions: FrontendAction<any>[]): FunctionCallHandler {\n return async ({ name, args }: { name: string; args: Record<string, any> }) => {\n let actionsByFunctionName: Record<string, FrontendAction<any>> = {};\n for (let action of actions) {\n actionsByFunctionName[action.name] = action;\n }\n\n const action = actionsByFunctionName[name];\n let result: any = undefined;\n if (action) {\n await new Promise<void>((resolve, reject) => {\n flushSync(async () => {\n try {\n result = await action.handler?.(args);\n resolve();\n } catch (error) {\n reject(error);\n }\n });\n });\n await new Promise((resolve) => setTimeout(resolve, 20));\n }\n return result;\n };\n}\n\nfunction formatFeatureName(featureName: string): string {\n return featureName\n .replace(/_c$/, \"\")\n .split(\"_\")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(\" \");\n}\n\nfunction validateProps(props: CopilotKitProps): never | void {\n const cloudFeatures = Object.keys(props).filter((key) => key.endsWith(\"_c\"));\n\n // Check if we have either a runtimeUrl or one of the API keys\n const hasApiKey = props.publicApiKey || props.publicLicenseKey;\n\n if (!props.runtimeUrl && !hasApiKey) {\n throw new ConfigurationError(\n \"Missing required prop: 'runtimeUrl' or 'publicApiKey' or 'publicLicenseKey'\",\n );\n }\n\n if (cloudFeatures.length > 0 && !hasApiKey) {\n throw new MissingPublicApiKeyError(\n `Missing required prop: 'publicApiKey' or 'publicLicenseKey' to use cloud features: ${cloudFeatures\n .map(formatFeatureName)\n .join(\", \")}`,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,SAAS,aAAa,WAAW,SAAS,QAAQ,gBAAgC;AAClF,SAAS,kCAAkC,0BAA0B;AAUrE,SAAS,iBAAiB;AAC1B;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAuCK,SA8aN,UA9aM,KA6fA,YA7fA;AAjBL,SAAS,WAAW,IAAyC;AAAzC,eAAE,WA7D7B,IA6D2B,IAAe,kBAAf,IAAe,CAAb;AAC3B,QAAM,UAAU,qBAAqB,MAAM,cAAc;AAGzD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AAS,KAAK,CAAC,WAAW;AAC1C,UAAM,IAAI;AAAA,MACR,sFAAsF,cACnF,IAAI,iBAAiB,EACrB,KAAK,IAAI;AAAA,IACd;AAAA,EACF;AACF;","names":["_a","_b","headers","threadId","action"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|