@dxos/plugin-assistant 0.8.4-main.422d1c7879 → 0.8.4-main.4f23b4e393
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/neutral/AgentArticle-5XDDEXMP.mjs +169 -0
- package/dist/lib/neutral/AgentArticle-5XDDEXMP.mjs.map +7 -0
- package/dist/lib/neutral/AgentProperties-CNH4JMDZ.mjs +100 -0
- package/dist/lib/neutral/AgentProperties-CNH4JMDZ.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.mjs +99 -0
- package/dist/lib/neutral/AssistantPlugin.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs +46 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AssistantSettings-GG52BLKS.mjs +40 -0
- package/dist/lib/neutral/AssistantSettings-GG52BLKS.mjs.map +7 -0
- package/dist/lib/neutral/BlueprintArticle-U7LUBFOS.mjs +27 -0
- package/dist/lib/neutral/BlueprintArticle-U7LUBFOS.mjs.map +7 -0
- package/dist/lib/neutral/ChatCompanion-L33PFOFB.mjs +130 -0
- package/dist/lib/neutral/ChatCompanion-L33PFOFB.mjs.map +7 -0
- package/dist/lib/neutral/ChatContainer-VYVJYPPN.mjs +8 -0
- package/dist/lib/neutral/ChatDialog-QKZLG7SQ.mjs +72 -0
- package/dist/lib/neutral/ChatDialog-QKZLG7SQ.mjs.map +7 -0
- package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs +28 -0
- package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs.map +7 -0
- package/dist/lib/neutral/RoutineArticle-H7ECM7AH.mjs +116 -0
- package/dist/lib/neutral/RoutineArticle-H7ECM7AH.mjs.map +7 -0
- package/dist/lib/neutral/RoutineList-CLDXGQUD.mjs +48 -0
- package/dist/lib/neutral/RoutineList-CLDXGQUD.mjs.map +7 -0
- package/dist/lib/neutral/TracePanel-HYVPDIAA.mjs +565 -0
- package/dist/lib/neutral/TracePanel-HYVPDIAA.mjs.map +7 -0
- package/dist/lib/neutral/TriggerStatus-WTFYUIG5.mjs +92 -0
- package/dist/lib/neutral/TriggerStatus-WTFYUIG5.mjs.map +7 -0
- package/dist/lib/neutral/ai-service-GJXMI5OI.mjs +22 -0
- package/dist/lib/neutral/ai-service-GJXMI5OI.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-LHRT43KA.mjs +189 -0
- package/dist/lib/neutral/app-graph-builder-LHRT43KA.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-VXJYQ5AE.mjs +32 -0
- package/dist/lib/neutral/blueprint-definition-VXJYQ5AE.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/blueprints/index.mjs +1 -1
- package/dist/lib/neutral/capabilities/index.mjs +35 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4CQZCMRP.mjs +25 -0
- package/dist/lib/neutral/chunk-4CQZCMRP.mjs.map +7 -0
- package/dist/lib/{browser/chunk-EZRS3J25.mjs → neutral/chunk-5H6UJHLF.mjs} +3 -3
- package/dist/lib/neutral/chunk-5H6UJHLF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-A4SCD32D.mjs +106 -0
- package/dist/lib/neutral/chunk-A4SCD32D.mjs.map +7 -0
- package/dist/lib/neutral/chunk-OT2QDO3T.mjs +8 -0
- package/dist/lib/neutral/chunk-OT2QDO3T.mjs.map +7 -0
- package/dist/lib/neutral/chunk-VHPTYKYD.mjs +361 -0
- package/dist/lib/neutral/chunk-VHPTYKYD.mjs.map +7 -0
- package/dist/lib/neutral/companion-chat-provisioner-2Y6PRSDK.mjs +116 -0
- package/dist/lib/neutral/companion-chat-provisioner-2Y6PRSDK.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +2297 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +29 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/{browser/create-chat-LBZHGVSN.mjs → neutral/create-chat-5VM2UUWY.mjs} +8 -19
- package/dist/lib/neutral/create-chat-5VM2UUWY.mjs.map +7 -0
- package/dist/lib/neutral/create-object-UZCJCPWM.mjs +93 -0
- package/dist/lib/neutral/create-object-UZCJCPWM.mjs.map +7 -0
- package/dist/lib/neutral/edge-model-resolver-XDNBZ3US.mjs +21 -0
- package/dist/lib/neutral/edge-model-resolver-XDNBZ3US.mjs.map +7 -0
- package/dist/lib/{browser/ensure-companion-chat-ZEZA34MZ.mjs → neutral/ensure-companion-chat-5S4LZM2H.mjs} +10 -17
- package/dist/lib/neutral/ensure-companion-chat-5S4LZM2H.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +930 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +32 -0
- package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs +24 -0
- package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs.map +7 -0
- package/dist/lib/neutral/markdown-KTBFOMFM.mjs +110 -0
- package/dist/lib/neutral/markdown-KTBFOMFM.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +12 -0
- package/dist/lib/neutral/migrations-7DEMVBOG.mjs +28 -0
- package/dist/lib/neutral/migrations-7DEMVBOG.mjs.map +7 -0
- package/dist/lib/{browser/on-create-space-54RNX5JI.mjs → neutral/on-create-space-Q2R7OSP6.mjs} +5 -8
- package/dist/lib/neutral/on-create-space-Q2R7OSP6.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-SF36MOB5.mjs +13 -0
- package/dist/lib/neutral/operation-handler-SF36MOB5.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-2WAPE25I.mjs +174 -0
- package/dist/lib/neutral/react-surface-2WAPE25I.mjs.map +7 -0
- package/dist/lib/{browser/resolve-navigation-targets-NZOD66NY.mjs → neutral/resolve-navigation-targets-VXBSWV5L.mjs} +4 -6
- package/dist/lib/neutral/resolve-navigation-targets-VXBSWV5L.mjs.map +7 -0
- package/dist/lib/{browser/run-prompt-in-new-chat-THLK5YQC.mjs → neutral/run-prompt-in-new-chat-XEPT5MOM.mjs} +14 -50
- package/dist/lib/neutral/run-prompt-in-new-chat-XEPT5MOM.mjs.map +7 -0
- package/dist/lib/{browser/set-current-chat-LRS3VFSH.mjs → neutral/set-current-chat-ZFDCYK5I.mjs} +5 -11
- package/dist/lib/neutral/set-current-chat-ZFDCYK5I.mjs.map +7 -0
- package/dist/lib/neutral/settings-W4BLWQ53.mjs +28 -0
- package/dist/lib/neutral/settings-W4BLWQ53.mjs.map +7 -0
- package/dist/lib/neutral/state-H3G7QCU6.mjs +28 -0
- package/dist/lib/neutral/state-H3G7QCU6.mjs.map +7 -0
- package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs +14 -0
- package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +174 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +20 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/{browser/update-chat-name-3Y36KFAS.mjs → neutral/update-chat-name-ENXRUMDJ.mjs} +8 -25
- package/dist/lib/neutral/update-chat-name-ENXRUMDJ.mjs.map +7 -0
- package/dist/types/src/AssistantPlugin.d.ts +1 -0
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/AssistantPlugin.node.d.ts +4 -0
- package/dist/types/src/AssistantPlugin.node.d.ts.map +1 -0
- package/dist/types/src/AssistantPlugin.test.d.ts +2 -0
- package/dist/types/src/AssistantPlugin.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +31 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +27 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +2 -1
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +36 -40
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/context.d.ts +29 -0
- package/dist/types/src/components/Chat/context.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts +12 -0
- package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +7 -5
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts +28 -0
- package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +2 -2
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +3 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Anchor.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +6 -3
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +5 -5
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts +18 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +4 -4
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +2 -15
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/defaults.d.ts +5 -0
- package/dist/types/src/components/ChatThread/widgets/defaults.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts +1 -2
- package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +2 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +0 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/TaskList/TaskList.d.ts +10 -0
- package/dist/types/src/components/TaskList/TaskList.d.ts.map +1 -0
- package/dist/types/src/components/TaskList/TaskList.stories.d.ts +16 -0
- package/dist/types/src/components/TaskList/TaskList.stories.d.ts.map +1 -0
- package/dist/types/src/components/TaskList/index.d.ts +2 -0
- package/dist/types/src/components/TaskList/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -2
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +4 -5
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +4 -4
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +3 -3
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -1
- package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts.map +1 -1
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +1 -1
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +1 -1
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts +6 -0
- package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PlanArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PlanArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +6 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts +15 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/index.d.ts +2 -0
- package/dist/types/src/containers/RoutineArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineList/RoutineList.d.ts +6 -0
- package/dist/types/src/containers/RoutineList/RoutineList.d.ts.map +1 -0
- package/dist/types/src/containers/{PromptList/PromptList.stories.d.ts → RoutineList/RoutineList.stories.d.ts} +1 -1
- package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineList/index.d.ts +2 -0
- package/dist/types/src/containers/RoutineList/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts +3 -2
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +1 -4
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +1 -1
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts +81 -1
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts +2 -0
- package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/testing/index.d.ts +3 -0
- package/dist/types/src/containers/TracePanel/testing/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts +14 -0
- package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts +12 -0
- package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +5 -4
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -1
- package/dist/types/src/feed-logger.d.ts +13 -0
- package/dist/types/src/feed-logger.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +4 -4
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatKeymap.d.ts +12 -0
- package/dist/types/src/hooks/useChatKeymap.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +2 -2
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextBinder.d.ts +2 -2
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts +2 -2
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useDebug.d.ts +10 -0
- package/dist/types/src/hooks/useDebug.d.ts.map +1 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
- package/dist/types/src/hooks/useFlush.d.ts +1 -1
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -1
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +3 -3
- package/dist/types/src/operations/create-chat.d.ts.map +1 -1
- package/dist/types/src/operations/ensure-companion-chat.d.ts +3 -3
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -2
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/on-create-space.d.ts +3 -3
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
- package/dist/types/src/operations/resolve-navigation-targets.d.ts +1 -1
- package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -1
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +3 -3
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -1
- package/dist/types/src/operations/set-current-chat.d.ts +3 -3
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -1
- package/dist/types/src/operations/update-chat-name.d.ts +3 -3
- package/dist/types/src/operations/update-chat-name.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +30 -12
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +2 -3
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-sequence.d.ts +3 -3
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/testing/test-trace.d.ts +5 -0
- package/dist/types/src/testing/test-trace.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +22 -6
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantCapabilities.d.ts +30 -0
- package/dist/types/src/types/AssistantCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/AssistantEvents.d.ts +3 -0
- package/dist/types/src/types/AssistantEvents.d.ts.map +1 -0
- package/dist/types/src/{operations/definitions.d.ts → types/AssistantOperation.d.ts} +27 -20
- package/dist/types/src/types/AssistantOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +20 -5
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +3 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +1 -1
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +156 -117
- package/src/AssistantPlugin.node.ts +44 -0
- package/src/AssistantPlugin.test.ts +35 -0
- package/src/AssistantPlugin.ts +126 -0
- package/src/blueprints/assistant/blueprint.test.ts +3 -3
- package/src/blueprints/assistant/blueprint.ts +4 -4
- package/src/capabilities/app-graph-builder.ts +42 -12
- package/src/capabilities/blueprint-definition.ts +2 -4
- package/src/capabilities/companion-chat-provisioner.ts +4 -5
- package/src/capabilities/create-object.ts +107 -0
- package/src/capabilities/index.ts +3 -1
- package/src/capabilities/markdown.ts +1 -1
- package/src/capabilities/migrations.ts +4 -11
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +28 -14
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +3 -2
- package/src/components/AssistantSettings/AssistantSettings.tsx +22 -111
- package/src/components/Chat/Chat.tsx +85 -259
- package/src/components/Chat/context.ts +39 -0
- package/src/components/ChatPrompt/ChatActions.tsx +10 -10
- package/src/components/ChatPrompt/ChatMcpErrors.tsx +50 -0
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +28 -14
- package/src/components/ChatPrompt/ChatOptions.tsx +100 -60
- package/src/components/ChatPrompt/ChatPrompt.tsx +182 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +4 -4
- package/src/components/ChatPrompt/ChatStatus.tsx +123 -0
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatPrompt/index.ts +3 -0
- package/src/components/ChatThread/Anchor.stories.tsx +3 -3
- package/src/components/ChatThread/ChatThread.stories.tsx +27 -30
- package/src/components/ChatThread/ChatThread.tsx +31 -18
- package/src/components/ChatThread/DEBUG.md +41 -0
- package/src/components/ChatThread/MarkdownStream.stories.tsx +5 -4
- package/src/components/ChatThread/registry.tsx +61 -18
- package/src/components/ChatThread/sync.test.ts +84 -18
- package/src/components/ChatThread/sync.ts +1 -1
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +7 -7
- package/src/components/ChatThread/widgets/ReferenceWidget.ts +3 -1
- package/src/components/ChatThread/widgets/SelectWidget.ts +3 -1
- package/src/components/ChatThread/widgets/StatsWidget.ts +3 -1
- package/src/components/ChatThread/widgets/StatusWidget.ts +5 -83
- package/src/components/ChatThread/widgets/SuggestionWidget.ts +1 -1
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +3 -4
- package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +2 -1
- package/src/components/ChatThread/widgets/defaults.ts +8 -0
- package/src/components/ChatThread/widgets/index.ts +1 -2
- package/src/components/ProcessTree/ProcessTree.stories.tsx +12 -38
- package/src/components/ProcessTree/ProcessTree.tsx +69 -36
- package/src/components/TaskList/TaskList.stories.tsx +44 -0
- package/src/components/TaskList/TaskList.tsx +45 -0
- package/src/{cli → components/TaskList}/index.ts +1 -1
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +4 -3
- package/src/components/TemplateEditor/TemplateEditor.tsx +5 -5
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +6 -9
- package/src/components/TemplateEditor/TemplateForm.tsx +51 -72
- package/src/components/Toolbox/Toolbox.stories.tsx +6 -5
- package/src/components/Toolbox/Toolbox.tsx +4 -4
- package/src/components/index.ts +1 -0
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +8 -8
- package/src/containers/AgentArticle/AgentArticle.tsx +12 -8
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +6 -5
- package/src/containers/AgentProperties/AgentProperties.tsx +6 -6
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +1 -1
- package/src/containers/ChatCompanion/ChatCompanion.tsx +13 -26
- package/src/containers/ChatContainer/ChatContainer.tsx +20 -8
- package/src/containers/ChatDialog/ChatDialog.tsx +3 -9
- package/src/containers/PlanArticle/PlanArticle.tsx +33 -0
- package/src/containers/PlanArticle/index.ts +5 -0
- package/src/containers/RoutineArticle/RoutineArticle.stories.tsx +75 -0
- package/src/containers/RoutineArticle/RoutineArticle.tsx +109 -0
- package/src/containers/RoutineArticle/index.ts +5 -0
- package/src/containers/{PromptList/PromptList.stories.tsx → RoutineList/RoutineList.stories.tsx} +13 -12
- package/src/containers/{PromptList/PromptList.tsx → RoutineList/RoutineList.tsx} +8 -7
- package/src/containers/RoutineList/index.ts +5 -0
- package/src/containers/TracePanel/TracePanel.stories.tsx +215 -202
- package/src/containers/TracePanel/TracePanel.tsx +101 -47
- package/src/containers/TracePanel/dxn-extractor.test.ts +7 -7
- package/src/containers/TracePanel/dxn-extractor.ts +11 -11
- package/src/containers/TracePanel/execution-graph.test.ts +382 -0
- package/src/containers/TracePanel/execution-graph.ts +380 -211
- package/src/containers/TracePanel/testing/index.ts +6 -0
- package/src/containers/TracePanel/testing/simulated-agent.ts +114 -0
- package/src/containers/TracePanel/testing/snapshot-playback.ts +45 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +1 -1
- package/src/containers/index.ts +5 -4
- package/src/{queue-logger.ts → feed-logger.ts} +38 -28
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useBlueprintRegistry.ts +4 -4
- package/src/hooks/useChatKeymap.ts +52 -0
- package/src/hooks/useChatProcessor.ts +4 -4
- package/src/hooks/useChatServices.ts +1 -1
- package/src/hooks/useChatToolbarActions.ts +1 -1
- package/src/hooks/useContextBinder.ts +4 -4
- package/src/hooks/useContextObjects.ts +2 -2
- package/src/hooks/useDebug.ts +38 -0
- package/src/index.ts +0 -5
- package/src/operations/create-chat.ts +7 -9
- package/src/operations/ensure-companion-chat.ts +49 -47
- package/src/operations/index.ts +1 -3
- package/src/operations/on-create-space.ts +4 -4
- package/src/operations/prompt.test.ts +9 -11
- package/src/operations/resolve-navigation-targets.ts +3 -3
- package/src/operations/run-prompt-in-new-chat.ts +85 -86
- package/src/operations/set-current-chat.ts +4 -5
- package/src/operations/update-chat-name.ts +4 -4
- package/src/plugin.ts +11 -0
- package/src/processor/processor.test.ts +2 -2
- package/src/processor/processor.ts +49 -18
- package/src/testing/data/trace-timeline.dx.json +3737 -1200
- package/src/testing/index.ts +1 -0
- package/src/testing/test-generator.test.ts +41 -52
- package/src/testing/test-generator.ts +177 -192
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-trace.ts +20 -0
- package/src/testing/trace-timeline.conversations.json +1 -1
- package/src/testing/trace-timeline.test.ts +53 -49
- package/src/translations.ts +29 -33
- package/src/types/Assistant.ts +13 -1
- package/src/types/AssistantCapabilities.ts +35 -0
- package/src/types/AssistantEvents.ts +11 -0
- package/src/{operations/definitions.ts → types/AssistantOperation.ts} +5 -4
- package/src/types/Settings.ts +62 -7
- package/src/types/index.ts +5 -3
- package/src/types/service.ts +1 -1
- package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs +0 -97
- package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs.map +0 -7
- package/dist/lib/browser/chunk-ATHYBVGN.mjs +0 -176
- package/dist/lib/browser/chunk-ATHYBVGN.mjs.map +0 -7
- package/dist/lib/browser/chunk-EZRS3J25.mjs.map +0 -7
- package/dist/lib/browser/chunk-LMVTXH54.mjs +0 -154
- package/dist/lib/browser/chunk-LMVTXH54.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs +0 -74
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/create-chat-LBZHGVSN.mjs.map +0 -7
- package/dist/lib/browser/ensure-companion-chat-ZEZA34MZ.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -3446
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/on-create-space-54RNX5JI.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -13
- package/dist/lib/browser/operations/index.mjs.map +0 -7
- package/dist/lib/browser/resolve-navigation-targets-NZOD66NY.mjs.map +0 -7
- package/dist/lib/browser/run-prompt-in-new-chat-THLK5YQC.mjs.map +0 -7
- package/dist/lib/browser/set-current-chat-LRS3VFSH.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -20
- package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs.map +0 -7
- package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs +0 -98
- package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -9
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs +0 -32
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs +0 -177
- package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-W3JZ2F4T.mjs +0 -155
- package/dist/lib/node-esm/chunk-W3JZ2F4T.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -75
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs +0 -83
- package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs.map +0 -7
- package/dist/lib/node-esm/ensure-companion-chat-6K2WEWFP.mjs +0 -66
- package/dist/lib/node-esm/ensure-companion-chat-6K2WEWFP.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -3447
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs +0 -23
- package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -14
- package/dist/lib/node-esm/operations/index.mjs.map +0 -7
- package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs +0 -23
- package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs.map +0 -7
- package/dist/lib/node-esm/run-prompt-in-new-chat-OUYKCMQ7.mjs +0 -137
- package/dist/lib/node-esm/run-prompt-in-new-chat-OUYKCMQ7.mjs.map +0 -7
- package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs +0 -55
- package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -21
- package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs +0 -72
- package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs.map +0 -7
- package/dist/types/src/cli/index.d.ts +0 -2
- package/dist/types/src/cli/index.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts +0 -10
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +0 -10
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +0 -1
- package/dist/types/src/components/ChatProgress/index.d.ts +0 -2
- package/dist/types/src/components/ChatProgress/index.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts +0 -15
- package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts.map +0 -1
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +0 -6
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +0 -1
- package/dist/types/src/containers/PromptArticle/index.d.ts +0 -2
- package/dist/types/src/containers/PromptArticle/index.d.ts.map +0 -1
- package/dist/types/src/containers/PromptList/PromptList.d.ts +0 -6
- package/dist/types/src/containers/PromptList/PromptList.d.ts.map +0 -1
- package/dist/types/src/containers/PromptList/PromptList.stories.d.ts.map +0 -1
- package/dist/types/src/containers/PromptList/index.d.ts +0 -2
- package/dist/types/src/containers/PromptList/index.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/dist/types/src/queue-logger.d.ts +0 -11
- package/dist/types/src/queue-logger.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -32
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/defs.d.ts +0 -2
- package/dist/types/src/types/defs.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -5
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/AssistantPlugin.tsx +0 -238
- package/src/cli/plugin.ts +0 -84
- package/src/components/ChatProgress/ChatProgress.tsx +0 -56
- package/src/components/ChatProgress/index.ts +0 -5
- package/src/components/ChatThread/widgets/PromptWidget.ts +0 -30
- package/src/containers/PromptArticle/PromptArticle.tsx +0 -59
- package/src/containers/PromptArticle/index.ts +0 -5
- package/src/containers/PromptList/index.ts +0 -5
- package/src/types/capabilities.ts +0 -35
- package/src/types/defs.ts +0 -5
- package/src/types/events.ts +0 -11
- /package/dist/lib/{browser/blueprints/index.mjs.map → neutral/ChatContainer-VYVJYPPN.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{node-esm/blueprints → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
|
@@ -2,59 +2,34 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Extension, Prec } from '@codemirror/state';
|
|
6
|
-
import { keymap } from '@codemirror/view';
|
|
7
5
|
import { useAtomValue } from '@effect-atom/atom-react';
|
|
8
|
-
import { createContext } from '@radix-ui/react-context';
|
|
9
6
|
import * as Array from 'effect/Array';
|
|
10
7
|
import * as Option from 'effect/Option';
|
|
11
8
|
import React, { type PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
12
9
|
|
|
13
|
-
import {
|
|
10
|
+
import { Agent, Plan } from '@dxos/assistant-toolkit';
|
|
14
11
|
import { Event } from '@dxos/async';
|
|
15
|
-
import { type
|
|
16
|
-
import {
|
|
17
|
-
import { type Queue, useQuery } from '@dxos/react-client/echo';
|
|
12
|
+
import { type Feed, Filter, Obj, Query } from '@dxos/echo';
|
|
13
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
18
14
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
19
|
-
import {
|
|
20
|
-
import { ChatEditor, type ChatEditorController, type ChatEditorProps } from '@dxos/react-ui-chat';
|
|
21
|
-
import { type MarkdownStreamController } from '@dxos/react-ui-components';
|
|
15
|
+
import { type MarkdownStreamController } from '@dxos/react-ui-markdown';
|
|
22
16
|
import { Menu, MenuRootProps } from '@dxos/react-ui-menu';
|
|
23
17
|
import { Message } from '@dxos/types';
|
|
24
|
-
import { composable, composableProps
|
|
25
|
-
import { isTruthy, trim } from '@dxos/util';
|
|
18
|
+
import { composable, composableProps } from '@dxos/ui-theme';
|
|
26
19
|
|
|
27
|
-
import { useChatToolbarActions } from '#hooks';
|
|
28
|
-
import { meta } from '#meta';
|
|
20
|
+
import { useChatKeymapExtensions, useChatToolbarActions, useDebug } from '#hooks';
|
|
29
21
|
|
|
30
|
-
import { type AiChatProcessor } from '../../processor';
|
|
31
22
|
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
type ChatPresetsProps,
|
|
36
|
-
ChatReferences,
|
|
37
|
-
ChatStatusIndicator,
|
|
23
|
+
ChatStatus,
|
|
24
|
+
ChatPrompt as NaturalChatPrompt,
|
|
25
|
+
type ChatPromptProps as NaturalChatPromptProps,
|
|
38
26
|
} from '../ChatPrompt';
|
|
39
27
|
import { ChatThread as NaturalChatThread, type ChatThreadProps as NaturalChatThreadProps } from '../ChatThread';
|
|
28
|
+
import { TaskList } from '../TaskList';
|
|
29
|
+
import { ChatContextProvider, type ChatContextValue, type ChatRequestTiming, useChatContext } from './context';
|
|
40
30
|
import { type ChatEvent } from './events';
|
|
41
31
|
|
|
42
|
-
|
|
43
|
-
// Context
|
|
44
|
-
// NOTE: The context should not be exported. It is only used internally.
|
|
45
|
-
// Components outside of this Radix-style group shuld define their own APIs.
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
type ChatContextValue = {
|
|
49
|
-
debug?: boolean;
|
|
50
|
-
event: Event<ChatEvent>;
|
|
51
|
-
db?: Database.Database;
|
|
52
|
-
chat?: ChatModule.Chat;
|
|
53
|
-
messages: Message.Message[];
|
|
54
|
-
processor: AiChatProcessor;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const [ChatContextProvider, useChatContext] = createContext<ChatContextValue>('Chat');
|
|
32
|
+
export { useChatContext };
|
|
58
33
|
|
|
59
34
|
//
|
|
60
35
|
// Root
|
|
@@ -62,49 +37,31 @@ export const [ChatContextProvider, useChatContext] = createContext<ChatContextVa
|
|
|
62
37
|
|
|
63
38
|
type ChatRootProps = PropsWithChildren<
|
|
64
39
|
Pick<ChatContextValue, 'db' | 'chat' | 'processor'> & {
|
|
65
|
-
|
|
40
|
+
feed?: Feed.Feed;
|
|
66
41
|
onEvent?: (event: ChatEvent) => void;
|
|
67
42
|
}
|
|
68
43
|
>;
|
|
69
44
|
|
|
70
|
-
const ChatRoot = ({ children, chat,
|
|
45
|
+
const ChatRoot = ({ children, chat, feed, processor, onEvent, ...props }: ChatRootProps) => {
|
|
71
46
|
const [debug, setDebug] = useState(false);
|
|
72
|
-
const pending = useAtomValue(processor.messages);
|
|
73
47
|
const streaming = useAtomValue(processor.streaming);
|
|
48
|
+
const active = useAtomValue(processor.active);
|
|
49
|
+
const requestTiming = useRequestTiming({ active });
|
|
74
50
|
const lastPrompt = useRef<string | undefined>(undefined);
|
|
51
|
+
const db = props.db ?? (chat && Obj.getDatabase(chat));
|
|
52
|
+
|
|
53
|
+
const feedMessages = useQuery(
|
|
54
|
+
db,
|
|
55
|
+
feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),
|
|
56
|
+
);
|
|
57
|
+
const pendingMessages = useAtomValue(processor.messages);
|
|
58
|
+
const messages = useMemo(
|
|
59
|
+
() => Array.dedupeWith([...feedMessages, ...pendingMessages], ({ id: a }, { id: b }) => a === b),
|
|
60
|
+
[feedMessages, pendingMessages],
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const dump = useDebug({ processor });
|
|
75
64
|
|
|
76
|
-
// Messages.
|
|
77
|
-
const storedMessages = useQuery(queue, Filter.type(Message.Message));
|
|
78
|
-
const messages = useMemo(() => {
|
|
79
|
-
return Array.dedupeWith([...storedMessages, ...pending], ({ id: a }, { id: b }) => a === b);
|
|
80
|
-
}, [storedMessages, pending]);
|
|
81
|
-
|
|
82
|
-
// Debug.
|
|
83
|
-
const dump = useCallback(async () => {
|
|
84
|
-
const objects = processor.context.getObjects();
|
|
85
|
-
const blueprints = processor.context.getBlueprints();
|
|
86
|
-
const system = await processor.getSystemPrompt();
|
|
87
|
-
const tools = await processor.getTools();
|
|
88
|
-
|
|
89
|
-
// eslint-disable-next-line no-console
|
|
90
|
-
// eslint-disable-next-line no-console
|
|
91
|
-
console.group('Chat', { objects, blueprints });
|
|
92
|
-
// eslint-disable-next-line no-console
|
|
93
|
-
console.log(trim`
|
|
94
|
-
System Prompt:
|
|
95
|
-
${system}
|
|
96
|
-
`);
|
|
97
|
-
// eslint-disable-next-line no-console
|
|
98
|
-
console.log(trim`
|
|
99
|
-
Tools:
|
|
100
|
-
${Object.values(tools)
|
|
101
|
-
.map((tool) => JSON.stringify(tool, null, 2))
|
|
102
|
-
.join('\n')}
|
|
103
|
-
`);
|
|
104
|
-
console.groupEnd();
|
|
105
|
-
}, [processor]);
|
|
106
|
-
|
|
107
|
-
// Events.
|
|
108
65
|
const event = useMemo(() => new Event<ChatEvent>(), []);
|
|
109
66
|
useEffect(() => {
|
|
110
67
|
return event.on((ev) => {
|
|
@@ -152,8 +109,6 @@ const ChatRoot = ({ children, chat, queue, processor, onEvent, ...props }: ChatR
|
|
|
152
109
|
});
|
|
153
110
|
}, [event, dump, processor, streaming, onEvent]);
|
|
154
111
|
|
|
155
|
-
const db = props.db ?? (chat && Obj.getDatabase(chat));
|
|
156
|
-
|
|
157
112
|
return (
|
|
158
113
|
<ChatContextProvider
|
|
159
114
|
debug={debug}
|
|
@@ -162,6 +117,7 @@ const ChatRoot = ({ children, chat, queue, processor, onEvent, ...props }: ChatR
|
|
|
162
117
|
chat={chat}
|
|
163
118
|
messages={messages}
|
|
164
119
|
processor={processor}
|
|
120
|
+
requestTiming={requestTiming}
|
|
165
121
|
{...props}
|
|
166
122
|
>
|
|
167
123
|
{children}
|
|
@@ -171,6 +127,19 @@ const ChatRoot = ({ children, chat, queue, processor, onEvent, ...props }: ChatR
|
|
|
171
127
|
|
|
172
128
|
ChatRoot.displayName = 'Chat.Root';
|
|
173
129
|
|
|
130
|
+
const useRequestTiming = ({ active }: { active: boolean }) => {
|
|
131
|
+
const [requestTiming, setRequestTiming] = useState<ChatRequestTiming | null>(null);
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
if (active) {
|
|
134
|
+
setRequestTiming({ startedAt: Date.now(), endedAt: null });
|
|
135
|
+
} else {
|
|
136
|
+
setRequestTiming((prev) => (prev && prev.endedAt == null ? { ...prev, endedAt: Date.now() } : prev));
|
|
137
|
+
}
|
|
138
|
+
}, [active]);
|
|
139
|
+
|
|
140
|
+
return requestTiming;
|
|
141
|
+
};
|
|
142
|
+
|
|
174
143
|
//
|
|
175
144
|
// Toolbar
|
|
176
145
|
//
|
|
@@ -197,14 +166,14 @@ const ChatToolbar = composable<HTMLDivElement, ChatToolbarProps>(
|
|
|
197
166
|
ChatToolbar.displayName = CHAT_TOOLBAR_NAME;
|
|
198
167
|
|
|
199
168
|
//
|
|
200
|
-
//
|
|
169
|
+
// Content
|
|
201
170
|
//
|
|
202
171
|
|
|
203
|
-
const
|
|
172
|
+
const CHAT_CONTENT_NAME = 'Chat.Content';
|
|
204
173
|
|
|
205
|
-
type
|
|
174
|
+
type ChatContentProps = {};
|
|
206
175
|
|
|
207
|
-
const
|
|
176
|
+
const ChatContent = composable<HTMLDivElement, ChatContentProps>(({ children, ...props }, forwardedRef) => {
|
|
208
177
|
return (
|
|
209
178
|
<div {...composableProps(props, { classNames: 'dx-expander flex flex-col' })} ref={forwardedRef}>
|
|
210
179
|
{children}
|
|
@@ -212,7 +181,7 @@ const ChatViewport = composable<HTMLDivElement, ChatViewportProps>(({ children,
|
|
|
212
181
|
);
|
|
213
182
|
});
|
|
214
183
|
|
|
215
|
-
|
|
184
|
+
ChatContent.displayName = CHAT_CONTENT_NAME;
|
|
216
185
|
|
|
217
186
|
//
|
|
218
187
|
// Thread
|
|
@@ -222,10 +191,12 @@ const CHAT_THREAD_NAME = 'Chat.Thread';
|
|
|
222
191
|
|
|
223
192
|
type ChatThreadProps = Omit<NaturalChatThreadProps, 'identity' | 'messages' | 'tools'>;
|
|
224
193
|
|
|
225
|
-
const ChatThread = (props: ChatThreadProps) => {
|
|
194
|
+
const ChatThread = ({ viewType, debug: debugProp, ...props }: ChatThreadProps) => {
|
|
226
195
|
const { debug, event, messages, processor } = useChatContext(CHAT_THREAD_NAME);
|
|
196
|
+
const debugView = viewType === 'debug';
|
|
227
197
|
const identity = useIdentity();
|
|
228
198
|
const error = useAtomValue(processor.error).pipe(Option.getOrUndefined);
|
|
199
|
+
const extensions = useChatKeymapExtensions({ event });
|
|
229
200
|
|
|
230
201
|
const controllerRef = useRef<MarkdownStreamController | null>(null);
|
|
231
202
|
useEffect(() => {
|
|
@@ -253,7 +224,7 @@ const ChatThread = (props: ChatThreadProps) => {
|
|
|
253
224
|
);
|
|
254
225
|
|
|
255
226
|
if (!identity) {
|
|
256
|
-
return
|
|
227
|
+
return <div className='dx-expander' />;
|
|
257
228
|
}
|
|
258
229
|
|
|
259
230
|
return (
|
|
@@ -262,7 +233,9 @@ const ChatThread = (props: ChatThreadProps) => {
|
|
|
262
233
|
identity={identity}
|
|
263
234
|
messages={messages}
|
|
264
235
|
error={error}
|
|
265
|
-
debug={debug}
|
|
236
|
+
debug={debugProp ?? (debug || debugView)}
|
|
237
|
+
viewType={viewType}
|
|
238
|
+
extensions={extensions}
|
|
266
239
|
onEvent={handleEvent}
|
|
267
240
|
ref={controllerRef}
|
|
268
241
|
/>
|
|
@@ -277,187 +250,38 @@ ChatThread.displayName = CHAT_THREAD_NAME;
|
|
|
277
250
|
|
|
278
251
|
const CHAT_PROMPT_NAME = 'Chat.Prompt';
|
|
279
252
|
|
|
280
|
-
type ChatPromptProps =
|
|
281
|
-
{
|
|
282
|
-
outline?: boolean;
|
|
283
|
-
settings?: boolean;
|
|
284
|
-
} & Pick<ChatEditorProps, 'placeholder'> &
|
|
285
|
-
Omit<ChatPresetsProps, 'onChange'> & {
|
|
286
|
-
expandable?: boolean;
|
|
287
|
-
online?: boolean;
|
|
288
|
-
onOnlineChange?: (online: boolean) => void;
|
|
289
|
-
onPresetChange?: ChatPresetsProps['onChange'];
|
|
290
|
-
}
|
|
291
|
-
>;
|
|
253
|
+
type ChatPromptProps = Omit<NaturalChatPromptProps, 'chat' | 'db' | 'processor' | 'event'>;
|
|
292
254
|
|
|
293
|
-
const ChatPrompt = ({
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
placeholder,
|
|
298
|
-
expandable,
|
|
299
|
-
online,
|
|
300
|
-
presets,
|
|
301
|
-
preset,
|
|
302
|
-
onPresetChange,
|
|
303
|
-
onOnlineChange,
|
|
304
|
-
}: ChatPromptProps) => {
|
|
305
|
-
const { t } = useTranslation(meta.id);
|
|
306
|
-
const { db, processor, event } = useChatContext(CHAT_PROMPT_NAME);
|
|
307
|
-
|
|
308
|
-
const error = useAtomValue(processor.error).pipe(Option.getOrUndefined);
|
|
309
|
-
const streaming = useAtomValue(processor.streaming);
|
|
310
|
-
const active = useAtomValue(processor.active);
|
|
311
|
-
const activeRef = useDynamicRef(active);
|
|
255
|
+
const ChatPrompt = (props: ChatPromptProps) => {
|
|
256
|
+
const { chat, db, processor, event } = useChatContext(CHAT_PROMPT_NAME);
|
|
257
|
+
return <NaturalChatPrompt {...props} chat={chat} db={db} processor={processor} event={event} />;
|
|
258
|
+
};
|
|
312
259
|
|
|
313
|
-
|
|
314
|
-
const [recordingState, setRecordingState] = useState(false);
|
|
315
|
-
useEffect(() => {
|
|
316
|
-
return event.on((event) => {
|
|
317
|
-
switch (event.type) {
|
|
318
|
-
case 'update-prompt':
|
|
319
|
-
if (!editorRef.current?.getText()?.length) {
|
|
320
|
-
editorRef.current?.setText(event.text);
|
|
321
|
-
editorRef.current?.focus();
|
|
322
|
-
}
|
|
323
|
-
break;
|
|
324
|
-
case 'record-start':
|
|
325
|
-
setRecordingState(true);
|
|
326
|
-
break;
|
|
327
|
-
case 'record-stop':
|
|
328
|
-
setRecordingState(false);
|
|
329
|
-
break;
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
}, [event]);
|
|
260
|
+
ChatPrompt.displayName = CHAT_PROMPT_NAME;
|
|
333
261
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
onUpdate: (text) => {
|
|
338
|
-
editorRef.current?.setText(text);
|
|
339
|
-
editorRef.current?.focus();
|
|
340
|
-
},
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
const extensions = useMemo<Extension[]>(() => {
|
|
344
|
-
return [
|
|
345
|
-
Prec.highest(
|
|
346
|
-
keymap.of([
|
|
347
|
-
{
|
|
348
|
-
key: 'Mod-d',
|
|
349
|
-
preventDefault: true,
|
|
350
|
-
run: () => {
|
|
351
|
-
event.emit({ type: 'toggle-debug' });
|
|
352
|
-
return true;
|
|
353
|
-
},
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
key: 'Mod-ArrowUp',
|
|
357
|
-
preventDefault: true,
|
|
358
|
-
run: () => {
|
|
359
|
-
event.emit({ type: 'nav-previous' });
|
|
360
|
-
return true;
|
|
361
|
-
},
|
|
362
|
-
shift: () => {
|
|
363
|
-
event.emit({ type: 'thread-open' });
|
|
364
|
-
return true;
|
|
365
|
-
},
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
key: 'Mod-ArrowDown',
|
|
369
|
-
preventDefault: true,
|
|
370
|
-
run: () => {
|
|
371
|
-
event.emit({ type: 'nav-next' });
|
|
372
|
-
return true;
|
|
373
|
-
},
|
|
374
|
-
shift: () => {
|
|
375
|
-
event.emit({ type: 'thread-close' });
|
|
376
|
-
return true;
|
|
377
|
-
},
|
|
378
|
-
},
|
|
379
|
-
]),
|
|
380
|
-
),
|
|
381
|
-
].filter(isTruthy);
|
|
382
|
-
}, [event, expandable]);
|
|
383
|
-
|
|
384
|
-
const handleSubmit = useCallback<NonNullable<ChatEditorProps['onSubmit']>>(
|
|
385
|
-
(text) => {
|
|
386
|
-
if (!activeRef.current) {
|
|
387
|
-
event.emit({ type: 'submit', text });
|
|
388
|
-
return true;
|
|
389
|
-
}
|
|
390
|
-
},
|
|
391
|
-
[event],
|
|
392
|
-
);
|
|
262
|
+
//
|
|
263
|
+
// TaskList
|
|
264
|
+
//
|
|
393
265
|
|
|
394
|
-
|
|
395
|
-
(ev) => {
|
|
396
|
-
event.emit(ev);
|
|
397
|
-
},
|
|
398
|
-
[event],
|
|
399
|
-
);
|
|
266
|
+
const CHAT_TASK_LIST_NAME = 'Chat.TaskList';
|
|
400
267
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
role='group'
|
|
404
|
-
className={mx(
|
|
405
|
-
'flex flex-col w-full dx-density-fine',
|
|
406
|
-
outline &&
|
|
407
|
-
'bg-group-surface border border-subdued-separator transition transition-border [&:has(.cm-content:focus)]:border-separator rounded-sm',
|
|
408
|
-
classNames,
|
|
409
|
-
)}
|
|
410
|
-
>
|
|
411
|
-
<div role='none' className='flex p-2 gap-2'>
|
|
412
|
-
<ChatStatusIndicator classNames='p-1' preset={preset} error={error} processing={streaming} />
|
|
413
|
-
<ChatEditor
|
|
414
|
-
ref={editorRef}
|
|
415
|
-
autoFocus
|
|
416
|
-
lineWrapping
|
|
417
|
-
classNames='col-span-2 pt-0.5'
|
|
418
|
-
placeholder={placeholder ?? t('prompt.placeholder')}
|
|
419
|
-
extensions={extensions}
|
|
420
|
-
onSubmit={handleSubmit}
|
|
421
|
-
/>
|
|
422
|
-
</div>
|
|
423
|
-
|
|
424
|
-
{db && settings && (
|
|
425
|
-
<div role='none' className='flex items-center overflow-hidden'>
|
|
426
|
-
<ChatOptions
|
|
427
|
-
db={db}
|
|
428
|
-
blueprintRegistry={processor.blueprintRegistry}
|
|
429
|
-
context={processor.context}
|
|
430
|
-
preset={preset}
|
|
431
|
-
presets={presets}
|
|
432
|
-
onPresetChange={onPresetChange}
|
|
433
|
-
/>
|
|
434
|
-
|
|
435
|
-
<div role='none' className='flex grow overflow-x-auto scrollbar-none'>
|
|
436
|
-
<ChatReferences db={db} context={processor.context} />
|
|
437
|
-
</div>
|
|
438
|
-
|
|
439
|
-
<ChatActions
|
|
440
|
-
classNames='col-span-2'
|
|
441
|
-
microphone={true}
|
|
442
|
-
recording={recording}
|
|
443
|
-
processing={streaming}
|
|
444
|
-
onEvent={handleEvent}
|
|
445
|
-
>
|
|
446
|
-
{/* TODO(burdon): Move offline switch into dialog. */}
|
|
447
|
-
{online !== undefined && (
|
|
448
|
-
<Input.Root>
|
|
449
|
-
<Input.Label srOnly>{t('online-switch.label')}</Input.Label>
|
|
450
|
-
<Input.Switch classNames='mx-2' checked={online} onCheckedChange={onOnlineChange} />
|
|
451
|
-
</Input.Root>
|
|
452
|
-
)}
|
|
453
|
-
</ChatActions>
|
|
454
|
-
</div>
|
|
455
|
-
)}
|
|
456
|
-
</div>
|
|
457
|
-
);
|
|
268
|
+
type ChatTaskListProps = {
|
|
269
|
+
plan?: Plan.Plan;
|
|
458
270
|
};
|
|
459
271
|
|
|
460
|
-
|
|
272
|
+
const ChatTaskList = composable<HTMLDivElement, ChatTaskListProps>(({ plan: planProp, ...props }, forwardedRef) => {
|
|
273
|
+
const { chat } = useChatContext(CHAT_TASK_LIST_NAME);
|
|
274
|
+
const parent = chat ? Obj.getParent(chat) : undefined;
|
|
275
|
+
const agent = parent && Obj.instanceOf(Agent.Agent, parent) ? parent : undefined;
|
|
276
|
+
const plan = planProp ?? agent?.plan.target;
|
|
277
|
+
if (!plan) {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return <TaskList {...props} plan={plan} ref={forwardedRef} />;
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
ChatTaskList.displayName = CHAT_TASK_LIST_NAME;
|
|
461
285
|
|
|
462
286
|
//
|
|
463
287
|
// Chat
|
|
@@ -466,9 +290,11 @@ ChatPrompt.displayName = CHAT_PROMPT_NAME;
|
|
|
466
290
|
export const Chat = {
|
|
467
291
|
Root: ChatRoot,
|
|
468
292
|
Toolbar: ChatToolbar,
|
|
469
|
-
|
|
470
|
-
Thread: ChatThread,
|
|
293
|
+
Content: ChatContent,
|
|
471
294
|
Prompt: ChatPrompt,
|
|
295
|
+
Status: ChatStatus,
|
|
296
|
+
Thread: ChatThread,
|
|
297
|
+
TaskList: ChatTaskList,
|
|
472
298
|
};
|
|
473
299
|
|
|
474
|
-
export type { ChatRootProps, ChatToolbarProps,
|
|
300
|
+
export type { ChatRootProps, ChatToolbarProps, ChatContentProps, ChatPromptProps, ChatThreadProps, ChatEvent };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { createContext } from '@radix-ui/react-context';
|
|
6
|
+
|
|
7
|
+
import { type Chat as ChatModule } from '@dxos/assistant-toolkit';
|
|
8
|
+
import { type Event } from '@dxos/async';
|
|
9
|
+
import { type Database } from '@dxos/echo';
|
|
10
|
+
import { type Message } from '@dxos/types';
|
|
11
|
+
|
|
12
|
+
import { type AiChatProcessor } from '../../processor';
|
|
13
|
+
import { type ChatEvent } from './events';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Wall-clock timestamps for the most-recent (or in-flight) request, lifted out of
|
|
17
|
+
* `ChatStreamStatus` so the elapsed value survives across re-mounts triggered when wire's
|
|
18
|
+
* drip queue toggles `wireDrainingEffect` (which removes/restores the footer block widget).
|
|
19
|
+
* `endedAt` is `null` while the request is still active.
|
|
20
|
+
*/
|
|
21
|
+
export type ChatRequestTiming = {
|
|
22
|
+
startedAt: number;
|
|
23
|
+
endedAt: number | null;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type ChatContextValue = {
|
|
27
|
+
debug?: boolean;
|
|
28
|
+
event: Event<ChatEvent>;
|
|
29
|
+
db?: Database.Database;
|
|
30
|
+
chat?: ChatModule.Chat;
|
|
31
|
+
messages: Message.Message[];
|
|
32
|
+
processor: AiChatProcessor;
|
|
33
|
+
requestTiming: ChatRequestTiming | null;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Internal: not re-exported from `Chat/index.ts`. Accessed by sibling components in this
|
|
37
|
+
// package (e.g. `ChatStreamStatus`) without dragging in `Chat.tsx`'s heavy transitive
|
|
38
|
+
// imports (transcription, etc.).
|
|
39
|
+
export const [ChatContextProvider, useChatContext] = createContext<ChatContextValue>('Chat');
|
|
@@ -33,18 +33,9 @@ export const ChatActions = ({
|
|
|
33
33
|
const { t } = useTranslation(meta.id);
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
|
-
<div className={mx('flex items-center
|
|
36
|
+
<div className={mx('flex items-center', classNames)}>
|
|
37
37
|
{children}
|
|
38
38
|
|
|
39
|
-
<IconButton
|
|
40
|
-
disabled={!processing}
|
|
41
|
-
variant='ghost'
|
|
42
|
-
icon='ph--x--regular'
|
|
43
|
-
iconOnly
|
|
44
|
-
label={t('cancel-processing.button')}
|
|
45
|
-
onClick={() => onEvent?.({ type: 'cancel' })}
|
|
46
|
-
/>
|
|
47
|
-
|
|
48
39
|
{microphone && (
|
|
49
40
|
<IconButton
|
|
50
41
|
disabled={!processing}
|
|
@@ -70,6 +61,15 @@ export const ChatActions = ({
|
|
|
70
61
|
onClick={() => onEvent?.({ type: 'toggle-debug' })}
|
|
71
62
|
/>
|
|
72
63
|
)}
|
|
64
|
+
|
|
65
|
+
<IconButton
|
|
66
|
+
disabled={!processing}
|
|
67
|
+
variant='ghost'
|
|
68
|
+
icon='ph--x--regular'
|
|
69
|
+
iconOnly
|
|
70
|
+
label={t('cancel-processing.button')}
|
|
71
|
+
onClick={() => onEvent?.({ type: 'cancel' })}
|
|
72
|
+
/>
|
|
73
73
|
</div>
|
|
74
74
|
);
|
|
75
75
|
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
+
import React, { useCallback } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Message, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
|
|
10
|
+
import { meta } from '#meta';
|
|
11
|
+
|
|
12
|
+
import { type AiChatProcessor } from '../../processor';
|
|
13
|
+
|
|
14
|
+
export type ChatMcpErrorsProps = ThemedClassName<{
|
|
15
|
+
processor: AiChatProcessor;
|
|
16
|
+
}>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Inline banner that lists MCP servers that failed to connect during the most recent request.
|
|
20
|
+
* The chat itself keeps working without these servers — this just lets the user see what was dropped.
|
|
21
|
+
*/
|
|
22
|
+
export const ChatMcpErrors = ({ classNames, processor }: ChatMcpErrorsProps) => {
|
|
23
|
+
const { t } = useTranslation(meta.id);
|
|
24
|
+
const errors = useAtomValue(processor.mcpErrors);
|
|
25
|
+
|
|
26
|
+
const handleDismiss = useCallback(() => {
|
|
27
|
+
processor.dismissMcpErrors();
|
|
28
|
+
}, [processor]);
|
|
29
|
+
|
|
30
|
+
if (errors.length === 0) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Message.Root classNames={['m-1', classNames]} valence='warning'>
|
|
36
|
+
<Message.Title onClose={handleDismiss}>{t('mcp-server-error.label')}</Message.Title>
|
|
37
|
+
<Message.Content asChild>
|
|
38
|
+
<ul className='flex flex-col gap-0.5 text-sm'>
|
|
39
|
+
{errors.map((error) => (
|
|
40
|
+
<li key={`${error.url}::${error.protocol}`} className='truncate'>
|
|
41
|
+
<span className='font-mono'>{error.url}</span>
|
|
42
|
+
{' — '}
|
|
43
|
+
<span>{error.message}</span>
|
|
44
|
+
</li>
|
|
45
|
+
))}
|
|
46
|
+
</ul>
|
|
47
|
+
</Message.Content>
|
|
48
|
+
</Message.Root>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
@@ -7,27 +7,37 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import React, { useState } from 'react';
|
|
8
8
|
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { Chat } from '@dxos/assistant-toolkit';
|
|
10
11
|
import { capabilities } from '@dxos/assistant-toolkit/testing';
|
|
11
|
-
import { Feed, Filter } from '@dxos/echo';
|
|
12
|
-
import { ChessPlugin } from '@dxos/plugin-chess';
|
|
13
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
12
|
+
import { Feed, Filter, Ref } from '@dxos/echo';
|
|
13
|
+
import { ChessPlugin } from '@dxos/plugin-chess/plugin';
|
|
14
|
+
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
14
15
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
15
|
-
import { MapPlugin } from '@dxos/plugin-map';
|
|
16
|
-
import { TablePlugin } from '@dxos/plugin-table';
|
|
16
|
+
import { MapPlugin } from '@dxos/plugin-map/plugin';
|
|
17
|
+
import { TablePlugin } from '@dxos/plugin-table/plugin';
|
|
17
18
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
18
19
|
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
19
20
|
import { Loading, withTheme } from '@dxos/react-ui/testing';
|
|
20
21
|
import { Organization, Person } from '@dxos/types';
|
|
21
22
|
|
|
22
23
|
import { useBlueprintRegistry, useContextBinder } from '#hooks';
|
|
24
|
+
import { translations } from '#translations';
|
|
23
25
|
|
|
24
|
-
import { translations } from '../../translations';
|
|
25
26
|
import { ChatOptions, ObjectsPanel, type ChatOptionsProps } from './ChatOptions';
|
|
26
27
|
|
|
27
28
|
const presets = [
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
{
|
|
30
|
+
id: 'edge-claude-sonnet',
|
|
31
|
+
label: 'Edge/Claude Sonnet',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'edge-gpt-4o',
|
|
35
|
+
label: 'Edge/GPT-4o',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'ollama-llama3',
|
|
39
|
+
label: 'Ollama/Llama 3',
|
|
40
|
+
},
|
|
31
41
|
];
|
|
32
42
|
|
|
33
43
|
type DefaultStoryProps = Pick<ChatOptionsProps, 'presets'>;
|
|
@@ -35,14 +45,17 @@ type DefaultStoryProps = Pick<ChatOptionsProps, 'presets'>;
|
|
|
35
45
|
const DefaultStory = ({ presets }: DefaultStoryProps) => {
|
|
36
46
|
const [space] = useSpaces();
|
|
37
47
|
const [feed] = useQuery(space?.db, Filter.type(Feed.Feed));
|
|
48
|
+
const [chat] = useQuery(space?.db, Filter.type(Chat.Chat));
|
|
38
49
|
const blueprintRegistry = useBlueprintRegistry();
|
|
39
50
|
const binder = useContextBinder(space, feed);
|
|
40
51
|
const [preset, setPreset] = useState(presets?.[0]?.id);
|
|
41
|
-
if (!space || !binder) {
|
|
52
|
+
if (!space || !binder || !chat) {
|
|
42
53
|
return <Loading />;
|
|
43
54
|
}
|
|
55
|
+
|
|
44
56
|
return (
|
|
45
57
|
<ChatOptions
|
|
58
|
+
chat={chat}
|
|
46
59
|
db={space.db}
|
|
47
60
|
context={binder}
|
|
48
61
|
blueprintRegistry={blueprintRegistry}
|
|
@@ -63,7 +76,7 @@ const meta = {
|
|
|
63
76
|
plugins: [
|
|
64
77
|
...corePlugins(),
|
|
65
78
|
ClientPlugin({
|
|
66
|
-
types: [Feed.Feed, Organization.Organization, Person.Person],
|
|
79
|
+
types: [Chat.Chat, Feed.Feed, Organization.Organization, Person.Person],
|
|
67
80
|
onClientInitialized: ({ client }) =>
|
|
68
81
|
Effect.gen(function* () {
|
|
69
82
|
yield* initializeIdentity(client);
|
|
@@ -77,7 +90,8 @@ const meta = {
|
|
|
77
90
|
}
|
|
78
91
|
|
|
79
92
|
// Create the chat feed used by the context binder.
|
|
80
|
-
space.db.add(Feed.make());
|
|
93
|
+
const feed = space.db.add(Feed.make());
|
|
94
|
+
space.db.add(Chat.make({ name: 'Test chat', feed: Ref.make(feed) }));
|
|
81
95
|
yield* Effect.promise(() => space.db.flush({ indexes: true }));
|
|
82
96
|
}),
|
|
83
97
|
}),
|
|
@@ -104,7 +118,7 @@ export const Default: Story = {
|
|
|
104
118
|
},
|
|
105
119
|
};
|
|
106
120
|
|
|
107
|
-
export const
|
|
121
|
+
export const _ObjectsPanel: Story = {
|
|
108
122
|
render: () => {
|
|
109
123
|
const [space] = useSpaces();
|
|
110
124
|
const [feed] = useQuery(space?.db, Filter.type(Feed.Feed));
|
|
@@ -114,7 +128,7 @@ export const ObjectsPanelStory: Story = {
|
|
|
114
128
|
}
|
|
115
129
|
|
|
116
130
|
return (
|
|
117
|
-
<div className='
|
|
131
|
+
<div className='grid w-[300px] h-[300px] border border-separator'>
|
|
118
132
|
<ObjectsPanel db={space.db} context={binder} />
|
|
119
133
|
</div>
|
|
120
134
|
);
|