@dxos/plugin-assistant 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0
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-RUV2WOQH.mjs +154 -0
- package/dist/lib/browser/chunk-RUV2WOQH.mjs.map +7 -0
- package/dist/lib/browser/create-chat-DF5TG5XC.mjs +82 -0
- package/dist/lib/browser/create-chat-DF5TG5XC.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 +3062 -322
- 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 +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-PY4X6FJT.mjs +155 -0
- package/dist/lib/node-esm/chunk-PY4X6FJT.mjs.map +7 -0
- package/dist/lib/node-esm/create-chat-RAV7IX2S.mjs +83 -0
- package/dist/lib/node-esm/create-chat-RAV7IX2S.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 +3062 -322
- 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 +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 +41 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +6 -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 +16 -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/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 +517 -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 +30 -19
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +1 -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 +3 -3
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- 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/ChatStream.stories.d.ts +530 -0
- package/dist/types/src/components/ChatThread/ChatStream.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +4 -4
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +502 -300
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- 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 +6 -6
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- 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/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/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/index.d.ts +10 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +14 -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 +9 -4
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +493 -290
- 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 +494 -291
- 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 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +1 -10
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +17 -12
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +493 -290
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +12 -0
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts +11 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +7 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts +5 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/index.d.ts +2 -0
- package/dist/types/src/components/Typewriter/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -6
- package/dist/types/src/components/index.d.ts.map +1 -1
- 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/ProjectArticle/ProjectArticle.d.ts +6 -0
- package/dist/types/src/containers/ProjectArticle/ProjectArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ProjectArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ProjectArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ProjectSettings/ProjectSettings.d.ts +6 -0
- package/dist/types/src/containers/ProjectSettings/ProjectSettings.d.ts.map +1 -0
- package/dist/types/src/containers/ProjectSettings/index.d.ts +2 -0
- package/dist/types/src/containers/ProjectSettings/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 +523 -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/index.d.ts +1 -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 +7 -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 +3 -3
- 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 +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/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 +34 -28
- 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 +3 -2
- 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 +493 -290
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +18 -46
- 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 +44 -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 -218
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +139 -93
- package/src/AssistantPlugin.tsx +182 -132
- 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 +5 -0
- package/src/capabilities/ai-service.ts +20 -17
- package/src/capabilities/app-graph-builder.ts +190 -183
- package/src/capabilities/blueprint-definition.ts +47 -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 +21 -13
- 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 +138 -68
- package/src/capabilities/settings.ts +24 -12
- package/src/capabilities/state.ts +26 -13
- package/src/capabilities/toolkit.ts +7 -11
- 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 +147 -104
- package/src/components/Chat/events.ts +1 -1
- package/src/components/ChatProgress/ChatProgress.tsx +11 -22
- package/src/components/ChatPrompt/ChatActions.tsx +26 -6
- package/src/components/ChatPrompt/ChatOptions.tsx +103 -79
- package/src/components/ChatPrompt/ChatReferences.tsx +21 -12
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/ChatStream.stories.tsx +168 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +30 -45
- package/src/components/ChatThread/ChatThread.tsx +29 -18
- package/src/components/ChatThread/Link.tsx +4 -4
- package/src/components/ChatThread/registry.tsx +74 -40
- package/src/components/ChatThread/sync.test.ts +19 -9
- package/src/components/ChatThread/sync.ts +27 -27
- package/src/components/ChatThread/testing/thread-1.md +17 -0
- package/src/components/ChatThread/widgets/FallbackWidget.tsx +24 -0
- package/src/components/ChatThread/widgets/PromptWidget.ts +28 -0
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +120 -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/SuggestionWidget.ts +41 -0
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +28 -0
- package/src/components/ChatThread/widgets/ToolWidget.tsx +143 -0
- package/src/components/ChatThread/widgets/index.ts +13 -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 +5 -10
- package/src/components/TemplateEditor/TemplateEditor.tsx +53 -42
- 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 +14 -9
- package/src/components/ToolBlock/ToolBlock.tsx +25 -24
- package/src/components/Toolbox/Toolbox.stories.tsx +11 -14
- package/src/components/Toolbox/Toolbox.tsx +72 -67
- package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
- package/src/components/Typewriter/Typewriter.stories.tsx +86 -0
- package/src/components/Typewriter/Typewriter.tsx +50 -0
- package/src/components/Typewriter/assistant-extension.tsx +141 -0
- package/src/components/Typewriter/index.ts +5 -0
- package/src/components/index.ts +3 -7
- 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 +13 -16
- package/src/containers/ChatDialog/index.ts +5 -0
- package/src/containers/ProjectArticle/ProjectArticle.tsx +131 -0
- package/src/containers/ProjectArticle/index.ts +5 -0
- package/src/containers/ProjectSettings/ProjectSettings.tsx +139 -0
- package/src/containers/ProjectSettings/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 +305 -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/index.ts +1 -1
- package/src/hooks/useBlueprintRegistry.ts +36 -22
- package/src/hooks/useChatProcessor.ts +34 -18
- package/src/hooks/useChatServices.ts +9 -34
- package/src/hooks/useChatToolbarActions.ts +34 -34
- 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 -9
- package/src/index.ts +1 -2
- package/src/meta.ts +7 -4
- 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/processor.test.ts +20 -51
- package/src/processor/processor.ts +196 -137
- package/src/queue-logger.ts +4 -1
- package/src/testing/test-generator.ts +17 -16
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +9 -7
- package/src/translations.ts +126 -79
- package/src/types/Assistant.ts +8 -57
- 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/BlueprintArticle-IMCR3642.mjs +0 -36
- package/dist/lib/browser/BlueprintArticle-IMCR3642.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-JYD2RIBJ.mjs +0 -158
- package/dist/lib/browser/ChatCompanion-JYD2RIBJ.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-XCPBWYIR.mjs +0 -77
- package/dist/lib/browser/ChatContainer-XCPBWYIR.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-DT7KFCRL.mjs +0 -90
- package/dist/lib/browser/ChatDialog-DT7KFCRL.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-45QX25Y5.mjs +0 -59
- package/dist/lib/browser/PromptArticle-45QX25Y5.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-VZEXMDTY.mjs +0 -199
- package/dist/lib/browser/app-graph-builder-VZEXMDTY.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-5FT5JGPY.mjs +0 -12
- package/dist/lib/browser/chunk-2BOE3OTW.mjs +0 -262
- package/dist/lib/browser/chunk-2BOE3OTW.mjs.map +0 -7
- package/dist/lib/browser/chunk-BNTPFZ7O.mjs +0 -229
- package/dist/lib/browser/chunk-BNTPFZ7O.mjs.map +0 -7
- package/dist/lib/browser/chunk-FJQ4ZRYJ.mjs +0 -335
- package/dist/lib/browser/chunk-FJQ4ZRYJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-IXIIS4QA.mjs +0 -176
- package/dist/lib/browser/chunk-IXIIS4QA.mjs.map +0 -7
- package/dist/lib/browser/chunk-LRE4VEZV.mjs +0 -16
- package/dist/lib/browser/chunk-LRE4VEZV.mjs.map +0 -7
- package/dist/lib/browser/chunk-U62BTGDF.mjs +0 -1929
- package/dist/lib/browser/chunk-U62BTGDF.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBG5PTSX.mjs +0 -23
- package/dist/lib/browser/chunk-WBG5PTSX.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-AK5O4GUW.mjs +0 -143
- package/dist/lib/browser/intent-resolver-AK5O4GUW.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-YCSR2MSR.mjs +0 -98
- package/dist/lib/browser/react-surface-YCSR2MSR.mjs.map +0 -7
- package/dist/lib/browser/settings-NYJGNQ5I.mjs +0 -23
- package/dist/lib/browser/settings-NYJGNQ5I.mjs.map +0 -7
- package/dist/lib/browser/state-GG7Z3NB7.mjs +0 -25
- package/dist/lib/browser/state-GG7Z3NB7.mjs.map +0 -7
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs +0 -17
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintArticle-OL2HUY6Q.mjs +0 -37
- package/dist/lib/node-esm/BlueprintArticle-OL2HUY6Q.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-AHKJS25S.mjs +0 -159
- package/dist/lib/node-esm/ChatCompanion-AHKJS25S.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-K7OGPE3G.mjs +0 -78
- package/dist/lib/node-esm/ChatContainer-K7OGPE3G.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QT6ZBX45.mjs +0 -91
- package/dist/lib/node-esm/ChatDialog-QT6ZBX45.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-OUKFSJQV.mjs +0 -60
- package/dist/lib/node-esm/PromptArticle-OUKFSJQV.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-VRN6ESRR.mjs +0 -200
- package/dist/lib/node-esm/app-graph-builder-VRN6ESRR.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-XW6QQVLV.mjs +0 -13
- package/dist/lib/node-esm/chunk-3Q22TTXW.mjs +0 -264
- package/dist/lib/node-esm/chunk-3Q22TTXW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AB74FOA2.mjs +0 -230
- package/dist/lib/node-esm/chunk-AB74FOA2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BHS747K7.mjs +0 -1930
- package/dist/lib/node-esm/chunk-BHS747K7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KJGD4EBJ.mjs +0 -336
- package/dist/lib/node-esm/chunk-KJGD4EBJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UXTUHH24.mjs +0 -178
- package/dist/lib/node-esm/chunk-UXTUHH24.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs +0 -25
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YWFWT57N.mjs +0 -17
- package/dist/lib/node-esm/chunk-YWFWT57N.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-L2F3N45L.mjs +0 -144
- package/dist/lib/node-esm/intent-resolver-L2F3N45L.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-CTW44GEM.mjs +0 -99
- package/dist/lib/node-esm/react-surface-CTW44GEM.mjs.map +0 -7
- package/dist/lib/node-esm/settings-RRHYI5KO.mjs +0 -24
- package/dist/lib/node-esm/settings-RRHYI5KO.mjs.map +0 -7
- package/dist/lib/node-esm/state-FSUHFMDM.mjs +0 -26
- package/dist/lib/node-esm/state-FSUHFMDM.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs +0 -18
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts +0 -10
- 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/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 -14
- 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/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/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/hooks/useItemTypes.d.ts +0 -4
- package/dist/types/src/hooks/useItemTypes.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 -132
- package/dist/types/src/types/AssistantAction.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -17
- package/src/capabilities/intent-resolver.ts +0 -147
- package/src/components/BlueprintArticle.tsx +0 -29
- package/src/components/ChatCompanion.tsx +0 -155
- package/src/components/ChatContainer.tsx +0 -61
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/components/PromptArticle.tsx +0 -51
- package/src/events.ts +0 -11
- package/src/functions/analysis.ts +0 -22
- package/src/functions/index.ts +0 -7
- package/src/functions/object-list.ts +0 -48
- package/src/functions/object-load.ts +0 -45
- package/src/hooks/useItemTypes.ts +0 -37
- package/src/processor/update-name.ts +0 -56
- package/src/types/AssistantAction.ts +0 -79
- /package/dist/lib/browser/{blueprint-definition-5FT5JGPY.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{blueprint-definition-XW6QQVLV.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/src/components/ChatThread/testing/{thread.md → thread-2.md} +0 -0
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
declare const _default: import("@dxos/functions").FunctionDefinition<{
|
|
2
|
-
readonly typename: string;
|
|
3
|
-
}, {
|
|
4
|
-
readonly results: readonly {
|
|
5
|
-
readonly dxn: string;
|
|
6
|
-
readonly label?: string | undefined;
|
|
7
|
-
}[];
|
|
8
|
-
}, import("@dxos/functions").FunctionServices>;
|
|
9
|
-
export default _default;
|
|
10
|
-
//# sourceMappingURL=object-list.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object-list.d.ts","sourceRoot":"","sources":["../../../../src/functions/object-list.ts"],"names":[],"mappings":";;;;;;;;AAYA,wBAmCG"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare const _default: import("@dxos/functions").FunctionDefinition<{
|
|
2
|
-
readonly typename: string;
|
|
3
|
-
readonly id: string;
|
|
4
|
-
}, {
|
|
5
|
-
readonly object: any;
|
|
6
|
-
}, import("@dxos/functions").FunctionServices>;
|
|
7
|
-
export default _default;
|
|
8
|
-
//# sourceMappingURL=object-load.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object-load.d.ts","sourceRoot":"","sources":["../../../../src/functions/object-load.ts"],"names":[],"mappings":";;;;;;AAcA,wBA8BG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useItemTypes.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useItemTypes.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAIrD,eAAO,MAAM,YAAY,GAAI,QAAQ,KAAK,KAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAwBxD,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as Runtime from 'effect/Runtime';
|
|
2
|
-
import { type ModelName } from '@dxos/ai';
|
|
3
|
-
import { type AiConversation } from '@dxos/assistant';
|
|
4
|
-
import { type Assistant } from '../types';
|
|
5
|
-
import { type AiChatServices } from './processor';
|
|
6
|
-
/**
|
|
7
|
-
* Update the current chat's name.
|
|
8
|
-
*/
|
|
9
|
-
export declare const updateName: (runtime: Runtime.Runtime<AiChatServices>, conversation: AiConversation, chat: Assistant.Chat, model?: ModelName) => Promise<void>;
|
|
10
|
-
//# sourceMappingURL=update-name.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-name.d.ts","sourceRoot":"","sources":["../../../../src/processor/update-name.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,iBAAiB,CAAC;AAIjE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;GAEG;AAEH,eAAO,MAAM,UAAU,GACrB,SAAS,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,EACxC,cAAc,cAAc,EAC5B,MAAM,SAAS,CAAC,IAAI,EACpB,QAAO,SAA8B,KACpC,OAAO,CAAC,IAAI,CA4Bd,CAAC"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import * as Schema from 'effect/Schema';
|
|
2
|
-
import { Prompt } from '@dxos/blueprints';
|
|
3
|
-
declare const onCreateSpace_base: Schema.TaggedClass<onCreateSpace, `${string}/on-space-created`, {
|
|
4
|
-
readonly _tag: Schema.tag<`${string}/on-space-created`>;
|
|
5
|
-
} & {
|
|
6
|
-
input: Schema.Struct<{
|
|
7
|
-
space: Schema.Schema<import("@dxos/client-protocol").Space, import("@dxos/client-protocol").Space, never>;
|
|
8
|
-
rootCollection: import("@dxos/echo/Type").obj<Schema.Struct<{
|
|
9
|
-
name: Schema.optional<typeof Schema.String>;
|
|
10
|
-
objects: Schema.mutable<Schema.Array$<import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo/Type").Expando, {
|
|
11
|
-
[x: string]: any;
|
|
12
|
-
id: string;
|
|
13
|
-
}, never>>>>;
|
|
14
|
-
}>>;
|
|
15
|
-
}>;
|
|
16
|
-
output: typeof Schema.Void;
|
|
17
|
-
}>;
|
|
18
|
-
export declare class onCreateSpace extends onCreateSpace_base {
|
|
19
|
-
}
|
|
20
|
-
declare const CreateChat_base: Schema.TaggedClass<CreateChat, `${string}/action/create-chat`, {
|
|
21
|
-
readonly _tag: Schema.tag<`${string}/action/create-chat`>;
|
|
22
|
-
} & {
|
|
23
|
-
input: Schema.Struct<{
|
|
24
|
-
space: Schema.Schema<import("@dxos/client-protocol").Space, import("@dxos/client-protocol").Space, never>;
|
|
25
|
-
name: Schema.optional<typeof Schema.String>;
|
|
26
|
-
}>;
|
|
27
|
-
output: Schema.Struct<{
|
|
28
|
-
object: import("@dxos/echo/Type").obj<Schema.Struct<{
|
|
29
|
-
name: Schema.optional<typeof Schema.String>;
|
|
30
|
-
queue: import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>;
|
|
31
|
-
traceQueue: Schema.optional<import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>>;
|
|
32
|
-
}>>;
|
|
33
|
-
}>;
|
|
34
|
-
}>;
|
|
35
|
-
export declare class CreateChat extends CreateChat_base {
|
|
36
|
-
}
|
|
37
|
-
declare const UpdateChatName_base: Schema.TaggedClass<UpdateChatName, `${string}/action/update-name`, {
|
|
38
|
-
readonly _tag: Schema.tag<`${string}/action/update-name`>;
|
|
39
|
-
} & {
|
|
40
|
-
input: Schema.Struct<{
|
|
41
|
-
chat: import("@dxos/echo/Type").obj<Schema.Struct<{
|
|
42
|
-
name: Schema.optional<typeof Schema.String>;
|
|
43
|
-
queue: import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>;
|
|
44
|
-
traceQueue: Schema.optional<import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>>;
|
|
45
|
-
}>>;
|
|
46
|
-
}>;
|
|
47
|
-
output: typeof Schema.Void;
|
|
48
|
-
}>;
|
|
49
|
-
export declare class UpdateChatName extends UpdateChatName_base {
|
|
50
|
-
}
|
|
51
|
-
export declare const BlueprintForm: Schema.Struct<{
|
|
52
|
-
key: typeof Schema.String;
|
|
53
|
-
name: typeof Schema.String;
|
|
54
|
-
description: Schema.optional<typeof Schema.String>;
|
|
55
|
-
}>;
|
|
56
|
-
declare const CreateBlueprint_base: Schema.TaggedClass<CreateBlueprint, `${string}/action/create-blueprint`, {
|
|
57
|
-
readonly _tag: Schema.tag<`${string}/action/create-blueprint`>;
|
|
58
|
-
} & {
|
|
59
|
-
input: Schema.Struct<{
|
|
60
|
-
key: typeof Schema.String;
|
|
61
|
-
name: typeof Schema.String;
|
|
62
|
-
description: Schema.optional<typeof Schema.String>;
|
|
63
|
-
}>;
|
|
64
|
-
output: Schema.Struct<{
|
|
65
|
-
object: import("@dxos/echo/Type").obj<Schema.Struct<{
|
|
66
|
-
key: Schema.SchemaClass<string, string, never>;
|
|
67
|
-
name: Schema.SchemaClass<string, string, never>;
|
|
68
|
-
description: Schema.optional<typeof Schema.String>;
|
|
69
|
-
instructions: Schema.mutable<Schema.Struct<{
|
|
70
|
-
source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
71
|
-
content: string;
|
|
72
|
-
}>, import("@dxos/echo-protocol").EncodedReference, never>;
|
|
73
|
-
inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
|
|
74
|
-
name: typeof Schema.String;
|
|
75
|
-
kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
|
|
76
|
-
default: Schema.optional<typeof Schema.Any>;
|
|
77
|
-
}>>>>>;
|
|
78
|
-
}>>;
|
|
79
|
-
tools: Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>;
|
|
80
|
-
}>>;
|
|
81
|
-
}>;
|
|
82
|
-
}>;
|
|
83
|
-
export declare class CreateBlueprint extends CreateBlueprint_base {
|
|
84
|
-
}
|
|
85
|
-
declare const CreatePrompt_base: Schema.TaggedClass<CreatePrompt, `${string}/action/create-prompt`, {
|
|
86
|
-
readonly _tag: Schema.tag<`${string}/action/create-prompt`>;
|
|
87
|
-
} & {
|
|
88
|
-
input: Schema.Struct<{
|
|
89
|
-
name: Schema.optional<typeof Schema.String>;
|
|
90
|
-
}>;
|
|
91
|
-
output: Schema.Struct<{
|
|
92
|
-
object: Schema.Schema<Prompt.Prompt, Prompt.Prompt_Encoded, never>;
|
|
93
|
-
}>;
|
|
94
|
-
}>;
|
|
95
|
-
export declare class CreatePrompt extends CreatePrompt_base {
|
|
96
|
-
}
|
|
97
|
-
declare const CreateSequence_base: Schema.TaggedClass<CreateSequence, `${string}/action/create-sequence`, {
|
|
98
|
-
readonly _tag: Schema.tag<`${string}/action/create-sequence`>;
|
|
99
|
-
} & {
|
|
100
|
-
input: Schema.Struct<{
|
|
101
|
-
name: Schema.optional<typeof Schema.String>;
|
|
102
|
-
}>;
|
|
103
|
-
output: Schema.Struct<{
|
|
104
|
-
object: import("@dxos/echo/Type").obj<Schema.Struct<{
|
|
105
|
-
name: Schema.optional<typeof Schema.String>;
|
|
106
|
-
steps: Schema.Array$<Schema.Struct<{
|
|
107
|
-
id: import("@dxos/keys").ObjectIdClass;
|
|
108
|
-
instructions: typeof Schema.String;
|
|
109
|
-
tools: Schema.optional<Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>>;
|
|
110
|
-
}>>;
|
|
111
|
-
}>>;
|
|
112
|
-
}>;
|
|
113
|
-
}>;
|
|
114
|
-
export declare class CreateSequence extends CreateSequence_base {
|
|
115
|
-
}
|
|
116
|
-
declare const SetCurrentChat_base: Schema.TaggedClass<SetCurrentChat, `${string}/action/set-current-chat`, {
|
|
117
|
-
readonly _tag: Schema.tag<`${string}/action/set-current-chat`>;
|
|
118
|
-
} & {
|
|
119
|
-
input: Schema.Struct<{
|
|
120
|
-
companionTo: Schema.Schema<any, any, never>;
|
|
121
|
-
chat: Schema.optional<import("@dxos/echo/Type").obj<Schema.Struct<{
|
|
122
|
-
name: Schema.optional<typeof Schema.String>;
|
|
123
|
-
queue: import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>;
|
|
124
|
-
traceQueue: Schema.optional<import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>>;
|
|
125
|
-
}>>>;
|
|
126
|
-
}>;
|
|
127
|
-
output: typeof Schema.Void;
|
|
128
|
-
}>;
|
|
129
|
-
export declare class SetCurrentChat extends SetCurrentChat_base {
|
|
130
|
-
}
|
|
131
|
-
export {};
|
|
132
|
-
//# sourceMappingURL=AssistantAction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantAction.d.ts","sourceRoot":"","sources":["../../../../src/types/AssistantAction.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAa,MAAM,EAAE,MAAM,kBAAkB,CAAC;;;;;;;;;;;;;;;;AAUrD,qBAAa,aAAc,SAAQ,kBAMjC;CAAG;;;;;;;;;;;;;;;;AAEL,qBAAa,UAAW,SAAQ,eAQ9B;CAAG;;;;;;;;;;;;;AAEL,qBAAa,cAAe,SAAQ,mBAKlC;CAAG;AAEL,eAAO,MAAM,aAAa;;;;EAIxB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qBAAa,eAAgB,SAAQ,oBAKnC;CAAG;;;;;;;;;;;AAEL,qBAAa,YAAa,SAAQ,iBAOhC;CAAG;;;;;;;;;;;;;;;;;;AAEL,qBAAa,cAAe,SAAQ,mBAOlC;CAAG;;;;;;;;;;;;;;AAEL,qBAAa,cAAe,SAAQ,mBAMlC;CAAG"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type DeepReadonly } from '@dxos/util';
|
|
7
|
-
|
|
8
|
-
import { meta } from '../meta';
|
|
9
|
-
|
|
10
|
-
export namespace AssistantCapabilities {
|
|
11
|
-
export type AssistantState = {
|
|
12
|
-
/** Map of primary object dxn to current chat dxn. */
|
|
13
|
-
currentChat: Record<string, string | undefined>;
|
|
14
|
-
};
|
|
15
|
-
export const State = defineCapability<DeepReadonly<AssistantState>>(`${meta.id}/capability/state`);
|
|
16
|
-
export const MutableState = defineCapability<AssistantState>(`${meta.id}/capability/state`);
|
|
17
|
-
}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
8
|
-
import { AiContextBinder, AiConversation } from '@dxos/assistant';
|
|
9
|
-
import { Agent } from '@dxos/assistant-toolkit';
|
|
10
|
-
import { Blueprint, Prompt, Template } from '@dxos/blueprints';
|
|
11
|
-
import { type Queue } from '@dxos/client/echo';
|
|
12
|
-
import { Sequence } from '@dxos/conductor';
|
|
13
|
-
import { Filter, Key, Obj, Ref, Type } from '@dxos/echo';
|
|
14
|
-
import { TracingService, serializeFunction } from '@dxos/functions';
|
|
15
|
-
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
16
|
-
import { CollectionAction } from '@dxos/plugin-space/types';
|
|
17
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
18
|
-
import { type Message } from '@dxos/types';
|
|
19
|
-
|
|
20
|
-
import { type AiChatServices, updateName } from '../processor';
|
|
21
|
-
import { Assistant, AssistantAction } from '../types';
|
|
22
|
-
|
|
23
|
-
import { ASSISTANT_BLUEPRINT_KEY, createBlueprint } from './blueprint-definition';
|
|
24
|
-
import { AssistantCapabilities } from './capabilities';
|
|
25
|
-
|
|
26
|
-
export default (context: PluginContext) => [
|
|
27
|
-
contributes(Capabilities.IntentResolver, [
|
|
28
|
-
createResolver({
|
|
29
|
-
intent: AssistantAction.onCreateSpace,
|
|
30
|
-
resolve: ({ space, rootCollection }) =>
|
|
31
|
-
Effect.gen(function* () {
|
|
32
|
-
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
33
|
-
const { object: chatCollection } = yield* dispatch(
|
|
34
|
-
createIntent(CollectionAction.CreateQueryCollection, {
|
|
35
|
-
typename: Assistant.Chat.typename,
|
|
36
|
-
}),
|
|
37
|
-
);
|
|
38
|
-
const { object: blueprintCollection } = yield* dispatch(
|
|
39
|
-
createIntent(CollectionAction.CreateQueryCollection, {
|
|
40
|
-
typename: Blueprint.Blueprint.typename,
|
|
41
|
-
}),
|
|
42
|
-
);
|
|
43
|
-
const { object: promptCollection } = yield* dispatch(
|
|
44
|
-
createIntent(CollectionAction.CreateQueryCollection, {
|
|
45
|
-
typename: Type.getTypename(Prompt.Prompt),
|
|
46
|
-
}),
|
|
47
|
-
);
|
|
48
|
-
rootCollection.objects.push(
|
|
49
|
-
Ref.make(chatCollection),
|
|
50
|
-
Ref.make(blueprintCollection),
|
|
51
|
-
Ref.make(promptCollection),
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
// TODO(wittjosiah): Remove once function registry is avaiable.
|
|
55
|
-
space.db.add(serializeFunction(Agent.prompt));
|
|
56
|
-
|
|
57
|
-
// Create default chat.
|
|
58
|
-
const { object: chat } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
59
|
-
space.db.add(chat);
|
|
60
|
-
}),
|
|
61
|
-
}),
|
|
62
|
-
createResolver({
|
|
63
|
-
intent: AssistantAction.CreateChat,
|
|
64
|
-
resolve: async ({ space, name }) => {
|
|
65
|
-
const queue = space.queues.create();
|
|
66
|
-
const chat = Assistant.makeChat({ name, queue });
|
|
67
|
-
|
|
68
|
-
// TODO(wittjosiah): This should be a space-level setting.
|
|
69
|
-
// TODO(burdon): Clone when activated. Copy-on-write for template.
|
|
70
|
-
const { objects: blueprints } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
71
|
-
let defaultBlueprint = blueprints.find((blueprint) => blueprint.key === ASSISTANT_BLUEPRINT_KEY);
|
|
72
|
-
if (!defaultBlueprint) {
|
|
73
|
-
defaultBlueprint = space.db.add(createBlueprint());
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const binder = new AiContextBinder(queue);
|
|
77
|
-
await binder.use((binder) => binder.bind({ blueprints: [Ref.make(defaultBlueprint)] }));
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
data: { object: chat },
|
|
81
|
-
};
|
|
82
|
-
},
|
|
83
|
-
}),
|
|
84
|
-
createResolver({
|
|
85
|
-
intent: AssistantAction.UpdateChatName,
|
|
86
|
-
resolve: async ({ chat }) => {
|
|
87
|
-
const space = getSpace(chat);
|
|
88
|
-
const queue = chat.queue.target as Queue<Message.Message>;
|
|
89
|
-
if (!space || !queue) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const runtimeResolver = context.getCapability(AutomationCapabilities.ComputeRuntime);
|
|
94
|
-
const runtime = await runtimeResolver
|
|
95
|
-
.getRuntime(space.id)
|
|
96
|
-
.runPromise(Effect.runtime<AiChatServices>().pipe(Effect.provide(TracingService.layerNoop)));
|
|
97
|
-
|
|
98
|
-
await new AiConversation(queue).use(async (conversation) => updateName(runtime, conversation, chat));
|
|
99
|
-
},
|
|
100
|
-
}),
|
|
101
|
-
createResolver({
|
|
102
|
-
intent: AssistantAction.CreateBlueprint,
|
|
103
|
-
resolve: ({ key, name, description }) => ({
|
|
104
|
-
data: {
|
|
105
|
-
object: Blueprint.make({
|
|
106
|
-
key,
|
|
107
|
-
name,
|
|
108
|
-
description,
|
|
109
|
-
instructions: Template.make(),
|
|
110
|
-
}),
|
|
111
|
-
},
|
|
112
|
-
}),
|
|
113
|
-
}),
|
|
114
|
-
createResolver({
|
|
115
|
-
intent: AssistantAction.CreatePrompt,
|
|
116
|
-
resolve: ({ name }) => ({
|
|
117
|
-
data: {
|
|
118
|
-
object: Prompt.make({ name }),
|
|
119
|
-
},
|
|
120
|
-
}),
|
|
121
|
-
}),
|
|
122
|
-
createResolver({
|
|
123
|
-
intent: AssistantAction.CreateSequence,
|
|
124
|
-
resolve: ({ name }) => ({
|
|
125
|
-
data: {
|
|
126
|
-
object: Obj.make(Sequence, {
|
|
127
|
-
name,
|
|
128
|
-
steps: [
|
|
129
|
-
{
|
|
130
|
-
id: Key.ObjectId.random(),
|
|
131
|
-
instructions: 'You are a helpful assistant.',
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
}),
|
|
135
|
-
},
|
|
136
|
-
}),
|
|
137
|
-
}),
|
|
138
|
-
createResolver({
|
|
139
|
-
intent: AssistantAction.SetCurrentChat,
|
|
140
|
-
resolve: ({ companionTo, chat }) =>
|
|
141
|
-
Effect.gen(function* () {
|
|
142
|
-
const state = context.getCapability(AssistantCapabilities.MutableState);
|
|
143
|
-
state.currentChat[Obj.getDXN(companionTo).toString()] = chat && Obj.getDXN(chat).toString();
|
|
144
|
-
}),
|
|
145
|
-
}),
|
|
146
|
-
]),
|
|
147
|
-
];
|
|
@@ -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 { StackItem } from '@dxos/react-ui-stack';
|
|
13
|
-
|
|
14
|
-
import { TemplateEditor } from './TemplateEditor';
|
|
15
|
-
|
|
16
|
-
export type BlueprintArticleProps = SurfaceComponentProps<Blueprint.Blueprint>;
|
|
17
|
-
|
|
18
|
-
export const BlueprintArticle = ({ subject }: BlueprintArticleProps) => {
|
|
19
|
-
const { hasAttention } = useAttention(Obj.getDXN(subject).toString());
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<StackItem.Content toolbar>
|
|
23
|
-
<Toolbar.Root disabled={!hasAttention} />
|
|
24
|
-
<TemplateEditor id={subject.id} template={subject.instructions} classNames='container-max-width' />
|
|
25
|
-
</StackItem.Content>
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default BlueprintArticle;
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Array from 'effect/Array';
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
|
-
import * as Option from 'effect/Option';
|
|
8
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
9
|
-
|
|
10
|
-
import { Capabilities, createIntent } from '@dxos/app-framework';
|
|
11
|
-
import { useCapabilities, useIntentDispatcher } from '@dxos/app-framework/react';
|
|
12
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
13
|
-
import { getSpace } from '@dxos/client/echo';
|
|
14
|
-
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
15
|
-
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
16
|
-
import { useQuery } from '@dxos/react-client/echo';
|
|
17
|
-
import { useAsyncEffect } from '@dxos/react-ui';
|
|
18
|
-
|
|
19
|
-
import { ChatContainer, type ChatEvent } from '../components';
|
|
20
|
-
import { useBlueprintRegistry, useContextBinder } from '../hooks';
|
|
21
|
-
import { Assistant, AssistantAction } from '../types';
|
|
22
|
-
|
|
23
|
-
export type ChatCompanionProps = {
|
|
24
|
-
role?: string;
|
|
25
|
-
data: { subject: Assistant.Chat | 'assistant-chat'; companionTo: Obj.Any };
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const ChatCompanion = ({ role, data }: ChatCompanionProps) => {
|
|
29
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
30
|
-
const blueprintRegistry = useBlueprintRegistry();
|
|
31
|
-
const companionTo = data.companionTo;
|
|
32
|
-
|
|
33
|
-
const space = getSpace(companionTo);
|
|
34
|
-
const [chat, setChat] = useState(data.subject === 'assistant-chat' ? undefined : data.subject);
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
setChat(data.subject === 'assistant-chat' ? undefined : data.subject);
|
|
37
|
-
}, [data.subject]);
|
|
38
|
-
|
|
39
|
-
const chatQueue = space && chat ? space.queues.get(chat.queue.dxn) : undefined;
|
|
40
|
-
const binder = useContextBinder(chatQueue);
|
|
41
|
-
|
|
42
|
-
// Initialize companion chat if it doesn't exist, but don't add it to the space immediately.
|
|
43
|
-
useAsyncEffect(async () => {
|
|
44
|
-
if (!space || chat) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const { data } = await dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
49
|
-
setChat(data?.object);
|
|
50
|
-
}, [chat, space]);
|
|
51
|
-
|
|
52
|
-
// Add chat to space when user submits the first message.
|
|
53
|
-
const handleEvent = useCallback(
|
|
54
|
-
async (event: ChatEvent) => {
|
|
55
|
-
const chatInSpace = !!getSpace(chat);
|
|
56
|
-
if (chatInSpace || !chat || !space) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (event.type === 'submit') {
|
|
61
|
-
await dispatch(
|
|
62
|
-
createIntent(SpaceAction.AddObject, {
|
|
63
|
-
object: chat,
|
|
64
|
-
target: space,
|
|
65
|
-
hidden: true,
|
|
66
|
-
}),
|
|
67
|
-
);
|
|
68
|
-
await dispatch(
|
|
69
|
-
createIntent(SpaceAction.AddRelation, {
|
|
70
|
-
space,
|
|
71
|
-
schema: Assistant.CompanionTo,
|
|
72
|
-
source: chat,
|
|
73
|
-
target: companionTo,
|
|
74
|
-
}),
|
|
75
|
-
);
|
|
76
|
-
await dispatch(
|
|
77
|
-
createIntent(AssistantAction.SetCurrentChat, {
|
|
78
|
-
companionTo,
|
|
79
|
-
chat,
|
|
80
|
-
}),
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
[chat, space, companionTo, dispatch],
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
const metadata = useCapabilities(Capabilities.Metadata);
|
|
88
|
-
const blueprintKeys = useMemo(
|
|
89
|
-
() =>
|
|
90
|
-
Function.pipe(
|
|
91
|
-
metadata,
|
|
92
|
-
Array.findFirst(
|
|
93
|
-
(
|
|
94
|
-
capability,
|
|
95
|
-
): capability is {
|
|
96
|
-
id: string;
|
|
97
|
-
metadata: { blueprints?: string[] };
|
|
98
|
-
} => capability.id === Obj.getTypename(companionTo),
|
|
99
|
-
),
|
|
100
|
-
Option.flatMap((c) => Option.fromNullable(c.metadata.blueprints)),
|
|
101
|
-
Option.getOrElse(() => [] as string[]),
|
|
102
|
-
),
|
|
103
|
-
[metadata, companionTo],
|
|
104
|
-
);
|
|
105
|
-
const existingBlueprints = useQuery(space, Filter.type(Blueprint.Blueprint));
|
|
106
|
-
const pluginBlueprints = useMemo(
|
|
107
|
-
() => existingBlueprints.filter((blueprint) => blueprintKeys.includes(blueprint.key)),
|
|
108
|
-
[existingBlueprints, blueprintKeys],
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
// Initialize related blueprints that are not already in the space.
|
|
112
|
-
useAsyncEffect(async () => {
|
|
113
|
-
if (!space) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// NOTE: This must be run instead of using the useQuery result to avoid duplicates.
|
|
118
|
-
const { objects: existingBlueprints } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
119
|
-
for (const key of blueprintKeys) {
|
|
120
|
-
const existingBlueprint = existingBlueprints.find((blueprint) => blueprint.key === key);
|
|
121
|
-
if (existingBlueprint) {
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const blueprint = blueprintRegistry.getByKey(key);
|
|
126
|
-
if (!blueprint) {
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
space.db.add(Obj.clone(blueprint));
|
|
131
|
-
}
|
|
132
|
-
}, [space, blueprintRegistry, blueprintKeys]);
|
|
133
|
-
|
|
134
|
-
useAsyncEffect(async () => {
|
|
135
|
-
if (!binder?.isOpen) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (pluginBlueprints.length > 0) {
|
|
140
|
-
await binder.bind({
|
|
141
|
-
blueprints: pluginBlueprints.map((blueprint) => Ref.make(blueprint)),
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (Obj.instanceOf(Blueprint.Blueprint, companionTo)) {
|
|
146
|
-
await binder.bind({ blueprints: [Ref.make(companionTo)] });
|
|
147
|
-
} else {
|
|
148
|
-
await binder.bind({ objects: [Ref.make(companionTo)] });
|
|
149
|
-
}
|
|
150
|
-
}, [binder, companionTo, blueprintKeys]);
|
|
151
|
-
|
|
152
|
-
return <ChatContainer role={role} space={space} chat={chat} companionTo={companionTo} onEvent={handleEvent} />;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
export default ChatCompanion;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities } from '@dxos/app-framework';
|
|
8
|
-
import { useCapability } from '@dxos/app-framework/react';
|
|
9
|
-
import { type Space, getSpace } from '@dxos/client/echo';
|
|
10
|
-
import { type Obj } from '@dxos/echo';
|
|
11
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
12
|
-
|
|
13
|
-
import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '../hooks';
|
|
14
|
-
import { meta } from '../meta';
|
|
15
|
-
import { type Assistant } from '../types';
|
|
16
|
-
|
|
17
|
-
import { Chat, type ChatRootProps } from './Chat';
|
|
18
|
-
|
|
19
|
-
export type ChatContainerProps = {
|
|
20
|
-
role?: string;
|
|
21
|
-
space?: Space;
|
|
22
|
-
chat?: Assistant.Chat;
|
|
23
|
-
companionTo?: Obj.Any;
|
|
24
|
-
} & Pick<ChatRootProps, 'onEvent'>;
|
|
25
|
-
|
|
26
|
-
export const ChatContainer = ({ space: spaceProp, chat, companionTo, onEvent }: ChatContainerProps) => {
|
|
27
|
-
const space = spaceProp ?? getSpace(chat);
|
|
28
|
-
const settings = useCapability(Capabilities.SettingsStore).getStore<Assistant.Settings>(meta.id)?.value;
|
|
29
|
-
const services = useChatServices({ space, chat });
|
|
30
|
-
const [online, setOnline] = useOnline();
|
|
31
|
-
const { preset, ...chatProps } = usePresets(online);
|
|
32
|
-
const blueprintRegistry = useBlueprintRegistry();
|
|
33
|
-
const processor = useChatProcessor({
|
|
34
|
-
space,
|
|
35
|
-
chat,
|
|
36
|
-
preset,
|
|
37
|
-
services,
|
|
38
|
-
blueprintRegistry,
|
|
39
|
-
settings,
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
if (!processor) {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<StackItem.Content toolbar>
|
|
48
|
-
<Chat.Root space={space} chat={chat} processor={processor} onEvent={onEvent}>
|
|
49
|
-
<Chat.Toolbar companionTo={companionTo} />
|
|
50
|
-
<Chat.Viewport classNames='container-max-width'>
|
|
51
|
-
<Chat.Thread />
|
|
52
|
-
<div role='none' className='p-4'>
|
|
53
|
-
<Chat.Prompt {...chatProps} outline preset={preset?.id} online={online} onOnlineChange={setOnline} />
|
|
54
|
-
</div>
|
|
55
|
-
</Chat.Viewport>
|
|
56
|
-
</Chat.Root>
|
|
57
|
-
</StackItem.Content>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export default ChatContainer;
|