@dxos/plugin-assistant 0.8.4-main.67995b8 → 0.8.4-main.69d29f4
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/BlueprintArticle-WP3G5GLG.mjs +31 -0
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-ECQYUQ2B.mjs +153 -0
- package/dist/lib/browser/ChatCompanion-ECQYUQ2B.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-QCCOFBUX.mjs +73 -0
- package/dist/lib/browser/ChatContainer-QCCOFBUX.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-SMK4RSZU.mjs +85 -0
- package/dist/lib/browser/ChatDialog-SMK4RSZU.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs +53 -0
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs.map +7 -0
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs +21 -0
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs +212 -0
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs +14 -0
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +12 -0
- package/dist/lib/browser/blueprints/index.mjs.map +7 -0
- package/dist/lib/browser/chunk-3JYPE2MM.mjs +1832 -0
- package/dist/lib/browser/chunk-3JYPE2MM.mjs.map +7 -0
- package/dist/lib/browser/chunk-DKQMSMBN.mjs +326 -0
- package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +7 -0
- package/dist/lib/browser/chunk-EXVT7D4B.mjs +23 -0
- package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-ML3QCFKA.mjs +265 -0
- package/dist/lib/browser/chunk-ML3QCFKA.mjs.map +7 -0
- package/dist/lib/browser/chunk-MRJVYGLU.mjs +208 -0
- package/dist/lib/browser/chunk-MRJVYGLU.mjs.map +7 -0
- package/dist/lib/browser/chunk-V772AMZM.mjs +250 -0
- package/dist/lib/browser/chunk-V772AMZM.mjs.map +7 -0
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs +41 -0
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs +20 -0
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +264 -168
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs +19 -0
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs +132 -0
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs.map +7 -0
- package/dist/lib/browser/react-surface-NCITRSJJ.mjs +109 -0
- package/dist/lib/browser/react-surface-NCITRSJJ.mjs.map +7 -0
- package/dist/lib/browser/repair-6QGAKOVM.mjs +54 -0
- package/dist/lib/browser/repair-6QGAKOVM.mjs.map +7 -0
- package/dist/lib/browser/settings-4ZDLUMYE.mjs +32 -0
- package/dist/lib/browser/settings-4ZDLUMYE.mjs.map +7 -0
- package/dist/lib/browser/state-AN6336ZX.mjs +26 -0
- package/dist/lib/browser/state-AN6336ZX.mjs.map +7 -0
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs +18 -0
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +11 -4
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs +32 -0
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-Q4FUZ2MW.mjs +154 -0
- package/dist/lib/node-esm/ChatCompanion-Q4FUZ2MW.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-AKI33HIB.mjs +74 -0
- package/dist/lib/node-esm/ChatContainer-AKI33HIB.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-AP45PVZR.mjs +86 -0
- package/dist/lib/node-esm/ChatDialog-AP45PVZR.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs +54 -0
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs +22 -0
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs +213 -0
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs +15 -0
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +13 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-355W5B27.mjs +251 -0
- package/dist/lib/node-esm/chunk-355W5B27.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs +327 -0
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs +209 -0
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs +42 -0
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs +25 -0
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XI5T3MJC.mjs +1833 -0
- package/dist/lib/node-esm/chunk-XI5T3MJC.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs +267 -0
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs +21 -0
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +264 -168
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs +20 -0
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs +133 -0
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-ST6V7LPE.mjs +110 -0
- package/dist/lib/node-esm/react-surface-ST6V7LPE.mjs.map +7 -0
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs +55 -0
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs.map +7 -0
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs +33 -0
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs.map +7 -0
- package/dist/lib/node-esm/state-HDON4REW.mjs +27 -0
- package/dist/lib/node-esm/state-HDON4REW.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs +19 -0
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +11 -4
- 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 +209 -0
- package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +7 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts +5 -0
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service/index.d.ts +3 -0
- package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +21 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +4 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +6 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +11 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +12 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/index.d.ts +3 -0
- package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
- package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +15 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +17 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +11 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +13 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +5 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -2
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +7 -0
- package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -0
- package/dist/types/src/components/Chat/Chat.d.ts +33 -20
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +10 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +13 -0
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer.d.ts +15 -7
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +7 -0
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
- package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
- package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +5 -6
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +13 -11
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +198 -56
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +42 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/PromptArticle.d.ts +7 -0
- package/dist/types/src/components/PromptArticle.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +317 -7
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +12 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +314 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +21 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
- package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +9 -15
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +318 -5
- 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 +10 -6
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +4 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/object-list.d.ts +10 -0
- package/dist/types/src/functions/object-list.d.ts.map +1 -0
- package/dist/types/src/functions/object-load.d.ts +8 -0
- package/dist/types/src/functions/object-load.d.ts.map +1 -0
- package/dist/types/src/functions/object-search.d.ts +10 -0
- package/dist/types/src/functions/object-search.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +8 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +25 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +8 -19
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +7 -8
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +4 -0
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnline.d.ts +3 -0
- package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +7 -0
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/processor/index.d.ts +4 -0
- package/dist/types/src/processor/index.d.ts.map +1 -0
- package/dist/types/src/{hooks → processor}/presets.d.ts +3 -3
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +75 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts +2 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/processor/update-name.d.ts +10 -0
- package/dist/types/src/processor/update-name.d.ts.map +1 -0
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +8 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts +2 -2
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +262 -28
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +42 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +95 -0
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +33 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/defs.d.ts +2 -0
- package/dist/types/src/types/defs.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 +5 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +14 -213
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +124 -100
- package/src/AssistantPlugin.tsx +125 -113
- package/src/blueprints/assistant-blueprint.ts +62 -0
- package/src/blueprints/index.ts +12 -0
- package/src/capabilities/ai-service/ai-service.ts +29 -0
- package/src/capabilities/ai-service/index.ts +7 -0
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +180 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +60 -0
- package/src/capabilities/blueprint-definition/index.ts +8 -0
- package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +32 -0
- package/src/capabilities/edge-model-resolver/index.ts +7 -0
- package/src/capabilities/index.ts +11 -6
- package/src/capabilities/local-model-resolver/index.ts +7 -0
- package/src/capabilities/local-model-resolver/local-model-resolver.ts +37 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +110 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +95 -0
- package/src/capabilities/repair/index.ts +7 -0
- package/src/capabilities/repair/repair.ts +63 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +30 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +27 -0
- package/src/capabilities/toolkit/index.ts +7 -0
- package/src/capabilities/toolkit/toolkit.ts +26 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +92 -77
- package/src/components/BlueprintArticle.tsx +29 -0
- package/src/components/Chat/Chat.tsx +237 -194
- package/src/components/Chat/events.ts +14 -1
- package/src/components/ChatCompanion.tsx +163 -0
- package/src/components/ChatContainer.tsx +48 -32
- package/src/components/ChatDialog.tsx +28 -18
- package/src/components/ChatProgress/ChatProgress.tsx +54 -0
- package/src/components/{SequenceEditor → ChatProgress}/index.ts +1 -1
- package/src/components/ChatPrompt/ChatActions.tsx +11 -27
- package/src/components/ChatPrompt/ChatOptions.tsx +238 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +32 -38
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatPrompt/index.ts +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +123 -116
- package/src/components/ChatThread/ChatThread.tsx +66 -36
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/components/ChatThread/registry.tsx +174 -0
- package/src/components/ChatThread/sync.test.ts +97 -0
- package/src/components/ChatThread/sync.ts +154 -0
- package/src/components/ChatThread/testing/thread.md +37 -0
- package/src/components/PromptArticle.tsx +50 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +38 -17
- package/src/components/TemplateEditor/TemplateEditor.tsx +33 -54
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +28 -15
- package/src/components/TemplateEditor/TemplateForm.tsx +80 -31
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +274 -0
- package/src/components/TemplateEditor/extensions/index.ts +6 -0
- package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
- package/src/components/ToolBlock/ToolBlock.tsx +143 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +18 -28
- package/src/components/Toolbox/Toolbox.tsx +37 -68
- package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
- package/src/components/Typewriter/Typewriter.stories.tsx +83 -0
- package/src/components/Typewriter/Typewriter.tsx +54 -0
- package/src/components/Typewriter/assistant-extension.tsx +144 -0
- package/src/components/Typewriter/index.ts +5 -0
- package/src/components/index.ts +3 -7
- package/src/functions/index.ts +7 -0
- package/src/functions/object-list.ts +49 -0
- package/src/functions/object-load.ts +47 -0
- package/src/functions/object-search.ts +46 -0
- package/src/hooks/index.ts +8 -4
- package/src/hooks/useBlueprintRegistry.ts +105 -0
- package/src/hooks/useChatProcessor.ts +38 -104
- package/src/hooks/useChatServices.ts +31 -51
- package/src/hooks/useChatToolbarActions.ts +121 -0
- package/src/hooks/useContextBinder.ts +32 -0
- package/src/hooks/useContextObjects.ts +46 -0
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/useFlush.ts +35 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +44 -0
- package/src/hooks/useReferencesProvider.ts +15 -12
- package/src/index.ts +2 -1
- package/src/meta.ts +11 -8
- package/src/processor/index.ts +7 -0
- package/src/{hooks → processor}/presets.ts +16 -8
- package/src/processor/processor.test.ts +72 -0
- package/src/processor/processor.ts +275 -0
- package/src/processor/update-name.ts +59 -0
- package/src/queue-logger.ts +17 -18
- package/src/testing/index.ts +1 -1
- package/src/testing/test-generator.ts +262 -0
- package/src/testing/test-sequence.ts +2 -27
- package/src/testing/test-services.ts +10 -14
- package/src/translations.ts +49 -18
- package/src/types/Assistant.ts +62 -0
- package/src/types/AssistantAction.ts +75 -0
- package/src/types/capabilities.ts +27 -0
- package/src/types/defs.ts +5 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +6 -1
- package/src/types/service.ts +25 -14
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/BlueprintContainer-IZ4AK5EO.mjs +0 -28
- package/dist/lib/browser/BlueprintContainer-IZ4AK5EO.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-RP3QEXYX.mjs +0 -54
- package/dist/lib/browser/ChatContainer-RP3QEXYX.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-ZVLXFHEY.mjs +0 -72
- package/dist/lib/browser/ChatDialog-ZVLXFHEY.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs +0 -162
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-XSEOKJLG.mjs +0 -164
- package/dist/lib/browser/app-graph-builder-XSEOKJLG.mjs.map +0 -7
- package/dist/lib/browser/chunk-63GG6U6D.mjs +0 -2226
- package/dist/lib/browser/chunk-63GG6U6D.mjs.map +0 -7
- package/dist/lib/browser/chunk-7W7LHTRH.mjs +0 -171
- package/dist/lib/browser/chunk-7W7LHTRH.mjs.map +0 -7
- package/dist/lib/browser/chunk-FDCJSQYF.mjs +0 -40
- package/dist/lib/browser/chunk-FDCJSQYF.mjs.map +0 -7
- package/dist/lib/browser/chunk-KFXSBNZR.mjs +0 -89
- package/dist/lib/browser/chunk-KFXSBNZR.mjs.map +0 -7
- package/dist/lib/browser/chunk-LERGF5YG.mjs +0 -108
- package/dist/lib/browser/chunk-LERGF5YG.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MV3VSZLS.mjs +0 -75
- package/dist/lib/browser/intent-resolver-MV3VSZLS.mjs.map +0 -7
- package/dist/lib/browser/react-surface-3GYEHQRP.mjs +0 -150
- package/dist/lib/browser/react-surface-3GYEHQRP.mjs.map +0 -7
- package/dist/lib/browser/settings-5GTTCVGD.mjs +0 -22
- package/dist/lib/browser/settings-5GTTCVGD.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-RGTMNLNX.mjs +0 -29
- package/dist/lib/node-esm/BlueprintContainer-RGTMNLNX.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-W3W6FWV3.mjs +0 -55
- package/dist/lib/node-esm/ChatContainer-W3W6FWV3.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QW4JRKVO.mjs +0 -73
- package/dist/lib/node-esm/ChatDialog-QW4JRKVO.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs +0 -163
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-PANCJUHV.mjs +0 -165
- package/dist/lib/node-esm/app-graph-builder-PANCJUHV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BFO3KHYL.mjs +0 -2227
- package/dist/lib/node-esm/chunk-BFO3KHYL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MS3PJARN.mjs +0 -109
- package/dist/lib/node-esm/chunk-MS3PJARN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +0 -41
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VIIMA3XQ.mjs +0 -90
- package/dist/lib/node-esm/chunk-VIIMA3XQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z7PUODRT.mjs +0 -172
- package/dist/lib/node-esm/chunk-Z7PUODRT.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-3FMC3GHC.mjs +0 -76
- package/dist/lib/node-esm/intent-resolver-3FMC3GHC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-QDQWJ7FZ.mjs +0 -151
- package/dist/lib/node-esm/react-surface-QDQWJ7FZ.mjs.map +0 -7
- package/dist/lib/node-esm/settings-J2EXEM5H.mjs +0 -23
- package/dist/lib/node-esm/settings-J2EXEM5H.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.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/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capability-definitions.d.ts +0 -7
- package/dist/types/src/capability-definitions.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +0 -8
- package/dist/types/src/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -17
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
- package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
- package/dist/types/src/components/PromptSettings.d.ts +0 -6
- package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
- package/dist/types/src/components/SequenceContainer.d.ts +0 -8
- package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -8
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
- package/dist/types/src/components/SequenceEditor/index.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.d.ts +0 -86
- package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.test.d.ts +0 -2
- package/dist/types/src/hooks/chat-processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/presets.d.ts.map +0 -1
- package/dist/types/src/hooks/useBlueprints.d.ts +0 -9
- package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/stories/Chat.stories.d.ts +0 -207
- package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/testing/test-functions.d.ts +0 -3
- package/dist/types/src/testing/test-functions.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -120
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -169
- package/src/capabilities/intent-resolver.ts +0 -72
- package/src/capabilities/react-surface.tsx +0 -138
- package/src/capabilities/settings.ts +0 -19
- package/src/capability-definitions.ts +0 -15
- package/src/components/BlueprintContainer.tsx +0 -24
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
- package/src/components/ChatThread/ChatMessage.tsx +0 -268
- package/src/components/ChatThread/ToolBlock.tsx +0 -121
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/components/PromptSettings.tsx +0 -89
- package/src/components/SequenceContainer.tsx +0 -132
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -32
- package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
- package/src/events.ts +0 -11
- package/src/hooks/chat-processor.test.ts +0 -16
- package/src/hooks/chat-processor.ts +0 -314
- package/src/hooks/useBlueprints.ts +0 -57
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -81
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/stories/Chat.stories.tsx +0 -371
- package/src/testing/test-functions.ts +0 -11
- package/src/tools/function.ts +0 -46
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -217
- package/src/tools/openapi.ts +0 -338
- package/src/types/schema.ts +0 -108
- package/src/typings.d.ts +0 -9
|
@@ -0,0 +1,163 @@
|
|
|
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, { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
9
|
+
|
|
10
|
+
import { Common } from '@dxos/app-framework';
|
|
11
|
+
import { useCapabilities, useOperationInvoker } 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 { SpaceOperation } 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, AssistantOperation } from '../types';
|
|
22
|
+
|
|
23
|
+
export type ChatCompanionProps = {
|
|
24
|
+
role?: string;
|
|
25
|
+
data: {
|
|
26
|
+
subject: Assistant.Chat | 'assistant-chat';
|
|
27
|
+
companionTo: Obj.Unknown;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
|
|
32
|
+
({ role, data }: ChatCompanionProps, forwardedRef) => {
|
|
33
|
+
const { invokePromise } = useOperationInvoker();
|
|
34
|
+
const blueprintRegistry = useBlueprintRegistry();
|
|
35
|
+
const companionTo = data.companionTo;
|
|
36
|
+
|
|
37
|
+
const space = getSpace(companionTo);
|
|
38
|
+
const [chat, setChat] = useState(data.subject === 'assistant-chat' ? undefined : data.subject);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
setChat(data.subject === 'assistant-chat' ? undefined : data.subject);
|
|
41
|
+
}, [data.subject]);
|
|
42
|
+
|
|
43
|
+
const chatQueue = space && chat ? space.queues.get(chat.queue.dxn) : undefined;
|
|
44
|
+
const binder = useContextBinder(chatQueue);
|
|
45
|
+
|
|
46
|
+
// Initialize companion chat if it doesn't exist, but don't add it to the space immediately.
|
|
47
|
+
useAsyncEffect(async () => {
|
|
48
|
+
if (!space || chat) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const { data } = await invokePromise(AssistantOperation.CreateChat, { db: space.db });
|
|
53
|
+
setChat(data?.object);
|
|
54
|
+
}, [chat, space]);
|
|
55
|
+
|
|
56
|
+
// Add chat to space when user submits the first message.
|
|
57
|
+
const handleEvent = useCallback(
|
|
58
|
+
async (event: ChatEvent) => {
|
|
59
|
+
const chatInSpace = !!getSpace(chat);
|
|
60
|
+
if (chatInSpace || !chat || !space) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (event.type === 'submit') {
|
|
65
|
+
await invokePromise(SpaceOperation.AddObject, {
|
|
66
|
+
object: chat,
|
|
67
|
+
target: space.db,
|
|
68
|
+
hidden: true,
|
|
69
|
+
});
|
|
70
|
+
await invokePromise(SpaceOperation.AddRelation, {
|
|
71
|
+
db: space.db,
|
|
72
|
+
schema: Assistant.CompanionTo,
|
|
73
|
+
source: chat,
|
|
74
|
+
target: companionTo,
|
|
75
|
+
});
|
|
76
|
+
await invokePromise(AssistantOperation.SetCurrentChat, {
|
|
77
|
+
companionTo,
|
|
78
|
+
chat,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
[chat, space, companionTo, invokePromise],
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
const metadata = useCapabilities(Common.Capability.Metadata);
|
|
86
|
+
const blueprintKeys = useMemo(
|
|
87
|
+
() =>
|
|
88
|
+
Function.pipe(
|
|
89
|
+
metadata,
|
|
90
|
+
Array.findFirst(
|
|
91
|
+
(
|
|
92
|
+
capability,
|
|
93
|
+
): capability is {
|
|
94
|
+
id: string;
|
|
95
|
+
metadata: { blueprints?: string[] };
|
|
96
|
+
} => capability.id === Obj.getTypename(companionTo),
|
|
97
|
+
),
|
|
98
|
+
Option.flatMap((c) => Option.fromNullable(c.metadata.blueprints)),
|
|
99
|
+
Option.getOrElse(() => [] as string[]),
|
|
100
|
+
),
|
|
101
|
+
[metadata, companionTo],
|
|
102
|
+
);
|
|
103
|
+
const existingBlueprints = useQuery(space?.db, Filter.type(Blueprint.Blueprint));
|
|
104
|
+
const pluginBlueprints = useMemo(
|
|
105
|
+
() => existingBlueprints.filter((blueprint) => blueprintKeys.includes(blueprint.key)),
|
|
106
|
+
[existingBlueprints, blueprintKeys],
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
// Initialize related blueprints that are not already in the space.
|
|
110
|
+
useAsyncEffect(async () => {
|
|
111
|
+
if (!space) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// NOTE: This must be run instead of using the useQuery result to avoid duplicates.
|
|
116
|
+
const existingBlueprints = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
117
|
+
for (const key of blueprintKeys) {
|
|
118
|
+
const existingBlueprint = existingBlueprints.find((blueprint) => blueprint.key === key);
|
|
119
|
+
if (existingBlueprint) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const blueprint = blueprintRegistry.getByKey(key);
|
|
124
|
+
if (!blueprint) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
space.db.add(Obj.clone(blueprint));
|
|
129
|
+
}
|
|
130
|
+
}, [space, blueprintRegistry, blueprintKeys]);
|
|
131
|
+
|
|
132
|
+
useAsyncEffect(async () => {
|
|
133
|
+
if (!binder?.isOpen) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (pluginBlueprints.length > 0) {
|
|
138
|
+
await binder.bind({
|
|
139
|
+
blueprints: pluginBlueprints.map((blueprint) => Ref.make(blueprint)),
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (Obj.instanceOf(Blueprint.Blueprint, companionTo)) {
|
|
144
|
+
await binder.bind({ blueprints: [Ref.make(companionTo)] });
|
|
145
|
+
} else {
|
|
146
|
+
await binder.bind({ objects: [Ref.make(companionTo)] });
|
|
147
|
+
}
|
|
148
|
+
}, [binder, companionTo, blueprintKeys]);
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<ChatContainer
|
|
152
|
+
role={role}
|
|
153
|
+
space={space}
|
|
154
|
+
subject={chat}
|
|
155
|
+
companionTo={companionTo}
|
|
156
|
+
onEvent={handleEvent}
|
|
157
|
+
ref={forwardedRef}
|
|
158
|
+
/>
|
|
159
|
+
);
|
|
160
|
+
},
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
export default ChatCompanion;
|
|
@@ -2,44 +2,60 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import { type
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
import { type
|
|
16
|
-
|
|
17
|
-
export type ChatContainerProps =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
const
|
|
5
|
+
import React, { forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type SurfaceComponentProps, useAtomCapability } from '@dxos/app-framework/react';
|
|
8
|
+
import { type Space, getSpace } from '@dxos/client/echo';
|
|
9
|
+
import { type Obj } from '@dxos/echo';
|
|
10
|
+
import { Layout } from '@dxos/react-ui-mosaic';
|
|
11
|
+
|
|
12
|
+
import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '../hooks';
|
|
13
|
+
import { type Assistant, AssistantCapabilities } from '../types';
|
|
14
|
+
|
|
15
|
+
import { Chat, type ChatRootProps } from './Chat';
|
|
16
|
+
|
|
17
|
+
export type ChatContainerProps = SurfaceComponentProps<
|
|
18
|
+
Assistant.Chat | undefined,
|
|
19
|
+
{
|
|
20
|
+
space?: Space;
|
|
21
|
+
companionTo?: Obj.Unknown;
|
|
22
|
+
} & Pick<ChatRootProps, 'onEvent'>
|
|
23
|
+
>;
|
|
24
|
+
|
|
25
|
+
export const ChatContainer = forwardRef<HTMLDivElement, ChatContainerProps>((props, forwardedRef) => {
|
|
26
|
+
const { role, subject: chat, space: spaceProp, companionTo, onEvent } = props;
|
|
27
|
+
const space = spaceProp ?? getSpace(chat);
|
|
28
|
+
const settings = useAtomCapability(AssistantCapabilities.Settings);
|
|
29
|
+
const services = useChatServices({ id: space?.id, 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
|
+
|
|
28
42
|
if (!processor) {
|
|
29
43
|
return null;
|
|
30
44
|
}
|
|
31
45
|
|
|
32
|
-
// TODO(burdon): Add attention attributes.
|
|
33
46
|
return (
|
|
34
|
-
<
|
|
35
|
-
<Chat.Root chat={chat} processor={processor}
|
|
36
|
-
<Chat.
|
|
37
|
-
<
|
|
38
|
-
<Chat.
|
|
39
|
-
|
|
47
|
+
<Layout.Main toolbar role={role} ref={forwardedRef}>
|
|
48
|
+
<Chat.Root db={space?.db} 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>
|
|
40
56
|
</Chat.Root>
|
|
41
|
-
</
|
|
57
|
+
</Layout.Main>
|
|
42
58
|
);
|
|
43
|
-
};
|
|
59
|
+
});
|
|
44
60
|
|
|
45
61
|
export default ChatContainer;
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useAtomCapability } from '@dxos/app-framework/react';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
9
|
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { ChatDialog as
|
|
10
|
+
import { ChatDialog as NaturalChatDialog } from '@dxos/react-ui-chat';
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
import { useChatProcessor, useChatServices } from '../hooks';
|
|
12
|
+
import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '../hooks';
|
|
14
13
|
import { meta } from '../meta';
|
|
15
|
-
import { type Assistant } from '../types';
|
|
14
|
+
import { type Assistant, AssistantCapabilities } from '../types';
|
|
15
|
+
|
|
16
|
+
import { Chat, type ChatRootProps } from './Chat';
|
|
16
17
|
|
|
17
18
|
export type ChatDialogProps = {
|
|
18
19
|
chat?: Assistant.Chat;
|
|
@@ -21,10 +22,19 @@ export type ChatDialogProps = {
|
|
|
21
22
|
export const ChatDialog = ({ chat }: ChatDialogProps) => {
|
|
22
23
|
const { t } = useTranslation(meta.id);
|
|
23
24
|
|
|
24
|
-
const
|
|
25
|
-
const settings =
|
|
26
|
-
const services = useChatServices({
|
|
27
|
-
const
|
|
25
|
+
const db = chat && Obj.getDatabase(chat);
|
|
26
|
+
const settings = useAtomCapability(AssistantCapabilities.Settings);
|
|
27
|
+
const services = useChatServices({ id: db?.spaceId, chat });
|
|
28
|
+
const [online, setOnline] = useOnline();
|
|
29
|
+
const { preset, ...chatProps } = usePresets(online);
|
|
30
|
+
const blueprintRegistry = useBlueprintRegistry();
|
|
31
|
+
const processor = useChatProcessor({
|
|
32
|
+
chat,
|
|
33
|
+
preset,
|
|
34
|
+
services,
|
|
35
|
+
blueprintRegistry,
|
|
36
|
+
settings,
|
|
37
|
+
});
|
|
28
38
|
|
|
29
39
|
// TODO(burdon): Refocus when open.
|
|
30
40
|
const [open, setOpen] = useState(true);
|
|
@@ -48,15 +58,15 @@ export const ChatDialog = ({ chat }: ChatDialogProps) => {
|
|
|
48
58
|
|
|
49
59
|
return (
|
|
50
60
|
<Chat.Root chat={chat} processor={processor} onEvent={handleEvent}>
|
|
51
|
-
<
|
|
52
|
-
<
|
|
53
|
-
<
|
|
61
|
+
<NaturalChatDialog.Root open={open} expanded={expanded} onOpenChange={setOpen}>
|
|
62
|
+
<NaturalChatDialog.Header title={t('assistant dialog title')} />
|
|
63
|
+
<NaturalChatDialog.Content>
|
|
54
64
|
<Chat.Thread />
|
|
55
|
-
</
|
|
56
|
-
<
|
|
57
|
-
<Chat.Prompt expandable />
|
|
58
|
-
</
|
|
59
|
-
</
|
|
65
|
+
</NaturalChatDialog.Content>
|
|
66
|
+
<NaturalChatDialog.Footer classNames='p-1.5'>
|
|
67
|
+
<Chat.Prompt {...chatProps} preset={preset?.id} online={online} onOnlineChange={setOnline} expandable />
|
|
68
|
+
</NaturalChatDialog.Footer>
|
|
69
|
+
</NaturalChatDialog.Root>
|
|
60
70
|
</Chat.Root>
|
|
61
71
|
);
|
|
62
72
|
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { addEventListener } from '@dxos/async';
|
|
8
|
+
import { ProgressBar, type ProgressBarProps, TextCrawl, useExecutionGraph } from '@dxos/react-ui-components';
|
|
9
|
+
|
|
10
|
+
import { type Assistant } from '../../types';
|
|
11
|
+
|
|
12
|
+
export type ChatProgressProps = {
|
|
13
|
+
chat: Assistant.Chat;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const ChatProgress = ({ chat }: ChatProgressProps) => {
|
|
17
|
+
const { commits } = useExecutionGraph(chat.traceQueue?.target, true);
|
|
18
|
+
const nodes = useMemo(() => commits.map((commit) => ({ id: commit.id, message: commit.message })), [commits]);
|
|
19
|
+
const lines = useMemo(() => commits.map((commit) => commit.message), [commits]);
|
|
20
|
+
|
|
21
|
+
const [index, setIndex] = useState<number | undefined>(undefined);
|
|
22
|
+
const handleSelect = useCallback<NonNullable<ProgressBarProps['onSelect']>>(({ index }) => {
|
|
23
|
+
setIndex((current) => {
|
|
24
|
+
return current === index ? undefined : index;
|
|
25
|
+
});
|
|
26
|
+
}, []);
|
|
27
|
+
|
|
28
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!ref.current) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return addEventListener(ref.current, 'keydown', (event) => {
|
|
35
|
+
switch (event.key) {
|
|
36
|
+
case 'ArrowLeft': {
|
|
37
|
+
setIndex((current) => (current === undefined || current <= 0 ? 0 : current - 1));
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
case 'ArrowRight': {
|
|
41
|
+
setIndex((current) => (current === undefined || current >= nodes.length ? nodes.length - 1 : current + 1));
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}, [nodes.length]);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div role='none' tabIndex={0} ref={ref} className='flex flex-col outline-none'>
|
|
50
|
+
<ProgressBar nodes={nodes} index={index} onSelect={handleSelect} />
|
|
51
|
+
<TextCrawl classNames='pis-4 text-sm text-description' lines={lines} autoAdvance />
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React, { type PropsWithChildren } from 'react';
|
|
6
6
|
|
|
7
7
|
import { IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { mx } from '@dxos/
|
|
8
|
+
import { mx } from '@dxos/ui-theme';
|
|
9
9
|
|
|
10
10
|
import { meta } from '../../meta';
|
|
11
11
|
import { type ChatEvent } from '../Chat';
|
|
@@ -26,40 +26,24 @@ export const ChatActions = ({ classNames, children, microphone, recording, proce
|
|
|
26
26
|
<div className={mx('flex items-center mie-1', classNames)}>
|
|
27
27
|
{children}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
label={t('button cancel processing')}
|
|
38
|
-
onClick={() => onEvent?.({ type: 'cancel' })}
|
|
39
|
-
/>
|
|
40
|
-
)) || (
|
|
41
|
-
<IconButton
|
|
42
|
-
disabled
|
|
43
|
-
classNames='px-1.5'
|
|
44
|
-
variant='ghost'
|
|
45
|
-
size={5}
|
|
46
|
-
icon='ph--arrow-down--regular'
|
|
47
|
-
iconOnly
|
|
48
|
-
label={t('button scroll down')}
|
|
49
|
-
onClick={() => onEvent?.({ type: 'scroll-to-bottom' })}
|
|
50
|
-
/>
|
|
51
|
-
)}
|
|
29
|
+
<IconButton
|
|
30
|
+
disabled={!processing}
|
|
31
|
+
variant='ghost'
|
|
32
|
+
icon='ph--x--regular'
|
|
33
|
+
iconOnly
|
|
34
|
+
label={t('cancel processing button')}
|
|
35
|
+
onClick={() => onEvent?.({ type: 'cancel' })}
|
|
36
|
+
/>
|
|
52
37
|
|
|
53
38
|
{microphone && (
|
|
54
39
|
<IconButton
|
|
55
40
|
disabled={!processing}
|
|
56
|
-
classNames={mx(
|
|
41
|
+
classNames={mx(recording && 'bg-primary-500')}
|
|
57
42
|
variant='ghost'
|
|
58
|
-
size={5}
|
|
59
43
|
icon='ph--microphone--regular'
|
|
60
44
|
iconOnly
|
|
61
45
|
noTooltip
|
|
62
|
-
label={t('button
|
|
46
|
+
label={t('microphone button')}
|
|
63
47
|
onMouseDown={() => onEvent?.({ type: 'record-start' })}
|
|
64
48
|
onMouseUp={() => onEvent?.({ type: 'record-stop' })}
|
|
65
49
|
onTouchStart={() => onEvent?.({ type: 'record-start' })}
|