@dxos/plugin-assistant 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6
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-PTNCDWC6.mjs +100 -0
- package/dist/lib/browser/AssistantSettings-PTNCDWC6.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +3 -7
- package/dist/lib/browser/chunk-EZRS3J25.mjs +30 -0
- package/dist/lib/browser/chunk-EZRS3J25.mjs.map +7 -0
- package/dist/lib/browser/chunk-OWBVGFDF.mjs +345 -0
- package/dist/lib/browser/chunk-OWBVGFDF.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/chunk-YD4JTOO5.mjs +173 -0
- package/dist/lib/browser/chunk-YD4JTOO5.mjs.map +7 -0
- package/dist/lib/browser/create-chat-6G6WROW2.mjs +89 -0
- package/dist/lib/browser/create-chat-6G6WROW2.mjs.map +7 -0
- package/dist/lib/browser/ensure-companion-chat-F46BGW2T.mjs +65 -0
- package/dist/lib/browser/ensure-companion-chat-F46BGW2T.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2458 -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-F5HHB3GI.mjs +22 -0
- package/dist/lib/browser/on-create-space-F5HHB3GI.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-5Y7FT4CQ.mjs +22 -0
- package/dist/lib/browser/resolve-navigation-targets-5Y7FT4CQ.mjs.map +7 -0
- package/dist/lib/browser/run-prompt-in-new-chat-XSPRWOSR.mjs +144 -0
- package/dist/lib/browser/run-prompt-in-new-chat-XSPRWOSR.mjs.map +7 -0
- package/dist/lib/browser/set-current-chat-JPWBMS7N.mjs +35 -0
- package/dist/lib/browser/set-current-chat-JPWBMS7N.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -4
- package/dist/lib/browser/update-chat-name-AEMFSIJX.mjs +60 -0
- package/dist/lib/browser/update-chat-name-AEMFSIJX.mjs.map +7 -0
- package/dist/lib/node-esm/AssistantSettings-Z5ZZWWSN.mjs +101 -0
- package/dist/lib/node-esm/AssistantSettings-Z5ZZWWSN.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-POJO5MTX.mjs +347 -0
- package/dist/lib/node-esm/chunk-POJO5MTX.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/chunk-QHPGS4A4.mjs +174 -0
- package/dist/lib/node-esm/chunk-QHPGS4A4.mjs.map +7 -0
- package/dist/lib/node-esm/create-chat-EEMDTQRE.mjs +90 -0
- package/dist/lib/node-esm/create-chat-EEMDTQRE.mjs.map +7 -0
- package/dist/lib/node-esm/ensure-companion-chat-YAKJY7TB.mjs +66 -0
- package/dist/lib/node-esm/ensure-companion-chat-YAKJY7TB.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +2458 -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-YE5NQ3D2.mjs +23 -0
- package/dist/lib/node-esm/on-create-space-YE5NQ3D2.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-W3GTFXDD.mjs +23 -0
- package/dist/lib/node-esm/resolve-navigation-targets-W3GTFXDD.mjs.map +7 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-Q2CLUUM4.mjs +145 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-Q2CLUUM4.mjs.map +7 -0
- package/dist/lib/node-esm/set-current-chat-ZBEFWS6P.mjs +36 -0
- package/dist/lib/node-esm/set-current-chat-ZBEFWS6P.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -4
- package/dist/lib/node-esm/update-chat-name-6F7COUGR.mjs +61 -0
- package/dist/lib/node-esm/update-chat-name-6F7COUGR.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 +511 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/index.d.ts +2 -1
- package/dist/types/src/components/AssistantSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +23 -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.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 +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +491 -299
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- 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 +487 -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 +487 -295
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +4 -4
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +14 -8
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +487 -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/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 +3 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +14 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts +3 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatContainer}/ChatContainer.d.ts +7 -6
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts +3 -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 +3 -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 +3 -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 +3 -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 +3 -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 +517 -0
- package/dist/types/src/containers/PromptList/PromptList.stories.d.ts.map +1 -0
- package/dist/types/src/containers/PromptList/index.d.ts +3 -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 +3 -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/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 +134 -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/processor.d.ts +27 -28
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/update-name.d.ts +2 -2
- package/dist/types/src/processor/update-name.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 +487 -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 +117 -92
- package/src/AssistantPlugin.tsx +151 -53
- 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 +208 -0
- package/src/capabilities/blueprint-definition.ts +58 -0
- package/src/capabilities/companion-chat-provisioner.ts +165 -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 +39 -0
- package/src/capabilities/migrations.ts +34 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +153 -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 +35 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +104 -92
- package/src/components/AssistantSettings/index.ts +4 -2
- package/src/components/Chat/Chat.tsx +72 -42
- package/src/components/ChatProgress/ChatProgress.tsx +9 -7
- package/src/components/ChatPrompt/ChatActions.tsx +12 -4
- package/src/components/ChatPrompt/ChatOptions.tsx +43 -29
- package/src/components/ChatPrompt/ChatReferences.tsx +18 -8
- package/src/components/ChatThread/ChatThread.stories.tsx +16 -16
- package/src/components/ChatThread/ChatThread.tsx +19 -6
- package/src/components/ChatThread/Link.tsx +1 -1
- package/src/components/ChatThread/registry.tsx +51 -18
- package/src/components/ChatThread/sync.test.ts +9 -7
- package/src/components/ChatThread/sync.ts +14 -8
- 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 -8
- package/src/components/TemplateEditor/TemplateEditor.tsx +50 -42
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +7 -5
- package/src/components/TemplateEditor/TemplateForm.tsx +9 -10
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +4 -4
- package/src/components/ToolBlock/ToolBlock.tsx +20 -20
- package/src/components/Toolbox/Toolbox.stories.tsx +4 -5
- package/src/components/Toolbox/Toolbox.tsx +65 -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/BlueprintArticle/BlueprintArticle.tsx +29 -0
- package/src/containers/BlueprintArticle/index.ts +7 -0
- package/src/{components → containers/ChatCompanion}/ChatCompanion.tsx +23 -43
- package/src/containers/ChatCompanion/index.ts +7 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +95 -0
- package/src/containers/ChatContainer/index.ts +7 -0
- package/src/{components → containers/ChatDialog}/ChatDialog.tsx +10 -12
- package/src/containers/ChatDialog/index.ts +7 -0
- package/src/containers/ProjectArticle/ProjectArticle.tsx +127 -0
- package/src/containers/ProjectArticle/index.ts +7 -0
- package/src/containers/ProjectSettings/ProjectSettings.tsx +139 -0
- package/src/containers/ProjectSettings/index.ts +7 -0
- package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
- package/src/containers/PromptArticle/index.ts +7 -0
- package/src/containers/PromptList/PromptList.stories.tsx +130 -0
- package/src/containers/PromptList/PromptList.tsx +49 -0
- package/src/containers/PromptList/index.ts +7 -0
- package/src/containers/TracePanel/TracePanel.tsx +258 -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 +7 -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 +21 -15
- package/src/hooks/useChatServices.ts +7 -28
- package/src/hooks/useChatToolbarActions.ts +13 -12
- package/src/hooks/useContextObjects.ts +8 -4
- package/src/hooks/useFilteredTypes.ts +3 -3
- package/src/hooks/usePresets.ts +1 -1
- package/src/hooks/useReferencesProvider.ts +1 -5
- package/src/index.ts +1 -1
- package/src/meta.ts +5 -2
- package/src/operations/create-chat.ts +79 -0
- package/src/operations/definitions.ts +126 -0
- package/src/operations/ensure-companion-chat.ts +59 -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 +114 -0
- package/src/operations/set-current-chat.ts +35 -0
- package/src/operations/update-chat-name.ts +55 -0
- package/src/processor/processor.test.ts +16 -49
- package/src/processor/processor.ts +158 -127
- package/src/processor/update-name.ts +4 -5
- package/src/queue-logger.ts +2 -2
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +2 -2
- package/src/translations.ts +125 -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-ECQYUQ2B.mjs +0 -153
- package/dist/lib/browser/ChatCompanion-ECQYUQ2B.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-QCCOFBUX.mjs +0 -73
- package/dist/lib/browser/ChatContainer-QCCOFBUX.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-SMK4RSZU.mjs +0 -85
- package/dist/lib/browser/ChatDialog-SMK4RSZU.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-3JYPE2MM.mjs +0 -1832
- package/dist/lib/browser/chunk-3JYPE2MM.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-NCITRSJJ.mjs +0 -109
- package/dist/lib/browser/react-surface-NCITRSJJ.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-Q4FUZ2MW.mjs +0 -154
- package/dist/lib/node-esm/ChatCompanion-Q4FUZ2MW.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-AKI33HIB.mjs +0 -74
- package/dist/lib/node-esm/ChatContainer-AKI33HIB.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-AP45PVZR.mjs +0 -86
- package/dist/lib/node-esm/ChatDialog-AP45PVZR.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-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-XI5T3MJC.mjs +0 -1833
- package/dist/lib/node-esm/chunk-XI5T3MJC.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-ST6V7LPE.mjs +0 -110
- package/dist/lib/node-esm/react-surface-ST6V7LPE.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.map +0 -1
- package/dist/types/src/components/ChatDialog.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/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/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/types/AssistantAction.ts +0 -75
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import { Obj, type Type } from '@dxos/echo';
|
|
6
6
|
|
|
7
|
-
import { type ApiAuthorization, type BaseServiceRegistry, ServiceType, categoryIcons } from '
|
|
7
|
+
import { type ApiAuthorization, type BaseServiceRegistry, ServiceType, categoryIcons } from '#types';
|
|
8
8
|
|
|
9
|
-
const ServiceTypeSchema = ServiceType as unknown as Type.
|
|
9
|
+
const ServiceTypeSchema = ServiceType as unknown as Type.AnyObj;
|
|
10
10
|
|
|
11
11
|
export class MockServiceRegistry implements BaseServiceRegistry {
|
|
12
12
|
async queryServices(): Promise<ServiceType[]> {
|
package/src/translations.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Chat, Project } from '@dxos/assistant-toolkit';
|
|
5
6
|
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
6
7
|
import { Sequence } from '@dxos/conductor';
|
|
7
8
|
import { Type } from '@dxos/echo';
|
|
8
9
|
import { type Resource } from '@dxos/react-ui';
|
|
9
10
|
|
|
10
|
-
import { meta } from '
|
|
11
|
-
import { Assistant } from './types';
|
|
11
|
+
import { meta } from '#meta';
|
|
12
12
|
|
|
13
13
|
// TODO(burdon): Standardize translation names.
|
|
14
14
|
export const translations = [
|
|
@@ -16,103 +16,145 @@ export const translations = [
|
|
|
16
16
|
'en-US': {
|
|
17
17
|
// TODO(burdon): From assistant.
|
|
18
18
|
[Blueprint.Blueprint.typename]: {
|
|
19
|
-
'typename
|
|
20
|
-
'typename
|
|
21
|
-
'typename
|
|
22
|
-
'typename
|
|
23
|
-
'object
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'object
|
|
19
|
+
'typename.label': 'Blueprint',
|
|
20
|
+
'typename.label_zero': 'Blueprints',
|
|
21
|
+
'typename.label_one': 'Blueprint',
|
|
22
|
+
'typename.label_other': 'Blueprints',
|
|
23
|
+
'object-name.placeholder': 'New blueprint',
|
|
24
|
+
'add-object.label': 'Add blueprint',
|
|
25
|
+
'rename-object.label': 'Rename blueprint',
|
|
26
|
+
'delete-object.label': 'Delete blueprint',
|
|
27
|
+
'object-deleted.label': 'Blueprint deleted',
|
|
27
28
|
},
|
|
28
29
|
[Type.getTypename(Prompt.Prompt)]: {
|
|
29
|
-
'typename
|
|
30
|
-
'typename
|
|
31
|
-
'typename
|
|
32
|
-
'typename
|
|
33
|
-
'object
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'object
|
|
30
|
+
'typename.label': 'Prompt',
|
|
31
|
+
'typename.label_zero': 'Prompts',
|
|
32
|
+
'typename.label_one': 'Prompt',
|
|
33
|
+
'typename.label_other': 'Prompts',
|
|
34
|
+
'object-name.placeholder': 'New prompt',
|
|
35
|
+
'add-object.label': 'Add prompt',
|
|
36
|
+
'rename-object.label': 'Rename prompt',
|
|
37
|
+
'delete-object.label': 'Delete prompt',
|
|
38
|
+
'object-deleted.label': 'Prompt deleted',
|
|
37
39
|
},
|
|
38
40
|
// TODO(burdon): From conductor.
|
|
39
41
|
[Sequence.typename]: {
|
|
40
|
-
'typename
|
|
41
|
-
'typename
|
|
42
|
-
'typename
|
|
43
|
-
'typename
|
|
44
|
-
'object
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
'object
|
|
42
|
+
'typename.label': 'Sequence',
|
|
43
|
+
'typename.label_zero': 'Sequences',
|
|
44
|
+
'typename.label_one': 'Sequence',
|
|
45
|
+
'typename.label_other': 'Sequences',
|
|
46
|
+
'object-name.placeholder': 'New sequence',
|
|
47
|
+
'add-object.label': 'Add sequence',
|
|
48
|
+
'rename-object.label': 'Rename sequence',
|
|
49
|
+
'delete-object.label': 'Delete sequence',
|
|
50
|
+
'object-deleted.label': 'Sequence deleted',
|
|
48
51
|
},
|
|
49
|
-
[
|
|
50
|
-
'typename
|
|
51
|
-
'object
|
|
52
|
-
'
|
|
53
|
-
'
|
|
54
|
-
'object
|
|
52
|
+
[Chat.Chat.typename]: {
|
|
53
|
+
'typename.label': 'AI Chat',
|
|
54
|
+
'object-name.placeholder': 'New AI Chat',
|
|
55
|
+
'add-object.label': 'Add AI chat',
|
|
56
|
+
'rename-object.label': 'Rename AI Chat',
|
|
57
|
+
'delete-object.label': 'Delete AI Chat',
|
|
58
|
+
'object-deleted.label': 'AI Chat deleted',
|
|
59
|
+
},
|
|
60
|
+
[Project.Project.typename]: {
|
|
61
|
+
'typename.label': 'Project',
|
|
62
|
+
'typename.label_zero': 'Projects',
|
|
63
|
+
'typename.label_one': 'Project',
|
|
64
|
+
'typename.label_other': 'Projects',
|
|
65
|
+
'object-name.placeholder': 'New project',
|
|
66
|
+
'add-object.label': 'Add project',
|
|
67
|
+
'rename-object.label': 'Rename project',
|
|
68
|
+
'delete-object.label': 'Delete project',
|
|
69
|
+
'object-deleted.label': 'Project deleted',
|
|
55
70
|
},
|
|
56
71
|
// TODO(burdon): Reconcile with react-ui-chat.
|
|
57
72
|
[meta.id]: {
|
|
58
|
-
'templates
|
|
59
|
-
'open
|
|
60
|
-
'assistant
|
|
61
|
-
'plugin
|
|
62
|
-
'settings
|
|
63
|
-
'object
|
|
64
|
-
'create
|
|
65
|
-
'create
|
|
66
|
-
'create
|
|
67
|
-
'command
|
|
68
|
-
'template
|
|
69
|
-
'value
|
|
70
|
-
'prompt
|
|
71
|
-
'typename
|
|
72
|
-
'description
|
|
73
|
-
'select
|
|
74
|
-
'service
|
|
75
|
-
'type
|
|
76
|
-
'any
|
|
77
|
-
'no
|
|
78
|
-
'tool
|
|
79
|
-
'tool
|
|
80
|
-
'tool
|
|
73
|
+
'templates.label': 'Templates',
|
|
74
|
+
'open-ambient-chat.label': 'Open Assistant',
|
|
75
|
+
'assistant-chat.label': 'Assistant',
|
|
76
|
+
'plugin.name': 'Assistant',
|
|
77
|
+
'settings.title': 'Assistant settings',
|
|
78
|
+
'object.placeholder': 'New prompt',
|
|
79
|
+
'create-object.label': 'Create prompt',
|
|
80
|
+
'create-trigger.label': 'Create trigger',
|
|
81
|
+
'create-stack-section.label': 'Create prompt',
|
|
82
|
+
'command.placeholder': 'Enter slash command...',
|
|
83
|
+
'template.placeholder': 'Enter template...',
|
|
84
|
+
'value.placeholder': 'Enter value...',
|
|
85
|
+
'prompt-rules.label': 'Prompt Rules',
|
|
86
|
+
'typename.placeholder': 'Enter typename of objects which this template is for',
|
|
87
|
+
'description.placeholder': 'Enter description of when this template should be used',
|
|
88
|
+
'select-preset-template.placeholder': 'Select preset',
|
|
89
|
+
'service-registry.label': 'Service Registry',
|
|
90
|
+
'type-filter.placeholder': 'Type',
|
|
91
|
+
'any-type-filter.label': 'Any',
|
|
92
|
+
'no-blueprint.message': 'No active blueprints',
|
|
93
|
+
'tool-call.label': 'Calling tool...',
|
|
94
|
+
'tool-result.label': 'Success',
|
|
95
|
+
'tool-error.label': 'Tool call failed',
|
|
96
|
+
|
|
97
|
+
'invocations.label': 'Invocations',
|
|
98
|
+
'trace.label': 'Trace',
|
|
99
|
+
|
|
100
|
+
'assistant-dialog.title': 'Assistant',
|
|
101
|
+
'open-assistant.label': 'Open assistant',
|
|
102
|
+
'reset-blueprints.label': 'Reset blueprints',
|
|
103
|
+
|
|
104
|
+
'no-results.message': 'No results',
|
|
81
105
|
|
|
82
|
-
'
|
|
106
|
+
'cancel.button': 'Cancel',
|
|
107
|
+
'save.button': 'Save',
|
|
108
|
+
'new-thread.button': 'New Chat',
|
|
109
|
+
'rename-thread.button': 'Rename Chat',
|
|
110
|
+
'chat-history.label': 'Chat History',
|
|
111
|
+
'chat-update-name.label': 'Update AI Chat name',
|
|
83
112
|
|
|
84
|
-
'
|
|
85
|
-
'
|
|
113
|
+
'toolkit.label': 'Toolkit',
|
|
114
|
+
'stats.label': 'Stats',
|
|
86
115
|
|
|
87
|
-
'
|
|
88
|
-
'
|
|
116
|
+
'search.placeholder': 'Search...',
|
|
117
|
+
'prompt.placeholder': 'Enter question or command...',
|
|
118
|
+
'context-objects.button': 'Add to context',
|
|
119
|
+
'context-settings.button': 'Chat settings',
|
|
120
|
+
'microphone.button': 'Click to speak',
|
|
121
|
+
'cancel-processing.button': 'Stop processing',
|
|
122
|
+
'blueprints-in-context.title': 'Blueprints',
|
|
123
|
+
'objects-in-context.title': 'Content',
|
|
124
|
+
'remove-object-in-context.label': 'Remove document',
|
|
125
|
+
'chat-model.title': 'Model',
|
|
89
126
|
|
|
90
|
-
'
|
|
91
|
-
'
|
|
92
|
-
'
|
|
93
|
-
'
|
|
94
|
-
'
|
|
95
|
-
'
|
|
127
|
+
'settings.default.label': 'Default',
|
|
128
|
+
'settings.custom-prompts.label': 'Use custom prompts',
|
|
129
|
+
'settings.custom-prompts.description': 'Allow the assistant to use custom prompts defined in your spaces.',
|
|
130
|
+
'settings.llm-provider.label': 'LLM provider',
|
|
131
|
+
'settings.llm-provider.description': 'Select which language model service to use for AI responses.',
|
|
132
|
+
'settings.edge-llm-model.label': 'Remote language model',
|
|
133
|
+
'settings.edge-llm-model.description': 'Choose the remote language model used for AI requests.',
|
|
134
|
+
'settings.ollama-llm-model.label': 'Ollama language model',
|
|
135
|
+
'settings.ollama-llm-model.description': 'Choose the locally hosted Ollama model for AI requests.',
|
|
136
|
+
'settings.default-llm-model.label': 'Default language model',
|
|
96
137
|
|
|
97
|
-
|
|
98
|
-
'
|
|
138
|
+
// Trigger status
|
|
139
|
+
'trigger-status-disabled.label': 'Triggers disabled',
|
|
140
|
+
'trigger-status-idle.label': 'Triggers idle',
|
|
141
|
+
'trigger-status-running.label': 'Trigger running',
|
|
142
|
+
'trigger-status-error.label': 'Trigger error',
|
|
143
|
+
'trigger-runtime.label': 'Auto trigger execution',
|
|
144
|
+
'trigger-last-invocation.label': 'Last run',
|
|
145
|
+
'trigger-duration.label': 'Duration',
|
|
99
146
|
|
|
100
|
-
'
|
|
101
|
-
'
|
|
102
|
-
'
|
|
103
|
-
'
|
|
104
|
-
'
|
|
105
|
-
'
|
|
106
|
-
'blueprints in context title': 'Blueprints',
|
|
107
|
-
'objects in context title': 'Content',
|
|
108
|
-
'remove object in context label': 'Remove document',
|
|
109
|
-
'chat model title': 'Model',
|
|
147
|
+
'debug.button': 'Debug',
|
|
148
|
+
'online-switch.label': 'Online',
|
|
149
|
+
'run-prompt.label': 'Run prompt',
|
|
150
|
+
'typename.label': 'Typename',
|
|
151
|
+
'branch-thread.menu': 'Branch chat',
|
|
152
|
+
'chat-toolbar.title': 'Chat toolbar',
|
|
110
153
|
|
|
111
|
-
|
|
112
|
-
'
|
|
113
|
-
'
|
|
114
|
-
'
|
|
115
|
-
'settings ollama llm model label': 'Ollama language model',
|
|
154
|
+
// ProjectSettings
|
|
155
|
+
'instructions.label': 'Instructions',
|
|
156
|
+
'reset-history.button': 'Reset',
|
|
157
|
+
'subscriptions.label': 'Subscriptions',
|
|
116
158
|
},
|
|
117
159
|
},
|
|
118
160
|
},
|
package/src/types/Assistant.ts
CHANGED
|
@@ -2,61 +2,13 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { Chat as ChatModule } from '@dxos/assistant-toolkit';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
// Re-export Chat schema for backward compatibility.
|
|
8
|
+
export const Chat = ChatModule.Chat;
|
|
9
|
+
export type Chat = ChatModule.Chat;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*/
|
|
16
|
-
export const Chat = Schema.Struct({
|
|
17
|
-
name: Schema.String.pipe(Schema.optional),
|
|
18
|
-
queue: Type.Ref(Queue).pipe(FormInputAnnotation.set(false)),
|
|
19
|
-
// TODO(dmaretskyi): Eventually this and the message queue will be the same.
|
|
20
|
-
traceQueue: Type.Ref(Queue).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
21
|
-
}).pipe(
|
|
22
|
-
Type.object({
|
|
23
|
-
typename: 'dxos.org/type/assistant/Chat',
|
|
24
|
-
version: '0.2.0',
|
|
25
|
-
}),
|
|
26
|
-
LabelAnnotation.set(['name']),
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
export interface Chat extends Schema.Schema.Type<typeof Chat> {}
|
|
30
|
-
|
|
31
|
-
export const make = (props: Obj.MakeProps<typeof Chat>) => Obj.make(Chat, props);
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Relation between a Chat and companion objects (e.g., artifacts).
|
|
35
|
-
*/
|
|
36
|
-
export const CompanionTo = Schema.Struct({
|
|
37
|
-
id: Obj.ID,
|
|
38
|
-
}).pipe(
|
|
39
|
-
Type.relation({
|
|
40
|
-
typename: 'dxos.org/relation/assistant/CompanionTo',
|
|
41
|
-
version: '0.1.0',
|
|
42
|
-
source: Chat,
|
|
43
|
-
target: Type.Obj,
|
|
44
|
-
}),
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
export interface CompanionTo extends Schema.Schema.Type<typeof CompanionTo> {}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Plugin settings.
|
|
51
|
-
*/
|
|
52
|
-
export const Settings = Schema.mutable(
|
|
53
|
-
Schema.Struct({
|
|
54
|
-
llmProvider: Schema.optional(Schema.Literal(...LLM_PROVIDERS)),
|
|
55
|
-
edgeModel: Schema.optional(Schema.String),
|
|
56
|
-
ollamaModel: Schema.optional(Schema.String),
|
|
57
|
-
lmstudioModel: Schema.optional(Schema.String),
|
|
58
|
-
customPrompts: Schema.optional(Schema.Boolean),
|
|
59
|
-
}),
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
export type Settings = Schema.Schema.Type<typeof Settings>;
|
|
11
|
+
// Re-export Settings as merged const/type (not as namespace).
|
|
12
|
+
import * as SettingsModule from './Settings';
|
|
13
|
+
export const Settings = SettingsModule.Settings;
|
|
14
|
+
export type Settings = SettingsModule.Settings;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
import { LLM_PROVIDERS } from './defs';
|
|
10
|
+
|
|
11
|
+
export const Settings = Schema.mutable(
|
|
12
|
+
Schema.Struct({
|
|
13
|
+
llmProvider: Schema.optional(Schema.Literal(...LLM_PROVIDERS)),
|
|
14
|
+
edgeModel: Schema.optional(Schema.String),
|
|
15
|
+
ollamaModel: Schema.optional(Schema.String),
|
|
16
|
+
lmstudioModel: Schema.optional(Schema.String),
|
|
17
|
+
customPrompts: Schema.optional(Schema.Boolean),
|
|
18
|
+
}),
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export type Settings = Schema.Schema.Type<typeof Settings>;
|
|
@@ -6,22 +6,30 @@ import { type Atom } from '@effect-atom/atom-react';
|
|
|
6
6
|
import * as Schema from 'effect/Schema';
|
|
7
7
|
|
|
8
8
|
import { Capability } from '@dxos/app-framework';
|
|
9
|
+
import { type Obj } from '@dxos/echo';
|
|
9
10
|
|
|
10
|
-
import { meta } from '
|
|
11
|
+
import { meta } from '#meta';
|
|
11
12
|
|
|
12
13
|
import { type Assistant } from './';
|
|
13
14
|
|
|
14
15
|
export namespace AssistantCapabilities {
|
|
15
|
-
export const Settings = Capability.make<Atom.Writable<Assistant.Settings>>(`${meta.id}
|
|
16
|
+
export const Settings = Capability.make<Atom.Writable<Assistant.Settings>>(`${meta.id}.capability.settings`);
|
|
16
17
|
|
|
17
18
|
export const StateSchema = Schema.mutable(
|
|
18
19
|
Schema.Struct({
|
|
19
20
|
/** Map of primary object dxn to current chat dxn. */
|
|
20
21
|
currentChat: Schema.Record({ key: Schema.String, value: Schema.UndefinedOr(Schema.String) }),
|
|
22
|
+
/** Map of chat object path to prompt text to auto-submit when the chat opens. */
|
|
23
|
+
pendingPrompts: Schema.Record({ key: Schema.String, value: Schema.UndefinedOr(Schema.String) }),
|
|
21
24
|
}),
|
|
22
25
|
);
|
|
23
26
|
|
|
24
27
|
export type AssistantState = Schema.Schema.Type<typeof StateSchema>;
|
|
25
28
|
|
|
26
|
-
export const State = Capability.make<Atom.Writable<AssistantState>>(`${meta.id}
|
|
29
|
+
export const State = Capability.make<Atom.Writable<AssistantState>>(`${meta.id}.capability.state`);
|
|
30
|
+
|
|
31
|
+
/** Session-scoped cache of transient (not yet persisted) companion chats keyed by companion DXN string. */
|
|
32
|
+
export const CompanionChatCache = Capability.make<Atom.Writable<Record<string, Obj.Unknown | undefined>>>(
|
|
33
|
+
`${meta.id}.capability.companion-chat-cache`,
|
|
34
|
+
);
|
|
27
35
|
}
|
package/src/types/events.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { ActivationEvent } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
7
|
+
import { meta } from '#meta';
|
|
8
8
|
|
|
9
9
|
export namespace AssistantEvents {
|
|
10
|
-
export const SetupAiServiceProviders = ActivationEvent.make(`${meta.id}
|
|
10
|
+
export const SetupAiServiceProviders = ActivationEvent.make(`${meta.id}.event.setup-ai-service-providers`);
|
|
11
11
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// Re-export Chat type from assistant-toolkit for public API type declarations.
|
|
6
|
+
export type { Chat as ChatType } from '@dxos/assistant-toolkit';
|
|
7
|
+
|
|
5
8
|
export * as Assistant from './Assistant';
|
|
6
|
-
export { AssistantOperation } from './AssistantAction';
|
|
7
9
|
|
|
8
10
|
export * from './capabilities';
|
|
9
11
|
export * from './defs';
|
package/src/types/service.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
7
|
import { ComputeGraph } from '@dxos/conductor';
|
|
8
|
-
import { Type } from '@dxos/echo';
|
|
9
|
-
import {
|
|
8
|
+
import { Ref, Type } from '@dxos/echo';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
10
|
|
|
11
11
|
// TODO(burdon): Factor out and reconcile with https://github.com/dxos/dxos/blob/main/packages/plugins/plugin-token-manager/src/defs/presets.ts#L7
|
|
12
12
|
|
|
@@ -37,12 +37,12 @@ export type ApiAuthorization = Schema.Schema.Type<typeof ApiAuthorization>;
|
|
|
37
37
|
|
|
38
38
|
const ServiceInterfaceFunction = Schema.Struct({
|
|
39
39
|
kind: Schema.Literal('function'),
|
|
40
|
-
fn:
|
|
40
|
+
fn: Ref.Ref(Operation.PersistentOperation),
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
const ServiceInterfaceWorkflow = Schema.Struct({
|
|
44
44
|
kind: Schema.Literal('workflow'),
|
|
45
|
-
workflow:
|
|
45
|
+
workflow: Ref.Ref(ComputeGraph),
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
const ServiceInterfaceApi = Schema.Struct({
|
|
@@ -86,7 +86,7 @@ export const ServiceType = Schema.Struct({
|
|
|
86
86
|
interfaces: Schema.optional(Schema.Array(ServiceInterface)),
|
|
87
87
|
}).pipe(
|
|
88
88
|
Type.object({
|
|
89
|
-
typename: 'dxos.
|
|
89
|
+
typename: 'org.dxos.type.service',
|
|
90
90
|
version: '0.1.0',
|
|
91
91
|
}),
|
|
92
92
|
);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TemplateEditor
|
|
3
|
-
} from "./chunk-DKQMSMBN.mjs";
|
|
4
|
-
import "./chunk-EXVT7D4B.mjs";
|
|
5
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
6
|
-
|
|
7
|
-
// src/components/BlueprintArticle.tsx
|
|
8
|
-
import React from "react";
|
|
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
|
-
var BlueprintArticle = ({ role, subject }) => {
|
|
14
|
-
const { hasAttention } = useAttention(Obj.getDXN(subject).toString());
|
|
15
|
-
return /* @__PURE__ */ React.createElement(Layout.Main, {
|
|
16
|
-
role,
|
|
17
|
-
toolbar: true
|
|
18
|
-
}, /* @__PURE__ */ React.createElement(Toolbar.Root, {
|
|
19
|
-
disabled: !hasAttention
|
|
20
|
-
}), /* @__PURE__ */ React.createElement(TemplateEditor, {
|
|
21
|
-
id: subject.id,
|
|
22
|
-
template: subject.instructions,
|
|
23
|
-
classNames: "container-max-width"
|
|
24
|
-
}));
|
|
25
|
-
};
|
|
26
|
-
var BlueprintArticle_default = BlueprintArticle;
|
|
27
|
-
export {
|
|
28
|
-
BlueprintArticle,
|
|
29
|
-
BlueprintArticle_default as default
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=BlueprintArticle-WP3G5GLG.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/BlueprintArticle.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-framework/react';\nimport { type Blueprint } from '@dxos/blueprints';\nimport { Obj } from '@dxos/echo';\nimport { Toolbar } from '@dxos/react-ui';\nimport { useAttention } from '@dxos/react-ui-attention';\nimport { Layout } from '@dxos/react-ui-mosaic';\n\nimport { TemplateEditor } from './TemplateEditor';\n\nexport type BlueprintArticleProps = SurfaceComponentProps<Blueprint.Blueprint>;\n\nexport const BlueprintArticle = ({ role, subject }: BlueprintArticleProps) => {\n const { hasAttention } = useAttention(Obj.getDXN(subject).toString());\n\n return (\n <Layout.Main role={role} toolbar>\n <Toolbar.Root disabled={!hasAttention} />\n <TemplateEditor id={subject.id} template={subject.instructions} classNames='container-max-width' />\n </Layout.Main>\n );\n};\n\nexport default BlueprintArticle;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,OAAOA,WAAW;AAIlB,SAASC,WAAW;AACpB,SAASC,eAAe;AACxB,SAASC,oBAAoB;AAC7B,SAASC,cAAc;AAMhB,IAAMC,mBAAmB,CAAC,EAAEC,MAAMC,QAAO,MAAyB;AACvE,QAAM,EAAEC,aAAY,IAAKC,aAAaC,IAAIC,OAAOJ,OAAAA,EAASK,SAAQ,CAAA;AAElE,SACE,sBAAA,cAACC,OAAOC,MAAI;IAACR;IAAYS,SAAAA;KACvB,sBAAA,cAACC,QAAQC,MAAI;IAACC,UAAU,CAACV;MACzB,sBAAA,cAACW,gBAAAA;IAAeC,IAAIb,QAAQa;IAAIC,UAAUd,QAAQe;IAAcC,YAAW;;AAGjF;AAEA,IAAA,2BAAelB;",
|
|
6
|
-
"names": ["React", "Obj", "Toolbar", "useAttention", "Layout", "BlueprintArticle", "role", "subject", "hasAttention", "useAttention", "Obj", "getDXN", "toString", "Layout", "Main", "toolbar", "Toolbar", "Root", "disabled", "TemplateEditor", "id", "template", "instructions", "classNames"]
|
|
7
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChatContainer,
|
|
3
|
-
useBlueprintRegistry,
|
|
4
|
-
useContextBinder
|
|
5
|
-
} from "./chunk-3JYPE2MM.mjs";
|
|
6
|
-
import "./chunk-ML3QCFKA.mjs";
|
|
7
|
-
import "./chunk-DKQMSMBN.mjs";
|
|
8
|
-
import {
|
|
9
|
-
AssistantOperation,
|
|
10
|
-
Assistant_exports
|
|
11
|
-
} from "./chunk-V772AMZM.mjs";
|
|
12
|
-
import "./chunk-EXVT7D4B.mjs";
|
|
13
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
14
|
-
|
|
15
|
-
// src/components/ChatCompanion.tsx
|
|
16
|
-
import * as Array from "effect/Array";
|
|
17
|
-
import * as Function from "effect/Function";
|
|
18
|
-
import * as Option from "effect/Option";
|
|
19
|
-
import React, { forwardRef, useCallback, useEffect, useMemo, useState } from "react";
|
|
20
|
-
import { Common } from "@dxos/app-framework";
|
|
21
|
-
import { useCapabilities, useOperationInvoker } from "@dxos/app-framework/react";
|
|
22
|
-
import { Blueprint } from "@dxos/blueprints";
|
|
23
|
-
import { getSpace } from "@dxos/client/echo";
|
|
24
|
-
import { Filter, Obj, Ref } from "@dxos/echo";
|
|
25
|
-
import { SpaceOperation } from "@dxos/plugin-space/types";
|
|
26
|
-
import { useQuery } from "@dxos/react-client/echo";
|
|
27
|
-
import { useAsyncEffect } from "@dxos/react-ui";
|
|
28
|
-
var ChatCompanion = /* @__PURE__ */ forwardRef(({ role, data }, forwardedRef) => {
|
|
29
|
-
const { invokePromise } = useOperationInvoker();
|
|
30
|
-
const blueprintRegistry = useBlueprintRegistry();
|
|
31
|
-
const companionTo = data.companionTo;
|
|
32
|
-
const space = getSpace(companionTo);
|
|
33
|
-
const [chat, setChat] = useState(data.subject === "assistant-chat" ? void 0 : data.subject);
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
setChat(data.subject === "assistant-chat" ? void 0 : data.subject);
|
|
36
|
-
}, [
|
|
37
|
-
data.subject
|
|
38
|
-
]);
|
|
39
|
-
const chatQueue = space && chat ? space.queues.get(chat.queue.dxn) : void 0;
|
|
40
|
-
const binder = useContextBinder(chatQueue);
|
|
41
|
-
useAsyncEffect(async () => {
|
|
42
|
-
if (!space || chat) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const { data: data2 } = await invokePromise(AssistantOperation.CreateChat, {
|
|
46
|
-
db: space.db
|
|
47
|
-
});
|
|
48
|
-
setChat(data2?.object);
|
|
49
|
-
}, [
|
|
50
|
-
chat,
|
|
51
|
-
space
|
|
52
|
-
]);
|
|
53
|
-
const handleEvent = useCallback(async (event) => {
|
|
54
|
-
const chatInSpace = !!getSpace(chat);
|
|
55
|
-
if (chatInSpace || !chat || !space) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (event.type === "submit") {
|
|
59
|
-
await invokePromise(SpaceOperation.AddObject, {
|
|
60
|
-
object: chat,
|
|
61
|
-
target: space.db,
|
|
62
|
-
hidden: true
|
|
63
|
-
});
|
|
64
|
-
await invokePromise(SpaceOperation.AddRelation, {
|
|
65
|
-
db: space.db,
|
|
66
|
-
schema: Assistant_exports.CompanionTo,
|
|
67
|
-
source: chat,
|
|
68
|
-
target: companionTo
|
|
69
|
-
});
|
|
70
|
-
await invokePromise(AssistantOperation.SetCurrentChat, {
|
|
71
|
-
companionTo,
|
|
72
|
-
chat
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}, [
|
|
76
|
-
chat,
|
|
77
|
-
space,
|
|
78
|
-
companionTo,
|
|
79
|
-
invokePromise
|
|
80
|
-
]);
|
|
81
|
-
const metadata = useCapabilities(Common.Capability.Metadata);
|
|
82
|
-
const blueprintKeys = useMemo(() => Function.pipe(metadata, Array.findFirst((capability) => capability.id === Obj.getTypename(companionTo)), Option.flatMap((c) => Option.fromNullable(c.metadata.blueprints)), Option.getOrElse(() => [])), [
|
|
83
|
-
metadata,
|
|
84
|
-
companionTo
|
|
85
|
-
]);
|
|
86
|
-
const existingBlueprints = useQuery(space?.db, Filter.type(Blueprint.Blueprint));
|
|
87
|
-
const pluginBlueprints = useMemo(() => existingBlueprints.filter((blueprint) => blueprintKeys.includes(blueprint.key)), [
|
|
88
|
-
existingBlueprints,
|
|
89
|
-
blueprintKeys
|
|
90
|
-
]);
|
|
91
|
-
useAsyncEffect(async () => {
|
|
92
|
-
if (!space) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
const existingBlueprints2 = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
96
|
-
for (const key of blueprintKeys) {
|
|
97
|
-
const existingBlueprint = existingBlueprints2.find((blueprint2) => blueprint2.key === key);
|
|
98
|
-
if (existingBlueprint) {
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
const blueprint = blueprintRegistry.getByKey(key);
|
|
102
|
-
if (!blueprint) {
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
space.db.add(Obj.clone(blueprint));
|
|
106
|
-
}
|
|
107
|
-
}, [
|
|
108
|
-
space,
|
|
109
|
-
blueprintRegistry,
|
|
110
|
-
blueprintKeys
|
|
111
|
-
]);
|
|
112
|
-
useAsyncEffect(async () => {
|
|
113
|
-
if (!binder?.isOpen) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
if (pluginBlueprints.length > 0) {
|
|
117
|
-
await binder.bind({
|
|
118
|
-
blueprints: pluginBlueprints.map((blueprint) => Ref.make(blueprint))
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
if (Obj.instanceOf(Blueprint.Blueprint, companionTo)) {
|
|
122
|
-
await binder.bind({
|
|
123
|
-
blueprints: [
|
|
124
|
-
Ref.make(companionTo)
|
|
125
|
-
]
|
|
126
|
-
});
|
|
127
|
-
} else {
|
|
128
|
-
await binder.bind({
|
|
129
|
-
objects: [
|
|
130
|
-
Ref.make(companionTo)
|
|
131
|
-
]
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
}, [
|
|
135
|
-
binder,
|
|
136
|
-
companionTo,
|
|
137
|
-
blueprintKeys
|
|
138
|
-
]);
|
|
139
|
-
return /* @__PURE__ */ React.createElement(ChatContainer, {
|
|
140
|
-
role,
|
|
141
|
-
space,
|
|
142
|
-
subject: chat,
|
|
143
|
-
companionTo,
|
|
144
|
-
onEvent: handleEvent,
|
|
145
|
-
ref: forwardedRef
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
var ChatCompanion_default = ChatCompanion;
|
|
149
|
-
export {
|
|
150
|
-
ChatCompanion,
|
|
151
|
-
ChatCompanion_default as default
|
|
152
|
-
};
|
|
153
|
-
//# sourceMappingURL=ChatCompanion-ECQYUQ2B.mjs.map
|