@dxos/plugin-assistant 0.8.4-main.406dc2a → 0.8.4-main.422d1c7879
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 +8 -0
- 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-LMVTXH54.mjs +154 -0
- package/dist/lib/browser/chunk-LMVTXH54.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +74 -0
- package/dist/lib/browser/cli/index.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-ZEZA34MZ.mjs +65 -0
- package/dist/lib/browser/ensure-companion-chat-ZEZA34MZ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3388 -308
- 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-THLK5YQC.mjs +136 -0
- package/dist/lib/browser/run-prompt-in-new-chat-THLK5YQC.mjs.map +7 -0
- package/dist/lib/browser/set-current-chat-LRS3VFSH.mjs +54 -0
- package/dist/lib/browser/set-current-chat-LRS3VFSH.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +5 -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 +9 -0
- 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-W3JZ2F4T.mjs +155 -0
- package/dist/lib/node-esm/chunk-W3JZ2F4T.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +75 -0
- package/dist/lib/node-esm/cli/index.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-6K2WEWFP.mjs +66 -0
- package/dist/lib/node-esm/ensure-companion-chat-6K2WEWFP.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3388 -308
- 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-OUYKCMQ7.mjs +137 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-OUYKCMQ7.mjs.map +7 -0
- package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs +55 -0
- package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +5 -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 +2 -1
- 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 +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service.d.ts +4 -2
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +4 -6
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- 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 +6 -3
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +29 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +9 -3
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
- 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 +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +4 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +19 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +4 -2
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +10 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -4
- 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 +28 -15
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +5 -1
- package/dist/types/src/components/Chat/events.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 +5 -3
- 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/ChatReferences.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatReferences.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 -10
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +15 -262
- package/dist/types/src/components/ChatThread/ChatThread.stories.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 +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +50 -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/PromptWidget.d.ts +15 -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 +15 -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 +6 -4
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +1 -250
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +11 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +2 -251
- 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 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +6 -13
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +13 -12
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +1 -249
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -11
- 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/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 +21 -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 +7 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +16 -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 +17 -0
- package/dist/types/src/containers/TracePanel/execution-graph.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 +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 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -5
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +9 -6
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -8
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
- 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 +7 -7
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
- 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 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -2
- 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/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/presets.d.ts +1 -1
- package/dist/types/src/processor/presets.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +41 -35
- 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/test-generator.d.ts +5 -4
- 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/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 -87
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +18 -49
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +11 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +32 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +10 -212
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +144 -98
- package/src/AssistantPlugin.tsx +190 -119
- 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/{components/Toolbar → blueprints}/index.ts +1 -1
- package/src/capabilities/ai-service.ts +20 -17
- package/src/capabilities/app-graph-builder.ts +143 -144
- package/src/capabilities/blueprint-definition.ts +49 -55
- package/src/capabilities/companion-chat-provisioner.ts +164 -0
- package/src/capabilities/edge-model-resolver.ts +22 -14
- package/src/capabilities/index.ts +21 -14
- package/src/capabilities/local-model-resolver.ts +31 -13
- package/src/capabilities/markdown.ts +40 -0
- package/src/capabilities/migrations.ts +35 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +147 -77
- package/src/capabilities/settings.ts +24 -12
- package/src/capabilities/state.ts +27 -12
- package/src/capabilities/toolkit.ts +6 -161
- package/src/cli/index.ts +5 -0
- package/src/cli/plugin.ts +84 -0
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +34 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +105 -85
- package/src/components/AssistantSettings/index.ts +2 -2
- package/src/components/Chat/Chat.tsx +225 -147
- package/src/components/Chat/events.ts +7 -1
- package/src/components/ChatProgress/ChatProgress.tsx +11 -22
- package/src/components/ChatPrompt/ChatActions.tsx +26 -8
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +122 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +272 -93
- package/src/components/ChatPrompt/ChatReferences.tsx +23 -14
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/Anchor.stories.tsx +95 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +76 -62
- package/src/components/ChatThread/ChatThread.tsx +47 -44
- package/src/components/ChatThread/Link.tsx +4 -4
- package/src/components/ChatThread/MarkdownStream.stories.tsx +280 -0
- package/src/components/ChatThread/registry.tsx +132 -69
- package/src/components/ChatThread/sync.test.ts +130 -20
- package/src/components/ChatThread/sync.ts +104 -67
- 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-2.md +56 -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 +30 -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 +131 -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 +86 -0
- package/src/components/ProcessTree/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +18 -13
- package/src/components/TemplateEditor/TemplateEditor.tsx +59 -39
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +20 -11
- package/src/components/TemplateEditor/TemplateForm.tsx +83 -37
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +274 -0
- package/src/components/TemplateEditor/extensions/index.ts +6 -0
- package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
- package/src/components/ToolBlock/ToolBlock.tsx +46 -54
- package/src/components/Toolbox/Toolbox.stories.tsx +11 -14
- package/src/components/Toolbox/Toolbox.tsx +70 -65
- package/src/components/index.ts +3 -10
- 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 +100 -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/containers/ChatCompanion/ChatCompanion.tsx +142 -0
- 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 +19 -15
- 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.stories.tsx +272 -0
- package/src/containers/TracePanel/TracePanel.tsx +113 -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.ts +452 -0
- package/src/containers/TracePanel/index.ts +9 -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 -1
- package/src/hooks/useBlueprintRegistry.ts +36 -21
- package/src/hooks/useChatProcessor.ts +44 -28
- package/src/hooks/useChatServices.ts +10 -33
- package/src/hooks/useChatToolbarActions.ts +122 -0
- package/src/hooks/useContextBinder.ts +20 -7
- package/src/hooks/useContextObjects.ts +16 -24
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/usePresets.ts +2 -1
- package/src/hooks/useReferencesProvider.ts +5 -8
- package/src/index.ts +1 -2
- package/src/meta.ts +14 -6
- 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/prompt.test.ts +79 -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/presets.ts +12 -4
- package/src/processor/processor.test.ts +20 -61
- package/src/processor/processor.ts +200 -181
- package/src/queue-logger.ts +24 -14
- package/src/testing/data/trace-timeline.dx.json +2120 -0
- package/src/testing/test-generator.test.ts +81 -0
- package/src/testing/test-generator.ts +86 -48
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +9 -7
- package/src/testing/trace-timeline.conversations.json +1 -0
- package/src/testing/trace-timeline.test.ts +246 -0
- package/src/translations.ts +161 -77
- package/src/types/Assistant.ts +8 -58
- package/src/types/Settings.ts +21 -0
- package/src/types/capabilities.ts +35 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +5 -1
- package/src/types/service.ts +14 -11
- package/dist/lib/browser/BlueprintContainer-WX2SSDVI.mjs +0 -28
- package/dist/lib/browser/BlueprintContainer-WX2SSDVI.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-BDZ55ZRF.mjs +0 -150
- package/dist/lib/browser/ChatCompanion-BDZ55ZRF.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-RYGNN73X.mjs +0 -73
- package/dist/lib/browser/ChatContainer-RYGNN73X.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-MVHH2U66.mjs +0 -86
- package/dist/lib/browser/ChatDialog-MVHH2U66.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-2FEWMQGW.mjs +0 -150
- package/dist/lib/browser/SequenceContainer-2FEWMQGW.mjs.map +0 -7
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-2U7SLCRX.mjs +0 -154
- package/dist/lib/browser/app-graph-builder-2U7SLCRX.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-NSJARW5U.mjs +0 -12
- package/dist/lib/browser/chunk-2CE2KPKZ.mjs +0 -175
- package/dist/lib/browser/chunk-2CE2KPKZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-43I2LR6O.mjs +0 -216
- package/dist/lib/browser/chunk-43I2LR6O.mjs.map +0 -7
- package/dist/lib/browser/chunk-5EGXHCAZ.mjs +0 -16
- package/dist/lib/browser/chunk-5EGXHCAZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-5RICKAMN.mjs +0 -18
- package/dist/lib/browser/chunk-5RICKAMN.mjs.map +0 -7
- package/dist/lib/browser/chunk-CQ7UHYTT.mjs +0 -296
- package/dist/lib/browser/chunk-CQ7UHYTT.mjs.map +0 -7
- package/dist/lib/browser/chunk-FP56WB24.mjs +0 -212
- package/dist/lib/browser/chunk-FP56WB24.mjs.map +0 -7
- package/dist/lib/browser/chunk-JZRZVB2A.mjs +0 -170
- package/dist/lib/browser/chunk-JZRZVB2A.mjs.map +0 -7
- package/dist/lib/browser/chunk-WRJGOT5P.mjs +0 -1794
- package/dist/lib/browser/chunk-WRJGOT5P.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3GOJMBXJ.mjs +0 -114
- package/dist/lib/browser/intent-resolver-3GOJMBXJ.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FTKCE6GG.mjs +0 -107
- package/dist/lib/browser/react-surface-FTKCE6GG.mjs.map +0 -7
- package/dist/lib/browser/settings-HBF32KV6.mjs +0 -23
- package/dist/lib/browser/settings-HBF32KV6.mjs.map +0 -7
- package/dist/lib/browser/state-LXTS54DI.mjs +0 -21
- package/dist/lib/browser/state-LXTS54DI.mjs.map +0 -7
- package/dist/lib/browser/toolkit-NQ2GXCF5.mjs +0 -199
- package/dist/lib/browser/toolkit-NQ2GXCF5.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-4MKN6ZRB.mjs +0 -29
- package/dist/lib/node-esm/BlueprintContainer-4MKN6ZRB.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-XFNXVZIP.mjs +0 -151
- package/dist/lib/node-esm/ChatCompanion-XFNXVZIP.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-UTJGCQXF.mjs +0 -74
- package/dist/lib/node-esm/ChatContainer-UTJGCQXF.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QEYZ4IOV.mjs +0 -87
- package/dist/lib/node-esm/ChatDialog-QEYZ4IOV.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-PGGJUQ46.mjs +0 -151
- package/dist/lib/node-esm/SequenceContainer-PGGJUQ46.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-OKNLR7H2.mjs +0 -155
- package/dist/lib/node-esm/app-graph-builder-OKNLR7H2.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-WD2IVMAI.mjs +0 -13
- package/dist/lib/node-esm/chunk-73ABYRYX.mjs +0 -20
- package/dist/lib/node-esm/chunk-73ABYRYX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DSE2IILK.mjs +0 -217
- package/dist/lib/node-esm/chunk-DSE2IILK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E2WXZND7.mjs +0 -297
- package/dist/lib/node-esm/chunk-E2WXZND7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HXIBCBH4.mjs +0 -171
- package/dist/lib/node-esm/chunk-HXIBCBH4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TNR46C3L.mjs +0 -213
- package/dist/lib/node-esm/chunk-TNR46C3L.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-U2NYUS2N.mjs +0 -177
- package/dist/lib/node-esm/chunk-U2NYUS2N.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UFKLCEAE.mjs +0 -1795
- package/dist/lib/node-esm/chunk-UFKLCEAE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs +0 -17
- package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +0 -19
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-6XLVTRDJ.mjs +0 -115
- package/dist/lib/node-esm/intent-resolver-6XLVTRDJ.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-K7ZXQLAP.mjs +0 -108
- package/dist/lib/node-esm/react-surface-K7ZXQLAP.mjs.map +0 -7
- package/dist/lib/node-esm/settings-CWP6MTWP.mjs +0 -24
- package/dist/lib/node-esm/settings-CWP6MTWP.mjs.map +0 -7
- package/dist/lib/node-esm/state-BO6GUFLB.mjs +0 -22
- package/dist/lib/node-esm/state-BO6GUFLB.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-V57PRJNG.mjs +0 -200
- package/dist/lib/node-esm/toolkit-V57PRJNG.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts +0 -11
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +0 -8
- package/dist/types/src/components/BlueprintContainer.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 -11
- 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/PromptSettings.d.ts +0 -6
- package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
- package/dist/types/src/components/SequenceContainer.d.ts +0 -8
- package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -269
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
- package/dist/types/src/components/SequenceEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +0 -5
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/index.d.ts +0 -2
- package/dist/types/src/components/Toolbar/index.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +0 -11
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/functions/analysis.d.ts +0 -5
- package/dist/types/src/functions/analysis.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/list.d.ts +0 -10
- package/dist/types/src/functions/list.d.ts.map +0 -1
- package/dist/types/src/functions/load.d.ts +0 -8
- package/dist/types/src/functions/load.d.ts.map +0 -1
- package/dist/types/src/hooks/useItemTypes.d.ts +0 -4
- package/dist/types/src/hooks/useItemTypes.d.ts.map +0 -1
- package/dist/types/src/types/AssistantAction.d.ts +0 -107
- package/dist/types/src/types/AssistantAction.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/intent-resolver.ts +0 -96
- package/src/components/BlueprintContainer.tsx +0 -24
- package/src/components/ChatCompanion.tsx +0 -136
- package/src/components/ChatContainer.tsx +0 -51
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/components/PromptSettings.tsx +0 -90
- package/src/components/SequenceContainer.tsx +0 -131
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -35
- package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
- package/src/components/SequenceEditor/index.ts +0 -5
- package/src/components/TemplateEditor/handlebars-extension.ts +0 -165
- package/src/components/Toolbar/Toolbar.tsx +0 -21
- package/src/components/Toolbar/useChatToolbarActions.ts +0 -126
- package/src/events.ts +0 -11
- package/src/functions/analysis.ts +0 -22
- package/src/functions/index.ts +0 -7
- package/src/functions/list.ts +0 -48
- package/src/functions/load.ts +0 -46
- package/src/hooks/useItemTypes.ts +0 -37
- package/src/types/AssistantAction.ts +0 -62
- /package/dist/lib/browser/{blueprint-definition-NSJARW5U.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{blueprint-definition-WD2IVMAI.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/types/src/components/TemplateEditor/{handlebars-extension.d.ts → extensions/handlebars-extension.d.ts} +0 -0
|
@@ -4,27 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Extension, Prec } from '@codemirror/state';
|
|
6
6
|
import { keymap } from '@codemirror/view';
|
|
7
|
-
import {
|
|
7
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
8
8
|
import { createContext } from '@radix-ui/react-context';
|
|
9
9
|
import * as Array from 'effect/Array';
|
|
10
10
|
import * as Option from 'effect/Option';
|
|
11
11
|
import React, { type PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
12
12
|
|
|
13
|
+
import { type Chat as ChatModule } from '@dxos/assistant-toolkit';
|
|
13
14
|
import { Event } from '@dxos/async';
|
|
14
|
-
import { Obj } from '@dxos/echo';
|
|
15
|
+
import { type Database, Filter, Obj } from '@dxos/echo';
|
|
15
16
|
import { useVoiceInput } from '@dxos/plugin-transcription';
|
|
16
|
-
import { type
|
|
17
|
+
import { type Queue, useQuery } from '@dxos/react-client/echo';
|
|
17
18
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
18
19
|
import { Input, type ThemedClassName, useDynamicRef, useTranslation } from '@dxos/react-ui';
|
|
19
|
-
import { ChatEditor, type ChatEditorController, type ChatEditorProps
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
20
|
+
import { ChatEditor, type ChatEditorController, type ChatEditorProps } from '@dxos/react-ui-chat';
|
|
21
|
+
import { type MarkdownStreamController } from '@dxos/react-ui-components';
|
|
22
|
+
import { Menu, MenuRootProps } from '@dxos/react-ui-menu';
|
|
23
|
+
import { Message } from '@dxos/types';
|
|
24
|
+
import { composable, composableProps, mx } from '@dxos/ui-theme';
|
|
25
|
+
import { isTruthy, trim } from '@dxos/util';
|
|
26
|
+
|
|
27
|
+
import { useChatToolbarActions } from '#hooks';
|
|
28
|
+
import { meta } from '#meta';
|
|
23
29
|
|
|
24
|
-
import { useReferencesProvider } from '../../hooks';
|
|
25
|
-
import { meta } from '../../meta';
|
|
26
30
|
import { type AiChatProcessor } from '../../processor';
|
|
27
|
-
import { type Assistant } from '../../types';
|
|
28
31
|
import {
|
|
29
32
|
ChatActions,
|
|
30
33
|
type ChatActionsProps,
|
|
@@ -33,12 +36,7 @@ import {
|
|
|
33
36
|
ChatReferences,
|
|
34
37
|
ChatStatusIndicator,
|
|
35
38
|
} from '../ChatPrompt';
|
|
36
|
-
import {
|
|
37
|
-
type ChatThreadController,
|
|
38
|
-
ChatThread as NaturalChatThread,
|
|
39
|
-
type ChatThreadProps as NaturalChatThreadProps,
|
|
40
|
-
} from '../ChatThread';
|
|
41
|
-
|
|
39
|
+
import { ChatThread as NaturalChatThread, type ChatThreadProps as NaturalChatThreadProps } from '../ChatThread';
|
|
42
40
|
import { type ChatEvent } from './events';
|
|
43
41
|
|
|
44
42
|
//
|
|
@@ -50,9 +48,9 @@ import { type ChatEvent } from './events';
|
|
|
50
48
|
type ChatContextValue = {
|
|
51
49
|
debug?: boolean;
|
|
52
50
|
event: Event<ChatEvent>;
|
|
53
|
-
|
|
54
|
-
chat
|
|
55
|
-
messages:
|
|
51
|
+
db?: Database.Database;
|
|
52
|
+
chat?: ChatModule.Chat;
|
|
53
|
+
messages: Message.Message[];
|
|
56
54
|
processor: AiChatProcessor;
|
|
57
55
|
};
|
|
58
56
|
|
|
@@ -62,28 +60,49 @@ export const [ChatContextProvider, useChatContext] = createContext<ChatContextVa
|
|
|
62
60
|
// Root
|
|
63
61
|
//
|
|
64
62
|
|
|
65
|
-
type ChatRootProps =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
>
|
|
63
|
+
type ChatRootProps = PropsWithChildren<
|
|
64
|
+
Pick<ChatContextValue, 'db' | 'chat' | 'processor'> & {
|
|
65
|
+
queue?: Queue;
|
|
66
|
+
onEvent?: (event: ChatEvent) => void;
|
|
67
|
+
}
|
|
71
68
|
>;
|
|
72
69
|
|
|
73
|
-
const ChatRoot = ({
|
|
70
|
+
const ChatRoot = ({ children, chat, queue, processor, onEvent, ...props }: ChatRootProps) => {
|
|
74
71
|
const [debug, setDebug] = useState(false);
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
// Messages.
|
|
78
|
-
const queue = useQueue<DataType.Message>(chat?.queue.dxn);
|
|
79
|
-
const pending = useRxValue(processor.messages);
|
|
80
|
-
const streaming = useRxValue(processor.streaming);
|
|
72
|
+
const pending = useAtomValue(processor.messages);
|
|
73
|
+
const streaming = useAtomValue(processor.streaming);
|
|
81
74
|
const lastPrompt = useRef<string | undefined>(undefined);
|
|
82
75
|
|
|
76
|
+
// Messages.
|
|
77
|
+
const storedMessages = useQuery(queue, Filter.type(Message.Message));
|
|
83
78
|
const messages = useMemo(() => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
return Array.dedupeWith([...storedMessages, ...pending], ({ id: a }, { id: b }) => a === b);
|
|
80
|
+
}, [storedMessages, pending]);
|
|
81
|
+
|
|
82
|
+
// Debug.
|
|
83
|
+
const dump = useCallback(async () => {
|
|
84
|
+
const objects = processor.context.getObjects();
|
|
85
|
+
const blueprints = processor.context.getBlueprints();
|
|
86
|
+
const system = await processor.getSystemPrompt();
|
|
87
|
+
const tools = await processor.getTools();
|
|
88
|
+
|
|
89
|
+
// eslint-disable-next-line no-console
|
|
90
|
+
// eslint-disable-next-line no-console
|
|
91
|
+
console.group('Chat', { objects, blueprints });
|
|
92
|
+
// eslint-disable-next-line no-console
|
|
93
|
+
console.log(trim`
|
|
94
|
+
System Prompt:
|
|
95
|
+
${system}
|
|
96
|
+
`);
|
|
97
|
+
// eslint-disable-next-line no-console
|
|
98
|
+
console.log(trim`
|
|
99
|
+
Tools:
|
|
100
|
+
${Object.values(tools)
|
|
101
|
+
.map((tool) => JSON.stringify(tool, null, 2))
|
|
102
|
+
.join('\n')}
|
|
103
|
+
`);
|
|
104
|
+
console.groupEnd();
|
|
105
|
+
}, [processor]);
|
|
87
106
|
|
|
88
107
|
// Events.
|
|
89
108
|
const event = useMemo(() => new Event<ChatEvent>(), []);
|
|
@@ -91,7 +110,14 @@ const ChatRoot = ({ classNames, children, chat, processor, onEvent, ...props }:
|
|
|
91
110
|
return event.on((ev) => {
|
|
92
111
|
switch (ev.type) {
|
|
93
112
|
case 'toggle-debug': {
|
|
94
|
-
setDebug((
|
|
113
|
+
setDebug((debug) => {
|
|
114
|
+
if (debug) {
|
|
115
|
+
return false;
|
|
116
|
+
} else {
|
|
117
|
+
void dump();
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
95
121
|
break;
|
|
96
122
|
}
|
|
97
123
|
|
|
@@ -120,41 +146,137 @@ const ChatRoot = ({ classNames, children, chat, processor, onEvent, ...props }:
|
|
|
120
146
|
}
|
|
121
147
|
break;
|
|
122
148
|
}
|
|
123
|
-
|
|
124
|
-
default: {
|
|
125
|
-
onEvent?.(ev);
|
|
126
|
-
}
|
|
127
149
|
}
|
|
150
|
+
|
|
151
|
+
onEvent?.(ev);
|
|
128
152
|
});
|
|
129
|
-
}, [event, processor, streaming, onEvent]);
|
|
153
|
+
}, [event, dump, processor, streaming, onEvent]);
|
|
130
154
|
|
|
131
|
-
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
155
|
+
const db = props.db ?? (chat && Obj.getDatabase(chat));
|
|
134
156
|
|
|
135
157
|
return (
|
|
136
158
|
<ChatContextProvider
|
|
137
159
|
debug={debug}
|
|
138
160
|
event={event}
|
|
161
|
+
db={db}
|
|
139
162
|
chat={chat}
|
|
140
|
-
space={space}
|
|
141
163
|
messages={messages}
|
|
142
164
|
processor={processor}
|
|
143
165
|
{...props}
|
|
144
166
|
>
|
|
145
|
-
|
|
146
|
-
{children}
|
|
147
|
-
</div>
|
|
167
|
+
{children}
|
|
148
168
|
</ChatContextProvider>
|
|
149
169
|
);
|
|
150
170
|
};
|
|
151
171
|
|
|
152
172
|
ChatRoot.displayName = 'Chat.Root';
|
|
153
173
|
|
|
174
|
+
//
|
|
175
|
+
// Toolbar
|
|
176
|
+
//
|
|
177
|
+
|
|
178
|
+
const CHAT_TOOLBAR_NAME = 'Chat.Toolbar';
|
|
179
|
+
|
|
180
|
+
type ChatToolbarProps = Pick<MenuRootProps, 'attendableId'> & {
|
|
181
|
+
companionTo?: Obj.Unknown;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const ChatToolbar = composable<HTMLDivElement, ChatToolbarProps>(
|
|
185
|
+
({ attendableId, companionTo, ...props }, forwardedRef) => {
|
|
186
|
+
const { chat } = useChatContext(CHAT_TOOLBAR_NAME);
|
|
187
|
+
const menuActions = useChatToolbarActions({ chat, companionTo });
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
<Menu.Root {...menuActions} attendableId={attendableId}>
|
|
191
|
+
<Menu.Toolbar {...composableProps(props)} ref={forwardedRef} />
|
|
192
|
+
</Menu.Root>
|
|
193
|
+
);
|
|
194
|
+
},
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
ChatToolbar.displayName = CHAT_TOOLBAR_NAME;
|
|
198
|
+
|
|
199
|
+
//
|
|
200
|
+
// Viewport
|
|
201
|
+
//
|
|
202
|
+
|
|
203
|
+
const CHAT_VIEWPORT_NAME = 'Chat.Viewport';
|
|
204
|
+
|
|
205
|
+
type ChatViewportProps = {};
|
|
206
|
+
|
|
207
|
+
const ChatViewport = composable<HTMLDivElement, ChatViewportProps>(({ children, ...props }, forwardedRef) => {
|
|
208
|
+
return (
|
|
209
|
+
<div {...composableProps(props, { classNames: 'dx-expander flex flex-col' })} ref={forwardedRef}>
|
|
210
|
+
{children}
|
|
211
|
+
</div>
|
|
212
|
+
);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
ChatViewport.displayName = CHAT_VIEWPORT_NAME;
|
|
216
|
+
|
|
217
|
+
//
|
|
218
|
+
// Thread
|
|
219
|
+
//
|
|
220
|
+
|
|
221
|
+
const CHAT_THREAD_NAME = 'Chat.Thread';
|
|
222
|
+
|
|
223
|
+
type ChatThreadProps = Omit<NaturalChatThreadProps, 'identity' | 'messages' | 'tools'>;
|
|
224
|
+
|
|
225
|
+
const ChatThread = (props: ChatThreadProps) => {
|
|
226
|
+
const { debug, event, messages, processor } = useChatContext(CHAT_THREAD_NAME);
|
|
227
|
+
const identity = useIdentity();
|
|
228
|
+
const error = useAtomValue(processor.error).pipe(Option.getOrUndefined);
|
|
229
|
+
|
|
230
|
+
const controllerRef = useRef<MarkdownStreamController | null>(null);
|
|
231
|
+
useEffect(() => {
|
|
232
|
+
return event.on((event) => {
|
|
233
|
+
switch (event.type) {
|
|
234
|
+
case 'submit':
|
|
235
|
+
case 'scroll-to-bottom':
|
|
236
|
+
controllerRef.current?.scrollToBottom();
|
|
237
|
+
break;
|
|
238
|
+
case 'nav-previous':
|
|
239
|
+
controllerRef.current?.navigatePrevious();
|
|
240
|
+
break;
|
|
241
|
+
case 'nav-next':
|
|
242
|
+
controllerRef.current?.navigateNext();
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}, [event]);
|
|
247
|
+
|
|
248
|
+
const handleEvent = useCallback<NonNullable<NaturalChatThreadProps['onEvent']>>(
|
|
249
|
+
(ev) => {
|
|
250
|
+
event.emit(ev);
|
|
251
|
+
},
|
|
252
|
+
[event],
|
|
253
|
+
);
|
|
254
|
+
|
|
255
|
+
if (!identity) {
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return (
|
|
260
|
+
<NaturalChatThread
|
|
261
|
+
{...props}
|
|
262
|
+
identity={identity}
|
|
263
|
+
messages={messages}
|
|
264
|
+
error={error}
|
|
265
|
+
debug={debug}
|
|
266
|
+
onEvent={handleEvent}
|
|
267
|
+
ref={controllerRef}
|
|
268
|
+
/>
|
|
269
|
+
);
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
ChatThread.displayName = CHAT_THREAD_NAME;
|
|
273
|
+
|
|
154
274
|
//
|
|
155
275
|
// Prompt
|
|
156
276
|
//
|
|
157
277
|
|
|
278
|
+
const CHAT_PROMPT_NAME = 'Chat.Prompt';
|
|
279
|
+
|
|
158
280
|
type ChatPromptProps = ThemedClassName<
|
|
159
281
|
{
|
|
160
282
|
outline?: boolean;
|
|
@@ -181,11 +303,11 @@ const ChatPrompt = ({
|
|
|
181
303
|
onOnlineChange,
|
|
182
304
|
}: ChatPromptProps) => {
|
|
183
305
|
const { t } = useTranslation(meta.id);
|
|
184
|
-
const {
|
|
306
|
+
const { db, processor, event } = useChatContext(CHAT_PROMPT_NAME);
|
|
185
307
|
|
|
186
|
-
const error =
|
|
187
|
-
const streaming =
|
|
188
|
-
const active =
|
|
308
|
+
const error = useAtomValue(processor.error).pipe(Option.getOrUndefined);
|
|
309
|
+
const streaming = useAtomValue(processor.streaming);
|
|
310
|
+
const active = useAtomValue(processor.active);
|
|
189
311
|
const activeRef = useDynamicRef(active);
|
|
190
312
|
|
|
191
313
|
const editorRef = useRef<ChatEditorController>(null);
|
|
@@ -218,43 +340,46 @@ const ChatPrompt = ({
|
|
|
218
340
|
},
|
|
219
341
|
});
|
|
220
342
|
|
|
221
|
-
// TODO(burdon): Reconcile with object tags.
|
|
222
|
-
const referencesProvider = useReferencesProvider(space);
|
|
223
343
|
const extensions = useMemo<Extension[]>(() => {
|
|
224
344
|
return [
|
|
225
|
-
referencesProvider && references({ provider: referencesProvider }),
|
|
226
345
|
Prec.highest(
|
|
227
|
-
keymap.of(
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
346
|
+
keymap.of([
|
|
347
|
+
{
|
|
348
|
+
key: 'Mod-d',
|
|
349
|
+
preventDefault: true,
|
|
350
|
+
run: () => {
|
|
351
|
+
event.emit({ type: 'toggle-debug' });
|
|
352
|
+
return true;
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
key: 'Mod-ArrowUp',
|
|
357
|
+
preventDefault: true,
|
|
358
|
+
run: () => {
|
|
359
|
+
event.emit({ type: 'nav-previous' });
|
|
360
|
+
return true;
|
|
236
361
|
},
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
run: () => {
|
|
241
|
-
event.emit({ type: 'thread-open' });
|
|
242
|
-
return true;
|
|
243
|
-
},
|
|
362
|
+
shift: () => {
|
|
363
|
+
event.emit({ type: 'thread-open' });
|
|
364
|
+
return true;
|
|
244
365
|
},
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
key: 'Mod-ArrowDown',
|
|
369
|
+
preventDefault: true,
|
|
370
|
+
run: () => {
|
|
371
|
+
event.emit({ type: 'nav-next' });
|
|
372
|
+
return true;
|
|
252
373
|
},
|
|
253
|
-
|
|
254
|
-
|
|
374
|
+
shift: () => {
|
|
375
|
+
event.emit({ type: 'thread-close' });
|
|
376
|
+
return true;
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
]),
|
|
255
380
|
),
|
|
256
381
|
].filter(isTruthy);
|
|
257
|
-
}, [event, expandable
|
|
382
|
+
}, [event, expandable]);
|
|
258
383
|
|
|
259
384
|
const handleSubmit = useCallback<NonNullable<ChatEditorProps['onSubmit']>>(
|
|
260
385
|
(text) => {
|
|
@@ -277,31 +402,29 @@ const ChatPrompt = ({
|
|
|
277
402
|
<div
|
|
278
403
|
role='group'
|
|
279
404
|
className={mx(
|
|
280
|
-
'flex flex-col
|
|
281
|
-
outline &&
|
|
282
|
-
'
|
|
283
|
-
],
|
|
405
|
+
'flex flex-col w-full dx-density-fine',
|
|
406
|
+
outline &&
|
|
407
|
+
'bg-group-surface border border-subdued-separator transition transition-border [&:has(.cm-content:focus)]:border-separator rounded-sm',
|
|
284
408
|
classNames,
|
|
285
409
|
)}
|
|
286
410
|
>
|
|
287
|
-
<div role='none' className='flex gap-2'>
|
|
411
|
+
<div role='none' className='flex p-2 gap-2'>
|
|
288
412
|
<ChatStatusIndicator classNames='p-1' preset={preset} error={error} processing={streaming} />
|
|
289
|
-
|
|
290
413
|
<ChatEditor
|
|
291
414
|
ref={editorRef}
|
|
292
415
|
autoFocus
|
|
293
416
|
lineWrapping
|
|
294
|
-
classNames='col-span-2
|
|
295
|
-
placeholder={placeholder ?? t('prompt
|
|
417
|
+
classNames='col-span-2 pt-0.5'
|
|
418
|
+
placeholder={placeholder ?? t('prompt.placeholder')}
|
|
296
419
|
extensions={extensions}
|
|
297
420
|
onSubmit={handleSubmit}
|
|
298
421
|
/>
|
|
299
422
|
</div>
|
|
300
423
|
|
|
301
|
-
{settings && (
|
|
302
|
-
<div role='none' className='flex
|
|
424
|
+
{db && settings && (
|
|
425
|
+
<div role='none' className='flex items-center overflow-hidden'>
|
|
303
426
|
<ChatOptions
|
|
304
|
-
|
|
427
|
+
db={db}
|
|
305
428
|
blueprintRegistry={processor.blueprintRegistry}
|
|
306
429
|
context={processor.context}
|
|
307
430
|
preset={preset}
|
|
@@ -309,8 +432,8 @@ const ChatPrompt = ({
|
|
|
309
432
|
onPresetChange={onPresetChange}
|
|
310
433
|
/>
|
|
311
434
|
|
|
312
|
-
<div role='none' className='
|
|
313
|
-
<ChatReferences
|
|
435
|
+
<div role='none' className='flex grow overflow-x-auto scrollbar-none'>
|
|
436
|
+
<ChatReferences db={db} context={processor.context} />
|
|
314
437
|
</div>
|
|
315
438
|
|
|
316
439
|
<ChatActions
|
|
@@ -320,10 +443,11 @@ const ChatPrompt = ({
|
|
|
320
443
|
processing={streaming}
|
|
321
444
|
onEvent={handleEvent}
|
|
322
445
|
>
|
|
446
|
+
{/* TODO(burdon): Move offline switch into dialog. */}
|
|
323
447
|
{online !== undefined && (
|
|
324
448
|
<Input.Root>
|
|
325
|
-
<Input.Label srOnly>{t('online
|
|
326
|
-
<Input.Switch classNames='
|
|
449
|
+
<Input.Label srOnly>{t('online-switch.label')}</Input.Label>
|
|
450
|
+
<Input.Switch classNames='mx-2' checked={online} onCheckedChange={onOnlineChange} />
|
|
327
451
|
</Input.Root>
|
|
328
452
|
)}
|
|
329
453
|
</ChatActions>
|
|
@@ -333,55 +457,7 @@ const ChatPrompt = ({
|
|
|
333
457
|
);
|
|
334
458
|
};
|
|
335
459
|
|
|
336
|
-
ChatPrompt.displayName =
|
|
337
|
-
|
|
338
|
-
//
|
|
339
|
-
// Thread
|
|
340
|
-
//
|
|
341
|
-
|
|
342
|
-
type ChatThreadProps = Omit<NaturalChatThreadProps, 'identity' | 'messages' | 'tools'>;
|
|
343
|
-
|
|
344
|
-
const ChatThread = (props: ChatThreadProps) => {
|
|
345
|
-
const { event, messages, processor } = useChatContext(ChatThread.displayName);
|
|
346
|
-
const identity = useIdentity();
|
|
347
|
-
const error = useRxValue(processor.error).pipe(Option.getOrUndefined);
|
|
348
|
-
|
|
349
|
-
const scrollerRef = useRef<ChatThreadController | null>(null);
|
|
350
|
-
useEffect(() => {
|
|
351
|
-
return event.on((event) => {
|
|
352
|
-
switch (event.type) {
|
|
353
|
-
case 'submit':
|
|
354
|
-
case 'scroll-to-bottom':
|
|
355
|
-
scrollerRef.current?.scrollToBottom();
|
|
356
|
-
break;
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
}, [event]);
|
|
360
|
-
|
|
361
|
-
const handleEvent = useCallback<NonNullable<NaturalChatThreadProps['onEvent']>>(
|
|
362
|
-
(ev) => {
|
|
363
|
-
event.emit(ev);
|
|
364
|
-
},
|
|
365
|
-
[event],
|
|
366
|
-
);
|
|
367
|
-
|
|
368
|
-
if (!identity) {
|
|
369
|
-
return null;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
return (
|
|
373
|
-
<NaturalChatThread
|
|
374
|
-
{...props}
|
|
375
|
-
ref={scrollerRef}
|
|
376
|
-
identity={identity}
|
|
377
|
-
messages={messages}
|
|
378
|
-
error={error}
|
|
379
|
-
onEvent={handleEvent}
|
|
380
|
-
/>
|
|
381
|
-
);
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
ChatThread.displayName = 'Chat.Thread';
|
|
460
|
+
ChatPrompt.displayName = CHAT_PROMPT_NAME;
|
|
385
461
|
|
|
386
462
|
//
|
|
387
463
|
// Chat
|
|
@@ -389,8 +465,10 @@ ChatThread.displayName = 'Chat.Thread';
|
|
|
389
465
|
|
|
390
466
|
export const Chat = {
|
|
391
467
|
Root: ChatRoot,
|
|
392
|
-
|
|
468
|
+
Toolbar: ChatToolbar,
|
|
469
|
+
Viewport: ChatViewport,
|
|
393
470
|
Thread: ChatThread,
|
|
471
|
+
Prompt: ChatPrompt,
|
|
394
472
|
};
|
|
395
473
|
|
|
396
|
-
export type { ChatRootProps, ChatThreadProps, ChatPromptProps, ChatEvent };
|
|
474
|
+
export type { ChatRootProps, ChatToolbarProps, ChatViewportProps, ChatThreadProps, ChatPromptProps, ChatEvent };
|
|
@@ -31,7 +31,7 @@ export type ChatEvent =
|
|
|
31
31
|
}
|
|
32
32
|
| {
|
|
33
33
|
type: 'add';
|
|
34
|
-
object: Obj.
|
|
34
|
+
object: Obj.Unknown;
|
|
35
35
|
}
|
|
36
36
|
//
|
|
37
37
|
// UX
|
|
@@ -43,6 +43,12 @@ export type ChatEvent =
|
|
|
43
43
|
| {
|
|
44
44
|
type: 'scroll-to-bottom';
|
|
45
45
|
}
|
|
46
|
+
| {
|
|
47
|
+
type: 'nav-previous';
|
|
48
|
+
}
|
|
49
|
+
| {
|
|
50
|
+
type: 'nav-next';
|
|
51
|
+
}
|
|
46
52
|
| {
|
|
47
53
|
type: 'thread-open';
|
|
48
54
|
}
|
|
@@ -5,29 +5,18 @@
|
|
|
5
5
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { addEventListener } from '@dxos/async';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { type Assistant } from '../../types';
|
|
11
|
-
|
|
12
|
-
// TODO(burdon): Reset after each session.
|
|
13
|
-
// TODO(burdon): Show after delay.
|
|
14
|
-
// TODO(burdon): Test with errors.
|
|
15
|
-
// TODO(burdon): Filter out empty trace messages.
|
|
16
|
-
|
|
17
|
-
// {
|
|
18
|
-
// "id": "01K3TE3C2VAXETP500QKDHK3C4_block_3",
|
|
19
|
-
// "branch": "main",
|
|
20
|
-
// "parents": [],
|
|
21
|
-
// "icon": "ph--robot--regular",
|
|
22
|
-
// "message": "\n"
|
|
23
|
-
// }
|
|
8
|
+
import { type Queue } from '@dxos/echo-db';
|
|
9
|
+
import { ProgressBar, type ProgressBarProps, TextCrawl, useExecutionGraph } from '@dxos/react-ui-components';
|
|
24
10
|
|
|
25
11
|
export type ChatProgressProps = {
|
|
26
|
-
|
|
12
|
+
traceQueue?: Queue;
|
|
27
13
|
};
|
|
28
14
|
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Displays execution progress from the space's invocation trace queue.
|
|
17
|
+
*/
|
|
18
|
+
export const ChatProgress = ({ traceQueue }: ChatProgressProps) => {
|
|
19
|
+
const { commits } = useExecutionGraph(traceQueue, true);
|
|
31
20
|
const nodes = useMemo(() => commits.map((commit) => ({ id: commit.id, message: commit.message })), [commits]);
|
|
32
21
|
const lines = useMemo(() => commits.map((commit) => commit.message), [commits]);
|
|
33
22
|
|
|
@@ -59,9 +48,9 @@ export const ChatProgress = ({ chat }: ChatProgressProps) => {
|
|
|
59
48
|
}, [nodes.length]);
|
|
60
49
|
|
|
61
50
|
return (
|
|
62
|
-
<
|
|
51
|
+
<div role='none' tabIndex={0} ref={ref} className='flex flex-col outline-hidden'>
|
|
63
52
|
<ProgressBar nodes={nodes} index={index} onSelect={handleSelect} />
|
|
64
|
-
<TextCrawl
|
|
65
|
-
</
|
|
53
|
+
<TextCrawl classNames='ps-4 text-sm text-description' lines={lines} autoAdvance />
|
|
54
|
+
</div>
|
|
66
55
|
);
|
|
67
56
|
};
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
import React, { type PropsWithChildren } from 'react';
|
|
6
6
|
|
|
7
7
|
import { IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { mx } from '@dxos/
|
|
8
|
+
import { mx } from '@dxos/ui-theme';
|
|
9
|
+
|
|
10
|
+
import { meta } from '#meta';
|
|
9
11
|
|
|
10
|
-
import { meta } from '../../meta';
|
|
11
12
|
import { type ChatEvent } from '../Chat';
|
|
12
13
|
|
|
13
14
|
export type ChatActionsProps = ThemedClassName<
|
|
@@ -15,24 +16,32 @@ export type ChatActionsProps = ThemedClassName<
|
|
|
15
16
|
microphone?: boolean;
|
|
16
17
|
recording?: boolean;
|
|
17
18
|
processing?: boolean;
|
|
19
|
+
debug?: boolean;
|
|
18
20
|
onEvent?: (event: ChatEvent) => void;
|
|
19
21
|
}>
|
|
20
22
|
>;
|
|
21
23
|
|
|
22
|
-
export const ChatActions = ({
|
|
24
|
+
export const ChatActions = ({
|
|
25
|
+
classNames,
|
|
26
|
+
children,
|
|
27
|
+
microphone,
|
|
28
|
+
recording,
|
|
29
|
+
processing,
|
|
30
|
+
debug,
|
|
31
|
+
onEvent,
|
|
32
|
+
}: ChatActionsProps) => {
|
|
23
33
|
const { t } = useTranslation(meta.id);
|
|
24
34
|
|
|
25
35
|
return (
|
|
26
|
-
<div className={mx('flex items-center
|
|
36
|
+
<div className={mx('flex items-center me-1', classNames)}>
|
|
27
37
|
{children}
|
|
28
38
|
|
|
29
39
|
<IconButton
|
|
30
40
|
disabled={!processing}
|
|
31
41
|
variant='ghost'
|
|
32
|
-
size={5}
|
|
33
42
|
icon='ph--x--regular'
|
|
34
43
|
iconOnly
|
|
35
|
-
label={t('
|
|
44
|
+
label={t('cancel-processing.button')}
|
|
36
45
|
onClick={() => onEvent?.({ type: 'cancel' })}
|
|
37
46
|
/>
|
|
38
47
|
|
|
@@ -41,17 +50,26 @@ export const ChatActions = ({ classNames, children, microphone, recording, proce
|
|
|
41
50
|
disabled={!processing}
|
|
42
51
|
classNames={mx(recording && 'bg-primary-500')}
|
|
43
52
|
variant='ghost'
|
|
44
|
-
size={5}
|
|
45
53
|
icon='ph--microphone--regular'
|
|
46
54
|
iconOnly
|
|
47
55
|
noTooltip
|
|
48
|
-
label={t('button
|
|
56
|
+
label={t('microphone.button')}
|
|
49
57
|
onMouseDown={() => onEvent?.({ type: 'record-start' })}
|
|
50
58
|
onMouseUp={() => onEvent?.({ type: 'record-stop' })}
|
|
51
59
|
onTouchStart={() => onEvent?.({ type: 'record-start' })}
|
|
52
60
|
onTouchEnd={() => onEvent?.({ type: 'record-stop' })}
|
|
53
61
|
/>
|
|
54
62
|
)}
|
|
63
|
+
|
|
64
|
+
{debug && (
|
|
65
|
+
<IconButton
|
|
66
|
+
variant='ghost'
|
|
67
|
+
icon='ph--wrench--regular'
|
|
68
|
+
iconOnly
|
|
69
|
+
label={t('debug.button')}
|
|
70
|
+
onClick={() => onEvent?.({ type: 'toggle-debug' })}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
55
73
|
</div>
|
|
56
74
|
);
|
|
57
75
|
};
|