@dxos/plugin-assistant 0.8.4-main.7ace549 → 0.8.4-main.9735255
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-7ZJIXQ2Y.mjs → chunk-DKQMSMBN.mjs} +54 -63
- 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-2BOE3OTW.mjs → chunk-ML3QCFKA.mjs} +23 -20
- 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 +156 -174
- 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-ECKZNDSU.mjs → react-surface-NCITRSJJ.mjs} +41 -30
- package/dist/lib/browser/react-surface-NCITRSJJ.mjs.map +7 -0
- package/dist/lib/browser/{repair-3MZXLUHO.mjs → repair-6QGAKOVM.mjs} +23 -13
- 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-RDCLLIQH.mjs → blueprint-definition-SEMDEIYG.mjs} +6 -4
- 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-CKW4IYLY.mjs → chunk-75PHXBN3.mjs} +54 -63
- 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-3Q22TTXW.mjs → chunk-ZRIPP7YF.mjs} +23 -20
- 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 +156 -174
- 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-NLIG5VAI.mjs → react-surface-ST6V7LPE.mjs} +41 -30
- package/dist/lib/node-esm/react-surface-ST6V7LPE.mjs.map +7 -0
- package/dist/lib/node-esm/{repair-RER5H7Y6.mjs → repair-QJ7CQDKU.mjs} +23 -13
- 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 -12
- 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 +1 -1
- package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +9 -10
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +1 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +2 -2
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +10 -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/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 +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +4 -3
- 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 +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/PromptArticle.d.ts +1 -1
- package/dist/types/src/components/PromptArticle.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.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 +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +3 -3
- 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.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 -4
- 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 +1 -1
- package/dist/types/src/functions/object-list.d.ts.map +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/useBlueprintRegistry.d.ts +5 -5
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -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 +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- 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 +2 -3
- package/dist/types/src/hooks/useFilteredTypes.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 +10 -9
- 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 +3 -2
- 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/types/Assistant.d.ts +16 -19
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +88 -122
- 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 +11 -260
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +113 -92
- package/src/AssistantPlugin.tsx +62 -90
- 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 -15
- 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.ts → repair/repair.ts} +23 -9
- 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 +4 -4
- package/src/components/Chat/Chat.tsx +68 -68
- package/src/components/Chat/events.ts +1 -1
- package/src/components/ChatCompanion.tsx +125 -117
- package/src/components/ChatContainer.tsx +19 -19
- package/src/components/ChatDialog.tsx +6 -7
- package/src/components/ChatProgress/ChatProgress.tsx +3 -16
- package/src/components/ChatPrompt/ChatActions.tsx +1 -1
- package/src/components/ChatPrompt/ChatOptions.tsx +62 -58
- package/src/components/ChatPrompt/ChatReferences.tsx +5 -6
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +10 -8
- package/src/components/ChatThread/ChatThread.tsx +1 -1
- package/src/components/ChatThread/Link.tsx +2 -2
- package/src/components/ChatThread/registry.tsx +2 -2
- package/src/components/ChatThread/sync.test.ts +13 -5
- package/src/components/ChatThread/sync.ts +8 -2
- package/src/components/PromptArticle.tsx +8 -9
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +2 -2
- package/src/components/TemplateEditor/TemplateEditor.tsx +7 -4
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +14 -6
- package/src/components/TemplateEditor/TemplateForm.tsx +75 -28
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +10 -5
- package/src/components/ToolBlock/ToolBlock.tsx +6 -6
- package/src/components/Toolbox/Toolbox.stories.tsx +8 -9
- package/src/components/Toolbox/Toolbox.tsx +14 -15
- 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/functions/index.ts +1 -1
- package/src/functions/object-list.ts +4 -3
- package/src/functions/object-load.ts +6 -4
- package/src/functions/object-search.ts +46 -0
- package/src/hooks/useBlueprintRegistry.ts +30 -20
- package/src/hooks/useChatProcessor.ts +5 -2
- package/src/hooks/useChatServices.ts +11 -15
- package/src/hooks/useChatToolbarActions.ts +24 -25
- package/src/hooks/useContextBinder.ts +4 -2
- package/src/hooks/useContextObjects.ts +13 -25
- package/src/hooks/useFilteredTypes.ts +6 -7
- package/src/hooks/useReferencesProvider.ts +6 -6
- package/src/index.ts +0 -1
- package/src/meta.ts +2 -2
- package/src/processor/processor.test.ts +3 -2
- package/src/processor/processor.ts +23 -25
- package/src/processor/update-name.ts +4 -1
- package/src/queue-logger.ts +4 -1
- package/src/testing/test-generator.ts +4 -3
- package/src/testing/test-services.ts +8 -6
- package/src/types/Assistant.ts +5 -6
- package/src/types/AssistantAction.ts +58 -62
- 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/BlueprintArticle-BWSLH6LG.mjs +0 -36
- package/dist/lib/browser/BlueprintArticle-BWSLH6LG.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-OSZZZSWV.mjs +0 -158
- package/dist/lib/browser/ChatCompanion-OSZZZSWV.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-2W6FNSJD.mjs +0 -77
- package/dist/lib/browser/ChatContainer-2W6FNSJD.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-XQ3KDYWE.mjs +0 -90
- package/dist/lib/browser/ChatDialog-XQ3KDYWE.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-Q7JYGFQV.mjs +0 -59
- package/dist/lib/browser/PromptArticle-Q7JYGFQV.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-LM6GVHQO.mjs +0 -199
- package/dist/lib/browser/app-graph-builder-LM6GVHQO.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-VBEOXNBS.mjs +0 -12
- package/dist/lib/browser/chunk-2BOE3OTW.mjs.map +0 -7
- package/dist/lib/browser/chunk-5JZRYQZL.mjs +0 -229
- package/dist/lib/browser/chunk-5JZRYQZL.mjs.map +0 -7
- package/dist/lib/browser/chunk-7ZJIXQ2Y.mjs.map +0 -7
- package/dist/lib/browser/chunk-LRE4VEZV.mjs +0 -16
- package/dist/lib/browser/chunk-LRE4VEZV.mjs.map +0 -7
- package/dist/lib/browser/chunk-NC2QNMBF.mjs +0 -176
- package/dist/lib/browser/chunk-NC2QNMBF.mjs.map +0 -7
- package/dist/lib/browser/chunk-PWSTPQUY.mjs +0 -1929
- package/dist/lib/browser/chunk-PWSTPQUY.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-EEYS2GJF.mjs +0 -143
- package/dist/lib/browser/intent-resolver-EEYS2GJF.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-ECKZNDSU.mjs.map +0 -7
- package/dist/lib/browser/repair-3MZXLUHO.mjs.map +0 -7
- package/dist/lib/browser/settings-HD5WA24I.mjs +0 -23
- package/dist/lib/browser/settings-HD5WA24I.mjs.map +0 -7
- package/dist/lib/browser/state-GG7Z3NB7.mjs +0 -25
- package/dist/lib/browser/state-GG7Z3NB7.mjs.map +0 -7
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs +0 -17
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs +0 -37
- package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-IUMU7WRQ.mjs +0 -159
- package/dist/lib/node-esm/ChatCompanion-IUMU7WRQ.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-CTUNUEU3.mjs +0 -78
- package/dist/lib/node-esm/ChatContainer-CTUNUEU3.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-X42ASXQD.mjs +0 -91
- package/dist/lib/node-esm/ChatDialog-X42ASXQD.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.mjs +0 -60
- package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.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-6XUAGTRS.mjs +0 -200
- package/dist/lib/node-esm/app-graph-builder-6XUAGTRS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-25GMMNY5.mjs +0 -178
- package/dist/lib/node-esm/chunk-25GMMNY5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3Q22TTXW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CKW4IYLY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E4JSYCWZ.mjs +0 -230
- package/dist/lib/node-esm/chunk-E4JSYCWZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YWFWT57N.mjs +0 -17
- package/dist/lib/node-esm/chunk-YWFWT57N.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z37USO4K.mjs +0 -1930
- package/dist/lib/node-esm/chunk-Z37USO4K.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-4SRYLDK5.mjs +0 -144
- package/dist/lib/node-esm/intent-resolver-4SRYLDK5.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-NLIG5VAI.mjs.map +0 -7
- package/dist/lib/node-esm/repair-RER5H7Y6.mjs.map +0 -7
- package/dist/lib/node-esm/settings-YJQVKHH5.mjs +0 -24
- package/dist/lib/node-esm/settings-YJQVKHH5.mjs.map +0 -7
- package/dist/lib/node-esm/state-FSUHFMDM.mjs +0 -26
- package/dist/lib/node-esm/state-FSUHFMDM.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs +0 -18
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs.map +0 -7
- package/dist/types/src/capabilities/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 -10
- 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/repair.d.ts +0 -4
- package/dist/types/src/capabilities/repair.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/ChatThread/reducers.d.ts +0 -40
- package/dist/types/src/components/ChatThread/reducers.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/src/capabilities/ai-service.ts +0 -27
- package/src/capabilities/app-graph-builder.ts +0 -210
- package/src/capabilities/blueprint-definition.ts +0 -66
- package/src/capabilities/capabilities.ts +0 -17
- package/src/capabilities/edge-model-resolver.ts +0 -25
- package/src/capabilities/intent-resolver.ts +0 -135
- package/src/capabilities/local-model-resolver.ts +0 -30
- package/src/capabilities/react-surface.tsx +0 -87
- package/src/capabilities/settings.ts +0 -19
- package/src/capabilities/state.ts +0 -22
- package/src/capabilities/toolkit.ts +0 -17
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/events.ts +0 -11
- package/src/functions/analysis.ts +0 -22
- /package/dist/lib/browser/{blueprint-definition-VBEOXNBS.mjs.map → blueprint-definition-DGHH7MUU.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-RDCLLIQH.mjs.map → browser/blueprints/index.mjs.map} +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as AnthropicClient from '@effect/ai-anthropic/AnthropicClient';
|
|
6
|
-
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
7
|
-
import * as Layer from 'effect/Layer';
|
|
8
|
-
|
|
9
|
-
import * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
10
|
-
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
11
|
-
|
|
12
|
-
export default (): Capability<any>[] => [
|
|
13
|
-
contributes(
|
|
14
|
-
Capabilities.AiModelResolver,
|
|
15
|
-
AiServiceRouter.AnthropicResolver.pipe(
|
|
16
|
-
Layer.provide(
|
|
17
|
-
AnthropicClient.layer({
|
|
18
|
-
// TODO(dmaretskyi): Read endpoint from config/settings.
|
|
19
|
-
apiUrl: 'https://ai-service.dxos.workers.dev/provider/anthropic',
|
|
20
|
-
}),
|
|
21
|
-
),
|
|
22
|
-
Layer.provide(FetchHttpClient.layer),
|
|
23
|
-
),
|
|
24
|
-
),
|
|
25
|
-
];
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
8
|
-
import { AiContextBinder, AiConversation } from '@dxos/assistant';
|
|
9
|
-
import { Agent } from '@dxos/assistant-toolkit';
|
|
10
|
-
import { Blueprint, Prompt, Template } from '@dxos/blueprints';
|
|
11
|
-
import { type Queue } from '@dxos/client/echo';
|
|
12
|
-
import { Sequence } from '@dxos/conductor';
|
|
13
|
-
import { Filter, Key, Obj, Ref, Type } from '@dxos/echo';
|
|
14
|
-
import { TracingService, serializeFunction } from '@dxos/functions';
|
|
15
|
-
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
16
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
17
|
-
import { Collection } from '@dxos/schema';
|
|
18
|
-
import { type Message } from '@dxos/types';
|
|
19
|
-
|
|
20
|
-
import { type AiChatServices, updateName } from '../processor';
|
|
21
|
-
import { Assistant, AssistantAction } from '../types';
|
|
22
|
-
|
|
23
|
-
import { ASSISTANT_BLUEPRINT_KEY, createBlueprint } from './blueprint-definition';
|
|
24
|
-
import { AssistantCapabilities } from './capabilities';
|
|
25
|
-
|
|
26
|
-
export default (context: PluginContext) => [
|
|
27
|
-
contributes(Capabilities.IntentResolver, [
|
|
28
|
-
createResolver({
|
|
29
|
-
intent: AssistantAction.OnCreateSpace,
|
|
30
|
-
resolve: ({ space, rootCollection }) =>
|
|
31
|
-
Effect.gen(function* () {
|
|
32
|
-
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
33
|
-
const chatCollection = Collection.makeManaged({ key: Assistant.Chat.typename });
|
|
34
|
-
const blueprintCollection = Collection.makeManaged({ key: Blueprint.Blueprint.typename });
|
|
35
|
-
const promptCollection = Collection.makeManaged({ key: Type.getTypename(Prompt.Prompt) });
|
|
36
|
-
rootCollection.objects.push(
|
|
37
|
-
Ref.make(chatCollection),
|
|
38
|
-
Ref.make(blueprintCollection),
|
|
39
|
-
Ref.make(promptCollection),
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
// TODO(wittjosiah): Remove once function registry is avaiable.
|
|
43
|
-
space.db.add(serializeFunction(Agent.prompt));
|
|
44
|
-
|
|
45
|
-
// Create default chat.
|
|
46
|
-
const { object: chat } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
47
|
-
space.db.add(chat);
|
|
48
|
-
}),
|
|
49
|
-
}),
|
|
50
|
-
createResolver({
|
|
51
|
-
intent: AssistantAction.CreateChat,
|
|
52
|
-
resolve: async ({ space, name }) => {
|
|
53
|
-
const queue = space.queues.create();
|
|
54
|
-
const chat = Assistant.makeChat({ name, queue });
|
|
55
|
-
|
|
56
|
-
// TODO(wittjosiah): This should be a space-level setting.
|
|
57
|
-
// TODO(burdon): Clone when activated. Copy-on-write for template.
|
|
58
|
-
const { objects: blueprints } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
59
|
-
let defaultBlueprint = blueprints.find((blueprint) => blueprint.key === ASSISTANT_BLUEPRINT_KEY);
|
|
60
|
-
if (!defaultBlueprint) {
|
|
61
|
-
defaultBlueprint = space.db.add(createBlueprint());
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const binder = new AiContextBinder(queue);
|
|
65
|
-
await binder.use((binder) => binder.bind({ blueprints: [Ref.make(defaultBlueprint)] }));
|
|
66
|
-
|
|
67
|
-
return {
|
|
68
|
-
data: { object: chat },
|
|
69
|
-
};
|
|
70
|
-
},
|
|
71
|
-
}),
|
|
72
|
-
createResolver({
|
|
73
|
-
intent: AssistantAction.UpdateChatName,
|
|
74
|
-
resolve: async ({ chat }) => {
|
|
75
|
-
const space = getSpace(chat);
|
|
76
|
-
const queue = chat.queue.target as Queue<Message.Message>;
|
|
77
|
-
if (!space || !queue) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const runtimeResolver = context.getCapability(AutomationCapabilities.ComputeRuntime);
|
|
82
|
-
const runtime = await runtimeResolver
|
|
83
|
-
.getRuntime(space.id)
|
|
84
|
-
.runPromise(Effect.runtime<AiChatServices>().pipe(Effect.provide(TracingService.layerNoop)));
|
|
85
|
-
|
|
86
|
-
await new AiConversation(queue).use(async (conversation) => updateName(runtime, conversation, chat));
|
|
87
|
-
},
|
|
88
|
-
}),
|
|
89
|
-
createResolver({
|
|
90
|
-
intent: AssistantAction.CreateBlueprint,
|
|
91
|
-
resolve: ({ key, name, description }) => ({
|
|
92
|
-
data: {
|
|
93
|
-
object: Blueprint.make({
|
|
94
|
-
key,
|
|
95
|
-
name,
|
|
96
|
-
description,
|
|
97
|
-
instructions: Template.make(),
|
|
98
|
-
}),
|
|
99
|
-
},
|
|
100
|
-
}),
|
|
101
|
-
}),
|
|
102
|
-
createResolver({
|
|
103
|
-
intent: AssistantAction.CreatePrompt,
|
|
104
|
-
resolve: ({ name }) => ({
|
|
105
|
-
data: {
|
|
106
|
-
object: Prompt.make({ name }),
|
|
107
|
-
},
|
|
108
|
-
}),
|
|
109
|
-
}),
|
|
110
|
-
createResolver({
|
|
111
|
-
intent: AssistantAction.CreateSequence,
|
|
112
|
-
resolve: ({ name }) => ({
|
|
113
|
-
data: {
|
|
114
|
-
object: Obj.make(Sequence, {
|
|
115
|
-
name,
|
|
116
|
-
steps: [
|
|
117
|
-
{
|
|
118
|
-
id: Key.ObjectId.random(),
|
|
119
|
-
instructions: 'You are a helpful assistant.',
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
}),
|
|
123
|
-
},
|
|
124
|
-
}),
|
|
125
|
-
}),
|
|
126
|
-
createResolver({
|
|
127
|
-
intent: AssistantAction.SetCurrentChat,
|
|
128
|
-
resolve: ({ companionTo, chat }) =>
|
|
129
|
-
Effect.gen(function* () {
|
|
130
|
-
const state = context.getCapability(AssistantCapabilities.MutableState);
|
|
131
|
-
state.currentChat[Obj.getDXN(companionTo).toString()] = chat && Obj.getDXN(chat).toString();
|
|
132
|
-
}),
|
|
133
|
-
}),
|
|
134
|
-
]),
|
|
135
|
-
];
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as OpenAiClient from '@effect/ai-openai/OpenAiClient';
|
|
6
|
-
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
7
|
-
import * as Layer from 'effect/Layer';
|
|
8
|
-
|
|
9
|
-
import * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
10
|
-
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* To start LM Studio server:
|
|
14
|
-
* ```bash
|
|
15
|
-
* ~/.lmstudio/bin/lms server start --cors
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export default (): Capability<any>[] => [
|
|
19
|
-
contributes(
|
|
20
|
-
Capabilities.AiModelResolver,
|
|
21
|
-
AiServiceRouter.LMStudioResolver.pipe(
|
|
22
|
-
Layer.provide(
|
|
23
|
-
OpenAiClient.layer({
|
|
24
|
-
apiUrl: AiServiceRouter.DEFAULT_LMSTUDIO_ENDPOINT,
|
|
25
|
-
}),
|
|
26
|
-
),
|
|
27
|
-
Layer.provide(FetchHttpClient.layer),
|
|
28
|
-
),
|
|
29
|
-
),
|
|
30
|
-
];
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
-
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
9
|
-
import { getSpace } from '@dxos/client/echo';
|
|
10
|
-
import { Sequence } from '@dxos/conductor';
|
|
11
|
-
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
12
|
-
import { Obj } from '@dxos/echo';
|
|
13
|
-
import { SettingsStore } from '@dxos/local-storage';
|
|
14
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
AssistantSettings,
|
|
18
|
-
BlueprintArticle,
|
|
19
|
-
ChatCompanion,
|
|
20
|
-
ChatContainer,
|
|
21
|
-
ChatDialog,
|
|
22
|
-
PromptArticle,
|
|
23
|
-
} from '../components';
|
|
24
|
-
import { ASSISTANT_DIALOG, meta } from '../meta';
|
|
25
|
-
import { Assistant } from '../types';
|
|
26
|
-
|
|
27
|
-
export default () =>
|
|
28
|
-
contributes(Capabilities.ReactSurface, [
|
|
29
|
-
createSurface({
|
|
30
|
-
id: `${meta.id}/plugin-settings`,
|
|
31
|
-
role: 'article',
|
|
32
|
-
filter: (data): data is { subject: SettingsStore<Assistant.Settings> } =>
|
|
33
|
-
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
34
|
-
component: ({ data: { subject } }) => <AssistantSettings settings={subject.value} />,
|
|
35
|
-
}),
|
|
36
|
-
createSurface({
|
|
37
|
-
id: `${meta.id}/chat`,
|
|
38
|
-
role: 'article',
|
|
39
|
-
filter: (data): data is { subject: Assistant.Chat; variant: undefined } =>
|
|
40
|
-
Obj.instanceOf(Assistant.Chat, data.subject) && data.variant !== 'assistant-chat',
|
|
41
|
-
component: ({ data, role }) => <ChatContainer role={role} chat={data.subject} />,
|
|
42
|
-
}),
|
|
43
|
-
// TODO(wittjosiah): This is flashing when chat changes.
|
|
44
|
-
createSurface({
|
|
45
|
-
id: `${meta.id}/companion-chat`,
|
|
46
|
-
role: 'article',
|
|
47
|
-
filter: (data): data is { companionTo: Obj.Any; subject: Assistant.Chat | 'assistant-chat' } =>
|
|
48
|
-
Obj.isObject(data.companionTo) &&
|
|
49
|
-
(Obj.instanceOf(Assistant.Chat, data.subject) || data.subject === 'assistant-chat'),
|
|
50
|
-
component: ({ data, role }) => <ChatCompanion role={role} data={data} />,
|
|
51
|
-
}),
|
|
52
|
-
createSurface({
|
|
53
|
-
id: `${meta.id}/companion-invocations`,
|
|
54
|
-
role: 'article',
|
|
55
|
-
filter: (data): data is { companionTo: Sequence } =>
|
|
56
|
-
(Obj.instanceOf(Sequence, data.companionTo) || Obj.instanceOf(Prompt.Prompt, data.companionTo)) &&
|
|
57
|
-
data.subject === 'invocations',
|
|
58
|
-
component: ({ data }) => {
|
|
59
|
-
const space = getSpace(data.companionTo);
|
|
60
|
-
// TODO(wittjosiah): Support invocation filtering for prompts.
|
|
61
|
-
const target = Obj.instanceOf(Prompt.Prompt, data.companionTo) ? undefined : data.companionTo;
|
|
62
|
-
return (
|
|
63
|
-
<StackItem.Content>
|
|
64
|
-
<InvocationTraceContainer space={space} target={target} detailAxis='block' />
|
|
65
|
-
</StackItem.Content>
|
|
66
|
-
);
|
|
67
|
-
},
|
|
68
|
-
}),
|
|
69
|
-
createSurface({
|
|
70
|
-
id: `${meta.id}/blueprint`,
|
|
71
|
-
role: 'article',
|
|
72
|
-
filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
|
|
73
|
-
component: ({ data }) => <BlueprintArticle subject={data.subject} />,
|
|
74
|
-
}),
|
|
75
|
-
createSurface({
|
|
76
|
-
id: `${meta.id}/prompt`,
|
|
77
|
-
role: 'article',
|
|
78
|
-
filter: (data): data is { subject: Prompt.Prompt } => Obj.instanceOf(Prompt.Prompt, data.subject),
|
|
79
|
-
component: ({ data }) => <PromptArticle subject={data.subject} />,
|
|
80
|
-
}),
|
|
81
|
-
createSurface({
|
|
82
|
-
id: ASSISTANT_DIALOG,
|
|
83
|
-
role: 'dialog',
|
|
84
|
-
filter: (data): data is { props: { chat: Assistant.Chat } } => data.component === ASSISTANT_DIALOG,
|
|
85
|
-
component: ({ data }) => <ChatDialog {...data.props} />,
|
|
86
|
-
}),
|
|
87
|
-
]);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { live } from '@dxos/live-object';
|
|
7
|
-
|
|
8
|
-
import { meta } from '../meta';
|
|
9
|
-
import { Assistant } from '../types';
|
|
10
|
-
|
|
11
|
-
export default () => {
|
|
12
|
-
const settings = live<Assistant.Settings>({});
|
|
13
|
-
|
|
14
|
-
return contributes(Capabilities.Settings, {
|
|
15
|
-
prefix: meta.id,
|
|
16
|
-
schema: Assistant.Settings,
|
|
17
|
-
value: settings,
|
|
18
|
-
});
|
|
19
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { contributes } from '@dxos/app-framework';
|
|
6
|
-
import { LocalStorageStore } from '@dxos/local-storage';
|
|
7
|
-
|
|
8
|
-
import { meta } from '../meta';
|
|
9
|
-
|
|
10
|
-
import { AssistantCapabilities } from './capabilities';
|
|
11
|
-
|
|
12
|
-
export default () => {
|
|
13
|
-
// NOTE: This needs to be a chat object rather than a string id to avoid a query race.
|
|
14
|
-
// TODO(wittjosiah): Handle serialization and hydration for this so it can be cached.
|
|
15
|
-
const state = new LocalStorageStore<AssistantCapabilities.AssistantState>(meta.id, {
|
|
16
|
-
currentChat: {},
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
state.prop({ key: 'currentChat', type: LocalStorageStore.json<Record<string, string | undefined>>() });
|
|
20
|
-
|
|
21
|
-
return contributes(AssistantCapabilities.State, state.values, () => state.close());
|
|
22
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Layer from 'effect/Layer';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, type Capability, type PluginContext, contributes } from '@dxos/app-framework';
|
|
8
|
-
import { GenericToolkit } from '@dxos/assistant';
|
|
9
|
-
import { AssistantToolkit, SystemToolkit, WebSearchToolkit } from '@dxos/assistant-toolkit';
|
|
10
|
-
|
|
11
|
-
export default (_context: PluginContext): Capability<any>[] => [
|
|
12
|
-
contributes(Capabilities.Toolkit, GenericToolkit.make(AssistantToolkit.AssistantToolkit, AssistantToolkit.layer())),
|
|
13
|
-
|
|
14
|
-
// TODO(burdon): How to manage dependencies across blueprints.
|
|
15
|
-
contributes(Capabilities.Toolkit, GenericToolkit.make(SystemToolkit.SystemToolkit, SystemToolkit.layer())),
|
|
16
|
-
contributes(Capabilities.Toolkit, GenericToolkit.make(WebSearchToolkit, Layer.empty)),
|
|
17
|
-
];
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type ContentBlock, type Message } from '@dxos/types';
|
|
6
|
-
|
|
7
|
-
type Reducer<R, I> = (acc: R, value: I, idx: number) => R;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Reducer that collapses related message blocks into single messages.
|
|
11
|
-
* For example, combines tool request/response pairs into a single message.
|
|
12
|
-
*
|
|
13
|
-
* Typical order:
|
|
14
|
-
* - message 0
|
|
15
|
-
* - text
|
|
16
|
-
* - message 1
|
|
17
|
-
* - text
|
|
18
|
-
* - toolCall
|
|
19
|
-
* - summary
|
|
20
|
-
* - message 2
|
|
21
|
-
* - toolResult
|
|
22
|
-
* - message 3
|
|
23
|
-
* - text
|
|
24
|
-
* - summary
|
|
25
|
-
*
|
|
26
|
-
* Coverts to:
|
|
27
|
-
* - message 0
|
|
28
|
-
* - text
|
|
29
|
-
* - message 1
|
|
30
|
-
* - text
|
|
31
|
-
* - message 2
|
|
32
|
-
* - toolCall
|
|
33
|
-
* - toolResult
|
|
34
|
-
* - summary
|
|
35
|
-
* - message 3
|
|
36
|
-
* - text
|
|
37
|
-
* - summary
|
|
38
|
-
*/
|
|
39
|
-
export const reduceMessages: Reducer<
|
|
40
|
-
{
|
|
41
|
-
messages: Message.Message[];
|
|
42
|
-
current?: Message.Message;
|
|
43
|
-
toolBlock?: boolean;
|
|
44
|
-
assistantMessages?: Message.Message[];
|
|
45
|
-
},
|
|
46
|
-
Message.Message
|
|
47
|
-
> = ({ messages, current, toolBlock, assistantMessages = [] }, message) => {
|
|
48
|
-
// Treat tool calls as assistant messages.
|
|
49
|
-
let assistant = message?.sender.role === 'assistant';
|
|
50
|
-
let i = 0;
|
|
51
|
-
for (const block of message.blocks) {
|
|
52
|
-
switch (block._tag) {
|
|
53
|
-
// TODO(burdon): Preserve call tool title.
|
|
54
|
-
case 'toolCall': {
|
|
55
|
-
assistant = true;
|
|
56
|
-
if (!toolBlock) {
|
|
57
|
-
current = {
|
|
58
|
-
...message,
|
|
59
|
-
id: [message.id, i++].join('_'),
|
|
60
|
-
blocks: [block],
|
|
61
|
-
};
|
|
62
|
-
messages.push(current);
|
|
63
|
-
toolBlock = true;
|
|
64
|
-
} else {
|
|
65
|
-
current!.blocks.push(block);
|
|
66
|
-
}
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
case 'toolResult': {
|
|
71
|
-
assistant = true;
|
|
72
|
-
if (toolBlock) {
|
|
73
|
-
current!.blocks.push(block);
|
|
74
|
-
}
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
case 'summary': {
|
|
79
|
-
assistant = true;
|
|
80
|
-
if (toolBlock) {
|
|
81
|
-
current!.blocks.push(block);
|
|
82
|
-
} else {
|
|
83
|
-
const summary = reduceSummary([...assistantMessages, message]);
|
|
84
|
-
current!.blocks.push(summary);
|
|
85
|
-
}
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
default: {
|
|
90
|
-
assistant = message.sender.role === 'assistant';
|
|
91
|
-
current = {
|
|
92
|
-
...message,
|
|
93
|
-
id: [message.id, i++].join('_'),
|
|
94
|
-
blocks: [block],
|
|
95
|
-
};
|
|
96
|
-
messages.push(current);
|
|
97
|
-
toolBlock = false;
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return {
|
|
104
|
-
messages,
|
|
105
|
-
current,
|
|
106
|
-
toolBlock,
|
|
107
|
-
assistantMessages: assistant ? [...assistantMessages, message] : undefined,
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Accumulate token counts from all summary blocks in pending messages.
|
|
113
|
-
*/
|
|
114
|
-
const reduceSummary = (messages: Message.Message[]): ContentBlock.Summary => {
|
|
115
|
-
let start: number | undefined;
|
|
116
|
-
return messages.reduce<ContentBlock.Summary>(
|
|
117
|
-
(acc, msg) => {
|
|
118
|
-
const time = new Date(msg.created).getTime();
|
|
119
|
-
if (!start) {
|
|
120
|
-
start = time;
|
|
121
|
-
}
|
|
122
|
-
msg.blocks.forEach((block) => {
|
|
123
|
-
switch (block._tag) {
|
|
124
|
-
case 'toolCall': {
|
|
125
|
-
acc.toolCalls = (acc.toolCalls ?? 0) + 1;
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
case 'summary': {
|
|
129
|
-
acc.model = block.model;
|
|
130
|
-
if (block.usage) {
|
|
131
|
-
acc.message = block.message;
|
|
132
|
-
acc.usage = {
|
|
133
|
-
inputTokens: (acc.usage?.inputTokens ?? 0) + (block.usage.inputTokens ?? 0),
|
|
134
|
-
outputTokens: (acc.usage?.outputTokens ?? 0) + (block.usage.outputTokens ?? 0),
|
|
135
|
-
totalTokens: (acc.usage?.totalTokens ?? 0) + (block.usage.totalTokens ?? 0),
|
|
136
|
-
};
|
|
137
|
-
acc.duration = time - (start ?? time);
|
|
138
|
-
}
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
return acc;
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
_tag: 'summary',
|
|
148
|
-
duration: 0,
|
|
149
|
-
} satisfies ContentBlock.Summary,
|
|
150
|
-
);
|
|
151
|
-
};
|
package/src/events.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineEvent } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
import { meta } from './meta';
|
|
8
|
-
|
|
9
|
-
export namespace AssistantEvents {
|
|
10
|
-
export const SetupAiServiceProviders = defineEvent(`${meta.id}/event/setup-ai-service-providers`);
|
|
11
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Schema from 'effect/Schema';
|
|
7
|
-
|
|
8
|
-
import { defineFunction } from '@dxos/functions';
|
|
9
|
-
import { log } from '@dxos/log';
|
|
10
|
-
|
|
11
|
-
export default defineFunction({
|
|
12
|
-
key: 'dxos.org/function/assistant-analysis',
|
|
13
|
-
name: 'Assistant analysis',
|
|
14
|
-
description: 'Enter analysis analysis mode.',
|
|
15
|
-
inputSchema: Schema.Struct({
|
|
16
|
-
enable: Schema.Boolean.annotations({ description: 'Enable or disable analysis mode.' }),
|
|
17
|
-
}),
|
|
18
|
-
outputSchema: Schema.Void,
|
|
19
|
-
handler: Effect.fn(function* ({ context, data: { enable } }) {
|
|
20
|
-
log.info('analysis mode', { enable });
|
|
21
|
-
}),
|
|
22
|
-
});
|
|
File without changes
|
|
File without changes
|