@dxos/plugin-assistant 0.8.4-main.9be5663bfe → 0.8.4-main.abd8ff62ef
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/AssistantSettings-GG52BLKS.mjs +40 -0
- package/dist/lib/browser/AssistantSettings-GG52BLKS.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +26 -3
- package/dist/lib/browser/blueprints/index.mjs.map +4 -4
- package/dist/lib/browser/{chunk-ATHYBVGN.mjs → chunk-DVOOFAWU.mjs} +4 -5
- package/dist/lib/browser/chunk-DVOOFAWU.mjs.map +7 -0
- package/dist/lib/browser/chunk-M55MBYG7.mjs +932 -0
- package/dist/lib/browser/chunk-M55MBYG7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RUV2WOQH.mjs → chunk-SEMCG4ZK.mjs} +58 -17
- package/dist/lib/browser/chunk-SEMCG4ZK.mjs.map +7 -0
- package/dist/lib/browser/chunk-VK53MITK.mjs +2300 -0
- package/dist/lib/browser/chunk-VK53MITK.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +73 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/components/index.mjs +20 -0
- package/dist/lib/browser/components/index.mjs.map +7 -0
- package/dist/lib/browser/{create-chat-LBZHGVSN.mjs → create-chat-E2ZLVTLP.mjs} +4 -13
- package/dist/lib/browser/create-chat-E2ZLVTLP.mjs.map +7 -0
- package/dist/lib/browser/{ensure-companion-chat-FR4AWZ2P.mjs → ensure-companion-chat-7GDMXSQW.mjs} +4 -4
- package/dist/lib/browser/ensure-companion-chat-7GDMXSQW.mjs.map +7 -0
- package/dist/lib/browser/hooks/index.mjs +39 -0
- package/dist/lib/browser/hooks/index.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +43 -3233
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{on-create-space-54RNX5JI.mjs → on-create-space-4J3KTNAJ.mjs} +3 -3
- package/dist/lib/browser/{on-create-space-54RNX5JI.mjs.map → on-create-space-4J3KTNAJ.mjs.map} +1 -1
- package/dist/lib/browser/operations/index.mjs +3 -3
- package/dist/lib/browser/operations/index.mjs.map +3 -3
- package/dist/lib/browser/{resolve-navigation-targets-NZOD66NY.mjs → resolve-navigation-targets-3ZPQE6SZ.mjs} +3 -3
- package/dist/lib/browser/{resolve-navigation-targets-NZOD66NY.mjs.map → resolve-navigation-targets-3ZPQE6SZ.mjs.map} +1 -1
- package/dist/lib/browser/{run-prompt-in-new-chat-4YQ37XIS.mjs → run-prompt-in-new-chat-AA3KPBDN.mjs} +9 -39
- package/dist/lib/browser/run-prompt-in-new-chat-AA3KPBDN.mjs.map +7 -0
- package/dist/lib/browser/{set-current-chat-WJI3WAVM.mjs → set-current-chat-P4VHI3YF.mjs} +4 -4
- package/dist/lib/browser/set-current-chat-P4VHI3YF.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +172 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -3
- package/dist/lib/browser/{update-chat-name-3Y36KFAS.mjs → update-chat-name-VWKNUON7.mjs} +7 -22
- package/dist/lib/browser/update-chat-name-VWKNUON7.mjs.map +7 -0
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs +41 -0
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +26 -3
- package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
- package/dist/lib/node-esm/chunk-FWC3ZGPH.mjs +933 -0
- package/dist/lib/node-esm/chunk-FWC3ZGPH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JKEB3NFZ.mjs +2302 -0
- package/dist/lib/node-esm/chunk-JKEB3NFZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PXAJSTGZ.mjs → chunk-MBDVPB4V.mjs} +4 -5
- package/dist/lib/node-esm/chunk-MBDVPB4V.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PY4X6FJT.mjs → chunk-XAFVSEUJ.mjs} +58 -17
- package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +74 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/components/index.mjs +21 -0
- package/dist/lib/node-esm/components/index.mjs.map +7 -0
- package/dist/lib/node-esm/{create-chat-3BEG4R6J.mjs → create-chat-UQQ3542N.mjs} +4 -13
- package/dist/lib/node-esm/create-chat-UQQ3542N.mjs.map +7 -0
- package/dist/lib/node-esm/{ensure-companion-chat-BLP7NT32.mjs → ensure-companion-chat-LVCPD4DJ.mjs} +4 -4
- package/dist/lib/node-esm/ensure-companion-chat-LVCPD4DJ.mjs.map +7 -0
- package/dist/lib/node-esm/hooks/index.mjs +40 -0
- package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +43 -3233
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{on-create-space-YRPZ6HZY.mjs → on-create-space-M63UBTTT.mjs} +3 -3
- package/dist/lib/node-esm/{on-create-space-YRPZ6HZY.mjs.map → on-create-space-M63UBTTT.mjs.map} +1 -1
- package/dist/lib/node-esm/operations/index.mjs +3 -3
- package/dist/lib/node-esm/operations/index.mjs.map +3 -3
- package/dist/lib/node-esm/{resolve-navigation-targets-3PPK7XLH.mjs → resolve-navigation-targets-HO77CAFT.mjs} +3 -3
- package/dist/lib/node-esm/{resolve-navigation-targets-3PPK7XLH.mjs.map → resolve-navigation-targets-HO77CAFT.mjs.map} +1 -1
- package/dist/lib/node-esm/{run-prompt-in-new-chat-2IJBSDTM.mjs → run-prompt-in-new-chat-RIRYYYPK.mjs} +9 -39
- package/dist/lib/node-esm/run-prompt-in-new-chat-RIRYYYPK.mjs.map +7 -0
- package/dist/lib/node-esm/{set-current-chat-KBMMZULR.mjs → set-current-chat-Z7GJ52VX.mjs} +4 -4
- package/dist/lib/node-esm/set-current-chat-Z7GJ52VX.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +173 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -3
- package/dist/lib/node-esm/{update-chat-name-HM2P4NSI.mjs → update-chat-name-GV4HX32Z.mjs} +7 -22
- package/dist/lib/node-esm/update-chat-name-GV4HX32Z.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/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +5 -17
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +6 -3
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +1 -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 +1 -13
- 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/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +10 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- 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 +1 -539
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +32 -42
- 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 +6 -2
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +19 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -0
- 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.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 +14 -0
- package/dist/types/src/components/ChatThread/Anchor.stories.d.ts.map +1 -0
- 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 +4 -541
- 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 +9 -540
- 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 +40 -14
- 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.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 +1 -539
- 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/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 +1 -539
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +3 -3
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +1 -539
- 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 +1 -539
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts +2 -2
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts +7 -540
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts +1 -1
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -1
- package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts +1 -539
- 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/ChatContainer/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -1
- 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/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/RoutineList/RoutineList.stories.d.ts +21 -0
- 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 +6 -4
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +13 -0
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -0
- 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 +97 -0
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +1 -0
- 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 +3 -2
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -1
- package/dist/types/src/containers/TriggerStatus/index.d.ts +1 -1
- package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +2 -2
- 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/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 +1 -1
- 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 +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +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.map +1 -1
- 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 +3 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +1 -1
- package/dist/types/src/operations/create-chat.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +24 -19
- package/dist/types/src/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/operations/ensure-companion-chat.d.ts +1 -1
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/on-create-space.d.ts +1 -1
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
- package/dist/types/src/operations/prompt.test.d.ts +2 -0
- package/dist/types/src/operations/prompt.test.d.ts.map +1 -0
- 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 +1 -1
- 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 +1 -1
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -1
- package/dist/types/src/operations/update-chat-name.d.ts +1 -1
- package/dist/types/src/operations/update-chat-name.d.ts.map +1 -1
- package/dist/types/src/processor/presets.d.ts +1 -1
- package/dist/types/src/processor/presets.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +25 -7
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/queue-logger.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.map +1 -1
- package/dist/types/src/testing/test-generator.test.d.ts +2 -0
- package/dist/types/src/testing/test-generator.test.d.ts.map +1 -0
- 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/testing/trace-timeline.test.d.ts +2 -0
- package/dist/types/src/testing/trace-timeline.test.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -539
- 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/Settings.d.ts +22 -6
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +1 -13
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- 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 +113 -99
- package/src/AssistantPlugin.node.ts +125 -0
- package/src/AssistantPlugin.test.ts +35 -0
- package/src/AssistantPlugin.tsx +22 -16
- package/src/blueprints/assistant/blueprint.test.ts +3 -3
- package/src/blueprints/assistant/blueprint.ts +3 -3
- package/src/capabilities/app-graph-builder.ts +5 -61
- package/src/capabilities/blueprint-definition.ts +2 -4
- package/src/capabilities/index.ts +2 -1
- package/src/capabilities/local-model-resolver.ts +14 -4
- package/src/capabilities/markdown.ts +1 -1
- package/src/capabilities/migrations.ts +1 -7
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +38 -28
- package/src/capabilities/toolkit.ts +2 -2
- package/src/{components/Typewriter → cli}/index.ts +1 -1
- package/src/cli/plugin.ts +83 -0
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +3 -2
- package/src/components/AssistantSettings/AssistantSettings.tsx +22 -111
- package/src/components/Chat/Chat.tsx +82 -286
- 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 +136 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +229 -37
- package/src/components/ChatPrompt/ChatPrompt.tsx +182 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +1 -1
- package/src/components/ChatPrompt/ChatStatus.tsx +123 -0
- package/src/components/ChatPrompt/index.ts +3 -0
- package/src/components/ChatThread/Anchor.stories.tsx +95 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +39 -29
- package/src/components/ChatThread/ChatThread.tsx +36 -21
- package/src/components/ChatThread/DEBUG.md +41 -0
- package/src/components/ChatThread/MarkdownStream.stories.tsx +43 -5
- package/src/components/ChatThread/registry.tsx +72 -24
- package/src/components/ChatThread/sync.test.ts +175 -15
- package/src/components/ChatThread/sync.ts +87 -102
- package/src/components/ChatThread/testing/reasoning.md +25 -0
- package/src/components/ChatThread/widgets/FallbackWidget.tsx +2 -2
- package/src/components/ChatThread/widgets/ReasoningWidget.stories.tsx +1 -1
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +6 -6
- 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 +3 -3
- package/src/components/ChatThread/widgets/SuggestionWidget.ts +1 -1
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +3 -2
- package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +3 -2
- package/src/components/ChatThread/widgets/ToolWidget.tsx +2 -2
- 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 +70 -37
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +3 -2
- package/src/components/TemplateEditor/TemplateEditor.tsx +5 -5
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +4 -3
- package/src/components/TemplateEditor/TemplateForm.tsx +3 -3
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +1 -1
- package/src/components/ToolBlock/ToolBlock.tsx +2 -2
- package/src/components/Toolbox/Toolbox.stories.tsx +2 -1
- package/src/components/Toolbox/Toolbox.tsx +2 -2
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +40 -25
- package/src/containers/AgentArticle/AgentArticle.tsx +96 -53
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +14 -4
- package/src/containers/AgentProperties/AgentProperties.tsx +46 -88
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +1 -1
- package/src/containers/ChatCompanion/ChatCompanion.tsx +1 -1
- package/src/containers/ChatContainer/ChatContainer.tsx +16 -6
- package/src/containers/ChatDialog/ChatDialog.tsx +3 -9
- package/src/containers/{PromptArticle/PromptArticle.tsx → RoutineArticle/RoutineArticle.tsx} +4 -4
- package/src/containers/RoutineArticle/index.ts +5 -0
- package/src/containers/{PromptList/PromptList.stories.tsx → RoutineList/RoutineList.stories.tsx} +11 -10
- package/src/containers/{PromptList/PromptList.tsx → RoutineList/RoutineList.tsx} +6 -5
- package/src/containers/RoutineList/index.ts +5 -0
- package/src/containers/TracePanel/TracePanel.stories.tsx +278 -0
- package/src/containers/TracePanel/TracePanel.tsx +95 -318
- package/src/containers/TracePanel/dxn-extractor.test.ts +7 -7
- package/src/containers/TracePanel/dxn-extractor.ts +4 -4
- package/src/containers/TracePanel/execution-graph.test.ts +382 -0
- package/src/containers/TracePanel/execution-graph.ts +579 -0
- 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 +19 -34
- package/src/containers/TriggerStatus/index.ts +1 -1
- package/src/containers/index.ts +2 -2
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useBlueprintRegistry.ts +1 -1
- package/src/hooks/useChatKeymap.ts +52 -0
- package/src/hooks/useChatProcessor.ts +11 -11
- package/src/hooks/useDebug.ts +38 -0
- package/src/index.ts +8 -6
- package/src/operations/create-chat.ts +1 -2
- package/src/operations/definitions.ts +3 -4
- package/src/operations/ensure-companion-chat.ts +1 -1
- package/src/operations/index.ts +1 -1
- package/src/operations/on-create-space.ts +1 -1
- package/src/operations/prompt.test.ts +77 -0
- package/src/operations/resolve-navigation-targets.ts +1 -1
- package/src/operations/run-prompt-in-new-chat.ts +2 -3
- package/src/operations/set-current-chat.ts +1 -1
- package/src/operations/update-chat-name.ts +2 -2
- package/src/processor/presets.ts +9 -1
- package/src/processor/processor.test.ts +4 -4
- package/src/processor/processor.ts +43 -27
- package/src/queue-logger.ts +19 -8
- package/src/testing/data/trace-timeline.dx.json +4657 -0
- package/src/testing/index.ts +1 -0
- package/src/testing/test-generator.test.ts +81 -0
- package/src/testing/test-generator.ts +46 -40
- package/src/testing/test-trace.ts +20 -0
- package/src/testing/trace-timeline.conversations.json +1 -0
- package/src/testing/trace-timeline.test.ts +249 -0
- package/src/translations.ts +49 -34
- package/src/types/Assistant.ts +11 -0
- package/src/types/Settings.ts +63 -8
- package/src/types/index.ts +0 -1
- 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.map +0 -7
- package/dist/lib/browser/chunk-EZRS3J25.mjs +0 -30
- package/dist/lib/browser/chunk-EZRS3J25.mjs.map +0 -7
- package/dist/lib/browser/chunk-RUV2WOQH.mjs.map +0 -7
- package/dist/lib/browser/create-chat-LBZHGVSN.mjs.map +0 -7
- package/dist/lib/browser/ensure-companion-chat-FR4AWZ2P.mjs.map +0 -7
- package/dist/lib/browser/run-prompt-in-new-chat-4YQ37XIS.mjs.map +0 -7
- package/dist/lib/browser/set-current-chat-WJI3WAVM.mjs.map +0 -7
- 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/chunk-NZIKC7AN.mjs +0 -32
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PY4X6FJT.mjs.map +0 -7
- package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs.map +0 -7
- package/dist/lib/node-esm/ensure-companion-chat-BLP7NT32.mjs.map +0 -7
- package/dist/lib/node-esm/run-prompt-in-new-chat-2IJBSDTM.mjs.map +0 -7
- package/dist/lib/node-esm/set-current-chat-KBMMZULR.mjs.map +0 -7
- package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs.map +0 -7
- 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 -14
- package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts.map +0 -1
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +0 -12
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +0 -1
- package/dist/types/src/components/Typewriter/Typewriter.d.ts +0 -11
- package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +0 -1
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +0 -7
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +0 -1
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts +0 -5
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +0 -1
- package/dist/types/src/components/Typewriter/index.d.ts +0 -2
- package/dist/types/src/components/Typewriter/index.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 +0 -559
- 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/types/defs.d.ts +0 -2
- package/dist/types/src/types/defs.d.ts.map +0 -1
- package/src/blueprints/assistant/blueprint.conversations.json +0 -1
- package/src/components/ChatProgress/ChatProgress.tsx +0 -56
- package/src/components/ChatProgress/index.ts +0 -5
- package/src/components/ChatThread/widgets/PromptWidget.ts +0 -28
- package/src/components/Typewriter/AssistantToolbar.tsx +0 -161
- package/src/components/Typewriter/Typewriter.stories.tsx +0 -86
- package/src/components/Typewriter/Typewriter.tsx +0 -50
- package/src/components/Typewriter/assistant-extension.tsx +0 -141
- package/src/containers/PromptArticle/index.ts +0 -5
- package/src/containers/PromptList/index.ts +0 -5
- package/src/types/defs.ts +0 -5
|
@@ -41,7 +41,7 @@ export const ChatReferences = ({ classNames, context, db }: ChatReferencesProps)
|
|
|
41
41
|
icon='ph--x--bold'
|
|
42
42
|
iconOnly
|
|
43
43
|
variant='ghost'
|
|
44
|
-
label={t('remove-object
|
|
44
|
+
label={t('remove-object.label')}
|
|
45
45
|
classNames='p-0 hover:bg-transparent'
|
|
46
46
|
size={3}
|
|
47
47
|
onClick={() => onUpdateObject?.(dxn, false)}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
8
|
+
import { ChatStatus as NaturalChatStatus, formatElapsed } from '@dxos/react-ui-chat';
|
|
9
|
+
import { Matrix } from '@dxos/react-ui-sfx';
|
|
10
|
+
import { type ContentBlock } from '@dxos/types';
|
|
11
|
+
import { Unit } from '@dxos/util';
|
|
12
|
+
|
|
13
|
+
import { type ChatRequestTiming, useChatContext } from '../Chat/context';
|
|
14
|
+
|
|
15
|
+
const CHAT_STREAM_STATUS_NAME = 'Chat.StreamStatus';
|
|
16
|
+
const TICK_MS = 1_000;
|
|
17
|
+
|
|
18
|
+
export type ChatStreamStatusProps = ThemedClassName<{
|
|
19
|
+
icon?: boolean;
|
|
20
|
+
}>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Live status pill rendered at the bottom of the chat thread.
|
|
24
|
+
*
|
|
25
|
+
* The block-widget host re-mounts this component each time wire's drip queue toggles
|
|
26
|
+
* (`wireDrainingEffect`) — so all visible state is derived from chat-context values that
|
|
27
|
+
* survive the unmount: the latest `stats` block on the chat context's `messages` for token counts,
|
|
28
|
+
* and `requestTiming` (start/end wall-clock timestamps) for the elapsed value.
|
|
29
|
+
*
|
|
30
|
+
* Shows:
|
|
31
|
+
* - elapsed seconds since the most recent request started (frozen at end-of-request)
|
|
32
|
+
* - last completed turn's output token count (from the most recent `stats` content block)
|
|
33
|
+
* - cumulative session total tokens across all `stats` content blocks
|
|
34
|
+
*/
|
|
35
|
+
export const ChatStatus = ({ classNames, icon }: ChatStreamStatusProps) => {
|
|
36
|
+
// Read `messages` from the chat context (combines `useQuery(queue)` + the processor's
|
|
37
|
+
// pending atom) rather than `processor.messages` directly — the latter only contains
|
|
38
|
+
// blocks streamed via the ephemeral `PartialBlock` channel, while finalized blocks
|
|
39
|
+
// (including the per-turn `stats` block we read for token counts) are submitted to the
|
|
40
|
+
// feed via `_submitMessage` and only show up through `useQuery`.
|
|
41
|
+
const { messages, requestTiming } = useChatContext(CHAT_STREAM_STATUS_NAME);
|
|
42
|
+
|
|
43
|
+
const { lastOutputTokens, sessionTotalTokens } = useMemo(() => {
|
|
44
|
+
let last: number | undefined;
|
|
45
|
+
let total = 0;
|
|
46
|
+
for (const message of messages) {
|
|
47
|
+
for (const block of message.blocks) {
|
|
48
|
+
if (isStats(block) && block.usage) {
|
|
49
|
+
last = block.usage.outputTokens;
|
|
50
|
+
total += block.usage.totalTokens ?? 0;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return { lastOutputTokens: last, sessionTotalTokens: total };
|
|
55
|
+
}, [messages]);
|
|
56
|
+
|
|
57
|
+
const isRunning = requestTiming != null && requestTiming.endedAt == null;
|
|
58
|
+
const show = requestTiming || lastOutputTokens || sessionTotalTokens > 0;
|
|
59
|
+
if (!show) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<NaturalChatStatus.Root defaultRunning={false} classNames={['py-2 gap-2 text-sm', classNames]}>
|
|
65
|
+
{icon && (
|
|
66
|
+
<NaturalChatStatus.Icon>
|
|
67
|
+
<Matrix
|
|
68
|
+
classNames='w-5 h-5'
|
|
69
|
+
dotClassNames='bg-primary-500'
|
|
70
|
+
dim={4}
|
|
71
|
+
dotSize={3}
|
|
72
|
+
count={10}
|
|
73
|
+
interval={500}
|
|
74
|
+
active={isRunning}
|
|
75
|
+
/>
|
|
76
|
+
</NaturalChatStatus.Icon>
|
|
77
|
+
)}
|
|
78
|
+
{show && (
|
|
79
|
+
<div role='none' className='flex items-center'>
|
|
80
|
+
{requestTiming && (
|
|
81
|
+
<NaturalChatStatus.Text>
|
|
82
|
+
<Elapsed timing={requestTiming} />
|
|
83
|
+
</NaturalChatStatus.Text>
|
|
84
|
+
)}
|
|
85
|
+
{lastOutputTokens != null && (
|
|
86
|
+
<>
|
|
87
|
+
{requestTiming && <NaturalChatStatus.Separator />}
|
|
88
|
+
<NaturalChatStatus.Text>↓ {Unit.Thousand(lastOutputTokens).toString()}</NaturalChatStatus.Text>
|
|
89
|
+
</>
|
|
90
|
+
)}
|
|
91
|
+
{sessionTotalTokens > 0 && (
|
|
92
|
+
<>
|
|
93
|
+
{(requestTiming || lastOutputTokens != null) && <NaturalChatStatus.Separator />}
|
|
94
|
+
<NaturalChatStatus.Text>Σ {Unit.Thousand(sessionTotalTokens).toString()}</NaturalChatStatus.Text>
|
|
95
|
+
</>
|
|
96
|
+
)}
|
|
97
|
+
</div>
|
|
98
|
+
)}
|
|
99
|
+
</NaturalChatStatus.Root>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Wall-clock-derived elapsed display. Tick interval forces a re-render every second while
|
|
105
|
+
* the request is active so the displayed value advances; once `endedAt` is set, the value
|
|
106
|
+
* is frozen and the interval is no longer scheduled.
|
|
107
|
+
*/
|
|
108
|
+
const Elapsed = ({ timing }: { timing: ChatRequestTiming }) => {
|
|
109
|
+
const isRunning = timing.endedAt == null;
|
|
110
|
+
const [now, setNow] = useState(Date.now());
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
if (!isRunning) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const id = setInterval(() => setNow(Date.now()), TICK_MS);
|
|
117
|
+
return () => clearInterval(id);
|
|
118
|
+
}, [isRunning]);
|
|
119
|
+
|
|
120
|
+
return <>{formatElapsed((timing.endedAt ?? now) - timing.startedAt)}</>;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const isStats = (block: ContentBlock.Any): block is ContentBlock.Stats => block._tag === 'stats';
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
export * from './ChatActions';
|
|
6
|
+
export * from './ChatMcpErrors';
|
|
6
7
|
export * from './ChatOptions';
|
|
7
8
|
export * from './ChatPresets';
|
|
9
|
+
export * from './ChatPrompt';
|
|
8
10
|
export * from './ChatReferences';
|
|
9
11
|
export * from './ChatStatusIndicator';
|
|
12
|
+
export * from './ChatStatus';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { Database, Filter, Obj } from '@dxos/echo';
|
|
11
|
+
import { DxAnchor } from '@dxos/lit-ui/react';
|
|
12
|
+
import { ClientPlugin } from '@dxos/plugin-client';
|
|
13
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
14
|
+
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
15
|
+
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
16
|
+
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
17
|
+
import { Loading, withLayout } from '@dxos/react-ui/testing';
|
|
18
|
+
import { Organization } from '@dxos/types';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Production-style click → popover demo.
|
|
22
|
+
*
|
|
23
|
+
* Wires up the same chain Composer uses:
|
|
24
|
+
* - `<DxAnchor dxn=…>label</DxAnchor>` fires `DxAnchorActivate` on click.
|
|
25
|
+
* - `PreviewPlugin`'s `preview-popover` capability listens for the event, resolves the DXN
|
|
26
|
+
* to a real ECHO object via `space.db.makeRef(dxn).load()`, then invokes
|
|
27
|
+
* `LayoutOperation.UpdatePopover`.
|
|
28
|
+
* - `StorybookPlugin` provides both the `LayoutOperation.UpdatePopover` handler (mutating
|
|
29
|
+
* the layout-state atom) and the `<Layout>` shell that renders the popover via
|
|
30
|
+
* `<Surface.Surface type={AppSurface.Card} data={popoverContent}>`.
|
|
31
|
+
* - `PreviewPlugin` also registers Card-role surfaces (Organization, Person, Task, …); the
|
|
32
|
+
* Surface system picks the matching one based on the resolved object's type.
|
|
33
|
+
*
|
|
34
|
+
* Click the anchor — the matching Card surface (from plugin-preview) renders inside the
|
|
35
|
+
* popover, anchored to the trigger.
|
|
36
|
+
*/
|
|
37
|
+
const DefaultStory = () => {
|
|
38
|
+
const [space] = useSpaces();
|
|
39
|
+
const [organization] = useQuery(space?.db, Filter.type(Organization.Organization));
|
|
40
|
+
if (!organization) {
|
|
41
|
+
return <Loading />;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const dxn = Obj.getDXN(organization).toString();
|
|
45
|
+
return (
|
|
46
|
+
<div role='none' className='flex flex-col gap-2 p-4'>
|
|
47
|
+
<p>
|
|
48
|
+
Click{' '}
|
|
49
|
+
<DxAnchor className='dx-tag--anchor' dxn={dxn}>
|
|
50
|
+
{organization.name}
|
|
51
|
+
</DxAnchor>{' '}
|
|
52
|
+
to open the popover.
|
|
53
|
+
</p>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const meta = {
|
|
59
|
+
title: 'plugins/plugin-assistant/components/ChatThread/Anchor',
|
|
60
|
+
render: DefaultStory,
|
|
61
|
+
decorators: [
|
|
62
|
+
withLayout({ layout: 'centered' }),
|
|
63
|
+
withPluginManager({
|
|
64
|
+
plugins: [
|
|
65
|
+
...corePlugins(),
|
|
66
|
+
StorybookPlugin({}),
|
|
67
|
+
PreviewPlugin(),
|
|
68
|
+
ClientPlugin({
|
|
69
|
+
types: [Organization.Organization],
|
|
70
|
+
onClientInitialized: Effect.fnUntraced(function* ({ client }) {
|
|
71
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
72
|
+
yield* Effect.gen(function* () {
|
|
73
|
+
yield* Database.add(
|
|
74
|
+
Obj.make(Organization.Organization, {
|
|
75
|
+
name: 'DXOS',
|
|
76
|
+
website: 'https://dxos.org',
|
|
77
|
+
description: 'A decentralized network for collaborative applications.',
|
|
78
|
+
}),
|
|
79
|
+
);
|
|
80
|
+
}).pipe(Effect.provide(Database.layer(personalSpace.db)));
|
|
81
|
+
}),
|
|
82
|
+
}),
|
|
83
|
+
],
|
|
84
|
+
}),
|
|
85
|
+
],
|
|
86
|
+
parameters: {
|
|
87
|
+
layout: 'centered',
|
|
88
|
+
},
|
|
89
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
90
|
+
|
|
91
|
+
export default meta;
|
|
92
|
+
|
|
93
|
+
type Story = StoryObj<typeof meta>;
|
|
94
|
+
|
|
95
|
+
export const Default: Story = {};
|
|
@@ -8,20 +8,23 @@ import * as Fiber from 'effect/Fiber';
|
|
|
8
8
|
import * as Layer from 'effect/Layer';
|
|
9
9
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
+
import { Database } from '@dxos/echo';
|
|
12
13
|
import { runAndForwardErrors } from '@dxos/effect';
|
|
13
14
|
import { ContextQueueService } from '@dxos/functions';
|
|
15
|
+
import { ClientPlugin } from '@dxos/plugin-client';
|
|
16
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
17
|
+
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
18
|
+
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
14
19
|
import { random } from '@dxos/random';
|
|
15
|
-
import { type Queue,
|
|
16
|
-
import {
|
|
17
|
-
import { Card, Popover } from '@dxos/react-ui';
|
|
18
|
-
import { EditorPreviewProvider, useEditorPreview } from '@dxos/react-ui-editor';
|
|
20
|
+
import { type Queue, useSpaces } from '@dxos/react-client/echo';
|
|
21
|
+
import { EditorPreviewProvider } from '@dxos/react-ui-editor';
|
|
19
22
|
import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
20
23
|
import { Message, Organization, Person } from '@dxos/types';
|
|
21
24
|
|
|
22
25
|
import { createMessageGenerator } from '#testing';
|
|
26
|
+
import { translations } from '#translations';
|
|
23
27
|
|
|
24
|
-
import { translations } from '../../translations';
|
|
25
28
|
import { ChatThread, type ChatThreadProps } from './ChatThread';
|
|
26
29
|
|
|
27
30
|
random.seed(1);
|
|
@@ -33,7 +36,7 @@ type DefaultStoryProps = { generator?: MessageGenerator[]; delay?: number; wait?
|
|
|
33
36
|
const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStoryProps) => {
|
|
34
37
|
const [space] = useSpaces();
|
|
35
38
|
const queue = useMemo<Queue<Message.Message> | undefined>(() => space?.queues.create(), [space]);
|
|
36
|
-
const messages =
|
|
39
|
+
const messages = useQueueMessages(queue);
|
|
37
40
|
const [done, setDone] = useState(false);
|
|
38
41
|
|
|
39
42
|
// Generate messages.
|
|
@@ -58,7 +61,7 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStor
|
|
|
58
61
|
return () => {
|
|
59
62
|
void runAndForwardErrors(Fiber.interrupt(fiber));
|
|
60
63
|
};
|
|
61
|
-
}, [space, queue, generator]);
|
|
64
|
+
}, [space, queue, generator, delay]);
|
|
62
65
|
|
|
63
66
|
if (wait && !done) {
|
|
64
67
|
return <Loading data={{ wait, done }} />;
|
|
@@ -67,27 +70,25 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStor
|
|
|
67
70
|
return (
|
|
68
71
|
<EditorPreviewProvider onLookup={async ({ dxn, label }) => ({ label, text: dxn })}>
|
|
69
72
|
<ChatThread {...props} messages={messages} />
|
|
70
|
-
<PreviewCard />
|
|
71
73
|
</EditorPreviewProvider>
|
|
72
74
|
);
|
|
73
75
|
};
|
|
74
76
|
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
+
const useQueueMessages = (queue?: Queue<Message.Message>) => {
|
|
78
|
+
const [messages, setMessages] = useState<Message.Message[]>([]);
|
|
77
79
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (!queue) {
|
|
82
|
+
setMessages([]);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const update = () => setMessages([...queue.objects]);
|
|
87
|
+
update();
|
|
88
|
+
return queue.subscribe(update);
|
|
89
|
+
}, [queue]);
|
|
90
|
+
|
|
91
|
+
return messages;
|
|
91
92
|
};
|
|
92
93
|
|
|
93
94
|
const meta = {
|
|
@@ -97,10 +98,19 @@ const meta = {
|
|
|
97
98
|
decorators: [
|
|
98
99
|
withTheme(),
|
|
99
100
|
withLayout({ layout: 'column' }),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
withPluginManager({
|
|
102
|
+
plugins: [
|
|
103
|
+
...corePlugins(),
|
|
104
|
+
StorybookPlugin({}),
|
|
105
|
+
PreviewPlugin(),
|
|
106
|
+
ClientPlugin({
|
|
107
|
+
types: [Organization.Organization, Person.Person],
|
|
108
|
+
onClientInitialized: ({ client }) =>
|
|
109
|
+
Effect.gen(function* () {
|
|
110
|
+
yield* initializeIdentity(client);
|
|
111
|
+
}),
|
|
112
|
+
}),
|
|
113
|
+
],
|
|
104
114
|
}),
|
|
105
115
|
],
|
|
106
116
|
parameters: {
|
|
@@ -126,7 +136,7 @@ export const Delayed: Story = {
|
|
|
126
136
|
delay: 500,
|
|
127
137
|
options: {
|
|
128
138
|
autoScroll: true,
|
|
129
|
-
|
|
139
|
+
typewriter: true,
|
|
130
140
|
cursor: true,
|
|
131
141
|
},
|
|
132
142
|
},
|
|
@@ -2,24 +2,25 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { PublicKey } from '@dxos/keys';
|
|
8
8
|
import { type Identity } from '@dxos/react-client/halo';
|
|
9
9
|
import { type ThemedClassName, setRef } from '@dxos/react-ui';
|
|
10
|
-
import { MarkdownStream, type MarkdownStreamController, type MarkdownStreamProps } from '@dxos/react-ui-
|
|
10
|
+
import { MarkdownStream, type MarkdownStreamController, type MarkdownStreamProps } from '@dxos/react-ui-markdown';
|
|
11
11
|
import { type Message } from '@dxos/types';
|
|
12
|
-
import { mx } from '@dxos/ui-theme';
|
|
13
12
|
import { keyToFallback } from '@dxos/util';
|
|
14
13
|
|
|
14
|
+
import { type Assistant } from '../../types';
|
|
15
15
|
import { type ChatEvent } from '../Chat';
|
|
16
|
-
import {
|
|
16
|
+
import { componentRegistry, createBlockRenderer } from './registry';
|
|
17
17
|
import { MessageSyncer } from './sync';
|
|
18
18
|
|
|
19
19
|
const defaultOptions: MarkdownStreamProps['options'] = {
|
|
20
20
|
autoScroll: true,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
cursor: false,
|
|
22
|
+
fader: false,
|
|
23
|
+
typewriter: true,
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
export type ChatThreadProps = ThemedClassName<
|
|
@@ -27,13 +28,27 @@ export type ChatThreadProps = ThemedClassName<
|
|
|
27
28
|
identity?: Identity;
|
|
28
29
|
messages?: Message.Message[];
|
|
29
30
|
error?: Error;
|
|
31
|
+
viewType?: Assistant.ChatView;
|
|
30
32
|
onEvent?: (event: ChatEvent) => void;
|
|
31
|
-
} & Pick<MarkdownStreamProps, 'options' | 'debug'>
|
|
33
|
+
} & Pick<MarkdownStreamProps, 'options' | 'debug' | 'extensions' | 'footer'>
|
|
32
34
|
>;
|
|
33
35
|
|
|
34
|
-
// TODO(burdon): Memo thread position.
|
|
35
36
|
export const ChatThread = forwardRef<MarkdownStreamController | null, ChatThreadProps>(
|
|
36
|
-
(
|
|
37
|
+
(
|
|
38
|
+
{
|
|
39
|
+
classNames,
|
|
40
|
+
identity,
|
|
41
|
+
messages = [],
|
|
42
|
+
error,
|
|
43
|
+
options = defaultOptions,
|
|
44
|
+
footer,
|
|
45
|
+
debug = false,
|
|
46
|
+
extensions,
|
|
47
|
+
viewType,
|
|
48
|
+
onEvent,
|
|
49
|
+
},
|
|
50
|
+
forwardedRef,
|
|
51
|
+
) => {
|
|
37
52
|
const [controller, setController] = useState<MarkdownStreamController | null>(null);
|
|
38
53
|
const handleMarkdownStreamRef = useCallback(
|
|
39
54
|
(instance: MarkdownStreamController | null) => {
|
|
@@ -54,10 +69,14 @@ export const ChatThread = forwardRef<MarkdownStreamController | null, ChatThread
|
|
|
54
69
|
}, [controller, error]);
|
|
55
70
|
|
|
56
71
|
// Update document.
|
|
57
|
-
const
|
|
72
|
+
const renderer = useMemo(() => createBlockRenderer(viewType), [viewType]);
|
|
73
|
+
const syncer = useMemo(() => controller && new MessageSyncer(controller, renderer), [controller, renderer]);
|
|
58
74
|
useEffect(() => {
|
|
59
|
-
|
|
60
|
-
|
|
75
|
+
if (!syncer) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (syncer.update(messages)) {
|
|
61
80
|
controller?.scrollToBottom('instant');
|
|
62
81
|
}
|
|
63
82
|
}, [controller, syncer, messages]);
|
|
@@ -76,19 +95,15 @@ export const ChatThread = forwardRef<MarkdownStreamController | null, ChatThread
|
|
|
76
95
|
);
|
|
77
96
|
|
|
78
97
|
return (
|
|
79
|
-
<div
|
|
80
|
-
role='none'
|
|
81
|
-
className={mx('flex h-full w-full justify-center overflow-hidden', classNames)}
|
|
82
|
-
style={
|
|
83
|
-
{
|
|
84
|
-
'--user-fill': `var(--color-${userHue}-fill)`,
|
|
85
|
-
} as CSSProperties
|
|
86
|
-
}
|
|
87
|
-
>
|
|
98
|
+
<div role='none' data-hue={userHue} className='contents'>
|
|
88
99
|
<MarkdownStream
|
|
100
|
+
key={viewType}
|
|
101
|
+
classNames={classNames}
|
|
89
102
|
registry={componentRegistry}
|
|
90
103
|
options={options}
|
|
91
104
|
debug={debug}
|
|
105
|
+
extensions={extensions}
|
|
106
|
+
footer={footer}
|
|
92
107
|
onEvent={handleEvent}
|
|
93
108
|
ref={handleMarkdownStreamRef}
|
|
94
109
|
/>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Dataflow from AI to Codemirror
|
|
2
|
+
|
|
3
|
+
AiSession (packages/core/assistant/src/conversation/session.ts)
|
|
4
|
+
│
|
|
5
|
+
│ emits ephemeral Trace events containing
|
|
6
|
+
│ PartialBlock { messageId, role, block: ContentBlock.Any }
|
|
7
|
+
│ via AgentService.Session.subscribeEphemeral(): Stream<Trace.Message>
|
|
8
|
+
▼
|
|
9
|
+
AiChatProcessor (packages/plugins/plugin-assistant/src/processor/processor.ts)
|
|
10
|
+
│
|
|
11
|
+
│ Stream.runForEach → if Trace.isOfType(PartialBlock) →
|
|
12
|
+
│ #handleEphemeralMessage(event.data)
|
|
13
|
+
│ → upserts Message.Message into #streaming atom
|
|
14
|
+
│ → finalizes into #messages atom on complete block
|
|
15
|
+
▼
|
|
16
|
+
Chat.tsx (packages/plugins/plugin-assistant/src/components/Chat/Chat.tsx)
|
|
17
|
+
│
|
|
18
|
+
│ reads processor.messages + processor.streaming atoms,
|
|
19
|
+
│ passes flat Message[] down to ChatThread
|
|
20
|
+
▼
|
|
21
|
+
ChatThread.tsx (packages/plugins/plugin-assistant/src/components/ChatThread/ChatThread.tsx)
|
|
22
|
+
│
|
|
23
|
+
│ MessageSyncer (sync.ts) compares current messages
|
|
24
|
+
│ to last rendered set:
|
|
25
|
+
│ - new finalized chunk → controller.append(delta)
|
|
26
|
+
│ - changed earlier message → controller.setContent(full)
|
|
27
|
+
│ blockToMarkdown serializes ContentBlocks → markdown,
|
|
28
|
+
│ embedding tool calls as XML widget tags
|
|
29
|
+
│ (e.g. <tool-call name="...">...</tool-call>)
|
|
30
|
+
▼
|
|
31
|
+
MarkdownStreamController.append / setContent
|
|
32
|
+
▼
|
|
33
|
+
MarkdownStream (packages/ui/react-ui-markdown/src/MarkdownStream/MarkdownStream.tsx)
|
|
34
|
+
│
|
|
35
|
+
│ CodeMirror editor with:
|
|
36
|
+
│ - extendedMarkdown (parseMixed → xmlLanguage on HTMLBlock/Paragraph)
|
|
37
|
+
│ - xmlTags (registry → React/native widget portals)
|
|
38
|
+
│ - wire extension (buffers appended text, drips at typewriter rate,
|
|
39
|
+
│ treats XML atomic ranges as indivisible units)
|
|
40
|
+
▼
|
|
41
|
+
Rendered DOM (markdown + portaled widgets for tool calls / reasoning / etc.)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import React, { useCallback, useEffect, useState
|
|
6
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import '@dxos/lit-ui';
|
|
9
9
|
import { PublicKey } from '@dxos/keys';
|
|
@@ -15,13 +15,15 @@ import {
|
|
|
15
15
|
type MarkdownStreamController,
|
|
16
16
|
type MarkdownStreamProps,
|
|
17
17
|
textStream,
|
|
18
|
-
} from '@dxos/react-ui-
|
|
18
|
+
} from '@dxos/react-ui-markdown';
|
|
19
19
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
20
20
|
import { type ContentBlock } from '@dxos/types';
|
|
21
21
|
import { keyToFallback } from '@dxos/util';
|
|
22
22
|
|
|
23
|
-
import { translations } from '
|
|
23
|
+
import { translations } from '#translations';
|
|
24
|
+
|
|
24
25
|
import { componentRegistry } from './registry';
|
|
26
|
+
import REASONING from './testing/reasoning.md?raw';
|
|
25
27
|
import THINKING from './testing/thinking.md?raw';
|
|
26
28
|
import THREAD_1 from './testing/thread-1.md?raw';
|
|
27
29
|
import THREAD_WIDGETS from './testing/thread-widgets.md?raw';
|
|
@@ -144,7 +146,7 @@ const DefaultStory = ({
|
|
|
144
146
|
}, [controller]);
|
|
145
147
|
|
|
146
148
|
return (
|
|
147
|
-
<Panel.Root
|
|
149
|
+
<Panel.Root data-hue={userHue}>
|
|
148
150
|
<Panel.Toolbar asChild>
|
|
149
151
|
<Toolbar.Root>
|
|
150
152
|
<Toolbar.IconButton
|
|
@@ -206,7 +208,7 @@ export const Streaming: Story = {
|
|
|
206
208
|
content: THREAD_1,
|
|
207
209
|
options: {
|
|
208
210
|
autoScroll: true,
|
|
209
|
-
|
|
211
|
+
typewriter: true,
|
|
210
212
|
cursor: true,
|
|
211
213
|
},
|
|
212
214
|
},
|
|
@@ -241,3 +243,39 @@ export const Thinking: Story = {
|
|
|
241
243
|
},
|
|
242
244
|
},
|
|
243
245
|
};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Splits a fixture at the first `</prompt>` so the prompt can be pre-loaded as initialContent
|
|
249
|
+
* (matching production: user prompts are submitted whole and never streamed) while the assistant
|
|
250
|
+
* body is streamed. Keeps the streaming-tail XML scan focused on the tags it is meant for
|
|
251
|
+
* (`<reasoning>`, `<status>`) instead of accumulating widgets for an unclosed `<prompt>`.
|
|
252
|
+
*/
|
|
253
|
+
const splitPromptAndBody = (markdown: string): { prompt: string; body: string } => {
|
|
254
|
+
const closing = '</prompt>';
|
|
255
|
+
const idx = markdown.indexOf(closing);
|
|
256
|
+
if (idx === -1) {
|
|
257
|
+
return { prompt: '', body: markdown };
|
|
258
|
+
}
|
|
259
|
+
return { prompt: markdown.slice(0, idx + closing.length), body: markdown.slice(idx + closing.length) };
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
const REASONING_PARTS = splitPromptAndBody(REASONING);
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Streams a reasoning block whose body contains a numbered list — exercises the streaming-tail XML
|
|
266
|
+
* scan as `<reasoning>` opens, accumulates list-marker lines like `"1. "`, and finally closes. Use
|
|
267
|
+
* this to visually verify that the reasoning widget renders cleanly without duplicate opening tags
|
|
268
|
+
* (regression from the per-line bullet stripper that used to collapse `"1. "` to empty mid-stream).
|
|
269
|
+
*/
|
|
270
|
+
export const Reasoning: Story = {
|
|
271
|
+
args: {
|
|
272
|
+
registry: componentRegistry,
|
|
273
|
+
initialContent: REASONING_PARTS.prompt,
|
|
274
|
+
content: REASONING_PARTS.body,
|
|
275
|
+
options: {
|
|
276
|
+
autoScroll: true,
|
|
277
|
+
typewriter: true,
|
|
278
|
+
cursor: true,
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
};
|