@dxos/plugin-assistant 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/AssistantSettings-PP6JSHWB.mjs +93 -0
- package/dist/lib/browser/AssistantSettings-PP6JSHWB.mjs.map +7 -0
- package/dist/lib/browser/BlueprintArticle-H6R33TZZ.mjs +35 -0
- package/dist/lib/browser/BlueprintArticle-H6R33TZZ.mjs.map +7 -0
- package/dist/lib/browser/{ChatCompanion-ECQYUQ2B.mjs → ChatCompanion-GXS6DK4X.mjs} +75 -26
- package/dist/lib/browser/ChatCompanion-GXS6DK4X.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-SMSZXEF5.mjs +12 -0
- package/dist/lib/browser/{ChatDialog-SMK4RSZU.mjs → ChatDialog-ZCVPPONM.mjs} +9 -9
- package/dist/lib/browser/ChatDialog-ZCVPPONM.mjs.map +7 -0
- package/dist/lib/browser/ProjectArticle-QDBTIFNE.mjs +91 -0
- package/dist/lib/browser/ProjectArticle-QDBTIFNE.mjs.map +7 -0
- package/dist/lib/browser/ProjectSettings-L5MCDUXK.mjs +232 -0
- package/dist/lib/browser/ProjectSettings-L5MCDUXK.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-G5YSAEGK.mjs +71 -0
- package/dist/lib/browser/PromptArticle-G5YSAEGK.mjs.map +7 -0
- package/dist/lib/browser/TriggerStatus-X35WDCK5.mjs +112 -0
- package/dist/lib/browser/TriggerStatus-X35WDCK5.mjs.map +7 -0
- package/dist/lib/browser/{ai-service-5GUDOEWF.mjs → ai-service-CY2BYPH6.mjs} +5 -4
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-DSNH2OMY.mjs → app-graph-builder-ECQCWGCN.mjs} +54 -42
- package/dist/lib/browser/app-graph-builder-ECQCWGCN.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-CKG4TQ2J.mjs +35 -0
- package/dist/lib/browser/blueprint-definition-CKG4TQ2J.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +3 -7
- package/dist/lib/browser/{chunk-EXVT7D4B.mjs → chunk-2VIEX4RA.mjs} +3 -3
- package/dist/lib/browser/{chunk-EXVT7D4B.mjs.map → chunk-2VIEX4RA.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-V772AMZM.mjs → chunk-734CB3XG.mjs} +28 -48
- package/dist/lib/browser/chunk-734CB3XG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-3JYPE2MM.mjs → chunk-A346P45I.mjs} +623 -330
- package/dist/lib/browser/chunk-A346P45I.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ML3QCFKA.mjs → chunk-JYY5AD65.mjs} +50 -29
- package/dist/lib/browser/chunk-JYY5AD65.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-QCCOFBUX.mjs → chunk-WP4WY2Y6.mjs} +18 -22
- package/dist/lib/browser/chunk-WP4WY2Y6.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZZRRSIQQ.mjs +26 -0
- package/dist/lib/browser/chunk-ZZRRSIQQ.mjs.map +7 -0
- package/dist/lib/browser/{edge-model-resolver-26BOY6HY.mjs → edge-model-resolver-YTMFQEN5.mjs} +4 -3
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +109 -85
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{local-model-resolver-ZFIM6GGV.mjs → local-model-resolver-CGRQH37T.mjs} +4 -3
- package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{operation-resolver-7XJLBRQY.mjs → operation-resolver-DYSWWNVG.mjs} +34 -43
- package/dist/lib/browser/operation-resolver-DYSWWNVG.mjs.map +7 -0
- package/dist/lib/browser/react-surface-M3GSSFPC.mjs +142 -0
- package/dist/lib/browser/react-surface-M3GSSFPC.mjs.map +7 -0
- package/dist/lib/browser/{settings-4ZDLUMYE.mjs → settings-NC5DQWES.mjs} +6 -5
- package/dist/lib/browser/settings-NC5DQWES.mjs.map +7 -0
- package/dist/lib/browser/{state-AN6336ZX.mjs → state-EMIKHGYZ.mjs} +3 -3
- package/dist/lib/browser/toolkit-XRSBBB3L.mjs +16 -0
- package/dist/lib/browser/toolkit-XRSBBB3L.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/AssistantSettings-3MNGBQB2.mjs +94 -0
- package/dist/lib/node-esm/AssistantSettings-3MNGBQB2.mjs.map +7 -0
- package/dist/lib/node-esm/BlueprintArticle-2KYFUQKY.mjs +36 -0
- package/dist/lib/node-esm/BlueprintArticle-2KYFUQKY.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatCompanion-Q4FUZ2MW.mjs → ChatCompanion-MPQGSWZB.mjs} +75 -26
- package/dist/lib/node-esm/ChatCompanion-MPQGSWZB.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-DMOAYUUM.mjs +13 -0
- package/dist/lib/node-esm/{ChatDialog-AP45PVZR.mjs → ChatDialog-PV2EU2XM.mjs} +9 -9
- package/dist/lib/node-esm/ChatDialog-PV2EU2XM.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectArticle-BCIBESJN.mjs +92 -0
- package/dist/lib/node-esm/ProjectArticle-BCIBESJN.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectSettings-K3YBQWDD.mjs +233 -0
- package/dist/lib/node-esm/ProjectSettings-K3YBQWDD.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-HAGZPZWV.mjs +72 -0
- package/dist/lib/node-esm/PromptArticle-HAGZPZWV.mjs.map +7 -0
- package/dist/lib/node-esm/TriggerStatus-V3QMIE7T.mjs +113 -0
- package/dist/lib/node-esm/TriggerStatus-V3QMIE7T.mjs.map +7 -0
- package/dist/lib/node-esm/{ai-service-PXKKCFIF.mjs → ai-service-ZI3A6RVG.mjs} +5 -4
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-TJCUEXW5.mjs → app-graph-builder-YPHP6X6W.mjs} +54 -42
- package/dist/lib/node-esm/app-graph-builder-YPHP6X6W.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-UZWGSFBI.mjs +36 -0
- package/dist/lib/node-esm/blueprint-definition-UZWGSFBI.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +3 -7
- package/dist/lib/node-esm/{chunk-XI5T3MJC.mjs → chunk-5DLYAEBK.mjs} +623 -330
- package/dist/lib/node-esm/chunk-5DLYAEBK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-AK3JJ76X.mjs +28 -0
- package/dist/lib/node-esm/chunk-AK3JJ76X.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZRIPP7YF.mjs → chunk-JMBYVUD6.mjs} +50 -29
- package/dist/lib/node-esm/chunk-JMBYVUD6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-355W5B27.mjs → chunk-JQAXFBBU.mjs} +28 -48
- package/dist/lib/node-esm/chunk-JQAXFBBU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-POWB2BPC.mjs → chunk-TEYTGR67.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-POWB2BPC.mjs.map → chunk-TEYTGR67.mjs.map} +1 -1
- package/dist/lib/node-esm/{ChatContainer-AKI33HIB.mjs → chunk-ZTL6HRDB.mjs} +18 -22
- package/dist/lib/node-esm/chunk-ZTL6HRDB.mjs.map +7 -0
- package/dist/lib/node-esm/{edge-model-resolver-G5KMODPO.mjs → edge-model-resolver-CMJ3KNLQ.mjs} +4 -3
- package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +109 -85
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{local-model-resolver-KDZLYI7Y.mjs → local-model-resolver-FFDAKOXN.mjs} +4 -3
- package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{operation-resolver-SX4WMNA7.mjs → operation-resolver-EE4EBO2Y.mjs} +34 -43
- package/dist/lib/node-esm/operation-resolver-EE4EBO2Y.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-U3PGFTKA.mjs +143 -0
- package/dist/lib/node-esm/react-surface-U3PGFTKA.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-CQEOHR3R.mjs → settings-OOAN5LAO.mjs} +6 -5
- package/dist/lib/node-esm/settings-OOAN5LAO.mjs.map +7 -0
- package/dist/lib/node-esm/{state-HDON4REW.mjs → state-7A7QPQKK.mjs} +3 -3
- package/dist/lib/node-esm/toolkit-5IWGLUF4.mjs +17 -0
- package/dist/lib/node-esm/toolkit-5IWGLUF4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/assistant/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/index.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +1 -6
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts +3 -2
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service/index.d.ts +1 -1
- package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +4 -19
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +1 -2
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +4 -3
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +0 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +4 -3
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +4 -3
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state/state.d.ts +1 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts +1 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +3 -2
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +11 -7
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +2 -2
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +2 -2
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +128 -8
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +125 -5
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +125 -5
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +4 -4
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +2 -2
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +125 -5
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +2 -2
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -12
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/containers/AssistantSettings/index.d.ts +3 -0
- package/dist/types/src/containers/AssistantSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +6 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts +3 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatCompanion}/ChatCompanion.d.ts +2 -3
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts +3 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatContainer}/ChatContainer.d.ts +6 -6
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts +3 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatDialog}/ChatDialog.d.ts +2 -3
- package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts +3 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/Project/ProjectArticle.d.ts +7 -0
- package/dist/types/src/containers/Project/ProjectArticle.d.ts.map +1 -0
- package/dist/types/src/containers/Project/ProjectSettings.d.ts +6 -0
- package/dist/types/src/containers/Project/ProjectSettings.d.ts.map +1 -0
- package/dist/types/src/containers/Project/index.d.ts +7 -0
- package/dist/types/src/containers/Project/index.d.ts.map +1 -0
- package/dist/types/src/containers/Project/triggers.d.ts +6 -0
- package/dist/types/src/containers/Project/triggers.d.ts.map +1 -0
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +6 -0
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts +3 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +4 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts +3 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +10 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +2 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +2 -2
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +2 -2
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +7 -3
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/update-name.d.ts +2 -2
- package/dist/types/src/processor/update-name.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +125 -5
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +5 -27
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +13 -15
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +95 -92
- package/src/AssistantPlugin.tsx +64 -36
- package/src/blueprints/assistant/blueprint.conversations.json +1 -0
- package/src/blueprints/assistant/blueprint.test.ts +48 -0
- package/src/blueprints/assistant/blueprint.ts +27 -0
- package/src/blueprints/assistant/index.ts +5 -0
- package/src/blueprints/index.ts +1 -8
- package/src/capabilities/ai-service/ai-service.ts +4 -3
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +48 -31
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +32 -42
- package/src/capabilities/blueprint-definition/index.ts +0 -1
- package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +4 -3
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/local-model-resolver/local-model-resolver.ts +4 -3
- package/src/capabilities/operation-resolver/operation-resolver.ts +29 -26
- package/src/capabilities/react-surface/react-surface.tsx +53 -29
- package/src/capabilities/settings/settings.ts +3 -2
- package/src/capabilities/toolkit/toolkit.ts +5 -16
- package/src/components/Chat/Chat.tsx +67 -30
- package/src/components/ChatProgress/ChatProgress.tsx +4 -5
- package/src/components/ChatPrompt/ChatActions.tsx +9 -1
- package/src/components/ChatPrompt/ChatOptions.tsx +29 -9
- package/src/components/ChatPrompt/ChatReferences.tsx +14 -4
- package/src/components/ChatThread/ChatThread.stories.tsx +11 -11
- package/src/components/ChatThread/ChatThread.tsx +15 -6
- package/src/components/ChatThread/Link.tsx +1 -1
- package/src/components/ChatThread/registry.tsx +51 -18
- package/src/components/ChatThread/sync.test.ts +2 -0
- package/src/components/ChatThread/sync.ts +14 -8
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +3 -3
- package/src/components/TemplateEditor/TemplateEditor.tsx +2 -2
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +3 -3
- package/src/components/TemplateEditor/TemplateForm.tsx +6 -7
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +4 -4
- package/src/components/ToolBlock/ToolBlock.tsx +15 -15
- package/src/components/Toolbox/Toolbox.stories.tsx +3 -3
- package/src/components/Toolbox/Toolbox.tsx +49 -48
- package/src/components/Typewriter/AssistantToolbar.tsx +3 -3
- package/src/components/Typewriter/Typewriter.stories.tsx +18 -15
- package/src/components/Typewriter/Typewriter.tsx +1 -1
- package/src/components/Typewriter/assistant-extension.tsx +3 -5
- package/src/components/index.ts +0 -9
- package/src/{components → containers}/AssistantSettings/AssistantSettings.tsx +15 -15
- package/src/containers/AssistantSettings/index.ts +7 -0
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +29 -0
- package/src/containers/BlueprintArticle/index.ts +7 -0
- package/src/{components → containers/ChatCompanion}/ChatCompanion.tsx +84 -22
- package/src/containers/ChatCompanion/index.ts +7 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +69 -0
- package/src/containers/ChatContainer/index.ts +7 -0
- package/src/{components → containers/ChatDialog}/ChatDialog.tsx +7 -9
- package/src/containers/ChatDialog/index.ts +7 -0
- package/src/containers/Project/ProjectArticle.tsx +117 -0
- package/src/containers/Project/ProjectSettings.tsx +134 -0
- package/src/containers/Project/index.ts +16 -0
- package/src/containers/Project/triggers.ts +149 -0
- package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
- package/src/containers/PromptArticle/index.ts +7 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +140 -0
- package/src/containers/TriggerStatus/index.ts +7 -0
- package/src/containers/index.ts +15 -0
- package/src/hooks/useBlueprintRegistry.ts +7 -4
- package/src/hooks/useChatProcessor.ts +2 -1
- package/src/hooks/useChatServices.ts +3 -3
- package/src/hooks/useChatToolbarActions.ts +6 -5
- package/src/hooks/useFilteredTypes.ts +2 -2
- package/src/hooks/useReferencesProvider.ts +1 -5
- package/src/index.ts +1 -0
- package/src/meta.ts +2 -2
- package/src/processor/processor.test.ts +8 -7
- package/src/processor/processor.ts +47 -26
- package/src/processor/update-name.ts +2 -3
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +1 -1
- package/src/translations.ts +29 -3
- package/src/types/Assistant.ts +4 -38
- package/src/types/AssistantAction.ts +14 -13
- package/src/types/capabilities.ts +2 -2
- package/src/types/events.ts +1 -1
- package/src/types/index.ts +3 -0
- package/src/types/service.ts +4 -4
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs +0 -31
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-ECQYUQ2B.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-QCCOFBUX.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-SMK4RSZU.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs +0 -53
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs.map +0 -7
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs +0 -14
- package/dist/lib/browser/chunk-3JYPE2MM.mjs.map +0 -7
- package/dist/lib/browser/chunk-DKQMSMBN.mjs +0 -326
- package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +0 -7
- package/dist/lib/browser/chunk-ML3QCFKA.mjs.map +0 -7
- package/dist/lib/browser/chunk-MRJVYGLU.mjs +0 -208
- package/dist/lib/browser/chunk-MRJVYGLU.mjs.map +0 -7
- package/dist/lib/browser/chunk-V772AMZM.mjs.map +0 -7
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs +0 -41
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs.map +0 -7
- package/dist/lib/browser/react-surface-NCITRSJJ.mjs +0 -109
- package/dist/lib/browser/react-surface-NCITRSJJ.mjs.map +0 -7
- package/dist/lib/browser/repair-6QGAKOVM.mjs +0 -54
- package/dist/lib/browser/repair-6QGAKOVM.mjs.map +0 -7
- package/dist/lib/browser/settings-4ZDLUMYE.mjs.map +0 -7
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs +0 -18
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs +0 -32
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-Q4FUZ2MW.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-AKI33HIB.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-AP45PVZR.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs +0 -54
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs +0 -15
- package/dist/lib/node-esm/chunk-355W5B27.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs +0 -327
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs +0 -209
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs +0 -42
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XI5T3MJC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ST6V7LPE.mjs +0 -110
- package/dist/lib/node-esm/react-surface-ST6V7LPE.mjs.map +0 -7
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs +0 -55
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs.map +0 -7
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs +0 -19
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs.map +0 -7
- package/dist/types/src/blueprints/assistant-blueprint.d.ts +0 -209
- package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/index.d.ts +0 -3
- package/dist/types/src/capabilities/repair/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/repair.d.ts +0 -6
- package/dist/types/src/capabilities/repair/repair.d.ts.map +0 -1
- package/dist/types/src/components/AssistantSettings/index.d.ts +0 -2
- package/dist/types/src/components/AssistantSettings/index.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +0 -7
- package/dist/types/src/components/BlueprintArticle.d.ts.map +0 -1
- package/dist/types/src/components/ChatCompanion.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +0 -1
- package/dist/types/src/components/PromptArticle.d.ts +0 -7
- package/dist/types/src/components/PromptArticle.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/object-list.d.ts +0 -10
- package/dist/types/src/functions/object-list.d.ts.map +0 -1
- package/dist/types/src/functions/object-load.d.ts +0 -8
- package/dist/types/src/functions/object-load.d.ts.map +0 -1
- package/dist/types/src/functions/object-search.d.ts +0 -10
- package/dist/types/src/functions/object-search.d.ts.map +0 -1
- package/src/blueprints/assistant-blueprint.ts +0 -62
- package/src/capabilities/repair/index.ts +0 -7
- package/src/capabilities/repair/repair.ts +0 -63
- package/src/components/AssistantSettings/index.ts +0 -5
- package/src/components/BlueprintArticle.tsx +0 -29
- package/src/components/ChatContainer.tsx +0 -61
- package/src/components/PromptArticle.tsx +0 -50
- package/src/functions/index.ts +0 -7
- package/src/functions/object-list.ts +0 -49
- package/src/functions/object-load.ts +0 -47
- package/src/functions/object-search.ts +0 -46
- /package/dist/lib/browser/{blueprint-definition-DGHH7MUU.mjs.map → ChatContainer-SMSZXEF5.mjs.map} +0 -0
- /package/dist/lib/browser/{state-AN6336ZX.mjs.map → state-EMIKHGYZ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{blueprint-definition-SEMDEIYG.mjs.map → ChatContainer-DMOAYUUM.mjs.map} +0 -0
- /package/dist/lib/node-esm/{state-HDON4REW.mjs.map → state-7A7QPQKK.mjs.map} +0 -0
- /package/dist/types/src/{components → containers}/AssistantSettings/AssistantSettings.d.ts +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
export * from './Project';
|
|
8
|
+
|
|
9
|
+
export const AssistantSettings: ComponentType<any> = lazy(() => import('./AssistantSettings'));
|
|
10
|
+
export const BlueprintArticle: ComponentType<any> = lazy(() => import('./BlueprintArticle'));
|
|
11
|
+
export const ChatCompanion: ComponentType<any> = lazy(() => import('./ChatCompanion'));
|
|
12
|
+
export const ChatContainer: ComponentType<any> = lazy(() => import('./ChatContainer'));
|
|
13
|
+
export const ChatDialog: ComponentType<any> = lazy(() => import('./ChatDialog'));
|
|
14
|
+
export const PromptArticle: ComponentType<any> = lazy(() => import('./PromptArticle'));
|
|
15
|
+
export const TriggerStatus: ComponentType<any> = lazy(() => import('./TriggerStatus'));
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useCapabilities } from '@dxos/app-framework/ui';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
9
|
import { type AiContextBinder } from '@dxos/assistant';
|
|
10
10
|
import { Blueprint } from '@dxos/blueprints';
|
|
11
11
|
import { type Database, Filter, Obj, Ref } from '@dxos/echo';
|
|
@@ -17,8 +17,11 @@ import { distinctBy } from '@dxos/util';
|
|
|
17
17
|
*/
|
|
18
18
|
// TODO(burdon): Reconcile with eventual public registry.
|
|
19
19
|
export const useBlueprintRegistry = () => {
|
|
20
|
-
const
|
|
21
|
-
return useMemo(
|
|
20
|
+
const blueprintDefinitions = useCapabilities(AppCapabilities.BlueprintDefinition);
|
|
21
|
+
return useMemo(
|
|
22
|
+
() => new Blueprint.Registry(blueprintDefinitions.map((blueprint) => blueprint.make())),
|
|
23
|
+
[blueprintDefinitions],
|
|
24
|
+
);
|
|
22
25
|
};
|
|
23
26
|
|
|
24
27
|
export const useBlueprints = ({
|
|
@@ -7,6 +7,7 @@ import type * as Runtime from 'effect/Runtime';
|
|
|
7
7
|
import { useContext, useMemo, useState } from 'react';
|
|
8
8
|
|
|
9
9
|
import { AiConversation } from '@dxos/assistant';
|
|
10
|
+
import { type Chat } from '@dxos/assistant-toolkit';
|
|
10
11
|
import { type Blueprint } from '@dxos/blueprints';
|
|
11
12
|
import { log } from '@dxos/log';
|
|
12
13
|
import { type Queue, type Space } from '@dxos/react-client/echo';
|
|
@@ -17,7 +18,7 @@ import { type Assistant } from '../types';
|
|
|
17
18
|
|
|
18
19
|
export type UseChatProcessorProps = {
|
|
19
20
|
space?: Space;
|
|
20
|
-
chat?:
|
|
21
|
+
chat?: Chat.Chat;
|
|
21
22
|
preset?: AiServicePreset;
|
|
22
23
|
services?: () => Promise<Runtime.Runtime<AiChatServices>>;
|
|
23
24
|
blueprintRegistry?: Blueprint.Registry;
|
|
@@ -6,7 +6,8 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
import type * as Runtime from 'effect/Runtime';
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
|
|
9
|
-
import { useCapability } from '@dxos/app-framework/
|
|
9
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
10
|
+
import { type Chat } from '@dxos/assistant-toolkit';
|
|
10
11
|
import { type Key } from '@dxos/echo';
|
|
11
12
|
import { TracingService } from '@dxos/functions';
|
|
12
13
|
import { TracingServiceExt } from '@dxos/functions-runtime';
|
|
@@ -14,11 +15,10 @@ import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
|
14
15
|
import { useClient } from '@dxos/react-client';
|
|
15
16
|
|
|
16
17
|
import { type AiChatServices } from '../processor';
|
|
17
|
-
import { type Assistant } from '../types';
|
|
18
18
|
|
|
19
19
|
export type UseChatServicesProps = {
|
|
20
20
|
id?: Key.SpaceId;
|
|
21
|
-
chat?:
|
|
21
|
+
chat?: Chat.Chat;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -6,7 +6,8 @@ import { Atom } from '@effect-atom/atom-react';
|
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
|
|
9
|
-
import { useOperationInvoker } from '@dxos/app-framework/
|
|
9
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
10
|
+
import { Chat } from '@dxos/assistant-toolkit';
|
|
10
11
|
import { Filter, Obj, Query } from '@dxos/echo';
|
|
11
12
|
import { runAndForwardErrors } from '@dxos/effect';
|
|
12
13
|
import { invariant } from '@dxos/invariant';
|
|
@@ -15,10 +16,10 @@ import { MenuBuilder, useMenuActions } from '@dxos/react-ui-menu';
|
|
|
15
16
|
|
|
16
17
|
import { useChatContext } from '../components';
|
|
17
18
|
import { meta } from '../meta';
|
|
18
|
-
import {
|
|
19
|
+
import { AssistantOperation } from '../types';
|
|
19
20
|
|
|
20
21
|
export type ChatToolbarActionsProps = {
|
|
21
|
-
chat?:
|
|
22
|
+
chat?: Chat.Chat;
|
|
22
23
|
companionTo?: Obj.Unknown;
|
|
23
24
|
};
|
|
24
25
|
|
|
@@ -26,7 +27,7 @@ export const useChatToolbarActions = ({ chat, companionTo }: ChatToolbarActionsP
|
|
|
26
27
|
const { invoke } = useOperationInvoker();
|
|
27
28
|
const { db } = useChatContext('useChatToolbarActions');
|
|
28
29
|
const query = companionTo
|
|
29
|
-
? Query.select(Filter.id(companionTo.id)).targetOf(
|
|
30
|
+
? Query.select(Filter.id(companionTo.id)).targetOf(Chat.CompanionTo).source()
|
|
30
31
|
: Query.select(Filter.nothing());
|
|
31
32
|
|
|
32
33
|
// TODO(wittjosiah): Query in react vs query in atom?
|
|
@@ -98,7 +99,7 @@ export const useChatToolbarActions = ({ chat, companionTo }: ChatToolbarActionsP
|
|
|
98
99
|
builder.action(
|
|
99
100
|
chat.id,
|
|
100
101
|
{
|
|
101
|
-
label: Obj.getLabel(chat) ?? ['object name placeholder', { ns:
|
|
102
|
+
label: Obj.getLabel(chat) ?? ['object name placeholder', { ns: Chat.Chat.typename }],
|
|
102
103
|
},
|
|
103
104
|
() =>
|
|
104
105
|
Effect.gen(function* () {
|
|
@@ -10,8 +10,8 @@ import { EntityKind, SystemTypeAnnotation, getTypeAnnotation } from '@dxos/echo/
|
|
|
10
10
|
|
|
11
11
|
// TODO(burdon): Pass in filter.
|
|
12
12
|
// TODO(wittjosiah): Factor out.
|
|
13
|
-
export const useFilteredTypes = (db?: Database.Database): Type.
|
|
14
|
-
const [types, setTypes] = useState<Type.
|
|
13
|
+
export const useFilteredTypes = (db?: Database.Database): Type.AnyEntity[] => {
|
|
14
|
+
const [types, setTypes] = useState<Type.AnyEntity[]>([]);
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
if (!db) {
|
|
17
17
|
return;
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Common } from '@dxos/app-framework';
|
|
8
|
-
import { useCapabilities } from '@dxos/app-framework/react';
|
|
9
7
|
import { type Space } from '@dxos/client/echo';
|
|
10
8
|
import { Filter, Obj } from '@dxos/echo';
|
|
11
9
|
import { type ReferencesProvider } from '@dxos/react-ui-chat';
|
|
@@ -14,8 +12,6 @@ import { type ReferencesProvider } from '@dxos/react-ui-chat';
|
|
|
14
12
|
* Resolve references to objects in the space.
|
|
15
13
|
*/
|
|
16
14
|
export const useReferencesProvider = (space?: Space): ReferencesProvider | undefined => {
|
|
17
|
-
const blueprints = useCapabilities(Common.Capability.BlueprintDefinition);
|
|
18
|
-
|
|
19
15
|
return useMemo<ReferencesProvider | undefined>((): ReferencesProvider | undefined => {
|
|
20
16
|
if (!space) {
|
|
21
17
|
return undefined;
|
|
@@ -52,7 +48,7 @@ export const useReferencesProvider = (space?: Space): ReferencesProvider | undef
|
|
|
52
48
|
return { uri, label: Obj.getLabel(object) ?? '' };
|
|
53
49
|
},
|
|
54
50
|
} satisfies ReferencesProvider;
|
|
55
|
-
}, [space
|
|
51
|
+
}, [space]);
|
|
56
52
|
};
|
|
57
53
|
|
|
58
54
|
const stringMatch = (query: string, label: string) => label.toLowerCase().startsWith(query.toLowerCase());
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
|
-
id: 'dxos.
|
|
9
|
+
id: 'org.dxos.plugin.assistant',
|
|
10
10
|
name: 'Assistant',
|
|
11
11
|
description: trim`
|
|
12
12
|
Intelligent AI assistant that can analyze and interact with objects across your spaces.
|
|
@@ -18,4 +18,4 @@ export const meta: Plugin.Meta = {
|
|
|
18
18
|
tags: ['labs'],
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export const ASSISTANT_DIALOG = `${meta.id}
|
|
21
|
+
export const ASSISTANT_DIALOG = `${meta.id}.assistant.dialog`;
|
|
@@ -10,8 +10,9 @@ import * as Layer from 'effect/Layer';
|
|
|
10
10
|
import * as Schema from 'effect/Schema';
|
|
11
11
|
|
|
12
12
|
import { AiService } from '@dxos/ai';
|
|
13
|
+
import { GenericToolkit } from '@dxos/ai';
|
|
13
14
|
import { AiServiceTestingPreset } from '@dxos/ai/testing';
|
|
14
|
-
import { AiConversation,
|
|
15
|
+
import { AiConversation, ToolExecutionServices } from '@dxos/assistant';
|
|
15
16
|
import { acquireReleaseResource } from '@dxos/effect';
|
|
16
17
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
17
18
|
import { CredentialsService, QueueService, TracingService } from '@dxos/functions';
|
|
@@ -28,9 +29,6 @@ const TestToolkit = Toolkit.make(
|
|
|
28
29
|
}),
|
|
29
30
|
);
|
|
30
31
|
|
|
31
|
-
// TODO(burdon): Create minimal toolkit.
|
|
32
|
-
const toolkit = Toolkit.merge(TestToolkit) as Toolkit.Toolkit<any>;
|
|
33
|
-
|
|
34
32
|
// TODO(burdon): Explain structure.
|
|
35
33
|
const TestServicesLayer = Layer.mergeAll(
|
|
36
34
|
TracingService.layerNoop,
|
|
@@ -45,10 +43,13 @@ const TestServicesLayer = Layer.mergeAll(
|
|
|
45
43
|
|
|
46
44
|
const TestLayer: Layer.Layer<AiChatServices, never, never> = Layer.mergeAll(
|
|
47
45
|
AiService.model('@anthropic/claude-opus-4-0'),
|
|
48
|
-
|
|
49
|
-
makeToolExecutionServiceFromFunctions(toolkit, toolkit.toLayer({}) as any),
|
|
46
|
+
ToolExecutionServices,
|
|
50
47
|
CredentialsService.layerFromDatabase(),
|
|
51
|
-
).pipe(
|
|
48
|
+
).pipe(
|
|
49
|
+
Layer.provideMerge(GenericToolkit.providerLayer(GenericToolkit.make(TestToolkit, TestToolkit.toLayer({} as any)))),
|
|
50
|
+
Layer.provideMerge(TestServicesLayer),
|
|
51
|
+
Layer.orDie,
|
|
52
|
+
);
|
|
52
53
|
|
|
53
54
|
// TODO(burdon): Create actual test with mock LLM.
|
|
54
55
|
describe('Chat processor', () => {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import type * as Tool from '@effect/ai/Tool';
|
|
5
6
|
import { Atom, Registry } from '@effect-atom/atom-react';
|
|
6
7
|
import * as Cause from 'effect/Cause';
|
|
7
8
|
import * as Effect from 'effect/Effect';
|
|
@@ -19,16 +20,19 @@ import {
|
|
|
19
20
|
type ToolResolverService,
|
|
20
21
|
} from '@dxos/ai';
|
|
21
22
|
import {
|
|
23
|
+
AiContextService,
|
|
22
24
|
type AiConversation,
|
|
23
25
|
type AiConversationRunProps,
|
|
24
26
|
ArtifactDiffResolver,
|
|
25
27
|
GenerationObserver,
|
|
26
28
|
createSystemPrompt,
|
|
27
29
|
} from '@dxos/assistant';
|
|
30
|
+
import { formatSystemPrompt } from '@dxos/assistant';
|
|
31
|
+
import { type Chat } from '@dxos/assistant-toolkit';
|
|
28
32
|
import { type Blueprint } from '@dxos/blueprints';
|
|
29
33
|
import { Obj } from '@dxos/echo';
|
|
30
34
|
import { type Database } from '@dxos/echo';
|
|
31
|
-
import { runAndForwardErrors, throwCause } from '@dxos/effect';
|
|
35
|
+
import { runAndForwardErrors, throwCause, unwrapExit } from '@dxos/effect';
|
|
32
36
|
import {
|
|
33
37
|
type CredentialsService,
|
|
34
38
|
type FunctionInvocationService,
|
|
@@ -38,8 +42,6 @@ import {
|
|
|
38
42
|
import { log } from '@dxos/log';
|
|
39
43
|
import { type ContentBlock, Message } from '@dxos/types';
|
|
40
44
|
|
|
41
|
-
import { type Assistant } from '../types';
|
|
42
|
-
|
|
43
45
|
import { updateName } from './update-name';
|
|
44
46
|
|
|
45
47
|
export type AiChatServices =
|
|
@@ -86,7 +88,7 @@ export class AiChatProcessor {
|
|
|
86
88
|
private readonly _pending = Atom.make<Message.Message[]>([]);
|
|
87
89
|
|
|
88
90
|
/** Currently streaming message (from the AI service). */
|
|
89
|
-
private readonly _streaming = Atom.make<
|
|
91
|
+
private readonly _streaming = Atom.make<Message.Message[]>([]);
|
|
90
92
|
|
|
91
93
|
/** Currently active request fiber. */
|
|
92
94
|
private _fiber: Fiber.Fiber<void, any> | undefined;
|
|
@@ -95,18 +97,13 @@ export class AiChatProcessor {
|
|
|
95
97
|
private _lastRequest: AiRequest | undefined;
|
|
96
98
|
|
|
97
99
|
/** Streaming state. */
|
|
98
|
-
public readonly streaming = Atom.make<boolean>((get) =>
|
|
100
|
+
public readonly streaming = Atom.make<boolean>((get) => get(this._streaming).length > 0);
|
|
99
101
|
|
|
100
102
|
/** Active state. */
|
|
101
103
|
public readonly active = Atom.make(false);
|
|
102
104
|
|
|
103
105
|
/** Array of Messages (incl. the current message being streamed). */
|
|
104
|
-
public readonly messages = Atom.make<Message.Message[]>((get) =>
|
|
105
|
-
Option.match(get(this._streaming), {
|
|
106
|
-
onNone: () => get(this._pending),
|
|
107
|
-
onSome: (streaming) => [...get(this._pending), streaming],
|
|
108
|
-
}),
|
|
109
|
-
);
|
|
106
|
+
public readonly messages = Atom.make<Message.Message[]>((get) => [...get(this._pending), ...get(this._streaming)]);
|
|
110
107
|
|
|
111
108
|
/** Last error. */
|
|
112
109
|
public readonly error = Atom.make<Option.Option<Error>>(Option.none());
|
|
@@ -141,6 +138,30 @@ export class AiChatProcessor {
|
|
|
141
138
|
return this._options.blueprintRegistry;
|
|
142
139
|
}
|
|
143
140
|
|
|
141
|
+
get system(): string {
|
|
142
|
+
return this._options.system ?? '';
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async getTools(): Promise<Record<string, Tool.Any>> {
|
|
146
|
+
return unwrapExit(await this._conversation.getTools().pipe(await Runtime.runPromiseExit(await this._services())));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
async getSystemPrompt(): Promise<string> {
|
|
150
|
+
return unwrapExit(
|
|
151
|
+
await Effect.gen(this, function* () {
|
|
152
|
+
const blueprints = this.context.getBlueprints();
|
|
153
|
+
const objects = this.context.getObjects();
|
|
154
|
+
const system = yield* formatSystemPrompt({ system: this._options.system, blueprints, objects });
|
|
155
|
+
return system;
|
|
156
|
+
}).pipe(
|
|
157
|
+
Effect.provideService(AiContextService, {
|
|
158
|
+
binder: this.context,
|
|
159
|
+
}),
|
|
160
|
+
await Runtime.runPromiseExit(await this._services()),
|
|
161
|
+
),
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
144
165
|
/**
|
|
145
166
|
* Initiates a new request.
|
|
146
167
|
*/
|
|
@@ -218,7 +239,7 @@ export class AiChatProcessor {
|
|
|
218
239
|
/**
|
|
219
240
|
* Update the current chat's name.
|
|
220
241
|
*/
|
|
221
|
-
async updateName(chat:
|
|
242
|
+
async updateName(chat: Chat.Chat): Promise<void> {
|
|
222
243
|
const runtime = await this._services();
|
|
223
244
|
await updateName(runtime, this._conversation, chat, this._options.model);
|
|
224
245
|
}
|
|
@@ -247,29 +268,29 @@ export class AiChatProcessor {
|
|
|
247
268
|
},
|
|
248
269
|
};
|
|
249
270
|
|
|
250
|
-
|
|
251
|
-
function* (this: AiChatProcessor, message: Message.Message) {
|
|
252
|
-
this._registry.set(this._streaming, Option.none());
|
|
253
|
-
this._registry.update(this._pending, (pending) => [...pending, message]);
|
|
254
|
-
}.bind(this),
|
|
255
|
-
);
|
|
256
|
-
|
|
271
|
+
// TODO(dmaretskyi): Due to the way effect streams do buffering, we cannot rely on _onBlock and _onMessage to be called in order.
|
|
257
272
|
private _onBlock = Effect.fn(
|
|
258
273
|
function* (this: AiChatProcessor, block: ContentBlock.Any) {
|
|
259
274
|
this._registry.update(this._streaming, (streaming) => {
|
|
260
|
-
const blocks = streaming.
|
|
261
|
-
Option.map((streaming) => streaming.blocks.filter((b: ContentBlock.Any) => !b.pending)),
|
|
262
|
-
Option.getOrElse(() => []),
|
|
263
|
-
);
|
|
275
|
+
const blocks = streaming.filter((message) => message.blocks.every((block) => !block.pending));
|
|
264
276
|
|
|
265
|
-
|
|
277
|
+
// AiSession emits a message per each assistant content-block, so we do the same.
|
|
278
|
+
return [
|
|
279
|
+
...blocks,
|
|
266
280
|
Obj.make(Message.Message, {
|
|
267
281
|
created: new Date().toISOString(),
|
|
268
282
|
sender: { role: 'assistant' },
|
|
269
|
-
blocks: [
|
|
283
|
+
blocks: [block],
|
|
270
284
|
}),
|
|
271
|
-
|
|
285
|
+
];
|
|
272
286
|
});
|
|
273
287
|
}.bind(this),
|
|
274
288
|
);
|
|
289
|
+
|
|
290
|
+
private _onMessage = Effect.fn(
|
|
291
|
+
function* (this: AiChatProcessor, message: Message.Message) {
|
|
292
|
+
this._registry.set(this._streaming, []);
|
|
293
|
+
this._registry.update(this._pending, (pending) => [...pending, message]);
|
|
294
|
+
}.bind(this),
|
|
295
|
+
);
|
|
275
296
|
}
|
|
@@ -9,12 +9,11 @@ import * as Runtime from 'effect/Runtime';
|
|
|
9
9
|
|
|
10
10
|
import { AiService, DEFAULT_EDGE_MODEL, type ModelName } from '@dxos/ai';
|
|
11
11
|
import { type AiConversation, AiSession } from '@dxos/assistant';
|
|
12
|
+
import { type Chat } from '@dxos/assistant-toolkit';
|
|
12
13
|
import { Obj } from '@dxos/echo';
|
|
13
14
|
import { throwCause } from '@dxos/effect';
|
|
14
15
|
import { trim } from '@dxos/util';
|
|
15
16
|
|
|
16
|
-
import { type Assistant } from '../types';
|
|
17
|
-
|
|
18
17
|
import { type AiChatServices } from './processor';
|
|
19
18
|
|
|
20
19
|
/**
|
|
@@ -24,7 +23,7 @@ import { type AiChatServices } from './processor';
|
|
|
24
23
|
export const updateName = async (
|
|
25
24
|
runtime: Runtime.Runtime<AiChatServices>,
|
|
26
25
|
conversation: AiConversation,
|
|
27
|
-
chat:
|
|
26
|
+
chat: Chat.Chat,
|
|
28
27
|
model: ModelName = DEFAULT_EDGE_MODEL,
|
|
29
28
|
): Promise<void> => {
|
|
30
29
|
const history = await conversation.getHistory();
|
|
@@ -9,16 +9,16 @@ export const RESEARCH_SEQUENCE_DEFINITION: SequenceDefinition = {
|
|
|
9
9
|
steps: [
|
|
10
10
|
{
|
|
11
11
|
instructions: 'Research information and entities related to the selected objects.',
|
|
12
|
-
tools: [ToolId.make('search/
|
|
12
|
+
tools: [ToolId.make('search/web-search')],
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
instructions:
|
|
16
16
|
'Based on your research find matching entires that are already in the graph. Do exaustive research.',
|
|
17
|
-
tools: [ToolId.make('search/
|
|
17
|
+
tools: [ToolId.make('search/local-search')],
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
instructions: 'Add researched data to the graph. Make connections to existing objects.',
|
|
21
|
-
tools: [ToolId.make('search/
|
|
21
|
+
tools: [ToolId.make('search/local-search'), ToolId.make('graph/writer')],
|
|
22
22
|
},
|
|
23
23
|
],
|
|
24
24
|
};
|
|
@@ -6,7 +6,7 @@ import { Obj, type Type } from '@dxos/echo';
|
|
|
6
6
|
|
|
7
7
|
import { type ApiAuthorization, type BaseServiceRegistry, ServiceType, categoryIcons } from '../types';
|
|
8
8
|
|
|
9
|
-
const ServiceTypeSchema = ServiceType as unknown as Type.
|
|
9
|
+
const ServiceTypeSchema = ServiceType as unknown as Type.AnyObj;
|
|
10
10
|
|
|
11
11
|
export class MockServiceRegistry implements BaseServiceRegistry {
|
|
12
12
|
async queryServices(): Promise<ServiceType[]> {
|
package/src/translations.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Chat, Project } from '@dxos/assistant-toolkit';
|
|
5
6
|
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
6
7
|
import { Sequence } from '@dxos/conductor';
|
|
7
8
|
import { Type } from '@dxos/echo';
|
|
8
9
|
import { type Resource } from '@dxos/react-ui';
|
|
9
10
|
|
|
10
11
|
import { meta } from './meta';
|
|
11
|
-
import { Assistant } from './types';
|
|
12
12
|
|
|
13
13
|
// TODO(burdon): Standardize translation names.
|
|
14
14
|
export const translations = [
|
|
@@ -21,6 +21,7 @@ export const translations = [
|
|
|
21
21
|
'typename label_one': 'Blueprint',
|
|
22
22
|
'typename label_other': 'Blueprints',
|
|
23
23
|
'object name placeholder': 'New blueprint',
|
|
24
|
+
'add object label': 'Add blueprint',
|
|
24
25
|
'rename object label': 'Rename blueprint',
|
|
25
26
|
'delete object label': 'Delete blueprint',
|
|
26
27
|
'object deleted label': 'Blueprint deleted',
|
|
@@ -31,6 +32,7 @@ export const translations = [
|
|
|
31
32
|
'typename label_one': 'Prompt',
|
|
32
33
|
'typename label_other': 'Prompts',
|
|
33
34
|
'object name placeholder': 'New prompt',
|
|
35
|
+
'add object label': 'Add prompt',
|
|
34
36
|
'rename object label': 'Rename prompt',
|
|
35
37
|
'delete object label': 'Delete prompt',
|
|
36
38
|
'object deleted label': 'Prompt deleted',
|
|
@@ -42,17 +44,30 @@ export const translations = [
|
|
|
42
44
|
'typename label_one': 'Sequence',
|
|
43
45
|
'typename label_other': 'Sequences',
|
|
44
46
|
'object name placeholder': 'New sequence',
|
|
47
|
+
'add object label': 'Add sequence',
|
|
45
48
|
'rename object label': 'Rename sequence',
|
|
46
49
|
'delete object label': 'Delete sequence',
|
|
47
50
|
'object deleted label': 'Sequence deleted',
|
|
48
51
|
},
|
|
49
|
-
[
|
|
52
|
+
[Chat.Chat.typename]: {
|
|
50
53
|
'typename label': 'AI Chat',
|
|
51
54
|
'object name placeholder': 'New AI Chat',
|
|
55
|
+
'add object label': 'Add AI chat',
|
|
52
56
|
'rename object label': 'Rename AI Chat',
|
|
53
57
|
'delete object label': 'Delete AI Chat',
|
|
54
58
|
'object deleted label': 'AI Chat deleted',
|
|
55
59
|
},
|
|
60
|
+
[Project.Project.typename]: {
|
|
61
|
+
'typename label': 'Project',
|
|
62
|
+
'typename label_zero': 'Projects',
|
|
63
|
+
'typename label_one': 'Project',
|
|
64
|
+
'typename label_other': 'Projects',
|
|
65
|
+
'object name placeholder': 'New project',
|
|
66
|
+
'add object label': 'Add project',
|
|
67
|
+
'rename object label': 'Rename project',
|
|
68
|
+
'delete object label': 'Delete project',
|
|
69
|
+
'object deleted label': 'Project deleted',
|
|
70
|
+
},
|
|
56
71
|
// TODO(burdon): Reconcile with react-ui-chat.
|
|
57
72
|
[meta.id]: {
|
|
58
73
|
'templates label': 'Templates',
|
|
@@ -83,6 +98,7 @@ export const translations = [
|
|
|
83
98
|
|
|
84
99
|
'assistant dialog title': 'Assistant',
|
|
85
100
|
'open assistant label': 'Open assistant',
|
|
101
|
+
'reset blueprints label': 'Reset blueprints',
|
|
86
102
|
|
|
87
103
|
'no tools': 'No tools are configured',
|
|
88
104
|
'no results': 'No results',
|
|
@@ -95,7 +111,7 @@ export const translations = [
|
|
|
95
111
|
'chat update name label': 'Update AI Chat name',
|
|
96
112
|
|
|
97
113
|
'toolkit label': 'Toolkit',
|
|
98
|
-
'
|
|
114
|
+
'stats label': 'Stats',
|
|
99
115
|
|
|
100
116
|
'search placeholder': 'Search...',
|
|
101
117
|
'prompt placeholder': 'Enter question or command...',
|
|
@@ -113,6 +129,16 @@ export const translations = [
|
|
|
113
129
|
'settings llm provider label': 'LLM provider',
|
|
114
130
|
'settings edge llm model label': 'Remote language model',
|
|
115
131
|
'settings ollama llm model label': 'Ollama language model',
|
|
132
|
+
|
|
133
|
+
// Trigger status
|
|
134
|
+
'trigger status disabled label': 'Triggers disabled',
|
|
135
|
+
'trigger status idle label': 'Triggers idle',
|
|
136
|
+
'trigger status running label': 'Trigger running',
|
|
137
|
+
'trigger status error label': 'Trigger error',
|
|
138
|
+
'trigger runtime label': 'Trigger Runtime',
|
|
139
|
+
'trigger runtime description': 'Enable automatic trigger execution',
|
|
140
|
+
'trigger last invocation label': 'Last run',
|
|
141
|
+
'trigger duration label': 'Duration',
|
|
116
142
|
},
|
|
117
143
|
},
|
|
118
144
|
},
|
package/src/types/Assistant.ts
CHANGED
|
@@ -4,47 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';
|
|
9
|
-
import { Queue } from '@dxos/echo-db';
|
|
7
|
+
import { Chat as ChatModule } from '@dxos/assistant-toolkit';
|
|
10
8
|
|
|
11
9
|
import { LLM_PROVIDERS } from './defs';
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export const Chat = Schema.Struct({
|
|
17
|
-
name: Schema.String.pipe(Schema.optional),
|
|
18
|
-
queue: Type.Ref(Queue).pipe(FormInputAnnotation.set(false)),
|
|
19
|
-
// TODO(dmaretskyi): Eventually this and the message queue will be the same.
|
|
20
|
-
traceQueue: Type.Ref(Queue).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
21
|
-
}).pipe(
|
|
22
|
-
Type.object({
|
|
23
|
-
typename: 'dxos.org/type/assistant/Chat',
|
|
24
|
-
version: '0.2.0',
|
|
25
|
-
}),
|
|
26
|
-
LabelAnnotation.set(['name']),
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
export interface Chat extends Schema.Schema.Type<typeof Chat> {}
|
|
30
|
-
|
|
31
|
-
export const make = (props: Obj.MakeProps<typeof Chat>) => Obj.make(Chat, props);
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Relation between a Chat and companion objects (e.g., artifacts).
|
|
35
|
-
*/
|
|
36
|
-
export const CompanionTo = Schema.Struct({
|
|
37
|
-
id: Obj.ID,
|
|
38
|
-
}).pipe(
|
|
39
|
-
Type.relation({
|
|
40
|
-
typename: 'dxos.org/relation/assistant/CompanionTo',
|
|
41
|
-
version: '0.1.0',
|
|
42
|
-
source: Chat,
|
|
43
|
-
target: Type.Obj,
|
|
44
|
-
}),
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
export interface CompanionTo extends Schema.Schema.Type<typeof CompanionTo> {}
|
|
11
|
+
// Re-export Chat schema for backward compatibility.
|
|
12
|
+
export const Chat = ChatModule.Chat;
|
|
13
|
+
export type Chat = ChatModule.Chat;
|
|
48
14
|
|
|
49
15
|
/**
|
|
50
16
|
* Plugin settings.
|
|
@@ -5,21 +5,20 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Chat } from '@dxos/assistant-toolkit';
|
|
8
9
|
import { SpaceSchema } from '@dxos/client/echo';
|
|
9
|
-
import { Database,
|
|
10
|
+
import { Database, Obj } from '@dxos/echo';
|
|
11
|
+
import { Collection } from '@dxos/echo';
|
|
10
12
|
import { Operation } from '@dxos/operation';
|
|
11
|
-
import { Collection } from '@dxos/schema';
|
|
12
13
|
|
|
13
14
|
import { meta } from '../meta';
|
|
14
15
|
|
|
15
|
-
import { Chat } from './Assistant';
|
|
16
|
-
|
|
17
16
|
// Operations
|
|
18
|
-
const ASSISTANT_OPERATION = `${meta.id}
|
|
17
|
+
const ASSISTANT_OPERATION = `${meta.id}.operation`;
|
|
19
18
|
|
|
20
19
|
export namespace AssistantOperation {
|
|
21
20
|
export const OnCreateSpace = Operation.make({
|
|
22
|
-
meta: { key: `${ASSISTANT_OPERATION}
|
|
21
|
+
meta: { key: `${ASSISTANT_OPERATION}.on-create-space`, name: 'On Create Space' },
|
|
23
22
|
services: [Capability.Service],
|
|
24
23
|
schema: {
|
|
25
24
|
input: Schema.Struct({
|
|
@@ -31,37 +30,39 @@ export namespace AssistantOperation {
|
|
|
31
30
|
});
|
|
32
31
|
|
|
33
32
|
export const CreateChat = Operation.make({
|
|
34
|
-
meta: { key: `${ASSISTANT_OPERATION}
|
|
33
|
+
meta: { key: `${ASSISTANT_OPERATION}.create-chat`, name: 'Create Chat' },
|
|
35
34
|
services: [Capability.Service],
|
|
36
35
|
schema: {
|
|
37
36
|
input: Schema.Struct({
|
|
38
37
|
db: Database.Database,
|
|
39
38
|
name: Schema.optional(Schema.String),
|
|
39
|
+
/** If false, chat is created in-memory only and not added to space. Defaults to true. */
|
|
40
|
+
addToSpace: Schema.optional(Schema.Boolean),
|
|
40
41
|
}),
|
|
41
42
|
output: Schema.Struct({
|
|
42
|
-
object: Chat,
|
|
43
|
+
object: Chat.Chat,
|
|
43
44
|
}),
|
|
44
45
|
},
|
|
45
46
|
});
|
|
46
47
|
|
|
47
48
|
export const UpdateChatName = Operation.make({
|
|
48
|
-
meta: { key: `${ASSISTANT_OPERATION}
|
|
49
|
+
meta: { key: `${ASSISTANT_OPERATION}.update-chat-name`, name: 'Update Chat Name' },
|
|
49
50
|
services: [Capability.Service],
|
|
50
51
|
schema: {
|
|
51
52
|
input: Schema.Struct({
|
|
52
|
-
chat: Chat,
|
|
53
|
+
chat: Chat.Chat,
|
|
53
54
|
}),
|
|
54
55
|
output: Schema.Void,
|
|
55
56
|
},
|
|
56
57
|
});
|
|
57
58
|
|
|
58
59
|
export const SetCurrentChat = Operation.make({
|
|
59
|
-
meta: { key: `${ASSISTANT_OPERATION}
|
|
60
|
+
meta: { key: `${ASSISTANT_OPERATION}.set-current-chat`, name: 'Set Current Chat' },
|
|
60
61
|
services: [Capability.Service],
|
|
61
62
|
schema: {
|
|
62
63
|
input: Schema.Struct({
|
|
63
|
-
companionTo:
|
|
64
|
-
chat: Chat.pipe(Schema.optional),
|
|
64
|
+
companionTo: Obj.Unknown,
|
|
65
|
+
chat: Chat.Chat.pipe(Schema.optional),
|
|
65
66
|
}),
|
|
66
67
|
output: Schema.Void,
|
|
67
68
|
},
|