@dxos/plugin-assistant 0.8.4-main.ae835ea → 0.8.4-main.bc674ce
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/blueprints/index.mjs +12 -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-WBG5PTSX.mjs → chunk-EXVT7D4B.mjs} +1 -1
- package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +7 -0
- package/dist/lib/browser/{chunk-L5OA5OGS.mjs → chunk-ML3QCFKA.mjs} +40 -37
- 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 +201 -214
- 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 +8 -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-CFCUD2VC.mjs → blueprint-definition-SEMDEIYG.mjs} +6 -5
- 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-MSBPC4RJ.mjs +42 -0
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-WE6KTH72.mjs → chunk-POWB2BPC.mjs} +1 -1
- 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-7ZYOYW7F.mjs → chunk-ZRIPP7YF.mjs} +40 -37
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs.map +7 -0
- package/dist/lib/node-esm/{edge-model-resolver-2ARXDOYS.mjs → edge-model-resolver-G5KMODPO.mjs} +9 -7
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +201 -214
- 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 +8 -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 +10 -11
- 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 +21 -12
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +5 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +2 -2
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +13 -5
- 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.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +7 -10
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +128 -73
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +12 -6
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +112 -60
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +11 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +113 -61
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +10 -8
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -5
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +112 -60
- 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 -5
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +1 -1
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/functions/object-list.d.ts +2 -2
- package/dist/types/src/functions/object-list.d.ts.map +1 -1
- package/dist/types/src/functions/object-load.d.ts +1 -1
- package/dist/types/src/functions/object-load.d.ts.map +1 -1
- 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 +2 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -5
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +3 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +3 -3
- 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 +2 -2
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts +7 -7
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +17 -16
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/update-name.d.ts.map +1 -1
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +5 -4
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +243 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +16 -22
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +88 -112
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- 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/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +10 -212
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +113 -90
- package/src/AssistantPlugin.tsx +70 -105
- 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 +10 -14
- 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 +13 -5
- package/src/components/BlueprintArticle.tsx +29 -0
- package/src/components/Chat/Chat.tsx +160 -125
- package/src/components/Chat/events.ts +7 -1
- package/src/components/ChatCompanion.tsx +132 -105
- package/src/components/ChatContainer.tsx +40 -30
- package/src/components/ChatDialog.tsx +13 -7
- package/src/components/ChatProgress/ChatProgress.tsx +4 -17
- package/src/components/ChatPrompt/ChatActions.tsx +3 -5
- package/src/components/ChatPrompt/ChatOptions.tsx +93 -80
- package/src/components/ChatPrompt/ChatReferences.tsx +7 -8
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +57 -36
- package/src/components/ChatThread/ChatThread.tsx +26 -36
- package/src/components/ChatThread/Link.tsx +3 -3
- package/src/components/ChatThread/registry.tsx +25 -35
- package/src/components/ChatThread/sync.test.ts +33 -17
- package/src/components/ChatThread/sync.ts +53 -12
- package/src/components/ChatThread/testing/thread.md +37 -0
- package/src/components/PromptArticle.tsx +50 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +12 -4
- package/src/components/TemplateEditor/TemplateEditor.tsx +14 -10
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +15 -7
- package/src/components/TemplateEditor/TemplateForm.tsx +76 -29
- 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 +36 -45
- package/src/components/Toolbox/Toolbox.stories.tsx +9 -10
- package/src/components/Toolbox/Toolbox.tsx +16 -17
- 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 +2 -3
- package/src/functions/index.ts +1 -1
- package/src/functions/object-list.ts +4 -3
- package/src/functions/object-load.ts +7 -5
- package/src/functions/object-search.ts +46 -0
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useBlueprintRegistry.ts +31 -20
- package/src/hooks/useChatProcessor.ts +15 -12
- package/src/hooks/useChatServices.ts +13 -14
- package/src/hooks/useChatToolbarActions.ts +121 -0
- package/src/hooks/useContextBinder.ts +9 -7
- package/src/hooks/useContextObjects.ts +13 -25
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/useReferencesProvider.ts +7 -6
- package/src/index.ts +0 -1
- package/src/meta.ts +2 -2
- package/src/processor/presets.ts +1 -1
- package/src/processor/processor.test.ts +8 -17
- package/src/processor/processor.ts +41 -43
- package/src/processor/update-name.ts +4 -2
- package/src/queue-logger.ts +8 -9
- package/src/testing/test-generator.ts +14 -13
- package/src/testing/test-services.ts +8 -6
- package/src/translations.ts +27 -16
- package/src/types/Assistant.ts +9 -10
- package/src/types/AssistantAction.ts +59 -54
- package/src/types/capabilities.ts +27 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +3 -1
- package/src/types/service.ts +10 -7
- package/dist/lib/browser/BlueprintContainer-GMSYKGSO.mjs +0 -36
- package/dist/lib/browser/BlueprintContainer-GMSYKGSO.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-M3FDKTQM.mjs +0 -151
- package/dist/lib/browser/ChatCompanion-M3FDKTQM.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-KAH7XITI.mjs +0 -74
- package/dist/lib/browser/ChatContainer-KAH7XITI.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-ZWRGABW6.mjs +0 -87
- package/dist/lib/browser/ChatDialog-ZWRGABW6.mjs.map +0 -7
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-R5T7BJPC.mjs +0 -183
- package/dist/lib/browser/app-graph-builder-R5T7BJPC.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-AGTDXTXO.mjs +0 -13
- package/dist/lib/browser/chunk-357IHWQL.mjs +0 -1519
- package/dist/lib/browser/chunk-357IHWQL.mjs.map +0 -7
- package/dist/lib/browser/chunk-A2NVNXPL.mjs +0 -170
- package/dist/lib/browser/chunk-A2NVNXPL.mjs.map +0 -7
- package/dist/lib/browser/chunk-CQW6UPJM.mjs +0 -199
- package/dist/lib/browser/chunk-CQW6UPJM.mjs.map +0 -7
- package/dist/lib/browser/chunk-GNI6HL6G.mjs +0 -219
- package/dist/lib/browser/chunk-GNI6HL6G.mjs.map +0 -7
- package/dist/lib/browser/chunk-GXHZTOWJ.mjs +0 -378
- package/dist/lib/browser/chunk-GXHZTOWJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-L5OA5OGS.mjs.map +0 -7
- package/dist/lib/browser/chunk-MEN5WTLA.mjs +0 -182
- package/dist/lib/browser/chunk-MEN5WTLA.mjs.map +0 -7
- package/dist/lib/browser/chunk-PUG24BEC.mjs +0 -277
- package/dist/lib/browser/chunk-PUG24BEC.mjs.map +0 -7
- package/dist/lib/browser/chunk-SJJV3HEX.mjs +0 -16
- package/dist/lib/browser/chunk-SJJV3HEX.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBG5PTSX.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3C5TABOX.mjs +0 -136
- package/dist/lib/browser/intent-resolver-3C5TABOX.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs.map +0 -7
- package/dist/lib/browser/react-surface-EYKA5IFU.mjs +0 -90
- package/dist/lib/browser/react-surface-EYKA5IFU.mjs.map +0 -7
- package/dist/lib/browser/settings-VMVBYZLN.mjs +0 -23
- package/dist/lib/browser/settings-VMVBYZLN.mjs.map +0 -7
- package/dist/lib/browser/state-CFREPBB6.mjs +0 -21
- package/dist/lib/browser/state-CFREPBB6.mjs.map +0 -7
- package/dist/lib/browser/toolkit-F3NQ7TSI.mjs +0 -21
- package/dist/lib/browser/toolkit-F3NQ7TSI.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-6GBLMK4Z.mjs +0 -37
- package/dist/lib/node-esm/BlueprintContainer-6GBLMK4Z.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-OV426GCP.mjs +0 -152
- package/dist/lib/node-esm/ChatCompanion-OV426GCP.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-UKY7NHFY.mjs +0 -75
- package/dist/lib/node-esm/ChatContainer-UKY7NHFY.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-2BDQIEXH.mjs +0 -88
- package/dist/lib/node-esm/ChatDialog-2BDQIEXH.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-I52RYVWH.mjs +0 -184
- package/dist/lib/node-esm/app-graph-builder-I52RYVWH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2CAETDW2.mjs +0 -183
- package/dist/lib/node-esm/chunk-2CAETDW2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4J5FYNNM.mjs +0 -171
- package/dist/lib/node-esm/chunk-4J5FYNNM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5ARE4R2I.mjs +0 -220
- package/dist/lib/node-esm/chunk-5ARE4R2I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7ZYOYW7F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HJPIYMWD.mjs +0 -1520
- package/dist/lib/node-esm/chunk-HJPIYMWD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-O36P4LN5.mjs +0 -200
- package/dist/lib/node-esm/chunk-O36P4LN5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XM4BVQQR.mjs +0 -278
- package/dist/lib/node-esm/chunk-XM4BVQQR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XQBL2SBL.mjs +0 -17
- package/dist/lib/node-esm/chunk-XQBL2SBL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YIO5MEPR.mjs +0 -380
- package/dist/lib/node-esm/chunk-YIO5MEPR.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-HQ27YALS.mjs +0 -137
- package/dist/lib/node-esm/intent-resolver-HQ27YALS.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-UOC3CBPH.mjs +0 -91
- package/dist/lib/node-esm/react-surface-UOC3CBPH.mjs.map +0 -7
- package/dist/lib/node-esm/settings-7AUVNDM2.mjs +0 -24
- package/dist/lib/node-esm/settings-7AUVNDM2.mjs.map +0 -7
- package/dist/lib/node-esm/state-XXND44OW.mjs +0 -22
- package/dist/lib/node-esm/state-XXND44OW.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-7CH5UNSQ.mjs +0 -22
- package/dist/lib/node-esm/toolkit-7CH5UNSQ.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-service.d.ts +0 -4
- package/dist/types/src/capabilities/ai-service.d.ts.map +0 -1
- 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/blueprint-definition.d.ts +0 -7
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -11
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/edge-model-resolver.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/local-model-resolver.d.ts +0 -10
- package/dist/types/src/capabilities/local-model-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/capabilities/state.d.ts +0 -4
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -4
- package/dist/types/src/capabilities/toolkit.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/ChatThread/reducers.d.ts +0 -40
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +0 -1
- package/dist/types/src/components/ChatToolbar/ChatToolbar.d.ts +0 -6
- package/dist/types/src/components/ChatToolbar/ChatToolbar.d.ts.map +0 -1
- package/dist/types/src/components/ChatToolbar/index.d.ts +0 -2
- package/dist/types/src/components/ChatToolbar/index.d.ts.map +0 -1
- package/dist/types/src/components/ChatToolbar/useChatToolbarActions.d.ts +0 -9
- package/dist/types/src/components/ChatToolbar/useChatToolbarActions.d.ts.map +0 -1
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/functions/analysis.d.ts +0 -5
- package/dist/types/src/functions/analysis.d.ts.map +0 -1
- package/dist/types/src/hooks/useItemTypes.d.ts +0 -4
- package/dist/types/src/hooks/useItemTypes.d.ts.map +0 -1
- package/dist/types/src/toolkits/AssistantToolkit.d.ts +0 -21
- package/dist/types/src/toolkits/AssistantToolkit.d.ts.map +0 -1
- package/dist/types/src/toolkits/SystemToolkit.d.ts +0 -69
- package/dist/types/src/toolkits/SystemToolkit.d.ts.map +0 -1
- package/dist/types/src/toolkits/index.d.ts +0 -3
- package/dist/types/src/toolkits/index.d.ts.map +0 -1
- package/src/capabilities/ai-service.ts +0 -27
- package/src/capabilities/app-graph-builder.ts +0 -194
- package/src/capabilities/blueprint-definition.ts +0 -66
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/edge-model-resolver.ts +0 -25
- package/src/capabilities/intent-resolver.ts +0 -121
- package/src/capabilities/local-model-resolver.ts +0 -30
- package/src/capabilities/react-surface.tsx +0 -71
- package/src/capabilities/settings.ts +0 -19
- package/src/capabilities/state.ts +0 -20
- package/src/capabilities/toolkit.ts +0 -19
- package/src/components/BlueprintContainer.tsx +0 -30
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/components/ChatToolbar/ChatToolbar.tsx +0 -23
- package/src/components/ChatToolbar/index.ts +0 -5
- package/src/components/ChatToolbar/useChatToolbarActions.ts +0 -126
- package/src/components/TemplateEditor/handlebars-extension.ts +0 -166
- package/src/events.ts +0 -11
- package/src/functions/analysis.ts +0 -22
- package/src/hooks/useItemTypes.ts +0 -37
- package/src/toolkits/AssistantToolkit.ts +0 -55
- package/src/toolkits/SystemToolkit.ts +0 -292
- package/src/toolkits/index.ts +0 -6
- /package/dist/lib/browser/{blueprint-definition-AGTDXTXO.mjs.map → blueprint-definition-DGHH7MUU.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-CFCUD2VC.mjs.map → browser/blueprints/index.mjs.map} +0 -0
- /package/dist/types/src/components/TemplateEditor/{handlebars-extension.d.ts → extensions/handlebars-extension.d.ts} +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability, Common } from '@dxos/app-framework';
|
|
8
|
+
import { createKvsStore } from '@dxos/effect';
|
|
9
|
+
|
|
10
|
+
import { meta } from '../../meta';
|
|
11
|
+
import { Assistant, AssistantCapabilities } from '../../types';
|
|
12
|
+
|
|
13
|
+
export default Capability.makeModule(() =>
|
|
14
|
+
Effect.sync(() => {
|
|
15
|
+
const settingsAtom = createKvsStore({
|
|
16
|
+
key: meta.id,
|
|
17
|
+
schema: Assistant.Settings,
|
|
18
|
+
defaultValue: () => ({}),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return [
|
|
22
|
+
Capability.contributes(AssistantCapabilities.Settings, settingsAtom),
|
|
23
|
+
Capability.contributes(Common.Capability.Settings, {
|
|
24
|
+
prefix: meta.id,
|
|
25
|
+
schema: Assistant.Settings,
|
|
26
|
+
atom: settingsAtom,
|
|
27
|
+
}),
|
|
28
|
+
];
|
|
29
|
+
}),
|
|
30
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { createKvsStore } from '@dxos/effect';
|
|
9
|
+
|
|
10
|
+
import { meta } from '../../meta';
|
|
11
|
+
import { AssistantCapabilities } from '../../types';
|
|
12
|
+
|
|
13
|
+
export default Capability.makeModule(() =>
|
|
14
|
+
Effect.sync(() => {
|
|
15
|
+
// NOTE: This needs to be a chat object rather than a string id to avoid a query race.
|
|
16
|
+
// TODO(wittjosiah): Handle serialization and hydration for this so it can be cached.
|
|
17
|
+
const stateAtom = createKvsStore({
|
|
18
|
+
key: meta.id,
|
|
19
|
+
schema: AssistantCapabilities.StateSchema,
|
|
20
|
+
defaultValue: () => ({
|
|
21
|
+
currentChat: {},
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return Capability.contributes(AssistantCapabilities.State, stateAtom);
|
|
26
|
+
}),
|
|
27
|
+
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Layer from 'effect/Layer';
|
|
7
|
+
|
|
8
|
+
import { Capability, Common } from '@dxos/app-framework';
|
|
9
|
+
import { GenericToolkit } from '@dxos/assistant';
|
|
10
|
+
import { AssistantToolkit, SystemToolkit, WebSearchToolkit } from '@dxos/assistant-toolkit';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule(() =>
|
|
13
|
+
Effect.succeed([
|
|
14
|
+
Capability.contributes(
|
|
15
|
+
Common.Capability.Toolkit,
|
|
16
|
+
GenericToolkit.make(AssistantToolkit.AssistantToolkit, AssistantToolkit.layer()),
|
|
17
|
+
),
|
|
18
|
+
|
|
19
|
+
// TODO(burdon): How to manage dependencies across blueprints.
|
|
20
|
+
Capability.contributes(
|
|
21
|
+
Common.Capability.Toolkit,
|
|
22
|
+
GenericToolkit.make(SystemToolkit.SystemToolkit, SystemToolkit.layer()),
|
|
23
|
+
),
|
|
24
|
+
Capability.contributes(Common.Capability.Toolkit, GenericToolkit.make(WebSearchToolkit, Layer.empty)),
|
|
25
|
+
]),
|
|
26
|
+
);
|
|
@@ -20,7 +20,12 @@ const LLM_PROVIDER_LABELS = {
|
|
|
20
20
|
lmstudio: 'LM Studio',
|
|
21
21
|
} as const;
|
|
22
22
|
|
|
23
|
-
export
|
|
23
|
+
export type AssistantSettingsComponentProps = {
|
|
24
|
+
settings: Assistant.Settings;
|
|
25
|
+
onSettingsChange: (fn: (current: Assistant.Settings) => Assistant.Settings) => void;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const AssistantSettings = ({ settings, onSettingsChange }: AssistantSettingsComponentProps) => {
|
|
24
29
|
const { t } = useTranslation(meta.id);
|
|
25
30
|
|
|
26
31
|
return (
|
|
@@ -30,7 +35,7 @@ export const AssistantSettings = ({ settings }: { settings: Assistant.Settings }
|
|
|
30
35
|
<ControlItemInput title={t('settings custom prompts label')}>
|
|
31
36
|
<Input.Switch
|
|
32
37
|
checked={!!settings.customPrompts}
|
|
33
|
-
onCheckedChange={(checked) => (
|
|
38
|
+
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, customPrompts: checked }))}
|
|
34
39
|
/>
|
|
35
40
|
</ControlItemInput>
|
|
36
41
|
|
|
@@ -38,7 +43,10 @@ export const AssistantSettings = ({ settings }: { settings: Assistant.Settings }
|
|
|
38
43
|
<Select.Root
|
|
39
44
|
value={settings.llmProvider ?? 'edge'}
|
|
40
45
|
onValueChange={(value) => {
|
|
41
|
-
|
|
46
|
+
onSettingsChange((s) => ({
|
|
47
|
+
...s,
|
|
48
|
+
llmProvider: value === DEFAULT_VALUE ? undefined : (value as any),
|
|
49
|
+
}));
|
|
42
50
|
}}
|
|
43
51
|
>
|
|
44
52
|
<Select.TriggerButton placeholder={t('settings llm provider label')} />
|
|
@@ -62,7 +70,7 @@ export const AssistantSettings = ({ settings }: { settings: Assistant.Settings }
|
|
|
62
70
|
<Select.Root
|
|
63
71
|
value={settings.edgeModel ?? DEFAULT_VALUE}
|
|
64
72
|
onValueChange={(value) => {
|
|
65
|
-
|
|
73
|
+
onSettingsChange((s) => ({ ...s, edgeModel: value === DEFAULT_VALUE ? undefined : value }));
|
|
66
74
|
}}
|
|
67
75
|
>
|
|
68
76
|
<Select.TriggerButton placeholder={t('settings default llm model label')} />
|
|
@@ -86,7 +94,7 @@ export const AssistantSettings = ({ settings }: { settings: Assistant.Settings }
|
|
|
86
94
|
<Select.Root
|
|
87
95
|
value={settings.ollamaModel ?? DEFAULT_VALUE}
|
|
88
96
|
onValueChange={(value) => {
|
|
89
|
-
|
|
97
|
+
onSettingsChange((s) => ({ ...s, ollamaModel: value === DEFAULT_VALUE ? undefined : value }));
|
|
90
98
|
}}
|
|
91
99
|
>
|
|
92
100
|
<Select.TriggerButton placeholder={t('settings default llm model label')} />
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type SurfaceComponentProps } from '@dxos/app-framework/react';
|
|
8
|
+
import { type Blueprint } from '@dxos/blueprints';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { Toolbar } from '@dxos/react-ui';
|
|
11
|
+
import { useAttention } from '@dxos/react-ui-attention';
|
|
12
|
+
import { Layout } from '@dxos/react-ui-mosaic';
|
|
13
|
+
|
|
14
|
+
import { TemplateEditor } from './TemplateEditor';
|
|
15
|
+
|
|
16
|
+
export type BlueprintArticleProps = SurfaceComponentProps<Blueprint.Blueprint>;
|
|
17
|
+
|
|
18
|
+
export const BlueprintArticle = ({ role, subject }: BlueprintArticleProps) => {
|
|
19
|
+
const { hasAttention } = useAttention(Obj.getDXN(subject).toString());
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Layout.Main role={role} toolbar>
|
|
23
|
+
<Toolbar.Root disabled={!hasAttention} />
|
|
24
|
+
<TemplateEditor id={subject.id} template={subject.instructions} classNames='container-max-width' />
|
|
25
|
+
</Layout.Main>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default BlueprintArticle;
|
|
@@ -4,24 +4,26 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Extension, Prec } from '@codemirror/state';
|
|
6
6
|
import { keymap } from '@codemirror/view';
|
|
7
|
-
import {
|
|
7
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
8
8
|
import { createContext } from '@radix-ui/react-context';
|
|
9
9
|
import * as Array from 'effect/Array';
|
|
10
10
|
import * as Option from 'effect/Option';
|
|
11
11
|
import React, { type PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
12
12
|
|
|
13
13
|
import { Event } from '@dxos/async';
|
|
14
|
-
import { Obj } from '@dxos/echo';
|
|
14
|
+
import { type Database, Obj } from '@dxos/echo';
|
|
15
15
|
import { useVoiceInput } from '@dxos/plugin-transcription';
|
|
16
|
-
import {
|
|
16
|
+
import { useQueue } from '@dxos/react-client/echo';
|
|
17
17
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
18
18
|
import { Input, type ThemedClassName, useDynamicRef, useTranslation } from '@dxos/react-ui';
|
|
19
|
-
import { ChatEditor, type ChatEditorController, type ChatEditorProps
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
19
|
+
import { ChatEditor, type ChatEditorController, type ChatEditorProps } from '@dxos/react-ui-chat';
|
|
20
|
+
import { type MarkdownStreamController } from '@dxos/react-ui-components';
|
|
21
|
+
import { MenuProvider, ToolbarMenu } from '@dxos/react-ui-menu';
|
|
22
|
+
import { Message } from '@dxos/types';
|
|
23
|
+
import { mx } from '@dxos/ui-theme';
|
|
22
24
|
import { isTruthy } from '@dxos/util';
|
|
23
25
|
|
|
24
|
-
import {
|
|
26
|
+
import { useChatToolbarActions } from '../../hooks';
|
|
25
27
|
import { meta } from '../../meta';
|
|
26
28
|
import { type AiChatProcessor } from '../../processor';
|
|
27
29
|
import { type Assistant } from '../../types';
|
|
@@ -33,11 +35,7 @@ import {
|
|
|
33
35
|
ChatReferences,
|
|
34
36
|
ChatStatusIndicator,
|
|
35
37
|
} from '../ChatPrompt';
|
|
36
|
-
import {
|
|
37
|
-
type ChatThreadController,
|
|
38
|
-
ChatThread as NaturalChatThread,
|
|
39
|
-
type ChatThreadProps as NaturalChatThreadProps,
|
|
40
|
-
} from '../ChatThread';
|
|
38
|
+
import { ChatThread as NaturalChatThread, type ChatThreadProps as NaturalChatThreadProps } from '../ChatThread';
|
|
41
39
|
|
|
42
40
|
import { type ChatEvent } from './events';
|
|
43
41
|
|
|
@@ -50,9 +48,9 @@ import { type ChatEvent } from './events';
|
|
|
50
48
|
type ChatContextValue = {
|
|
51
49
|
debug?: boolean;
|
|
52
50
|
event: Event<ChatEvent>;
|
|
53
|
-
|
|
54
|
-
chat
|
|
55
|
-
messages:
|
|
51
|
+
db?: Database.Database;
|
|
52
|
+
chat?: Assistant.Chat;
|
|
53
|
+
messages: Message.Message[];
|
|
56
54
|
processor: AiChatProcessor;
|
|
57
55
|
};
|
|
58
56
|
|
|
@@ -62,27 +60,23 @@ export const [ChatContextProvider, useChatContext] = createContext<ChatContextVa
|
|
|
62
60
|
// Root
|
|
63
61
|
//
|
|
64
62
|
|
|
65
|
-
type ChatRootProps =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
>
|
|
63
|
+
type ChatRootProps = PropsWithChildren<
|
|
64
|
+
Pick<ChatContextValue, 'db' | 'chat' | 'processor'> & {
|
|
65
|
+
onEvent?: (event: ChatEvent) => void;
|
|
66
|
+
}
|
|
71
67
|
>;
|
|
72
68
|
|
|
73
|
-
const ChatRoot = ({
|
|
69
|
+
const ChatRoot = ({ children, chat, processor, onEvent, ...props }: ChatRootProps) => {
|
|
74
70
|
const [debug, setDebug] = useState(false);
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
// Messages.
|
|
78
|
-
const queue = useQueue<DataType.Message>(chat?.queue.dxn);
|
|
79
|
-
const pending = useRxValue(processor.messages);
|
|
80
|
-
const streaming = useRxValue(processor.streaming);
|
|
71
|
+
const pending = useAtomValue(processor.messages);
|
|
72
|
+
const streaming = useAtomValue(processor.streaming);
|
|
81
73
|
const lastPrompt = useRef<string | undefined>(undefined);
|
|
82
74
|
|
|
75
|
+
// Messages.
|
|
76
|
+
const queue = useQueue<Message.Message>(chat?.queue.dxn);
|
|
83
77
|
const messages = useMemo(() => {
|
|
84
|
-
const queueMessages = queue?.objects?.filter(Obj.instanceOf(
|
|
85
|
-
return Array.dedupeWith([...queueMessages, ...pending], (a, b) => a
|
|
78
|
+
const queueMessages = queue?.objects?.filter(Obj.instanceOf(Message.Message)) ?? [];
|
|
79
|
+
return Array.dedupeWith([...queueMessages, ...pending], ({ id: a }, { id: b }) => a === b);
|
|
86
80
|
}, [queue?.objects, pending]);
|
|
87
81
|
|
|
88
82
|
// Events.
|
|
@@ -120,37 +114,100 @@ const ChatRoot = ({ classNames, children, chat, processor, onEvent, ...props }:
|
|
|
120
114
|
}
|
|
121
115
|
break;
|
|
122
116
|
}
|
|
123
|
-
|
|
124
|
-
default: {
|
|
125
|
-
onEvent?.(ev);
|
|
126
|
-
}
|
|
127
117
|
}
|
|
118
|
+
|
|
119
|
+
onEvent?.(ev);
|
|
128
120
|
});
|
|
129
121
|
}, [event, processor, streaming, onEvent]);
|
|
130
122
|
|
|
131
|
-
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
123
|
+
const db = props.db ?? (chat && Obj.getDatabase(chat));
|
|
134
124
|
|
|
135
125
|
return (
|
|
136
126
|
<ChatContextProvider
|
|
137
127
|
debug={debug}
|
|
138
128
|
event={event}
|
|
129
|
+
db={db}
|
|
139
130
|
chat={chat}
|
|
140
|
-
space={space}
|
|
141
131
|
messages={messages}
|
|
142
132
|
processor={processor}
|
|
143
133
|
{...props}
|
|
144
134
|
>
|
|
145
|
-
|
|
146
|
-
{children}
|
|
147
|
-
</div>
|
|
135
|
+
{children}
|
|
148
136
|
</ChatContextProvider>
|
|
149
137
|
);
|
|
150
138
|
};
|
|
151
139
|
|
|
152
140
|
ChatRoot.displayName = 'Chat.Root';
|
|
153
141
|
|
|
142
|
+
//
|
|
143
|
+
// Viewport
|
|
144
|
+
//
|
|
145
|
+
|
|
146
|
+
type ChatViewportProps = ThemedClassName<PropsWithChildren>;
|
|
147
|
+
|
|
148
|
+
const ChatViewport = ({ classNames, children }: ChatViewportProps) => {
|
|
149
|
+
return (
|
|
150
|
+
<div role='none' className={mx('flex flex-col bs-full is-full', classNames)}>
|
|
151
|
+
{children}
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
//
|
|
157
|
+
// Thread
|
|
158
|
+
//
|
|
159
|
+
|
|
160
|
+
type ChatThreadProps = Omit<NaturalChatThreadProps, 'identity' | 'messages' | 'tools'>;
|
|
161
|
+
|
|
162
|
+
const ChatThread = (props: ChatThreadProps) => {
|
|
163
|
+
const { debug, event, messages, processor } = useChatContext(ChatThread.displayName);
|
|
164
|
+
const identity = useIdentity();
|
|
165
|
+
const error = useAtomValue(processor.error).pipe(Option.getOrUndefined);
|
|
166
|
+
|
|
167
|
+
const controllerRef = useRef<MarkdownStreamController | null>(null);
|
|
168
|
+
useEffect(() => {
|
|
169
|
+
return event.on((event) => {
|
|
170
|
+
switch (event.type) {
|
|
171
|
+
case 'submit':
|
|
172
|
+
case 'scroll-to-bottom':
|
|
173
|
+
controllerRef.current?.scrollToBottom();
|
|
174
|
+
break;
|
|
175
|
+
case 'nav-previous':
|
|
176
|
+
controllerRef.current?.navigatePrevious();
|
|
177
|
+
break;
|
|
178
|
+
case 'nav-next':
|
|
179
|
+
controllerRef.current?.navigateNext();
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}, [event]);
|
|
184
|
+
|
|
185
|
+
const handleEvent = useCallback<NonNullable<NaturalChatThreadProps['onEvent']>>(
|
|
186
|
+
(ev) => {
|
|
187
|
+
event.emit(ev);
|
|
188
|
+
},
|
|
189
|
+
[event],
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
if (!identity) {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return (
|
|
197
|
+
<NaturalChatThread
|
|
198
|
+
{...props}
|
|
199
|
+
identity={identity}
|
|
200
|
+
messages={messages}
|
|
201
|
+
error={error}
|
|
202
|
+
debug={debug}
|
|
203
|
+
onEvent={handleEvent}
|
|
204
|
+
ref={controllerRef}
|
|
205
|
+
/>
|
|
206
|
+
);
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
ChatThread.displayName = 'Chat.Thread';
|
|
210
|
+
|
|
154
211
|
//
|
|
155
212
|
// Prompt
|
|
156
213
|
//
|
|
@@ -181,11 +238,11 @@ const ChatPrompt = ({
|
|
|
181
238
|
onOnlineChange,
|
|
182
239
|
}: ChatPromptProps) => {
|
|
183
240
|
const { t } = useTranslation(meta.id);
|
|
184
|
-
const {
|
|
241
|
+
const { db, processor, event } = useChatContext(ChatPrompt.displayName);
|
|
185
242
|
|
|
186
|
-
const error =
|
|
187
|
-
const streaming =
|
|
188
|
-
const active =
|
|
243
|
+
const error = useAtomValue(processor.error).pipe(Option.getOrUndefined);
|
|
244
|
+
const streaming = useAtomValue(processor.streaming);
|
|
245
|
+
const active = useAtomValue(processor.active);
|
|
189
246
|
const activeRef = useDynamicRef(active);
|
|
190
247
|
|
|
191
248
|
const editorRef = useRef<ChatEditorController>(null);
|
|
@@ -218,43 +275,46 @@ const ChatPrompt = ({
|
|
|
218
275
|
},
|
|
219
276
|
});
|
|
220
277
|
|
|
221
|
-
// TODO(burdon): Reconcile with object tags.
|
|
222
|
-
const referencesProvider = useReferencesProvider(space);
|
|
223
278
|
const extensions = useMemo<Extension[]>(() => {
|
|
224
279
|
return [
|
|
225
|
-
referencesProvider && references({ provider: referencesProvider }),
|
|
226
280
|
Prec.highest(
|
|
227
|
-
keymap.of(
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
return true;
|
|
235
|
-
},
|
|
281
|
+
keymap.of([
|
|
282
|
+
{
|
|
283
|
+
key: 'Mod-d',
|
|
284
|
+
preventDefault: true,
|
|
285
|
+
run: () => {
|
|
286
|
+
event.emit({ type: 'toggle-debug' });
|
|
287
|
+
return true;
|
|
236
288
|
},
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
key: 'Mod-ArrowUp',
|
|
292
|
+
preventDefault: true,
|
|
293
|
+
run: () => {
|
|
294
|
+
event.emit({ type: 'nav-previous' });
|
|
295
|
+
return true;
|
|
244
296
|
},
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
run: () => {
|
|
249
|
-
event.emit({ type: 'thread-close' });
|
|
250
|
-
return true;
|
|
251
|
-
},
|
|
297
|
+
shift: () => {
|
|
298
|
+
event.emit({ type: 'thread-open' });
|
|
299
|
+
return true;
|
|
252
300
|
},
|
|
253
|
-
|
|
254
|
-
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
key: 'Mod-ArrowDown',
|
|
304
|
+
preventDefault: true,
|
|
305
|
+
run: () => {
|
|
306
|
+
event.emit({ type: 'nav-next' });
|
|
307
|
+
return true;
|
|
308
|
+
},
|
|
309
|
+
shift: () => {
|
|
310
|
+
event.emit({ type: 'thread-close' });
|
|
311
|
+
return true;
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
]),
|
|
255
315
|
),
|
|
256
316
|
].filter(isTruthy);
|
|
257
|
-
}, [event, expandable
|
|
317
|
+
}, [event, expandable]);
|
|
258
318
|
|
|
259
319
|
const handleSubmit = useCallback<NonNullable<ChatEditorProps['onSubmit']>>(
|
|
260
320
|
(text) => {
|
|
@@ -278,15 +338,13 @@ const ChatPrompt = ({
|
|
|
278
338
|
role='group'
|
|
279
339
|
className={mx(
|
|
280
340
|
'flex flex-col is-full density-fine',
|
|
281
|
-
outline &&
|
|
282
|
-
'
|
|
283
|
-
],
|
|
341
|
+
outline &&
|
|
342
|
+
'bg-groupSurface border border-subduedSeparator transition transition-border [&:has(.cm-content:focus)]:border-separator rounded',
|
|
284
343
|
classNames,
|
|
285
344
|
)}
|
|
286
345
|
>
|
|
287
|
-
<div role='none' className='flex gap-2'>
|
|
346
|
+
<div role='none' className='flex p-2 gap-2'>
|
|
288
347
|
<ChatStatusIndicator classNames='p-1' preset={preset} error={error} processing={streaming} />
|
|
289
|
-
|
|
290
348
|
<ChatEditor
|
|
291
349
|
ref={editorRef}
|
|
292
350
|
autoFocus
|
|
@@ -298,10 +356,10 @@ const ChatPrompt = ({
|
|
|
298
356
|
/>
|
|
299
357
|
</div>
|
|
300
358
|
|
|
301
|
-
{settings && (
|
|
302
|
-
<div role='none' className='flex
|
|
359
|
+
{db && settings && (
|
|
360
|
+
<div role='none' className='flex items-center overflow-hidden'>
|
|
303
361
|
<ChatOptions
|
|
304
|
-
|
|
362
|
+
db={db}
|
|
305
363
|
blueprintRegistry={processor.blueprintRegistry}
|
|
306
364
|
context={processor.context}
|
|
307
365
|
preset={preset}
|
|
@@ -309,8 +367,8 @@ const ChatPrompt = ({
|
|
|
309
367
|
onPresetChange={onPresetChange}
|
|
310
368
|
/>
|
|
311
369
|
|
|
312
|
-
<div role='none' className='
|
|
313
|
-
<ChatReferences
|
|
370
|
+
<div role='none' className='flex grow overflow-x-auto scrollbar-none'>
|
|
371
|
+
<ChatReferences db={db} context={processor.context} />
|
|
314
372
|
</div>
|
|
315
373
|
|
|
316
374
|
<ChatActions
|
|
@@ -320,10 +378,11 @@ const ChatPrompt = ({
|
|
|
320
378
|
processing={streaming}
|
|
321
379
|
onEvent={handleEvent}
|
|
322
380
|
>
|
|
381
|
+
{/* TODO(burdon): Move offline switch into dialog. */}
|
|
323
382
|
{online !== undefined && (
|
|
324
383
|
<Input.Root>
|
|
325
384
|
<Input.Label srOnly>{t('online switch label')}</Input.Label>
|
|
326
|
-
<Input.Switch classNames='
|
|
385
|
+
<Input.Switch classNames='mli-2' checked={online} onCheckedChange={onOnlineChange} />
|
|
327
386
|
</Input.Root>
|
|
328
387
|
)}
|
|
329
388
|
</ChatActions>
|
|
@@ -336,52 +395,26 @@ const ChatPrompt = ({
|
|
|
336
395
|
ChatPrompt.displayName = 'Chat.Prompt';
|
|
337
396
|
|
|
338
397
|
//
|
|
339
|
-
//
|
|
398
|
+
// Toolbar
|
|
340
399
|
//
|
|
341
400
|
|
|
342
|
-
type
|
|
401
|
+
type ChatToolbarProps = ThemedClassName<{ companionTo?: Obj.Unknown }>;
|
|
343
402
|
|
|
344
|
-
const
|
|
345
|
-
const {
|
|
346
|
-
const
|
|
347
|
-
const error = useRxValue(processor.error).pipe(Option.getOrUndefined);
|
|
348
|
-
|
|
349
|
-
const scrollerRef = useRef<ChatThreadController | null>(null);
|
|
350
|
-
useEffect(() => {
|
|
351
|
-
return event.on((event) => {
|
|
352
|
-
switch (event.type) {
|
|
353
|
-
case 'submit':
|
|
354
|
-
case 'scroll-to-bottom':
|
|
355
|
-
scrollerRef.current?.scrollToBottom();
|
|
356
|
-
break;
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
}, [event]);
|
|
360
|
-
|
|
361
|
-
const handleEvent = useCallback<NonNullable<NaturalChatThreadProps['onEvent']>>(
|
|
362
|
-
(ev) => {
|
|
363
|
-
event.emit(ev);
|
|
364
|
-
},
|
|
365
|
-
[event],
|
|
366
|
-
);
|
|
367
|
-
|
|
368
|
-
if (!identity) {
|
|
369
|
-
return null;
|
|
370
|
-
}
|
|
403
|
+
const ChatToolbar = ({ classNames, companionTo }: ChatToolbarProps) => {
|
|
404
|
+
const { chat } = useChatContext(ChatToolbar.displayName);
|
|
405
|
+
const menu = useChatToolbarActions({ chat, companionTo });
|
|
371
406
|
|
|
372
407
|
return (
|
|
373
|
-
<
|
|
374
|
-
{...
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
onEvent={handleEvent}
|
|
380
|
-
/>
|
|
408
|
+
<MenuProvider
|
|
409
|
+
{...menu}
|
|
410
|
+
attendableId={companionTo ? Obj.getDXN(companionTo).toString() : chat ? Obj.getDXN(chat).toString() : ''}
|
|
411
|
+
>
|
|
412
|
+
<ToolbarMenu classNames={classNames} textBlockWidth />
|
|
413
|
+
</MenuProvider>
|
|
381
414
|
);
|
|
382
415
|
};
|
|
383
416
|
|
|
384
|
-
|
|
417
|
+
ChatToolbar.displayName = 'Chat.Toolbar';
|
|
385
418
|
|
|
386
419
|
//
|
|
387
420
|
// Chat
|
|
@@ -389,8 +422,10 @@ ChatThread.displayName = 'Chat.Thread';
|
|
|
389
422
|
|
|
390
423
|
export const Chat = {
|
|
391
424
|
Root: ChatRoot,
|
|
392
|
-
|
|
425
|
+
Viewport: ChatViewport,
|
|
393
426
|
Thread: ChatThread,
|
|
427
|
+
Prompt: ChatPrompt,
|
|
428
|
+
Toolbar: ChatToolbar,
|
|
394
429
|
};
|
|
395
430
|
|
|
396
|
-
export type { ChatRootProps, ChatThreadProps, ChatPromptProps, ChatEvent };
|
|
431
|
+
export type { ChatRootProps, ChatViewportProps, ChatThreadProps, ChatPromptProps, ChatToolbarProps, ChatEvent };
|
|
@@ -31,7 +31,7 @@ export type ChatEvent =
|
|
|
31
31
|
}
|
|
32
32
|
| {
|
|
33
33
|
type: 'add';
|
|
34
|
-
object: Obj.
|
|
34
|
+
object: Obj.Unknown;
|
|
35
35
|
}
|
|
36
36
|
//
|
|
37
37
|
// UX
|
|
@@ -43,6 +43,12 @@ export type ChatEvent =
|
|
|
43
43
|
| {
|
|
44
44
|
type: 'scroll-to-bottom';
|
|
45
45
|
}
|
|
46
|
+
| {
|
|
47
|
+
type: 'nav-previous';
|
|
48
|
+
}
|
|
49
|
+
| {
|
|
50
|
+
type: 'nav-next';
|
|
51
|
+
}
|
|
46
52
|
| {
|
|
47
53
|
type: 'thread-open';
|
|
48
54
|
}
|