@dxos/plugin-assistant 0.8.4-main.9735255 → 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 +27 -8
- package/dist/lib/browser/blueprints/index.mjs.map +4 -4
- package/dist/lib/browser/chunk-DVOOFAWU.mjs +175 -0
- 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-SEMCG4ZK.mjs +195 -0
- 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/create-chat-E2ZLVTLP.mjs +73 -0
- package/dist/lib/browser/create-chat-E2ZLVTLP.mjs.map +7 -0
- package/dist/lib/browser/ensure-companion-chat-7GDMXSQW.mjs +65 -0
- 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/index.mjs +37 -309
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/on-create-space-4J3KTNAJ.mjs +22 -0
- package/dist/lib/browser/on-create-space-4J3KTNAJ.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/resolve-navigation-targets-3ZPQE6SZ.mjs +22 -0
- package/dist/lib/browser/resolve-navigation-targets-3ZPQE6SZ.mjs.map +7 -0
- package/dist/lib/browser/run-prompt-in-new-chat-AA3KPBDN.mjs +106 -0
- package/dist/lib/browser/run-prompt-in-new-chat-AA3KPBDN.mjs.map +7 -0
- package/dist/lib/browser/set-current-chat-P4VHI3YF.mjs +54 -0
- 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 -6
- package/dist/lib/browser/update-chat-name-VWKNUON7.mjs +56 -0
- 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 +27 -8
- 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-MBDVPB4V.mjs +176 -0
- package/dist/lib/node-esm/chunk-MBDVPB4V.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs +196 -0
- 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-UQQ3542N.mjs +74 -0
- package/dist/lib/node-esm/create-chat-UQQ3542N.mjs.map +7 -0
- package/dist/lib/node-esm/ensure-companion-chat-LVCPD4DJ.mjs +66 -0
- 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 +37 -309
- 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-M63UBTTT.mjs +23 -0
- package/dist/lib/node-esm/on-create-space-M63UBTTT.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/resolve-navigation-targets-HO77CAFT.mjs +23 -0
- package/dist/lib/node-esm/resolve-navigation-targets-HO77CAFT.mjs.map +7 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-RIRYYYPK.mjs +107 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-RIRYYYPK.mjs.map +7 -0
- package/dist/lib/node-esm/set-current-chat-Z7GJ52VX.mjs +55 -0
- 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 -6
- package/dist/lib/node-esm/update-chat-name-GV4HX32Z.mjs +57 -0
- 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 +4 -0
- package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/index.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +1 -6
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +6 -0
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts +9 -0
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +7 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +29 -11
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +16 -0
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown.d.ts +5 -0
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/migrations.d.ts +5 -0
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +6 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +21 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit.d.ts +6 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- 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 +4 -6
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts +15 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/index.d.ts +1 -1
- package/dist/types/src/components/AssistantSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +36 -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 +2 -1
- 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 +7 -4
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +8 -313
- 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 +42 -0
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -0
- 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 +44 -17
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/tool-widget-state.d.ts +18 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +8 -0
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts +25 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts +18 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts +9 -0
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts +14 -0
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts +12 -0
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +25 -0
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts +11 -0
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts +5 -0
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts +9 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts +15 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -0
- 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 +10 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +11 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +7 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/index.d.ts +2 -0
- package/dist/types/src/components/ProcessTree/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +6 -5
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +1 -305
- 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 -305
- 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 -13
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +11 -9
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +1 -305
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -12
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts +6 -0
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -0
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts +21 -0
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/AgentArticle/index.d.ts +2 -0
- package/dist/types/src/containers/AgentArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts +6 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts +16 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts.map +1 -0
- package/dist/types/src/containers/AgentProperties/index.d.ts +2 -0
- package/dist/types/src/containers/AgentProperties/index.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +6 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts +2 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +18 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts +2 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +12 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts +2 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatDialog}/ChatDialog.d.ts +2 -3
- package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts +2 -0
- package/dist/types/src/containers/ChatDialog/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/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 +8 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
- 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 +19 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts +2 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts.map +1 -0
- 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 +4 -0
- package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -0
- 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 +5 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts +2 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +12 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +2 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/extensions/prompt-extension.d.ts +10 -0
- package/dist/types/src/extensions/prompt-extension.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 +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 +8 -7
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +3 -6
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +2 -2
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextBinder.d.ts +3 -2
- 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 +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 +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/meta.d.ts +2 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +5 -0
- package/dist/types/src/operations/create-chat.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +140 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/ensure-companion-chat.d.ts +5 -0
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/on-create-space.d.ts +5 -0
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
- 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 +15 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -0
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +5 -0
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -0
- package/dist/types/src/operations/set-current-chat.d.ts +5 -0
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -0
- package/dist/types/src/operations/update-chat-name.d.ts +5 -0
- package/dist/types/src/operations/update-chat-name.d.ts.map +1 -0
- package/dist/types/src/processor/index.d.ts +0 -1
- package/dist/types/src/processor/index.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 +53 -30
- 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 +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.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 -305
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +33 -39
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +26 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +12 -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 +1 -2
- 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 +144 -102
- package/src/AssistantPlugin.node.ts +125 -0
- package/src/AssistantPlugin.test.ts +35 -0
- package/src/AssistantPlugin.tsx +161 -59
- package/src/blueprints/assistant/blueprint.test.ts +46 -0
- package/src/blueprints/assistant/blueprint.ts +31 -0
- package/src/blueprints/assistant/index.ts +5 -0
- package/src/blueprints/index.ts +1 -8
- package/src/capabilities/{ai-service/ai-service.ts → ai-service.ts} +4 -3
- package/src/capabilities/app-graph-builder.ts +161 -0
- package/src/capabilities/blueprint-definition.ts +56 -0
- package/src/capabilities/companion-chat-provisioner.ts +164 -0
- package/src/capabilities/{edge-model-resolver/edge-model-resolver.ts → edge-model-resolver.ts} +4 -3
- package/src/capabilities/index.ts +23 -11
- package/src/capabilities/{local-model-resolver/local-model-resolver.ts → local-model-resolver.ts} +17 -6
- package/src/capabilities/markdown.ts +40 -0
- package/src/capabilities/migrations.ts +28 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +167 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +5 -4
- package/src/capabilities/{state/state.ts → state.ts} +11 -3
- package/src/capabilities/toolkit.ts +13 -0
- package/src/{components/Typewriter → cli}/index.ts +1 -1
- package/src/cli/plugin.ts +83 -0
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +35 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +30 -107
- package/src/components/AssistantSettings/index.ts +2 -2
- package/src/components/Chat/Chat.tsx +103 -264
- package/src/components/Chat/context.ts +39 -0
- package/src/components/ChatPrompt/ChatActions.tsx +33 -13
- package/src/components/ChatPrompt/ChatMcpErrors.tsx +50 -0
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +136 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +248 -42
- package/src/components/ChatPrompt/ChatPrompt.tsx +182 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +18 -8
- 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 +64 -71
- package/src/components/ChatThread/ChatThread.tsx +50 -24
- package/src/components/ChatThread/DEBUG.md +41 -0
- package/src/components/ChatThread/Link.tsx +1 -1
- package/src/components/ChatThread/MarkdownStream.stories.tsx +281 -0
- package/src/components/ChatThread/registry.tsx +167 -55
- package/src/components/ChatThread/sync.test.ts +182 -20
- package/src/components/ChatThread/sync.ts +93 -97
- package/src/components/ChatThread/testing/reasoning.md +25 -0
- package/src/components/ChatThread/testing/thinking.md +21 -0
- package/src/components/ChatThread/testing/thread-1.md +30 -0
- package/src/components/ChatThread/testing/{thread.md → thread-2.md} +19 -0
- package/src/components/ChatThread/testing/thread-widgets.md +79 -0
- package/src/components/ChatThread/tool-widget-state.test.ts +34 -0
- package/src/components/ChatThread/tool-widget-state.ts +48 -0
- package/src/components/ChatThread/widgets/FallbackWidget.tsx +26 -0
- package/src/components/ChatThread/widgets/ReasoningWidget.stories.tsx +68 -0
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +133 -0
- package/src/components/ChatThread/widgets/ReferenceWidget.ts +33 -0
- package/src/components/ChatThread/widgets/SelectWidget.ts +39 -0
- package/src/components/ChatThread/widgets/StatsWidget.ts +31 -0
- package/src/components/ChatThread/widgets/StatusWidget.ts +133 -0
- package/src/components/ChatThread/widgets/SuggestionWidget.ts +41 -0
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +29 -0
- package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +55 -0
- package/src/components/ChatThread/widgets/ToolWidget.tsx +156 -0
- package/src/components/ChatThread/widgets/defaults.ts +8 -0
- package/src/components/ChatThread/widgets/index.ts +13 -0
- package/src/components/ProcessTree/ProcessTree.stories.tsx +83 -0
- package/src/components/ProcessTree/ProcessTree.tsx +118 -0
- package/src/components/ProcessTree/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +6 -10
- package/src/components/TemplateEditor/TemplateEditor.tsx +51 -43
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +9 -7
- package/src/components/TemplateEditor/TemplateForm.tsx +12 -13
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +5 -5
- package/src/components/ToolBlock/ToolBlock.tsx +22 -21
- package/src/components/Toolbox/Toolbox.stories.tsx +5 -6
- package/src/components/Toolbox/Toolbox.tsx +67 -61
- package/src/components/index.ts +3 -7
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +120 -0
- package/src/containers/AgentArticle/AgentArticle.tsx +200 -0
- package/src/containers/AgentArticle/index.ts +5 -0
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +101 -0
- package/src/containers/AgentProperties/AgentProperties.tsx +127 -0
- package/src/containers/AgentProperties/index.ts +5 -0
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +29 -0
- package/src/containers/BlueprintArticle/index.ts +5 -0
- package/src/{components → containers/ChatCompanion}/ChatCompanion.tsx +24 -45
- package/src/containers/ChatCompanion/index.ts +5 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +105 -0
- package/src/containers/ChatContainer/index.ts +5 -0
- package/src/{components → containers/ChatDialog}/ChatDialog.tsx +11 -19
- package/src/containers/ChatDialog/index.ts +5 -0
- package/src/containers/RoutineArticle/RoutineArticle.tsx +59 -0
- package/src/containers/RoutineArticle/index.ts +5 -0
- package/src/containers/RoutineList/RoutineList.stories.tsx +130 -0
- package/src/containers/RoutineList/RoutineList.tsx +50 -0
- package/src/containers/RoutineList/index.ts +5 -0
- package/src/containers/TracePanel/TracePanel.stories.tsx +278 -0
- package/src/containers/TracePanel/TracePanel.tsx +138 -0
- package/src/containers/TracePanel/dxn-extractor.test.ts +153 -0
- package/src/containers/TracePanel/dxn-extractor.ts +178 -0
- package/src/containers/TracePanel/execution-graph.test.ts +382 -0
- package/src/containers/TracePanel/execution-graph.ts +579 -0
- package/src/containers/TracePanel/index.ts +9 -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 +129 -0
- package/src/containers/TriggerStatus/index.ts +5 -0
- package/src/containers/index.ts +16 -0
- package/src/extensions/index.ts +5 -0
- package/src/extensions/prompt-extension.ts +111 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useBlueprintRegistry.ts +9 -5
- package/src/hooks/useChatKeymap.ts +52 -0
- package/src/hooks/useChatProcessor.ts +38 -25
- package/src/hooks/useChatServices.ts +7 -28
- package/src/hooks/useChatToolbarActions.ts +13 -12
- package/src/hooks/useContextBinder.ts +17 -6
- package/src/hooks/useContextObjects.ts +8 -4
- package/src/hooks/useDebug.ts +38 -0
- package/src/hooks/useFilteredTypes.ts +3 -3
- package/src/hooks/usePresets.ts +2 -1
- package/src/hooks/useReferencesProvider.ts +1 -5
- package/src/index.ts +8 -6
- package/src/meta.ts +6 -3
- package/src/operations/create-chat.ts +79 -0
- package/src/operations/definitions.ts +126 -0
- package/src/operations/ensure-companion-chat.ts +61 -0
- package/src/operations/index.ts +17 -0
- package/src/operations/on-create-space.ts +24 -0
- package/src/operations/prompt.test.ts +77 -0
- package/src/operations/resolve-navigation-targets.ts +26 -0
- package/src/operations/run-prompt-in-new-chat.ts +112 -0
- package/src/operations/set-current-chat.ts +50 -0
- package/src/operations/update-chat-name.ts +61 -0
- package/src/processor/index.ts +0 -1
- package/src/processor/presets.ts +11 -3
- package/src/processor/processor.test.ts +18 -50
- package/src/processor/processor.ts +226 -149
- 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 +79 -42
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +2 -2
- 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 +155 -89
- package/src/types/Assistant.ts +16 -53
- package/src/types/Settings.ts +76 -0
- package/src/types/capabilities.ts +11 -3
- package/src/types/events.ts +2 -2
- package/src/types/index.ts +3 -2
- package/src/types/service.ts +5 -5
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs +0 -31
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-ECQYUQ2B.mjs +0 -153
- package/dist/lib/browser/ChatCompanion-ECQYUQ2B.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-QCCOFBUX.mjs +0 -73
- package/dist/lib/browser/ChatContainer-QCCOFBUX.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-SMK4RSZU.mjs +0 -85
- package/dist/lib/browser/ChatDialog-SMK4RSZU.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs +0 -53
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs.map +0 -7
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs +0 -21
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs +0 -212
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs +0 -14
- package/dist/lib/browser/chunk-3JYPE2MM.mjs +0 -1832
- package/dist/lib/browser/chunk-3JYPE2MM.mjs.map +0 -7
- package/dist/lib/browser/chunk-DKQMSMBN.mjs +0 -326
- package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +0 -7
- package/dist/lib/browser/chunk-EXVT7D4B.mjs +0 -23
- package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +0 -7
- package/dist/lib/browser/chunk-ML3QCFKA.mjs +0 -265
- package/dist/lib/browser/chunk-ML3QCFKA.mjs.map +0 -7
- package/dist/lib/browser/chunk-MRJVYGLU.mjs +0 -208
- package/dist/lib/browser/chunk-MRJVYGLU.mjs.map +0 -7
- package/dist/lib/browser/chunk-V772AMZM.mjs +0 -250
- package/dist/lib/browser/chunk-V772AMZM.mjs.map +0 -7
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs +0 -41
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs +0 -20
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs +0 -19
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs +0 -132
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs.map +0 -7
- package/dist/lib/browser/react-surface-NCITRSJJ.mjs +0 -109
- package/dist/lib/browser/react-surface-NCITRSJJ.mjs.map +0 -7
- package/dist/lib/browser/repair-6QGAKOVM.mjs +0 -54
- package/dist/lib/browser/repair-6QGAKOVM.mjs.map +0 -7
- package/dist/lib/browser/settings-4ZDLUMYE.mjs +0 -32
- package/dist/lib/browser/settings-4ZDLUMYE.mjs.map +0 -7
- package/dist/lib/browser/state-AN6336ZX.mjs +0 -26
- package/dist/lib/browser/state-AN6336ZX.mjs.map +0 -7
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs +0 -18
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs +0 -32
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-Q4FUZ2MW.mjs +0 -154
- package/dist/lib/node-esm/ChatCompanion-Q4FUZ2MW.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-AKI33HIB.mjs +0 -74
- package/dist/lib/node-esm/ChatContainer-AKI33HIB.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-AP45PVZR.mjs +0 -86
- package/dist/lib/node-esm/ChatDialog-AP45PVZR.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs +0 -54
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs +0 -22
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs +0 -213
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs +0 -15
- package/dist/lib/node-esm/chunk-355W5B27.mjs +0 -251
- package/dist/lib/node-esm/chunk-355W5B27.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs +0 -327
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs +0 -209
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs +0 -42
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs +0 -25
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XI5T3MJC.mjs +0 -1833
- package/dist/lib/node-esm/chunk-XI5T3MJC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs +0 -267
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs +0 -21
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs +0 -20
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs +0 -133
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ST6V7LPE.mjs +0 -110
- package/dist/lib/node-esm/react-surface-ST6V7LPE.mjs.map +0 -7
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs +0 -55
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs.map +0 -7
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs +0 -33
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs.map +0 -7
- package/dist/lib/node-esm/state-HDON4REW.mjs +0 -27
- package/dist/lib/node-esm/state-HDON4REW.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs +0 -19
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs.map +0 -7
- package/dist/types/src/blueprints/assistant-blueprint.d.ts +0 -209
- package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +0 -1
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts +0 -5
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +0 -1
- package/dist/types/src/capabilities/ai-service/index.d.ts +0 -3
- package/dist/types/src/capabilities/ai-service/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -21
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -4
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +0 -6
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +0 -12
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/index.d.ts +0 -3
- package/dist/types/src/capabilities/repair/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/repair.d.ts +0 -6
- package/dist/types/src/capabilities/repair/repair.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -15
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +0 -17
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -11
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts +0 -13
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts +0 -3
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +0 -5
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +0 -7
- package/dist/types/src/components/BlueprintArticle.d.ts.map +0 -1
- package/dist/types/src/components/ChatCompanion.d.ts +0 -13
- package/dist/types/src/components/ChatCompanion.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts +0 -19
- package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +0 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +0 -7
- 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/PromptArticle.d.ts +0 -7
- package/dist/types/src/components/PromptArticle.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/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/object-list.d.ts +0 -10
- package/dist/types/src/functions/object-list.d.ts.map +0 -1
- package/dist/types/src/functions/object-load.d.ts +0 -8
- package/dist/types/src/functions/object-load.d.ts.map +0 -1
- package/dist/types/src/functions/object-search.d.ts +0 -10
- package/dist/types/src/functions/object-search.d.ts.map +0 -1
- package/dist/types/src/processor/update-name.d.ts +0 -10
- package/dist/types/src/processor/update-name.d.ts.map +0 -1
- package/dist/types/src/types/AssistantAction.d.ts +0 -95
- package/dist/types/src/types/AssistantAction.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.ts +0 -62
- package/src/capabilities/ai-service/index.ts +0 -7
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -180
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -60
- package/src/capabilities/blueprint-definition/index.ts +0 -8
- package/src/capabilities/edge-model-resolver/index.ts +0 -7
- package/src/capabilities/local-model-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -110
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -95
- package/src/capabilities/repair/index.ts +0 -7
- package/src/capabilities/repair/repair.ts +0 -63
- package/src/capabilities/settings/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/capabilities/toolkit/index.ts +0 -7
- package/src/capabilities/toolkit/toolkit.ts +0 -26
- package/src/components/BlueprintArticle.tsx +0 -29
- package/src/components/ChatContainer.tsx +0 -61
- package/src/components/ChatProgress/ChatProgress.tsx +0 -54
- package/src/components/ChatProgress/index.ts +0 -5
- package/src/components/PromptArticle.tsx +0 -50
- package/src/components/Typewriter/AssistantToolbar.tsx +0 -161
- package/src/components/Typewriter/Typewriter.stories.tsx +0 -83
- package/src/components/Typewriter/Typewriter.tsx +0 -54
- package/src/components/Typewriter/assistant-extension.tsx +0 -144
- package/src/functions/index.ts +0 -7
- package/src/functions/object-list.ts +0 -49
- package/src/functions/object-load.ts +0 -47
- package/src/functions/object-search.ts +0 -46
- package/src/processor/update-name.ts +0 -59
- package/src/types/AssistantAction.ts +0 -75
- package/src/types/defs.ts +0 -5
- /package/dist/lib/browser/{blueprint-definition-DGHH7MUU.mjs.map → components/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-SEMDEIYG.mjs.map → browser/hooks/index.mjs.map} +0 -0
|
@@ -5,56 +5,74 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { log } from '@dxos/log';
|
|
8
|
-
import {
|
|
8
|
+
import { ContentBlock, type Message } from '@dxos/types';
|
|
9
|
+
import { type XmlWidgetRegistry, getXmlTextChild } from '@dxos/ui-editor';
|
|
10
|
+
|
|
11
|
+
import { type Assistant } from '../../types';
|
|
12
|
+
import { type BlockRenderer, type MessageThreadContext } from './sync';
|
|
13
|
+
import { applyToolBlockToWidgetState } from './tool-widget-state';
|
|
9
14
|
import {
|
|
10
|
-
|
|
15
|
+
FallbackWidget,
|
|
16
|
+
ReasoningWidget,
|
|
11
17
|
ReferenceWidget,
|
|
12
18
|
SelectWidget,
|
|
13
19
|
SuggestionWidget,
|
|
20
|
+
StatsWidget,
|
|
14
21
|
SummaryWidget,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import { type XmlWidgetProps, type XmlWidgetRegistry, getXmlTextChild } from '@dxos/ui-editor';
|
|
19
|
-
|
|
20
|
-
import { ToolBlock } from '../ToolBlock';
|
|
21
|
-
|
|
22
|
-
import { type BlockRenderer, type MessageThreadContext } from './sync';
|
|
23
|
-
|
|
24
|
-
const Fallback = ({ _tag, ...props }: XmlWidgetProps<MessageThreadContext>) => {
|
|
25
|
-
return (
|
|
26
|
-
<ToggleContainer.Root classNames='rounded-sm'>
|
|
27
|
-
<ToggleContainer.Header classNames='bg-groupSurface'>{_tag}</ToggleContainer.Header>
|
|
28
|
-
<ToggleContainer.Content classNames='bg-modalSurface'>
|
|
29
|
-
<Json classNames='!p-2 text-sm' data={props} />
|
|
30
|
-
</ToggleContainer.Content>
|
|
31
|
-
</ToggleContainer.Root>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
22
|
+
ToolWidget,
|
|
23
|
+
StatusWidget,
|
|
24
|
+
} from './widgets';
|
|
34
25
|
|
|
35
26
|
/**
|
|
36
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).
|
|
37
36
|
*/
|
|
38
37
|
export const componentRegistry: XmlWidgetRegistry = {
|
|
39
38
|
//
|
|
40
|
-
//
|
|
39
|
+
// Block-only (no widget — see note above).
|
|
41
40
|
//
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
prompt: {
|
|
44
43
|
block: true,
|
|
45
|
-
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
//
|
|
47
|
+
// DOM Widgets
|
|
48
|
+
//
|
|
49
|
+
|
|
50
|
+
synthetic: {
|
|
51
|
+
block: true,
|
|
52
|
+
factory: ({ children, range }) => {
|
|
53
|
+
const text = getXmlTextChild(children);
|
|
54
|
+
// TODO(dmaretskyi): Synthetic blocks are "user"-turn messages generated by the system, i.e. and event from a trigger, an email-encoded to JSON, etc.
|
|
55
|
+
// They are meant to start agent, to process the event without looking like user-authored prompt.
|
|
56
|
+
// Create a new widget type for them.
|
|
57
|
+
return text ? new ReasoningWidget(text, range.from) : null;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
reasoning: {
|
|
61
|
+
block: true,
|
|
62
|
+
streaming: true,
|
|
63
|
+
factory: ({ children, range }) => {
|
|
46
64
|
const text = getXmlTextChild(children);
|
|
47
|
-
return text ? new
|
|
65
|
+
return text ? new ReasoningWidget(text, range.from) : null;
|
|
48
66
|
},
|
|
49
67
|
},
|
|
50
|
-
|
|
68
|
+
reference: {
|
|
51
69
|
block: false,
|
|
52
70
|
factory: ({ children, ref }) => {
|
|
53
71
|
const text = getXmlTextChild(children);
|
|
54
72
|
return text && ref ? new ReferenceWidget(text, ref) : null;
|
|
55
73
|
},
|
|
56
74
|
},
|
|
57
|
-
|
|
75
|
+
select: {
|
|
58
76
|
block: true,
|
|
59
77
|
factory: ({ children }) => {
|
|
60
78
|
const options = children
|
|
@@ -63,62 +81,108 @@ export const componentRegistry: XmlWidgetRegistry = {
|
|
|
63
81
|
return options?.length ? new SelectWidget(options) : null;
|
|
64
82
|
},
|
|
65
83
|
},
|
|
66
|
-
|
|
84
|
+
suggestion: {
|
|
67
85
|
block: true,
|
|
68
86
|
factory: ({ children }) => {
|
|
69
87
|
const text = getXmlTextChild(children);
|
|
70
88
|
return text ? new SuggestionWidget(text) : null;
|
|
71
89
|
},
|
|
72
90
|
},
|
|
73
|
-
|
|
91
|
+
stats: {
|
|
74
92
|
block: true,
|
|
75
93
|
factory: ({ children }) => {
|
|
76
94
|
const text = getXmlTextChild(children);
|
|
77
|
-
return text ? new
|
|
95
|
+
return text ? new StatsWidget(text) : null;
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
status: {
|
|
99
|
+
block: true,
|
|
100
|
+
streaming: true,
|
|
101
|
+
factory: ({ children, range }) => {
|
|
102
|
+
const text = getXmlTextChild(children);
|
|
103
|
+
return text ? new StatusWidget(text, range.from) : null;
|
|
78
104
|
},
|
|
79
105
|
},
|
|
80
106
|
|
|
81
107
|
//
|
|
82
|
-
// React
|
|
108
|
+
// React Widgets (portaled outside of the editor)
|
|
83
109
|
//
|
|
84
110
|
|
|
85
|
-
|
|
111
|
+
summary: {
|
|
112
|
+
block: true,
|
|
113
|
+
Component: SummaryWidget,
|
|
114
|
+
},
|
|
115
|
+
toolCall: {
|
|
86
116
|
block: true,
|
|
87
|
-
Component:
|
|
117
|
+
Component: (props) => (
|
|
118
|
+
<div role='none' className='py-2'>
|
|
119
|
+
<ToolWidget {...props} />
|
|
120
|
+
</div>
|
|
121
|
+
),
|
|
88
122
|
},
|
|
89
|
-
|
|
123
|
+
toolResult: {
|
|
90
124
|
block: true,
|
|
91
|
-
Component:
|
|
125
|
+
Component: FallbackWidget,
|
|
92
126
|
},
|
|
93
|
-
|
|
127
|
+
toolkit: {
|
|
94
128
|
block: true,
|
|
95
|
-
Component:
|
|
129
|
+
Component: FallbackWidget,
|
|
96
130
|
},
|
|
97
131
|
|
|
98
132
|
//
|
|
99
133
|
// Fallback
|
|
100
134
|
//
|
|
101
135
|
|
|
102
|
-
|
|
136
|
+
json: {
|
|
103
137
|
block: true,
|
|
104
|
-
Component:
|
|
138
|
+
Component: FallbackWidget,
|
|
105
139
|
},
|
|
106
140
|
};
|
|
107
141
|
|
|
108
142
|
/**
|
|
109
143
|
* Convert block to markdown.
|
|
110
144
|
*/
|
|
111
|
-
export const blockToMarkdown: BlockRenderer = (
|
|
112
|
-
|
|
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
|
+
return (str += '\n');
|
|
163
|
+
}
|
|
164
|
+
return str;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const isBlockVisible = (
|
|
169
|
+
viewType: Assistant.ChatView | undefined,
|
|
113
170
|
message: Message.Message,
|
|
114
171
|
block: ContentBlock.Any,
|
|
115
|
-
) => {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
172
|
+
): boolean => {
|
|
173
|
+
switch (viewType) {
|
|
174
|
+
case 'debug':
|
|
175
|
+
return true;
|
|
176
|
+
case 'normal':
|
|
177
|
+
return block._tag !== 'reasoning';
|
|
178
|
+
case 'summary':
|
|
179
|
+
// Show only conversational text (user prompts + assistant replies); hide reasoning,
|
|
180
|
+
// tool calls, status, stats, and synthetic system messages.
|
|
181
|
+
return block._tag === 'text' && (block as ContentBlock.Text).disposition !== 'synthetic';
|
|
182
|
+
case 'thinking':
|
|
183
|
+
default:
|
|
184
|
+
return true;
|
|
119
185
|
}
|
|
120
|
-
|
|
121
|
-
return str;
|
|
122
186
|
};
|
|
123
187
|
|
|
124
188
|
const blockToMarkdownImpl = (context: MessageThreadContext, message: Message.Message, block: ContentBlock.Any) => {
|
|
@@ -126,7 +190,11 @@ const blockToMarkdownImpl = (context: MessageThreadContext, message: Message.Mes
|
|
|
126
190
|
switch (block._tag) {
|
|
127
191
|
case 'text': {
|
|
128
192
|
if (message.sender.role === 'user') {
|
|
129
|
-
|
|
193
|
+
if (block.disposition === 'synthetic') {
|
|
194
|
+
return renderXMLBlock('synthetic', { content: block.text, pending: block.pending });
|
|
195
|
+
} else {
|
|
196
|
+
return `<prompt>${block.text}</prompt>`;
|
|
197
|
+
}
|
|
130
198
|
} else {
|
|
131
199
|
const text = block.text.trim();
|
|
132
200
|
if (text.length > 0) {
|
|
@@ -135,40 +203,84 @@ const blockToMarkdownImpl = (context: MessageThreadContext, message: Message.Mes
|
|
|
135
203
|
}
|
|
136
204
|
break;
|
|
137
205
|
}
|
|
206
|
+
|
|
138
207
|
case 'reference': {
|
|
208
|
+
if (block.pending) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
139
211
|
const dxn = block.reference.dxn;
|
|
140
212
|
return `<reference ref="${dxn.toString()}">${context.getObjectLabel(dxn)}</reference>`;
|
|
141
213
|
}
|
|
214
|
+
|
|
142
215
|
case 'suggestion': {
|
|
143
216
|
if (block.pending) {
|
|
144
217
|
return;
|
|
145
218
|
}
|
|
146
219
|
return `<suggestion>${block.text}</suggestion>`;
|
|
147
220
|
}
|
|
221
|
+
|
|
148
222
|
case 'select': {
|
|
149
223
|
if (block.pending || block.options.length === 0) {
|
|
150
224
|
return;
|
|
151
225
|
}
|
|
152
226
|
return `<select>${block.options.map((option) => `<option>${option}</option>`).join('')}</select>`;
|
|
153
227
|
}
|
|
228
|
+
|
|
154
229
|
case 'toolCall': {
|
|
155
|
-
context
|
|
156
|
-
blocks: [block],
|
|
157
|
-
});
|
|
230
|
+
applyToolBlockToWidgetState(context, block);
|
|
158
231
|
return `<toolCall id="${block.toolCallId}" />`;
|
|
159
232
|
}
|
|
233
|
+
|
|
160
234
|
case 'toolResult': {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}));
|
|
235
|
+
// TODO(dmaretskyi): the parameter could be undefined, perhaps tool blocks are not arriving in order.
|
|
236
|
+
applyToolBlockToWidgetState(context, block);
|
|
164
237
|
break;
|
|
165
238
|
}
|
|
239
|
+
|
|
240
|
+
case 'stats': {
|
|
241
|
+
return '';
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
case 'reasoning': {
|
|
245
|
+
let text = block.reasoningText ?? block.redactedText;
|
|
246
|
+
if (!text) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
return renderXMLBlock('reasoning', { content: text, pending: block.pending });
|
|
250
|
+
}
|
|
251
|
+
|
|
166
252
|
case 'summary': {
|
|
167
|
-
return
|
|
253
|
+
return renderXMLBlock('summary', { content: block.content, pending: block.pending });
|
|
168
254
|
}
|
|
255
|
+
|
|
256
|
+
case 'status': {
|
|
257
|
+
return renderXMLBlock('status', { content: block.statusText, pending: block.pending });
|
|
258
|
+
}
|
|
259
|
+
|
|
169
260
|
default: {
|
|
170
261
|
// TODO(burdon): Needs stable ID.
|
|
171
262
|
return `<json id="${message.id}">\n${JSON.stringify(block)}\n</json>`;
|
|
172
263
|
}
|
|
173
264
|
}
|
|
174
265
|
};
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Escape text embedded in generated XML so the mixed XML parser does not treat `&`, `<`, `>` as markup.
|
|
269
|
+
*/
|
|
270
|
+
const escapeXmlTextContent = (raw: string): string =>
|
|
271
|
+
raw.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
272
|
+
|
|
273
|
+
const renderXMLBlock = (tag: string, opts: { content?: string; pending?: boolean; attributes?: string }) => {
|
|
274
|
+
// Replace paragraph breaks so that the markdown parser does not split the content into multiple paragraphs.
|
|
275
|
+
// NOTE: do not strip leading list-marker prefixes (`-`, `*`, `1. `, ...) per line — the streaming
|
|
276
|
+
// tag's range is replaced atomically by the XML widget so the inner markdown is never user-visible,
|
|
277
|
+
// and stripping can collapse a line to empty mid-stream (e.g. when only `1. ` has arrived), breaking
|
|
278
|
+
// the prefix-extension contract that `MessageSyncer` relies on for incremental appends.
|
|
279
|
+
const content = escapeXmlTextContent((opts.content ?? '').replace(/\n\n/g, ' ').trim());
|
|
280
|
+
|
|
281
|
+
if (opts.pending) {
|
|
282
|
+
return `<${tag}${opts.attributes ? ` ${opts.attributes}` : ''}>${content}`;
|
|
283
|
+
} else {
|
|
284
|
+
return `<${tag}${opts.attributes ? ` ${opts.attributes}` : ''}>${content}</${tag}>`;
|
|
285
|
+
}
|
|
286
|
+
};
|
|
@@ -2,31 +2,33 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @vitest-environment jsdom
|
|
6
|
+
|
|
5
7
|
import { EditorView } from '@codemirror/view';
|
|
6
8
|
import { describe, it } from '@effect/vitest';
|
|
7
9
|
import * as Effect from 'effect/Effect';
|
|
8
10
|
|
|
9
11
|
import { Obj } from '@dxos/echo';
|
|
10
12
|
import { type Mutable } from '@dxos/echo/internal';
|
|
11
|
-
import { type ContentBlock } from '@dxos/types';
|
|
13
|
+
import { type ContentBlock, type Message } from '@dxos/types';
|
|
12
14
|
|
|
13
|
-
import { createMessage } from '
|
|
15
|
+
import { createMessage } from '#testing';
|
|
14
16
|
|
|
15
|
-
import {
|
|
16
|
-
import { MessageSyncer, type TextModel } from './sync';
|
|
17
|
+
import { createBlockRenderer } from './registry';
|
|
18
|
+
import { type BlockRenderer, MessageSyncer, type MessageThreadContext, type TextModel } from './sync';
|
|
17
19
|
|
|
18
20
|
class TestDocument implements TextModel {
|
|
19
21
|
private readonly _view = new EditorView({ extensions: [] });
|
|
20
22
|
|
|
21
|
-
get
|
|
22
|
-
return this._view;
|
|
23
|
+
get length() {
|
|
24
|
+
return this._view.state.doc.length;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
get content() {
|
|
26
28
|
return this._view.state.doc.toString();
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
async
|
|
31
|
+
async setContent(text: string) {
|
|
30
32
|
this._view.dispatch({
|
|
31
33
|
changes: { from: 0, to: this._view.state.doc.length, insert: text },
|
|
32
34
|
});
|
|
@@ -46,20 +48,20 @@ describe('reducers', () => {
|
|
|
46
48
|
'basic sync',
|
|
47
49
|
Effect.fn(function* ({ expect }) {
|
|
48
50
|
const doc = new TestDocument();
|
|
49
|
-
const syncer = new MessageSyncer(doc,
|
|
51
|
+
const syncer = new MessageSyncer(doc, createBlockRenderer('thinking'));
|
|
50
52
|
|
|
51
53
|
const messages = [
|
|
52
54
|
createMessage('user', [{ _tag: 'text', text: 'Hello' }]),
|
|
53
55
|
createMessage('assistant', [{ _tag: 'text', text: 'Hi there!' }]),
|
|
54
56
|
];
|
|
55
57
|
|
|
56
|
-
syncer.
|
|
58
|
+
syncer.update(messages);
|
|
57
59
|
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!', ''].join('\n'));
|
|
58
60
|
|
|
59
|
-
Obj.
|
|
60
|
-
|
|
61
|
+
Obj.update(messages[1], (obj) => {
|
|
62
|
+
obj.blocks.push({ _tag: 'text', text: 'How can I help?' });
|
|
61
63
|
});
|
|
62
|
-
syncer.
|
|
64
|
+
syncer.update(messages);
|
|
63
65
|
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!', 'How can I help?', ''].join('\n'));
|
|
64
66
|
}),
|
|
65
67
|
);
|
|
@@ -68,30 +70,190 @@ describe('reducers', () => {
|
|
|
68
70
|
'sync with partial updates',
|
|
69
71
|
Effect.fn(function* ({ expect }) {
|
|
70
72
|
const doc = new TestDocument();
|
|
71
|
-
const syncer = new MessageSyncer(doc,
|
|
73
|
+
const syncer = new MessageSyncer(doc, createBlockRenderer('thinking'));
|
|
72
74
|
|
|
73
75
|
const messages = [
|
|
74
76
|
createMessage('user', [{ _tag: 'text', text: 'Hello' }]),
|
|
75
77
|
createMessage('assistant', [{ _tag: 'text', text: 'Hi there!', pending: true }]),
|
|
76
78
|
];
|
|
77
79
|
|
|
78
|
-
syncer.
|
|
80
|
+
syncer.update(messages);
|
|
79
81
|
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!'].join('\n'));
|
|
80
82
|
|
|
81
|
-
Obj.
|
|
82
|
-
const block =
|
|
83
|
+
Obj.update(messages[1], (obj) => {
|
|
84
|
+
const block = obj.blocks[0] as Mutable<ContentBlock.Text>;
|
|
83
85
|
block.text = 'Hi there! How are you?';
|
|
84
86
|
block.pending = false;
|
|
85
87
|
});
|
|
86
|
-
syncer.
|
|
88
|
+
syncer.update(messages);
|
|
87
89
|
|
|
88
|
-
Obj.
|
|
89
|
-
|
|
90
|
+
Obj.update(messages[1], (obj) => {
|
|
91
|
+
obj.blocks.push({ _tag: 'text', text: 'How can I help?' });
|
|
90
92
|
});
|
|
91
|
-
syncer.
|
|
93
|
+
syncer.update(messages);
|
|
92
94
|
expect(doc.content).toEqual(
|
|
93
95
|
['<prompt>Hello</prompt>', 'Hi there! How are you?', 'How can I help?', ''].join('\n'),
|
|
94
96
|
);
|
|
95
97
|
}),
|
|
96
98
|
);
|
|
99
|
+
|
|
100
|
+
// Regression: streaming reasoning text that passes through a bare list-marker state
|
|
101
|
+
// (e.g. `"…\n1. "`) used to make `stripBulletLikeLinePrefixes` collapse the line to empty,
|
|
102
|
+
// breaking the prefix-diff invariant in `MessageSyncer` and producing a duplicate `<reasoning>`
|
|
103
|
+
// opening tag in the document.
|
|
104
|
+
it.effect(
|
|
105
|
+
'streaming reasoning with list-marker transitions does not duplicate opening tag',
|
|
106
|
+
Effect.fn(function* ({ expect }) {
|
|
107
|
+
const doc = new TestDocument();
|
|
108
|
+
const syncer = new MessageSyncer(doc, createBlockRenderer('thinking'));
|
|
109
|
+
|
|
110
|
+
const setReasoning = (message: Message.Message, text: string, pending: boolean) => {
|
|
111
|
+
Obj.update(message, (message) => {
|
|
112
|
+
const block = message.blocks[0] as Mutable<ContentBlock.Reasoning>;
|
|
113
|
+
block.reasoningText = text;
|
|
114
|
+
block.pending = pending;
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const messages = [createMessage('assistant', [{ _tag: 'reasoning', reasoningText: 'abc\n1', pending: true }])];
|
|
119
|
+
|
|
120
|
+
// Tick 1: `"abc\n1"` — `\d+[.)]\s` regex does not match (no dot/space yet).
|
|
121
|
+
syncer.update(messages);
|
|
122
|
+
|
|
123
|
+
// Tick 2: `"abc\n1."` — still no match (no trailing whitespace).
|
|
124
|
+
setReasoning(messages[0], 'abc\n1.', true);
|
|
125
|
+
syncer.update(messages);
|
|
126
|
+
|
|
127
|
+
// Tick 3: `"abc\n1. "` — line `"1. "` matches and is stripped to empty.
|
|
128
|
+
setReasoning(messages[0], 'abc\n1. ', true);
|
|
129
|
+
syncer.update(messages);
|
|
130
|
+
|
|
131
|
+
// Tick 4: `"abc\n1. foo"` — list item with content.
|
|
132
|
+
setReasoning(messages[0], 'abc\n1. foo', true);
|
|
133
|
+
syncer.update(messages);
|
|
134
|
+
|
|
135
|
+
// Tick 5: finalize.
|
|
136
|
+
setReasoning(messages[0], 'abc\n1. foo', false);
|
|
137
|
+
syncer.update(messages);
|
|
138
|
+
|
|
139
|
+
const openTagCount = (doc.content.match(/<reasoning>/g) ?? []).length;
|
|
140
|
+
const closeTagCount = (doc.content.match(/<\/reasoning>/g) ?? []).length;
|
|
141
|
+
expect(openTagCount).toBe(1);
|
|
142
|
+
expect(closeTagCount).toBe(1);
|
|
143
|
+
}),
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
// Regression: prompt "respond with your name inside an xml tag" produces a streamed
|
|
147
|
+
// reasoning block followed by a text block containing a non-registered XML tag
|
|
148
|
+
// (`<name>Claude</name>`). The text block must appear in the document AFTER the
|
|
149
|
+
// closed reasoning block — the bug symptom is the reasoning tag rendering with no
|
|
150
|
+
// follow-up response visible.
|
|
151
|
+
it.effect(
|
|
152
|
+
'reasoning block followed by text containing a non-registered xml tag',
|
|
153
|
+
Effect.fn(function* ({ expect }) {
|
|
154
|
+
const doc = new TestDocument();
|
|
155
|
+
const syncer = new MessageSyncer(doc, createBlockRenderer('thinking'));
|
|
156
|
+
|
|
157
|
+
const setReasoning = (message: Message.Message, text: string, pending: boolean) => {
|
|
158
|
+
Obj.update(message, (message) => {
|
|
159
|
+
const block = message.blocks[0] as Mutable<ContentBlock.Reasoning>;
|
|
160
|
+
block.reasoningText = text;
|
|
161
|
+
block.pending = pending;
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const setText = (message: Message.Message, text: string, pending: boolean) => {
|
|
166
|
+
Obj.update(message, (message) => {
|
|
167
|
+
const block = message.blocks[1] as Mutable<ContentBlock.Text>;
|
|
168
|
+
block.text = text;
|
|
169
|
+
block.pending = pending;
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// Tick 1: reasoning starts streaming.
|
|
174
|
+
const messages = [createMessage('assistant', [{ _tag: 'reasoning', reasoningText: 'Thinking', pending: true }])];
|
|
175
|
+
syncer.update(messages);
|
|
176
|
+
|
|
177
|
+
// Tick 2: reasoning grows.
|
|
178
|
+
setReasoning(messages[0], 'Thinking about the answer', true);
|
|
179
|
+
syncer.update(messages);
|
|
180
|
+
|
|
181
|
+
// Tick 3: reasoning closes.
|
|
182
|
+
setReasoning(messages[0], 'Thinking about the answer', false);
|
|
183
|
+
syncer.update(messages);
|
|
184
|
+
|
|
185
|
+
// Tick 4: text block appears, pending and empty (model has started emitting but text is still '').
|
|
186
|
+
Obj.update(messages[0], (message) => {
|
|
187
|
+
message.blocks.push({ _tag: 'text', text: '', pending: true });
|
|
188
|
+
});
|
|
189
|
+
syncer.update(messages);
|
|
190
|
+
|
|
191
|
+
// Tick 5: partial text — opening tag only.
|
|
192
|
+
setText(messages[0], '<name>', true);
|
|
193
|
+
syncer.update(messages);
|
|
194
|
+
|
|
195
|
+
// Tick 6: full text streamed.
|
|
196
|
+
setText(messages[0], '<name>Claude</name>', true);
|
|
197
|
+
syncer.update(messages);
|
|
198
|
+
|
|
199
|
+
// Tick 7: text finalised.
|
|
200
|
+
setText(messages[0], '<name>Claude</name>', false);
|
|
201
|
+
syncer.update(messages);
|
|
202
|
+
|
|
203
|
+
// Both the closed reasoning tag and the response text must be present.
|
|
204
|
+
expect(doc.content).toContain('<reasoning>Thinking about the answer</reasoning>');
|
|
205
|
+
expect(doc.content).toContain('<name>Claude</name>');
|
|
206
|
+
|
|
207
|
+
const openReasoning = (doc.content.match(/<reasoning>/g) ?? []).length;
|
|
208
|
+
const closeReasoning = (doc.content.match(/<\/reasoning>/g) ?? []).length;
|
|
209
|
+
expect(openReasoning).toBe(1);
|
|
210
|
+
expect(closeReasoning).toBe(1);
|
|
211
|
+
}),
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
// Direct test of `MessageSyncer`'s tolerance for non-monotonic renderer output —
|
|
215
|
+
// any renderer that produces a shorter string for the same streaming block (e.g., due
|
|
216
|
+
// to whitespace normalisation or future transforms) must not produce duplicate output.
|
|
217
|
+
it.effect(
|
|
218
|
+
'non-monotonic renderer output does not duplicate previously-emitted content',
|
|
219
|
+
Effect.fn(function* ({ expect }) {
|
|
220
|
+
const doc = new TestDocument();
|
|
221
|
+
|
|
222
|
+
const renderer: BlockRenderer = (_ctx: MessageThreadContext, _msg: Message.Message, block: ContentBlock.Any) => {
|
|
223
|
+
if (block._tag !== 'reasoning') {
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
const text = block.reasoningText ?? '';
|
|
227
|
+
// Simulate a non-monotonic transform: collapse a line that is a sole digit+dot+space.
|
|
228
|
+
const normalised = text
|
|
229
|
+
.split(/\r?\n/)
|
|
230
|
+
.map((line) => line.replace(/^\s*\d+[.)]\s$/, ''))
|
|
231
|
+
.join('\n')
|
|
232
|
+
.trim();
|
|
233
|
+
return block.pending ? `<reasoning>${normalised}` : `<reasoning>${normalised}</reasoning>\n`;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
const syncer = new MessageSyncer(doc, renderer);
|
|
237
|
+
|
|
238
|
+
const messages = [createMessage('assistant', [{ _tag: 'reasoning', reasoningText: 'abc\n1.', pending: true }])];
|
|
239
|
+
|
|
240
|
+
syncer.update(messages);
|
|
241
|
+
Obj.update(messages[0], (obj) => {
|
|
242
|
+
const block = obj.blocks[0] as Mutable<ContentBlock.Reasoning>;
|
|
243
|
+
block.reasoningText = 'abc\n1. ';
|
|
244
|
+
});
|
|
245
|
+
syncer.update(messages);
|
|
246
|
+
Obj.update(messages[0], (obj) => {
|
|
247
|
+
const block = obj.blocks[0] as Mutable<ContentBlock.Reasoning>;
|
|
248
|
+
block.reasoningText = 'abc\n1. tail';
|
|
249
|
+
block.pending = false;
|
|
250
|
+
});
|
|
251
|
+
syncer.update(messages);
|
|
252
|
+
|
|
253
|
+
const openTagCount = (doc.content.match(/<reasoning>/g) ?? []).length;
|
|
254
|
+
const closeTagCount = (doc.content.match(/<\/reasoning>/g) ?? []).length;
|
|
255
|
+
expect(openTagCount).toBe(1);
|
|
256
|
+
expect(closeTagCount).toBe(1);
|
|
257
|
+
}),
|
|
258
|
+
);
|
|
97
259
|
});
|