@dxos/plugin-assistant 0.8.4-main.422d1c7879 → 0.8.4-main.43cb759274
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/LICENSE +102 -5
- package/PLUGIN.mdl +439 -0
- package/README.md +1 -1
- package/dist/lib/neutral/AgentArticle-OYQPCK3Q.mjs +161 -0
- package/dist/lib/neutral/AgentArticle-OYQPCK3Q.mjs.map +7 -0
- package/dist/lib/neutral/AgentProperties-W6LD56IB.mjs +40 -0
- package/dist/lib/neutral/AgentProperties-W6LD56IB.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.mjs +10 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs +66 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.workerd.mjs +40 -0
- package/dist/lib/neutral/AssistantPlugin.workerd.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-ZBOZNZM7.mjs +27 -0
- package/dist/lib/neutral/BlueprintArticle-ZBOZNZM7.mjs.map +7 -0
- package/dist/lib/neutral/ChatArticle-PWD4OEFZ.mjs +8 -0
- package/dist/lib/neutral/ChatCompanion-TPY7HF3C.mjs +122 -0
- package/dist/lib/neutral/ChatCompanion-TPY7HF3C.mjs.map +7 -0
- package/dist/lib/neutral/ChatDialog-DCA6FLOV.mjs +73 -0
- package/dist/lib/neutral/ChatDialog-DCA6FLOV.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-5NYXHRG6.mjs +119 -0
- package/dist/lib/neutral/RoutineArticle-5NYXHRG6.mjs.map +7 -0
- package/dist/lib/neutral/RoutineList-SO5ETHNT.mjs +48 -0
- package/dist/lib/neutral/RoutineList-SO5ETHNT.mjs.map +7 -0
- package/dist/lib/neutral/RoutineProperties-FISLMW2R.mjs +17 -0
- package/dist/lib/neutral/RoutineProperties-FISLMW2R.mjs.map +7 -0
- package/dist/lib/neutral/TracePanel-CHJHFTTQ.mjs +136 -0
- package/dist/lib/neutral/TracePanel-CHJHFTTQ.mjs.map +7 -0
- package/dist/lib/neutral/TriggerStatus-X7Y5JFZJ.mjs +93 -0
- package/dist/lib/neutral/TriggerStatus-X7Y5JFZJ.mjs.map +7 -0
- package/dist/lib/neutral/ai-context-IABBIEHG.mjs +42 -0
- package/dist/lib/neutral/ai-context-IABBIEHG.mjs.map +7 -0
- package/dist/lib/neutral/ai-service-3SH2UQIR.mjs +42 -0
- package/dist/lib/neutral/ai-service-3SH2UQIR.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-RJW5O57E.mjs +199 -0
- package/dist/lib/neutral/app-graph-builder-RJW5O57E.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 +37 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-47OH7ZF6.mjs +8 -0
- package/dist/lib/neutral/chunk-47OH7ZF6.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-6BUTAYVO.mjs +123 -0
- package/dist/lib/neutral/chunk-6BUTAYVO.mjs.map +7 -0
- package/dist/lib/neutral/chunk-A2XIILMZ.mjs +107 -0
- package/dist/lib/neutral/chunk-A2XIILMZ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-UWI53RCD.mjs +386 -0
- package/dist/lib/neutral/chunk-UWI53RCD.mjs.map +7 -0
- package/dist/lib/neutral/chunk-XYHPOGTK.mjs +43 -0
- package/dist/lib/neutral/chunk-XYHPOGTK.mjs.map +7 -0
- package/dist/lib/neutral/companion-chat-provisioner-7RTSXL6M.mjs +116 -0
- package/dist/lib/neutral/companion-chat-provisioner-7RTSXL6M.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +2384 -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/neutral/create-chat-67GZNG3T.mjs +54 -0
- package/dist/lib/neutral/create-chat-67GZNG3T.mjs.map +7 -0
- package/dist/lib/neutral/create-object-XPVVVEKF.mjs +89 -0
- package/dist/lib/neutral/create-object-XPVVVEKF.mjs.map +7 -0
- package/dist/lib/neutral/edge-model-resolver-7SMCGDRL.mjs +50 -0
- package/dist/lib/neutral/edge-model-resolver-7SMCGDRL.mjs.map +7 -0
- package/dist/lib/{browser/ensure-companion-chat-ZEZA34MZ.mjs → neutral/ensure-companion-chat-AMOF3C66.mjs} +14 -21
- package/dist/lib/neutral/ensure-companion-chat-AMOF3C66.mjs.map +7 -0
- package/dist/lib/neutral/execution-graph/index.mjs +658 -0
- package/dist/lib/neutral/execution-graph/index.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +965 -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/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-XRTBW5OJ.mjs +174 -0
- package/dist/lib/neutral/react-surface-XRTBW5OJ.mjs.map +7 -0
- package/dist/lib/{browser/resolve-navigation-targets-NZOD66NY.mjs → neutral/resolve-navigation-targets-ZHIMMH7L.mjs} +6 -6
- package/dist/lib/neutral/resolve-navigation-targets-ZHIMMH7L.mjs.map +7 -0
- package/dist/lib/{browser/run-prompt-in-new-chat-THLK5YQC.mjs → neutral/run-prompt-in-new-chat-NRDYPCJK.mjs} +21 -55
- package/dist/lib/neutral/run-prompt-in-new-chat-NRDYPCJK.mjs.map +7 -0
- package/dist/lib/{browser/set-current-chat-LRS3VFSH.mjs → neutral/set-current-chat-VWBPSIMZ.mjs} +7 -13
- package/dist/lib/neutral/set-current-chat-VWBPSIMZ.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/testing.mjs +8 -0
- package/dist/lib/neutral/testing.mjs.map +7 -0
- package/dist/lib/neutral/toggle-trace-panel-debug-JGTB6KVJ.mjs +21 -0
- package/dist/lib/neutral/toggle-trace-panel-debug-JGTB6KVJ.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 +175 -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 +3 -1
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/AssistantPlugin.node.d.ts +5 -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/AssistantPlugin.workerd.d.ts +4 -0
- package/dist/types/src/AssistantPlugin.workerd.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/blueprints/assistant/blueprint.node.test.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/blueprint.node.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-context.d.ts +6 -0
- package/dist/types/src/capabilities/ai-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service.d.ts +2 -2
- 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 +1 -1
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +30 -2
- 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/AgentProperties/AgentProperties.d.ts +7 -0
- package/dist/types/src/components/AgentProperties/AgentProperties.d.ts.map +1 -0
- package/dist/types/src/{containers → components}/AgentProperties/AgentProperties.stories.d.ts +1 -2
- package/dist/types/src/components/AgentProperties/AgentProperties.stories.d.ts.map +1 -0
- package/dist/types/src/components/AgentProperties/index.d.ts +2 -0
- package/dist/types/src/components/AgentProperties/index.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.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 +8 -7
- 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 +2 -2
- 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 +3 -3
- 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 +4 -3
- 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/RoutineProperties/RoutineProperties.d.ts +7 -0
- package/dist/types/src/components/RoutineProperties/RoutineProperties.d.ts.map +1 -0
- package/dist/types/src/components/RoutineProperties/RoutineProperties.stories.d.ts +15 -0
- package/dist/types/src/components/RoutineProperties/RoutineProperties.stories.d.ts.map +1 -0
- package/dist/types/src/components/RoutineProperties/index.d.ts +2 -0
- package/dist/types/src/components/RoutineProperties/index.d.ts.map +1 -0
- 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 +5 -3
- 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 +3 -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 +0 -2
- 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/BlueprintArticle/BlueprintArticle.d.ts +1 -1
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -1
- package/dist/types/src/containers/{ChatContainer/ChatContainer.d.ts → ChatArticle/ChatArticle.d.ts} +3 -3
- package/dist/types/src/containers/ChatArticle/ChatArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChatArticle/ChatArticle.stories.d.ts +15 -0
- package/dist/types/src/containers/ChatArticle/ChatArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChatArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ChatArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +11 -3
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.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 +3 -4
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +5 -5
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -1
- 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 +6 -5
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/execution-graph/execution-graph.d.ts +108 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph/execution-graph.test.d.ts +2 -0
- package/dist/types/src/execution-graph/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/index.d.ts +3 -0
- package/dist/types/src/execution-graph/index.d.ts.map +1 -0
- package/dist/types/src/execution-graph/remote-snapshot.test.d.ts +2 -0
- package/dist/types/src/execution-graph/remote-snapshot.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/span-tree.d.ts +76 -0
- package/dist/types/src/execution-graph/span-tree.d.ts.map +1 -0
- package/dist/types/src/execution-graph/span-tree.test.d.ts +2 -0
- package/dist/types/src/execution-graph/span-tree.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts +40 -0
- package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts.map +1 -0
- package/dist/types/src/execution-graph/testing/index.d.ts +2 -0
- package/dist/types/src/execution-graph/testing/index.d.ts.map +1 -0
- 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 +56 -15
- 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 +5 -5
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +7 -3
- 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 +5 -4
- 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 +1 -1
- 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/meta.d.ts +3 -2
- package/dist/types/src/meta.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/prompt.node.test.d.ts +2 -0
- package/dist/types/src/operations/prompt.node.test.d.ts.map +1 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts +4 -2
- 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/toggle-trace-panel-debug.d.ts +5 -0
- package/dist/types/src/operations/toggle-trace-panel-debug.d.ts.map +1 -0
- 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 +263 -20
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/processor.node.test.d.ts +2 -0
- package/dist/types/src/processor/processor.node.test.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/snapshot.d.ts +21 -0
- package/dist/types/src/testing/snapshot.d.ts.map +1 -0
- 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 +10 -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/testing/trace-timeline.node.test.d.ts +2 -0
- package/dist/types/src/testing/trace-timeline.node.test.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +25 -8
- 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} +61 -59
- package/dist/types/src/types/AssistantOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +21 -5
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +7 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +2 -3
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/src/util/suggestions.d.ts +9 -0
- package/dist/types/src/util/suggestions.d.ts.map +1 -0
- package/dist/types/src/util/suggestions.test.d.ts +2 -0
- package/dist/types/src/util/suggestions.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +178 -138
- package/src/AssistantPlugin.conversations.json +1 -0
- package/src/AssistantPlugin.node.ts +77 -0
- package/src/AssistantPlugin.test.ts +152 -0
- package/src/AssistantPlugin.ts +147 -0
- package/src/AssistantPlugin.workerd.ts +41 -0
- package/src/blueprints/assistant/{blueprint.test.ts → blueprint.node.test.ts} +5 -5
- package/src/blueprints/assistant/blueprint.ts +4 -4
- package/src/capabilities/ai-context.ts +85 -0
- package/src/capabilities/ai-service.ts +36 -9
- package/src/capabilities/app-graph-builder.ts +55 -20
- package/src/capabilities/blueprint-definition.ts +2 -4
- package/src/capabilities/companion-chat-provisioner.ts +4 -5
- package/src/capabilities/create-object.ts +98 -0
- package/src/capabilities/edge-model-resolver.ts +47 -11
- package/src/capabilities/index.ts +10 -2
- 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 +33 -20
- package/src/components/AgentProperties/AgentProperties.stories.tsx +74 -0
- package/src/components/AgentProperties/AgentProperties.tsx +104 -0
- package/src/components/AgentProperties/index.ts +5 -0
- 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 +32 -18
- package/src/components/ChatPrompt/ChatOptions.tsx +103 -82
- package/src/components/ChatPrompt/ChatPrompt.tsx +182 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +9 -13
- 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 +7 -7
- package/src/components/ChatThread/ChatThread.stories.tsx +27 -31
- package/src/components/ChatThread/ChatThread.tsx +43 -21
- package/src/components/ChatThread/DEBUG.md +41 -0
- package/src/components/ChatThread/Link.tsx +5 -5
- package/src/components/ChatThread/MarkdownStream.stories.tsx +5 -4
- package/src/components/ChatThread/registry.tsx +62 -19
- package/src/components/ChatThread/sync.test.ts +84 -18
- package/src/components/ChatThread/sync.ts +3 -3
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +13 -7
- package/src/components/ChatThread/widgets/ReferenceWidget.ts +3 -1
- package/src/components/ChatThread/widgets/SelectWidget.ts +4 -2
- package/src/components/ChatThread/widgets/StatsWidget.ts +3 -1
- package/src/components/ChatThread/widgets/StatusWidget.ts +6 -84
- package/src/components/ChatThread/widgets/SuggestionWidget.ts +2 -2
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +3 -4
- package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +2 -1
- package/src/components/ChatThread/widgets/ToolWidget.tsx +19 -4
- 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 +13 -39
- package/src/components/ProcessTree/ProcessTree.tsx +101 -67
- package/src/components/RoutineProperties/RoutineProperties.stories.tsx +59 -0
- package/src/components/RoutineProperties/RoutineProperties.tsx +23 -0
- package/src/components/RoutineProperties/index.ts +5 -0
- 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 +5 -4
- package/src/components/TemplateEditor/TemplateEditor.tsx +11 -9
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +6 -9
- package/src/components/TemplateEditor/TemplateForm.tsx +52 -73
- package/src/components/ToolBlock/ToolBlock.tsx +1 -1
- package/src/components/Toolbox/Toolbox.stories.tsx +6 -5
- package/src/components/Toolbox/Toolbox.tsx +6 -5
- package/src/components/index.ts +3 -0
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +19 -15
- package/src/containers/AgentArticle/AgentArticle.tsx +37 -48
- package/src/containers/AgentProperties/AgentProperties.tsx +19 -103
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +2 -2
- package/src/containers/ChatArticle/ChatArticle.stories.tsx +76 -0
- package/src/containers/{ChatContainer/ChatContainer.tsx → ChatArticle/ChatArticle.tsx} +30 -17
- package/src/containers/ChatArticle/index.ts +5 -0
- package/src/containers/ChatCompanion/ChatCompanion.tsx +39 -60
- package/src/containers/ChatDialog/ChatDialog.tsx +6 -11
- 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} +9 -8
- package/src/containers/RoutineList/index.ts +5 -0
- package/src/containers/TracePanel/TracePanel.stories.tsx +251 -204
- package/src/containers/TracePanel/TracePanel.tsx +172 -72
- package/src/containers/TracePanel/dxn-extractor.test.ts +7 -7
- package/src/containers/TracePanel/dxn-extractor.ts +25 -35
- 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 +2 -1
- package/src/containers/index.ts +6 -5
- package/src/execution-graph/SPEC.md +678 -0
- package/src/execution-graph/execution-graph.test.ts +799 -0
- package/src/execution-graph/execution-graph.ts +714 -0
- package/src/execution-graph/index.ts +24 -0
- package/src/execution-graph/remote-snapshot.test.ts +116 -0
- package/src/execution-graph/span-tree.test.ts +249 -0
- package/src/execution-graph/span-tree.ts +259 -0
- package/src/execution-graph/testing/collect-trace-events.ts +74 -0
- package/src/execution-graph/testing/index.ts +5 -0
- package/src/{queue-logger.ts → feed-logger.ts} +39 -25
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useBlueprintRegistry.ts +62 -46
- package/src/hooks/useChatKeymap.ts +52 -0
- package/src/hooks/useChatProcessor.ts +30 -14
- package/src/hooks/useChatServices.ts +8 -6
- package/src/hooks/useChatToolbarActions.ts +87 -89
- package/src/hooks/useContextBinder.ts +4 -4
- package/src/hooks/useContextObjects.ts +6 -5
- package/src/hooks/useDebug.ts +38 -0
- package/src/hooks/useFilteredTypes.ts +17 -16
- package/src/hooks/useReferencesProvider.ts +7 -15
- package/src/index.ts +0 -5
- package/src/meta.ts +27 -8
- package/src/operations/create-chat.ts +14 -37
- package/src/operations/ensure-companion-chat.ts +49 -47
- package/src/operations/index.ts +2 -3
- package/src/operations/on-create-space.ts +4 -4
- package/src/operations/{prompt.test.ts → prompt.node.test.ts} +24 -23
- package/src/operations/resolve-navigation-targets.ts +8 -3
- package/src/operations/run-prompt-in-new-chat.ts +86 -86
- package/src/operations/set-current-chat.ts +6 -7
- package/src/operations/toggle-trace-panel-debug.ts +27 -0
- package/src/operations/update-chat-name.ts +4 -4
- package/src/plugin.ts +11 -0
- package/src/processor/{processor.test.ts → processor.node.test.ts} +6 -6
- package/src/processor/processor.ts +112 -33
- package/src/testing/data/trace-timeline-multiple.dx.json +1 -0
- package/src/testing/data/trace-timeline-remote.dx.json +1 -0
- package/src/testing/data/trace-timeline.dx.json +3737 -1200
- package/src/testing/index.ts +2 -0
- package/src/testing/snapshot.ts +35 -0
- package/src/testing/test-generator.test.ts +42 -52
- package/src/testing/test-generator.ts +177 -192
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +1 -1
- package/src/testing/test-trace.ts +20 -0
- package/src/testing/trace-timeline.node.conversations.json +1 -0
- package/src/testing/{trace-timeline.test.ts → trace-timeline.node.test.ts} +44 -49
- package/src/testing.ts +9 -0
- package/src/translations.ts +34 -37
- 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} +57 -20
- package/src/types/Settings.ts +68 -7
- package/src/types/index.ts +11 -3
- package/src/types/service.ts +5 -10
- package/src/util/suggestions.test.ts +52 -0
- package/src/util/suggestions.ts +42 -0
- package/src/vite-env.d.ts +5 -0
- 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 +0 -82
- 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/blueprints/assistant/blueprint.test.d.ts +0 -2
- package/dist/types/src/blueprints/assistant/blueprint.test.d.ts.map +0 -1
- 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/AgentProperties/AgentProperties.stories.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/index.d.ts +0 -2
- package/dist/types/src/containers/ChatContainer/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.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/containers/TracePanel/execution-graph.d.ts +0 -17
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/dist/types/src/operations/prompt.test.d.ts +0 -2
- package/dist/types/src/operations/prompt.test.d.ts.map +0 -1
- package/dist/types/src/processor/processor.test.d.ts +0 -2
- package/dist/types/src/processor/processor.test.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/testing/trace-timeline.test.d.ts +0 -2
- package/dist/types/src/testing/trace-timeline.test.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/AgentProperties/AgentProperties.stories.tsx +0 -100
- package/src/containers/ChatContainer/index.ts +0 -5
- 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/containers/TracePanel/execution-graph.ts +0 -452
- package/src/testing/trace-timeline.conversations.json +0 -1
- 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/AssistantPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/ChatArticle-PWD4OEFZ.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/{node-esm/blueprints/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
|
@@ -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 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';
|
|
@@ -30,7 +30,7 @@ export const ChatStatusIndicator = ({ classNames, preset, processing, error, ...
|
|
|
30
30
|
);
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
|
-
<div
|
|
33
|
+
<div className={mx('relative flex', classNames)}>
|
|
34
34
|
<Spinner duration={period} state={!init ? 'flash' : error ? 'error' : processing ? 'spin' : 'pulse'} {...props} />
|
|
35
35
|
{error && (
|
|
36
36
|
<Tooltip.Trigger asChild content={error.message}>
|
|
@@ -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';
|
|
@@ -9,9 +9,9 @@ import React from 'react';
|
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { Database, Filter, Obj } from '@dxos/echo';
|
|
11
11
|
import { DxAnchor } from '@dxos/lit-ui/react';
|
|
12
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
12
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
13
13
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
14
|
-
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
14
|
+
import { PreviewPlugin } from '@dxos/plugin-preview/testing';
|
|
15
15
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
16
16
|
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
17
17
|
import { Loading, withLayout } from '@dxos/react-ui/testing';
|
|
@@ -21,9 +21,9 @@ import { Organization } from '@dxos/types';
|
|
|
21
21
|
* Production-style click → popover demo.
|
|
22
22
|
*
|
|
23
23
|
* Wires up the same chain Composer uses:
|
|
24
|
-
* - `<DxAnchor
|
|
24
|
+
* - `<DxAnchor uri=…>label</DxAnchor>` fires `DxAnchorActivate` on click.
|
|
25
25
|
* - `PreviewPlugin`'s `preview-popover` capability listens for the event, resolves the DXN
|
|
26
|
-
* to a real ECHO object via `space.db.makeRef(
|
|
26
|
+
* to a real ECHO object via `space.db.makeRef(uri).load()`, then invokes
|
|
27
27
|
* `LayoutOperation.UpdatePopover`.
|
|
28
28
|
* - `StorybookPlugin` provides both the `LayoutOperation.UpdatePopover` handler (mutating
|
|
29
29
|
* the layout-state atom) and the `<Layout>` shell that renders the popover via
|
|
@@ -41,12 +41,12 @@ const DefaultStory = () => {
|
|
|
41
41
|
return <Loading />;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
const
|
|
44
|
+
const uri = Obj.getURI(organization);
|
|
45
45
|
return (
|
|
46
|
-
<div
|
|
46
|
+
<div className='flex flex-col gap-2 p-4'>
|
|
47
47
|
<p>
|
|
48
48
|
Click{' '}
|
|
49
|
-
<DxAnchor className='dx-tag--anchor' dxn={
|
|
49
|
+
<DxAnchor className='dx-tag--anchor' dxn={uri}>
|
|
50
50
|
{organization.name}
|
|
51
51
|
</DxAnchor>{' '}
|
|
52
52
|
to open the popover.
|
|
@@ -9,39 +9,44 @@ import * as Layer from 'effect/Layer';
|
|
|
9
9
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
10
10
|
|
|
11
11
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import {
|
|
12
|
+
import { createFeedServiceLayer } from '@dxos/client/echo';
|
|
13
|
+
import { Database, Feed, Filter, Query } from '@dxos/echo';
|
|
13
14
|
import { runAndForwardErrors } from '@dxos/effect';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
17
|
-
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
15
|
+
import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
|
|
16
|
+
import { PreviewPlugin } from '@dxos/plugin-preview/testing';
|
|
18
17
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
19
18
|
import { random } from '@dxos/random';
|
|
20
|
-
import {
|
|
19
|
+
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
21
20
|
import { EditorPreviewProvider } from '@dxos/react-ui-editor';
|
|
22
21
|
import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
23
22
|
import { Message, Organization, Person } from '@dxos/types';
|
|
24
23
|
|
|
25
24
|
import { createMessageGenerator } from '#testing';
|
|
25
|
+
import { translations } from '#translations';
|
|
26
26
|
|
|
27
|
-
import { translations } from '../../translations';
|
|
28
27
|
import { ChatThread, type ChatThreadProps } from './ChatThread';
|
|
29
28
|
|
|
30
29
|
random.seed(1);
|
|
31
30
|
|
|
32
|
-
type MessageGenerator = Effect.Effect<void, never, Database.Service |
|
|
31
|
+
type MessageGenerator = Effect.Effect<void, never, Database.Service | Feed.ContextFeedService | Feed.FeedService>;
|
|
33
32
|
|
|
34
33
|
type DefaultStoryProps = { generator?: MessageGenerator[]; delay?: number; wait?: boolean } & ChatThreadProps;
|
|
35
34
|
|
|
36
35
|
const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStoryProps) => {
|
|
37
36
|
const [space] = useSpaces();
|
|
38
|
-
const
|
|
39
|
-
|
|
37
|
+
const feed = useMemo<Feed.Feed | undefined>(
|
|
38
|
+
() => (space ? space.db.add(Feed.make({ name: 'chat' })) : undefined),
|
|
39
|
+
[space],
|
|
40
|
+
);
|
|
41
|
+
const messages = useQuery(
|
|
42
|
+
space?.db,
|
|
43
|
+
feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),
|
|
44
|
+
);
|
|
40
45
|
const [done, setDone] = useState(false);
|
|
41
46
|
|
|
42
47
|
// Generate messages.
|
|
43
48
|
useEffect(() => {
|
|
44
|
-
if (!space || !
|
|
49
|
+
if (!space || !feed) {
|
|
45
50
|
return;
|
|
46
51
|
}
|
|
47
52
|
|
|
@@ -55,13 +60,21 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStor
|
|
|
55
60
|
}
|
|
56
61
|
|
|
57
62
|
setDone(true);
|
|
58
|
-
}).pipe(
|
|
63
|
+
}).pipe(
|
|
64
|
+
Effect.provide(
|
|
65
|
+
Layer.mergeAll(
|
|
66
|
+
Database.layer(space.db),
|
|
67
|
+
Feed.ContextFeedService.layer(feed),
|
|
68
|
+
createFeedServiceLayer(space.queues),
|
|
69
|
+
),
|
|
70
|
+
),
|
|
71
|
+
),
|
|
59
72
|
);
|
|
60
73
|
|
|
61
74
|
return () => {
|
|
62
75
|
void runAndForwardErrors(Fiber.interrupt(fiber));
|
|
63
76
|
};
|
|
64
|
-
}, [space,
|
|
77
|
+
}, [space, feed, generator, delay]);
|
|
65
78
|
|
|
66
79
|
if (wait && !done) {
|
|
67
80
|
return <Loading data={{ wait, done }} />;
|
|
@@ -74,23 +87,6 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStor
|
|
|
74
87
|
);
|
|
75
88
|
};
|
|
76
89
|
|
|
77
|
-
const useQueueMessages = (queue?: Queue<Message.Message>) => {
|
|
78
|
-
const [messages, setMessages] = useState<Message.Message[]>([]);
|
|
79
|
-
|
|
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;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
90
|
const meta = {
|
|
95
91
|
title: 'plugins/plugin-assistant/components/ChatThread',
|
|
96
92
|
component: ChatThread,
|
|
@@ -136,7 +132,7 @@ export const Delayed: Story = {
|
|
|
136
132
|
delay: 500,
|
|
137
133
|
options: {
|
|
138
134
|
autoScroll: true,
|
|
139
|
-
|
|
135
|
+
typewriter: true,
|
|
140
136
|
cursor: true,
|
|
141
137
|
},
|
|
142
138
|
},
|
|
@@ -2,28 +2,25 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
5
|
+
import React, { forwardRef, useCallback, useEffect, useMemo, useRef, 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
|
-
|
|
23
|
-
|
|
24
|
-
// see in the MarkdownStream/Reasoning story.
|
|
25
|
-
wire: true,
|
|
26
|
-
cursor: true,
|
|
21
|
+
cursor: false,
|
|
22
|
+
fader: false,
|
|
23
|
+
typewriter: true,
|
|
27
24
|
};
|
|
28
25
|
|
|
29
26
|
export type ChatThreadProps = ThemedClassName<
|
|
@@ -31,13 +28,27 @@ export type ChatThreadProps = ThemedClassName<
|
|
|
31
28
|
identity?: Identity;
|
|
32
29
|
messages?: Message.Message[];
|
|
33
30
|
error?: Error;
|
|
31
|
+
viewType?: Assistant.ChatView;
|
|
34
32
|
onEvent?: (event: ChatEvent) => void;
|
|
35
|
-
} & Pick<MarkdownStreamProps, 'options' | 'debug'>
|
|
33
|
+
} & Pick<MarkdownStreamProps, 'options' | 'debug' | 'extensions' | 'footer'>
|
|
36
34
|
>;
|
|
37
35
|
|
|
38
|
-
// TODO(burdon): Memo thread position.
|
|
39
36
|
export const ChatThread = forwardRef<MarkdownStreamController | null, ChatThreadProps>(
|
|
40
|
-
(
|
|
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
|
+
) => {
|
|
41
52
|
const [controller, setController] = useState<MarkdownStreamController | null>(null);
|
|
42
53
|
const handleMarkdownStreamRef = useCallback(
|
|
43
54
|
(instance: MarkdownStreamController | null) => {
|
|
@@ -52,17 +63,28 @@ export const ChatThread = forwardRef<MarkdownStreamController | null, ChatThread
|
|
|
52
63
|
[identity],
|
|
53
64
|
);
|
|
54
65
|
|
|
55
|
-
//
|
|
66
|
+
// Jump to the bottom instantly when the thread first mounts (e.g. opening the companion);
|
|
67
|
+
// smooth-scroll only on subsequent error changes.
|
|
68
|
+
const initializedRef = useRef(false);
|
|
56
69
|
useEffect(() => {
|
|
57
|
-
controller
|
|
70
|
+
if (!controller) {
|
|
71
|
+
// MarkdownStream is keyed by viewType; switching views replaces the controller. Reset so
|
|
72
|
+
// the first scroll for the new controller is instant rather than animated.
|
|
73
|
+
initializedRef.current = false;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
controller.scrollToBottom(initializedRef.current ? 'smooth' : 'instant');
|
|
77
|
+
initializedRef.current = true;
|
|
58
78
|
}, [controller, error]);
|
|
59
79
|
|
|
60
80
|
// Update document.
|
|
61
|
-
const
|
|
81
|
+
const renderer = useMemo(() => createBlockRenderer(viewType), [viewType]);
|
|
82
|
+
const syncer = useMemo(() => controller && new MessageSyncer(controller, renderer), [controller, renderer]);
|
|
62
83
|
useEffect(() => {
|
|
63
84
|
if (!syncer) {
|
|
64
85
|
return;
|
|
65
86
|
}
|
|
87
|
+
|
|
66
88
|
if (syncer.update(messages)) {
|
|
67
89
|
controller?.scrollToBottom('instant');
|
|
68
90
|
}
|
|
@@ -82,15 +104,15 @@ export const ChatThread = forwardRef<MarkdownStreamController | null, ChatThread
|
|
|
82
104
|
);
|
|
83
105
|
|
|
84
106
|
return (
|
|
85
|
-
<div
|
|
86
|
-
role='none'
|
|
87
|
-
data-hue={userHue}
|
|
88
|
-
className={mx('flex h-full w-full justify-center overflow-hidden', classNames)}
|
|
89
|
-
>
|
|
107
|
+
<div data-hue={userHue} className='contents'>
|
|
90
108
|
<MarkdownStream
|
|
109
|
+
key={viewType}
|
|
110
|
+
classNames={classNames}
|
|
91
111
|
registry={componentRegistry}
|
|
92
112
|
options={options}
|
|
93
113
|
debug={debug}
|
|
114
|
+
extensions={extensions}
|
|
115
|
+
footer={footer}
|
|
94
116
|
onEvent={handleEvent}
|
|
95
117
|
ref={handleMarkdownStreamRef}
|
|
96
118
|
/>
|
|
@@ -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.)
|
|
@@ -6,20 +6,20 @@ import React, { useMemo } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type Space } from '@dxos/client/echo';
|
|
8
8
|
import { Entity } from '@dxos/echo';
|
|
9
|
-
import { type
|
|
9
|
+
import { type URI } from '@dxos/keys';
|
|
10
10
|
import { DxAnchor } from '@dxos/lit-ui/react';
|
|
11
11
|
|
|
12
12
|
export type ObjectLinkProps = {
|
|
13
13
|
space: Space;
|
|
14
|
-
dxn:
|
|
14
|
+
dxn: URI.URI;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const ObjectLink = ({ space, dxn }: ObjectLinkProps) => {
|
|
18
|
-
const ref = useMemo(() => space.db.makeRef(dxn), [space, dxn
|
|
18
|
+
const ref = useMemo(() => space.db.makeRef(dxn), [space, dxn]);
|
|
19
19
|
|
|
20
|
-
const title = (ref.target && Entity.getLabel(ref.target)) ?? ref.target?.id ?? ref.
|
|
20
|
+
const title = (ref.target && Entity.getLabel(ref.target)) ?? ref.target?.id ?? ref.uri;
|
|
21
21
|
return (
|
|
22
|
-
<DxAnchor rootclassname='dx-tag--anchor' dxn={dxn
|
|
22
|
+
<DxAnchor rootclassname='dx-tag--anchor' dxn={dxn}>
|
|
23
23
|
{title}
|
|
24
24
|
</DxAnchor>
|
|
25
25
|
);
|
|
@@ -15,12 +15,13 @@ 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';
|
|
25
26
|
import REASONING from './testing/reasoning.md?raw';
|
|
26
27
|
import THINKING from './testing/thinking.md?raw';
|
|
@@ -207,7 +208,7 @@ export const Streaming: Story = {
|
|
|
207
208
|
content: THREAD_1,
|
|
208
209
|
options: {
|
|
209
210
|
autoScroll: true,
|
|
210
|
-
|
|
211
|
+
typewriter: true,
|
|
211
212
|
cursor: true,
|
|
212
213
|
},
|
|
213
214
|
},
|
|
@@ -273,7 +274,7 @@ export const Reasoning: Story = {
|
|
|
273
274
|
content: REASONING_PARTS.body,
|
|
274
275
|
options: {
|
|
275
276
|
autoScroll: true,
|
|
276
|
-
|
|
277
|
+
typewriter: true,
|
|
277
278
|
cursor: true,
|
|
278
279
|
},
|
|
279
280
|
},
|
|
@@ -8,11 +8,11 @@ import { log } from '@dxos/log';
|
|
|
8
8
|
import { ContentBlock, type Message } from '@dxos/types';
|
|
9
9
|
import { type XmlWidgetRegistry, getXmlTextChild } from '@dxos/ui-editor';
|
|
10
10
|
|
|
11
|
+
import { type Assistant } from '../../types';
|
|
11
12
|
import { type BlockRenderer, type MessageThreadContext } from './sync';
|
|
12
13
|
import { applyToolBlockToWidgetState } from './tool-widget-state';
|
|
13
14
|
import {
|
|
14
15
|
FallbackWidget,
|
|
15
|
-
PromptWidget,
|
|
16
16
|
ReasoningWidget,
|
|
17
17
|
ReferenceWidget,
|
|
18
18
|
SelectWidget,
|
|
@@ -25,19 +25,28 @@ import {
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Custom XML tags registry.
|
|
28
|
+
*
|
|
29
|
+
* NOTE: `<prompt>` has no widget — it is rendered via mark + line decorations
|
|
30
|
+
* (`xmlBlockDecoration`) in MarkdownStream so the prompt text remains part of the document
|
|
31
|
+
* and can be highlighted by `xmlFormatting`. It is still listed here so the markdown block
|
|
32
|
+
* parser (`xmlBlockParsers`) knows to keep `<prompt>...</prompt>` as a single HTMLBlock
|
|
33
|
+
* — otherwise an unregistered prompt opens a Paragraph that lazy-continues into the
|
|
34
|
+
* following lines and breaks parsing of subsequent multi-line tags (e.g. a `<reasoning>`
|
|
35
|
+
* block whose content contains an ordered list).
|
|
28
36
|
*/
|
|
29
37
|
export const componentRegistry: XmlWidgetRegistry = {
|
|
30
38
|
//
|
|
31
|
-
//
|
|
39
|
+
// Block-only (no widget — see note above).
|
|
32
40
|
//
|
|
33
41
|
|
|
34
42
|
prompt: {
|
|
35
43
|
block: true,
|
|
36
|
-
factory: ({ children }) => {
|
|
37
|
-
const text = getXmlTextChild(children);
|
|
38
|
-
return text ? new PromptWidget(text) : null;
|
|
39
|
-
},
|
|
40
44
|
},
|
|
45
|
+
|
|
46
|
+
//
|
|
47
|
+
// DOM Widgets
|
|
48
|
+
//
|
|
49
|
+
|
|
41
50
|
synthetic: {
|
|
42
51
|
block: true,
|
|
43
52
|
factory: ({ children, range }) => {
|
|
@@ -89,9 +98,9 @@ export const componentRegistry: XmlWidgetRegistry = {
|
|
|
89
98
|
status: {
|
|
90
99
|
block: true,
|
|
91
100
|
streaming: true,
|
|
92
|
-
factory: ({ children
|
|
101
|
+
factory: ({ children }) => {
|
|
93
102
|
const text = getXmlTextChild(children);
|
|
94
|
-
return text ? new StatusWidget(text
|
|
103
|
+
return text ? new StatusWidget(text) : null;
|
|
95
104
|
},
|
|
96
105
|
},
|
|
97
106
|
|
|
@@ -106,7 +115,7 @@ export const componentRegistry: XmlWidgetRegistry = {
|
|
|
106
115
|
toolCall: {
|
|
107
116
|
block: true,
|
|
108
117
|
Component: (props) => (
|
|
109
|
-
<div
|
|
118
|
+
<div className='py-2'>
|
|
110
119
|
<ToolWidget {...props} />
|
|
111
120
|
</div>
|
|
112
121
|
),
|
|
@@ -133,17 +142,51 @@ export const componentRegistry: XmlWidgetRegistry = {
|
|
|
133
142
|
/**
|
|
134
143
|
* Convert block to markdown.
|
|
135
144
|
*/
|
|
136
|
-
export const blockToMarkdown: BlockRenderer = (
|
|
137
|
-
|
|
145
|
+
export const blockToMarkdown: BlockRenderer = createBlockRenderer('normal');
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Create a {@link BlockRenderer} that filters blocks based on the chat view type.
|
|
149
|
+
*
|
|
150
|
+
* - `summary`: only user prompts.
|
|
151
|
+
* - `normal`: user prompts + assistant text + tool calls + summary/select/suggestion/reference + status. Hides reasoning.
|
|
152
|
+
* - `thinking`: same as normal plus reasoning.
|
|
153
|
+
* - `debug`: renders every block (raw fallbacks visible).
|
|
154
|
+
*/
|
|
155
|
+
export function createBlockRenderer(viewType: Assistant.ChatView | undefined): BlockRenderer {
|
|
156
|
+
return (context, message, block) => {
|
|
157
|
+
if (!isBlockVisible(viewType, message, block)) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
let str = blockToMarkdownImpl(context, message, block);
|
|
161
|
+
if (str && !block.pending) {
|
|
162
|
+
// Use a blank line as the block separator so each rendered block parses as its own
|
|
163
|
+
// markdown block. A single newline lets CommonMark absorb a following `<prompt>` (an
|
|
164
|
+
// HTML type-7 tag, which can't interrupt an open paragraph) into the previous
|
|
165
|
+
// paragraph, rendering the prompt bubble inline next to the prior assistant text.
|
|
166
|
+
return (str += '\n');
|
|
167
|
+
}
|
|
168
|
+
return str;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const isBlockVisible = (
|
|
173
|
+
viewType: Assistant.ChatView | undefined,
|
|
138
174
|
message: Message.Message,
|
|
139
175
|
block: ContentBlock.Any,
|
|
140
|
-
) => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
176
|
+
): boolean => {
|
|
177
|
+
switch (viewType) {
|
|
178
|
+
case 'debug':
|
|
179
|
+
return true;
|
|
180
|
+
case 'normal':
|
|
181
|
+
return block._tag !== 'reasoning';
|
|
182
|
+
case 'summary':
|
|
183
|
+
// Show only conversational text (user prompts + assistant replies); hide reasoning,
|
|
184
|
+
// tool calls, status, stats, and synthetic system messages.
|
|
185
|
+
return block._tag === 'text' && (block as ContentBlock.Text).disposition !== 'synthetic';
|
|
186
|
+
case 'thinking':
|
|
187
|
+
default:
|
|
188
|
+
return true;
|
|
144
189
|
}
|
|
145
|
-
|
|
146
|
-
return str;
|
|
147
190
|
};
|
|
148
191
|
|
|
149
192
|
const blockToMarkdownImpl = (context: MessageThreadContext, message: Message.Message, block: ContentBlock.Any) => {
|
|
@@ -154,7 +197,7 @@ const blockToMarkdownImpl = (context: MessageThreadContext, message: Message.Mes
|
|
|
154
197
|
if (block.disposition === 'synthetic') {
|
|
155
198
|
return renderXMLBlock('synthetic', { content: block.text, pending: block.pending });
|
|
156
199
|
} else {
|
|
157
|
-
return
|
|
200
|
+
return `\n<prompt>${block.text}</prompt>`;
|
|
158
201
|
}
|
|
159
202
|
} else {
|
|
160
203
|
const text = block.text.trim();
|
|
@@ -169,7 +212,7 @@ const blockToMarkdownImpl = (context: MessageThreadContext, message: Message.Mes
|
|
|
169
212
|
if (block.pending) {
|
|
170
213
|
return;
|
|
171
214
|
}
|
|
172
|
-
const dxn = block.reference.
|
|
215
|
+
const dxn = block.reference.uri;
|
|
173
216
|
return `<reference ref="${dxn.toString()}">${context.getObjectLabel(dxn)}</reference>`;
|
|
174
217
|
}
|
|
175
218
|
|