@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
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { type InvocationsState } from '@dxos/functions-runtime';
|
|
9
|
+
import { useTriggerRuntimeControls } from '@dxos/plugin-automation/hooks';
|
|
10
|
+
import { StatusBar } from '@dxos/plugin-status-bar';
|
|
11
|
+
import { useObject } from '@dxos/react-client/echo';
|
|
12
|
+
import { IconButton, Popover, useTranslation } from '@dxos/react-ui';
|
|
13
|
+
|
|
14
|
+
import { meta } from '#meta';
|
|
15
|
+
|
|
16
|
+
type TriggerStatusState = 'disabled' | 'idle' | 'running' | 'edge' | 'error';
|
|
17
|
+
|
|
18
|
+
const getIcon = (state: TriggerStatusState): string => {
|
|
19
|
+
switch (state) {
|
|
20
|
+
case 'disabled':
|
|
21
|
+
return 'ph--lightning-slash--regular';
|
|
22
|
+
case 'idle':
|
|
23
|
+
return 'ph--lightning--regular';
|
|
24
|
+
case 'edge':
|
|
25
|
+
return 'ph--lightning--regular';
|
|
26
|
+
case 'running':
|
|
27
|
+
return 'ph--lightning--fill';
|
|
28
|
+
case 'error':
|
|
29
|
+
return 'ph--warning--regular';
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const getIconClassNames = (state: TriggerStatusState): string | undefined => {
|
|
34
|
+
switch (state) {
|
|
35
|
+
case 'running':
|
|
36
|
+
return 'animate-pulse text-accent-text';
|
|
37
|
+
case 'error':
|
|
38
|
+
return 'text-error-text';
|
|
39
|
+
default:
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type SpaceStatusProps = AppSurface.SpaceArticleProps;
|
|
45
|
+
|
|
46
|
+
export const SpaceStatus = ({ space }: SpaceStatusProps) => {
|
|
47
|
+
const { t } = useTranslation(meta.id);
|
|
48
|
+
const { state } = useTriggerRuntimeControls(space.db);
|
|
49
|
+
const isEnabled = state?.enabled ?? false;
|
|
50
|
+
const [properties] = useObject(space.properties);
|
|
51
|
+
const computeEnvironment = properties.computeEnvironment ?? 'local';
|
|
52
|
+
|
|
53
|
+
// Determine the current trigger status state.
|
|
54
|
+
const triggerState: TriggerStatusState = useMemo(() => {
|
|
55
|
+
if (computeEnvironment === 'edge') {
|
|
56
|
+
return 'edge';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (!isEnabled) {
|
|
60
|
+
return 'disabled';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Check if there's any pending invocation.
|
|
64
|
+
const hasPending = state?.invocations.some((invocation) => invocation.result === null);
|
|
65
|
+
if (hasPending) {
|
|
66
|
+
return 'running';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Check if the last invocation failed.
|
|
70
|
+
const lastInvocation = state?.invocations.at(-1);
|
|
71
|
+
if (lastInvocation?.result?._tag === 'Failure') {
|
|
72
|
+
return 'error';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return 'idle';
|
|
76
|
+
}, [computeEnvironment, isEnabled, state?.invocations]);
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<Popover.Root>
|
|
80
|
+
<Popover.Trigger asChild>
|
|
81
|
+
<StatusBar.Item>
|
|
82
|
+
<IconButton
|
|
83
|
+
icon={getIcon(triggerState)}
|
|
84
|
+
iconOnly
|
|
85
|
+
label={t(`trigger-status-${triggerState}.label`)}
|
|
86
|
+
classNames={getIconClassNames(triggerState)}
|
|
87
|
+
/>
|
|
88
|
+
</StatusBar.Item>
|
|
89
|
+
</Popover.Trigger>
|
|
90
|
+
<Popover.Portal>
|
|
91
|
+
<Popover.Content side='left'>
|
|
92
|
+
<TriggerStatusPopover
|
|
93
|
+
state={triggerState}
|
|
94
|
+
currentFunctionName={
|
|
95
|
+
state?.invocations.at(-1)?.function?.meta.name ?? state?.invocations.at(-1)?.function?.meta.key
|
|
96
|
+
}
|
|
97
|
+
lastInvocation={state?.invocations.at(-1)}
|
|
98
|
+
/>
|
|
99
|
+
<Popover.Arrow />
|
|
100
|
+
</Popover.Content>
|
|
101
|
+
</Popover.Portal>
|
|
102
|
+
</Popover.Root>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type TriggerStatusPopoverProps = {
|
|
107
|
+
state: TriggerStatusState;
|
|
108
|
+
currentFunctionName?: string;
|
|
109
|
+
lastInvocation?: InvocationsState;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const TriggerStatusPopover = ({
|
|
113
|
+
state,
|
|
114
|
+
currentFunctionName,
|
|
115
|
+
lastInvocation, // TODO(burdon): Show.
|
|
116
|
+
}: TriggerStatusPopoverProps) => {
|
|
117
|
+
const { t } = useTranslation(meta.id);
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<div className='flex flex-col gap-2 p-2 w-[240px]'>
|
|
121
|
+
<div className='flex flex-col gap-1'>
|
|
122
|
+
<div className='text-sm'>{t(`trigger-status-${state}.label`)}</div>
|
|
123
|
+
{currentFunctionName && state === 'running' && (
|
|
124
|
+
<div className='text-xs text-description'>{currentFunctionName}</div>
|
|
125
|
+
)}
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
);
|
|
129
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
export const BlueprintArticle: ComponentType<any> = lazy(() => import('./BlueprintArticle'));
|
|
8
|
+
export const ChatCompanion: ComponentType<any> = lazy(() => import('./ChatCompanion'));
|
|
9
|
+
export const ChatContainer: ComponentType<any> = lazy(() => import('./ChatContainer'));
|
|
10
|
+
export const ChatDialog: ComponentType<any> = lazy(() => import('./ChatDialog'));
|
|
11
|
+
export const AgentArticle: ComponentType<any> = lazy(() => import('./AgentArticle'));
|
|
12
|
+
export const AgentProperties: ComponentType<any> = lazy(() => import('./AgentProperties'));
|
|
13
|
+
export const PromptArticle: ComponentType<any> = lazy(() => import('./PromptArticle'));
|
|
14
|
+
export const PromptList: ComponentType<any> = lazy(() => import('./PromptList'));
|
|
15
|
+
export const TracePanel: ComponentType<any> = lazy(() => import('./TracePanel'));
|
|
16
|
+
export const TriggerStatus: ComponentType<any> = lazy(() => import('./TriggerStatus'));
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { syntaxTree } from '@codemirror/language';
|
|
6
|
+
import { type Extension } from '@codemirror/state';
|
|
7
|
+
import { Decoration, type DecorationSet, EditorView, ViewPlugin, type ViewUpdate, WidgetType } from '@codemirror/view';
|
|
8
|
+
|
|
9
|
+
import { Domino } from '@dxos/ui';
|
|
10
|
+
|
|
11
|
+
export type PromptExtensionOptions = {
|
|
12
|
+
/** Called when the user clicks the run button on a prompt code block. */
|
|
13
|
+
onRun: (promptText: string) => void;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* CodeMirror extension that adds a green "run" button to ```prompt fenced code blocks.
|
|
18
|
+
*/
|
|
19
|
+
export const promptRunExtension = ({ onRun }: PromptExtensionOptions): Extension => {
|
|
20
|
+
return [
|
|
21
|
+
ViewPlugin.fromClass(
|
|
22
|
+
class {
|
|
23
|
+
decorations: DecorationSet;
|
|
24
|
+
|
|
25
|
+
constructor(view: EditorView) {
|
|
26
|
+
this.decorations = this.buildDecorations(view);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
update(update: ViewUpdate) {
|
|
30
|
+
if (update.docChanged || update.viewportChanged || update.selectionSet || update.focusChanged) {
|
|
31
|
+
this.decorations = this.buildDecorations(update.view);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
buildDecorations(view: EditorView): DecorationSet {
|
|
36
|
+
const decorations: Array<{ from: number; to: number; decoration: Decoration }> = [];
|
|
37
|
+
|
|
38
|
+
syntaxTree(view.state).iterate({
|
|
39
|
+
enter: (node) => {
|
|
40
|
+
if (node.name === 'FencedCode') {
|
|
41
|
+
const info = node.node.getChild('CodeInfo');
|
|
42
|
+
if (info) {
|
|
43
|
+
const type = view.state.sliceDoc(info.from, info.to);
|
|
44
|
+
const text = node.node.getChild('CodeText');
|
|
45
|
+
if (type === 'prompt' && text) {
|
|
46
|
+
const content = view.state.sliceDoc(text.from, text.to).trim();
|
|
47
|
+
if (content.length > 0) {
|
|
48
|
+
const widget = new PromptRunWidget(content, onRun);
|
|
49
|
+
decorations.push({
|
|
50
|
+
from: node.from,
|
|
51
|
+
to: node.from,
|
|
52
|
+
decoration: Decoration.widget({ widget, side: -1 }),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return Decoration.set(
|
|
62
|
+
decorations.sort((a, b) => a.from - b.from || a.to - b.to).map((d) => d.decoration.range(d.from, d.to)),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
decorations: (v) => v.decorations,
|
|
68
|
+
},
|
|
69
|
+
),
|
|
70
|
+
];
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
class PromptRunWidget extends WidgetType {
|
|
74
|
+
constructor(
|
|
75
|
+
private readonly prompt: string,
|
|
76
|
+
private readonly onClick: (promptText: string) => void,
|
|
77
|
+
) {
|
|
78
|
+
super();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
override eq(other: this) {
|
|
82
|
+
return this.prompt === other.prompt;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
override ignoreEvent() {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
override toDOM() {
|
|
90
|
+
return Domino.of('div')
|
|
91
|
+
.classNames('relative')
|
|
92
|
+
.append(
|
|
93
|
+
Domino.of('button')
|
|
94
|
+
.classNames('dx-button absolute right-0 top-4')
|
|
95
|
+
.on('mousedown', (event) => {
|
|
96
|
+
event.preventDefault();
|
|
97
|
+
event.stopPropagation();
|
|
98
|
+
this.onClick(this.prompt);
|
|
99
|
+
})
|
|
100
|
+
.append(
|
|
101
|
+
Domino.of('svg', Domino.SVG)
|
|
102
|
+
.classNames('w-4 h-4 cursor-pointer')
|
|
103
|
+
.append(
|
|
104
|
+
Domino.of('use', Domino.SVG).attributes({
|
|
105
|
+
href: Domino.icon('ph--play--regular'),
|
|
106
|
+
}),
|
|
107
|
+
),
|
|
108
|
+
),
|
|
109
|
+
).root;
|
|
110
|
+
}
|
|
111
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
export * from './useBlueprintRegistry';
|
|
6
6
|
export * from './useChatProcessor';
|
|
7
7
|
export * from './useChatServices';
|
|
8
|
+
export * from './useChatToolbarActions';
|
|
8
9
|
export * from './useContextBinder';
|
|
9
10
|
export * from './useContextObjects';
|
|
11
|
+
export * from './useFilteredTypes';
|
|
10
12
|
export * from './useFlush';
|
|
11
|
-
export * from './useItemTypes';
|
|
12
13
|
export * from './useOnline';
|
|
13
14
|
export * from './usePresets';
|
|
14
15
|
export * from './useReferencesProvider';
|
|
@@ -2,35 +2,38 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { useCallback, useMemo, useState } from 'react';
|
|
5
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
7
6
|
|
|
8
|
-
import {
|
|
7
|
+
import { useCapabilities } from '@dxos/app-framework/ui';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
9
|
import { type AiContextBinder } from '@dxos/assistant';
|
|
10
10
|
import { Blueprint } from '@dxos/blueprints';
|
|
11
|
-
import { type
|
|
12
|
-
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
11
|
+
import { type Database, Filter, Obj, Ref } from '@dxos/echo';
|
|
13
12
|
import { useQuery } from '@dxos/react-client/echo';
|
|
14
|
-
import { distinctBy
|
|
13
|
+
import { distinctBy } from '@dxos/util';
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* Provide a registry of blueprints from plugins.
|
|
18
17
|
*/
|
|
19
18
|
// TODO(burdon): Reconcile with eventual public registry.
|
|
19
|
+
// TODO(dmaretskyi): Reconcile with blueprint registry in compute runtime.
|
|
20
20
|
export const useBlueprintRegistry = () => {
|
|
21
|
-
const
|
|
22
|
-
return useMemo(
|
|
21
|
+
const blueprintDefinitions = useCapabilities(AppCapabilities.BlueprintDefinition);
|
|
22
|
+
return useMemo(
|
|
23
|
+
() => new Blueprint.Registry(blueprintDefinitions.map((blueprint) => blueprint.make())),
|
|
24
|
+
[blueprintDefinitions],
|
|
25
|
+
);
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
export const useBlueprints = ({
|
|
26
29
|
blueprintRegistry,
|
|
27
|
-
|
|
30
|
+
db,
|
|
28
31
|
}: {
|
|
29
32
|
blueprintRegistry?: Blueprint.Registry;
|
|
30
|
-
|
|
33
|
+
db?: Database.Database;
|
|
31
34
|
}) => {
|
|
32
35
|
const staticBlueprints = useMemo(() => blueprintRegistry?.query() ?? [], [blueprintRegistry]);
|
|
33
|
-
const spaceBlueprints = useQuery(
|
|
36
|
+
const spaceBlueprints = useQuery(db, Filter.type(Blueprint.Blueprint));
|
|
34
37
|
return useMemo(() => {
|
|
35
38
|
const blueprints = distinctBy([...staticBlueprints, ...spaceBlueprints], (b) => b.key);
|
|
36
39
|
blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));
|
|
@@ -44,22 +47,34 @@ export const useBlueprints = ({
|
|
|
44
47
|
export const useActiveBlueprints = ({ context }: { context?: AiContextBinder }) => {
|
|
45
48
|
const [active, setActive] = useState<Map<string, Blueprint.Blueprint>>(new Map());
|
|
46
49
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!context) {
|
|
52
|
+
setActive(new Map());
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const updateActive = () => {
|
|
57
|
+
const blueprints = context.getBlueprints();
|
|
58
|
+
setActive(new Map(blueprints.map((blueprint) => [blueprint.key, blueprint])));
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// Set initial value.
|
|
62
|
+
updateActive();
|
|
63
|
+
|
|
64
|
+
// Subscribe to changes.
|
|
65
|
+
return context.subscribeBlueprints(updateActive);
|
|
66
|
+
}, [context]);
|
|
52
67
|
|
|
53
68
|
return active;
|
|
54
69
|
};
|
|
55
70
|
|
|
56
71
|
// TODO(burdon): Move logic into binder.
|
|
57
72
|
export const useBlueprintHandlers = ({
|
|
58
|
-
|
|
73
|
+
db,
|
|
59
74
|
context,
|
|
60
75
|
blueprintRegistry,
|
|
61
76
|
}: {
|
|
62
|
-
|
|
77
|
+
db: Database.Database;
|
|
63
78
|
context?: AiContextBinder;
|
|
64
79
|
blueprintRegistry?: Blueprint.Registry;
|
|
65
80
|
}) => {
|
|
@@ -70,7 +85,7 @@ export const useBlueprintHandlers = ({
|
|
|
70
85
|
}
|
|
71
86
|
|
|
72
87
|
// Find existing cloned blueprint.
|
|
73
|
-
const
|
|
88
|
+
const objects = await db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
74
89
|
let storedBlueprint = objects.find((blueprint) => blueprint.key === key);
|
|
75
90
|
if (checked) {
|
|
76
91
|
if (!storedBlueprint) {
|
|
@@ -80,14 +95,14 @@ export const useBlueprintHandlers = ({
|
|
|
80
95
|
}
|
|
81
96
|
|
|
82
97
|
// NOTE: Possible race condition with other peers.
|
|
83
|
-
storedBlueprint =
|
|
98
|
+
storedBlueprint = db.add(Obj.clone(blueprint));
|
|
84
99
|
}
|
|
85
100
|
await context.bind({ blueprints: [Ref.make(storedBlueprint)] });
|
|
86
101
|
} else if (storedBlueprint) {
|
|
87
102
|
await context.unbind({ blueprints: [Ref.make(storedBlueprint)] });
|
|
88
103
|
}
|
|
89
104
|
},
|
|
90
|
-
[
|
|
105
|
+
[db, context, blueprintRegistry],
|
|
91
106
|
);
|
|
92
107
|
|
|
93
108
|
return { onUpdateBlueprint };
|
|
@@ -2,23 +2,30 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { RegistryContext } from '@effect-
|
|
6
|
-
import
|
|
5
|
+
import { type Registry, RegistryContext } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
7
|
import { useContext, useMemo, useState } from 'react';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { AiSession } from '@dxos/assistant';
|
|
10
|
+
import { type Chat } from '@dxos/assistant-toolkit';
|
|
10
11
|
import { type Blueprint } from '@dxos/blueprints';
|
|
12
|
+
import { Feed, Ref } from '@dxos/echo';
|
|
13
|
+
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
14
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
11
15
|
import { log } from '@dxos/log';
|
|
12
|
-
import { type
|
|
16
|
+
import { type AutomationCapabilities } from '@dxos/plugin-automation/types';
|
|
17
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
13
18
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
14
19
|
|
|
15
|
-
import {
|
|
16
|
-
|
|
20
|
+
import { type Assistant } from '#types';
|
|
21
|
+
|
|
22
|
+
import { AiChatProcessor, type AiServicePreset } from '../processor';
|
|
17
23
|
|
|
18
24
|
export type UseChatProcessorProps = {
|
|
19
|
-
|
|
25
|
+
space?: Space;
|
|
26
|
+
chat?: Chat.Chat;
|
|
20
27
|
preset?: AiServicePreset;
|
|
21
|
-
|
|
28
|
+
runtime?: AutomationCapabilities.ComputeRuntime;
|
|
22
29
|
blueprintRegistry?: Blueprint.Registry;
|
|
23
30
|
settings?: Assistant.Settings;
|
|
24
31
|
};
|
|
@@ -27,48 +34,57 @@ export type UseChatProcessorProps = {
|
|
|
27
34
|
* Configure and create AiChatProcessor.
|
|
28
35
|
*/
|
|
29
36
|
export const useChatProcessor = ({
|
|
37
|
+
space,
|
|
30
38
|
chat,
|
|
31
39
|
preset,
|
|
32
|
-
|
|
40
|
+
runtime,
|
|
33
41
|
blueprintRegistry,
|
|
34
42
|
settings,
|
|
35
43
|
}: UseChatProcessorProps): AiChatProcessor | undefined => {
|
|
36
44
|
const observableRegistry = useContext(RegistryContext);
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
const [conversation, setConversation] = useState<AiConversation>();
|
|
46
|
+
const [session, setSession] = useState<AiSession>();
|
|
40
47
|
useAsyncEffect(async () => {
|
|
41
|
-
if (!chat
|
|
48
|
+
if (!space || !chat) {
|
|
42
49
|
return;
|
|
43
50
|
}
|
|
44
51
|
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
const feedTarget = chat.feed.target;
|
|
53
|
+
if (!feedTarget) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const feedServiceLayer = createFeedServiceLayer(space.queues);
|
|
57
|
+
const runtime = await runAndForwardErrors(
|
|
58
|
+
Effect.runtime<Feed.FeedService>().pipe(Effect.provide(feedServiceLayer)),
|
|
59
|
+
);
|
|
60
|
+
const session = new AiSession({
|
|
61
|
+
feed: feedTarget,
|
|
62
|
+
runtime,
|
|
63
|
+
registry: observableRegistry as Registry.Registry,
|
|
64
|
+
});
|
|
65
|
+
await session.open();
|
|
66
|
+
setSession(session);
|
|
49
67
|
return () => {
|
|
50
|
-
void
|
|
68
|
+
void session.close();
|
|
69
|
+
setSession(undefined);
|
|
51
70
|
};
|
|
52
|
-
}, [chat?.
|
|
71
|
+
}, [space, chat?.feed.target]);
|
|
72
|
+
|
|
73
|
+
const feed = chat?.feed.target;
|
|
53
74
|
|
|
54
|
-
// Create processor.
|
|
55
75
|
const processor = useMemo(() => {
|
|
56
|
-
if (!
|
|
76
|
+
if (!runtime || !session || !chat || !feed) {
|
|
57
77
|
return undefined;
|
|
58
78
|
}
|
|
59
79
|
|
|
60
|
-
log('creating processor', {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
settings,
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
return new AiChatProcessor(conversation, services, {
|
|
80
|
+
log('creating processor', { preset, model: preset?.model, settings });
|
|
81
|
+
return new AiChatProcessor(session, runtime, feed, {
|
|
82
|
+
chat: chat ? Ref.make(chat) : undefined,
|
|
67
83
|
observableRegistry,
|
|
68
84
|
blueprintRegistry,
|
|
69
85
|
model: preset?.model,
|
|
70
86
|
});
|
|
71
|
-
}, [
|
|
87
|
+
}, [runtime, session, blueprintRegistry, preset, feed]);
|
|
72
88
|
|
|
73
89
|
return processor;
|
|
74
90
|
};
|
|
@@ -2,48 +2,25 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import type * as Runtime from 'effect/Runtime';
|
|
7
5
|
import { useMemo } from 'react';
|
|
8
6
|
|
|
9
|
-
import { useCapability } from '@dxos/app-framework';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
7
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
8
|
+
import { getPersonalSpace } from '@dxos/app-toolkit';
|
|
9
|
+
import { type Key } from '@dxos/echo';
|
|
10
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation/types';
|
|
13
11
|
import { useClient } from '@dxos/react-client';
|
|
14
12
|
|
|
15
|
-
import { type AiChatServices } from '../processor';
|
|
16
|
-
import { type Assistant } from '../types';
|
|
17
|
-
|
|
18
13
|
export type UseChatServicesProps = {
|
|
19
|
-
|
|
20
|
-
chat?: Assistant.Chat;
|
|
14
|
+
id?: Key.SpaceId;
|
|
21
15
|
};
|
|
22
16
|
|
|
23
17
|
/**
|
|
24
|
-
*
|
|
18
|
+
* Resolves the compute runtime for a space.
|
|
25
19
|
*/
|
|
26
|
-
|
|
27
|
-
export const useChatServices = ({
|
|
28
|
-
space,
|
|
29
|
-
chat,
|
|
30
|
-
}: UseChatServicesProps): (() => Promise<Runtime.Runtime<AiChatServices>>) | undefined => {
|
|
20
|
+
export const useChatServices = ({ id }: UseChatServicesProps) => {
|
|
31
21
|
const client = useClient();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const computeRuntimeResolver = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
22
|
+
id ??= getPersonalSpace(client)?.id;
|
|
35
23
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return () =>
|
|
39
|
-
runtime.runPromise(
|
|
40
|
-
Effect.gen(function* () {
|
|
41
|
-
return yield* Effect.runtime<AiChatServices>().pipe(
|
|
42
|
-
Effect.provide(
|
|
43
|
-
chat?.traceQueue?.target ? TracingService.layerQueue(chat.traceQueue?.target) : TracingService.layerNoop,
|
|
44
|
-
),
|
|
45
|
-
);
|
|
46
|
-
}),
|
|
47
|
-
);
|
|
48
|
-
}, [space, chat?.traceQueue?.target]);
|
|
24
|
+
const runtimeResolver = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
25
|
+
return useMemo(() => (!id ? undefined : runtimeResolver.getRuntime(id)), [id]);
|
|
49
26
|
};
|