@dxos/plugin-assistant 0.8.4-main.f5c0578 → 0.8.4-main.fcfe5033a5
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/blueprints/index.mjs.map +7 -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/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 +3406 -249
- 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/blueprints/index.mjs.map +7 -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/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 +3406 -249
- 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 -3
- 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 -2
- 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 -4
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +29 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +16 -0
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown.d.ts +5 -0
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/migrations.d.ts +5 -0
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +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 +21 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit.d.ts +4 -3
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- 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 +36 -17
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +10 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +10 -0
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
- package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
- package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +2 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +13 -4
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +19 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -4
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +13 -11
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +24 -215
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +35 -0
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +43 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.d.ts +18 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +8 -0
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts +14 -0
- package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts +25 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts +18 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts +9 -0
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts +14 -0
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts +12 -0
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +25 -0
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts +11 -0
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts +5 -0
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts +9 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts +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 -9
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +13 -7
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +12 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +10 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts +12 -0
- 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 +12 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
- package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +14 -15
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +15 -5
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -9
- 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 +9 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +15 -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 +4 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts +2 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +12 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +2 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/extensions/prompt-extension.d.ts +10 -0
- package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +5 -5
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +8 -4
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +7 -10
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -10
- 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 +5 -0
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
- 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/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +3 -3
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +5 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +5 -0
- package/dist/types/src/operations/create-chat.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +135 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/ensure-companion-chat.d.ts +5 -0
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/on-create-space.d.ts +5 -0
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts +15 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -0
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +5 -0
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -0
- package/dist/types/src/operations/set-current-chat.d.ts +5 -0
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -0
- package/dist/types/src/operations/update-chat-name.d.ts +5 -0
- package/dist/types/src/operations/update-chat-name.d.ts.map +1 -0
- package/dist/types/src/processor/index.d.ts +3 -0
- package/dist/types/src/processor/index.d.ts.map +1 -0
- package/dist/types/src/{hooks → processor}/presets.d.ts +2 -2
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +80 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts +2 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +8 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts +2 -2
- 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 -76
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +18 -40
- 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 +14 -213
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +148 -102
- package/src/AssistantPlugin.tsx +216 -128
- 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/Timeline → blueprints}/index.ts +1 -1
- package/src/capabilities/ai-service.ts +22 -20
- package/src/capabilities/app-graph-builder.ts +194 -146
- package/src/capabilities/blueprint-definition.ts +51 -25
- package/src/capabilities/companion-chat-provisioner.ts +164 -0
- package/src/capabilities/edge-model-resolver.ts +17 -13
- package/src/capabilities/index.ts +21 -11
- package/src/capabilities/local-model-resolver.ts +48 -0
- 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 +139 -130
- package/src/capabilities/settings.ts +24 -12
- package/src/capabilities/state.ts +35 -0
- package/src/capabilities/toolkit.ts +7 -100
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +34 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +102 -75
- package/src/components/AssistantSettings/index.ts +2 -2
- package/src/components/Chat/Chat.tsx +278 -205
- package/src/components/Chat/events.ts +14 -1
- package/src/components/ChatProgress/ChatProgress.tsx +56 -0
- package/src/components/{SequenceEditor → ChatProgress}/index.ts +1 -1
- package/src/components/ChatPrompt/ChatActions.tsx +34 -30
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +122 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +380 -35
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +40 -38
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatThread/ChatThread.stories.tsx +91 -223
- package/src/components/ChatThread/ChatThread.tsx +77 -36
- package/src/components/ChatThread/Link.tsx +11 -8
- package/src/components/ChatThread/MarkdownStream.stories.tsx +243 -0
- package/src/components/ChatThread/registry.tsx +238 -0
- package/src/components/ChatThread/sync.test.ts +99 -0
- package/src/components/ChatThread/sync.ts +165 -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 +28 -0
- package/src/components/ChatThread/widgets/ReasoningWidget.stories.tsx +68 -0
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +133 -0
- package/src/components/ChatThread/widgets/ReferenceWidget.ts +31 -0
- package/src/components/ChatThread/widgets/SelectWidget.ts +37 -0
- package/src/components/ChatThread/widgets/StatsWidget.ts +29 -0
- package/src/components/ChatThread/widgets/StatusWidget.ts +133 -0
- package/src/components/ChatThread/widgets/SuggestionWidget.ts +41 -0
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +28 -0
- package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +54 -0
- package/src/components/ChatThread/widgets/ToolWidget.tsx +156 -0
- package/src/components/ChatThread/widgets/index.ts +14 -0
- package/src/components/ProcessTree/ProcessTree.stories.tsx +109 -0
- package/src/components/ProcessTree/ProcessTree.tsx +86 -0
- package/src/components/ProcessTree/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +27 -18
- package/src/components/TemplateEditor/TemplateEditor.tsx +55 -69
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +23 -16
- package/src/components/TemplateEditor/TemplateForm.tsx +85 -38
- 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 +144 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +17 -23
- package/src/components/Toolbox/Toolbox.tsx +80 -81
- package/src/components/index.ts +3 -8
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +120 -0
- package/src/containers/AgentArticle/AgentArticle.tsx +198 -0
- package/src/containers/AgentArticle/index.ts +5 -0
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +100 -0
- package/src/containers/AgentProperties/AgentProperties.tsx +158 -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 +27 -23
- 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 +230 -0
- package/src/containers/TracePanel/TracePanel.tsx +114 -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 +425 -0
- package/src/containers/TracePanel/index.ts +9 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +144 -0
- package/src/containers/TriggerStatus/index.ts +5 -0
- package/src/containers/index.ts +16 -0
- package/src/extensions/index.ts +5 -0
- package/src/extensions/prompt-extension.ts +111 -0
- package/src/hooks/index.ts +5 -6
- package/src/hooks/useBlueprintRegistry.ts +52 -22
- package/src/hooks/useChatProcessor.ts +47 -38
- package/src/hooks/useChatServices.ts +12 -60
- package/src/hooks/useChatToolbarActions.ts +122 -0
- package/src/hooks/useContextBinder.ts +43 -0
- package/src/hooks/useContextObjects.ts +50 -0
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/usePresets.ts +5 -5
- package/src/hooks/useReferencesProvider.ts +5 -8
- package/src/index.ts +3 -2
- package/src/meta.ts +15 -9
- package/src/operations/create-chat.ts +80 -0
- package/src/operations/definitions.ts +127 -0
- package/src/operations/ensure-companion-chat.ts +61 -0
- package/src/operations/index.ts +17 -0
- package/src/operations/on-create-space.ts +24 -0
- package/src/operations/resolve-navigation-targets.ts +26 -0
- package/src/operations/run-prompt-in-new-chat.ts +113 -0
- package/src/operations/set-current-chat.ts +50 -0
- package/src/operations/update-chat-name.ts +61 -0
- package/src/processor/index.ts +6 -0
- package/src/{hooks → processor}/presets.ts +21 -6
- package/src/processor/processor.test.ts +40 -0
- package/src/processor/processor.ts +321 -0
- package/src/queue-logger.ts +29 -19
- package/src/testing/index.ts +1 -1
- package/src/testing/test-generator.ts +293 -0
- package/src/testing/test-sequence.ts +4 -29
- package/src/testing/test-services.ts +10 -14
- package/src/testing/trace-timeline.conversations.json +1 -0
- package/src/testing/trace-timeline.test.ts +246 -0
- package/src/translations.ts +161 -66
- package/src/types/Assistant.ts +8 -56
- 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 +27 -16
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/BlueprintContainer-H7H4BQ2C.mjs +0 -29
- package/dist/lib/browser/BlueprintContainer-H7H4BQ2C.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-SB7YC2XP.mjs +0 -77
- package/dist/lib/browser/ChatContainer-SB7YC2XP.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-X6PFOQSQ.mjs +0 -87
- package/dist/lib/browser/ChatDialog-X6PFOQSQ.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-627OQ557.mjs +0 -163
- package/dist/lib/browser/SequenceContainer-627OQ557.mjs.map +0 -7
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs +0 -22
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-ERU5XY2S.mjs +0 -166
- package/dist/lib/browser/app-graph-builder-ERU5XY2S.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-CMGIZAOW.mjs +0 -146
- package/dist/lib/browser/blueprint-definition-CMGIZAOW.mjs.map +0 -7
- package/dist/lib/browser/chunk-BVH6VK6Q.mjs +0 -2254
- package/dist/lib/browser/chunk-BVH6VK6Q.mjs.map +0 -7
- package/dist/lib/browser/chunk-JBFDQMUJ.mjs +0 -193
- package/dist/lib/browser/chunk-JBFDQMUJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-LKP65RPA.mjs +0 -20
- package/dist/lib/browser/chunk-LKP65RPA.mjs.map +0 -7
- package/dist/lib/browser/chunk-NZDCKQ6W.mjs +0 -89
- package/dist/lib/browser/chunk-NZDCKQ6W.mjs.map +0 -7
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs +0 -16
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs.map +0 -7
- package/dist/lib/browser/chunk-Y66UJUHV.mjs +0 -280
- package/dist/lib/browser/chunk-Y66UJUHV.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs +0 -24
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-DGRO2XSG.mjs +0 -81
- package/dist/lib/browser/intent-resolver-DGRO2XSG.mjs.map +0 -7
- package/dist/lib/browser/react-surface-LPSIBHEJ.mjs +0 -163
- package/dist/lib/browser/react-surface-LPSIBHEJ.mjs.map +0 -7
- package/dist/lib/browser/settings-ZFNQYSYP.mjs +0 -23
- package/dist/lib/browser/settings-ZFNQYSYP.mjs.map +0 -7
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs +0 -105
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-VH4EE4CM.mjs +0 -30
- package/dist/lib/node-esm/BlueprintContainer-VH4EE4CM.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-7JLMWHMX.mjs +0 -78
- package/dist/lib/node-esm/ChatContainer-7JLMWHMX.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QDD722F2.mjs +0 -88
- package/dist/lib/node-esm/ChatDialog-QDD722F2.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-EQ5NP2PG.mjs +0 -164
- package/dist/lib/node-esm/SequenceContainer-EQ5NP2PG.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-LDD32477.mjs +0 -23
- package/dist/lib/node-esm/ai-service-LDD32477.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-RCT4ANP2.mjs +0 -167
- package/dist/lib/node-esm/app-graph-builder-RCT4ANP2.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-AEWYMW6I.mjs +0 -147
- package/dist/lib/node-esm/blueprint-definition-AEWYMW6I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ETS2CIDF.mjs +0 -2255
- package/dist/lib/node-esm/chunk-ETS2CIDF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GAWXJ7K5.mjs +0 -90
- package/dist/lib/node-esm/chunk-GAWXJ7K5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GENVBE3B.mjs +0 -194
- package/dist/lib/node-esm/chunk-GENVBE3B.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KOC6ESG7.mjs +0 -22
- package/dist/lib/node-esm/chunk-KOC6ESG7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QS6GWTVA.mjs +0 -281
- package/dist/lib/node-esm/chunk-QS6GWTVA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-X6AANUHZ.mjs +0 -17
- package/dist/lib/node-esm/chunk-X6AANUHZ.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs +0 -25
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-7CKWG7TZ.mjs +0 -82
- package/dist/lib/node-esm/intent-resolver-7CKWG7TZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-3EPAE4I4.mjs +0 -164
- package/dist/lib/node-esm/react-surface-3EPAE4I4.mjs.map +0 -7
- package/dist/lib/node-esm/settings-UI4VQCWW.mjs +0 -24
- package/dist/lib/node-esm/settings-UI4VQCWW.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-2VNUL77B.mjs +0 -106
- package/dist/lib/node-esm/toolkit-2VNUL77B.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/ChatContainer.d.ts +0 -12
- 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/ChatMessage.d.ts +0 -18
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
- package/dist/types/src/components/ChatThread/reducer.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 -8
- 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/Timeline/Timeline.d.ts +0 -42
- package/dist/types/src/components/Timeline/Timeline.d.ts.map +0 -1
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts +0 -11
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts.map +0 -1
- package/dist/types/src/components/Timeline/index.d.ts +0 -2
- package/dist/types/src/components/Timeline/index.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/execution-graph/execution-graph.d.ts +0 -21
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +0 -1
- package/dist/types/src/execution-graph/index.d.ts +0 -2
- package/dist/types/src/execution-graph/index.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/chat-processor.d.ts +0 -72
- package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
- package/dist/types/src/hooks/errors.d.ts +0 -4
- package/dist/types/src/hooks/errors.d.ts.map +0 -1
- package/dist/types/src/hooks/presets.d.ts.map +0 -1
- package/dist/types/src/hooks/useExecutionGraph.d.ts +0 -7
- package/dist/types/src/hooks/useExecutionGraph.d.ts.map +0 -1
- package/dist/types/src/hooks/useResolveRef.d.ts +0 -4
- package/dist/types/src/hooks/useResolveRef.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/stories/Chat.stories.d.ts +0 -268
- package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +0 -5
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/ChatContainer.d.ts +0 -5
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/GraphContainer.d.ts +0 -6
- package/dist/types/src/stories/components/GraphContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/LoggingContainer.d.ts +0 -5
- package/dist/types/src/stories/components/LoggingContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/SurfaceContainer.d.ts +0 -8
- package/dist/types/src/stories/components/SurfaceContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/TasksContainer.d.ts +0 -5
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/index.d.ts +0 -8
- package/dist/types/src/stories/components/index.d.ts.map +0 -1
- package/dist/types/src/stories/components/types.d.ts +0 -7
- package/dist/types/src/stories/components/types.d.ts.map +0 -1
- package/dist/types/src/stories/hooks/index.d.ts +0 -3
- package/dist/types/src/stories/hooks/index.d.ts.map +0 -1
- package/dist/types/src/stories/hooks/useFlush.d.ts.map +0 -1
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts +0 -3
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts.map +0 -1
- package/dist/types/src/stories/testing/data.d.ts +0 -142
- package/dist/types/src/stories/testing/data.d.ts.map +0 -1
- package/dist/types/src/stories/testing/index.d.ts +0 -3
- package/dist/types/src/stories/testing/index.d.ts.map +0 -1
- package/dist/types/src/stories/testing/testing.d.ts +0 -26
- package/dist/types/src/stories/testing/testing.d.ts.map +0 -1
- package/dist/types/src/testing/test-functions.d.ts +0 -6
- package/dist/types/src/testing/test-functions.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/AssistantAction.d.ts +0 -91
- package/dist/types/src/types/AssistantAction.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -22
- package/src/capabilities/intent-resolver.ts +0 -73
- package/src/components/BlueprintContainer.tsx +0 -24
- package/src/components/ChatContainer.tsx +0 -69
- package/src/components/ChatThread/ChatMessage.tsx +0 -291
- package/src/components/ChatThread/ToolBlock.tsx +0 -125
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/components/PromptSettings.tsx +0 -89
- package/src/components/SequenceContainer.tsx +0 -133
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -33
- package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
- package/src/components/Timeline/Timeline.stories.tsx +0 -144
- package/src/components/Timeline/Timeline.tsx +0 -202
- package/src/events.ts +0 -11
- package/src/execution-graph/execution-graph.ts +0 -184
- package/src/execution-graph/index.ts +0 -5
- package/src/functions/analysis.ts +0 -20
- package/src/functions/index.ts +0 -7
- package/src/functions/list.ts +0 -42
- package/src/functions/load.ts +0 -43
- package/src/hooks/chat-processor.ts +0 -260
- package/src/hooks/errors.ts +0 -8
- package/src/hooks/useExecutionGraph.ts +0 -16
- package/src/hooks/useResolveRef.ts +0 -33
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -74
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/stories/Chat.stories.tsx +0 -317
- package/src/stories/components/BlueprintContainer.tsx +0 -34
- package/src/stories/components/ChatContainer.tsx +0 -80
- package/src/stories/components/GraphContainer.tsx +0 -118
- package/src/stories/components/LoggingContainer.tsx +0 -29
- package/src/stories/components/SurfaceContainer.tsx +0 -62
- package/src/stories/components/TasksContainer.tsx +0 -51
- package/src/stories/components/index.ts +0 -12
- package/src/stories/components/types.ts +0 -11
- package/src/stories/hooks/index.ts +0 -6
- package/src/stories/hooks/useMatcherExtension.ts +0 -45
- package/src/stories/testing/data.ts +0 -130
- package/src/stories/testing/index.ts +0 -6
- package/src/stories/testing/testing.tsx +0 -163
- package/src/testing/test-functions.ts +0 -16
- package/src/tools/function.ts +0 -49
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -219
- package/src/tools/openapi.ts +0 -341
- package/src/types/AssistantAction.ts +0 -54
- package/src/typings.d.ts +0 -9
- /package/dist/types/src/{stories/hooks → hooks}/useFlush.d.ts +0 -0
- /package/src/{stories/hooks → hooks}/useFlush.ts +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { type Database, type Type } from '@dxos/echo';
|
|
9
|
+
import { EntityKind, SystemTypeAnnotation, getTypeAnnotation } from '@dxos/echo/internal';
|
|
10
|
+
|
|
11
|
+
// TODO(burdon): Pass in filter.
|
|
12
|
+
// TODO(wittjosiah): Factor out.
|
|
13
|
+
export const useFilteredTypes = (db?: Database.Database): Type.AnyEntity[] => {
|
|
14
|
+
const [types, setTypes] = useState<Type.AnyEntity[]>([]);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!db) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return db.schemaRegistry.query({ location: ['database', 'runtime'] }).subscribe(
|
|
21
|
+
(query) => {
|
|
22
|
+
const types = Array.from(
|
|
23
|
+
new Set(
|
|
24
|
+
query.results
|
|
25
|
+
.filter((schema) => getTypeAnnotation(schema)?.kind !== EntityKind.Relation)
|
|
26
|
+
.filter((schema) => !SystemTypeAnnotation.get(schema).pipe(Option.getOrElse(() => false))),
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
setTypes(types);
|
|
31
|
+
},
|
|
32
|
+
{ fire: true },
|
|
33
|
+
);
|
|
34
|
+
}, [db]);
|
|
35
|
+
|
|
36
|
+
return types;
|
|
37
|
+
};
|
package/src/hooks/usePresets.ts
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type ChatPromptProps } from '
|
|
7
|
+
import { type ChatPromptProps } from '#components';
|
|
8
8
|
|
|
9
|
-
import { type AiServicePreset, AiServicePresets } from '
|
|
9
|
+
import { type AiServicePreset, AiServicePresets } from '../processor';
|
|
10
10
|
|
|
11
11
|
export type UsePresets = {
|
|
12
12
|
preset: AiServicePreset | undefined;
|
|
13
|
-
} & Pick<ChatPromptProps, 'presets' | '
|
|
13
|
+
} & Pick<ChatPromptProps, 'presets' | 'onPresetChange'>;
|
|
14
14
|
|
|
15
15
|
export const usePresets = (online: boolean): UsePresets => {
|
|
16
16
|
// TODO(burdon): Memo preset for provider.
|
|
@@ -27,7 +27,7 @@ export const usePresets = (online: boolean): UsePresets => {
|
|
|
27
27
|
setPreset(presets[0]);
|
|
28
28
|
}, [presets]);
|
|
29
29
|
|
|
30
|
-
const
|
|
30
|
+
const handlePresetChange = useCallback<NonNullable<ChatPromptProps['onPresetChange']>>(
|
|
31
31
|
(id) => {
|
|
32
32
|
const preset = presets.find((preset) => preset.id === id);
|
|
33
33
|
if (preset) {
|
|
@@ -40,6 +40,6 @@ export const usePresets = (online: boolean): UsePresets => {
|
|
|
40
40
|
return {
|
|
41
41
|
preset: preset,
|
|
42
42
|
presets: presetOptions,
|
|
43
|
-
|
|
43
|
+
onPresetChange: handlePresetChange,
|
|
44
44
|
};
|
|
45
45
|
};
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, useCapabilities } from '@dxos/app-framework';
|
|
8
7
|
import { type Space } from '@dxos/client/echo';
|
|
9
8
|
import { Filter, Obj } from '@dxos/echo';
|
|
10
9
|
import { type ReferencesProvider } from '@dxos/react-ui-chat';
|
|
@@ -13,8 +12,6 @@ import { type ReferencesProvider } from '@dxos/react-ui-chat';
|
|
|
13
12
|
* Resolve references to objects in the space.
|
|
14
13
|
*/
|
|
15
14
|
export const useReferencesProvider = (space?: Space): ReferencesProvider | undefined => {
|
|
16
|
-
const blueprints = useCapabilities(Capabilities.BlueprintDefinition);
|
|
17
|
-
|
|
18
15
|
return useMemo<ReferencesProvider | undefined>((): ReferencesProvider | undefined => {
|
|
19
16
|
if (!space) {
|
|
20
17
|
return undefined;
|
|
@@ -24,11 +21,11 @@ export const useReferencesProvider = (space?: Space): ReferencesProvider | undef
|
|
|
24
21
|
getReferences: async ({ query }) => {
|
|
25
22
|
// TODO(burdon): Previously we filtered by types declared by the artifact definitions.
|
|
26
23
|
// const schemas = blueprints.map((blueprint) => blueprint.schema).flat();
|
|
27
|
-
// const
|
|
24
|
+
// const objects = await space.db
|
|
28
25
|
// .query(Filter.or(...schemas.map((schema) => Filter.type(schema as Type.Schema))))
|
|
29
26
|
// .run();
|
|
30
27
|
|
|
31
|
-
const
|
|
28
|
+
const objects = await space.db.query(Filter.everything()).run();
|
|
32
29
|
|
|
33
30
|
return (
|
|
34
31
|
objects
|
|
@@ -39,7 +36,7 @@ export const useReferencesProvider = (space?: Space): ReferencesProvider | undef
|
|
|
39
36
|
// })
|
|
40
37
|
.filter((object) => stringMatch(query, Obj.getLabel(object as any) ?? ''))
|
|
41
38
|
// TODO(dmaretskyi): `Type.getDXN` (at the point of writing) didn't work here as it was schema-only.
|
|
42
|
-
.filter((object) => !!Obj.getDXN(object as Obj.
|
|
39
|
+
.filter((object) => !!Obj.getDXN(object as Obj.Unknown))
|
|
43
40
|
.map((object) => ({
|
|
44
41
|
uri: Obj.getDXN(object as any).toString(),
|
|
45
42
|
label: Obj.getLabel(object as any) ?? '',
|
|
@@ -47,11 +44,11 @@ export const useReferencesProvider = (space?: Space): ReferencesProvider | undef
|
|
|
47
44
|
);
|
|
48
45
|
},
|
|
49
46
|
resolveReference: async ({ uri }) => {
|
|
50
|
-
const object = await space.db.query(Filter.
|
|
47
|
+
const object = await space.db.query(Filter.id(uri)).first();
|
|
51
48
|
return { uri, label: Obj.getLabel(object) ?? '' };
|
|
52
49
|
},
|
|
53
50
|
} satisfies ReferencesProvider;
|
|
54
|
-
}, [space
|
|
51
|
+
}, [space]);
|
|
55
52
|
};
|
|
56
53
|
|
|
57
54
|
const stringMatch = (query: string, label: string) => label.toLowerCase().startsWith(query.toLowerCase());
|
package/src/index.ts
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './
|
|
5
|
+
export * from './blueprints';
|
|
6
6
|
export * from './components';
|
|
7
|
-
export * from './
|
|
7
|
+
export * from './hooks';
|
|
8
8
|
export * from './meta';
|
|
9
|
+
export * from './translations';
|
|
9
10
|
export * from './types';
|
|
10
11
|
|
|
11
12
|
export * from './AssistantPlugin';
|
package/src/meta.ts
CHANGED
|
@@ -2,17 +2,23 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
6
7
|
|
|
7
|
-
export const
|
|
8
|
-
|
|
9
|
-
export const ASSISTANT_DIALOG = `${ASSISTANT_PLUGIN}/assistant/dialog`;
|
|
10
|
-
|
|
11
|
-
export const meta: PluginMeta = {
|
|
12
|
-
id: ASSISTANT_PLUGIN,
|
|
8
|
+
export const meta: Plugin.Meta = {
|
|
9
|
+
id: 'org.dxos.plugin.assistant',
|
|
13
10
|
name: 'Assistant',
|
|
14
|
-
description:
|
|
15
|
-
|
|
11
|
+
description: trim`
|
|
12
|
+
Intelligent AI assistant that can analyze and interact with objects across your spaces.
|
|
13
|
+
Chat naturally to get insights, search content, and perform actions using AI-powered context awareness.
|
|
14
|
+
`,
|
|
15
|
+
icon: 'ph--sparkle--regular',
|
|
16
|
+
iconHue: 'sky',
|
|
16
17
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-assistant',
|
|
17
18
|
tags: ['labs'],
|
|
18
19
|
};
|
|
20
|
+
|
|
21
|
+
export const ASSISTANT_DIALOG = `${meta.id}.assistant.dialog`;
|
|
22
|
+
|
|
23
|
+
/** Companion variant identifier for the assistant chat panel. */
|
|
24
|
+
export const ASSISTANT_COMPANION_VARIANT = 'assistant-chat';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AiContextBinder } from '@dxos/assistant';
|
|
9
|
+
import { Chat, DatabaseBlueprint, AgentWizardBlueprint } from '@dxos/assistant-toolkit';
|
|
10
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
11
|
+
import { Feed, Filter, Obj, Ref } from '@dxos/echo';
|
|
12
|
+
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
13
|
+
import { invariant } from '@dxos/invariant';
|
|
14
|
+
import { Operation } from '@dxos/operation';
|
|
15
|
+
import { ClientCapabilities } from '@dxos/plugin-client/types';
|
|
16
|
+
|
|
17
|
+
import { AssistantBlueprint } from '#blueprints';
|
|
18
|
+
|
|
19
|
+
import { CreateChat } from './definitions';
|
|
20
|
+
|
|
21
|
+
const handler: Operation.WithHandler<typeof CreateChat> = CreateChat.pipe(
|
|
22
|
+
Operation.withHandler(
|
|
23
|
+
Effect.fnUntraced(function* ({ db, name, addToSpace = true }) {
|
|
24
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
25
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
26
|
+
const space = client.spaces.get(db.spaceId);
|
|
27
|
+
invariant(space, 'Space not found');
|
|
28
|
+
const feed = space.db.add(Feed.make());
|
|
29
|
+
const chat = Chat.make({ name, feed: Ref.make(feed) });
|
|
30
|
+
Obj.setParent(feed, chat);
|
|
31
|
+
if (addToSpace) {
|
|
32
|
+
space.db.add(chat);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// TODO(wittjosiah): This should be a space-level setting.
|
|
36
|
+
// TODO(burdon): Clone when activated. Copy-on-write for template.
|
|
37
|
+
const blueprints = yield* Effect.promise(() => db.query(Filter.type(Blueprint.Blueprint)).run());
|
|
38
|
+
let defaultAssistantBlueprint = blueprints.find((blueprint) => blueprint.key === AssistantBlueprint.key);
|
|
39
|
+
if (!defaultAssistantBlueprint) {
|
|
40
|
+
defaultAssistantBlueprint = db.add(AssistantBlueprint.make());
|
|
41
|
+
}
|
|
42
|
+
let defaultDatabaseBlueprint = blueprints.find((blueprint) => blueprint.key === DatabaseBlueprint.key);
|
|
43
|
+
if (!defaultDatabaseBlueprint) {
|
|
44
|
+
defaultDatabaseBlueprint = db.add(DatabaseBlueprint.make());
|
|
45
|
+
}
|
|
46
|
+
let defaultAgentWizardBlueprint = blueprints.find((blueprint) => blueprint.key === AgentWizardBlueprint.key);
|
|
47
|
+
if (!defaultAgentWizardBlueprint) {
|
|
48
|
+
defaultAgentWizardBlueprint = db.add(AgentWizardBlueprint.make());
|
|
49
|
+
}
|
|
50
|
+
// Dynamic import to avoid circular dependency with the barrel that also exports BlueprintManagerHandlers.
|
|
51
|
+
const { BlueprintManagerBlueprint } = yield* Effect.promise(() => import('@dxos/assistant-toolkit'));
|
|
52
|
+
let defaultBlueprintManagerBlueprint = blueprints.find(
|
|
53
|
+
(blueprint) => blueprint.key === BlueprintManagerBlueprint.key,
|
|
54
|
+
);
|
|
55
|
+
if (!defaultBlueprintManagerBlueprint) {
|
|
56
|
+
defaultBlueprintManagerBlueprint = db.add(BlueprintManagerBlueprint.make());
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const feedServiceLayer = createFeedServiceLayer(space.queues);
|
|
60
|
+
const runtime = yield* Effect.runtime<Feed.FeedService>().pipe(Effect.provide(feedServiceLayer));
|
|
61
|
+
const binder = new AiContextBinder({ feed, runtime, registry });
|
|
62
|
+
yield* Effect.promise(() =>
|
|
63
|
+
binder.use((b: AiContextBinder) =>
|
|
64
|
+
b.bind({
|
|
65
|
+
blueprints: [
|
|
66
|
+
Ref.make(defaultAssistantBlueprint!),
|
|
67
|
+
Ref.make(defaultDatabaseBlueprint!),
|
|
68
|
+
Ref.make(defaultAgentWizardBlueprint!),
|
|
69
|
+
Ref.make(defaultBlueprintManagerBlueprint!),
|
|
70
|
+
],
|
|
71
|
+
}),
|
|
72
|
+
),
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
return { object: chat };
|
|
76
|
+
}),
|
|
77
|
+
),
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
export default handler;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { AiService } from '@dxos/ai';
|
|
8
|
+
import { Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Chat } from '@dxos/assistant-toolkit';
|
|
10
|
+
import { Prompt } from '@dxos/blueprints';
|
|
11
|
+
import { SpaceSchema } from '@dxos/client/echo';
|
|
12
|
+
import { Collection, Database, DXN, Feed, Obj, Ref } from '@dxos/echo';
|
|
13
|
+
import { Operation } from '@dxos/operation';
|
|
14
|
+
|
|
15
|
+
import { meta } from '#meta';
|
|
16
|
+
|
|
17
|
+
const ASSISTANT_OPERATION = `${meta.id}.operation`;
|
|
18
|
+
|
|
19
|
+
export const OnCreateSpace = Operation.make({
|
|
20
|
+
meta: { key: `${ASSISTANT_OPERATION}.on-create-space`, name: 'On Create Space' },
|
|
21
|
+
services: [Capability.Service],
|
|
22
|
+
input: Schema.Struct({
|
|
23
|
+
space: SpaceSchema,
|
|
24
|
+
rootCollection: Collection.Collection,
|
|
25
|
+
}),
|
|
26
|
+
output: Schema.Void,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const CreateChat = Operation.make({
|
|
30
|
+
meta: { key: `${ASSISTANT_OPERATION}.create-chat`, name: 'Create Chat' },
|
|
31
|
+
services: [Capability.Service],
|
|
32
|
+
input: Schema.Struct({
|
|
33
|
+
db: Database.Database,
|
|
34
|
+
name: Schema.optional(Schema.String),
|
|
35
|
+
/** If false, chat is created in-memory only and not added to space. Defaults to true. */
|
|
36
|
+
addToSpace: Schema.optional(Schema.Boolean),
|
|
37
|
+
}),
|
|
38
|
+
output: Schema.Struct({
|
|
39
|
+
object: Chat.Chat,
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const UpdateChatName = Operation.make({
|
|
44
|
+
meta: { key: `${ASSISTANT_OPERATION}.update-chat-name`, name: 'Update Chat Name' },
|
|
45
|
+
services: [Database.Service, Feed.FeedService, AiService.AiService],
|
|
46
|
+
input: Schema.Struct({
|
|
47
|
+
chat: Chat.Chat,
|
|
48
|
+
}),
|
|
49
|
+
output: Schema.Void,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export const SetCurrentChat = Operation.make({
|
|
53
|
+
meta: { key: `${ASSISTANT_OPERATION}.set-current-chat`, name: 'Set Current Chat' },
|
|
54
|
+
services: [Capability.Service],
|
|
55
|
+
input: Schema.Struct({
|
|
56
|
+
companionTo: Obj.Unknown,
|
|
57
|
+
chat: Chat.Chat.pipe(Schema.optional),
|
|
58
|
+
}),
|
|
59
|
+
output: Schema.Void,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export const RunPromptInNewChat = Operation.make({
|
|
63
|
+
meta: { key: `${ASSISTANT_OPERATION}.run-prompt-in-new-chat`, name: 'Run Prompt In New Chat' },
|
|
64
|
+
services: [Capability.Service],
|
|
65
|
+
input: Schema.Struct({
|
|
66
|
+
db: Database.Database,
|
|
67
|
+
/** Context objects to bind to the new chat. */
|
|
68
|
+
objects: Schema.optional(Schema.Array(Obj.Unknown)),
|
|
69
|
+
/** Blueprint keys to look up and bind to the new chat. */
|
|
70
|
+
blueprints: Schema.optional(Schema.Array(Schema.String)),
|
|
71
|
+
/** Raw instructions or an existing Prompt object reference (e.g. from the prompts surface). */
|
|
72
|
+
prompt: Schema.Union(Schema.String, Ref.Ref(Prompt.Prompt)),
|
|
73
|
+
/**
|
|
74
|
+
* When true, skips opening the chat: runs the Agent prompt operation against the new chat via the compute runtime (traced).
|
|
75
|
+
*/
|
|
76
|
+
background: Schema.optional(Schema.Boolean),
|
|
77
|
+
}),
|
|
78
|
+
output: Schema.Struct({
|
|
79
|
+
object: Chat.Chat,
|
|
80
|
+
}),
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const NavigationTargetSchema = Schema.Struct({
|
|
84
|
+
path: Schema.String.annotations({ description: 'Navigation path to use with the Open operation.' }),
|
|
85
|
+
label: Schema.String.annotations({ description: 'Human-readable label.' }),
|
|
86
|
+
type: Schema.String.annotations({ description: 'Object type.' }),
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export const ResolveNavigationTargets = Operation.make({
|
|
90
|
+
meta: {
|
|
91
|
+
key: `${ASSISTANT_OPERATION}.resolve-navigation-targets`,
|
|
92
|
+
name: 'Resolve navigation targets',
|
|
93
|
+
description:
|
|
94
|
+
'Resolve navigation targets within the application. The returned paths can be used with the Open operation. Without a query, returns pages that can be navigated to.',
|
|
95
|
+
},
|
|
96
|
+
input: Schema.Struct({
|
|
97
|
+
query: Schema.optional(
|
|
98
|
+
Schema.Struct({
|
|
99
|
+
dxn: DXN.Schema.pipe(Schema.optional),
|
|
100
|
+
}),
|
|
101
|
+
),
|
|
102
|
+
}),
|
|
103
|
+
output: Schema.Struct({
|
|
104
|
+
targets: Schema.Array(NavigationTargetSchema),
|
|
105
|
+
}),
|
|
106
|
+
services: [Capability.Service],
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
export const EnsureCompanionChat = Operation.make({
|
|
110
|
+
meta: { key: `${ASSISTANT_OPERATION}.ensure-companion-chat`, name: 'Ensure Companion Chat' },
|
|
111
|
+
services: [Capability.Service],
|
|
112
|
+
input: Schema.Struct({
|
|
113
|
+
db: Database.Database,
|
|
114
|
+
companionTo: Obj.Unknown,
|
|
115
|
+
}),
|
|
116
|
+
output: Schema.Struct({
|
|
117
|
+
chat: Chat.Chat,
|
|
118
|
+
/** Whether the returned chat was already persisted in the space. */
|
|
119
|
+
persisted: Schema.Boolean,
|
|
120
|
+
}),
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export const BlueprintForm = Schema.Struct({
|
|
124
|
+
key: Schema.String,
|
|
125
|
+
name: Schema.String,
|
|
126
|
+
description: Schema.optional(Schema.String),
|
|
127
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Chat } from '@dxos/assistant-toolkit';
|
|
9
|
+
import { Filter, Obj, Query } from '@dxos/echo';
|
|
10
|
+
import { Operation } from '@dxos/operation';
|
|
11
|
+
|
|
12
|
+
import { AssistantCapabilities } from '../types';
|
|
13
|
+
import { CreateChat, EnsureCompanionChat, SetCurrentChat } from './definitions';
|
|
14
|
+
|
|
15
|
+
const handler: Operation.WithHandler<typeof EnsureCompanionChat> = EnsureCompanionChat.pipe(
|
|
16
|
+
Operation.withHandler(
|
|
17
|
+
Effect.fnUntraced(function* ({ db, companionTo }) {
|
|
18
|
+
const operationInvoker = yield* Capability.get(Capabilities.OperationInvoker);
|
|
19
|
+
const companionDxn = Obj.getDXN(companionTo).toString();
|
|
20
|
+
|
|
21
|
+
// 1. Look for an existing persisted companion chat in the space.
|
|
22
|
+
const existingChats = yield* Effect.promise(() =>
|
|
23
|
+
db.query(Query.select(Filter.id(companionTo.id)).targetOf(Chat.CompanionTo).source()).run(),
|
|
24
|
+
);
|
|
25
|
+
if (existingChats.length > 0) {
|
|
26
|
+
const chat = existingChats.at(-1) as Chat.Chat;
|
|
27
|
+
// Cache the persisted chat so the graph connector can resolve it immediately
|
|
28
|
+
// via the cache fallback, without waiting for AtomObj.make(ref) to hydrate.
|
|
29
|
+
yield* Capabilities.updateAtomValue(AssistantCapabilities.CompanionChatCache, (current) => ({
|
|
30
|
+
...current,
|
|
31
|
+
[companionDxn]: chat,
|
|
32
|
+
}));
|
|
33
|
+
yield* Effect.promise(() => operationInvoker.invokePromise(SetCurrentChat, { companionTo, chat }));
|
|
34
|
+
return { chat, persisted: true };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// 2. Return cached transient chat for this companion if present.
|
|
38
|
+
const cache = yield* Capabilities.getAtomValue(AssistantCapabilities.CompanionChatCache);
|
|
39
|
+
const cached = cache[companionDxn] as Chat.Chat | undefined;
|
|
40
|
+
if (cached) {
|
|
41
|
+
return { chat: cached, persisted: false };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// 3. Create a new transient chat, cache it, and return it without persisting.
|
|
45
|
+
const { data } = yield* Effect.promise(() =>
|
|
46
|
+
operationInvoker.invokePromise(CreateChat, { db, addToSpace: false }),
|
|
47
|
+
);
|
|
48
|
+
if (!data?.object) {
|
|
49
|
+
return yield* Effect.fail(new Error('CreateChat did not return a chat object'));
|
|
50
|
+
}
|
|
51
|
+
const chat = data.object;
|
|
52
|
+
yield* Capabilities.updateAtomValue(AssistantCapabilities.CompanionChatCache, (current) => ({
|
|
53
|
+
...current,
|
|
54
|
+
[companionDxn]: chat,
|
|
55
|
+
}));
|
|
56
|
+
return { chat, persisted: false };
|
|
57
|
+
}),
|
|
58
|
+
),
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
export default handler;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
6
|
+
|
|
7
|
+
export * as AssistantOperation from './definitions';
|
|
8
|
+
|
|
9
|
+
export const AssistantOperationHandlerSet = OperationHandlerSet.lazy(
|
|
10
|
+
() => import('./create-chat'),
|
|
11
|
+
() => import('./ensure-companion-chat'),
|
|
12
|
+
() => import('./on-create-space'),
|
|
13
|
+
() => import('./resolve-navigation-targets'),
|
|
14
|
+
() => import('./run-prompt-in-new-chat'),
|
|
15
|
+
() => import('./set-current-chat'),
|
|
16
|
+
() => import('./update-chat-name'),
|
|
17
|
+
);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { AgentPrompt } from '@dxos/assistant-toolkit';
|
|
8
|
+
import { Operation } from '@dxos/operation';
|
|
9
|
+
|
|
10
|
+
import { CreateChat, OnCreateSpace } from './definitions';
|
|
11
|
+
|
|
12
|
+
const handler: Operation.WithHandler<typeof OnCreateSpace> = OnCreateSpace.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fnUntraced(function* ({ space }) {
|
|
15
|
+
// TODO(wittjosiah): Remove once function registry is avaiable.
|
|
16
|
+
space.db.add(Operation.serialize(AgentPrompt));
|
|
17
|
+
|
|
18
|
+
const { object: chat } = yield* Operation.invoke(CreateChat, { db: space.db });
|
|
19
|
+
space.db.add(chat);
|
|
20
|
+
}),
|
|
21
|
+
),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export default handler;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
|
+
|
|
11
|
+
import { ResolveNavigationTargets } from './definitions';
|
|
12
|
+
|
|
13
|
+
export default ResolveNavigationTargets.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fn(function* ({ query }) {
|
|
16
|
+
const capabilities = yield* Capability.Service;
|
|
17
|
+
|
|
18
|
+
// Delegate to contributed resolvers.
|
|
19
|
+
const resolvers = capabilities.getAll(AppCapabilities.NavigationTargetResolver);
|
|
20
|
+
const results = yield* Effect.forEach(resolvers, (resolver) =>
|
|
21
|
+
resolver(query as AppCapabilities.NavigationQuery).pipe(Effect.catchAll(() => Effect.succeed([]))),
|
|
22
|
+
);
|
|
23
|
+
return { targets: results.flat() };
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
);
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { getObjectPathFromObject, LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { AiContextBinder } from '@dxos/assistant';
|
|
10
|
+
import { AgentPrompt } from '@dxos/assistant-toolkit';
|
|
11
|
+
import { Blueprint, Prompt, Template } from '@dxos/blueprints';
|
|
12
|
+
import { Database, Feed, Filter, Obj, Ref } from '@dxos/echo';
|
|
13
|
+
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
14
|
+
import { invariant } from '@dxos/invariant';
|
|
15
|
+
import { log } from '@dxos/log';
|
|
16
|
+
import { Operation } from '@dxos/operation';
|
|
17
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation/types';
|
|
18
|
+
import { ClientCapabilities } from '@dxos/plugin-client/types';
|
|
19
|
+
import { Text } from '@dxos/schema';
|
|
20
|
+
|
|
21
|
+
import { AssistantCapabilities } from '../types';
|
|
22
|
+
import { CreateChat, RunPromptInNewChat } from './definitions';
|
|
23
|
+
|
|
24
|
+
const handler: Operation.WithHandler<typeof RunPromptInNewChat> = RunPromptInNewChat.pipe(
|
|
25
|
+
Operation.withHandler(
|
|
26
|
+
Effect.fnUntraced(
|
|
27
|
+
function* ({ db, prompt, objects, blueprints, background }) {
|
|
28
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
29
|
+
const { object: chat } = yield* Operation.invoke(CreateChat, { db });
|
|
30
|
+
|
|
31
|
+
if ((objects && objects.length > 0) || (blueprints && blueprints.length > 0)) {
|
|
32
|
+
const feedTarget = chat.feed.target;
|
|
33
|
+
invariant(feedTarget, 'Chat feed not found.');
|
|
34
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
35
|
+
const space = client.spaces.get(db.spaceId);
|
|
36
|
+
invariant(space, 'Space not found.');
|
|
37
|
+
const feedServiceLayer = createFeedServiceLayer(space.queues);
|
|
38
|
+
const runtime = yield* Effect.runtime<Feed.FeedService>().pipe(Effect.provide(feedServiceLayer));
|
|
39
|
+
const binder = new AiContextBinder({ feed: feedTarget, runtime, registry });
|
|
40
|
+
yield* Effect.promise(() =>
|
|
41
|
+
binder.use(async (b: AiContextBinder) => {
|
|
42
|
+
const bindingProps: Parameters<AiContextBinder['bind']>[0] = {};
|
|
43
|
+
|
|
44
|
+
if (objects && objects.length > 0) {
|
|
45
|
+
bindingProps.objects = objects.map((obj) => Ref.make(obj));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (blueprints && blueprints.length > 0) {
|
|
49
|
+
const allBlueprints = await db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
50
|
+
const matchedBlueprints = allBlueprints.filter(
|
|
51
|
+
(blueprint) => blueprint.key && blueprints.includes(blueprint.key),
|
|
52
|
+
);
|
|
53
|
+
if (matchedBlueprints.length > 0) {
|
|
54
|
+
bindingProps.blueprints = matchedBlueprints.map((blueprint) => Ref.make(blueprint));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
await b.bind(bindingProps);
|
|
59
|
+
}),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (background) {
|
|
64
|
+
const promptRef =
|
|
65
|
+
typeof prompt === 'string'
|
|
66
|
+
? Ref.make(
|
|
67
|
+
Prompt.make({
|
|
68
|
+
instructions: prompt,
|
|
69
|
+
blueprints: [],
|
|
70
|
+
context: [],
|
|
71
|
+
}),
|
|
72
|
+
)
|
|
73
|
+
: prompt;
|
|
74
|
+
yield* Database.flush();
|
|
75
|
+
const computeRuntime = yield* Capability.get(AutomationCapabilities.ComputeRuntime);
|
|
76
|
+
const runtime = yield* computeRuntime.getRuntime(db.spaceId).runtimeEffect;
|
|
77
|
+
yield* Operation.invoke(AgentPrompt, {
|
|
78
|
+
prompt: promptRef,
|
|
79
|
+
input: {},
|
|
80
|
+
chat: Ref.make(chat),
|
|
81
|
+
}).pipe(
|
|
82
|
+
Effect.provide(runtime),
|
|
83
|
+
Effect.catchAll((error) => {
|
|
84
|
+
log.catch(error);
|
|
85
|
+
return Effect.void;
|
|
86
|
+
}),
|
|
87
|
+
);
|
|
88
|
+
return { object: chat };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const chatPath = getObjectPathFromObject(chat);
|
|
92
|
+
const pendingPromptText =
|
|
93
|
+
typeof prompt === 'string'
|
|
94
|
+
? prompt
|
|
95
|
+
: yield* Effect.gen(function* () {
|
|
96
|
+
const promptObj = yield* Effect.promise(() => prompt.load());
|
|
97
|
+
const source = yield* Effect.promise(() => promptObj.instructions.source.load());
|
|
98
|
+
invariant(Obj.instanceOf(Text.Text, source), 'Prompt template source must be Text.');
|
|
99
|
+
return Template.process(source.content ?? '');
|
|
100
|
+
});
|
|
101
|
+
yield* Capabilities.updateAtomValue(AssistantCapabilities.State, (current) => ({
|
|
102
|
+
...current,
|
|
103
|
+
pendingPrompts: { ...current.pendingPrompts, [chatPath]: pendingPromptText },
|
|
104
|
+
}));
|
|
105
|
+
yield* Operation.invoke(LayoutOperation.Open, { subject: [chatPath] });
|
|
106
|
+
return { object: chat };
|
|
107
|
+
},
|
|
108
|
+
(effect, { db }) => effect.pipe(Effect.provide(Database.layer(db))),
|
|
109
|
+
),
|
|
110
|
+
),
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
export default handler;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
|
+
|
|
11
|
+
import { AssistantCapabilities } from '../types';
|
|
12
|
+
import { CreateChat, SetCurrentChat } from './definitions';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof SetCurrentChat> = SetCurrentChat.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fnUntraced(function* ({ companionTo, chat }) {
|
|
17
|
+
const companionToId = Obj.getDXN(companionTo).toString();
|
|
18
|
+
|
|
19
|
+
if (chat) {
|
|
20
|
+
const chatId = Obj.getDXN(chat).toString();
|
|
21
|
+
yield* Capabilities.updateAtomValue(AssistantCapabilities.State, (current) => ({
|
|
22
|
+
...current,
|
|
23
|
+
currentChat: { ...current.currentChat, [companionToId]: chatId },
|
|
24
|
+
}));
|
|
25
|
+
} else {
|
|
26
|
+
// New thread: create a transient chat and cache it so the graph connector
|
|
27
|
+
// can resolve it immediately via the cache fallback tier.
|
|
28
|
+
const operationInvoker = yield* Capability.get(Capabilities.OperationInvoker);
|
|
29
|
+
const db = Obj.getDatabase(companionTo);
|
|
30
|
+
if (db) {
|
|
31
|
+
const { data } = yield* Effect.promise(() =>
|
|
32
|
+
operationInvoker.invokePromise(CreateChat, { db, addToSpace: false }),
|
|
33
|
+
);
|
|
34
|
+
if (data?.object) {
|
|
35
|
+
yield* Capabilities.updateAtomValue(AssistantCapabilities.CompanionChatCache, (current) => ({
|
|
36
|
+
...current,
|
|
37
|
+
[companionToId]: data.object,
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
yield* Capabilities.updateAtomValue(AssistantCapabilities.State, (current) => ({
|
|
42
|
+
...current,
|
|
43
|
+
currentChat: { ...current.currentChat, [companionToId]: undefined },
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
}),
|
|
47
|
+
),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export default handler;
|