@dxos/plugin-assistant 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe
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 +3 -7
- 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-RUV2WOQH.mjs +154 -0
- package/dist/lib/browser/chunk-RUV2WOQH.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-FR4AWZ2P.mjs +65 -0
- package/dist/lib/browser/ensure-companion-chat-FR4AWZ2P.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3163 -245
- 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-4YQ37XIS.mjs +136 -0
- package/dist/lib/browser/run-prompt-in-new-chat-4YQ37XIS.mjs.map +7 -0
- package/dist/lib/browser/set-current-chat-WJI3WAVM.mjs +54 -0
- package/dist/lib/browser/set-current-chat-WJI3WAVM.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -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 +3 -7
- 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-PY4X6FJT.mjs +155 -0
- package/dist/lib/node-esm/chunk-PY4X6FJT.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-BLP7NT32.mjs +66 -0
- package/dist/lib/node-esm/ensure-companion-chat-BLP7NT32.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3163 -245
- 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-2IJBSDTM.mjs +137 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-2IJBSDTM.mjs.map +7 -0
- package/dist/lib/node-esm/set-current-chat-KBMMZULR.mjs +55 -0
- package/dist/lib/node-esm/set-current-chat-KBMMZULR.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -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.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 +1 -6
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +6 -0
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- 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 +7 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +41 -11
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +13 -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 +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +4 -3
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- 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 +6 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -6
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts +553 -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 +15 -11
- package/dist/types/src/components/Chat/Chat.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.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +3 -3
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +535 -303
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +573 -0
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +6 -5
- 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 +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 +553 -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 +5 -4
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +529 -295
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +529 -295
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +0 -9
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +10 -8
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +529 -295
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +2 -2
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -12
- 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 +554 -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 +554 -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 +559 -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 +6 -0
- package/dist/types/src/containers/TracePanel/TracePanel.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/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/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +7 -6
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +3 -6
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +2 -2
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
- 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 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -0
- 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 +0 -1
- package/dist/types/src/processor/index.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +33 -28
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- 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/translations.d.ts +529 -295
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +17 -39
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +10 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +11 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +120 -92
- package/src/AssistantPlugin.tsx +148 -52
- package/src/blueprints/assistant/blueprint.conversations.json +1 -0
- 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/blueprints/index.ts +1 -8
- package/src/capabilities/{ai-service/ai-service.ts → ai-service.ts} +4 -3
- package/src/capabilities/app-graph-builder.ts +217 -0
- package/src/capabilities/blueprint-definition.ts +58 -0
- package/src/capabilities/companion-chat-provisioner.ts +164 -0
- package/src/capabilities/{edge-model-resolver/edge-model-resolver.ts → edge-model-resolver.ts} +4 -3
- package/src/capabilities/index.ts +22 -11
- package/src/capabilities/{local-model-resolver/local-model-resolver.ts → local-model-resolver.ts} +4 -3
- package/src/capabilities/markdown.ts +40 -0
- package/src/capabilities/migrations.ts +34 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +157 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +5 -4
- package/src/capabilities/{state/state.ts → state.ts} +11 -3
- package/src/capabilities/toolkit.ts +13 -0
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +34 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +104 -92
- package/src/components/AssistantSettings/index.ts +2 -2
- package/src/components/Chat/Chat.tsx +88 -45
- package/src/components/ChatProgress/ChatProgress.tsx +9 -7
- package/src/components/ChatPrompt/ChatActions.tsx +25 -5
- package/src/components/ChatPrompt/ChatOptions.tsx +43 -29
- package/src/components/ChatPrompt/ChatReferences.tsx +18 -8
- package/src/components/ChatThread/ChatThread.stories.tsx +31 -48
- package/src/components/ChatThread/ChatThread.tsx +28 -17
- package/src/components/ChatThread/Link.tsx +1 -1
- package/src/components/ChatThread/MarkdownStream.stories.tsx +243 -0
- package/src/components/ChatThread/registry.tsx +107 -43
- package/src/components/ChatThread/sync.test.ts +13 -10
- package/src/components/ChatThread/sync.ts +43 -32
- 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.md → thread-2.md} +19 -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 +85 -0
- package/src/components/ProcessTree/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +4 -9
- package/src/components/TemplateEditor/TemplateEditor.tsx +50 -42
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +7 -6
- package/src/components/TemplateEditor/TemplateForm.tsx +9 -10
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +4 -4
- package/src/components/ToolBlock/ToolBlock.tsx +21 -20
- package/src/components/Toolbox/Toolbox.stories.tsx +4 -6
- package/src/components/Toolbox/Toolbox.tsx +66 -60
- package/src/components/Typewriter/AssistantToolbar.tsx +7 -7
- package/src/components/Typewriter/Typewriter.stories.tsx +18 -15
- package/src/components/Typewriter/Typewriter.tsx +6 -10
- package/src/components/Typewriter/assistant-extension.tsx +5 -8
- package/src/components/index.ts +3 -7
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +105 -0
- package/src/containers/AgentArticle/AgentArticle.tsx +157 -0
- package/src/containers/AgentArticle/index.ts +5 -0
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +91 -0
- package/src/containers/AgentProperties/AgentProperties.tsx +169 -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/{components → containers/ChatCompanion}/ChatCompanion.tsx +23 -44
- 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 +10 -12
- 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.tsx +361 -0
- package/src/containers/TracePanel/dxn-extractor.test.ts +153 -0
- package/src/containers/TracePanel/dxn-extractor.ts +178 -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/useBlueprintRegistry.ts +8 -4
- package/src/hooks/useChatProcessor.ts +30 -17
- package/src/hooks/useChatServices.ts +7 -28
- package/src/hooks/useChatToolbarActions.ts +13 -12
- package/src/hooks/useContextBinder.ts +17 -6
- package/src/hooks/useContextObjects.ts +8 -4
- package/src/hooks/useFilteredTypes.ts +3 -3
- package/src/hooks/usePresets.ts +2 -1
- package/src/hooks/useReferencesProvider.ts +1 -5
- package/src/index.ts +1 -1
- package/src/meta.ts +6 -3
- 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 +0 -1
- package/src/processor/presets.ts +2 -2
- package/src/processor/processor.test.ts +18 -50
- package/src/processor/processor.ts +190 -129
- package/src/queue-logger.ts +2 -2
- package/src/testing/test-generator.ts +45 -14
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +2 -2
- package/src/translations.ts +134 -83
- package/src/types/Assistant.ts +8 -56
- package/src/types/Settings.ts +21 -0
- package/src/types/capabilities.ts +11 -3
- package/src/types/events.ts +2 -2
- package/src/types/index.ts +3 -1
- package/src/types/service.ts +5 -5
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs +0 -31
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-GFSJZTOT.mjs +0 -153
- package/dist/lib/browser/ChatCompanion-GFSJZTOT.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-IHAPBIZE.mjs +0 -72
- package/dist/lib/browser/ChatContainer-IHAPBIZE.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-EGRMPCTL.mjs +0 -85
- package/dist/lib/browser/ChatDialog-EGRMPCTL.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs +0 -53
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs.map +0 -7
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs +0 -21
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs +0 -212
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs +0 -14
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs.map +0 -7
- package/dist/lib/browser/chunk-A75V4MOQ.mjs +0 -1832
- package/dist/lib/browser/chunk-A75V4MOQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-DKQMSMBN.mjs +0 -326
- package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +0 -7
- package/dist/lib/browser/chunk-EXVT7D4B.mjs +0 -23
- package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +0 -7
- package/dist/lib/browser/chunk-ML3QCFKA.mjs +0 -265
- package/dist/lib/browser/chunk-ML3QCFKA.mjs.map +0 -7
- package/dist/lib/browser/chunk-MRJVYGLU.mjs +0 -208
- package/dist/lib/browser/chunk-MRJVYGLU.mjs.map +0 -7
- package/dist/lib/browser/chunk-V772AMZM.mjs +0 -250
- package/dist/lib/browser/chunk-V772AMZM.mjs.map +0 -7
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs +0 -41
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs +0 -20
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs +0 -19
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs +0 -132
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs.map +0 -7
- package/dist/lib/browser/react-surface-S7SBFOSW.mjs +0 -109
- package/dist/lib/browser/react-surface-S7SBFOSW.mjs.map +0 -7
- package/dist/lib/browser/repair-6QGAKOVM.mjs +0 -54
- package/dist/lib/browser/repair-6QGAKOVM.mjs.map +0 -7
- package/dist/lib/browser/settings-4ZDLUMYE.mjs +0 -32
- package/dist/lib/browser/settings-4ZDLUMYE.mjs.map +0 -7
- package/dist/lib/browser/state-AN6336ZX.mjs +0 -26
- package/dist/lib/browser/state-AN6336ZX.mjs.map +0 -7
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs +0 -18
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs +0 -32
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-UR7DXZ54.mjs +0 -154
- package/dist/lib/node-esm/ChatCompanion-UR7DXZ54.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-YMLLGOZK.mjs +0 -73
- package/dist/lib/node-esm/ChatContainer-YMLLGOZK.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-D24WJPK4.mjs +0 -86
- package/dist/lib/node-esm/ChatDialog-D24WJPK4.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs +0 -54
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs +0 -22
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs +0 -213
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs +0 -15
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-355W5B27.mjs +0 -251
- package/dist/lib/node-esm/chunk-355W5B27.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4BERCIES.mjs +0 -1833
- package/dist/lib/node-esm/chunk-4BERCIES.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs +0 -327
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs +0 -209
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs +0 -42
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs +0 -25
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs +0 -267
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs +0 -21
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs +0 -20
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs +0 -133
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ZR6FXGLF.mjs +0 -110
- package/dist/lib/node-esm/react-surface-ZR6FXGLF.mjs.map +0 -7
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs +0 -55
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs.map +0 -7
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs +0 -33
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs.map +0 -7
- package/dist/lib/node-esm/state-HDON4REW.mjs +0 -27
- package/dist/lib/node-esm/state-HDON4REW.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs +0 -19
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs.map +0 -7
- package/dist/types/src/blueprints/assistant-blueprint.d.ts +0 -209
- package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +0 -1
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts +0 -5
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +0 -1
- package/dist/types/src/capabilities/ai-service/index.d.ts +0 -3
- package/dist/types/src/capabilities/ai-service/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -21
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -4
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +0 -6
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +0 -12
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/index.d.ts +0 -3
- package/dist/types/src/capabilities/repair/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/repair.d.ts +0 -6
- package/dist/types/src/capabilities/repair/repair.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -15
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -11
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts +0 -13
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts +0 -3
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +0 -5
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +0 -7
- package/dist/types/src/components/BlueprintArticle.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 -19
- 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/PromptArticle.d.ts +0 -7
- package/dist/types/src/components/PromptArticle.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/object-list.d.ts +0 -10
- package/dist/types/src/functions/object-list.d.ts.map +0 -1
- package/dist/types/src/functions/object-load.d.ts +0 -8
- package/dist/types/src/functions/object-load.d.ts.map +0 -1
- package/dist/types/src/functions/object-search.d.ts +0 -10
- package/dist/types/src/functions/object-search.d.ts.map +0 -1
- package/dist/types/src/processor/update-name.d.ts +0 -10
- package/dist/types/src/processor/update-name.d.ts.map +0 -1
- package/dist/types/src/types/AssistantAction.d.ts +0 -95
- package/dist/types/src/types/AssistantAction.d.ts.map +0 -1
- package/src/blueprints/assistant-blueprint.ts +0 -62
- package/src/capabilities/ai-service/index.ts +0 -7
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -180
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -60
- package/src/capabilities/blueprint-definition/index.ts +0 -8
- package/src/capabilities/edge-model-resolver/index.ts +0 -7
- package/src/capabilities/local-model-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -110
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -95
- package/src/capabilities/repair/index.ts +0 -7
- package/src/capabilities/repair/repair.ts +0 -63
- package/src/capabilities/settings/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/capabilities/toolkit/index.ts +0 -7
- package/src/capabilities/toolkit/toolkit.ts +0 -26
- package/src/components/BlueprintArticle.tsx +0 -29
- package/src/components/ChatContainer.tsx +0 -61
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/components/PromptArticle.tsx +0 -50
- package/src/functions/index.ts +0 -7
- package/src/functions/object-list.ts +0 -49
- package/src/functions/object-load.ts +0 -47
- package/src/functions/object-search.ts +0 -46
- package/src/processor/update-name.ts +0 -59
- package/src/types/AssistantAction.ts +0 -75
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
8
|
-
import { Prompt } from '@dxos/blueprints';
|
|
9
|
-
import { Sequence } from '@dxos/conductor';
|
|
10
|
-
import { DXN, type Database, Obj, type Ref } from '@dxos/echo';
|
|
11
|
-
import { AtomObj } from '@dxos/echo-atom';
|
|
12
|
-
import { invariant } from '@dxos/invariant';
|
|
13
|
-
import { Operation, type OperationInvoker } from '@dxos/operation';
|
|
14
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
15
|
-
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
16
|
-
import { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
|
|
17
|
-
import { getActiveSpace } from '@dxos/plugin-space';
|
|
18
|
-
import { SpaceOperation } from '@dxos/plugin-space/types';
|
|
19
|
-
import { Query } from '@dxos/react-client/echo';
|
|
20
|
-
|
|
21
|
-
import { ASSISTANT_DIALOG, meta } from '../../meta';
|
|
22
|
-
import { Assistant, AssistantCapabilities, AssistantOperation } from '../../types';
|
|
23
|
-
|
|
24
|
-
export default Capability.makeModule(
|
|
25
|
-
Effect.fnUntraced(function* () {
|
|
26
|
-
const capabilities = yield* Capability.Service;
|
|
27
|
-
|
|
28
|
-
const extensions = yield* Effect.all([
|
|
29
|
-
GraphBuilder.createTypeExtension({
|
|
30
|
-
id: `${meta.id}/root`,
|
|
31
|
-
type: Assistant.Chat,
|
|
32
|
-
actions: (chat) => {
|
|
33
|
-
const id = Obj.getDXN(chat).toString();
|
|
34
|
-
return Effect.succeed([
|
|
35
|
-
{
|
|
36
|
-
id: `${AssistantOperation.UpdateChatName.meta.key}/${id}`,
|
|
37
|
-
data: () => Operation.invoke(AssistantOperation.UpdateChatName, { chat }),
|
|
38
|
-
properties: {
|
|
39
|
-
label: ['chat update name label', { ns: meta.id }],
|
|
40
|
-
icon: 'ph--magic-wand--regular',
|
|
41
|
-
disposition: 'list-item',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
]);
|
|
45
|
-
},
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
GraphBuilder.createExtension({
|
|
49
|
-
id: `${meta.id}/assistant`,
|
|
50
|
-
match: NodeMatcher.whenRoot,
|
|
51
|
-
actions: () =>
|
|
52
|
-
Effect.succeed([
|
|
53
|
-
{
|
|
54
|
-
id: `${Common.LayoutOperation.UpdateDialog.meta.key}/assistant/open`,
|
|
55
|
-
data: Effect.fnUntraced(function* () {
|
|
56
|
-
const capabilities = yield* Capability.Service;
|
|
57
|
-
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
58
|
-
const operationInvoker = yield* Capability.get(Common.Capability.OperationInvoker);
|
|
59
|
-
const space = getActiveSpace(capabilities) ?? client.spaces.default;
|
|
60
|
-
const chat = yield* Effect.tryPromise(() => getOrCreateChat(operationInvoker.invokePromise, space.db));
|
|
61
|
-
if (!chat) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
yield* Operation.invoke(Common.LayoutOperation.UpdateDialog, {
|
|
66
|
-
subject: ASSISTANT_DIALOG,
|
|
67
|
-
state: true,
|
|
68
|
-
blockAlign: 'end',
|
|
69
|
-
props: {
|
|
70
|
-
chat,
|
|
71
|
-
},
|
|
72
|
-
});
|
|
73
|
-
}),
|
|
74
|
-
properties: {
|
|
75
|
-
label: ['open assistant label', { ns: meta.id }],
|
|
76
|
-
icon: 'ph--sparkle--regular',
|
|
77
|
-
disposition: 'pin-end',
|
|
78
|
-
position: 'hoist',
|
|
79
|
-
keyBinding: {
|
|
80
|
-
macos: 'shift+meta+k',
|
|
81
|
-
windows: 'shift+ctrl+k',
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
]),
|
|
86
|
-
}),
|
|
87
|
-
|
|
88
|
-
GraphBuilder.createExtension({
|
|
89
|
-
id: `${meta.id}/companion-chat`,
|
|
90
|
-
match: NodeMatcher.whenEchoObject,
|
|
91
|
-
connector: (object, get) =>
|
|
92
|
-
Effect.gen(function* () {
|
|
93
|
-
const state = get(yield* Capability.get(AssistantCapabilities.State));
|
|
94
|
-
const currentChatState = state.currentChat[Obj.getDXN(object).toString()];
|
|
95
|
-
// If no state, continue to allow chat initialization.
|
|
96
|
-
if (!currentChatState) {
|
|
97
|
-
return [
|
|
98
|
-
{
|
|
99
|
-
id: [Obj.getDXN(object).toString(), 'assistant-chat'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
100
|
-
type: PLANK_COMPANION_TYPE,
|
|
101
|
-
data: 'assistant-chat',
|
|
102
|
-
properties: {
|
|
103
|
-
label: ['assistant chat label', { ns: meta.id }],
|
|
104
|
-
icon: 'ph--sparkle--regular',
|
|
105
|
-
position: 'hoist',
|
|
106
|
-
disposition: 'hidden',
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
];
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const db = Obj.getDatabase(object);
|
|
113
|
-
const currentChatDxn = DXN.tryParse(currentChatState);
|
|
114
|
-
const currentChatRef = currentChatDxn ? db?.makeRef(currentChatDxn) : undefined;
|
|
115
|
-
const currentChat = currentChatRef ? get(AtomObj.make(currentChatRef as Ref.Ref<Obj.Unknown>)) : undefined;
|
|
116
|
-
if (!Obj.isObject(currentChat)) {
|
|
117
|
-
return [];
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return [
|
|
121
|
-
{
|
|
122
|
-
id: [Obj.getDXN(object).toString(), 'assistant-chat'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
123
|
-
type: PLANK_COMPANION_TYPE,
|
|
124
|
-
data: currentChat,
|
|
125
|
-
properties: {
|
|
126
|
-
label: ['assistant chat label', { ns: meta.id }],
|
|
127
|
-
icon: 'ph--sparkle--regular',
|
|
128
|
-
position: 'hoist',
|
|
129
|
-
disposition: 'hidden',
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
];
|
|
133
|
-
}),
|
|
134
|
-
}),
|
|
135
|
-
|
|
136
|
-
GraphBuilder.createExtension({
|
|
137
|
-
id: `${meta.id}/invocations`,
|
|
138
|
-
match: NodeMatcher.whenAny(
|
|
139
|
-
NodeMatcher.whenEchoTypeMatches(Sequence),
|
|
140
|
-
NodeMatcher.whenEchoTypeMatches(Prompt.Prompt),
|
|
141
|
-
),
|
|
142
|
-
connector: (node) =>
|
|
143
|
-
Effect.succeed([
|
|
144
|
-
{
|
|
145
|
-
id: [node.id, 'invocations'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
146
|
-
type: PLANK_COMPANION_TYPE,
|
|
147
|
-
data: 'invocations',
|
|
148
|
-
properties: {
|
|
149
|
-
label: ['invocations label', { ns: meta.id }],
|
|
150
|
-
icon: 'ph--clock-countdown--regular',
|
|
151
|
-
disposition: 'hidden',
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
]),
|
|
155
|
-
}),
|
|
156
|
-
]);
|
|
157
|
-
|
|
158
|
-
return Capability.contributes(Common.Capability.AppGraphBuilder, extensions);
|
|
159
|
-
}),
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
// TODO(burdon): Factor out.
|
|
163
|
-
const getOrCreateChat = async (
|
|
164
|
-
invokePromise: OperationInvoker.OperationInvoker['invokePromise'],
|
|
165
|
-
db: Database.Database,
|
|
166
|
-
): Promise<Assistant.Chat | undefined> => {
|
|
167
|
-
// TODO(wittjosiah): This should be possible with a single query.
|
|
168
|
-
const allChats = await db.query(Query.type(Assistant.Chat)).run();
|
|
169
|
-
const relatedChats = await db.query(Query.type(Assistant.Chat).sourceOf(Assistant.CompanionTo).source()).run();
|
|
170
|
-
|
|
171
|
-
const chats = allChats.filter((chat) => !relatedChats.includes(chat));
|
|
172
|
-
if (chats.length > 0) {
|
|
173
|
-
return chats.at(-1);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
const { data } = await invokePromise(AssistantOperation.CreateChat, { db });
|
|
177
|
-
invariant(Obj.instanceOf(Assistant.Chat, data?.object));
|
|
178
|
-
await invokePromise(SpaceOperation.AddObject, { target: db, object: data.object });
|
|
179
|
-
return data.object;
|
|
180
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
9
|
-
Agent,
|
|
10
|
-
Discord,
|
|
11
|
-
DiscordBlueprint,
|
|
12
|
-
EntityExtraction,
|
|
13
|
-
Linear,
|
|
14
|
-
LinearBlueprint,
|
|
15
|
-
Research,
|
|
16
|
-
ResearchBlueprint,
|
|
17
|
-
WebSearchBlueprint,
|
|
18
|
-
} from '@dxos/assistant-toolkit';
|
|
19
|
-
import { type Blueprint } from '@dxos/blueprints';
|
|
20
|
-
|
|
21
|
-
import { AssistantBlueprint } from '../../blueprints';
|
|
22
|
-
|
|
23
|
-
export const createBlueprint: () => Blueprint.Blueprint = AssistantBlueprint.make;
|
|
24
|
-
export { AssistantBlueprint };
|
|
25
|
-
|
|
26
|
-
export type BlueprintCapabilities = [
|
|
27
|
-
Capability.Capability<typeof Common.Capability.Functions>,
|
|
28
|
-
Capability.Capability<typeof Common.Capability.BlueprintDefinition>,
|
|
29
|
-
Capability.Capability<typeof Common.Capability.Functions>,
|
|
30
|
-
Capability.Capability<typeof Common.Capability.BlueprintDefinition>,
|
|
31
|
-
Capability.Capability<typeof Common.Capability.Functions>,
|
|
32
|
-
Capability.Capability<typeof Common.Capability.BlueprintDefinition>,
|
|
33
|
-
Capability.Capability<typeof Common.Capability.Functions>,
|
|
34
|
-
Capability.Capability<typeof Common.Capability.BlueprintDefinition>,
|
|
35
|
-
Capability.Capability<typeof Common.Capability.Functions>,
|
|
36
|
-
Capability.Capability<typeof Common.Capability.BlueprintDefinition>,
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
export default Capability.makeModule<[], BlueprintCapabilities>(() =>
|
|
40
|
-
Effect.succeed([
|
|
41
|
-
Capability.contributes(Common.Capability.Functions, AssistantBlueprint.functions$),
|
|
42
|
-
Capability.contributes(Common.Capability.BlueprintDefinition, AssistantBlueprint.blueprint),
|
|
43
|
-
|
|
44
|
-
// TODO(burdon): Factor out.
|
|
45
|
-
Capability.contributes(Common.Capability.Functions, [Research.create, Research.research]),
|
|
46
|
-
Capability.contributes(Common.Capability.BlueprintDefinition, ResearchBlueprint),
|
|
47
|
-
|
|
48
|
-
// TODO(burdon): Factor out.
|
|
49
|
-
Capability.contributes(Common.Capability.Functions, [Agent.prompt, EntityExtraction.extract]),
|
|
50
|
-
Capability.contributes(Common.Capability.BlueprintDefinition, WebSearchBlueprint),
|
|
51
|
-
|
|
52
|
-
// TODO(burdon): Factor out.
|
|
53
|
-
Capability.contributes(Common.Capability.Functions, [Discord.fetch]),
|
|
54
|
-
Capability.contributes(Common.Capability.BlueprintDefinition, DiscordBlueprint),
|
|
55
|
-
|
|
56
|
-
// TODO(burdon): Factor out.
|
|
57
|
-
Capability.contributes(Common.Capability.Functions, [Linear.sync]),
|
|
58
|
-
Capability.contributes(Common.Capability.BlueprintDefinition, LinearBlueprint),
|
|
59
|
-
]),
|
|
60
|
-
);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capability } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
8
|
-
export { AssistantBlueprint } from './blueprint-definition';
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
8
|
-
import { AiContextBinder, AiConversation } from '@dxos/assistant';
|
|
9
|
-
import { Agent } from '@dxos/assistant-toolkit';
|
|
10
|
-
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
11
|
-
import { type Queue } from '@dxos/client/echo';
|
|
12
|
-
import { Filter, Obj, Ref, Type } from '@dxos/echo';
|
|
13
|
-
import { TracingService, serializeFunction } from '@dxos/functions';
|
|
14
|
-
import { invariant } from '@dxos/invariant';
|
|
15
|
-
import { Operation, OperationResolver } from '@dxos/operation';
|
|
16
|
-
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
17
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
18
|
-
import { Collection } from '@dxos/schema';
|
|
19
|
-
import { type Message } from '@dxos/types';
|
|
20
|
-
|
|
21
|
-
import { type AiChatServices, updateName } from '../../processor';
|
|
22
|
-
import { Assistant, AssistantCapabilities, AssistantOperation } from '../../types';
|
|
23
|
-
import { AssistantBlueprint, createBlueprint } from '../blueprint-definition/blueprint-definition';
|
|
24
|
-
|
|
25
|
-
export default Capability.makeModule(
|
|
26
|
-
Effect.fnUntraced(function* () {
|
|
27
|
-
return Capability.contributes(Common.Capability.OperationResolver, [
|
|
28
|
-
OperationResolver.make({
|
|
29
|
-
operation: AssistantOperation.OnCreateSpace,
|
|
30
|
-
handler: Effect.fnUntraced(function* ({ space, rootCollection }) {
|
|
31
|
-
const chatCollection = Collection.makeManaged({ key: Assistant.Chat.typename });
|
|
32
|
-
const blueprintCollection = Collection.makeManaged({ key: Blueprint.Blueprint.typename });
|
|
33
|
-
const promptCollection = Collection.makeManaged({ key: Type.getTypename(Prompt.Prompt) });
|
|
34
|
-
Obj.change(rootCollection, (c) => {
|
|
35
|
-
c.objects.push(Ref.make(chatCollection), Ref.make(blueprintCollection), Ref.make(promptCollection));
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// TODO(wittjosiah): Remove once function registry is avaiable.
|
|
39
|
-
space.db.add(serializeFunction(Agent.prompt));
|
|
40
|
-
|
|
41
|
-
// Create default chat.
|
|
42
|
-
const { object: chat } = yield* Operation.invoke(AssistantOperation.CreateChat, { db: space.db });
|
|
43
|
-
space.db.add(chat);
|
|
44
|
-
}),
|
|
45
|
-
}),
|
|
46
|
-
OperationResolver.make({
|
|
47
|
-
operation: AssistantOperation.CreateChat,
|
|
48
|
-
handler: Effect.fnUntraced(function* ({ db, name }) {
|
|
49
|
-
const registry = yield* Capability.get(Common.Capability.AtomRegistry);
|
|
50
|
-
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
51
|
-
const space = client.spaces.get(db.spaceId);
|
|
52
|
-
invariant(space, 'Space not found');
|
|
53
|
-
const queue = space.queues.create();
|
|
54
|
-
const chat = Assistant.make({ name, queue: Ref.fromDXN(queue.dxn) });
|
|
55
|
-
space.db.add(chat);
|
|
56
|
-
|
|
57
|
-
// TODO(wittjosiah): This should be a space-level setting.
|
|
58
|
-
// TODO(burdon): Clone when activated. Copy-on-write for template.
|
|
59
|
-
const blueprints = yield* Effect.promise(() => db.query(Filter.type(Blueprint.Blueprint)).run());
|
|
60
|
-
let defaultBlueprint = blueprints.find((blueprint) => blueprint.key === AssistantBlueprint.Key);
|
|
61
|
-
if (!defaultBlueprint) {
|
|
62
|
-
defaultBlueprint = db.add(createBlueprint());
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const binder = new AiContextBinder({ queue, registry });
|
|
66
|
-
yield* Effect.promise(() =>
|
|
67
|
-
binder.use((b: AiContextBinder) => b.bind({ blueprints: [Ref.make(defaultBlueprint!)] })),
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
return { object: chat };
|
|
71
|
-
}),
|
|
72
|
-
}),
|
|
73
|
-
OperationResolver.make({
|
|
74
|
-
operation: AssistantOperation.UpdateChatName,
|
|
75
|
-
handler: Effect.fnUntraced(function* ({ chat }) {
|
|
76
|
-
const registry = yield* Capability.get(Common.Capability.AtomRegistry);
|
|
77
|
-
const db = Obj.getDatabase(chat);
|
|
78
|
-
const queue = chat.queue.target as Queue<Message.Message>;
|
|
79
|
-
if (!db || !queue) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const runtimeResolver = yield* Capability.get(AutomationCapabilities.ComputeRuntime);
|
|
84
|
-
const runtime = yield* Effect.promise(() =>
|
|
85
|
-
runtimeResolver
|
|
86
|
-
.getRuntime(db.spaceId)
|
|
87
|
-
.runPromise(Effect.runtime<AiChatServices>().pipe(Effect.provide(TracingService.layerNoop))),
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
yield* Effect.promise(() =>
|
|
91
|
-
new AiConversation({ queue, registry }).use(async (conversation) =>
|
|
92
|
-
updateName(runtime, conversation, chat),
|
|
93
|
-
),
|
|
94
|
-
);
|
|
95
|
-
}),
|
|
96
|
-
}),
|
|
97
|
-
OperationResolver.make({
|
|
98
|
-
operation: AssistantOperation.SetCurrentChat,
|
|
99
|
-
handler: Effect.fnUntraced(function* ({ companionTo, chat }) {
|
|
100
|
-
const companionToId = Obj.getDXN(companionTo).toString();
|
|
101
|
-
const chatId = chat && Obj.getDXN(chat).toString();
|
|
102
|
-
yield* Common.Capability.updateAtomValue(AssistantCapabilities.State, (current) => ({
|
|
103
|
-
...current,
|
|
104
|
-
currentChat: { ...current.currentChat, [companionToId]: chatId },
|
|
105
|
-
}));
|
|
106
|
-
}),
|
|
107
|
-
}),
|
|
108
|
-
]);
|
|
109
|
-
}),
|
|
110
|
-
);
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
9
|
-
import { useSettingsState } from '@dxos/app-framework/react';
|
|
10
|
-
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
11
|
-
import { getSpace } from '@dxos/client/echo';
|
|
12
|
-
import { Sequence } from '@dxos/conductor';
|
|
13
|
-
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
14
|
-
import { Obj } from '@dxos/echo';
|
|
15
|
-
import { Layout } from '@dxos/react-ui-mosaic';
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
AssistantSettings,
|
|
19
|
-
BlueprintArticle,
|
|
20
|
-
ChatCompanion,
|
|
21
|
-
ChatContainer,
|
|
22
|
-
ChatDialog,
|
|
23
|
-
PromptArticle,
|
|
24
|
-
} from '../../components';
|
|
25
|
-
import { ASSISTANT_DIALOG, meta } from '../../meta';
|
|
26
|
-
import { Assistant } from '../../types';
|
|
27
|
-
|
|
28
|
-
export default Capability.makeModule(() =>
|
|
29
|
-
Effect.succeed(
|
|
30
|
-
Capability.contributes(Common.Capability.ReactSurface, [
|
|
31
|
-
Common.createSurface({
|
|
32
|
-
id: `${meta.id}/plugin-settings`,
|
|
33
|
-
role: 'article',
|
|
34
|
-
filter: (data): data is { subject: Common.Capability.Settings } =>
|
|
35
|
-
Common.Capability.isSettings(data.subject) && data.subject.prefix === meta.id,
|
|
36
|
-
component: ({ data: { subject } }) => {
|
|
37
|
-
const { settings, updateSettings } = useSettingsState<Assistant.Settings>(subject.atom);
|
|
38
|
-
return <AssistantSettings settings={settings} onSettingsChange={updateSettings} />;
|
|
39
|
-
},
|
|
40
|
-
}),
|
|
41
|
-
Common.createSurface({
|
|
42
|
-
id: `${meta.id}/chat`,
|
|
43
|
-
role: 'article',
|
|
44
|
-
filter: (data): data is { subject: Assistant.Chat; variant: undefined } =>
|
|
45
|
-
Obj.instanceOf(Assistant.Chat, data.subject) && data.variant !== 'assistant-chat',
|
|
46
|
-
component: ({ data, role, ref }) => <ChatContainer role={role} subject={data.subject} ref={ref} />,
|
|
47
|
-
}),
|
|
48
|
-
// TODO(wittjosiah): This is flashing when chat changes.
|
|
49
|
-
Common.createSurface({
|
|
50
|
-
id: `${meta.id}/companion-chat`,
|
|
51
|
-
role: 'article',
|
|
52
|
-
filter: (data): data is { companionTo: Obj.Unknown; subject: Assistant.Chat | 'assistant-chat' } =>
|
|
53
|
-
Obj.isObject(data.companionTo) &&
|
|
54
|
-
(Obj.instanceOf(Assistant.Chat, data.subject) || data.subject === 'assistant-chat'),
|
|
55
|
-
component: ({ data, role, ref }) => <ChatCompanion role={role} data={data} ref={ref} />,
|
|
56
|
-
}),
|
|
57
|
-
Common.createSurface({
|
|
58
|
-
id: `${meta.id}/companion-invocations`,
|
|
59
|
-
role: 'article',
|
|
60
|
-
filter: (data): data is { companionTo: Sequence } =>
|
|
61
|
-
(Obj.instanceOf(Sequence, data.companionTo) || Obj.instanceOf(Prompt.Prompt, data.companionTo)) &&
|
|
62
|
-
data.subject === 'invocations',
|
|
63
|
-
component: ({ data, role }) => {
|
|
64
|
-
const space = getSpace(data.companionTo);
|
|
65
|
-
const queueDxn = space?.properties.invocationTraceQueue?.dxn;
|
|
66
|
-
// TODO(wittjosiah): Support invocation filtering for prompts.
|
|
67
|
-
const target = Obj.instanceOf(Prompt.Prompt, data.companionTo) ? undefined : data.companionTo;
|
|
68
|
-
return (
|
|
69
|
-
<Layout.Main role={role}>
|
|
70
|
-
<InvocationTraceContainer db={space?.db} queueDxn={queueDxn} target={target} detailAxis='block' />
|
|
71
|
-
</Layout.Main>
|
|
72
|
-
);
|
|
73
|
-
},
|
|
74
|
-
}),
|
|
75
|
-
Common.createSurface({
|
|
76
|
-
id: `${meta.id}/blueprint`,
|
|
77
|
-
role: 'article',
|
|
78
|
-
filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
|
|
79
|
-
component: ({ data }) => <BlueprintArticle subject={data.subject} />,
|
|
80
|
-
}),
|
|
81
|
-
Common.createSurface({
|
|
82
|
-
id: `${meta.id}/prompt`,
|
|
83
|
-
role: 'article',
|
|
84
|
-
filter: (data): data is { subject: Prompt.Prompt } => Obj.instanceOf(Prompt.Prompt, data.subject),
|
|
85
|
-
component: ({ data }) => <PromptArticle subject={data.subject} />,
|
|
86
|
-
}),
|
|
87
|
-
Common.createSurface({
|
|
88
|
-
id: ASSISTANT_DIALOG,
|
|
89
|
-
role: 'dialog',
|
|
90
|
-
filter: (data): data is { props: { chat: Assistant.Chat } } => data.component === ASSISTANT_DIALOG,
|
|
91
|
-
component: ({ data }) => <ChatDialog {...data.props} />,
|
|
92
|
-
}),
|
|
93
|
-
]),
|
|
94
|
-
),
|
|
95
|
-
);
|
|
@@ -1,63 +0,0 @@
|
|
|
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 { Blueprint, Prompt } from '@dxos/blueprints';
|
|
9
|
-
import { Obj, Ref, Type } from '@dxos/echo';
|
|
10
|
-
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
11
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
12
|
-
import { Collection } from '@dxos/schema';
|
|
13
|
-
|
|
14
|
-
import { Assistant } from '../../types';
|
|
15
|
-
|
|
16
|
-
export default Capability.makeModule(() =>
|
|
17
|
-
Effect.succeed(
|
|
18
|
-
Capability.contributes(SpaceCapabilities.Repair, async ({ space }) => {
|
|
19
|
-
await ensureSystemCollections(space);
|
|
20
|
-
}),
|
|
21
|
-
),
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Ensure the root collection has system collections for AI Chats, Blueprints, and Prompts.
|
|
26
|
-
*/
|
|
27
|
-
const ensureSystemCollections = async (space: Space) => {
|
|
28
|
-
const rootCollection: Collection.Collection = await space.properties[Collection.Collection.typename]?.load();
|
|
29
|
-
if (!rootCollection) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const objects = await Promise.all(rootCollection.objects.map((ref) => ref.load()));
|
|
34
|
-
const chats = objects.find(
|
|
35
|
-
(object) => Obj.instanceOf(Collection.Managed, object) && object.key === Assistant.Chat.typename,
|
|
36
|
-
);
|
|
37
|
-
if (!chats) {
|
|
38
|
-
const chatsCollectionRef = Ref.make(Collection.makeManaged({ key: Assistant.Chat.typename }));
|
|
39
|
-
Obj.change(rootCollection, (c) => {
|
|
40
|
-
c.objects.push(chatsCollectionRef);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const blueprints = objects.find(
|
|
45
|
-
(object) => Obj.instanceOf(Collection.Managed, object) && object.key === Blueprint.Blueprint.typename,
|
|
46
|
-
);
|
|
47
|
-
if (!blueprints) {
|
|
48
|
-
const blueprintsCollectionRef = Ref.make(Collection.makeManaged({ key: Blueprint.Blueprint.typename }));
|
|
49
|
-
Obj.change(rootCollection, (c) => {
|
|
50
|
-
c.objects.push(blueprintsCollectionRef);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const prompts = objects.find(
|
|
55
|
-
(object) => Obj.instanceOf(Collection.Managed, object) && object.key === Type.getTypename(Prompt.Prompt),
|
|
56
|
-
);
|
|
57
|
-
if (!prompts) {
|
|
58
|
-
const promptsCollectionRef = Ref.make(Collection.makeManaged({ key: Type.getTypename(Prompt.Prompt) }));
|
|
59
|
-
Obj.change(rootCollection, (c) => {
|
|
60
|
-
c.objects.push(promptsCollectionRef);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Layer from 'effect/Layer';
|
|
7
|
-
|
|
8
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
9
|
-
import { GenericToolkit } from '@dxos/assistant';
|
|
10
|
-
import { AssistantToolkit, SystemToolkit, WebSearchToolkit } from '@dxos/assistant-toolkit';
|
|
11
|
-
|
|
12
|
-
export default Capability.makeModule(() =>
|
|
13
|
-
Effect.succeed([
|
|
14
|
-
Capability.contributes(
|
|
15
|
-
Common.Capability.Toolkit,
|
|
16
|
-
GenericToolkit.make(AssistantToolkit.AssistantToolkit, AssistantToolkit.layer()),
|
|
17
|
-
),
|
|
18
|
-
|
|
19
|
-
// TODO(burdon): How to manage dependencies across blueprints.
|
|
20
|
-
Capability.contributes(
|
|
21
|
-
Common.Capability.Toolkit,
|
|
22
|
-
GenericToolkit.make(SystemToolkit.SystemToolkit, SystemToolkit.layer()),
|
|
23
|
-
),
|
|
24
|
-
Capability.contributes(Common.Capability.Toolkit, GenericToolkit.make(WebSearchToolkit, Layer.empty)),
|
|
25
|
-
]),
|
|
26
|
-
);
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type SurfaceComponentProps } from '@dxos/app-framework/react';
|
|
8
|
-
import { type Blueprint } from '@dxos/blueprints';
|
|
9
|
-
import { Obj } from '@dxos/echo';
|
|
10
|
-
import { Toolbar } from '@dxos/react-ui';
|
|
11
|
-
import { useAttention } from '@dxos/react-ui-attention';
|
|
12
|
-
import { Layout } from '@dxos/react-ui-mosaic';
|
|
13
|
-
|
|
14
|
-
import { TemplateEditor } from './TemplateEditor';
|
|
15
|
-
|
|
16
|
-
export type BlueprintArticleProps = SurfaceComponentProps<Blueprint.Blueprint>;
|
|
17
|
-
|
|
18
|
-
export const BlueprintArticle = ({ role, subject }: BlueprintArticleProps) => {
|
|
19
|
-
const { hasAttention } = useAttention(Obj.getDXN(subject).toString());
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<Layout.Main role={role} toolbar>
|
|
23
|
-
<Toolbar.Root disabled={!hasAttention} />
|
|
24
|
-
<TemplateEditor id={subject.id} template={subject.instructions} classNames='container-max-width' />
|
|
25
|
-
</Layout.Main>
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default BlueprintArticle;
|