@dxos/plugin-assistant 0.8.4-main.c1de068 → 0.8.4-main.e098934
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/lib/browser/{TemplateContainer-RPJ2LBOB.mjs → BlueprintContainer-BFNN6K46.mjs} +11 -9
- package/dist/lib/browser/BlueprintContainer-BFNN6K46.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-DOVN34C7.mjs +126 -0
- package/dist/lib/browser/ChatCompanion-DOVN34C7.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-M3IHQLRS.mjs → ChatContainer-XIVJTCC2.mjs} +34 -13
- package/dist/lib/browser/ChatContainer-XIVJTCC2.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-X6VN6QZI.mjs → ChatDialog-EJJMK3WL.mjs} +28 -12
- package/dist/lib/browser/ChatDialog-EJJMK3WL.mjs.map +7 -0
- package/dist/lib/browser/{SequenceContainer-3UDVKWPA.mjs → SequenceContainer-TF5QNXYM.mjs} +5 -17
- package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs.map +7 -0
- package/dist/lib/browser/ai-service-YC2EQPHA.mjs +22 -0
- package/dist/lib/browser/ai-service-YC2EQPHA.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-JTXBKE7O.mjs → app-graph-builder-3C43MLCD.mjs} +26 -96
- package/dist/lib/browser/app-graph-builder-3C43MLCD.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-VHFSRTEJ.mjs +12 -0
- package/dist/lib/browser/blueprint-definition-VHFSRTEJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-C4Q2RYQM.mjs +1974 -0
- package/dist/lib/browser/chunk-C4Q2RYQM.mjs.map +7 -0
- package/dist/lib/browser/chunk-EZUSNS2J.mjs +19 -0
- package/dist/lib/browser/chunk-EZUSNS2J.mjs.map +7 -0
- package/dist/lib/browser/chunk-GLWD66TA.mjs +161 -0
- package/dist/lib/browser/chunk-GLWD66TA.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-O4LUJEDV.mjs +20 -0
- package/dist/lib/browser/{chunk-FDCJSQYF.mjs.map → chunk-O4LUJEDV.mjs.map} +2 -2
- package/dist/lib/browser/chunk-PQI3MGDN.mjs +169 -0
- package/dist/lib/browser/chunk-PQI3MGDN.mjs.map +7 -0
- package/dist/lib/browser/chunk-QD4UUISH.mjs +299 -0
- package/dist/lib/browser/chunk-QD4UUISH.mjs.map +7 -0
- package/dist/lib/browser/chunk-R6LRGW3I.mjs +216 -0
- package/dist/lib/browser/chunk-R6LRGW3I.mjs.map +7 -0
- package/dist/lib/browser/chunk-SMIVXXAI.mjs +202 -0
- package/dist/lib/browser/chunk-SMIVXXAI.mjs.map +7 -0
- package/dist/lib/browser/compute-runtime-X6IREJN3.mjs +155 -0
- package/dist/lib/browser/compute-runtime-X6IREJN3.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-JNEB355N.mjs +22 -0
- package/dist/lib/browser/edge-model-resolver-JNEB355N.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +167 -68
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-I6M3ZDAS.mjs +112 -0
- package/dist/lib/browser/intent-resolver-I6M3ZDAS.mjs.map +7 -0
- package/dist/lib/browser/local-model-resolver-EUXSRZ7X.mjs +21 -0
- package/dist/lib/browser/local-model-resolver-EUXSRZ7X.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-E4NAGB6R.mjs +109 -0
- package/dist/lib/browser/react-surface-E4NAGB6R.mjs.map +7 -0
- package/dist/lib/browser/{settings-2DGP3UTS.mjs → settings-36V3VUMW.mjs} +6 -5
- package/dist/lib/{node-esm/settings-47RYZOU4.mjs.map → browser/settings-36V3VUMW.mjs.map} +1 -1
- package/dist/lib/browser/state-AINRYS5W.mjs +21 -0
- package/dist/lib/browser/state-AINRYS5W.mjs.map +7 -0
- package/dist/lib/browser/toolkit-MPUS3U64.mjs +191 -0
- package/dist/lib/browser/toolkit-MPUS3U64.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -4
- package/dist/lib/node-esm/{TemplateContainer-A3NAQCZE.mjs → BlueprintContainer-X4MRBKDR.mjs} +11 -9
- package/dist/lib/node-esm/BlueprintContainer-X4MRBKDR.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-ICWYVPRD.mjs +127 -0
- package/dist/lib/node-esm/ChatCompanion-ICWYVPRD.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-VZT74PO2.mjs → ChatContainer-LMMMQD4K.mjs} +34 -13
- package/dist/lib/node-esm/ChatContainer-LMMMQD4K.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-RJ6FDX4Q.mjs → ChatDialog-UUE3F7BT.mjs} +28 -12
- package/dist/lib/node-esm/ChatDialog-UUE3F7BT.mjs.map +7 -0
- package/dist/lib/node-esm/{SequenceContainer-RQQH5XOC.mjs → SequenceContainer-UXOVZPZO.mjs} +5 -17
- package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-XUMZVFCK.mjs +23 -0
- package/dist/lib/node-esm/ai-service-XUMZVFCK.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-OWSOXFTD.mjs → app-graph-builder-NM3JDLQ2.mjs} +26 -96
- package/dist/lib/node-esm/app-graph-builder-NM3JDLQ2.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-4E6XTLVN.mjs +13 -0
- package/dist/lib/node-esm/blueprint-definition-4E6XTLVN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs +170 -0
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7YOGZI66.mjs +203 -0
- package/dist/lib/node-esm/chunk-7YOGZI66.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LVTG5JTW.mjs +217 -0
- package/dist/lib/node-esm/chunk-LVTG5JTW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QG2KT3AT.mjs +163 -0
- package/dist/lib/node-esm/chunk-QG2KT3AT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-V44ZG7CU.mjs +1975 -0
- package/dist/lib/node-esm/chunk-V44ZG7CU.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-VFY2JG62.mjs +22 -0
- package/dist/lib/node-esm/{chunk-QN2H2EHV.mjs.map → chunk-VFY2JG62.mjs.map} +2 -2
- package/dist/lib/node-esm/chunk-XD4CDA4R.mjs +20 -0
- package/dist/lib/node-esm/chunk-XD4CDA4R.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YU62ZWJN.mjs +300 -0
- package/dist/lib/node-esm/chunk-YU62ZWJN.mjs.map +7 -0
- package/dist/lib/node-esm/compute-runtime-NRHLLTSC.mjs +156 -0
- package/dist/lib/node-esm/compute-runtime-NRHLLTSC.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-UE5TLLJZ.mjs +23 -0
- package/dist/lib/node-esm/edge-model-resolver-UE5TLLJZ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +167 -68
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-VIINHFMT.mjs +113 -0
- package/dist/lib/node-esm/intent-resolver-VIINHFMT.mjs.map +7 -0
- package/dist/lib/node-esm/local-model-resolver-JBEFVVZA.mjs +22 -0
- package/dist/lib/node-esm/local-model-resolver-JBEFVVZA.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-5WQLRTCH.mjs +110 -0
- package/dist/lib/node-esm/react-surface-5WQLRTCH.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-47RYZOU4.mjs → settings-7ZCZ6AS5.mjs} +6 -5
- package/dist/lib/{browser/settings-2DGP3UTS.mjs.map → node-esm/settings-7ZCZ6AS5.mjs.map} +1 -1
- package/dist/lib/node-esm/state-EQS5KP6M.mjs +22 -0
- package/dist/lib/node-esm/state-EQS5KP6M.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-PKVYDZ4H.mjs +192 -0
- package/dist/lib/node-esm/toolkit-PKVYDZ4H.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -4
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +5 -0
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +7 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +32 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts +5 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +12 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +10 -0
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +4 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit.d.ts +4 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +8 -0
- package/dist/types/src/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/components/Chat/Chat.d.ts +20 -17
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +5 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +13 -0
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer.d.ts +4 -4
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +7 -0
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
- package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
- package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +4 -5
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +10 -7
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +115 -74
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts +40 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +36 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/PromptSettings.d.ts.map +1 -1
- package/dist/types/src/components/SequenceContainer.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +261 -2
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +261 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +2 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +258 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +19 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
- package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +5 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/index.d.ts +2 -0
- package/dist/types/src/components/Toolbar/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +11 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -9
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +262 -4
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/execution-graph/execution-graph.d.ts +21 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph/index.d.ts +2 -0
- package/dist/types/src/execution-graph/index.d.ts.map +1 -0
- package/dist/types/src/functions/analysis.d.ts +5 -0
- package/dist/types/src/functions/analysis.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +4 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/list.d.ts +10 -0
- package/dist/types/src/functions/list.d.ts.map +1 -0
- package/dist/types/src/functions/load.d.ts +8 -0
- package/dist/types/src/functions/load.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +9 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +24 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +8 -21
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -6
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +8 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +4 -0
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts +6 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/useItemTypes.d.ts +4 -0
- package/dist/types/src/hooks/useItemTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnline.d.ts +3 -0
- package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +7 -0
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/processor/index.d.ts +3 -0
- package/dist/types/src/processor/index.d.ts.map +1 -0
- package/dist/types/src/{hooks → processor}/presets.d.ts +2 -2
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +73 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts +2 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/stories/Chat.stories.d.ts +26 -245
- package/dist/types/src/stories/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +4 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/DebugCard.d.ts +8 -0
- package/dist/types/src/stories/components/DebugCard.d.ts.map +1 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts +6 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts +7 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts +4 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts +6 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts +4 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts +3 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts +14 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/index.d.ts +16 -0
- package/dist/types/src/stories/components/index.d.ts.map +1 -0
- package/dist/types/src/stories/components/types.d.ts +7 -0
- package/dist/types/src/stories/components/types.d.ts.map +1 -0
- package/dist/types/src/stories/testing/data.d.ts +9 -0
- package/dist/types/src/stories/testing/data.d.ts.map +1 -0
- package/dist/types/src/stories/testing/index.d.ts +3 -0
- package/dist/types/src/stories/testing/index.d.ts.map +1 -0
- package/dist/types/src/stories/testing/schema.d.ts +7 -0
- package/dist/types/src/stories/testing/schema.d.ts.map +1 -0
- package/dist/types/src/stories/testing/testing.d.ts +48 -0
- package/dist/types/src/stories/testing/testing.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +3 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-data.d.ts +14 -0
- package/dist/types/src/testing/test-data.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +5 -2
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +7 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +29 -22
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +42 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +107 -0
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
- package/dist/types/src/types/defs.d.ts +2 -0
- package/dist/types/src/types/defs.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +6 -3
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +106 -82
- package/src/AssistantPlugin.tsx +83 -12
- package/src/capabilities/ai-service.ts +28 -0
- package/src/capabilities/app-graph-builder.ts +43 -134
- package/src/capabilities/blueprint-definition.ts +58 -0
- package/src/capabilities/capabilities.ts +71 -0
- package/src/capabilities/compute-runtime.ts +124 -0
- package/src/capabilities/edge-model-resolver.ts +27 -0
- package/src/capabilities/index.ts +10 -0
- package/src/capabilities/intent-resolver.ts +50 -14
- package/src/capabilities/local-model-resolver.ts +32 -0
- package/src/capabilities/react-surface.tsx +17 -64
- package/src/capabilities/state.ts +20 -0
- package/src/capabilities/toolkit.ts +163 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +83 -76
- package/src/components/BlueprintContainer.tsx +24 -0
- package/src/components/Chat/Chat.tsx +175 -174
- package/src/components/Chat/events.ts +7 -0
- package/src/components/ChatCompanion.tsx +111 -0
- package/src/components/ChatContainer.tsx +19 -13
- package/src/components/ChatDialog.tsx +18 -14
- package/src/components/ChatProgress/ChatProgress.tsx +68 -0
- package/src/components/ChatProgress/index.ts +5 -0
- package/src/components/ChatPrompt/ChatActions.tsx +10 -24
- package/src/components/ChatPrompt/ChatOptions.tsx +233 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +31 -36
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatPrompt/index.ts +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +97 -110
- package/src/components/ChatThread/ChatThread.tsx +65 -29
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/components/ChatThread/reducers.ts +151 -0
- package/src/components/ChatThread/registry.tsx +189 -0
- package/src/components/ChatThread/sync.test.ts +81 -0
- package/src/components/ChatThread/sync.ts +113 -0
- package/src/components/PromptSettings.tsx +1 -0
- package/src/components/SequenceContainer.tsx +27 -28
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +5 -4
- package/src/components/SequenceEditor/SequenceEditor.tsx +1 -1
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +27 -14
- package/src/components/TemplateEditor/TemplateEditor.tsx +20 -51
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +15 -8
- package/src/components/TemplateEditor/TemplateForm.tsx +6 -3
- package/src/components/TemplateEditor/handlebars-extension.ts +165 -0
- package/src/components/ToolBlock/ToolBlock.tsx +152 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbar/Toolbar.tsx +21 -0
- package/src/components/Toolbar/index.ts +5 -0
- package/src/components/Toolbar/useChatToolbarActions.ts +126 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +10 -16
- package/src/components/Toolbox/Toolbox.tsx +21 -51
- package/src/components/index.ts +4 -5
- package/src/events.ts +2 -2
- package/src/execution-graph/execution-graph.ts +211 -0
- package/src/execution-graph/index.ts +5 -0
- package/src/functions/analysis.ts +20 -0
- package/src/functions/index.ts +7 -0
- package/src/functions/list.ts +46 -0
- package/src/functions/load.ts +42 -0
- package/src/hooks/index.ts +9 -4
- package/src/hooks/useBlueprintRegistry.ts +80 -0
- package/src/hooks/useChatProcessor.ts +21 -98
- package/src/hooks/useChatServices.ts +28 -71
- package/src/hooks/useComputeRuntimeCallback.ts +25 -0
- package/src/hooks/useContextBinder.ts +18 -0
- package/src/hooks/useContextObjects.ts +58 -0
- package/src/hooks/useExecutionGraph.ts +20 -0
- package/src/hooks/useFlush.ts +35 -0
- package/src/hooks/useItemTypes.ts +37 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +44 -0
- package/src/hooks/useReferencesProvider.ts +11 -9
- package/src/meta.ts +1 -1
- package/src/processor/index.ts +6 -0
- package/src/{hooks → processor}/presets.ts +14 -6
- package/src/processor/processor.test.ts +77 -0
- package/src/processor/processor.ts +302 -0
- package/src/queue-logger.ts +10 -10
- package/src/stories/Chat.stories.tsx +594 -315
- package/src/stories/components/BlueprintContainer.tsx +34 -0
- package/src/stories/components/ChatContainer.tsx +74 -0
- package/src/stories/components/ChessContainer.tsx +17 -0
- package/src/stories/components/CommentsContainer.tsx +25 -0
- package/src/stories/components/DebugCard.tsx +61 -0
- package/src/stories/components/GraphContainer.tsx +119 -0
- package/src/stories/components/InvocationsContainer.tsx +17 -0
- package/src/stories/components/LoggingContainer.tsx +33 -0
- package/src/stories/components/MessageContainer.tsx +22 -0
- package/src/stories/components/PromptContainer.tsx +52 -0
- package/src/stories/components/ResearchInputStack.tsx +30 -0
- package/src/stories/components/ResearchOutputStack.tsx +29 -0
- package/src/stories/components/TasksContainer.tsx +49 -0
- package/src/stories/components/TokenManagerContainer.tsx +14 -0
- package/src/stories/components/TriggersContainer.tsx +75 -0
- package/src/stories/components/index.ts +20 -0
- package/src/stories/components/types.ts +11 -0
- package/src/stories/testing/data.ts +142 -0
- package/src/stories/testing/index.ts +6 -0
- package/src/stories/testing/schema.ts +17 -0
- package/src/stories/testing/testing.tsx +279 -0
- package/src/testing/index.ts +3 -1
- package/src/testing/test-data.ts +245 -0
- package/src/testing/test-functions.ts +8 -3
- package/src/testing/test-generator.ts +257 -0
- package/src/testing/test-sequence.ts +2 -27
- package/src/translations.ts +32 -22
- package/src/types/Assistant.ts +61 -0
- package/src/types/AssistantAction.ts +62 -0
- package/src/types/defs.ts +5 -0
- package/src/types/index.ts +4 -1
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/ChatContainer-M3IHQLRS.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-RPJ2LBOB.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs.map +0 -7
- package/dist/lib/browser/chunk-AEAEKWOC.mjs +0 -98
- package/dist/lib/browser/chunk-AEAEKWOC.mjs.map +0 -7
- package/dist/lib/browser/chunk-EQDW6BYQ.mjs +0 -108
- package/dist/lib/browser/chunk-EQDW6BYQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-FDCJSQYF.mjs +0 -40
- package/dist/lib/browser/chunk-JQBVLTM5.mjs +0 -158
- package/dist/lib/browser/chunk-JQBVLTM5.mjs.map +0 -7
- package/dist/lib/browser/chunk-OWY4CUQY.mjs +0 -2245
- package/dist/lib/browser/chunk-OWY4CUQY.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs +0 -60
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs.map +0 -7
- package/dist/lib/browser/react-surface-66VY37YQ.mjs +0 -150
- package/dist/lib/browser/react-surface-66VY37YQ.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-A3NAQCZE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2XL6MNPE.mjs +0 -99
- package/dist/lib/node-esm/chunk-2XL6MNPE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs +0 -159
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E33DNNDW.mjs +0 -109
- package/dist/lib/node-esm/chunk-E33DNNDW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +0 -41
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs +0 -2246
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs +0 -61
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs +0 -151
- package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs.map +0 -7
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -17
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
- package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
- package/dist/types/src/components/TemplateContainer.d.ts +0 -8
- package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.d.ts +0 -86
- package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.test.d.ts +0 -2
- package/dist/types/src/hooks/chat-processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/presets.d.ts.map +0 -1
- package/dist/types/src/hooks/useBlueprints.d.ts +0 -9
- package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -88
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
- package/src/components/ChatThread/ChatMessage.tsx +0 -268
- package/src/components/ChatThread/ToolBlock.tsx +0 -121
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/components/TemplateContainer.tsx +0 -24
- package/src/hooks/chat-processor.test.ts +0 -16
- package/src/hooks/chat-processor.ts +0 -314
- package/src/hooks/useBlueprints.ts +0 -57
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -81
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/tools/function.ts +0 -46
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -217
- package/src/tools/openapi.ts +0 -338
- package/src/types/schema.ts +0 -95
- package/src/typings.d.ts +0 -9
|
@@ -4,46 +4,41 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Extension, Prec } from '@codemirror/state';
|
|
6
6
|
import { keymap } from '@codemirror/view';
|
|
7
|
+
import { useRxValue } from '@effect-rx/rx-react';
|
|
7
8
|
import { createContext } from '@radix-ui/react-context';
|
|
8
|
-
import {
|
|
9
|
+
import { Array, Option } from 'effect';
|
|
9
10
|
import React, { type PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
10
11
|
|
|
11
|
-
import { CollaborationActions, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
12
12
|
import { Event } from '@dxos/async';
|
|
13
|
-
import {
|
|
14
|
-
import { log } from '@dxos/log';
|
|
13
|
+
import { Obj } from '@dxos/echo';
|
|
15
14
|
import { useVoiceInput } from '@dxos/plugin-transcription';
|
|
16
|
-
import { type
|
|
15
|
+
import { type Space, getSpace, useQueue } from '@dxos/react-client/echo';
|
|
17
16
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
18
|
-
import { Input,
|
|
17
|
+
import { Input, type ThemedClassName, useDynamicRef, useTranslation } from '@dxos/react-ui';
|
|
19
18
|
import { ChatEditor, type ChatEditorController, type ChatEditorProps, references } from '@dxos/react-ui-chat';
|
|
20
|
-
import { type ScrollController } from '@dxos/react-ui-components';
|
|
21
19
|
import { mx } from '@dxos/react-ui-theme';
|
|
22
20
|
import { DataType } from '@dxos/schema';
|
|
23
21
|
import { isNotFalsy } from '@dxos/util';
|
|
24
22
|
|
|
25
|
-
import {
|
|
26
|
-
import { type ChatProcessor, useBlueprints, useReferencesProvider } from '../../hooks';
|
|
23
|
+
import { useReferencesProvider } from '../../hooks';
|
|
27
24
|
import { meta } from '../../meta';
|
|
25
|
+
import { type AiChatProcessor } from '../../processor';
|
|
28
26
|
import { type Assistant } from '../../types';
|
|
29
27
|
import {
|
|
30
28
|
ChatActions,
|
|
31
29
|
type ChatActionsProps,
|
|
32
|
-
|
|
33
|
-
ChatPresets,
|
|
30
|
+
ChatOptions,
|
|
34
31
|
type ChatPresetsProps,
|
|
35
32
|
ChatReferences,
|
|
36
|
-
type ChatReferencesProps,
|
|
37
33
|
ChatStatusIndicator,
|
|
38
34
|
} from '../ChatPrompt';
|
|
39
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
type ChatThreadController,
|
|
37
|
+
ChatThread as NaturalChatThread,
|
|
38
|
+
type ChatThreadProps as NaturalChatThreadProps,
|
|
39
|
+
} from '../ChatThread';
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
const Endcap = ({ children }: PropsWithChildren) => {
|
|
43
|
-
return (
|
|
44
|
-
<div className='grid w-[var(--rail-action)] h-[var(--rail-action)] items-center justify-center'>{children}</div>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
41
|
+
import { type ChatEvent } from './events';
|
|
47
42
|
|
|
48
43
|
//
|
|
49
44
|
// Context
|
|
@@ -51,21 +46,16 @@ const Endcap = ({ children }: PropsWithChildren) => {
|
|
|
51
46
|
// Components outside of this Radix-style group shuld define their own APIs.
|
|
52
47
|
//
|
|
53
48
|
|
|
54
|
-
// TODO(burdon): Inject via effect layer.
|
|
55
49
|
type ChatContextValue = {
|
|
56
50
|
debug?: boolean;
|
|
57
51
|
event: Event<ChatEvent>;
|
|
58
52
|
space: Space;
|
|
59
53
|
chat: Assistant.Chat;
|
|
60
|
-
processor: ChatProcessor;
|
|
61
54
|
messages: DataType.Message[];
|
|
62
|
-
|
|
63
|
-
/** @deprecated Remove and replace with context. */
|
|
64
|
-
artifact?: Expando;
|
|
55
|
+
processor: AiChatProcessor;
|
|
65
56
|
};
|
|
66
57
|
|
|
67
|
-
|
|
68
|
-
const [ChatContextProvider, useChatContext] = createContext<ChatContextValue>('Chat');
|
|
58
|
+
export const [ChatContextProvider, useChatContext] = createContext<ChatContextValue>('Chat');
|
|
69
59
|
|
|
70
60
|
//
|
|
71
61
|
// Root
|
|
@@ -73,72 +63,69 @@ const [ChatContextProvider, useChatContext] = createContext<ChatContextValue>('C
|
|
|
73
63
|
|
|
74
64
|
type ChatRootProps = ThemedClassName<
|
|
75
65
|
PropsWithChildren<
|
|
76
|
-
Pick<ChatContextValue, 'chat' | 'processor'
|
|
66
|
+
Pick<ChatContextValue, 'chat' | 'processor'> & {
|
|
77
67
|
onEvent?: (event: ChatEvent) => void;
|
|
78
68
|
}
|
|
79
69
|
>
|
|
80
70
|
>;
|
|
81
71
|
|
|
82
|
-
const ChatRoot = ({ classNames, children, chat, processor,
|
|
72
|
+
const ChatRoot = ({ classNames, children, chat, processor, onEvent, ...props }: ChatRootProps) => {
|
|
83
73
|
const [debug, setDebug] = useState(false);
|
|
84
74
|
const space = getSpace(chat);
|
|
85
75
|
|
|
86
76
|
// Messages.
|
|
87
77
|
const queue = useQueue<DataType.Message>(chat?.queue.dxn);
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
[...(queue?.objects?.filter(Obj.instanceOf(DataType.Message)) ?? []), ...(processor?.messages.value ?? [])],
|
|
92
|
-
(a, b) => a.id === b.id,
|
|
93
|
-
),
|
|
94
|
-
[queue?.objects, processor?.messages.value],
|
|
95
|
-
);
|
|
78
|
+
const pending = useRxValue(processor.messages);
|
|
79
|
+
const streaming = useRxValue(processor.streaming);
|
|
80
|
+
const lastPrompt = useRef<string | undefined>(undefined);
|
|
96
81
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const message = queue.objects[queue.objects.length - 1];
|
|
102
|
-
if (dispatch && space && chat && message) {
|
|
103
|
-
void dispatch(
|
|
104
|
-
createIntent(CollaborationActions.InsertContent, {
|
|
105
|
-
target: artifact,
|
|
106
|
-
object: Ref.fromDXN(new DXN(DXN.kind.QUEUE, [...chat.queue.dxn.parts, message.id])),
|
|
107
|
-
label: 'View proposal',
|
|
108
|
-
}),
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}, [queue, processor?.streaming.value]);
|
|
82
|
+
const messages = useMemo(() => {
|
|
83
|
+
const queueMessages = queue?.objects?.filter(Obj.instanceOf(DataType.Message)) ?? [];
|
|
84
|
+
return Array.dedupeWith([...queueMessages, ...pending], (a, b) => a.id === b.id);
|
|
85
|
+
}, [queue?.objects, pending]);
|
|
113
86
|
|
|
114
87
|
// Events.
|
|
115
88
|
const event = useMemo(() => new Event<ChatEvent>(), []);
|
|
116
89
|
useEffect(() => {
|
|
117
|
-
return event.on((
|
|
118
|
-
switch (
|
|
90
|
+
return event.on((ev) => {
|
|
91
|
+
switch (ev.type) {
|
|
119
92
|
case 'toggle-debug': {
|
|
120
|
-
setDebug((
|
|
93
|
+
setDebug((current) => !current);
|
|
121
94
|
break;
|
|
122
95
|
}
|
|
123
96
|
|
|
124
97
|
case 'submit': {
|
|
125
|
-
|
|
126
|
-
|
|
98
|
+
const text = ev.text.trim();
|
|
99
|
+
if (!streaming && text.length) {
|
|
100
|
+
lastPrompt.current = ev.text;
|
|
101
|
+
void processor.request({ message: text });
|
|
102
|
+
}
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
case 'retry': {
|
|
107
|
+
if (!streaming) {
|
|
108
|
+
void processor.retry();
|
|
127
109
|
}
|
|
128
110
|
break;
|
|
129
111
|
}
|
|
130
112
|
|
|
131
113
|
case 'cancel': {
|
|
132
|
-
|
|
114
|
+
if (streaming) {
|
|
115
|
+
void processor.cancel();
|
|
116
|
+
if (lastPrompt.current) {
|
|
117
|
+
event.emit({ type: 'update-prompt', text: lastPrompt.current });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
133
120
|
break;
|
|
134
121
|
}
|
|
135
122
|
|
|
136
123
|
default: {
|
|
137
|
-
onEvent?.(
|
|
124
|
+
onEvent?.(ev);
|
|
138
125
|
}
|
|
139
126
|
}
|
|
140
127
|
});
|
|
141
|
-
}, [event, onEvent]);
|
|
128
|
+
}, [event, processor, streaming, onEvent]);
|
|
142
129
|
|
|
143
130
|
if (!space) {
|
|
144
131
|
return null;
|
|
@@ -150,8 +137,8 @@ const ChatRoot = ({ classNames, children, chat, processor, artifact, onEvent, ..
|
|
|
150
137
|
event={event}
|
|
151
138
|
chat={chat}
|
|
152
139
|
space={space}
|
|
153
|
-
processor={processor}
|
|
154
140
|
messages={messages}
|
|
141
|
+
processor={processor}
|
|
155
142
|
{...props}
|
|
156
143
|
>
|
|
157
144
|
<div role='none' className={mx('flex flex-col h-full overflow-hidden', classNames)}>
|
|
@@ -163,110 +150,79 @@ const ChatRoot = ({ classNames, children, chat, processor, artifact, onEvent, ..
|
|
|
163
150
|
|
|
164
151
|
ChatRoot.displayName = 'Chat.Root';
|
|
165
152
|
|
|
166
|
-
//
|
|
167
|
-
// Thread
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
type ChatThreadProps = Omit<NativeChatThreadProps, 'identity' | 'space' | 'messages' | 'tools' | 'onEvent'>;
|
|
171
|
-
|
|
172
|
-
const ChatThread = (props: ChatThreadProps) => {
|
|
173
|
-
const { debug, event, space, processor, messages } = useChatContext(ChatThread.displayName);
|
|
174
|
-
const identity = useIdentity();
|
|
175
|
-
|
|
176
|
-
const scrollerRef = useRef<ScrollController>(null);
|
|
177
|
-
useEffect(() => {
|
|
178
|
-
return event.on((event) => {
|
|
179
|
-
switch (event.type) {
|
|
180
|
-
case 'submit':
|
|
181
|
-
case 'scroll-to-bottom':
|
|
182
|
-
scrollerRef.current?.scrollToBottom('smooth');
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
}, [event]);
|
|
187
|
-
|
|
188
|
-
if (!identity) {
|
|
189
|
-
return null;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
return (
|
|
193
|
-
<NativeChatThread
|
|
194
|
-
{...props}
|
|
195
|
-
ref={scrollerRef}
|
|
196
|
-
debug={debug}
|
|
197
|
-
identity={identity}
|
|
198
|
-
space={space}
|
|
199
|
-
messages={messages}
|
|
200
|
-
tools={processor?.tools}
|
|
201
|
-
onEvent={(ev) => event.emit(ev)}
|
|
202
|
-
/>
|
|
203
|
-
);
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
ChatThread.displayName = 'Chat.Thread';
|
|
207
|
-
|
|
208
153
|
//
|
|
209
154
|
// Prompt
|
|
210
155
|
//
|
|
211
156
|
|
|
212
157
|
type ChatPromptProps = ThemedClassName<
|
|
213
|
-
|
|
158
|
+
{
|
|
159
|
+
outline?: boolean;
|
|
160
|
+
} & Pick<ChatEditorProps, 'placeholder'> &
|
|
214
161
|
Omit<ChatPresetsProps, 'onChange'> & {
|
|
215
162
|
expandable?: boolean;
|
|
216
163
|
online?: boolean;
|
|
217
|
-
|
|
218
|
-
|
|
164
|
+
onOnlineChange?: (online: boolean) => void;
|
|
165
|
+
onPresetChange?: ChatPresetsProps['onChange'];
|
|
219
166
|
}
|
|
220
167
|
>;
|
|
221
168
|
|
|
222
169
|
const ChatPrompt = ({
|
|
223
170
|
classNames,
|
|
171
|
+
outline,
|
|
224
172
|
placeholder,
|
|
225
173
|
expandable,
|
|
226
174
|
online,
|
|
227
175
|
presets,
|
|
228
176
|
preset,
|
|
229
|
-
|
|
230
|
-
|
|
177
|
+
onPresetChange,
|
|
178
|
+
onOnlineChange,
|
|
231
179
|
}: ChatPromptProps) => {
|
|
232
180
|
const { t } = useTranslation(meta.id);
|
|
233
181
|
const { space, event, processor } = useChatContext(ChatPrompt.displayName);
|
|
234
182
|
|
|
235
|
-
const
|
|
183
|
+
const error = useRxValue(processor.error).pipe(Option.getOrUndefined);
|
|
184
|
+
const streaming = useRxValue(processor.streaming);
|
|
185
|
+
const active = useRxValue(processor.active);
|
|
186
|
+
const activeRef = useDynamicRef(active);
|
|
187
|
+
|
|
188
|
+
const editorRef = useRef<ChatEditorController>(null);
|
|
189
|
+
const [recordingState, setRecordingState] = useState(false);
|
|
236
190
|
useEffect(() => {
|
|
237
191
|
return event.on((event) => {
|
|
238
192
|
switch (event.type) {
|
|
193
|
+
case 'update-prompt':
|
|
194
|
+
if (!editorRef.current?.getText()?.length) {
|
|
195
|
+
editorRef.current?.setText(event.text);
|
|
196
|
+
editorRef.current?.focus();
|
|
197
|
+
}
|
|
198
|
+
break;
|
|
239
199
|
case 'record-start':
|
|
240
|
-
|
|
200
|
+
setRecordingState(true);
|
|
241
201
|
break;
|
|
242
202
|
case 'record-stop':
|
|
243
|
-
|
|
203
|
+
setRecordingState(false);
|
|
244
204
|
break;
|
|
245
205
|
}
|
|
246
206
|
});
|
|
247
207
|
}, [event]);
|
|
248
208
|
|
|
249
|
-
const editorRef = useRef<ChatEditorController>(null);
|
|
250
|
-
|
|
251
209
|
// TODO(burdon): Configure capability in TranscriptionPlugin.
|
|
252
210
|
const { recording } = useVoiceInput({
|
|
253
|
-
active,
|
|
211
|
+
active: recordingState,
|
|
254
212
|
onUpdate: (text) => {
|
|
255
213
|
editorRef.current?.setText(text);
|
|
256
214
|
editorRef.current?.focus();
|
|
257
215
|
},
|
|
258
216
|
});
|
|
259
217
|
|
|
260
|
-
const [blueprints, handleUpdateBlueprints] = useBlueprints(space, processor.context, processor.blueprintRegistry);
|
|
261
|
-
|
|
262
218
|
// TODO(burdon): Reconcile with object tags.
|
|
263
|
-
const
|
|
219
|
+
const referencesProvider = useReferencesProvider(space);
|
|
264
220
|
const extensions = useMemo<Extension[]>(() => {
|
|
265
221
|
return [
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
222
|
+
referencesProvider && references({ provider: referencesProvider }),
|
|
223
|
+
Prec.highest(
|
|
224
|
+
keymap.of(
|
|
225
|
+
[
|
|
270
226
|
{
|
|
271
227
|
key: 'cmd-d',
|
|
272
228
|
preventDefault: true,
|
|
@@ -275,7 +231,7 @@ const ChatPrompt = ({
|
|
|
275
231
|
return true;
|
|
276
232
|
},
|
|
277
233
|
},
|
|
278
|
-
{
|
|
234
|
+
expandable && {
|
|
279
235
|
key: 'cmd-ArrowUp',
|
|
280
236
|
preventDefault: true,
|
|
281
237
|
run: () => {
|
|
@@ -283,7 +239,7 @@ const ChatPrompt = ({
|
|
|
283
239
|
return true;
|
|
284
240
|
},
|
|
285
241
|
},
|
|
286
|
-
{
|
|
242
|
+
expandable && {
|
|
287
243
|
key: 'cmd-ArrowDown',
|
|
288
244
|
preventDefault: true,
|
|
289
245
|
run: () => {
|
|
@@ -291,19 +247,20 @@ const ChatPrompt = ({
|
|
|
291
247
|
return true;
|
|
292
248
|
},
|
|
293
249
|
},
|
|
294
|
-
]),
|
|
250
|
+
].filter(isNotFalsy),
|
|
295
251
|
),
|
|
252
|
+
),
|
|
296
253
|
].filter(isNotFalsy);
|
|
297
|
-
}, [event, expandable,
|
|
254
|
+
}, [event, expandable, referencesProvider]);
|
|
298
255
|
|
|
299
256
|
const handleSubmit = useCallback<NonNullable<ChatEditorProps['onSubmit']>>(
|
|
300
257
|
(text) => {
|
|
301
|
-
if (!
|
|
258
|
+
if (!activeRef.current) {
|
|
302
259
|
event.emit({ type: 'submit', text });
|
|
303
260
|
return true;
|
|
304
261
|
}
|
|
305
262
|
},
|
|
306
|
-
[
|
|
263
|
+
[event],
|
|
307
264
|
);
|
|
308
265
|
|
|
309
266
|
const handleEvent = useCallback<NonNullable<ChatActionsProps['onEvent']>>(
|
|
@@ -313,76 +270,120 @@ const ChatPrompt = ({
|
|
|
313
270
|
[event],
|
|
314
271
|
);
|
|
315
272
|
|
|
316
|
-
// TODO(burdon): Update context.
|
|
317
|
-
const handleUpdateReferences = useCallback<NonNullable<ChatReferencesProps['onUpdate']>>((ids) => {
|
|
318
|
-
log.info('update', { ids });
|
|
319
|
-
}, []);
|
|
320
|
-
|
|
321
273
|
return (
|
|
322
274
|
<div
|
|
323
275
|
className={mx(
|
|
324
|
-
'is-full
|
|
276
|
+
'is-full flex flex-col density-fine',
|
|
277
|
+
outline && [
|
|
278
|
+
'p-2 bg-groupSurface border border-subduedSeparator transition transition-border [&:has(.cm-content:focus)]:border-separator rounded',
|
|
279
|
+
],
|
|
325
280
|
classNames,
|
|
326
281
|
)}
|
|
327
282
|
>
|
|
328
|
-
<
|
|
329
|
-
<ChatStatusIndicator preset={preset} error={
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
<div
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
<div className='grow' />
|
|
364
|
-
{presets && <ChatPresets preset={preset} presets={presets} onChange={onChangePreset} />}
|
|
283
|
+
<div className='flex gap-2'>
|
|
284
|
+
<ChatStatusIndicator classNames='p-1' preset={preset} error={error} processing={streaming} />
|
|
285
|
+
|
|
286
|
+
<ChatEditor
|
|
287
|
+
ref={editorRef}
|
|
288
|
+
autoFocus
|
|
289
|
+
lineWrapping
|
|
290
|
+
classNames='col-span-2 pbs-0.5'
|
|
291
|
+
placeholder={placeholder ?? t('prompt placeholder')}
|
|
292
|
+
extensions={extensions}
|
|
293
|
+
onSubmit={handleSubmit}
|
|
294
|
+
/>
|
|
295
|
+
</div>
|
|
296
|
+
|
|
297
|
+
<div className='flex pbs-2 items-center'>
|
|
298
|
+
<ChatOptions
|
|
299
|
+
space={space}
|
|
300
|
+
blueprintRegistry={processor.blueprintRegistry}
|
|
301
|
+
context={processor.context}
|
|
302
|
+
preset={preset}
|
|
303
|
+
presets={presets}
|
|
304
|
+
onPresetChange={onPresetChange}
|
|
305
|
+
/>
|
|
306
|
+
|
|
307
|
+
<div role='none' className='pli-cardSpacingChrome grow'>
|
|
308
|
+
<ChatReferences space={space} context={processor.context} />
|
|
309
|
+
</div>
|
|
310
|
+
|
|
311
|
+
<ChatActions
|
|
312
|
+
classNames='col-span-2'
|
|
313
|
+
microphone={true}
|
|
314
|
+
recording={recording}
|
|
315
|
+
processing={streaming}
|
|
316
|
+
onEvent={handleEvent}
|
|
317
|
+
>
|
|
365
318
|
{online !== undefined && (
|
|
366
319
|
<Input.Root>
|
|
367
|
-
<Input.Switch classNames='mis-2 mie-2' checked={online} onCheckedChange={
|
|
320
|
+
<Input.Switch classNames='mis-2 mie-2' checked={online} onCheckedChange={onOnlineChange} />
|
|
368
321
|
</Input.Root>
|
|
369
322
|
)}
|
|
370
|
-
|
|
371
|
-
</
|
|
323
|
+
</ChatActions>
|
|
324
|
+
</div>
|
|
372
325
|
</div>
|
|
373
326
|
);
|
|
374
327
|
};
|
|
375
328
|
|
|
376
329
|
ChatPrompt.displayName = 'Chat.Prompt';
|
|
377
330
|
|
|
331
|
+
//
|
|
332
|
+
// Thread
|
|
333
|
+
//
|
|
334
|
+
|
|
335
|
+
type ChatThreadProps = Omit<NaturalChatThreadProps, 'identity' | 'messages' | 'tools'>;
|
|
336
|
+
|
|
337
|
+
const ChatThread = (props: ChatThreadProps) => {
|
|
338
|
+
const { event, messages, processor } = useChatContext(ChatThread.displayName);
|
|
339
|
+
const identity = useIdentity();
|
|
340
|
+
const error = useRxValue(processor.error).pipe(Option.getOrUndefined);
|
|
341
|
+
|
|
342
|
+
const scrollerRef = useRef<ChatThreadController | null>(null);
|
|
343
|
+
useEffect(() => {
|
|
344
|
+
return event.on((event) => {
|
|
345
|
+
switch (event.type) {
|
|
346
|
+
case 'submit':
|
|
347
|
+
case 'scroll-to-bottom':
|
|
348
|
+
scrollerRef.current?.scrollToBottom();
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
}, [event]);
|
|
353
|
+
|
|
354
|
+
const handleEvent = useCallback<NonNullable<NaturalChatThreadProps['onEvent']>>(
|
|
355
|
+
(ev) => {
|
|
356
|
+
event.emit(ev);
|
|
357
|
+
},
|
|
358
|
+
[event],
|
|
359
|
+
);
|
|
360
|
+
|
|
361
|
+
if (!identity) {
|
|
362
|
+
return null;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
return (
|
|
366
|
+
<NaturalChatThread
|
|
367
|
+
{...props}
|
|
368
|
+
ref={scrollerRef}
|
|
369
|
+
identity={identity}
|
|
370
|
+
messages={messages}
|
|
371
|
+
error={error}
|
|
372
|
+
onEvent={handleEvent}
|
|
373
|
+
/>
|
|
374
|
+
);
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
ChatThread.displayName = 'Chat.Thread';
|
|
378
|
+
|
|
378
379
|
//
|
|
379
380
|
// Chat
|
|
380
381
|
//
|
|
381
382
|
|
|
382
383
|
export const Chat = {
|
|
383
384
|
Root: ChatRoot,
|
|
384
|
-
Thread: ChatThread,
|
|
385
385
|
Prompt: ChatPrompt,
|
|
386
|
+
Thread: ChatThread,
|
|
386
387
|
};
|
|
387
388
|
|
|
388
389
|
export type { ChatRootProps, ChatThreadProps, ChatPromptProps, ChatEvent };
|
|
@@ -19,6 +19,9 @@ export type ChatEvent =
|
|
|
19
19
|
type: 'submit';
|
|
20
20
|
text: string;
|
|
21
21
|
}
|
|
22
|
+
| {
|
|
23
|
+
type: 'retry';
|
|
24
|
+
}
|
|
22
25
|
| {
|
|
23
26
|
type: 'cancel';
|
|
24
27
|
}
|
|
@@ -33,6 +36,10 @@ export type ChatEvent =
|
|
|
33
36
|
//
|
|
34
37
|
// UX
|
|
35
38
|
//
|
|
39
|
+
| {
|
|
40
|
+
type: 'update-prompt';
|
|
41
|
+
text: string;
|
|
42
|
+
}
|
|
36
43
|
| {
|
|
37
44
|
type: 'scroll-to-bottom';
|
|
38
45
|
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Array, Effect, Option, pipe } from 'effect';
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, createIntent, useCapabilities, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
10
|
+
import { getSpace } from '@dxos/client/echo';
|
|
11
|
+
import { Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
12
|
+
import { DatabaseService } from '@dxos/functions';
|
|
13
|
+
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
14
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
15
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
16
|
+
|
|
17
|
+
import { ChatContainer } from '../components';
|
|
18
|
+
import { useContextBinder } from '../hooks';
|
|
19
|
+
import { Assistant, AssistantAction } from '../types';
|
|
20
|
+
|
|
21
|
+
export type ChatCompanionProps = {
|
|
22
|
+
role?: string;
|
|
23
|
+
data: { companionTo: Obj.Any; subject: Assistant.Chat | 'assistant-chat' };
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const ChatCompanion = ({ role, data }: ChatCompanionProps) => {
|
|
27
|
+
const companionTo = data.companionTo;
|
|
28
|
+
const space = getSpace(companionTo);
|
|
29
|
+
const chat = data.subject === 'assistant-chat' ? undefined : data.subject;
|
|
30
|
+
const binder = useContextBinder(chat);
|
|
31
|
+
const { dispatch } = useIntentDispatcher();
|
|
32
|
+
|
|
33
|
+
// Initialize companion chat if it doesn't exist.
|
|
34
|
+
useAsyncEffect(async () => {
|
|
35
|
+
if (chat || !space) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// TODO(burdon): Garbage collection of queues?
|
|
40
|
+
// TODO(wittjosiah): Figure out how to prevent companion chats from showing up in the navtree.
|
|
41
|
+
await Effect.gen(function* () {
|
|
42
|
+
const { objects } = yield* DatabaseService.runQuery(
|
|
43
|
+
Query.select(Filter.ids(companionTo.id)).targetOf(Assistant.CompanionTo).source(),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
// TODO(wittjosiah): This should be the default sort order.
|
|
47
|
+
let nextChat = objects.toSorted((a, b) => a.id.localeCompare(b.id)).at(-1);
|
|
48
|
+
if (!nextChat) {
|
|
49
|
+
const { object } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
50
|
+
nextChat = object;
|
|
51
|
+
yield* dispatch(createIntent(SpaceAction.AddObject, { object: nextChat, target: space, hidden: true }));
|
|
52
|
+
yield* dispatch(
|
|
53
|
+
createIntent(SpaceAction.AddRelation, {
|
|
54
|
+
space,
|
|
55
|
+
schema: Assistant.CompanionTo,
|
|
56
|
+
source: nextChat,
|
|
57
|
+
target: data.companionTo,
|
|
58
|
+
}),
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
yield* dispatch(createIntent(AssistantAction.SetCurrentChat, { companionTo, chat: nextChat }));
|
|
63
|
+
}).pipe(Effect.provide(DatabaseService.layer(space.db)), Effect.runPromise);
|
|
64
|
+
}, [space, chat, companionTo]);
|
|
65
|
+
|
|
66
|
+
const metadata = useCapabilities(Capabilities.Metadata);
|
|
67
|
+
const blueprintKeys = useMemo(
|
|
68
|
+
() =>
|
|
69
|
+
pipe(
|
|
70
|
+
metadata,
|
|
71
|
+
Array.findFirst(
|
|
72
|
+
(capability): capability is { id: string; metadata: { blueprints?: string[] } } =>
|
|
73
|
+
capability.id === Obj.getTypename(companionTo),
|
|
74
|
+
),
|
|
75
|
+
Option.flatMap((c) => Option.fromNullable(c.metadata.blueprints)),
|
|
76
|
+
Option.getOrElse(() => [] as string[]),
|
|
77
|
+
),
|
|
78
|
+
[metadata, companionTo],
|
|
79
|
+
);
|
|
80
|
+
const allBlueprints = useQuery(space, Filter.type(Blueprint.Blueprint));
|
|
81
|
+
const pluginBlueprints = useMemo(
|
|
82
|
+
() => allBlueprints.filter((blueprint) => blueprintKeys.includes(blueprint.key)),
|
|
83
|
+
[allBlueprints, blueprintKeys],
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
// TODO(wittjosiah): Occasionally this fails to bind but seems to be an upstream issue.
|
|
87
|
+
// It seems like the queue object signal emits as an empty array after previously emitting a non-empty array.
|
|
88
|
+
useAsyncEffect(async () => {
|
|
89
|
+
if (!binder) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (pluginBlueprints.length > 0) {
|
|
94
|
+
await binder.bind({ blueprints: pluginBlueprints.map((blueprint) => Ref.make(blueprint)) });
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (Obj.instanceOf(Blueprint.Blueprint, companionTo)) {
|
|
98
|
+
await binder.bind({ blueprints: [Ref.make(companionTo)] });
|
|
99
|
+
} else {
|
|
100
|
+
await binder.bind({ objects: [Ref.make(companionTo)] });
|
|
101
|
+
}
|
|
102
|
+
}, [binder, companionTo, pluginBlueprints]);
|
|
103
|
+
|
|
104
|
+
if (!chat) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return <ChatContainer role={role} chat={chat} companionTo={companionTo} />;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export default ChatCompanion;
|