@copilotkit/react-core 0.0.0-fix-debug-infosys-20251107162427 → 0.0.0-fix-restore-handle-method-node-http-20260105204107
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 +309 -4
- package/dist/chunk-36KQV2NA.mjs +1 -0
- package/dist/{chunk-OKCYPO4I.mjs → chunk-3MHWEKFN.mjs} +5 -5
- package/dist/chunk-4RRMC7L2.mjs +32 -0
- package/dist/chunk-4RRMC7L2.mjs.map +1 -0
- package/dist/{chunk-E3624YDU.mjs → chunk-53K6WNJG.mjs} +8 -6
- package/dist/{chunk-E3624YDU.mjs.map → chunk-53K6WNJG.mjs.map} +1 -1
- package/dist/{chunk-N4WEHORG.mjs → chunk-6PUNP7CD.mjs} +4 -4
- package/dist/chunk-6PUNP7CD.mjs.map +1 -0
- package/dist/chunk-7DTB7S5V.mjs +83 -0
- package/dist/chunk-7DTB7S5V.mjs.map +1 -0
- package/dist/{chunk-BBUQMG45.mjs → chunk-7IBF6RBW.mjs} +3 -3
- package/dist/{chunk-BBUQMG45.mjs.map → chunk-7IBF6RBW.mjs.map} +1 -1
- package/dist/chunk-A6NKSGH3.mjs +1 -0
- package/dist/{chunk-MGWRDFBE.mjs → chunk-ABWT4DRT.mjs} +2 -2
- package/dist/{chunk-EUX2P2E7.mjs → chunk-AFNWX62Q.mjs} +11 -9
- package/dist/chunk-AFNWX62Q.mjs.map +1 -0
- package/dist/{chunk-MQYWH4E6.mjs → chunk-BUSWSDYO.mjs} +2 -2
- package/dist/chunk-CDUIA2WM.mjs +60 -0
- package/dist/chunk-CDUIA2WM.mjs.map +1 -0
- package/dist/chunk-CYDWEPFL.mjs +1 -0
- package/dist/{chunk-ZLQVRPDS.mjs → chunk-DMLQZG75.mjs} +1 -1
- package/dist/chunk-DMLQZG75.mjs.map +1 -0
- package/dist/{chunk-U7QULEVO.mjs → chunk-E7SE25ZU.mjs} +3 -3
- package/dist/chunk-F555TVE4.mjs +33 -0
- package/dist/chunk-F555TVE4.mjs.map +1 -0
- package/dist/chunk-FD6FGKYY.mjs +1 -0
- package/dist/chunk-FDOMAPJY.mjs +59 -0
- package/dist/chunk-FDOMAPJY.mjs.map +1 -0
- package/dist/{chunk-OAGAFMUM.mjs → chunk-FQFXYAV7.mjs} +6 -5
- package/dist/{chunk-OAGAFMUM.mjs.map → chunk-FQFXYAV7.mjs.map} +1 -1
- package/dist/chunk-GPEJNVE5.mjs +80 -0
- package/dist/chunk-GPEJNVE5.mjs.map +1 -0
- package/dist/chunk-I76HKHPJ.mjs +32 -0
- package/dist/chunk-I76HKHPJ.mjs.map +1 -0
- package/dist/{chunk-C6IANC2R.mjs → chunk-INPM7YKW.mjs} +9 -45
- package/dist/chunk-INPM7YKW.mjs.map +1 -0
- package/dist/chunk-JD7BAH7U.mjs +1 -0
- package/dist/chunk-LSHFN2Y5.mjs +349 -0
- package/dist/chunk-LSHFN2Y5.mjs.map +1 -0
- package/dist/chunk-NB2FKV2V.mjs +1 -0
- package/dist/chunk-NBK4KBLX.mjs +54 -0
- package/dist/chunk-NBK4KBLX.mjs.map +1 -0
- package/dist/chunk-QNUAXSDP.mjs +166 -0
- package/dist/chunk-QNUAXSDP.mjs.map +1 -0
- package/dist/chunk-RB2TXKFP.mjs +551 -0
- package/dist/chunk-RB2TXKFP.mjs.map +1 -0
- package/dist/{chunk-EDBI5PCJ.mjs → chunk-RW2Y52HO.mjs} +2 -2
- package/dist/chunk-RW2Y52HO.mjs.map +1 -0
- package/dist/{chunk-N4VN2B5S.mjs → chunk-SNON4QA6.mjs} +4 -4
- package/dist/chunk-SPCZTZCY.mjs +1 -0
- package/dist/chunk-SPCZTZCY.mjs.map +1 -0
- package/dist/chunk-VV56AVPB.mjs +125 -0
- package/dist/chunk-VV56AVPB.mjs.map +1 -0
- package/dist/chunk-WF65O6HX.mjs +66 -0
- 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-GT5WI3AF.mjs → chunk-YTQHRJUA.mjs} +7 -9
- package/dist/chunk-YTQHRJUA.mjs.map +1 -0
- package/dist/{chunk-5FHSUKQL.mjs → chunk-YYN33GSG.mjs} +5 -2
- package/dist/chunk-YYN33GSG.mjs.map +1 -0
- package/dist/chunk-Z6JV2LRY.mjs +37 -0
- package/dist/chunk-Z6JV2LRY.mjs.map +1 -0
- package/dist/chunk-ZVF5Q6IH.mjs +29 -0
- package/dist/chunk-ZVF5Q6IH.mjs.map +1 -0
- package/dist/chunk-ZYTXB6HH.mjs +151 -0
- package/dist/chunk-ZYTXB6HH.mjs.map +1 -0
- package/dist/components/CopilotListeners.d.ts +3 -0
- package/dist/components/CopilotListeners.js +101 -0
- package/dist/components/CopilotListeners.js.map +1 -0
- package/dist/components/CopilotListeners.mjs +9 -0
- package/dist/components/CopilotListeners.mjs.map +1 -0
- package/dist/components/copilot-provider/copilot-messages.js +14 -48
- 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 +15 -2
- package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.d.ts +2 -1
- package/dist/components/copilot-provider/copilotkit.js +491 -1361
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +15 -13
- package/dist/components/copilot-provider/index.d.ts +2 -1
- package/dist/components/copilot-provider/index.js +491 -1361
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +16 -13
- package/dist/components/dev-console/console-trigger.js +10 -8
- package/dist/components/dev-console/console-trigger.js.map +1 -1
- package/dist/components/dev-console/console-trigger.mjs +226 -6
- package/dist/components/dev-console/console-trigger.mjs.map +1 -1
- package/dist/components/dev-console/developer-console-modal.js +10 -8
- package/dist/components/dev-console/developer-console-modal.js.map +1 -1
- package/dist/components/dev-console/developer-console-modal.mjs +3 -3
- package/dist/components/error-boundary/error-boundary.d.ts +7 -7
- package/dist/components/error-boundary/error-boundary.js +3 -3
- package/dist/components/error-boundary/error-boundary.js.map +1 -1
- package/dist/components/error-boundary/error-boundary.mjs +3 -3
- package/dist/components/error-boundary/error-utils.d.ts +1 -1
- package/dist/components/error-boundary/error-utils.js +3 -3
- package/dist/components/error-boundary/error-utils.js.map +1 -1
- package/dist/components/error-boundary/error-utils.mjs +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +491 -1361
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +17 -13
- package/dist/components/toast/exclamation-mark-icon.d.ts +2 -2
- package/dist/components/toast/toast-provider.d.ts +3 -3
- package/dist/components/usage-banner.d.ts +2 -2
- package/dist/context/coagent-state-renders-context.d.ts +24 -0
- package/dist/context/coagent-state-renders-context.js +91 -0
- package/dist/context/coagent-state-renders-context.js.map +1 -0
- package/dist/context/coagent-state-renders-context.mjs +12 -0
- package/dist/context/coagent-state-renders-context.mjs.map +1 -0
- package/dist/context/copilot-context.d.ts +1 -1
- package/dist/context/copilot-context.js +10 -8
- package/dist/context/copilot-context.js.map +1 -1
- package/dist/context/copilot-context.mjs +1 -1
- package/dist/context/copilot-messages-context.d.ts +18 -11
- package/dist/context/copilot-messages-context.js.map +1 -1
- package/dist/context/copilot-messages-context.mjs +1 -1
- package/dist/context/index.d.ts +6 -2
- package/dist/context/index.js +110 -10
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.mjs +23 -7
- package/dist/context/threads-context.d.ts +16 -0
- package/dist/context/threads-context.js +59 -0
- package/dist/context/threads-context.js.map +1 -0
- package/dist/context/threads-context.mjs +12 -0
- package/dist/context/threads-context.mjs.map +1 -0
- package/dist/{copilot-context-cf9de848.d.ts → copilot-context-ec77e921.d.ts} +36 -32
- package/dist/hooks/index.d.ts +9 -6
- package/dist/hooks/index.js +1109 -1841
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +45 -53
- 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-agent-nodename.mjs.map +1 -0
- package/dist/hooks/use-coagent-state-render-bridge.d.ts +100 -0
- package/dist/hooks/use-coagent-state-render-bridge.js +214 -0
- package/dist/hooks/use-coagent-state-render-bridge.js.map +1 -0
- package/dist/hooks/use-coagent-state-render-bridge.mjs +15 -0
- package/dist/hooks/use-coagent-state-render-bridge.mjs.map +1 -0
- package/dist/hooks/use-coagent-state-render.js +31 -20
- package/dist/hooks/use-coagent-state-render.js.map +1 -1
- package/dist/hooks/use-coagent-state-render.mjs +3 -2
- package/dist/hooks/use-coagent.d.ts +2 -14
- package/dist/hooks/use-coagent.js +138 -1898
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +2 -30
- package/dist/hooks/use-configure-chat-suggestions.d.ts +36 -0
- package/dist/hooks/use-configure-chat-suggestions.js +79 -0
- package/dist/hooks/use-configure-chat-suggestions.js.map +1 -0
- package/dist/hooks/use-configure-chat-suggestions.mjs +47 -0
- package/dist/hooks/use-configure-chat-suggestions.mjs.map +1 -0
- package/dist/hooks/use-copilot-action.d.ts +8 -45
- package/dist/hooks/use-copilot-action.js +219 -349
- package/dist/hooks/use-copilot-action.js.map +1 -1
- package/dist/hooks/use-copilot-action.mjs +4 -5
- package/dist/hooks/use-copilot-additional-instructions.js +10 -8
- 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 +236 -248
- package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
- package/dist/hooks/use-copilot-authenticated-action.mjs +6 -6
- package/dist/hooks/use-copilot-chat-headless_c.d.ts +2 -10
- package/dist/hooks/use-copilot-chat-headless_c.js +585 -1374
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +12 -22
- package/dist/hooks/use-copilot-chat-suggestions.d.ts +35 -0
- 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.d.ts +2 -10
- package/dist/hooks/use-copilot-chat.js +579 -1393
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +12 -22
- package/dist/hooks/use-copilot-chat_internal.d.ts +77 -14
- package/dist/hooks/use-copilot-chat_internal.js +577 -1367
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +13 -23
- package/dist/hooks/use-copilot-readable.d.ts +1 -1
- package/dist/hooks/use-copilot-readable.js +25 -152
- package/dist/hooks/use-copilot-readable.js.map +1 -1
- package/dist/hooks/use-copilot-readable.mjs +1 -2
- package/dist/hooks/use-default-tool.js +216 -349
- package/dist/hooks/use-default-tool.js.map +1 -1
- package/dist/hooks/use-default-tool.mjs +5 -6
- package/dist/hooks/use-flat-category-store.js +4 -1
- package/dist/hooks/use-flat-category-store.js.map +1 -1
- package/dist/hooks/use-flat-category-store.mjs +1 -1
- package/dist/hooks/use-frontend-tool.d.ts +3 -3
- package/dist/hooks/use-frontend-tool.js +42 -370
- package/dist/hooks/use-frontend-tool.js.map +1 -1
- package/dist/hooks/use-frontend-tool.mjs +1 -6
- package/dist/hooks/use-human-in-the-loop.d.ts +4 -3
- package/dist/hooks/use-human-in-the-loop.js +61 -393
- package/dist/hooks/use-human-in-the-loop.js.map +1 -1
- package/dist/hooks/use-human-in-the-loop.mjs +1 -6
- package/dist/hooks/use-langgraph-interrupt-render.d.ts +3 -2
- package/dist/hooks/use-langgraph-interrupt-render.js +157 -37
- package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.mjs +7 -4
- package/dist/hooks/use-langgraph-interrupt.d.ts +1 -1
- package/dist/hooks/use-langgraph-interrupt.js +24 -1642
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +2 -23
- package/dist/hooks/use-lazy-tool-renderer.d.ts +6 -0
- package/dist/hooks/use-lazy-tool-renderer.js +53 -0
- package/dist/hooks/use-lazy-tool-renderer.js.map +1 -0
- package/dist/hooks/use-lazy-tool-renderer.mjs +8 -0
- package/dist/hooks/use-lazy-tool-renderer.mjs.map +1 -0
- package/dist/hooks/use-make-copilot-document-readable.js +11 -9
- 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/hooks/use-render-tool-call.d.ts +7 -6
- package/dist/hooks/use-render-tool-call.js +36 -386
- package/dist/hooks/use-render-tool-call.js.map +1 -1
- package/dist/hooks/use-render-tool-call.mjs +1 -6
- package/dist/index.d.ts +11 -6
- package/dist/index.js +1456 -3033
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -68
- package/dist/lib/copilot-task.d.ts +2 -2
- package/dist/lib/copilot-task.js +1 -0
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +18 -14
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +18 -14
- package/dist/setupTests.d.ts +2 -2
- package/dist/types/frontend-action.d.ts +5 -5
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +2 -1
- package/dist/types/interrupt-action.d.ts +1 -1
- package/dist/types/interrupt-action.js.map +1 -1
- package/dist/types/interrupt-action.mjs +1 -0
- package/dist/utils/index.d.ts +0 -12
- package/dist/utils/index.js +6 -325
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +1 -21
- package/dist/utils/utils.js.map +1 -1
- package/dist/v2/index.css +4 -0
- package/dist/v2/index.css.map +1 -0
- package/dist/v2/index.d.ts +2 -0
- package/dist/v2/index.js +27 -0
- package/dist/v2/index.js.map +1 -0
- package/dist/v2/index.mjs +6 -0
- package/dist/v2/index.mjs.map +1 -0
- package/jest.config.js +12 -0
- package/package.json +24 -10
- package/src/components/CopilotListeners.tsx +81 -0
- package/src/components/copilot-provider/copilot-messages.tsx +6 -48
- package/src/components/copilot-provider/copilotkit-props.tsx +15 -1
- package/src/components/copilot-provider/copilotkit.tsx +189 -148
- package/src/components/error-boundary/error-utils.tsx +3 -3
- package/src/context/coagent-state-renders-context.tsx +76 -0
- package/src/context/copilot-context.tsx +21 -21
- package/src/context/copilot-messages-context.tsx +3 -3
- package/src/context/index.ts +8 -0
- package/src/context/threads-context.tsx +41 -0
- package/src/hooks/__tests__/use-coagent-config.test.ts +189 -129
- package/src/hooks/index.ts +12 -3
- package/src/hooks/use-agent-nodename.ts +30 -0
- package/src/hooks/use-coagent-state-render-bridge.tsx +293 -0
- package/src/hooks/use-coagent-state-render.ts +4 -7
- package/src/hooks/use-coagent.ts +136 -247
- package/src/hooks/use-configure-chat-suggestions.tsx +86 -0
- package/src/hooks/use-copilot-action.ts +88 -199
- package/src/hooks/use-copilot-chat-headless_c.ts +2 -1
- package/src/hooks/use-copilot-chat-suggestions.tsx +124 -0
- package/src/hooks/use-copilot-chat.ts +4 -1
- package/src/hooks/use-copilot-chat_internal.ts +410 -263
- package/src/hooks/use-copilot-readable.ts +23 -25
- package/src/hooks/use-flat-category-store.ts +4 -3
- package/src/hooks/use-frontend-tool.ts +86 -8
- package/src/hooks/use-human-in-the-loop.ts +111 -13
- package/src/hooks/use-langgraph-interrupt-render.ts +108 -40
- package/src/hooks/use-langgraph-interrupt.ts +18 -48
- package/src/hooks/use-lazy-tool-renderer.tsx +30 -0
- package/src/hooks/use-make-copilot-document-readable.ts +1 -1
- package/src/hooks/use-render-tool-call.ts +73 -13
- package/src/lib/copilot-task.ts +1 -1
- package/src/types/index.ts +1 -0
- package/src/types/interrupt-action.ts +8 -7
- package/src/utils/index.ts +0 -3
- package/src/utils/utils.ts +7 -0
- package/src/v2/index.css +1 -0
- package/src/v2/index.ts +4 -0
- package/tsup.config.ts +1 -1
- package/dist/chunk-5FHSUKQL.mjs.map +0 -1
- package/dist/chunk-6GPVUMBU.mjs +0 -13
- package/dist/chunk-6GPVUMBU.mjs.map +0 -1
- package/dist/chunk-AKR2SSUJ.mjs +0 -22
- package/dist/chunk-AKR2SSUJ.mjs.map +0 -1
- package/dist/chunk-BXXJQ2BL.mjs +0 -239
- package/dist/chunk-BXXJQ2BL.mjs.map +0 -1
- package/dist/chunk-C6IANC2R.mjs.map +0 -1
- package/dist/chunk-DXEQPN43.mjs +0 -231
- package/dist/chunk-DXEQPN43.mjs.map +0 -1
- package/dist/chunk-DZTU6PGS.mjs +0 -1
- package/dist/chunk-EDBI5PCJ.mjs.map +0 -1
- package/dist/chunk-EUX2P2E7.mjs.map +0 -1
- package/dist/chunk-EVVO67QO.mjs +0 -25
- package/dist/chunk-EVVO67QO.mjs.map +0 -1
- package/dist/chunk-GGLAHG3I.mjs +0 -804
- package/dist/chunk-GGLAHG3I.mjs.map +0 -1
- package/dist/chunk-GT5WI3AF.mjs.map +0 -1
- package/dist/chunk-HDOG2RTM.mjs +0 -37
- package/dist/chunk-HDOG2RTM.mjs.map +0 -1
- package/dist/chunk-MIXSWZSB.mjs +0 -71
- package/dist/chunk-MIXSWZSB.mjs.map +0 -1
- package/dist/chunk-N4WEHORG.mjs.map +0 -1
- package/dist/chunk-NSBAWITG.mjs +0 -332
- package/dist/chunk-NSBAWITG.mjs.map +0 -1
- package/dist/chunk-OT5NHMEC.mjs +0 -723
- package/dist/chunk-OT5NHMEC.mjs.map +0 -1
- package/dist/chunk-T3376SZS.mjs +0 -142
- package/dist/chunk-T3376SZS.mjs.map +0 -1
- package/dist/chunk-YPBKY4KY.mjs +0 -1
- package/dist/chunk-YPSGKPDA.mjs +0 -1
- package/dist/chunk-ZLQVRPDS.mjs.map +0 -1
- package/dist/chunk-ZVOLWJCY.mjs +0 -47
- package/dist/chunk-ZVOLWJCY.mjs.map +0 -1
- package/dist/hooks/use-chat.d.ts +0 -145
- package/dist/hooks/use-chat.js +0 -1129
- package/dist/hooks/use-chat.js.map +0 -1
- package/dist/hooks/use-chat.mjs +0 -14
- package/dist/index-1f5b66ac.d.ts +0 -36
- package/dist/utils/extract.d.ts +0 -43
- package/dist/utils/extract.js +0 -208
- package/dist/utils/extract.js.map +0 -1
- package/dist/utils/extract.mjs +0 -25
- package/dist/utils/suggestions.d.ts +0 -11
- package/dist/utils/suggestions.js +0 -343
- package/dist/utils/suggestions.js.map +0 -1
- package/dist/utils/suggestions.mjs +0 -25
- package/src/hooks/use-chat.ts +0 -1142
- package/src/utils/extract.ts +0 -215
- package/src/utils/suggestions.ts +0 -208
- /package/dist/{chunk-DZTU6PGS.mjs.map → chunk-36KQV2NA.mjs.map} +0 -0
- /package/dist/{chunk-OKCYPO4I.mjs.map → chunk-3MHWEKFN.mjs.map} +0 -0
- /package/dist/{chunk-YPBKY4KY.mjs.map → chunk-A6NKSGH3.mjs.map} +0 -0
- /package/dist/{chunk-MGWRDFBE.mjs.map → chunk-ABWT4DRT.mjs.map} +0 -0
- /package/dist/{chunk-MQYWH4E6.mjs.map → chunk-BUSWSDYO.mjs.map} +0 -0
- /package/dist/{chunk-YPSGKPDA.mjs.map → chunk-CYDWEPFL.mjs.map} +0 -0
- /package/dist/{chunk-U7QULEVO.mjs.map → chunk-E7SE25ZU.mjs.map} +0 -0
- /package/dist/{hooks/use-chat.mjs.map → chunk-FD6FGKYY.mjs.map} +0 -0
- /package/dist/{utils/extract.mjs.map → chunk-JD7BAH7U.mjs.map} +0 -0
- /package/dist/{utils/suggestions.mjs.map → chunk-NB2FKV2V.mjs.map} +0 -0
- /package/dist/{chunk-N4VN2B5S.mjs.map → chunk-SNON4QA6.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,317 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
-
## 0.0.0-fix-
|
|
3
|
+
## 0.0.0-fix-restore-handle-method-node-http-20260105204107
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
- @copilotkit/runtime-client-gql@0.0.0-fix-restore-handle-method-node-http-20260105204107
|
|
8
|
+
- @copilotkit/shared@0.0.0-fix-restore-handle-method-node-http-20260105204107
|
|
9
|
+
|
|
10
|
+
## 1.50.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- bdc7a8f: - fix: restore message callbacks
|
|
15
|
+
- 80dffec: Updated the default model and API version for the Google GenAI adapter
|
|
16
|
+
- cfa4185: - fix: fix stale state in handler
|
|
17
|
+
- eac8b20: - fix: use latest vnext
|
|
18
|
+
- Updated dependencies [80dffec]
|
|
19
|
+
- @copilotkit/runtime-client-gql@1.50.1
|
|
20
|
+
- @copilotkit/shared@1.50.1
|
|
21
|
+
|
|
22
|
+
## 1.50.1-next.3
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- eac8b20: - fix: use latest vnext
|
|
27
|
+
- @copilotkit/runtime-client-gql@1.50.1-next.3
|
|
28
|
+
- @copilotkit/shared@1.50.1-next.3
|
|
29
|
+
|
|
30
|
+
## 1.50.1-next.2
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- bdc7a8f: - fix: restore message callbacks
|
|
35
|
+
- @copilotkit/runtime-client-gql@1.50.1-next.2
|
|
36
|
+
- @copilotkit/shared@1.50.1-next.2
|
|
37
|
+
|
|
38
|
+
## 1.50.1-next.1
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- cfa4185: - fix: fix stale state in handler
|
|
43
|
+
- @copilotkit/runtime-client-gql@1.50.1-next.1
|
|
44
|
+
- @copilotkit/shared@1.50.1-next.1
|
|
45
|
+
|
|
46
|
+
## 1.50.1-next.0
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- Updated the default model and API version for the Google GenAI adapter
|
|
51
|
+
- Updated dependencies
|
|
52
|
+
- @copilotkit/runtime-client-gql@1.50.1-next.0
|
|
53
|
+
- @copilotkit/shared@1.50.1-next.0
|
|
54
|
+
|
|
55
|
+
## 1.50.0
|
|
56
|
+
|
|
57
|
+
### Minor Changes
|
|
58
|
+
|
|
59
|
+
- 0fc76d7: add new runner with telemetry baked in
|
|
60
|
+
- c942f9c: Minor fixes and stability improvements
|
|
61
|
+
- bad5f06: - feat: port old endpoint creators to 2.0
|
|
62
|
+
- 33f47e3: - fix: fix predictive state update
|
|
63
|
+
- fix: fix state setters
|
|
64
|
+
- eed6021: Updating to the latest version of vnext
|
|
65
|
+
- 3b7367e: Improving general stability around LangChain
|
|
66
|
+
- 7ff9ca7: Minor fixes and improvements
|
|
67
|
+
- 974875e: Lint and format code to resolve Prettier errors
|
|
68
|
+
- 3bd484f: Minor fixes and stability improvements
|
|
69
|
+
- 5a534bf: fix telemetry in v1.50 runtime
|
|
70
|
+
- 907ae5d: - feat: route CPK implementation to 2.0 copilotkitnext
|
|
71
|
+
- 769a06c: Refactor suggestions to not always run
|
|
72
|
+
- 788292b: Improving langchain dependency resolution
|
|
73
|
+
- eab69a2: Enabling the new inspector
|
|
74
|
+
- 0a7bfe0: Updating dependency versions across all packages
|
|
75
|
+
|
|
76
|
+
### Patch Changes
|
|
77
|
+
|
|
78
|
+
- 8ce60af: - feat: enable coagent state renders
|
|
79
|
+
- 04057d5: - fix: refrain from adding placeholder message
|
|
80
|
+
- 6ce0edc: - fix: refrain from re-setting context infinitely if it hasnt changed
|
|
81
|
+
- fix: pass only strings to context value
|
|
82
|
+
- fix: allow custom convert and availability setup
|
|
83
|
+
- 2c93ff1: - fix: re-enable repeatable interrupt renders
|
|
84
|
+
- b0e3652: - chore: Update to latest of vnext
|
|
85
|
+
- 7643e71: - fix: make suggestions available
|
|
86
|
+
- d55a8bd: - feat(runtime): export v2 of the runtime as a subpackage
|
|
87
|
+
- fix(runtime): update method for merging tools in assignToolsToAgent
|
|
88
|
+
- fix: remove redundant agent instantiation code
|
|
89
|
+
- c38da1c: - feat: add suggestions support to 1.5
|
|
90
|
+
- 3c60073: - fix: better sync back-and-forth state, including initial state
|
|
91
|
+
- 962546c: - fix: resolve agent name directly from provider props
|
|
92
|
+
- ca8eb39: - fix: fix result arguments passed to tool calls
|
|
93
|
+
- c3d55e5: - fix: refactor interrupts mechanism to use a queue
|
|
94
|
+
- 5840bab: - fix: adjust dependencies
|
|
95
|
+
- 7808fac: - feat: add spinner indicator to show chat readiness for conversation
|
|
96
|
+
- c70210e: - feat: use copilotnext's single endpoint
|
|
97
|
+
- d2c57a1: - fix: export v2 styles
|
|
98
|
+
- Updated dependencies [0fc76d7]
|
|
99
|
+
- Updated dependencies [c942f9c]
|
|
100
|
+
- Updated dependencies [b0e3652]
|
|
101
|
+
- Updated dependencies [eed6021]
|
|
102
|
+
- Updated dependencies [3b7367e]
|
|
103
|
+
- Updated dependencies [7ff9ca7]
|
|
104
|
+
- Updated dependencies [974875e]
|
|
105
|
+
- Updated dependencies [4942f62]
|
|
106
|
+
- Updated dependencies [3bd484f]
|
|
107
|
+
- Updated dependencies [5a534bf]
|
|
108
|
+
- Updated dependencies [769a06c]
|
|
109
|
+
- Updated dependencies [788292b]
|
|
110
|
+
- Updated dependencies [eab69a2]
|
|
111
|
+
- Updated dependencies [0a7bfe0]
|
|
112
|
+
- @copilotkit/runtime-client-gql@1.50.0
|
|
113
|
+
- @copilotkit/shared@1.50.0
|
|
114
|
+
|
|
115
|
+
## 1.50.0-beta.19
|
|
116
|
+
|
|
117
|
+
### Minor Changes
|
|
118
|
+
|
|
119
|
+
- Improving langchain dependency resolution
|
|
120
|
+
|
|
121
|
+
### Patch Changes
|
|
122
|
+
|
|
123
|
+
- Updated dependencies
|
|
124
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.19
|
|
125
|
+
- @copilotkit/shared@1.50.0-beta.19
|
|
126
|
+
|
|
127
|
+
## 1.50.0-beta.18
|
|
128
|
+
|
|
129
|
+
### Minor Changes
|
|
130
|
+
|
|
131
|
+
- Improving general stability around LangChain
|
|
132
|
+
|
|
133
|
+
### Patch Changes
|
|
134
|
+
|
|
135
|
+
- Updated dependencies
|
|
136
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.18
|
|
137
|
+
- @copilotkit/shared@1.50.0-beta.18
|
|
138
|
+
|
|
139
|
+
## 1.50.0-beta.17
|
|
140
|
+
|
|
141
|
+
### Minor Changes
|
|
142
|
+
|
|
143
|
+
- Minor fixes and improvements
|
|
144
|
+
|
|
145
|
+
### Patch Changes
|
|
146
|
+
|
|
147
|
+
- Updated dependencies
|
|
148
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.17
|
|
149
|
+
- @copilotkit/shared@1.50.0-beta.17
|
|
150
|
+
|
|
151
|
+
## 1.50.0-beta.16
|
|
152
|
+
|
|
153
|
+
### Minor Changes
|
|
154
|
+
|
|
155
|
+
- Minor fixes and stability improvements
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- Updated dependencies
|
|
160
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.16
|
|
161
|
+
- @copilotkit/shared@1.50.0-beta.16
|
|
162
|
+
|
|
163
|
+
## 1.50.0-beta.15
|
|
164
|
+
|
|
165
|
+
### Minor Changes
|
|
166
|
+
|
|
167
|
+
- Lint and format code to resolve Prettier errors
|
|
168
|
+
|
|
169
|
+
### Patch Changes
|
|
170
|
+
|
|
171
|
+
- Updated dependencies
|
|
172
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.15
|
|
173
|
+
- @copilotkit/shared@1.50.0-beta.15
|
|
174
|
+
|
|
175
|
+
## 1.50.0-beta.14
|
|
176
|
+
|
|
177
|
+
### Minor Changes
|
|
178
|
+
|
|
179
|
+
- Minor fixes and stability improvements
|
|
180
|
+
|
|
181
|
+
### Patch Changes
|
|
182
|
+
|
|
183
|
+
- Updated dependencies
|
|
184
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.14
|
|
185
|
+
- @copilotkit/shared@1.50.0-beta.14
|
|
186
|
+
|
|
187
|
+
## 1.50.0-beta.13
|
|
188
|
+
|
|
189
|
+
### Minor Changes
|
|
190
|
+
|
|
191
|
+
- Updating to the latest version of vnext
|
|
192
|
+
|
|
193
|
+
### Patch Changes
|
|
194
|
+
|
|
195
|
+
- Updated dependencies
|
|
196
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.13
|
|
197
|
+
- @copilotkit/shared@1.50.0-beta.13
|
|
198
|
+
|
|
199
|
+
## 1.50.0-beta.12
|
|
200
|
+
|
|
201
|
+
### Minor Changes
|
|
202
|
+
|
|
203
|
+
- eab69a2: Enabling the new inspector
|
|
204
|
+
|
|
205
|
+
### Patch Changes
|
|
206
|
+
|
|
207
|
+
- Updated dependencies [eab69a2]
|
|
208
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.12
|
|
209
|
+
- @copilotkit/shared@1.50.0-beta.12
|
|
210
|
+
|
|
211
|
+
## 1.50.0-beta.11
|
|
212
|
+
|
|
213
|
+
### Minor Changes
|
|
214
|
+
|
|
215
|
+
- fix telemetry in v1.50 runtime
|
|
216
|
+
|
|
217
|
+
### Patch Changes
|
|
218
|
+
|
|
219
|
+
- Updated dependencies
|
|
220
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.11
|
|
221
|
+
- @copilotkit/shared@1.50.0-beta.11
|
|
222
|
+
|
|
223
|
+
## 1.50.0-beta.10
|
|
224
|
+
|
|
225
|
+
### Minor Changes
|
|
226
|
+
|
|
227
|
+
- add new runner with telemetry baked in
|
|
228
|
+
|
|
229
|
+
### Patch Changes
|
|
230
|
+
|
|
231
|
+
- Updated dependencies
|
|
232
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.10
|
|
233
|
+
- @copilotkit/shared@1.50.0-beta.10
|
|
234
|
+
|
|
235
|
+
## 1.50.0-beta.9
|
|
236
|
+
|
|
237
|
+
### Minor Changes
|
|
238
|
+
|
|
239
|
+
- Refactor suggestions to not always run
|
|
240
|
+
|
|
241
|
+
### Patch Changes
|
|
242
|
+
|
|
243
|
+
- Updated dependencies
|
|
244
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.9
|
|
245
|
+
- @copilotkit/shared@1.50.0-beta.9
|
|
246
|
+
|
|
247
|
+
## 1.50.0-beta.8
|
|
248
|
+
|
|
249
|
+
### Patch Changes
|
|
250
|
+
|
|
251
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.8
|
|
252
|
+
- @copilotkit/shared@1.50.0-beta.8
|
|
253
|
+
|
|
254
|
+
## 1.50.0-beta.7
|
|
255
|
+
|
|
256
|
+
### Patch Changes
|
|
257
|
+
|
|
258
|
+
- 6ce0edc: - fix: refrain from re-setting context infinitely if it hasnt changed
|
|
259
|
+
- fix: pass only strings to context value
|
|
260
|
+
- fix: allow custom convert and availability setup
|
|
261
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.7
|
|
262
|
+
- @copilotkit/shared@1.50.0-beta.7
|
|
263
|
+
|
|
264
|
+
## 1.50.0-beta.6
|
|
265
|
+
|
|
266
|
+
### Minor Changes
|
|
267
|
+
|
|
268
|
+
- Updating dependency versions across all packages
|
|
269
|
+
|
|
270
|
+
### Patch Changes
|
|
271
|
+
|
|
272
|
+
- Updated dependencies
|
|
273
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.6
|
|
274
|
+
- @copilotkit/shared@1.50.0-beta.6
|
|
275
|
+
|
|
276
|
+
## 1.50.0-beta.4
|
|
277
|
+
|
|
278
|
+
### Minor Changes
|
|
279
|
+
|
|
280
|
+
- bad5f06: - feat: port old endpoint creators to 2.0
|
|
281
|
+
- 33f47e3: - fix: fix predictive state update
|
|
282
|
+
- fix: fix state setters
|
|
283
|
+
- 907ae5d: - feat: route CPK implementation to 2.0 copilotkitnext
|
|
284
|
+
|
|
285
|
+
### Patch Changes
|
|
286
|
+
|
|
287
|
+
- 8ce60af: - feat: enable coagent state renders
|
|
288
|
+
- 04057d5: - fix: refrain from adding placeholder message
|
|
289
|
+
- 2c93ff1: - fix: re-enable repeatable interrupt renders
|
|
290
|
+
- b0e3652: - chore: Update to latest of vnext
|
|
291
|
+
- 7643e71: - fix: make suggestions available
|
|
292
|
+
- d55a8bd: - feat(runtime): export v2 of the runtime as a subpackage
|
|
293
|
+
- fix(runtime): update method for merging tools in assignToolsToAgent
|
|
294
|
+
- fix: remove redundant agent instantiation code
|
|
295
|
+
- c38da1c: - feat: add suggestions support to 1.5
|
|
296
|
+
- 3c60073: - fix: better sync back-and-forth state, including initial state
|
|
297
|
+
- 962546c: - fix: resolve agent name directly from provider props
|
|
298
|
+
- ca8eb39: - fix: fix result arguments passed to tool calls
|
|
299
|
+
- c3d55e5: - fix: refactor interrupts mechanism to use a queue
|
|
300
|
+
- 5840bab: - fix: adjust dependencies
|
|
301
|
+
- 7808fac: - feat: add spinner indicator to show chat readiness for conversation
|
|
302
|
+
- c70210e: - feat: use copilotnext's single endpoint
|
|
303
|
+
- d2c57a1: - fix: export v2 styles
|
|
304
|
+
- Updated dependencies [b0e3652]
|
|
305
|
+
- Updated dependencies [4942f62]
|
|
306
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.4
|
|
307
|
+
- @copilotkit/shared@1.50.0-beta.4
|
|
308
|
+
|
|
309
|
+
## 1.10.7-next.0
|
|
310
|
+
|
|
311
|
+
### Patch Changes
|
|
312
|
+
|
|
313
|
+
- @copilotkit/runtime-client-gql@1.10.7-next.0
|
|
314
|
+
- @copilotkit/shared@1.10.7-next.0
|
|
10
315
|
|
|
11
316
|
## 1.10.6
|
|
12
317
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-36KQV2NA.mjs.map
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
CopilotKitIcon,
|
|
4
4
|
ExclamationMarkTriangleIcon
|
|
5
5
|
} from "./chunk-PIF5KJYI.mjs";
|
|
6
|
-
import {
|
|
7
|
-
useCopilotContext
|
|
8
|
-
} from "./chunk-EUX2P2E7.mjs";
|
|
9
6
|
import {
|
|
10
7
|
useCopilotMessagesContext
|
|
11
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DMLQZG75.mjs";
|
|
9
|
+
import {
|
|
10
|
+
useCopilotContext
|
|
11
|
+
} from "./chunk-AFNWX62Q.mjs";
|
|
12
12
|
|
|
13
13
|
// src/components/dev-console/developer-console-modal.tsx
|
|
14
14
|
import { COPILOTKIT_VERSION } from "@copilotkit/shared";
|
|
@@ -756,4 +756,4 @@ function ContextTab({ context }) {
|
|
|
756
756
|
export {
|
|
757
757
|
DeveloperConsoleModal
|
|
758
758
|
};
|
|
759
|
-
//# sourceMappingURL=chunk-
|
|
759
|
+
//# sourceMappingURL=chunk-3MHWEKFN.mjs.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useToast
|
|
3
|
+
} from "./chunk-EFL5OBKN.mjs";
|
|
4
|
+
import {
|
|
5
|
+
CopilotContext
|
|
6
|
+
} from "./chunk-AFNWX62Q.mjs";
|
|
7
|
+
import {
|
|
8
|
+
__spreadProps,
|
|
9
|
+
__spreadValues
|
|
10
|
+
} from "./chunk-SKC7AJIV.mjs";
|
|
11
|
+
|
|
12
|
+
// src/hooks/use-langgraph-interrupt.ts
|
|
13
|
+
import { useContext, useEffect } from "react";
|
|
14
|
+
import { dataToUUID } from "@copilotkit/shared";
|
|
15
|
+
function useLangGraphInterrupt(action, dependencies) {
|
|
16
|
+
const { setInterruptAction, removeInterruptAction, interruptActions, threadId } = useContext(CopilotContext);
|
|
17
|
+
const { addToast } = useToast();
|
|
18
|
+
const actionId = dataToUUID(action, "lgAction");
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!action)
|
|
21
|
+
return;
|
|
22
|
+
setInterruptAction(__spreadProps(__spreadValues({}, action), { id: actionId }));
|
|
23
|
+
return () => {
|
|
24
|
+
removeInterruptAction(actionId);
|
|
25
|
+
};
|
|
26
|
+
}, [setInterruptAction, removeInterruptAction, threadId, actionId, ...dependencies || []]);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
useLangGraphInterrupt
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chunk-4RRMC7L2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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 { 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(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({ ...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;AAI/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,QAAQ,UAAU;AAE9C,YAAU,MAAM;AACd,QAAI,CAAC;AAAQ;AAWb,uBAAmB,iCAAK,SAAL,EAAa,IAAI,SAAS,EAAC;AAG9C,WAAO,MAAM;AACX,4BAAsB,QAAQ;AAAA,IAChC;AAAA,EACF,GAAG,CAAC,oBAAoB,uBAAuB,UAAU,UAAU,GAAI,gBAAgB,CAAC,CAAE,CAAC;AAC7F;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
useCopilotChatInternal
|
|
3
|
+
} from "./chunk-LSHFN2Y5.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-copilot-chat.ts
|
|
6
|
-
function
|
|
6
|
+
function useCopilotChat(options = {}) {
|
|
7
7
|
const {
|
|
8
8
|
visibleMessages,
|
|
9
9
|
appendMessage,
|
|
@@ -11,10 +11,11 @@ function useCopilotChat2(options = {}) {
|
|
|
11
11
|
stopGeneration,
|
|
12
12
|
reset,
|
|
13
13
|
isLoading,
|
|
14
|
+
isAvailable,
|
|
14
15
|
runChatCompletion,
|
|
15
16
|
mcpServers,
|
|
16
17
|
setMcpServers
|
|
17
|
-
} =
|
|
18
|
+
} = useCopilotChatInternal(options);
|
|
18
19
|
return {
|
|
19
20
|
visibleMessages,
|
|
20
21
|
appendMessage,
|
|
@@ -22,6 +23,7 @@ function useCopilotChat2(options = {}) {
|
|
|
22
23
|
stopGeneration,
|
|
23
24
|
reset,
|
|
24
25
|
isLoading,
|
|
26
|
+
isAvailable,
|
|
25
27
|
runChatCompletion,
|
|
26
28
|
mcpServers,
|
|
27
29
|
setMcpServers
|
|
@@ -29,6 +31,6 @@ function useCopilotChat2(options = {}) {
|
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
export {
|
|
32
|
-
|
|
34
|
+
useCopilotChat
|
|
33
35
|
};
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
36
|
+
//# sourceMappingURL=chunk-53K6WNJG.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-copilot-chat.ts"],"sourcesContent":["/**\n * `useCopilotChat` is a lightweight React hook for headless chat interactions.\n * Perfect for controlling the prebuilt chat components programmatically.\n *\n * **Open Source Friendly** - Works without requiring a free public license key.\n *\n * <Callout title=\"Looking for fully headless UI?\">\n * Get started with [useCopilotChatHeadless_c](https://docs.copilotkit.ai/reference/hooks/useCopilotChatHeadless_c).\n * </Callout>\n *\n * ## Use Cases\n *\n * - **Programmatic Messaging**: Send messages without displaying chat UI\n * - **Programmatic control**: Control prebuilt component programmatically\n * - **Background Operations**: Trigger AI interactions in the background\n * - **Fire-and-Forget**: Send messages without needing to read responses\n *\n * ## Usage\n *\n * ```tsx\n * import { TextMessage, MessageRole } from \"@copilotkit/runtime-client-gql\";\n *\n * const { appendMessage } = useCopilotChat();\n *\n * // Example usage without naming conflicts\n * const handleSendMessage = async (content: string) => {\n * await appendMessage(\n * new TextMessage({\n * role: MessageRole.User,\n * content,\n * })\n * );\n * };\n * ```\n *\n * ## Return Values\n * The following properties are returned from the hook:\n *\n * <PropertyReference name=\"visibleMessages\" type=\"DeprecatedGqlMessage[]\" deprecated>\n * Array of messages in old non-AG-UI format, use for compatibility only\n * </PropertyReference>\n *\n * <PropertyReference name=\"appendMessage\" type=\"(message: DeprecatedGqlMessage, options?) => Promise<void>\" deprecated>\n * Append message using old format, use `sendMessage` instead\n * </PropertyReference>\n *\n * <PropertyReference name=\"reloadMessages\" type=\"(messageId: string) => Promise<void>\">\n * Regenerate the response for a specific message by ID\n * </PropertyReference>\n *\n * <PropertyReference name=\"stopGeneration\" type=\"() => void\">\n * Stop the current message generation process\n * </PropertyReference>\n *\n * <PropertyReference name=\"reset\" type=\"() => void\">\n * Clear all messages and reset chat state completely\n * </PropertyReference>\n *\n * <PropertyReference name=\"isLoading\" type=\"boolean\">\n * Whether the chat is currently generating a response\n * </PropertyReference>\n *\n * <PropertyReference name=\"runChatCompletion\" type=\"() => Promise<Message[]>\">\n * Manually trigger chat completion for advanced usage\n * </PropertyReference>\n *\n * <PropertyReference name=\"mcpServers\" type=\"MCPServerConfig[]\">\n * Array of Model Context Protocol server configurations\n * </PropertyReference>\n *\n * <PropertyReference name=\"setMcpServers\" type=\"(servers: MCPServerConfig[]) => void\">\n * Update MCP server configurations for enhanced context\n * </PropertyReference>\n */\n\nimport {\n UseCopilotChatOptions,\n
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-copilot-chat.ts"],"sourcesContent":["/**\n * `useCopilotChat` is a lightweight React hook for headless chat interactions.\n * Perfect for controlling the prebuilt chat components programmatically.\n *\n * **Open Source Friendly** - Works without requiring a free public license key.\n *\n * <Callout title=\"Looking for fully headless UI?\">\n * Get started with [useCopilotChatHeadless_c](https://docs.copilotkit.ai/reference/hooks/useCopilotChatHeadless_c).\n * </Callout>\n *\n * ## Use Cases\n *\n * - **Programmatic Messaging**: Send messages without displaying chat UI\n * - **Programmatic control**: Control prebuilt component programmatically\n * - **Background Operations**: Trigger AI interactions in the background\n * - **Fire-and-Forget**: Send messages without needing to read responses\n *\n * ## Usage\n *\n * ```tsx\n * import { TextMessage, MessageRole } from \"@copilotkit/runtime-client-gql\";\n *\n * const { appendMessage } = useCopilotChat();\n *\n * // Example usage without naming conflicts\n * const handleSendMessage = async (content: string) => {\n * await appendMessage(\n * new TextMessage({\n * role: MessageRole.User,\n * content,\n * })\n * );\n * };\n * ```\n *\n * ## Return Values\n * The following properties are returned from the hook:\n *\n * <PropertyReference name=\"visibleMessages\" type=\"DeprecatedGqlMessage[]\" deprecated>\n * Array of messages in old non-AG-UI format, use for compatibility only\n * </PropertyReference>\n *\n * <PropertyReference name=\"appendMessage\" type=\"(message: DeprecatedGqlMessage, options?) => Promise<void>\" deprecated>\n * Append message using old format, use `sendMessage` instead\n * </PropertyReference>\n *\n * <PropertyReference name=\"reloadMessages\" type=\"(messageId: string) => Promise<void>\">\n * Regenerate the response for a specific message by ID\n * </PropertyReference>\n *\n * <PropertyReference name=\"stopGeneration\" type=\"() => void\">\n * Stop the current message generation process\n * </PropertyReference>\n *\n * <PropertyReference name=\"reset\" type=\"() => void\">\n * Clear all messages and reset chat state completely\n * </PropertyReference>\n *\n * <PropertyReference name=\"isLoading\" type=\"boolean\">\n * Whether the chat is currently generating a response\n * </PropertyReference>\n *\n * <PropertyReference name=\"runChatCompletion\" type=\"() => Promise<Message[]>\">\n * Manually trigger chat completion for advanced usage\n * </PropertyReference>\n *\n * <PropertyReference name=\"mcpServers\" type=\"MCPServerConfig[]\">\n * Array of Model Context Protocol server configurations\n * </PropertyReference>\n *\n * <PropertyReference name=\"setMcpServers\" type=\"(servers: MCPServerConfig[]) => void\">\n * Update MCP server configurations for enhanced context\n * </PropertyReference>\n */\n\nimport {\n UseCopilotChatOptions,\n useCopilotChatInternal,\n UseCopilotChatReturn as UseCopilotChatReturnInternal,\n} from \"./use-copilot-chat_internal\";\n\n// Create a type that excludes message-related properties from the internal type\nexport type UseCopilotChatReturn = Omit<\n UseCopilotChatReturnInternal,\n | \"messages\"\n | \"sendMessage\"\n | \"suggestions\"\n | \"setSuggestions\"\n | \"generateSuggestions\"\n | \"isLoadingSuggestions\"\n | \"resetSuggestions\"\n | \"interrupt\"\n | \"setMessages\"\n | \"deleteMessage\"\n>;\n\n/**\n * A lightweight React hook for headless chat interactions.\n * Perfect for programmatic messaging, background operations, and custom UI implementations.\n *\n * **Open Source Friendly** - Works without requiring a `publicApiKey`.\n */\n// TODO: Do we need this? If so, does it work properly? test.\nexport function useCopilotChat(options: UseCopilotChatOptions = {}): UseCopilotChatReturn {\n const {\n visibleMessages,\n appendMessage,\n reloadMessages,\n stopGeneration,\n reset,\n isLoading,\n isAvailable,\n runChatCompletion,\n mcpServers,\n setMcpServers,\n } = useCopilotChatInternal(options);\n\n return {\n visibleMessages,\n appendMessage,\n reloadMessages,\n stopGeneration,\n reset,\n isLoading,\n isAvailable,\n runChatCompletion,\n mcpServers,\n setMcpServers,\n };\n}\n"],"mappings":";;;;;AAuGO,SAAS,eAAe,UAAiC,CAAC,GAAyB;AACxF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,uBAAuB,OAAO;AAElC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -64,8 +64,8 @@ function ErrorToast({ errors }) {
|
|
|
64
64
|
function useErrorToast() {
|
|
65
65
|
const { addToast } = useToast();
|
|
66
66
|
return useCallback(
|
|
67
|
-
(
|
|
68
|
-
const errorId =
|
|
67
|
+
(errors) => {
|
|
68
|
+
const errorId = errors.map((err) => {
|
|
69
69
|
var _a, _b;
|
|
70
70
|
const message = "extensions" in err ? ((_b = (_a = err.extensions) == null ? void 0 : _a.originalError) == null ? void 0 : _b.message) || err.message : err.message;
|
|
71
71
|
const stack = err.stack || "";
|
|
@@ -75,7 +75,7 @@ function useErrorToast() {
|
|
|
75
75
|
type: "error",
|
|
76
76
|
id: errorId,
|
|
77
77
|
// Toast libraries typically dedupe by id
|
|
78
|
-
message: /* @__PURE__ */ jsx(ErrorToast, { errors
|
|
78
|
+
message: /* @__PURE__ */ jsx(ErrorToast, { errors })
|
|
79
79
|
});
|
|
80
80
|
},
|
|
81
81
|
[addToast]
|
|
@@ -99,4 +99,4 @@ export {
|
|
|
99
99
|
useErrorToast,
|
|
100
100
|
useAsyncCallback
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-6PUNP7CD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/error-boundary/error-utils.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { GraphQLError } from \"@copilotkit/runtime-client-gql\";\nimport { useToast } from \"../toast/toast-provider\";\nimport { ExclamationMarkIcon } from \"../toast/exclamation-mark-icon\";\nimport ReactMarkdown from \"react-markdown\";\n\ninterface OriginalError {\n message?: string;\n stack?: string;\n}\n\nexport function ErrorToast({ errors }: { errors: (Error | GraphQLError)[] }) {\n const errorsToRender = errors.map((error, idx) => {\n const originalError =\n \"extensions\" in error ? (error.extensions?.originalError as undefined | OriginalError) : {};\n const message = originalError?.message ?? error.message;\n const code = \"extensions\" in error ? (error.extensions?.code as string) : null;\n\n return (\n <div\n key={idx}\n style={{\n marginTop: idx === 0 ? 0 : 10,\n marginBottom: 14,\n }}\n >\n <ExclamationMarkIcon style={{ marginBottom: 4 }} />\n\n {code && (\n <div\n style={{\n fontWeight: \"600\",\n marginBottom: 4,\n }}\n >\n Copilot Runtime Error:{\" \"}\n <span style={{ fontFamily: \"monospace\", fontWeight: \"normal\" }}>{code}</span>\n </div>\n )}\n <ReactMarkdown>{message}</ReactMarkdown>\n </div>\n );\n });\n return (\n <div\n style={{\n fontSize: \"13px\",\n maxWidth: \"600px\",\n }}\n >\n {errorsToRender}\n <div style={{ fontSize: \"11px\", opacity: 0.75 }}>\n NOTE: This error only displays during local development.\n </div>\n </div>\n );\n}\n\nexport function useErrorToast() {\n const { addToast } = useToast();\n\n return useCallback(\n (errors: (Error | GraphQLError)[]) => {\n const errorId = errors\n .map((err) => {\n const message =\n \"extensions\" in err\n ? (err.extensions?.originalError as any)?.message || err.message\n : err.message;\n const stack = err.stack || \"\";\n return btoa(message + stack).slice(0, 32); // Create hash from message + stack\n })\n .join(\"|\");\n\n addToast({\n type: \"error\",\n id: errorId, // Toast libraries typically dedupe by id\n message: <ErrorToast errors={errors} />,\n });\n },\n [addToast],\n );\n}\n\nexport function useAsyncCallback<T extends (...args: any[]) => Promise<any>>(\n callback: T,\n deps: Parameters<typeof useCallback>[1],\n) {\n const addErrorToast = useErrorToast();\n return useCallback(async (...args: Parameters<T>) => {\n try {\n return await callback(...args);\n } catch (error) {\n console.error(\"Error in async callback:\", error);\n // @ts-ignore\n addErrorToast([error]);\n throw error;\n }\n }, deps);\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAgB,mBAAmB;AAInC,OAAO,mBAAmB;AAsBlB,cAGE,YAHF;AAfD,SAAS,WAAW,EAAE,OAAO,GAAyC;AAC3E,QAAM,iBAAiB,OAAO,IAAI,CAAC,OAAO,QAAQ;AAZpD;AAaI,UAAM,gBACJ,gBAAgB,SAAS,WAAM,eAAN,mBAAkB,gBAA8C,CAAC;AAC5F,UAAM,WAAU,oDAAe,YAAf,YAA0B,MAAM;AAChD,UAAM,OAAO,gBAAgB,SAAS,WAAM,eAAN,mBAAkB,OAAkB;AAE1E,WACE;AAAA,MAAC;AAAA;AAAA,QAEC,OAAO;AAAA,UACL,WAAW,QAAQ,IAAI,IAAI;AAAA,UAC3B,cAAc;AAAA,QAChB;AAAA,QAEA;AAAA,8BAAC,uBAAoB,OAAO,EAAE,cAAc,EAAE,GAAG;AAAA,UAEhD,QACC;AAAA,YAAC;AAAA;AAAA,cACC,OAAO;AAAA,gBACL,YAAY;AAAA,gBACZ,cAAc;AAAA,cAChB;AAAA,cACD;AAAA;AAAA,gBACwB;AAAA,gBACvB,oBAAC,UAAK,OAAO,EAAE,YAAY,aAAa,YAAY,SAAS,GAAI,gBAAK;AAAA;AAAA;AAAA,UACxE;AAAA,UAEF,oBAAC,iBAAe,mBAAQ;AAAA;AAAA;AAAA,MAnBnB;AAAA,IAoBP;AAAA,EAEJ,CAAC;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,QACL,UAAU;AAAA,QACV,UAAU;AAAA,MACZ;AAAA,MAEC;AAAA;AAAA,QACD,oBAAC,SAAI,OAAO,EAAE,UAAU,QAAQ,SAAS,KAAK,GAAG,sEAEjD;AAAA;AAAA;AAAA,EACF;AAEJ;AAEO,SAAS,gBAAgB;AAC9B,QAAM,EAAE,SAAS,IAAI,SAAS;AAE9B,SAAO;AAAA,IACL,CAAC,WAAqC;AACpC,YAAM,UAAU,OACb,IAAI,CAAC,QAAQ;AAhEtB;AAiEU,cAAM,UACJ,gBAAgB,QACX,eAAI,eAAJ,mBAAgB,kBAAhB,mBAAuC,YAAW,IAAI,UACvD,IAAI;AACV,cAAM,QAAQ,IAAI,SAAS;AAC3B,eAAO,KAAK,UAAU,KAAK,EAAE,MAAM,GAAG,EAAE;AAAA,MAC1C,CAAC,EACA,KAAK,GAAG;AAEX,eAAS;AAAA,QACP,MAAM;AAAA,QACN,IAAI;AAAA;AAAA,QACJ,SAAS,oBAAC,cAAW,QAAgB;AAAA,MACvC,CAAC;AAAA,IACH;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AACF;AAEO,SAAS,iBACd,UACA,MACA;AACA,QAAM,gBAAgB,cAAc;AACpC,SAAO,YAAY,IAAU,SAAwB;AACnD,QAAI;AACF,aAAO,MAAM,SAAS,GAAG,IAAI;AAAA,IAC/B,SAAS,OAAP;AACA,cAAQ,MAAM,4BAA4B,KAAK;AAE/C,oBAAc,CAAC,KAAK,CAAC;AACrB,YAAM;AAAA,IACR;AAAA,EACF,IAAG,IAAI;AACT;","names":[]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest
|
|
3
|
+
} from "./chunk-SKC7AJIV.mjs";
|
|
4
|
+
|
|
5
|
+
// src/hooks/use-human-in-the-loop.ts
|
|
6
|
+
import {
|
|
7
|
+
CopilotKitError,
|
|
8
|
+
CopilotKitErrorCode,
|
|
9
|
+
getZodParameters,
|
|
10
|
+
parseJson
|
|
11
|
+
} from "@copilotkit/shared";
|
|
12
|
+
import { useHumanInTheLoop as useHumanInTheLoopVNext } from "@copilotkitnext/react";
|
|
13
|
+
import { ToolCallStatus } from "@copilotkitnext/core";
|
|
14
|
+
import React, { useEffect, useRef } from "react";
|
|
15
|
+
function useHumanInTheLoop(tool, dependencies) {
|
|
16
|
+
const _a = tool, { render } = _a, toolRest = __objRest(_a, ["render"]);
|
|
17
|
+
const { name, description, parameters, followUp } = toolRest;
|
|
18
|
+
const zodParameters = getZodParameters(parameters);
|
|
19
|
+
const renderRef = useRef(null);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
renderRef.current = (args) => {
|
|
22
|
+
if (typeof render === "string") {
|
|
23
|
+
return React.createElement(React.Fragment, null, render);
|
|
24
|
+
}
|
|
25
|
+
if (!render) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
const renderProps = (() => {
|
|
29
|
+
const mappedArgs = args.args;
|
|
30
|
+
switch (args.status) {
|
|
31
|
+
case ToolCallStatus.InProgress:
|
|
32
|
+
return {
|
|
33
|
+
args: mappedArgs,
|
|
34
|
+
respond: args.respond,
|
|
35
|
+
status: args.status,
|
|
36
|
+
handler: void 0
|
|
37
|
+
};
|
|
38
|
+
case ToolCallStatus.Executing:
|
|
39
|
+
return {
|
|
40
|
+
args: mappedArgs,
|
|
41
|
+
respond: args.respond,
|
|
42
|
+
status: args.status,
|
|
43
|
+
handler: () => {
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
case ToolCallStatus.Complete:
|
|
47
|
+
return {
|
|
48
|
+
args: mappedArgs,
|
|
49
|
+
respond: args.respond,
|
|
50
|
+
status: args.status,
|
|
51
|
+
result: args.result ? parseJson(args.result, args.result) : args.result,
|
|
52
|
+
handler: void 0
|
|
53
|
+
};
|
|
54
|
+
default:
|
|
55
|
+
throw new CopilotKitError({
|
|
56
|
+
code: CopilotKitErrorCode.UNKNOWN,
|
|
57
|
+
message: `Invalid tool call status: ${args.status}`
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
})();
|
|
61
|
+
const rendered = render(renderProps);
|
|
62
|
+
if (typeof rendered === "string") {
|
|
63
|
+
return React.createElement(React.Fragment, null, rendered);
|
|
64
|
+
}
|
|
65
|
+
return rendered != null ? rendered : null;
|
|
66
|
+
};
|
|
67
|
+
}, [render, ...dependencies != null ? dependencies : []]);
|
|
68
|
+
useHumanInTheLoopVNext({
|
|
69
|
+
name,
|
|
70
|
+
description,
|
|
71
|
+
followUp,
|
|
72
|
+
parameters: zodParameters,
|
|
73
|
+
render: (args) => {
|
|
74
|
+
var _a2, _b;
|
|
75
|
+
return (_b = (_a2 = renderRef.current) == null ? void 0 : _a2.call(renderRef, args)) != null ? _b : null;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
useHumanInTheLoop
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=chunk-7DTB7S5V.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-human-in-the-loop.ts"],"sourcesContent":["import { ActionRenderProps, ActionRenderPropsWait, FrontendAction } from \"../types\";\nimport {\n CopilotKitError,\n CopilotKitErrorCode,\n MappedParameterTypes,\n Parameter,\n getZodParameters,\n parseJson,\n} from \"@copilotkit/shared\";\nimport { useHumanInTheLoop as useHumanInTheLoopVNext } from \"@copilotkitnext/react\";\nimport { ToolCallStatus } from \"@copilotkitnext/core\";\nimport React, { ComponentType, FunctionComponent, useEffect, useRef } from \"react\";\n\ntype HumanInTheLoopOptions = Parameters<typeof useHumanInTheLoopVNext>[0];\ntype HumanInTheLoopRender = HumanInTheLoopOptions[\"render\"];\ntype HumanInTheLoopRenderArgs = HumanInTheLoopRender extends (props: infer P) => any ? P : never;\n\nexport type UseHumanInTheLoopArgs<T extends Parameter[] | [] = []> = {\n available?: \"disabled\" | \"enabled\";\n render: FrontendAction<T>[\"renderAndWaitForResponse\"];\n followUp?: FrontendAction<T>[\"followUp\"];\n} & Pick<FrontendAction<T>, \"name\" | \"description\" | \"parameters\">;\n\ntype HitlRendererArgs =\n | {\n name: string;\n description: string;\n args: Partial<Record<string, unknown>>;\n status: ToolCallStatus.InProgress;\n result: undefined;\n respond: undefined;\n }\n | {\n name: string;\n description: string;\n args: Record<string, unknown>;\n status: ToolCallStatus.Executing;\n result: undefined;\n respond: (result: unknown) => Promise<void>;\n }\n | {\n name: string;\n description: string;\n args: Record<string, unknown>;\n status: ToolCallStatus.Complete;\n result: string;\n respond: undefined;\n };\ntype HitlRenderer = FunctionComponent<HitlRendererArgs>;\n\nexport function useHumanInTheLoop<const T extends Parameter[] | [] = []>(\n tool: UseHumanInTheLoopArgs<T>,\n dependencies?: any[],\n) {\n const { render, ...toolRest } = tool;\n const { name, description, parameters, followUp } = toolRest;\n const zodParameters = getZodParameters(parameters);\n const renderRef = useRef<HitlRenderer | null>(null);\n\n useEffect(() => {\n renderRef.current = (args: HitlRendererArgs): React.ReactElement | null => {\n if (typeof render === \"string\") {\n return React.createElement(React.Fragment, null, render);\n }\n\n if (!render) {\n return null;\n }\n\n const renderProps: ActionRenderPropsWait<T> = (() => {\n const mappedArgs = args.args as unknown as MappedParameterTypes<T>;\n\n switch (args.status) {\n case ToolCallStatus.InProgress:\n return {\n args: mappedArgs,\n respond: args.respond,\n status: args.status,\n handler: undefined,\n };\n case ToolCallStatus.Executing:\n return {\n args: mappedArgs,\n respond: args.respond,\n status: args.status,\n handler: () => {},\n };\n case ToolCallStatus.Complete:\n return {\n args: mappedArgs,\n respond: args.respond,\n status: args.status,\n result: args.result ? parseJson(args.result, args.result) : args.result,\n handler: undefined,\n };\n default:\n throw new CopilotKitError({\n code: CopilotKitErrorCode.UNKNOWN,\n message: `Invalid tool call status: ${(args as unknown as { status: string }).status}`,\n });\n }\n })();\n\n const rendered = render(renderProps);\n\n if (typeof rendered === \"string\") {\n return React.createElement(React.Fragment, null, rendered);\n }\n\n return rendered ?? null;\n };\n }, [render, ...(dependencies ?? [])]);\n\n useHumanInTheLoopVNext({\n name,\n description,\n followUp,\n parameters: zodParameters,\n render: ((args: HumanInTheLoopRenderArgs) =>\n renderRef.current?.(args as HitlRendererArgs) ?? null) as HumanInTheLoopOptions[\"render\"],\n });\n}\n"],"mappings":";;;;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB,8BAA8B;AAC5D,SAAS,sBAAsB;AAC/B,OAAO,SAA2C,WAAW,cAAc;AAuCpE,SAAS,kBACd,MACA,cACA;AACA,QAAgC,WAAxB,SAtDV,IAsDkC,IAAb,qBAAa,IAAb,CAAX;AACR,QAAM,EAAE,MAAM,aAAa,YAAY,SAAS,IAAI;AACpD,QAAM,gBAAgB,iBAAiB,UAAU;AACjD,QAAM,YAAY,OAA4B,IAAI;AAElD,YAAU,MAAM;AACd,cAAU,UAAU,CAAC,SAAsD;AACzE,UAAI,OAAO,WAAW,UAAU;AAC9B,eAAO,MAAM,cAAc,MAAM,UAAU,MAAM,MAAM;AAAA,MACzD;AAEA,UAAI,CAAC,QAAQ;AACX,eAAO;AAAA,MACT;AAEA,YAAM,eAAyC,MAAM;AACnD,cAAM,aAAa,KAAK;AAExB,gBAAQ,KAAK,QAAQ;AAAA,UACnB,KAAK,eAAe;AAClB,mBAAO;AAAA,cACL,MAAM;AAAA,cACN,SAAS,KAAK;AAAA,cACd,QAAQ,KAAK;AAAA,cACb,SAAS;AAAA,YACX;AAAA,UACF,KAAK,eAAe;AAClB,mBAAO;AAAA,cACL,MAAM;AAAA,cACN,SAAS,KAAK;AAAA,cACd,QAAQ,KAAK;AAAA,cACb,SAAS,MAAM;AAAA,cAAC;AAAA,YAClB;AAAA,UACF,KAAK,eAAe;AAClB,mBAAO;AAAA,cACL,MAAM;AAAA,cACN,SAAS,KAAK;AAAA,cACd,QAAQ,KAAK;AAAA,cACb,QAAQ,KAAK,SAAS,UAAU,KAAK,QAAQ,KAAK,MAAM,IAAI,KAAK;AAAA,cACjE,SAAS;AAAA,YACX;AAAA,UACF;AACE,kBAAM,IAAI,gBAAgB;AAAA,cACxB,MAAM,oBAAoB;AAAA,cAC1B,SAAS,6BAA8B,KAAuC;AAAA,YAChF,CAAC;AAAA,QACL;AAAA,MACF,GAAG;AAEH,YAAM,WAAW,OAAO,WAAW;AAEnC,UAAI,OAAO,aAAa,UAAU;AAChC,eAAO,MAAM,cAAc,MAAM,UAAU,MAAM,QAAQ;AAAA,MAC3D;AAEA,aAAO,8BAAY;AAAA,IACrB;AAAA,EACF,GAAG,CAAC,QAAQ,GAAI,sCAAgB,CAAC,CAAE,CAAC;AAEpC,yBAAuB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,QAAS,CAAC,SAAgC;AAtH9C,UAAAA,KAAA;AAuHM,oBAAAA,MAAA,UAAU,YAAV,gBAAAA,IAAA,gBAAoB,UAApB,YAAiD;AAAA;AAAA,EACrD,CAAC;AACH;","names":["_a"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AFNWX62Q.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-make-copilot-document-readable.ts
|
|
6
6
|
import { useEffect, useRef } from "react";
|
|
7
7
|
function useMakeCopilotDocumentReadable(document, categories, dependencies = []) {
|
|
8
8
|
const { addDocumentContext, removeDocumentContext } = useCopilotContext();
|
|
9
|
-
const idRef = useRef();
|
|
9
|
+
const idRef = useRef(void 0);
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
const id = addDocumentContext(document, categories);
|
|
12
12
|
idRef.current = id;
|
|
@@ -20,4 +20,4 @@ function useMakeCopilotDocumentReadable(document, categories, dependencies = [])
|
|
|
20
20
|
export {
|
|
21
21
|
useMakeCopilotDocumentReadable
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-7IBF6RBW.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-make-copilot-document-readable.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport { useCopilotContext } from \"../context/copilot-context\";\nimport { DocumentPointer } from \"../types\";\n\n/**\n * Makes a document readable by Copilot.\n * @param document The document to make readable.\n * @param categories The categories to associate with the document.\n * @param dependencies The dependencies to use for the effect.\n * @returns The id of the document.\n */\nexport function useMakeCopilotDocumentReadable(\n document: DocumentPointer,\n categories?: string[],\n dependencies: any[] = [],\n): string | undefined {\n const { addDocumentContext, removeDocumentContext } = useCopilotContext();\n const idRef = useRef<string>();\n\n useEffect(() => {\n const id = addDocumentContext(document, categories);\n idRef.current = id;\n\n return () => {\n removeDocumentContext(id);\n };\n }, [addDocumentContext, removeDocumentContext, ...dependencies]);\n\n return idRef.current;\n}\n"],"mappings":";;;;;AAAA,SAAS,WAAW,cAAc;AAW3B,SAAS,+BACd,UACA,YACA,eAAsB,CAAC,GACH;AACpB,QAAM,EAAE,oBAAoB,sBAAsB,IAAI,kBAAkB;AACxE,QAAM,QAAQ,OAAe;
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-make-copilot-document-readable.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport { useCopilotContext } from \"../context/copilot-context\";\nimport { DocumentPointer } from \"../types\";\n\n/**\n * Makes a document readable by Copilot.\n * @param document The document to make readable.\n * @param categories The categories to associate with the document.\n * @param dependencies The dependencies to use for the effect.\n * @returns The id of the document.\n */\nexport function useMakeCopilotDocumentReadable(\n document: DocumentPointer,\n categories?: string[],\n dependencies: any[] = [],\n): string | undefined {\n const { addDocumentContext, removeDocumentContext } = useCopilotContext();\n const idRef = useRef<string>(undefined!);\n\n useEffect(() => {\n const id = addDocumentContext(document, categories);\n idRef.current = id;\n\n return () => {\n removeDocumentContext(id);\n };\n }, [addDocumentContext, removeDocumentContext, ...dependencies]);\n\n return idRef.current;\n}\n"],"mappings":";;;;;AAAA,SAAS,WAAW,cAAc;AAW3B,SAAS,+BACd,UACA,YACA,eAAsB,CAAC,GACH;AACpB,QAAM,EAAE,oBAAoB,sBAAsB,IAAI,kBAAkB;AACxE,QAAM,QAAQ,OAAe,MAAU;AAEvC,YAAU,MAAM;AACd,UAAM,KAAK,mBAAmB,UAAU,UAAU;AAClD,UAAM,UAAU;AAEhB,WAAO,MAAM;AACX,4BAAsB,EAAE;AAAA,IAC1B;AAAA,EACF,GAAG,CAAC,oBAAoB,uBAAuB,GAAG,YAAY,CAAC;AAE/D,SAAO,MAAM;AACf;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-A6NKSGH3.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AFNWX62Q.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-copilot-additional-instructions.ts
|
|
6
6
|
import { useEffect } from "react";
|
|
@@ -21,4 +21,4 @@ function useCopilotAdditionalInstructions({ instructions, available = "enabled"
|
|
|
21
21
|
export {
|
|
22
22
|
useCopilotAdditionalInstructions
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-ABWT4DRT.mjs.map
|