@copilotkit/react-core 1.50.0-beta.1 → 1.50.0-beta.10
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 +93 -0
- package/dist/{chunk-UJBV5GAG.mjs → chunk-3775VM7Y.mjs} +32 -65
- package/dist/chunk-3775VM7Y.mjs.map +1 -0
- package/dist/{chunk-3GURHDG7.mjs → chunk-4HRUQH6U.mjs} +3 -3
- package/dist/{chunk-7BYHZLPL.mjs → chunk-4RRMC7L2.mjs} +4 -4
- package/dist/chunk-4RRMC7L2.mjs.map +1 -0
- package/dist/{chunk-D3QSYDJR.mjs → chunk-7IBF6RBW.mjs} +2 -2
- package/dist/{chunk-GMI4KO4X.mjs → chunk-7SHWECGN.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-JRT5BJF3.mjs → chunk-B5ELMVT7.mjs} +2 -2
- package/dist/{chunk-TXI72QHK.mjs → chunk-EG56H77V.mjs} +2 -2
- package/dist/{chunk-DCHSCK62.mjs → chunk-FYMZKPOL.mjs} +36 -42
- package/dist/chunk-FYMZKPOL.mjs.map +1 -0
- package/dist/{chunk-FBD24VEH.mjs → chunk-HE22TZMF.mjs} +2 -2
- package/dist/{chunk-FBD24VEH.mjs.map → chunk-HE22TZMF.mjs.map} +1 -1
- package/dist/chunk-I76HKHPJ.mjs +32 -0
- package/dist/chunk-I76HKHPJ.mjs.map +1 -0
- package/dist/{chunk-LHKZJ2ND.mjs → chunk-PMWUKW3Z.mjs} +3 -3
- package/dist/{chunk-NROJOTQP.mjs → chunk-QNUAXSDP.mjs} +9 -6
- package/dist/chunk-QNUAXSDP.mjs.map +1 -0
- package/dist/{chunk-NG26QEGF.mjs → chunk-T2VBHAAP.mjs} +9 -3
- package/dist/chunk-T2VBHAAP.mjs.map +1 -0
- package/dist/{chunk-QU6NONOD.mjs → chunk-U2ZRVVKT.mjs} +2 -2
- package/dist/{chunk-R4MR43UQ.mjs → chunk-VV56AVPB.mjs} +33 -9
- package/dist/chunk-VV56AVPB.mjs.map +1 -0
- package/dist/{chunk-5X5DJRQQ.mjs → chunk-WF65O6HX.mjs} +2 -7
- package/dist/chunk-WF65O6HX.mjs.map +1 -0
- package/dist/chunk-XDFVCQD3.mjs +27 -0
- package/dist/chunk-XDFVCQD3.mjs.map +1 -0
- package/dist/{chunk-WMJVBMUX.mjs → chunk-YCG6SNAU.mjs} +2 -2
- package/dist/{chunk-3R423LZT.mjs → chunk-YJGPIN3R.mjs} +3 -3
- package/dist/{chunk-BR5YEYZJ.mjs → chunk-YTQHRJUA.mjs} +2 -2
- package/dist/chunk-Z6JV2LRY.mjs +37 -0
- package/dist/chunk-Z6JV2LRY.mjs.map +1 -0
- package/dist/{chunk-24SCZAB4.mjs → chunk-ZYTXB6HH.mjs} +22 -14
- package/dist/chunk-ZYTXB6HH.mjs.map +1 -0
- package/dist/components/CopilotListeners.js +13 -146
- package/dist/components/CopilotListeners.js.map +1 -1
- package/dist/components/CopilotListeners.mjs +1 -6
- 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 +2 -2
- 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 +35 -40
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +9 -9
- package/dist/components/copilot-provider/index.d.ts +1 -1
- package/dist/components/copilot-provider/index.js +35 -40
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +9 -9
- 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/index.d.ts +1 -1
- package/dist/components/index.js +35 -40
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +9 -9
- 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 +1 -1
- package/dist/{copilot-context-1cd70a3f.d.ts → copilot-context-ec77e921.d.ts} +3 -3
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +254 -219
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +24 -23
- package/dist/hooks/use-agent-nodename.d.ts +3 -0
- package/dist/hooks/use-agent-nodename.js +56 -0
- package/dist/hooks/use-agent-nodename.js.map +1 -0
- package/dist/hooks/use-agent-nodename.mjs +8 -0
- package/dist/hooks/use-coagent-state-render-bridge.js +8 -5
- package/dist/hooks/use-coagent-state-render-bridge.js.map +1 -1
- package/dist/hooks/use-coagent-state-render-bridge.mjs +2 -2
- 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 +2 -2
- package/dist/hooks/use-coagent.js +58 -21
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +2 -1
- package/dist/hooks/use-copilot-action.js +5 -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-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 +6 -2
- package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
- package/dist/hooks/use-copilot-authenticated-action.mjs +4 -4
- package/dist/hooks/use-copilot-chat-headless_c.js +128 -140
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +6 -6
- package/dist/hooks/{use-configure-chat-suggestions.d.ts → use-copilot-chat-suggestions.d.ts} +2 -3
- package/dist/hooks/use-copilot-chat-suggestions.js +60 -0
- package/dist/hooks/use-copilot-chat-suggestions.js.map +1 -0
- package/dist/hooks/use-copilot-chat-suggestions.mjs +8 -0
- package/dist/hooks/use-copilot-chat-suggestions.mjs.map +1 -0
- package/dist/hooks/use-copilot-chat.js +126 -138
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +6 -6
- package/dist/hooks/use-copilot-chat_internal.d.ts +18 -1
- package/dist/hooks/use-copilot-chat_internal.js +126 -138
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +5 -5
- package/dist/hooks/use-copilot-readable.d.ts +1 -1
- package/dist/hooks/use-copilot-readable.js +29 -5
- package/dist/hooks/use-copilot-readable.js.map +1 -1
- package/dist/hooks/use-copilot-readable.mjs +1 -1
- package/dist/hooks/use-default-tool.js +5 -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 +5 -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.js +77 -13
- package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.mjs +3 -2
- 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 +2 -2
- package/dist/index.js +273 -246
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -33
- package/dist/lib/copilot-task.d.ts +1 -1
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +10 -10
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +10 -10
- package/dist/types/index.d.ts +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/jest.config.js +12 -0
- package/package.json +14 -11
- package/src/components/CopilotListeners.tsx +1 -2
- package/src/components/copilot-provider/copilot-messages.tsx +0 -41
- package/src/components/copilot-provider/copilotkit.tsx +31 -31
- package/src/context/copilot-context.tsx +2 -2
- package/src/hooks/__tests__/use-coagent-config.test.ts +189 -129
- package/src/hooks/index.ts +2 -2
- package/src/hooks/use-agent-nodename.ts +30 -0
- package/src/hooks/use-coagent-state-render-bridge.tsx +22 -22
- package/src/hooks/use-coagent.ts +22 -13
- package/src/hooks/use-copilot-chat-suggestions.tsx +124 -0
- package/src/hooks/use-copilot-chat_internal.ts +78 -78
- package/src/hooks/use-copilot-readable.ts +30 -12
- package/src/hooks/use-frontend-tool.ts +10 -2
- package/src/hooks/use-langgraph-interrupt-render.ts +25 -7
- package/src/hooks/use-langgraph-interrupt.ts +2 -3
- package/src/types/interrupt-action.ts +2 -5
- package/src/v2/index.ts +2 -0
- package/tsup.config.ts +1 -1
- package/dist/chunk-24SCZAB4.mjs.map +0 -1
- package/dist/chunk-5X5DJRQQ.mjs.map +0 -1
- package/dist/chunk-7BYHZLPL.mjs.map +0 -1
- package/dist/chunk-CB7CRBDG.mjs +0 -48
- package/dist/chunk-CB7CRBDG.mjs.map +0 -1
- package/dist/chunk-DCHSCK62.mjs.map +0 -1
- package/dist/chunk-IUSKVYUI.mjs +0 -13
- package/dist/chunk-IUSKVYUI.mjs.map +0 -1
- package/dist/chunk-NG26QEGF.mjs.map +0 -1
- package/dist/chunk-NROJOTQP.mjs.map +0 -1
- package/dist/chunk-R4MR43UQ.mjs.map +0 -1
- package/dist/chunk-UJBV5GAG.mjs.map +0 -1
- package/dist/hooks/use-configure-chat-suggestions.js +0 -210
- package/dist/hooks/use-configure-chat-suggestions.js.map +0 -1
- package/dist/hooks/use-configure-chat-suggestions.mjs +0 -13
- package/src/hooks/use-configure-chat-suggestions.tsx +0 -85
- /package/dist/{chunk-3GURHDG7.mjs.map → chunk-4HRUQH6U.mjs.map} +0 -0
- /package/dist/{chunk-D3QSYDJR.mjs.map → chunk-7IBF6RBW.mjs.map} +0 -0
- /package/dist/{chunk-GMI4KO4X.mjs.map → chunk-7SHWECGN.mjs.map} +0 -0
- /package/dist/{chunk-OVYFRPSN.mjs.map → chunk-ABWT4DRT.mjs.map} +0 -0
- /package/dist/{chunk-JRT5BJF3.mjs.map → chunk-B5ELMVT7.mjs.map} +0 -0
- /package/dist/{chunk-TXI72QHK.mjs.map → chunk-EG56H77V.mjs.map} +0 -0
- /package/dist/{chunk-LHKZJ2ND.mjs.map → chunk-PMWUKW3Z.mjs.map} +0 -0
- /package/dist/{chunk-QU6NONOD.mjs.map → chunk-U2ZRVVKT.mjs.map} +0 -0
- /package/dist/{chunk-WMJVBMUX.mjs.map → chunk-YCG6SNAU.mjs.map} +0 -0
- /package/dist/{chunk-3R423LZT.mjs.map → chunk-YJGPIN3R.mjs.map} +0 -0
- /package/dist/{chunk-BR5YEYZJ.mjs.map → chunk-YTQHRJUA.mjs.map} +0 -0
- /package/dist/hooks/{use-configure-chat-suggestions.mjs.map → use-agent-nodename.mjs.map} +0 -0
- /package/src/v2/{styles.css → index.css} +0 -0
package/dist/lib/index.mjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import "../chunk-LUGEI4YQ.mjs";
|
|
2
2
|
import {
|
|
3
3
|
CopilotTask
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-B5ELMVT7.mjs";
|
|
5
5
|
import "../chunk-4CEQJ2X6.mjs";
|
|
6
6
|
import "../chunk-JD7BAH7U.mjs";
|
|
7
7
|
import "../chunk-SPCZTZCY.mjs";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-FYMZKPOL.mjs";
|
|
9
9
|
import "../chunk-LHERIF3L.mjs";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-HE22TZMF.mjs";
|
|
11
|
+
import "../chunk-PMWUKW3Z.mjs";
|
|
12
|
+
import "../chunk-YCG6SNAU.mjs";
|
|
13
13
|
import "../chunk-PIF5KJYI.mjs";
|
|
14
|
+
import "../chunk-RKTVJRK7.mjs";
|
|
14
15
|
import "../chunk-CYDWEPFL.mjs";
|
|
15
|
-
import "../chunk-2IDV5OHF.mjs";
|
|
16
16
|
import "../chunk-ICIK2BSB.mjs";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-2IDV5OHF.mjs";
|
|
18
18
|
import "../chunk-YYN33GSG.mjs";
|
|
19
19
|
import "../chunk-PMAFHQ7P.mjs";
|
|
20
20
|
import "../chunk-6PUNP7CD.mjs";
|
|
21
21
|
import "../chunk-O7ARI5CV.mjs";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-5X5DJRQQ.mjs";
|
|
22
|
+
import "../chunk-QNUAXSDP.mjs";
|
|
24
23
|
import "../chunk-NB2FKV2V.mjs";
|
|
25
24
|
import "../chunk-F555TVE4.mjs";
|
|
25
|
+
import "../chunk-WF65O6HX.mjs";
|
|
26
26
|
import "../chunk-EFL5OBKN.mjs";
|
|
27
27
|
import "../chunk-6ZLPNY7X.mjs";
|
|
28
28
|
import "../chunk-FDOMAPJY.mjs";
|
|
29
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-AFNWX62Q.mjs";
|
|
30
30
|
import "../chunk-DMLQZG75.mjs";
|
|
31
31
|
import "../chunk-SKC7AJIV.mjs";
|
|
32
32
|
export {
|
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';
|
|
@@ -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
|
|
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/jest.config.js
CHANGED
|
@@ -9,5 +9,17 @@ module.exports = {
|
|
|
9
9
|
setupFilesAfterEnv: ["<rootDir>/src/setupTests.ts"],
|
|
10
10
|
moduleNameMapper: {
|
|
11
11
|
"^@/(.*)$": "<rootDir>/src/$1",
|
|
12
|
+
"\\.(css|less|scss|sass)$": "identity-obj-proxy",
|
|
13
|
+
},
|
|
14
|
+
transformIgnorePatterns: [
|
|
15
|
+
"node_modules/(?!(react-markdown|streamdown|@copilotkitnext)/)",
|
|
16
|
+
],
|
|
17
|
+
transform: {
|
|
18
|
+
"^.+\\.(ts|tsx)$": "ts-jest",
|
|
19
|
+
"^.+\\.(js|jsx|mjs)$": ["ts-jest", {
|
|
20
|
+
tsconfig: {
|
|
21
|
+
allowJs: true,
|
|
22
|
+
},
|
|
23
|
+
}],
|
|
12
24
|
},
|
|
13
25
|
};
|
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.10",
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"**/*.css"
|
|
15
|
+
],
|
|
14
16
|
"main": "./dist/index.js",
|
|
15
17
|
"module": "./dist/index.mjs",
|
|
16
18
|
"exports": {
|
|
@@ -24,42 +26,43 @@
|
|
|
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.22",
|
|
33
|
-
"@copilotkitnext/react": "0.0.22",
|
|
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.42",
|
|
40
40
|
"@testing-library/react": "^16.3.0",
|
|
41
41
|
"@testing-library/react-hooks": "^8.0.1",
|
|
42
42
|
"@types/jest": "^29.5.4",
|
|
43
43
|
"@types/react": "^19.1.0",
|
|
44
44
|
"@types/react-dom": "^19.0.2",
|
|
45
45
|
"eslint": "^8.56.0",
|
|
46
|
+
"identity-obj-proxy": "^3.0.0",
|
|
46
47
|
"jest": "^29.6.4",
|
|
47
48
|
"jest-environment-jsdom": "^30.0.2",
|
|
48
49
|
"react": "^19.1.0",
|
|
49
|
-
"react-dom": "^19.0
|
|
50
|
+
"react-dom": "^19.2.0",
|
|
50
51
|
"ts-jest": "^29.1.1",
|
|
51
52
|
"tsup": "^6.7.0",
|
|
52
53
|
"typescript": "^5.2.3",
|
|
53
54
|
"zod": ">=3.0.0",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
55
|
+
"tsconfig": "1.4.6",
|
|
56
|
+
"eslint-config-custom": "1.4.6"
|
|
56
57
|
},
|
|
57
58
|
"dependencies": {
|
|
59
|
+
"@copilotkitnext/core": "0.0.28",
|
|
60
|
+
"@copilotkitnext/react": "0.0.28",
|
|
58
61
|
"@scarf/scarf": "^1.3.0",
|
|
59
62
|
"react-markdown": "^8.0.7",
|
|
60
63
|
"untruncate-json": "^0.0.1",
|
|
61
|
-
"@copilotkit/
|
|
62
|
-
"@copilotkit/
|
|
64
|
+
"@copilotkit/runtime-client-gql": "1.50.0-beta.10",
|
|
65
|
+
"@copilotkit/shared": "1.50.0-beta.10"
|
|
63
66
|
},
|
|
64
67
|
"keywords": [
|
|
65
68
|
"copilotkit",
|
|
@@ -55,9 +55,8 @@ const usePredictStateSubscription = (agent?: AbstractAgent) => {
|
|
|
55
55
|
|
|
56
56
|
export function CopilotListeners() {
|
|
57
57
|
const { copilotkit } = useCopilotKit();
|
|
58
|
-
const { agentSession } = useCopilotContext();
|
|
59
58
|
const existingConfig = useCopilotChatConfiguration();
|
|
60
|
-
const resolvedAgentId =
|
|
59
|
+
const resolvedAgentId = existingConfig?.agentId;
|
|
61
60
|
const { setBannerError } = useToast();
|
|
62
61
|
|
|
63
62
|
const { agent } = useAgent({ agentId: resolvedAgentId });
|
|
@@ -252,47 +252,6 @@ export function CopilotMessages({ children }: { children: ReactNode }) {
|
|
|
252
252
|
[setBannerError, showDevConsole, traceUIError],
|
|
253
253
|
);
|
|
254
254
|
|
|
255
|
-
// useEffect(() => {
|
|
256
|
-
// if (!threadId || threadId === lastLoadedThreadId.current) return;
|
|
257
|
-
// if (
|
|
258
|
-
// threadId === lastLoadedThreadId.current &&
|
|
259
|
-
// agentSession?.agentName === lastLoadedAgentName.current
|
|
260
|
-
// ) {
|
|
261
|
-
// return;
|
|
262
|
-
// }
|
|
263
|
-
//
|
|
264
|
-
// const fetchMessages = async () => {
|
|
265
|
-
// if (!agentSession?.agentName) return;
|
|
266
|
-
//
|
|
267
|
-
// const result = await runtimeClient.loadAgentState({
|
|
268
|
-
// threadId,
|
|
269
|
-
// agentName: agentSession?.agentName,
|
|
270
|
-
// });
|
|
271
|
-
//
|
|
272
|
-
// // Check for GraphQL errors and manually trigger error handling
|
|
273
|
-
// if (result.error) {
|
|
274
|
-
// // Update refs to prevent infinite retries of the same failed request
|
|
275
|
-
// lastLoadedThreadId.current = threadId;
|
|
276
|
-
// lastLoadedAgentName.current = agentSession?.agentName;
|
|
277
|
-
// handleGraphQLErrors(result.error);
|
|
278
|
-
// return; // Don't try to process the data if there's an error
|
|
279
|
-
// }
|
|
280
|
-
//
|
|
281
|
-
// const newMessages = result.data?.loadAgentState?.messages;
|
|
282
|
-
// if (newMessages === lastLoadedMessages.current) return;
|
|
283
|
-
//
|
|
284
|
-
// if (result.data?.loadAgentState) {
|
|
285
|
-
// lastLoadedMessages.current = newMessages;
|
|
286
|
-
// lastLoadedThreadId.current = threadId;
|
|
287
|
-
// lastLoadedAgentName.current = agentSession?.agentName;
|
|
288
|
-
//
|
|
289
|
-
// const messages = loadMessagesFromJsonRepresentation(JSON.parse(newMessages || "[]"));
|
|
290
|
-
// setMessages(messages);
|
|
291
|
-
// }
|
|
292
|
-
// };
|
|
293
|
-
// void fetchMessages();
|
|
294
|
-
// }, [threadId, agentSession?.agentName]);
|
|
295
|
-
|
|
296
255
|
useEffect(() => {
|
|
297
256
|
updateTapMessages(messages);
|
|
298
257
|
}, [messages, updateTapMessages]);
|
|
@@ -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
|
-
runtimeUrl={props.runtimeUrl}
|
|
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);
|
|
@@ -519,7 +519,7 @@ export function CopilotKitInternal(cpkProps: CopilotKitProps) {
|
|
|
519
519
|
<CopilotChatConfigurationProvider
|
|
520
520
|
// labels={labels}
|
|
521
521
|
// isModalDefaultOpen={isModalDefaultOpen}
|
|
522
|
-
agentId={
|
|
522
|
+
agentId={props.agent ?? "default"}
|
|
523
523
|
threadId={threadId}
|
|
524
524
|
>
|
|
525
525
|
<CopilotContext.Provider
|
|
@@ -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: () => {},
|