@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,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,79 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Array from 'effect/Array';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import { describe, test } from 'vitest';
|
|
8
|
+
|
|
9
|
+
import { AgentPrompt, Chat } from '@dxos/assistant-toolkit';
|
|
10
|
+
import { Prompt } from '@dxos/blueprints';
|
|
11
|
+
import { Database, Feed, Filter, Ref } from '@dxos/echo';
|
|
12
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
13
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
14
|
+
import { ObjectId } from '@dxos/keys';
|
|
15
|
+
import { Operation } from '@dxos/operation';
|
|
16
|
+
import { AutomationPlugin } from '@dxos/plugin-automation/cli';
|
|
17
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation/types';
|
|
18
|
+
import { ClientPlugin } from '@dxos/plugin-client/cli';
|
|
19
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
20
|
+
import { ClientCapabilities } from '@dxos/plugin-client/types';
|
|
21
|
+
import { createComposerTestApp } from '@dxos/plugin-testing/harness';
|
|
22
|
+
import { Message } from '@dxos/types';
|
|
23
|
+
|
|
24
|
+
import { AssistantPlugin } from '../cli';
|
|
25
|
+
|
|
26
|
+
ObjectId.dangerouslyDisableRandomness();
|
|
27
|
+
|
|
28
|
+
describe('Agent prompt (composer plugin harness)', () => {
|
|
29
|
+
// Hits AutomationPlugin compute runtime (plugin handlers, AiServiceLayer, blueprints).
|
|
30
|
+
// Requires reachable edge AI (see repo DX_EDGE_AI_SERVICE_URL); not memoized like AssistantTestLayer tests.
|
|
31
|
+
test.runIf(TestHelpers.tagEnabled('llm'))(
|
|
32
|
+
'chat mode appends assistant messages to the chat queue',
|
|
33
|
+
async ({ expect }) => {
|
|
34
|
+
await using harness = await createComposerTestApp({
|
|
35
|
+
plugins: [ClientPlugin({}), AssistantPlugin(), AutomationPlugin()],
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const { personalSpace } = await runAndForwardErrors(initializeIdentity(harness.get(ClientCapabilities.Client)));
|
|
39
|
+
const computeProvider = await harness.waitForCapability(AutomationCapabilities.ComputeRuntime, {
|
|
40
|
+
timeout: 30_000,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
await computeProvider.getRuntime(personalSpace.id).runPromise(
|
|
44
|
+
Effect.gen(function* () {
|
|
45
|
+
const feed = yield* Database.add(Feed.make());
|
|
46
|
+
|
|
47
|
+
const messageCountBefore = yield* Feed.runQuery(feed, Filter.type(Message.Message)).pipe(
|
|
48
|
+
Effect.map(Array.length),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const chat = yield* Database.add(Chat.make({ feed: Ref.make(feed) }));
|
|
52
|
+
const prompt = yield* Database.add(
|
|
53
|
+
Prompt.make({
|
|
54
|
+
name: 'chat-mode-test',
|
|
55
|
+
instructions: 'Reply with a single word: ack.',
|
|
56
|
+
blueprints: [],
|
|
57
|
+
context: [],
|
|
58
|
+
}),
|
|
59
|
+
);
|
|
60
|
+
yield* Database.flush();
|
|
61
|
+
|
|
62
|
+
const result = yield* Operation.invoke(AgentPrompt, {
|
|
63
|
+
prompt: Ref.make(prompt),
|
|
64
|
+
input: {},
|
|
65
|
+
chat: Ref.make(chat),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const messageCountAfter = yield* Feed.runQuery(feed, Filter.type(Message.Message)).pipe(
|
|
69
|
+
Effect.map(Array.length),
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
expect(messageCountAfter).toBeGreaterThan(messageCountBefore);
|
|
73
|
+
expect(result).toBe('ack');
|
|
74
|
+
}),
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
60_000,
|
|
78
|
+
);
|
|
79
|
+
});
|
|
@@ -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;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as LanguageModel from '@effect/ai/LanguageModel';
|
|
6
|
+
import * as Prompt from '@effect/ai/Prompt';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
|
|
9
|
+
import { AiPreprocessor, AiService } from '@dxos/ai';
|
|
10
|
+
import { Database, Feed, Filter, Obj } from '@dxos/echo';
|
|
11
|
+
import { log } from '@dxos/log';
|
|
12
|
+
import { Operation } from '@dxos/operation';
|
|
13
|
+
import { Message } from '@dxos/types';
|
|
14
|
+
import { trim } from '@dxos/util';
|
|
15
|
+
|
|
16
|
+
import { UpdateChatName } from './definitions';
|
|
17
|
+
|
|
18
|
+
const handler: Operation.WithHandler<typeof UpdateChatName> = UpdateChatName.pipe(
|
|
19
|
+
Operation.withHandler(
|
|
20
|
+
Effect.fnUntraced(
|
|
21
|
+
function* ({ chat }) {
|
|
22
|
+
log.info('updating chat name', { chat });
|
|
23
|
+
|
|
24
|
+
const feed = yield* Database.load(chat.feed);
|
|
25
|
+
const history = yield* Feed.runQuery(feed, Filter.type(Message.Message));
|
|
26
|
+
|
|
27
|
+
log.info('history', { history: history.length });
|
|
28
|
+
|
|
29
|
+
const system = trim`
|
|
30
|
+
It is extremely important that you respond only with the title and nothing else.
|
|
31
|
+
Do not use markdown or other formatting.
|
|
32
|
+
If you cannot do this effectively respond with "New Chat".
|
|
33
|
+
|
|
34
|
+
<example_reply>
|
|
35
|
+
Fishing Trip
|
|
36
|
+
</example_reply>
|
|
37
|
+
`;
|
|
38
|
+
const prompt = 'Suggest a name for this chat';
|
|
39
|
+
|
|
40
|
+
const historyPrompt = yield* AiPreprocessor.preprocessPrompt(history, {
|
|
41
|
+
system,
|
|
42
|
+
cacheControl: 'ephemeral',
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const response = yield* LanguageModel.generateText({
|
|
46
|
+
prompt: Prompt.merge(historyPrompt, prompt),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const newName = response.text.replaceAll(/[^a-zA-Z0-9\s]/g, '').trim();
|
|
50
|
+
|
|
51
|
+
Obj.change(chat, (chat) => {
|
|
52
|
+
chat.name = newName;
|
|
53
|
+
});
|
|
54
|
+
log.info('chat name updated', { chat, newName: chat.name });
|
|
55
|
+
},
|
|
56
|
+
Effect.provide(AiService.model('@anthropic/claude-haiku-4-5')),
|
|
57
|
+
),
|
|
58
|
+
),
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
export default handler;
|
package/src/processor/presets.ts
CHANGED
|
@@ -6,7 +6,7 @@ import * as Schema from 'effect/Schema';
|
|
|
6
6
|
|
|
7
7
|
import { type ModelName } from '@dxos/ai';
|
|
8
8
|
|
|
9
|
-
const ModelProviders = ['dxos-local', 'dxos-remote', 'lm-studio'] as const;
|
|
9
|
+
const ModelProviders = ['dxos-local', 'dxos-remote', 'lm-studio', 'ollama'] as const;
|
|
10
10
|
|
|
11
11
|
const ModelProvider = Schema.Literal(...ModelProviders);
|
|
12
12
|
type ModelProvider = Schema.Schema.Type<typeof ModelProvider>;
|
|
@@ -27,23 +27,31 @@ const createModelLabel = (model: ModelName) => {
|
|
|
27
27
|
export const AiServicePresets: AiServicePreset[] = [
|
|
28
28
|
{
|
|
29
29
|
provider: 'dxos-remote' as const,
|
|
30
|
-
model: '@anthropic/claude-opus-4-
|
|
30
|
+
model: '@anthropic/claude-opus-4-6' as const,
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
provider: 'dxos-remote' as const,
|
|
34
|
-
model: '@anthropic/claude-sonnet-4-
|
|
34
|
+
model: '@anthropic/claude-sonnet-4-5' as const,
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
provider: 'dxos-remote' as const,
|
|
38
38
|
model: '@anthropic/claude-3-5-haiku-20241022' as const,
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
provider: 'ollama' as const,
|
|
42
|
+
model: 'gpt-oss:20b' as const,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
provider: 'ollama' as const,
|
|
46
|
+
model: 'gemma4:latest' as const,
|
|
47
|
+
},
|
|
40
48
|
{
|
|
41
49
|
provider: 'lm-studio' as const,
|
|
42
50
|
model: '@google/gemma-3-27b' as const,
|
|
43
51
|
},
|
|
44
52
|
{
|
|
45
53
|
provider: 'lm-studio' as const,
|
|
46
|
-
model: '@
|
|
54
|
+
model: '@meta/llama-3.2-3b-instruct' as const,
|
|
47
55
|
},
|
|
48
56
|
{
|
|
49
57
|
model: 'deepseek-r1:latest' as const,
|
|
@@ -2,80 +2,39 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Tool from '@effect/ai/Tool';
|
|
6
|
-
import * as Toolkit from '@effect/ai/Toolkit';
|
|
7
5
|
import { describe, it } from '@effect/vitest';
|
|
8
6
|
import * as Effect from 'effect/Effect';
|
|
9
|
-
import * as
|
|
10
|
-
import * as Schema from 'effect/Schema';
|
|
7
|
+
import * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
11
8
|
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
CredentialsService,
|
|
19
|
-
FunctionInvocationService,
|
|
20
|
-
QueueService,
|
|
21
|
-
TracingService,
|
|
22
|
-
} from '@dxos/functions';
|
|
23
|
-
import { TestDatabaseLayer } from '@dxos/functions/testing';
|
|
24
|
-
import { type DataType } from '@dxos/schema';
|
|
9
|
+
import { AiSession } from '@dxos/assistant';
|
|
10
|
+
import { Chat } from '@dxos/assistant-toolkit';
|
|
11
|
+
import { AssistantTestLayer } from '@dxos/assistant/testing';
|
|
12
|
+
import { Database, Feed } from '@dxos/echo';
|
|
13
|
+
import { acquireReleaseResource } from '@dxos/effect';
|
|
14
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
25
15
|
|
|
26
|
-
import { AiChatProcessor
|
|
16
|
+
import { AiChatProcessor } from './processor';
|
|
27
17
|
|
|
28
|
-
|
|
29
|
-
Tool.make('random', {
|
|
30
|
-
description: 'Random number generator',
|
|
31
|
-
parameters: {},
|
|
32
|
-
success: Schema.Number,
|
|
33
|
-
}),
|
|
34
|
-
) {}
|
|
18
|
+
const TestLayer = AssistantTestLayer({ tracing: 'noop', types: [Chat.Chat, Feed.Feed] });
|
|
35
19
|
|
|
36
|
-
// TODO(burdon): Create minimal toolkit.
|
|
37
|
-
const toolkit = Toolkit.merge(TestToolkit) as Toolkit.Toolkit<any>;
|
|
38
|
-
|
|
39
|
-
// TODO(burdon): Explain structure.
|
|
40
|
-
const TestServicesLayer = Layer.mergeAll(
|
|
41
|
-
TracingService.layerNoop,
|
|
42
|
-
AiServiceTestingPreset('direct'),
|
|
43
|
-
TestDatabaseLayer({
|
|
44
|
-
// indexing: { vector: true },
|
|
45
|
-
// types: [],
|
|
46
|
-
}),
|
|
47
|
-
// CredentialsService.configuredLayer([{ service: 'exa.ai', apiKey: EXA_API_KEY }]),
|
|
48
|
-
FunctionInvocationService.layerTestMocked({ functions: [] }).pipe(
|
|
49
|
-
Layer.provideMerge(ComputeEventLogger.layerFromTracing),
|
|
50
|
-
Layer.provideMerge(TracingService.layerNoop),
|
|
51
|
-
),
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
const TestLayer: Layer.Layer<AiChatServices, never, never> = Layer.mergeAll(
|
|
55
|
-
AiService.model('@anthropic/claude-opus-4-0'),
|
|
56
|
-
makeToolResolverFromFunctions([], toolkit),
|
|
57
|
-
makeToolExecutionServiceFromFunctions(toolkit, toolkit.toLayer({}) as any),
|
|
58
|
-
CredentialsService.layerFromDatabase(),
|
|
59
|
-
ComputeEventLogger.layerFromTracing,
|
|
60
|
-
).pipe(Layer.provideMerge(TestServicesLayer), Layer.orDie);
|
|
61
|
-
|
|
62
|
-
// TODO(burdon): Create actual test with mock LLM.
|
|
63
20
|
describe('Chat processor', () => {
|
|
64
21
|
it.scoped(
|
|
65
22
|
'basic',
|
|
66
23
|
Effect.fn(
|
|
67
24
|
function* ({ expect }) {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
25
|
+
const feed = Feed.make();
|
|
26
|
+
yield* Database.add(feed);
|
|
27
|
+
const runtime = yield* Effect.runtime<Feed.FeedService>();
|
|
28
|
+
const session = yield* acquireReleaseResource(() => new AiSession({ feed, runtime }));
|
|
29
|
+
const managedRuntime = ManagedRuntime.make(
|
|
30
|
+
Effect.runSync(Effect.map(Effect.context<never>(), () => undefined as any)) as any,
|
|
31
|
+
);
|
|
32
|
+
const processor = new AiChatProcessor(session, managedRuntime as any, feed);
|
|
33
|
+
expect(processor).toBeDefined();
|
|
34
|
+
expect(processor.active).toBeDefined();
|
|
76
35
|
},
|
|
77
36
|
Effect.provide(TestLayer),
|
|
78
|
-
TestHelpers.
|
|
37
|
+
TestHelpers.provideTestContext,
|
|
79
38
|
),
|
|
80
39
|
);
|
|
81
40
|
});
|