@dxos/plugin-assistant 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe
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-7QMO3LGF.mjs +97 -0
- package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +3 -7
- package/dist/lib/browser/chunk-ATHYBVGN.mjs +176 -0
- package/dist/lib/browser/chunk-ATHYBVGN.mjs.map +7 -0
- package/dist/lib/browser/chunk-EZRS3J25.mjs +30 -0
- package/dist/lib/browser/chunk-EZRS3J25.mjs.map +7 -0
- package/dist/lib/browser/chunk-RUV2WOQH.mjs +154 -0
- package/dist/lib/browser/chunk-RUV2WOQH.mjs.map +7 -0
- package/dist/lib/browser/create-chat-LBZHGVSN.mjs +82 -0
- package/dist/lib/browser/create-chat-LBZHGVSN.mjs.map +7 -0
- package/dist/lib/browser/ensure-companion-chat-FR4AWZ2P.mjs +65 -0
- package/dist/lib/browser/ensure-companion-chat-FR4AWZ2P.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3163 -245
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/on-create-space-54RNX5JI.mjs +22 -0
- package/dist/lib/browser/on-create-space-54RNX5JI.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-NZOD66NY.mjs +22 -0
- package/dist/lib/browser/resolve-navigation-targets-NZOD66NY.mjs.map +7 -0
- package/dist/lib/browser/run-prompt-in-new-chat-4YQ37XIS.mjs +136 -0
- package/dist/lib/browser/run-prompt-in-new-chat-4YQ37XIS.mjs.map +7 -0
- package/dist/lib/browser/set-current-chat-WJI3WAVM.mjs +54 -0
- package/dist/lib/browser/set-current-chat-WJI3WAVM.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -4
- package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs +71 -0
- package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs.map +7 -0
- package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs +98 -0
- package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +3 -7
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs +32 -0
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs +177 -0
- package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PY4X6FJT.mjs +155 -0
- package/dist/lib/node-esm/chunk-PY4X6FJT.mjs.map +7 -0
- package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs +83 -0
- package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs.map +7 -0
- package/dist/lib/node-esm/ensure-companion-chat-BLP7NT32.mjs +66 -0
- package/dist/lib/node-esm/ensure-companion-chat-BLP7NT32.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3163 -245
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs +23 -0
- package/dist/lib/node-esm/on-create-space-YRPZ6HZY.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-3PPK7XLH.mjs +23 -0
- package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs.map +7 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-2IJBSDTM.mjs +137 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-2IJBSDTM.mjs.map +7 -0
- package/dist/lib/node-esm/set-current-chat-KBMMZULR.mjs +55 -0
- package/dist/lib/node-esm/set-current-chat-KBMMZULR.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -4
- package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs +72 -0
- package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs.map +7 -0
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- 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 +41 -11
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +13 -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/settings.d.ts → settings.d.ts} +4 -3
- 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/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 +553 -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 +15 -11
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +6 -3
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
- 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/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +3 -3
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +535 -303
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +573 -0
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +6 -5
- 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/PromptWidget.d.ts +14 -0
- package/dist/types/src/components/ChatThread/widgets/PromptWidget.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 +553 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts +11 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +10 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +8 -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 +5 -4
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +529 -295
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +529 -295
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +0 -9
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +10 -8
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +529 -295
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +2 -2
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/Typewriter.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 +554 -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 +554 -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/PromptArticle/PromptArticle.d.ts +6 -0
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/PromptList/PromptList.d.ts +6 -0
- package/dist/types/src/containers/PromptList/PromptList.d.ts.map +1 -0
- package/dist/types/src/containers/PromptList/PromptList.stories.d.ts +559 -0
- package/dist/types/src/containers/PromptList/PromptList.stories.d.ts.map +1 -0
- package/dist/types/src/containers/PromptList/index.d.ts +2 -0
- package/dist/types/src/containers/PromptList/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts +6 -0
- package/dist/types/src/containers/TracePanel/TracePanel.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/index.d.ts +4 -0
- package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +4 -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/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +7 -6
- 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/useFilteredTypes.d.ts +1 -1
- package/dist/types/src/hooks/useFilteredTypes.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 +1 -1
- 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 +135 -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/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/processor.d.ts +33 -28
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- 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/translations.d.ts +529 -295
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +17 -39
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +10 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +11 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +120 -92
- package/src/AssistantPlugin.tsx +148 -52
- package/src/blueprints/assistant/blueprint.conversations.json +1 -0
- 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 +217 -0
- package/src/capabilities/blueprint-definition.ts +58 -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 +22 -11
- package/src/capabilities/{local-model-resolver/local-model-resolver.ts → local-model-resolver.ts} +4 -3
- package/src/capabilities/markdown.ts +40 -0
- package/src/capabilities/migrations.ts +34 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +157 -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/AssistantSettings/AssistantSettings.stories.tsx +34 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +104 -92
- package/src/components/AssistantSettings/index.ts +2 -2
- package/src/components/Chat/Chat.tsx +88 -45
- package/src/components/ChatProgress/ChatProgress.tsx +9 -7
- package/src/components/ChatPrompt/ChatActions.tsx +25 -5
- package/src/components/ChatPrompt/ChatOptions.tsx +43 -29
- package/src/components/ChatPrompt/ChatReferences.tsx +18 -8
- package/src/components/ChatThread/ChatThread.stories.tsx +31 -48
- package/src/components/ChatThread/ChatThread.tsx +28 -17
- package/src/components/ChatThread/Link.tsx +1 -1
- package/src/components/ChatThread/MarkdownStream.stories.tsx +243 -0
- package/src/components/ChatThread/registry.tsx +107 -43
- package/src/components/ChatThread/sync.test.ts +13 -10
- package/src/components/ChatThread/sync.ts +43 -32
- 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/PromptWidget.ts +28 -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 +31 -0
- package/src/components/ChatThread/widgets/SelectWidget.ts +37 -0
- package/src/components/ChatThread/widgets/StatsWidget.ts +29 -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 +28 -0
- package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +54 -0
- package/src/components/ChatThread/widgets/ToolWidget.tsx +156 -0
- package/src/components/ChatThread/widgets/index.ts +14 -0
- package/src/components/ProcessTree/ProcessTree.stories.tsx +109 -0
- package/src/components/ProcessTree/ProcessTree.tsx +85 -0
- package/src/components/ProcessTree/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +4 -9
- package/src/components/TemplateEditor/TemplateEditor.tsx +50 -42
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +7 -6
- package/src/components/TemplateEditor/TemplateForm.tsx +9 -10
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +4 -4
- package/src/components/ToolBlock/ToolBlock.tsx +21 -20
- package/src/components/Toolbox/Toolbox.stories.tsx +4 -6
- package/src/components/Toolbox/Toolbox.tsx +66 -60
- package/src/components/Typewriter/AssistantToolbar.tsx +7 -7
- package/src/components/Typewriter/Typewriter.stories.tsx +18 -15
- package/src/components/Typewriter/Typewriter.tsx +6 -10
- package/src/components/Typewriter/assistant-extension.tsx +5 -8
- package/src/components/index.ts +3 -7
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +105 -0
- package/src/containers/AgentArticle/AgentArticle.tsx +157 -0
- package/src/containers/AgentArticle/index.ts +5 -0
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +91 -0
- package/src/containers/AgentProperties/AgentProperties.tsx +169 -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 +23 -44
- package/src/containers/ChatCompanion/index.ts +5 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +95 -0
- package/src/containers/ChatContainer/index.ts +5 -0
- package/src/{components → containers/ChatDialog}/ChatDialog.tsx +10 -12
- package/src/containers/ChatDialog/index.ts +5 -0
- package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
- package/src/containers/PromptArticle/index.ts +5 -0
- package/src/containers/PromptList/PromptList.stories.tsx +129 -0
- package/src/containers/PromptList/PromptList.tsx +49 -0
- package/src/containers/PromptList/index.ts +5 -0
- package/src/containers/TracePanel/TracePanel.tsx +361 -0
- package/src/containers/TracePanel/dxn-extractor.test.ts +153 -0
- package/src/containers/TracePanel/dxn-extractor.ts +178 -0
- package/src/containers/TracePanel/index.ts +9 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +144 -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/useBlueprintRegistry.ts +8 -4
- package/src/hooks/useChatProcessor.ts +30 -17
- 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/useFilteredTypes.ts +3 -3
- package/src/hooks/usePresets.ts +2 -1
- package/src/hooks/useReferencesProvider.ts +1 -5
- package/src/index.ts +1 -1
- package/src/meta.ts +6 -3
- package/src/operations/create-chat.ts +80 -0
- package/src/operations/definitions.ts +127 -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/resolve-navigation-targets.ts +26 -0
- package/src/operations/run-prompt-in-new-chat.ts +113 -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 +2 -2
- package/src/processor/processor.test.ts +18 -50
- package/src/processor/processor.ts +190 -129
- package/src/queue-logger.ts +2 -2
- package/src/testing/test-generator.ts +45 -14
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +2 -2
- package/src/translations.ts +134 -83
- package/src/types/Assistant.ts +8 -56
- package/src/types/Settings.ts +21 -0
- package/src/types/capabilities.ts +11 -3
- package/src/types/events.ts +2 -2
- package/src/types/index.ts +3 -1
- 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-GFSJZTOT.mjs +0 -153
- package/dist/lib/browser/ChatCompanion-GFSJZTOT.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-IHAPBIZE.mjs +0 -72
- package/dist/lib/browser/ChatContainer-IHAPBIZE.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-EGRMPCTL.mjs +0 -85
- package/dist/lib/browser/ChatDialog-EGRMPCTL.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/blueprint-definition-DGHH7MUU.mjs.map +0 -7
- package/dist/lib/browser/chunk-A75V4MOQ.mjs +0 -1832
- package/dist/lib/browser/chunk-A75V4MOQ.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-S7SBFOSW.mjs +0 -109
- package/dist/lib/browser/react-surface-S7SBFOSW.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-UR7DXZ54.mjs +0 -154
- package/dist/lib/node-esm/ChatCompanion-UR7DXZ54.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-YMLLGOZK.mjs +0 -73
- package/dist/lib/node-esm/ChatContainer-YMLLGOZK.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-D24WJPK4.mjs +0 -86
- package/dist/lib/node-esm/ChatDialog-D24WJPK4.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/blueprint-definition-SEMDEIYG.mjs.map +0 -7
- 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-4BERCIES.mjs +0 -1833
- package/dist/lib/node-esm/chunk-4BERCIES.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-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-ZR6FXGLF.mjs +0 -110
- package/dist/lib/node-esm/react-surface-ZR6FXGLF.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.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/ChatThread/reducers.d.ts +0 -40
- package/dist/types/src/components/ChatThread/reducers.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/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/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/ChatThread/reducers.ts +0 -151
- package/src/components/PromptArticle.tsx +0 -50
- 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
|
@@ -5,56 +5,55 @@
|
|
|
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 BlockRenderer, type MessageThreadContext } from './sync';
|
|
12
|
+
import { applyToolBlockToWidgetState } from './tool-widget-state';
|
|
9
13
|
import {
|
|
14
|
+
FallbackWidget,
|
|
10
15
|
PromptWidget,
|
|
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.
|
|
37
28
|
*/
|
|
38
29
|
export const componentRegistry: XmlWidgetRegistry = {
|
|
39
30
|
//
|
|
40
|
-
// Widgets
|
|
31
|
+
// DOM Widgets
|
|
41
32
|
//
|
|
42
33
|
|
|
43
|
-
|
|
34
|
+
prompt: {
|
|
44
35
|
block: true,
|
|
45
36
|
factory: ({ children }) => {
|
|
46
37
|
const text = getXmlTextChild(children);
|
|
47
38
|
return text ? new PromptWidget(text) : null;
|
|
48
39
|
},
|
|
49
40
|
},
|
|
50
|
-
|
|
41
|
+
reasoning: {
|
|
42
|
+
block: true,
|
|
43
|
+
streaming: true,
|
|
44
|
+
factory: ({ children, range }) => {
|
|
45
|
+
const text = getXmlTextChild(children);
|
|
46
|
+
return text ? new ReasoningWidget(text, range.from) : null;
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
reference: {
|
|
51
50
|
block: false,
|
|
52
51
|
factory: ({ children, ref }) => {
|
|
53
52
|
const text = getXmlTextChild(children);
|
|
54
53
|
return text && ref ? new ReferenceWidget(text, ref) : null;
|
|
55
54
|
},
|
|
56
55
|
},
|
|
57
|
-
|
|
56
|
+
select: {
|
|
58
57
|
block: true,
|
|
59
58
|
factory: ({ children }) => {
|
|
60
59
|
const options = children
|
|
@@ -63,45 +62,61 @@ export const componentRegistry: XmlWidgetRegistry = {
|
|
|
63
62
|
return options?.length ? new SelectWidget(options) : null;
|
|
64
63
|
},
|
|
65
64
|
},
|
|
66
|
-
|
|
65
|
+
suggestion: {
|
|
67
66
|
block: true,
|
|
68
67
|
factory: ({ children }) => {
|
|
69
68
|
const text = getXmlTextChild(children);
|
|
70
69
|
return text ? new SuggestionWidget(text) : null;
|
|
71
70
|
},
|
|
72
71
|
},
|
|
73
|
-
|
|
72
|
+
stats: {
|
|
74
73
|
block: true,
|
|
75
74
|
factory: ({ children }) => {
|
|
76
75
|
const text = getXmlTextChild(children);
|
|
77
|
-
return text ? new
|
|
76
|
+
return text ? new StatsWidget(text) : null;
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
status: {
|
|
80
|
+
block: true,
|
|
81
|
+
streaming: true,
|
|
82
|
+
factory: ({ children, range }) => {
|
|
83
|
+
const text = getXmlTextChild(children);
|
|
84
|
+
return text ? new StatusWidget(text, range.from) : null;
|
|
78
85
|
},
|
|
79
86
|
},
|
|
80
87
|
|
|
81
88
|
//
|
|
82
|
-
// React
|
|
89
|
+
// React Widgets (portaled outside of the editor)
|
|
83
90
|
//
|
|
84
91
|
|
|
85
|
-
|
|
92
|
+
summary: {
|
|
93
|
+
block: true,
|
|
94
|
+
Component: SummaryWidget,
|
|
95
|
+
},
|
|
96
|
+
toolCall: {
|
|
86
97
|
block: true,
|
|
87
|
-
Component:
|
|
98
|
+
Component: (props) => (
|
|
99
|
+
<div role='none' className='py-2'>
|
|
100
|
+
<ToolWidget {...props} />
|
|
101
|
+
</div>
|
|
102
|
+
),
|
|
88
103
|
},
|
|
89
|
-
|
|
104
|
+
toolResult: {
|
|
90
105
|
block: true,
|
|
91
|
-
Component:
|
|
106
|
+
Component: FallbackWidget,
|
|
92
107
|
},
|
|
93
|
-
|
|
108
|
+
toolkit: {
|
|
94
109
|
block: true,
|
|
95
|
-
Component:
|
|
110
|
+
Component: FallbackWidget,
|
|
96
111
|
},
|
|
97
112
|
|
|
98
113
|
//
|
|
99
114
|
// Fallback
|
|
100
115
|
//
|
|
101
116
|
|
|
102
|
-
|
|
117
|
+
json: {
|
|
103
118
|
block: true,
|
|
104
|
-
Component:
|
|
119
|
+
Component: FallbackWidget,
|
|
105
120
|
},
|
|
106
121
|
};
|
|
107
122
|
|
|
@@ -135,40 +150,89 @@ const blockToMarkdownImpl = (context: MessageThreadContext, message: Message.Mes
|
|
|
135
150
|
}
|
|
136
151
|
break;
|
|
137
152
|
}
|
|
153
|
+
|
|
138
154
|
case 'reference': {
|
|
155
|
+
if (block.pending) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
139
158
|
const dxn = block.reference.dxn;
|
|
140
159
|
return `<reference ref="${dxn.toString()}">${context.getObjectLabel(dxn)}</reference>`;
|
|
141
160
|
}
|
|
161
|
+
|
|
142
162
|
case 'suggestion': {
|
|
143
163
|
if (block.pending) {
|
|
144
164
|
return;
|
|
145
165
|
}
|
|
146
166
|
return `<suggestion>${block.text}</suggestion>`;
|
|
147
167
|
}
|
|
168
|
+
|
|
148
169
|
case 'select': {
|
|
149
170
|
if (block.pending || block.options.length === 0) {
|
|
150
171
|
return;
|
|
151
172
|
}
|
|
152
173
|
return `<select>${block.options.map((option) => `<option>${option}</option>`).join('')}</select>`;
|
|
153
174
|
}
|
|
175
|
+
|
|
154
176
|
case 'toolCall': {
|
|
155
|
-
context
|
|
156
|
-
blocks: [block],
|
|
157
|
-
});
|
|
177
|
+
applyToolBlockToWidgetState(context, block);
|
|
158
178
|
return `<toolCall id="${block.toolCallId}" />`;
|
|
159
179
|
}
|
|
180
|
+
|
|
160
181
|
case 'toolResult': {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}));
|
|
182
|
+
// TODO(dmaretskyi): the parameter could be undefined, perhaps tool blocks are not arriving in order.
|
|
183
|
+
applyToolBlockToWidgetState(context, block);
|
|
164
184
|
break;
|
|
165
185
|
}
|
|
186
|
+
|
|
187
|
+
case 'stats': {
|
|
188
|
+
return '';
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
case 'reasoning': {
|
|
192
|
+
let text = block.reasoningText ?? block.redactedText;
|
|
193
|
+
if (!text) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
return renderXMLBlock('reasoning', { content: text, pending: block.pending });
|
|
197
|
+
}
|
|
198
|
+
|
|
166
199
|
case 'summary': {
|
|
167
|
-
return
|
|
200
|
+
return renderXMLBlock('summary', { content: block.content, pending: block.pending });
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
case 'status': {
|
|
204
|
+
return renderXMLBlock('status', { content: block.statusText, pending: block.pending });
|
|
168
205
|
}
|
|
206
|
+
|
|
169
207
|
default: {
|
|
170
208
|
// TODO(burdon): Needs stable ID.
|
|
171
209
|
return `<json id="${message.id}">\n${JSON.stringify(block)}\n</json>`;
|
|
172
210
|
}
|
|
173
211
|
}
|
|
174
212
|
};
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Escape text embedded in generated XML so the mixed XML parser does not treat `&`, `<`, `>` as markup.
|
|
216
|
+
*/
|
|
217
|
+
const escapeXmlTextContent = (raw: string): string =>
|
|
218
|
+
raw.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Strip actual list-marker prefixes without removing meaningful leading content.
|
|
222
|
+
*/
|
|
223
|
+
const stripBulletLikeLinePrefixes = (raw: string): string =>
|
|
224
|
+
raw
|
|
225
|
+
.split(/\r?\n/)
|
|
226
|
+
.map((line) => line.replace(/^\s*(?:[-*+•]|\d+[.)]\s)/, ''))
|
|
227
|
+
.join('\n');
|
|
228
|
+
|
|
229
|
+
const renderXMLBlock = (tag: string, opts: { content?: string; pending?: boolean; attributes?: string }) => {
|
|
230
|
+
// Replace paragraph breaks so that markdown parser does not split the content into multiple paragraphs.
|
|
231
|
+
const content = escapeXmlTextContent(stripBulletLikeLinePrefixes((opts.content ?? '').replace(/\n\n/g, ' ').trim()));
|
|
232
|
+
|
|
233
|
+
if (opts.pending) {
|
|
234
|
+
return `<${tag}${opts.attributes ? ` ${opts.attributes}` : ''}>${content}`;
|
|
235
|
+
} else {
|
|
236
|
+
return `<${tag}${opts.attributes ? ` ${opts.attributes}` : ''}>${content}</${tag}>`;
|
|
237
|
+
}
|
|
238
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
|
|
1
3
|
//
|
|
2
4
|
// Copyright 2025 DXOS.org
|
|
3
5
|
//
|
|
@@ -7,9 +9,10 @@ import { describe, it } from '@effect/vitest';
|
|
|
7
9
|
import * as Effect from 'effect/Effect';
|
|
8
10
|
|
|
9
11
|
import { Obj } from '@dxos/echo';
|
|
12
|
+
import { type Mutable } from '@dxos/echo/internal';
|
|
10
13
|
import { type ContentBlock } from '@dxos/types';
|
|
11
14
|
|
|
12
|
-
import { createMessage } from '
|
|
15
|
+
import { createMessage } from '#testing';
|
|
13
16
|
|
|
14
17
|
import { blockToMarkdown } from './registry';
|
|
15
18
|
import { MessageSyncer, type TextModel } from './sync';
|
|
@@ -17,15 +20,15 @@ import { MessageSyncer, type TextModel } from './sync';
|
|
|
17
20
|
class TestDocument implements TextModel {
|
|
18
21
|
private readonly _view = new EditorView({ extensions: [] });
|
|
19
22
|
|
|
20
|
-
get
|
|
21
|
-
return this._view;
|
|
23
|
+
get length() {
|
|
24
|
+
return this._view.state.doc.length;
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
get content() {
|
|
25
28
|
return this._view.state.doc.toString();
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
async
|
|
31
|
+
async setContent(text: string) {
|
|
29
32
|
this._view.dispatch({
|
|
30
33
|
changes: { from: 0, to: this._view.state.doc.length, insert: text },
|
|
31
34
|
});
|
|
@@ -55,8 +58,8 @@ describe('reducers', () => {
|
|
|
55
58
|
syncer.append(messages);
|
|
56
59
|
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!', ''].join('\n'));
|
|
57
60
|
|
|
58
|
-
Obj.change(messages[1], (
|
|
59
|
-
|
|
61
|
+
Obj.change(messages[1], (obj) => {
|
|
62
|
+
obj.blocks.push({ _tag: 'text', text: 'How can I help?' });
|
|
60
63
|
});
|
|
61
64
|
syncer.append(messages);
|
|
62
65
|
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!', 'How can I help?', ''].join('\n'));
|
|
@@ -77,15 +80,15 @@ describe('reducers', () => {
|
|
|
77
80
|
syncer.append(messages);
|
|
78
81
|
expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!'].join('\n'));
|
|
79
82
|
|
|
80
|
-
Obj.change(messages[1], (
|
|
81
|
-
const block =
|
|
83
|
+
Obj.change(messages[1], (obj) => {
|
|
84
|
+
const block = obj.blocks[0] as Mutable<ContentBlock.Text>;
|
|
82
85
|
block.text = 'Hi there! How are you?';
|
|
83
86
|
block.pending = false;
|
|
84
87
|
});
|
|
85
88
|
syncer.append(messages);
|
|
86
89
|
|
|
87
|
-
Obj.change(messages[1], (
|
|
88
|
-
|
|
90
|
+
Obj.change(messages[1], (obj) => {
|
|
91
|
+
obj.blocks.push({ _tag: 'text', text: 'How can I help?' });
|
|
89
92
|
});
|
|
90
93
|
syncer.append(messages);
|
|
91
94
|
expect(doc.content).toEqual(
|
|
@@ -8,10 +8,12 @@ import { type MarkdownStreamController } from '@dxos/react-ui-components';
|
|
|
8
8
|
import { type ContentBlock, type Message } from '@dxos/types';
|
|
9
9
|
import { type StateDispatch, type XmlWidgetStateManager } from '@dxos/ui-editor';
|
|
10
10
|
|
|
11
|
+
import { rehydrateToolWidgetsFromMessages } from './tool-widget-state';
|
|
12
|
+
|
|
11
13
|
/**
|
|
12
14
|
* Update document.
|
|
13
15
|
*/
|
|
14
|
-
export type TextModel = Pick<MarkdownStreamController, '
|
|
16
|
+
export type TextModel = Pick<MarkdownStreamController, 'length' | 'setContent' | 'append' | 'updateWidget'>;
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* Thread context passed to renderer.
|
|
@@ -42,6 +44,7 @@ export type BlockRenderer = (
|
|
|
42
44
|
* Syncs messages with the editor.
|
|
43
45
|
*/
|
|
44
46
|
export class MessageSyncer {
|
|
47
|
+
#syncEpoch = 0;
|
|
45
48
|
private _initialMessageId?: string;
|
|
46
49
|
private _currentMessageIndex = 0;
|
|
47
50
|
private _currentBlockIndex = 0;
|
|
@@ -50,10 +53,10 @@ export class MessageSyncer {
|
|
|
50
53
|
private readonly _context: MessageThreadContext;
|
|
51
54
|
|
|
52
55
|
constructor(
|
|
53
|
-
private readonly
|
|
54
|
-
private readonly
|
|
56
|
+
private readonly _document: TextModel,
|
|
57
|
+
private readonly _renderer: BlockRenderer,
|
|
55
58
|
) {
|
|
56
|
-
this._context = new MessageThreadContext(this.
|
|
59
|
+
this._context = new MessageThreadContext(this._document);
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
get context() {
|
|
@@ -62,59 +65,67 @@ export class MessageSyncer {
|
|
|
62
65
|
|
|
63
66
|
reset() {
|
|
64
67
|
log('reset');
|
|
68
|
+
this.#syncEpoch++;
|
|
65
69
|
this._initialMessageId = undefined;
|
|
66
70
|
this._currentMessageIndex = 0;
|
|
67
71
|
this._currentBlockIndex = 0;
|
|
68
72
|
this._currentBlockContent = undefined;
|
|
69
|
-
void this.
|
|
73
|
+
void this._document.setContent('');
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
/**
|
|
73
77
|
* Syncs messages with the editor.
|
|
74
78
|
*/
|
|
75
79
|
append(messages: Message.Message[], flush = false): boolean {
|
|
80
|
+
// TODO(dmaretskyi): MarkdownStream currently does not support streaming XML tags, so we need to remove pending non-text blocks.
|
|
81
|
+
// messages = messages.map((message) => ({
|
|
82
|
+
// ...message,
|
|
83
|
+
// blocks: message.blocks.filter((block) => !block.pending || block._tag === 'text'),
|
|
84
|
+
// }));
|
|
85
|
+
|
|
76
86
|
// Check if new set of messages.
|
|
77
87
|
if (this._initialMessageId !== messages[0]?.id) {
|
|
78
88
|
this.reset();
|
|
79
89
|
this._initialMessageId = messages[0]?.id;
|
|
80
90
|
}
|
|
81
91
|
|
|
82
|
-
if (
|
|
92
|
+
if (this._document.length === 0 && flush) {
|
|
83
93
|
const buffer: string[] = [];
|
|
84
|
-
this.
|
|
85
|
-
buffer.push(content);
|
|
86
|
-
});
|
|
87
|
-
|
|
94
|
+
this.processBlocks(messages, (content) => buffer.push(content));
|
|
88
95
|
const content = buffer.join('');
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
// `setContent` dispatches `xmlTagResetEffect`, which clears widget props accumulated during
|
|
97
|
+
// `processBlocks`; re-apply tool state after the document is replaced.
|
|
98
|
+
const epoch = this.#syncEpoch;
|
|
99
|
+
void this._document
|
|
100
|
+
.setContent(content)
|
|
101
|
+
.then(() => {
|
|
102
|
+
if (epoch !== this.#syncEpoch) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
rehydrateToolWidgetsFromMessages(this._context, messages);
|
|
106
|
+
})
|
|
107
|
+
.catch((error) => {
|
|
108
|
+
log.warn('failed to replace thread content before widget rehydration', { error });
|
|
109
|
+
});
|
|
99
110
|
|
|
100
111
|
return true;
|
|
101
112
|
} else {
|
|
102
|
-
this.
|
|
103
|
-
void this.
|
|
113
|
+
this.processBlocks(messages, (content) => {
|
|
114
|
+
void this._document.append(content);
|
|
104
115
|
});
|
|
105
116
|
|
|
106
117
|
return false;
|
|
107
118
|
}
|
|
108
119
|
}
|
|
109
120
|
|
|
110
|
-
private
|
|
111
|
-
log('sync', {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
121
|
+
private processBlocks(messages: Message.Message[], append: (content: string) => void) {
|
|
122
|
+
// console.log('sync', {
|
|
123
|
+
// doc: this._model.view?.state.doc.length,
|
|
124
|
+
// messages: messages.map((message) => message.blocks.length),
|
|
125
|
+
// currentMessageIndex: this._currentMessageIndex,
|
|
126
|
+
// currentBlockIndex: this._currentBlockIndex,
|
|
127
|
+
// currentBlockContent: this._currentBlockContent,
|
|
128
|
+
// });
|
|
118
129
|
|
|
119
130
|
let i = this._currentMessageIndex;
|
|
120
131
|
for (const message of messages.slice(this._currentMessageIndex)) {
|
|
@@ -126,7 +137,7 @@ export class MessageSyncer {
|
|
|
126
137
|
let j = this._currentBlockIndex;
|
|
127
138
|
for (const block of message.blocks.slice(this._currentBlockIndex)) {
|
|
128
139
|
this._currentBlockIndex = j;
|
|
129
|
-
const currentBlockContent = this.
|
|
140
|
+
const currentBlockContent = this._renderer(this._context, message, block);
|
|
130
141
|
if (currentBlockContent) {
|
|
131
142
|
let content: string = '';
|
|
132
143
|
if (this._currentBlockContent && currentBlockContent.startsWith(this._currentBlockContent)) {
|
|
@@ -135,7 +146,7 @@ export class MessageSyncer {
|
|
|
135
146
|
content = currentBlockContent;
|
|
136
147
|
}
|
|
137
148
|
|
|
138
|
-
log('append', { message: i, block: j, content });
|
|
149
|
+
// console.log('append', { message: i, block: j, content });
|
|
139
150
|
this._currentBlockContent = currentBlockContent;
|
|
140
151
|
append(content);
|
|
141
152
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<prompt>create a project to track what I order online based on my emails, dont asak me questions</prompt>
|
|
2
|
+
<reasoning>The user wants me to create a project that tracks their online orders based on emails. They don't want me to ask questions - just go ahead and create it. Let me first get the project rules and query for available mailboxes/inboxes.</reasoning>
|
|
3
|
+
<status>Getting the project rules and finding your mailboxes to set this up...</status>
|
|
4
|
+
<toolCall id="toolu_01QJcUw8RZDyemLdvMe8nSGZ" />
|
|
5
|
+
<toolCall id="toolu_01JJZrCc17JqV5r36aR9wcaj" />
|
|
6
|
+
<toolCall id="toolu_012r3VQFxvWZ9UmKxMNiJP48" />
|
|
7
|
+
<reasoning>The mailbox query failed. Let me try a different approach to find mailboxes. Let me also enable the inbox blueprint to find mailboxes, and create the Order schema first. Let me first search for mailboxes with a different query approach.</reasoning>
|
|
8
|
+
<status>Looking for your mailboxes...</status>
|
|
9
|
+
<toolCall id="toolu_01P4ekwYwYJfxUnGFPHNhcCu" />
|
|
10
|
+
<toolCall id="toolu_017NHbtinMDcjmwqN6vLaNQp" />
|
|
11
|
+
<reasoning>I found the mailbox with DXN `dxn:echo:B6ON2Y6HN4KLJWZD75VUUDCUQ552ERQSG:01KNHKXSWWCBZX6TCPMF1M0PDE`. Now I need to: 1. Create an Order schema for tracking online orders 2. Create the project with the right blueprints and subscriptions Let me first create the Order schema, then create the project.</reasoning>
|
|
12
|
+
<status>Found your mailbox. Now creating an Order schema and setting up the project...</status>
|
|
13
|
+
<toolCall id="toolu_01Gk4RcfdB4ttzsVN9mnatWn" />
|
|
14
|
+
<status>Order schema created. Now creating the project...</status>
|
|
15
|
+
<toolCall id="toolu_01QmJcua6jmRx15wnxo5bkNQ" />
|
|
16
|
+
<reasoning>The service isn't available. Let me try again.</reasoning>
|
|
17
|
+
<status>Encountered a temporary service issue. Retrying...</status>
|
|
18
|
+
<toolCall id="toolu_01X4CVxXuBjgW2JESGUEsm6f" />
|
|
19
|
+
<reasoning>The service seems to be temporarily unavailable. Let me try once more.</reasoning>
|
|
20
|
+
<toolCall id="toolu_01S9vi1pMnwqUuxNpe5FU731" />
|
|
21
|
+
Got the project created. Let me know if you need anything else.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<prompt>What is markdown?</prompt>
|
|
2
|
+
|
|
3
|
+
<reasoning>
|
|
4
|
+
The user is asking me to think deeply about what markdown is.
|
|
5
|
+
|
|
6
|
+
But given the context of our conversation - we've been trying to scrape slab data from a website - I think they might be hinting at something specific.
|
|
7
|
+
</reasoning>
|
|
8
|
+
|
|
9
|
+
### Markdown
|
|
10
|
+
|
|
11
|
+
Markdown is a lightweight markup language used to format plain text in a simple and readable way.
|
|
12
|
+
|
|
13
|
+
It allows you to create structured documents using conventions for headings, lists, emphasis (bold/italic), links, images, code, blockquotes, tables, and horizontal rules.
|
|
14
|
+
|
|
15
|
+
Markdown documents look like this
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
# Markdown
|
|
19
|
+
|
|
20
|
+
This is a plain text.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Composer supports extended components via XML tags.
|
|
24
|
+
|
|
25
|
+
<summary>
|
|
26
|
+
The user asked about Markdown.
|
|
27
|
+
|
|
28
|
+
We responded with a summary.
|
|
29
|
+
|
|
30
|
+
</summary>
|
|
@@ -35,3 +35,22 @@ What kind of information are you looking to organize? This will help me suggest
|
|
|
35
35
|
|
|
36
36
|
<summary>OK (1 tool uses · 4.28k tokens · 11.1s)</summary>
|
|
37
37
|
<summary>OK (4.30k tokens · 1.6s)</summary>
|
|
38
|
+
|
|
39
|
+
<reasoning>Based on the rules, this is similar to the "Parcel tracking" example. I should: 1. First create an Order schema 2. Query for mailboxes to subscribe to 3. Query for available blueprints 4. Create the project Let me first ask a couple of qualifying questions, then proceed. Actually, the example is pretty clear - let me set things up. But first let me check for mailboxes and blueprints. Let me query for mailboxes and blueprints in parallel.</reasoning>
|
|
40
|
+
|
|
41
|
+
<reasoning>I found a mailbox at `dxn:echo:B6ON2Y6HN4KLJWZD75VUUDCUQ552ERQSG:01KNHKXSWWCBZX6TCPMF1M0PDE`. Now I have everything I need to create the CRM project. The project should:
|
|
42
|
+
|
|
43
|
+
1. Subscribe to the mailbox
|
|
44
|
+
2. Use database, web-search, and browser blueprints
|
|
45
|
+
3. Extract People and Organizations from emails
|
|
46
|
+
4. Research contacts on the web
|
|
47
|
+
5. Save to database avoiding duplicates
|
|
48
|
+
6. Now I'm building the project structure to tie all these components together.</reasoning>
|
|
49
|
+
|
|
50
|
+
<reasoning>I found the mailbox. Now I have all the information I need to create the CRM project. Let me create it with the appropriate blueprints and subscription to the mailbox. The project should:
|
|
51
|
+
|
|
52
|
+
- Subscribe to the mailbox
|
|
53
|
+
- On every email, extract People and Organizations
|
|
54
|
+
- Save them to the database (checking for duplicates first)
|
|
55
|
+
- Run web searches to enrich contact/org data
|
|
56
|
+
- Blueprints needed: database, web-search, browser</reasoning>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<prompt>Analyze this codebase and suggest improvements.</prompt>
|
|
2
|
+
|
|
3
|
+
<reasoning>
|
|
4
|
+
The user wants a comprehensive analysis of their codebase. I should examine the project structure, identify key patterns, and look for areas that could be improved. Let me start by reviewing the main source files and dependencies.
|
|
5
|
+
</reasoning>
|
|
6
|
+
|
|
7
|
+
I'll start by examining the project structure and key files.
|
|
8
|
+
|
|
9
|
+
<toolCall id="toolu_01ABC123analyze" />
|
|
10
|
+
|
|
11
|
+
<summary>Analyzed 42 files across 8 packages. Found 3 areas for improvement.</summary>
|
|
12
|
+
|
|
13
|
+
Here's what I found after reviewing the codebase:
|
|
14
|
+
|
|
15
|
+
## Architecture
|
|
16
|
+
|
|
17
|
+
The project follows a modular plugin architecture with clear separation of concerns. Each plugin manages its own state and communicates through a shared event bus.
|
|
18
|
+
|
|
19
|
+
## Suggested Improvements
|
|
20
|
+
|
|
21
|
+
1. **Type Safety** — Several utility functions use `any` types that could be narrowed. This would catch bugs at compile time rather than runtime.
|
|
22
|
+
|
|
23
|
+
2. **Error Handling** — The API layer could benefit from structured error types using discriminated unions instead of thrown exceptions.
|
|
24
|
+
|
|
25
|
+
3. **Performance** — The subscription handlers in the data layer create new closures on every update. Memoizing these would reduce GC pressure.
|
|
26
|
+
|
|
27
|
+
<reference ref="dxn:echo:@:123e4567-e89b-12d3-a456-426614174000">ProjectConfig</reference>
|
|
28
|
+
|
|
29
|
+
Would you like me to dive deeper into any of these areas?
|
|
30
|
+
|
|
31
|
+
<select>
|
|
32
|
+
<option>Improve type safety</option>
|
|
33
|
+
<option>Refactor error handling</option>
|
|
34
|
+
<option>Optimize performance</option>
|
|
35
|
+
</select>
|
|
36
|
+
|
|
37
|
+
<suggestion>Show me the specific files that need type improvements</suggestion>
|
|
38
|
+
|
|
39
|
+
<suggestion>Generate a refactoring plan as a document</suggestion>
|
|
40
|
+
|
|
41
|
+
<stats>3 tool uses · 12.4k tokens · 18.2s</stats>
|
|
42
|
+
|
|
43
|
+
<prompt>Improve type safety</prompt>
|
|
44
|
+
|
|
45
|
+
<reasoning>
|
|
46
|
+
The user chose to focus on type safety improvements. I should identify the specific files and patterns where `any` types are used unnecessarily and propose concrete fixes with before/after examples.
|
|
47
|
+
</reasoning>
|
|
48
|
+
|
|
49
|
+
Let me find all the locations where type safety can be improved.
|
|
50
|
+
|
|
51
|
+
<toolCall id="toolu_01DEF456typescan" />
|
|
52
|
+
|
|
53
|
+
<summary>Scanned 42 files. Found 17 instances of unnecessary `any` usage across 6 modules.</summary>
|
|
54
|
+
|
|
55
|
+
Here are the key changes I recommend:
|
|
56
|
+
|
|
57
|
+
### `src/utils/transform.ts`
|
|
58
|
+
|
|
59
|
+
The `transform` function currently accepts `any` for its input parameter. We can use a generic constraint instead:
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
// Before
|
|
63
|
+
const transform = (input: any) => { ... }
|
|
64
|
+
|
|
65
|
+
// After
|
|
66
|
+
const transform = <T extends Record<string, unknown>>(input: T) => { ... }
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### `src/handlers/events.ts`
|
|
70
|
+
|
|
71
|
+
The event handler map uses `any` for callback types. A mapped type would preserve type information:
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
type EventHandlers = {
|
|
75
|
+
[K in keyof EventMap]: (event: EventMap[K]) => void;
|
|
76
|
+
};
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
<stats>1 tool use · 8.7k tokens · 12.1s</stats>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { createMessage } from '#testing';
|
|
8
|
+
|
|
9
|
+
import { rehydrateToolWidgetsFromMessages } from './tool-widget-state';
|
|
10
|
+
|
|
11
|
+
describe('rehydrateToolWidgetsFromMessages', () => {
|
|
12
|
+
test('replays toolCall then toolResult in order', () => {
|
|
13
|
+
const calls: Array<{ id: string; kind: 'object' | 'function' }> = [];
|
|
14
|
+
const sink = {
|
|
15
|
+
updateWidget: (id: string, value: unknown) => {
|
|
16
|
+
calls.push({ id, kind: typeof value === 'function' ? 'function' : 'object' });
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const messages = [
|
|
21
|
+
createMessage('assistant', [
|
|
22
|
+
{ _tag: 'toolCall', toolCallId: 't1', name: 'foo', input: '{}', providerExecuted: false },
|
|
23
|
+
{ _tag: 'toolResult', toolCallId: 't1', name: 'foo', result: '{}', providerExecuted: false },
|
|
24
|
+
]),
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
rehydrateToolWidgetsFromMessages(sink, messages);
|
|
28
|
+
|
|
29
|
+
expect(calls).toEqual([
|
|
30
|
+
{ id: 't1', kind: 'object' },
|
|
31
|
+
{ id: 't1', kind: 'function' },
|
|
32
|
+
]);
|
|
33
|
+
});
|
|
34
|
+
});
|