@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
|
@@ -3,50 +3,34 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import type * as Tool from '@effect/ai/Tool';
|
|
6
|
-
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type AgentStatus } from '@dxos/ai';
|
|
9
8
|
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
chatMessageJson,
|
|
15
|
-
chatMessagePanel,
|
|
16
|
-
chatMessagePanelContent,
|
|
17
|
-
chatMessagePanelHeader,
|
|
18
|
-
} from '@dxos/react-ui-components';
|
|
19
|
-
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
20
|
-
import { type ContentBlock, type DataType } from '@dxos/schema';
|
|
9
|
+
import { NumericTabs, TextCrawl, TogglePanel, type TogglePanelRootProps } from '@dxos/react-ui-components';
|
|
10
|
+
import { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
11
|
+
import { type ContentBlock, type Message } from '@dxos/types';
|
|
12
|
+
import { type XmlWidgetProps } from '@dxos/ui-editor';
|
|
21
13
|
import { isNonNullable, safeParseJson } from '@dxos/util';
|
|
22
14
|
|
|
23
|
-
import { meta } from '
|
|
15
|
+
import { meta } from '#meta';
|
|
24
16
|
|
|
25
|
-
export const isToolMessage = (message:
|
|
26
|
-
return message.blocks.some((block) => block._tag === 'toolCall' || block._tag === 'toolResult');
|
|
17
|
+
export const isToolMessage = (message: Message.Message) => {
|
|
18
|
+
return message.blocks.some((block: ContentBlock.Any) => block._tag === 'toolCall' || block._tag === 'toolResult');
|
|
27
19
|
};
|
|
28
20
|
|
|
29
|
-
export type ToolBlockProps = {
|
|
21
|
+
export type ToolBlockProps = XmlWidgetProps<{
|
|
30
22
|
blocks: ContentBlock.Any[];
|
|
31
|
-
}
|
|
23
|
+
}>;
|
|
32
24
|
|
|
33
|
-
export const ToolBlock = ({ blocks = [] }: ToolBlockProps) => {
|
|
25
|
+
export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
|
|
34
26
|
const { t } = useTranslation(meta.id);
|
|
35
27
|
|
|
36
|
-
const
|
|
37
|
-
if (!tool) {
|
|
38
|
-
return t('calling tool label');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return status?.message ?? tool.description ?? [t('calling label'), tool.name].join(' ');
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const items = useMemo(() => {
|
|
28
|
+
const items = useMemo<ToolPanelProps['items']>(() => {
|
|
45
29
|
let lastToolCall: { tool: Tool.Any | undefined; block: ContentBlock.ToolCall } | undefined;
|
|
46
30
|
// TODO(burdon): Get from context?
|
|
47
31
|
const tools: Tool.Any[] = []; //processor.conversation.toolkit?.tools ?? [];
|
|
48
32
|
return blocks
|
|
49
|
-
.filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult' || block._tag === '
|
|
33
|
+
.filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult' || block._tag === 'stats')
|
|
50
34
|
.map((block) => {
|
|
51
35
|
switch (block._tag) {
|
|
52
36
|
case 'toolCall': {
|
|
@@ -57,7 +41,7 @@ export const ToolBlock = ({ blocks = [] }: ToolBlockProps) => {
|
|
|
57
41
|
const tool = tools.find((tool) => tool.name === block.name);
|
|
58
42
|
lastToolCall = { tool, block };
|
|
59
43
|
return {
|
|
60
|
-
title:
|
|
44
|
+
title: tool?.description ?? [t('tool-call.label'), block?.name].join(' '),
|
|
61
45
|
content: {
|
|
62
46
|
...block,
|
|
63
47
|
input: safeParseJson(block.input),
|
|
@@ -69,12 +53,13 @@ export const ToolBlock = ({ blocks = [] }: ToolBlockProps) => {
|
|
|
69
53
|
// TODO(burdon): Parse error type.
|
|
70
54
|
if (block.error) {
|
|
71
55
|
return {
|
|
72
|
-
title: t('error
|
|
56
|
+
title: t('tool-error.label'),
|
|
73
57
|
content: block,
|
|
74
58
|
};
|
|
75
59
|
}
|
|
76
60
|
|
|
77
|
-
const title =
|
|
61
|
+
const title =
|
|
62
|
+
lastToolCall?.tool?.description ?? [t('tool-result.label'), lastToolCall?.block?.name].join(' ');
|
|
78
63
|
lastToolCall = undefined;
|
|
79
64
|
return {
|
|
80
65
|
title,
|
|
@@ -85,13 +70,13 @@ export const ToolBlock = ({ blocks = [] }: ToolBlockProps) => {
|
|
|
85
70
|
};
|
|
86
71
|
}
|
|
87
72
|
|
|
88
|
-
case '
|
|
73
|
+
case 'stats': {
|
|
89
74
|
if (!lastToolCall) {
|
|
90
75
|
return null;
|
|
91
76
|
}
|
|
92
77
|
|
|
93
78
|
return {
|
|
94
|
-
title: t('
|
|
79
|
+
title: t('stats.label'),
|
|
95
80
|
content: block,
|
|
96
81
|
};
|
|
97
82
|
}
|
|
@@ -100,53 +85,60 @@ export const ToolBlock = ({ blocks = [] }: ToolBlockProps) => {
|
|
|
100
85
|
.filter(isNonNullable);
|
|
101
86
|
}, [blocks]);
|
|
102
87
|
|
|
88
|
+
const handleChangeOpen = useCallback(() => {
|
|
89
|
+
setTimeout(() => {
|
|
90
|
+
// Measure after animation.
|
|
91
|
+
view?.requestMeasure();
|
|
92
|
+
}, 1_000);
|
|
93
|
+
}, [view]);
|
|
94
|
+
|
|
95
|
+
// Ignore if empty.
|
|
103
96
|
if (!items.length) {
|
|
104
97
|
return null;
|
|
105
98
|
}
|
|
106
99
|
|
|
107
|
-
return <
|
|
100
|
+
return <ToolPanel items={items} onChangeOpen={handleChangeOpen} />;
|
|
108
101
|
};
|
|
109
102
|
|
|
110
103
|
ToolBlock.displayName = 'ToolBlock';
|
|
111
104
|
|
|
112
|
-
type
|
|
105
|
+
type ToolPanelProps = {
|
|
113
106
|
items: { title: string; content: any }[];
|
|
114
|
-
}
|
|
107
|
+
} & Pick<TogglePanelRootProps, 'onChangeOpen'>;
|
|
115
108
|
|
|
116
|
-
|
|
117
|
-
export const ToolContainer = ({ items }: ToolContainerParams) => {
|
|
109
|
+
const ToolPanel = ({ items, onChangeOpen }: ToolPanelProps) => {
|
|
118
110
|
const tabsRef = useRef<HTMLDivElement>(null);
|
|
119
111
|
const [selected, setSelected] = useState(0);
|
|
120
112
|
const [open, setOpen] = useState(false);
|
|
113
|
+
|
|
121
114
|
useEffect(() => {
|
|
115
|
+
onChangeOpen?.(open);
|
|
122
116
|
if (open) {
|
|
123
117
|
tabsRef.current?.focus();
|
|
124
118
|
}
|
|
125
|
-
}, [open]);
|
|
119
|
+
}, [open, onChangeOpen]);
|
|
126
120
|
|
|
127
|
-
const handleSelect = (index: number) => {
|
|
121
|
+
const handleSelect = useCallback((index: number) => {
|
|
128
122
|
setSelected(index);
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const data = items[selected]?.content;
|
|
123
|
+
}, []);
|
|
132
124
|
|
|
133
125
|
return (
|
|
134
|
-
<
|
|
135
|
-
<
|
|
136
|
-
<TextCrawl key='status-roll' lines={items.map((item) => item.title)} />
|
|
137
|
-
</
|
|
138
|
-
<
|
|
126
|
+
<TogglePanel.Root classNames='w-full rounded-xs border border-subdued-separator' open={open} onChangeOpen={setOpen}>
|
|
127
|
+
<TogglePanel.Header classNames='text-sm text-placeholder'>
|
|
128
|
+
<TextCrawl key='status-roll' lines={items.map((item) => item.title)} autoAdvance greedy />
|
|
129
|
+
</TogglePanel.Header>
|
|
130
|
+
<TogglePanel.Content classNames='grid grid-cols-[32px_1fr]'>
|
|
139
131
|
<NumericTabs ref={tabsRef} classNames='p-1' length={items.length} selected={selected} onSelect={handleSelect} />
|
|
140
|
-
<
|
|
141
|
-
data={
|
|
142
|
-
classNames=
|
|
132
|
+
<JsonHighlighter
|
|
133
|
+
data={items[selected]?.content}
|
|
134
|
+
classNames='p-1 text-xs bg-transparent'
|
|
143
135
|
replacer={{
|
|
144
136
|
maxDepth: 3,
|
|
145
137
|
maxArrayLen: 10,
|
|
146
138
|
maxStringLen: 128,
|
|
147
139
|
}}
|
|
148
140
|
/>
|
|
149
|
-
</
|
|
150
|
-
</
|
|
141
|
+
</TogglePanel.Content>
|
|
142
|
+
</TogglePanel.Root>
|
|
151
143
|
);
|
|
152
144
|
};
|
|
@@ -3,42 +3,39 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
6
7
|
import React from 'react';
|
|
7
8
|
|
|
8
|
-
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { capabilities } from '@dxos/assistant-testing';
|
|
10
|
+
import { capabilities } from '@dxos/assistant-toolkit/testing';
|
|
11
11
|
import { ChessPlugin } from '@dxos/plugin-chess';
|
|
12
12
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
13
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
13
14
|
import { MapPlugin } from '@dxos/plugin-map';
|
|
14
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
15
15
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
16
|
-
import {
|
|
16
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
17
17
|
|
|
18
18
|
import { translations } from '../../translations';
|
|
19
|
-
|
|
20
19
|
import { Toolbox, type ToolboxProps } from './Toolbox';
|
|
21
20
|
|
|
22
21
|
const DefaultStory = (props: ToolboxProps) => {
|
|
23
|
-
return <Toolbox {...props} classNames='
|
|
22
|
+
return <Toolbox {...props} classNames='h-[15rem] w-[30rem] py-1 rounded-xs border border-separator' />;
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
const meta = {
|
|
27
|
-
title: 'plugins/plugin-assistant/Toolbox',
|
|
26
|
+
title: 'plugins/plugin-assistant/components/Toolbox',
|
|
28
27
|
component: Toolbox as any,
|
|
29
28
|
render: DefaultStory,
|
|
30
29
|
decorators: [
|
|
31
|
-
withTheme,
|
|
32
30
|
withPluginManager({
|
|
33
31
|
plugins: [
|
|
32
|
+
...corePlugins(),
|
|
34
33
|
ClientPlugin({
|
|
35
|
-
onClientInitialized:
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
onClientInitialized: ({ client }) =>
|
|
35
|
+
Effect.gen(function* () {
|
|
36
|
+
yield* initializeIdentity(client);
|
|
37
|
+
}),
|
|
38
38
|
}),
|
|
39
|
-
SpacePlugin({}),
|
|
40
|
-
SettingsPlugin(),
|
|
41
|
-
IntentPlugin(),
|
|
42
39
|
ChessPlugin(),
|
|
43
40
|
MapPlugin(),
|
|
44
41
|
TablePlugin(),
|
|
@@ -2,79 +2,84 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { Fragment, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type Blueprint } from '@dxos/blueprints';
|
|
8
|
-
import { type Ref } from '@dxos/echo';
|
|
9
|
-
import { FunctionType } from '@dxos/functions';
|
|
8
|
+
import { type Database, type Ref } from '@dxos/echo';
|
|
10
9
|
import { log } from '@dxos/log';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { mx } from '@dxos/
|
|
10
|
+
import { Operation } from '@dxos/operation';
|
|
11
|
+
import { Filter, useQuery } from '@dxos/react-client/echo';
|
|
12
|
+
import { ScrollArea, type ThemedClassName } from '@dxos/react-ui';
|
|
13
|
+
import { composable, composableProps, mx } from '@dxos/ui-theme';
|
|
14
|
+
|
|
15
|
+
import { ServiceType } from '#types';
|
|
15
16
|
|
|
16
|
-
import { meta } from '../../meta';
|
|
17
17
|
import { type AiChatProcessor } from '../../processor';
|
|
18
|
-
import { ServiceType } from '../../types';
|
|
19
18
|
|
|
20
|
-
export type ToolboxProps =
|
|
19
|
+
export type ToolboxProps = {
|
|
21
20
|
services?: { service: ServiceType }[];
|
|
22
|
-
functions?:
|
|
21
|
+
functions?: Operation.PersistentOperation[];
|
|
23
22
|
// TODO(burdon): Combine into single array.
|
|
24
|
-
blueprints?: readonly
|
|
23
|
+
blueprints?: readonly Blueprint.Blueprint[];
|
|
25
24
|
activeBlueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
|
|
26
|
-
}>;
|
|
27
|
-
|
|
28
|
-
export const Toolbox = ({ classNames, functions, services, blueprints, activeBlueprints }: ToolboxProps) => {
|
|
29
|
-
const { t } = useTranslation(meta.id);
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<div className={mx('flex flex-col overflow-y-auto box-content', classNames)}>
|
|
33
|
-
{blueprints && blueprints.length > 0 && (
|
|
34
|
-
<Section
|
|
35
|
-
title='Blueprints'
|
|
36
|
-
items={blueprints.map(({ target }) => ({
|
|
37
|
-
name: target?.name ?? '',
|
|
38
|
-
description: target?.description ?? '',
|
|
39
|
-
subitems: target?.tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
40
|
-
}))}
|
|
41
|
-
/>
|
|
42
|
-
)}
|
|
43
|
-
|
|
44
|
-
{activeBlueprints && activeBlueprints.length > 0 && (
|
|
45
|
-
<Section
|
|
46
|
-
title='Blueprints'
|
|
47
|
-
items={activeBlueprints.map(({ target }) => ({
|
|
48
|
-
name: target?.name ?? '',
|
|
49
|
-
description: target?.description ?? '',
|
|
50
|
-
subitems: target?.tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
51
|
-
}))}
|
|
52
|
-
/>
|
|
53
|
-
)}
|
|
54
|
-
|
|
55
|
-
{services && services.length > 0 && (
|
|
56
|
-
<Section
|
|
57
|
-
title='Services'
|
|
58
|
-
items={services.map(({ service: { serviceId, name, description } }) => ({
|
|
59
|
-
name: name ?? serviceId,
|
|
60
|
-
description,
|
|
61
|
-
// subitems: tools.map(({ name, description }) => ({ name: `∙ ${name}`, description })),
|
|
62
|
-
}))}
|
|
63
|
-
/>
|
|
64
|
-
)}
|
|
65
|
-
|
|
66
|
-
{functions && functions.length > 0 && (
|
|
67
|
-
<Section title='Functions' items={functions.map(({ name, description }) => ({ name, description }))} />
|
|
68
|
-
)}
|
|
69
|
-
</div>
|
|
70
|
-
);
|
|
71
25
|
};
|
|
72
26
|
|
|
73
|
-
const
|
|
27
|
+
export const Toolbox = composable<HTMLDivElement, ToolboxProps>(
|
|
28
|
+
({ functions, services, blueprints, activeBlueprints, ...props }, forwardedRef) => {
|
|
29
|
+
return (
|
|
30
|
+
<ScrollArea.Root {...composableProps(props)} thin orientation='vertical' ref={forwardedRef}>
|
|
31
|
+
<ScrollArea.Viewport>
|
|
32
|
+
{blueprints && blueprints.length > 0 && (
|
|
33
|
+
<Section
|
|
34
|
+
title='Blueprints'
|
|
35
|
+
items={blueprints.map(({ name, description, tools }) => ({
|
|
36
|
+
name,
|
|
37
|
+
description,
|
|
38
|
+
subitems: tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
39
|
+
}))}
|
|
40
|
+
/>
|
|
41
|
+
)}
|
|
42
|
+
|
|
43
|
+
{activeBlueprints && activeBlueprints.length > 0 && (
|
|
44
|
+
<Section
|
|
45
|
+
title='Blueprints'
|
|
46
|
+
items={activeBlueprints.map(({ target }) => ({
|
|
47
|
+
name: target?.name ?? '',
|
|
48
|
+
description: target?.description ?? '',
|
|
49
|
+
subitems: target?.tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
50
|
+
}))}
|
|
51
|
+
/>
|
|
52
|
+
)}
|
|
53
|
+
|
|
54
|
+
{services && services.length > 0 && (
|
|
55
|
+
<Section
|
|
56
|
+
title='Services'
|
|
57
|
+
items={services.map(({ service: { serviceId, name, description } }) => ({
|
|
58
|
+
name: name ?? serviceId,
|
|
59
|
+
description,
|
|
60
|
+
// subitems: tools.map(({ name, description }) => ({ name: `∙ ${name}`, description })),
|
|
61
|
+
}))}
|
|
62
|
+
/>
|
|
63
|
+
)}
|
|
64
|
+
|
|
65
|
+
{functions && functions.length > 0 && (
|
|
66
|
+
<Section title='Functions' items={functions.map(({ name, description }) => ({ name, description }))} />
|
|
67
|
+
)}
|
|
68
|
+
</ScrollArea.Viewport>
|
|
69
|
+
</ScrollArea.Root>
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
Toolbox.displayName = 'Toolbox';
|
|
75
|
+
|
|
76
|
+
type SectionProps = {
|
|
74
77
|
title: string;
|
|
75
78
|
items: { name: string; description?: string; subitems?: { name: string; description?: string }[] }[];
|
|
76
79
|
striped?: boolean;
|
|
77
|
-
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const Section = ({ title, items, striped }: SectionProps) => {
|
|
78
83
|
const stripeClassNames = 'odd:bg-neutral-50 dark:odd:bg-neutral-800';
|
|
79
84
|
const gridClassNames = 'grid grid-cols-[8rem_1fr]';
|
|
80
85
|
const subGridClassNames = mx('col-span-full grid grid-cols-subgrid text-xs px-2', striped && stripeClassNames);
|
|
@@ -104,14 +109,14 @@ const Section: FC<{
|
|
|
104
109
|
);
|
|
105
110
|
};
|
|
106
111
|
|
|
107
|
-
export type
|
|
108
|
-
|
|
112
|
+
export type ToolboxPanelProps = ThemedClassName<{
|
|
113
|
+
db?: Database.Database;
|
|
109
114
|
processor?: AiChatProcessor;
|
|
110
115
|
}>;
|
|
111
116
|
|
|
112
|
-
export const
|
|
117
|
+
export const ToolboxPanel = ({ classNames, db, processor }: ToolboxPanelProps) => {
|
|
113
118
|
// Registered services.
|
|
114
|
-
const services = useQuery(
|
|
119
|
+
const services = useQuery(db, Filter.type(ServiceType));
|
|
115
120
|
const [serviceTools, setServiceTools] = useState<{ service: ServiceType }[]>([]);
|
|
116
121
|
useEffect(() => {
|
|
117
122
|
log('creating service tools...', { services: services.length });
|
|
@@ -125,12 +130,12 @@ export const ToolboxContainer = ({ classNames, space, processor }: ToolboxContai
|
|
|
125
130
|
}, [services]);
|
|
126
131
|
|
|
127
132
|
// Deployed functions.
|
|
128
|
-
const functions = useQuery(
|
|
133
|
+
const functions = useQuery(db, Filter.type(Operation.PersistentOperation));
|
|
129
134
|
|
|
130
135
|
return (
|
|
131
136
|
<Toolbox
|
|
132
137
|
classNames={classNames}
|
|
133
|
-
blueprints={processor?.context.
|
|
138
|
+
blueprints={processor?.context.getBlueprints()}
|
|
134
139
|
services={serviceTools}
|
|
135
140
|
functions={functions}
|
|
136
141
|
/>
|
package/src/components/index.ts
CHANGED
|
@@ -2,18 +2,11 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { lazy } from 'react';
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export * from './AssistantSettings';
|
|
8
7
|
export * from './Chat';
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './PromptSettings';
|
|
8
|
+
export * from './ProcessTree';
|
|
11
9
|
export * from './TemplateEditor';
|
|
12
|
-
export * from './Toolbar';
|
|
13
10
|
export * from './Toolbox';
|
|
14
11
|
|
|
15
|
-
export const
|
|
16
|
-
export const ChatCompanion = lazy(() => import('./ChatCompanion'));
|
|
17
|
-
export const ChatContainer = lazy(() => import('./ChatContainer'));
|
|
18
|
-
export const ChatDialog = lazy(() => import('./ChatDialog'));
|
|
19
|
-
export const SequenceContainer = lazy(() => import('./SequenceContainer'));
|
|
12
|
+
export const AssistantSettings: ComponentType<any> = lazy(() => import('./AssistantSettings'));
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { Plan, Agent } from '@dxos/assistant-toolkit';
|
|
11
|
+
import { Obj, Ref } from '@dxos/echo';
|
|
12
|
+
import { AutomationPlugin } from '@dxos/plugin-automation';
|
|
13
|
+
import { ClientPlugin } from '@dxos/plugin-client';
|
|
14
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
15
|
+
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
16
|
+
import { corePlugins, StorybookPlugin } from '@dxos/plugin-testing';
|
|
17
|
+
import { random } from '@dxos/random';
|
|
18
|
+
import { Filter, useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
19
|
+
import { Loading, withTheme } from '@dxos/react-ui/testing';
|
|
20
|
+
import { Text } from '@dxos/schema';
|
|
21
|
+
import { createObjectFactory, TypeSpec } from '@dxos/schema/testing';
|
|
22
|
+
import { Message, Organization, Person } from '@dxos/types';
|
|
23
|
+
|
|
24
|
+
import { createMessage } from '#testing';
|
|
25
|
+
|
|
26
|
+
import { AssistantPlugin } from '../../AssistantPlugin';
|
|
27
|
+
import { translations } from '../../translations';
|
|
28
|
+
import { AgentArticle } from './AgentArticle';
|
|
29
|
+
|
|
30
|
+
random.seed(1);
|
|
31
|
+
|
|
32
|
+
type DefaultStoryProps = {
|
|
33
|
+
spec?: TypeSpec[];
|
|
34
|
+
inputs?: boolean;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const DefaultStory = (_: DefaultStoryProps) => {
|
|
38
|
+
const [space] = useSpaces();
|
|
39
|
+
const [agent] = useQuery(space?.db, Filter.type(Agent.Agent));
|
|
40
|
+
if (!agent) {
|
|
41
|
+
return <Loading />;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return <AgentArticle role='article' subject={agent} attendableId='story' />;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const meta = {
|
|
48
|
+
title: 'plugins/plugin-assistant/containers/AgentArticle',
|
|
49
|
+
render: DefaultStory,
|
|
50
|
+
decorators: [
|
|
51
|
+
withTheme(),
|
|
52
|
+
withPluginManager<DefaultStoryProps>(({ args: { spec = [], inputs } }) => ({
|
|
53
|
+
plugins: [
|
|
54
|
+
...corePlugins(),
|
|
55
|
+
ClientPlugin({
|
|
56
|
+
types: [Agent.Agent, Message.Message, Plan.Plan, Text.Text, Organization.Organization, Person.Person],
|
|
57
|
+
onClientInitialized: ({ client }) =>
|
|
58
|
+
Effect.gen(function* () {
|
|
59
|
+
yield* initializeIdentity(client);
|
|
60
|
+
const [space] = client.spaces.get();
|
|
61
|
+
yield* Effect.promise(() => space.waitUntilReady());
|
|
62
|
+
|
|
63
|
+
const factory = createObjectFactory(space.db, random as any);
|
|
64
|
+
const artifacts = yield* Effect.promise(() => factory(spec));
|
|
65
|
+
|
|
66
|
+
const inputQueue = space.queues.create();
|
|
67
|
+
if (inputs) {
|
|
68
|
+
yield* Effect.promise(() =>
|
|
69
|
+
inputQueue.append([
|
|
70
|
+
createMessage('user', [{ _tag: 'text', text: 'Summarize the current artifacts.' }]),
|
|
71
|
+
createMessage('assistant', [
|
|
72
|
+
{ _tag: 'text', text: 'Here is a quick overview of the organizations and contacts in context.' },
|
|
73
|
+
]),
|
|
74
|
+
createMessage('user', [{ _tag: 'text', text: 'Flag anything that needs follow-up.' }]),
|
|
75
|
+
]),
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
space.db.add(
|
|
80
|
+
Obj.make(Agent.Agent, {
|
|
81
|
+
instructions: Ref.make(Text.make()),
|
|
82
|
+
plan: Ref.make(Plan.makePlan({ tasks: [] })),
|
|
83
|
+
artifacts: artifacts.map((obj) => ({
|
|
84
|
+
name: Obj.getLabel(obj) ?? 'Artifact',
|
|
85
|
+
data: Ref.make(obj),
|
|
86
|
+
})),
|
|
87
|
+
queue: Ref.fromDXN(inputQueue.dxn),
|
|
88
|
+
subscriptions: [],
|
|
89
|
+
}),
|
|
90
|
+
);
|
|
91
|
+
}),
|
|
92
|
+
}),
|
|
93
|
+
AutomationPlugin(),
|
|
94
|
+
AssistantPlugin(),
|
|
95
|
+
PreviewPlugin(),
|
|
96
|
+
StorybookPlugin({}),
|
|
97
|
+
],
|
|
98
|
+
})),
|
|
99
|
+
],
|
|
100
|
+
parameters: {
|
|
101
|
+
layout: 'fullscreen',
|
|
102
|
+
translations,
|
|
103
|
+
},
|
|
104
|
+
} satisfies Meta<DefaultStoryProps>;
|
|
105
|
+
|
|
106
|
+
export default meta;
|
|
107
|
+
|
|
108
|
+
type Story = StoryObj<typeof meta>;
|
|
109
|
+
|
|
110
|
+
export const Default: Story = {
|
|
111
|
+
args: {
|
|
112
|
+
inputs: true,
|
|
113
|
+
spec: [
|
|
114
|
+
{ type: Organization.Organization, count: 10 },
|
|
115
|
+
{ type: Person.Person, count: 10 },
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const Empty: Story = {};
|