@dxos/plugin-assistant 0.8.4-main.dedc0f3 → 0.8.4-main.e8ec1fe
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-IMCR3642.mjs +36 -0
- package/dist/lib/browser/BlueprintArticle-IMCR3642.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-JYD2RIBJ.mjs +158 -0
- package/dist/lib/browser/ChatCompanion-JYD2RIBJ.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-G6YHR6GJ.mjs → ChatContainer-XCPBWYIR.mjs} +22 -20
- package/dist/lib/browser/ChatContainer-XCPBWYIR.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-HJ7VDRQO.mjs → ChatDialog-DT7KFCRL.mjs} +8 -6
- package/dist/lib/browser/ChatDialog-DT7KFCRL.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-45QX25Y5.mjs +59 -0
- package/dist/lib/browser/PromptArticle-45QX25Y5.mjs.map +7 -0
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs +19 -0
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-3C43MLCD.mjs → app-graph-builder-VZEXMDTY.mjs} +67 -21
- package/dist/lib/browser/app-graph-builder-VZEXMDTY.mjs.map +7 -0
- package/dist/lib/browser/{blueprint-definition-VHFSRTEJ.mjs → blueprint-definition-5FT5JGPY.mjs} +4 -4
- package/dist/lib/browser/chunk-2BOE3OTW.mjs +262 -0
- package/dist/lib/browser/chunk-2BOE3OTW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SMIVXXAI.mjs → chunk-BNTPFZ7O.mjs} +51 -24
- package/dist/lib/browser/chunk-BNTPFZ7O.mjs.map +7 -0
- package/dist/lib/browser/chunk-FJQ4ZRYJ.mjs +335 -0
- package/dist/lib/browser/chunk-FJQ4ZRYJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GLWD66TA.mjs → chunk-IXIIS4QA.mjs} +53 -38
- package/dist/lib/browser/chunk-IXIIS4QA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EZUSNS2J.mjs → chunk-LRE4VEZV.mjs} +2 -5
- package/dist/lib/browser/chunk-LRE4VEZV.mjs.map +7 -0
- package/dist/lib/browser/chunk-U62BTGDF.mjs +1929 -0
- package/dist/lib/browser/chunk-U62BTGDF.mjs.map +7 -0
- package/dist/lib/browser/chunk-WBG5PTSX.mjs +23 -0
- package/dist/lib/browser/chunk-WBG5PTSX.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +18 -0
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +118 -82
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-I6M3ZDAS.mjs → intent-resolver-AK5O4GUW.mjs} +55 -24
- package/dist/lib/browser/intent-resolver-AK5O4GUW.mjs.map +7 -0
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs +17 -0
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-WNLA2636.mjs → react-surface-YCSR2MSR.mjs} +24 -35
- package/dist/lib/browser/react-surface-YCSR2MSR.mjs.map +7 -0
- package/dist/lib/browser/{settings-36V3VUMW.mjs → settings-NYJGNQ5I.mjs} +5 -5
- package/dist/lib/browser/{settings-36V3VUMW.mjs.map → settings-NYJGNQ5I.mjs.map} +1 -1
- package/dist/lib/browser/{state-AINRYS5W.mjs → state-GG7Z3NB7.mjs} +9 -5
- package/dist/lib/browser/{state-AINRYS5W.mjs.map → state-GG7Z3NB7.mjs.map} +3 -3
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs +17 -0
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/BlueprintArticle-OL2HUY6Q.mjs +37 -0
- package/dist/lib/node-esm/BlueprintArticle-OL2HUY6Q.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-AHKJS25S.mjs +159 -0
- package/dist/lib/node-esm/ChatCompanion-AHKJS25S.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-EZZF7RSQ.mjs → ChatContainer-K7OGPE3G.mjs} +22 -20
- package/dist/lib/node-esm/ChatContainer-K7OGPE3G.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-PTQLZNJU.mjs → ChatDialog-QT6ZBX45.mjs} +8 -6
- package/dist/lib/node-esm/ChatDialog-QT6ZBX45.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-OUKFSJQV.mjs +60 -0
- package/dist/lib/node-esm/PromptArticle-OUKFSJQV.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +20 -0
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-NM3JDLQ2.mjs → app-graph-builder-VRN6ESRR.mjs} +67 -21
- package/dist/lib/node-esm/app-graph-builder-VRN6ESRR.mjs.map +7 -0
- package/dist/lib/node-esm/{blueprint-definition-4E6XTLVN.mjs → blueprint-definition-XW6QQVLV.mjs} +4 -4
- package/dist/lib/node-esm/chunk-3Q22TTXW.mjs +264 -0
- package/dist/lib/node-esm/chunk-3Q22TTXW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7YOGZI66.mjs → chunk-AB74FOA2.mjs} +51 -24
- package/dist/lib/node-esm/chunk-AB74FOA2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BHS747K7.mjs +1930 -0
- package/dist/lib/node-esm/chunk-BHS747K7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KJGD4EBJ.mjs +336 -0
- package/dist/lib/node-esm/chunk-KJGD4EBJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-QG2KT3AT.mjs → chunk-UXTUHH24.mjs} +53 -38
- package/dist/lib/node-esm/chunk-UXTUHH24.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs +25 -0
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-XD4CDA4R.mjs → chunk-YWFWT57N.mjs} +2 -5
- package/dist/lib/node-esm/chunk-YWFWT57N.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +19 -0
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +118 -82
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-VIINHFMT.mjs → intent-resolver-L2F3N45L.mjs} +55 -24
- package/dist/lib/node-esm/intent-resolver-L2F3N45L.mjs.map +7 -0
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs +18 -0
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-GP3LU6DX.mjs → react-surface-CTW44GEM.mjs} +24 -35
- package/dist/lib/node-esm/react-surface-CTW44GEM.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-7ZCZ6AS5.mjs → settings-RRHYI5KO.mjs} +5 -5
- package/dist/lib/node-esm/{settings-7ZCZ6AS5.mjs.map → settings-RRHYI5KO.mjs.map} +1 -1
- package/dist/lib/node-esm/{state-EQS5KP6M.mjs → state-FSUHFMDM.mjs} +9 -5
- package/dist/lib/node-esm/{state-EQS5KP6M.mjs.map → state-FSUHFMDM.mjs.map} +3 -3
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs +18 -0
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/AssistantPlugin.d.ts +1 -1
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +2 -3
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +2 -24
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/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/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +7 -0
- package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -0
- package/dist/types/src/components/Chat/Chat.d.ts +20 -9
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +4 -0
- 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 +7 -4
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +6 -7
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +124 -71
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/reducers.d.ts +5 -5
- package/dist/types/src/components/ChatThread/reducers.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 +12 -6
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/PromptArticle.d.ts +7 -0
- package/dist/types/src/components/PromptArticle.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +111 -61
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +111 -61
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +9 -7
- 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 +111 -61
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -9
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/functions/analysis.d.ts +1 -1
- package/dist/types/src/functions/analysis.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +2 -2
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/functions/{list.d.ts → object-list.d.ts} +2 -2
- package/dist/types/src/functions/object-list.d.ts.map +1 -0
- package/dist/types/src/functions/{load.d.ts → object-load.d.ts} +2 -2
- package/dist/types/src/functions/object-load.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -2
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +2 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +4 -2
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +2 -2
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/processor/index.d.ts +1 -0
- package/dist/types/src/processor/index.d.ts.map +1 -1
- package/dist/types/src/processor/presets.d.ts +1 -1
- package/dist/types/src/processor/presets.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +11 -10
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/update-name.d.ts +10 -0
- package/dist/types/src/processor/update-name.d.ts.map +1 -0
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +0 -2
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +3 -3
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts +2 -2
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +239 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +15 -9
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +33 -8
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +24 -18
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +94 -113
- package/src/AssistantPlugin.tsx +154 -137
- package/src/capabilities/ai-service.ts +6 -7
- package/src/capabilities/app-graph-builder.ts +69 -21
- package/src/capabilities/blueprint-definition.ts +38 -30
- package/src/capabilities/capabilities.ts +2 -56
- package/src/capabilities/edge-model-resolver.ts +5 -7
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +69 -16
- package/src/capabilities/local-model-resolver.ts +7 -9
- package/src/capabilities/react-surface.tsx +16 -20
- package/src/capabilities/state.ts +2 -0
- package/src/capabilities/toolkit.ts +9 -155
- package/src/components/BlueprintArticle.tsx +29 -0
- package/src/components/Chat/Chat.tsx +155 -113
- package/src/components/Chat/events.ts +6 -0
- package/src/components/ChatCompanion.tsx +93 -49
- package/src/components/ChatContainer.tsx +27 -17
- package/src/components/ChatDialog.tsx +9 -2
- package/src/components/ChatProgress/ChatProgress.tsx +2 -3
- package/src/components/ChatPrompt/ChatActions.tsx +2 -4
- package/src/components/ChatPrompt/ChatOptions.tsx +40 -45
- package/src/components/ChatPrompt/ChatReferences.tsx +2 -2
- package/src/components/ChatThread/ChatThread.stories.tsx +52 -34
- package/src/components/ChatThread/ChatThread.tsx +28 -34
- package/src/components/ChatThread/reducers.ts +6 -6
- package/src/components/ChatThread/registry.tsx +25 -40
- package/src/components/ChatThread/sync.test.ts +21 -13
- package/src/components/ChatThread/sync.ts +48 -13
- package/src/components/ChatThread/testing/thread.md +37 -0
- package/src/components/PromptArticle.tsx +51 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +15 -7
- package/src/components/TemplateEditor/TemplateEditor.tsx +19 -10
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +4 -6
- package/src/components/TemplateEditor/TemplateForm.tsx +2 -2
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +269 -0
- package/src/components/TemplateEditor/extensions/index.ts +6 -0
- package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
- package/src/components/ToolBlock/ToolBlock.tsx +37 -46
- package/src/components/Toolbox/Toolbox.stories.tsx +5 -8
- package/src/components/Toolbox/Toolbox.tsx +5 -5
- package/src/components/index.ts +2 -5
- package/src/functions/analysis.ts +5 -3
- package/src/functions/index.ts +2 -2
- package/src/functions/{list.ts → object-list.ts} +6 -4
- package/src/functions/{load.ts → object-load.ts} +8 -5
- package/src/hooks/index.ts +1 -2
- package/src/hooks/useBlueprintRegistry.ts +19 -4
- package/src/hooks/useChatProcessor.ts +22 -14
- package/src/hooks/useChatServices.ts +10 -7
- package/src/hooks/useChatToolbarActions.ts +122 -0
- package/src/hooks/useContextBinder.ts +19 -7
- package/src/hooks/useItemTypes.ts +1 -1
- package/src/hooks/useReferencesProvider.ts +2 -1
- package/src/index.ts +2 -0
- package/src/meta.ts +9 -6
- package/src/processor/index.ts +1 -0
- package/src/processor/presets.ts +2 -2
- package/src/processor/processor.test.ts +18 -24
- package/src/processor/processor.ts +35 -60
- package/src/processor/update-name.ts +56 -0
- package/src/queue-logger.ts +4 -8
- package/src/testing/index.ts +0 -2
- package/src/testing/test-generator.ts +15 -11
- package/src/testing/test-services.ts +2 -8
- package/src/translations.ts +24 -16
- package/src/types/Assistant.ts +10 -8
- package/src/types/AssistantAction.ts +23 -6
- package/src/types/service.ts +17 -9
- package/dist/lib/browser/BlueprintContainer-BFNN6K46.mjs +0 -29
- package/dist/lib/browser/BlueprintContainer-BFNN6K46.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-YYYCHZYV.mjs +0 -126
- package/dist/lib/browser/ChatCompanion-YYYCHZYV.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-G6YHR6GJ.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-HJ7VDRQO.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs +0 -150
- package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs.map +0 -7
- package/dist/lib/browser/ai-service-YC2EQPHA.mjs +0 -22
- package/dist/lib/browser/ai-service-YC2EQPHA.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-3C43MLCD.mjs.map +0 -7
- package/dist/lib/browser/chunk-EZUSNS2J.mjs.map +0 -7
- package/dist/lib/browser/chunk-GLWD66TA.mjs.map +0 -7
- package/dist/lib/browser/chunk-O4LUJEDV.mjs +0 -20
- package/dist/lib/browser/chunk-O4LUJEDV.mjs.map +0 -7
- package/dist/lib/browser/chunk-PL4O4ZJU.mjs +0 -1974
- package/dist/lib/browser/chunk-PL4O4ZJU.mjs.map +0 -7
- package/dist/lib/browser/chunk-PPJAIE2T.mjs +0 -299
- package/dist/lib/browser/chunk-PPJAIE2T.mjs.map +0 -7
- package/dist/lib/browser/chunk-PQI3MGDN.mjs +0 -169
- package/dist/lib/browser/chunk-PQI3MGDN.mjs.map +0 -7
- package/dist/lib/browser/chunk-R6LRGW3I.mjs +0 -216
- package/dist/lib/browser/chunk-R6LRGW3I.mjs.map +0 -7
- package/dist/lib/browser/chunk-SMIVXXAI.mjs.map +0 -7
- package/dist/lib/browser/compute-runtime-X6IREJN3.mjs +0 -155
- package/dist/lib/browser/compute-runtime-X6IREJN3.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-JNEB355N.mjs +0 -22
- package/dist/lib/browser/edge-model-resolver-JNEB355N.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-I6M3ZDAS.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-EUXSRZ7X.mjs +0 -21
- package/dist/lib/browser/local-model-resolver-EUXSRZ7X.mjs.map +0 -7
- package/dist/lib/browser/react-surface-WNLA2636.mjs.map +0 -7
- package/dist/lib/browser/toolkit-Y5OYX5PO.mjs +0 -191
- package/dist/lib/browser/toolkit-Y5OYX5PO.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-X4MRBKDR.mjs +0 -30
- package/dist/lib/node-esm/BlueprintContainer-X4MRBKDR.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-PUAFRIEC.mjs +0 -127
- package/dist/lib/node-esm/ChatCompanion-PUAFRIEC.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-EZZF7RSQ.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-PTQLZNJU.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs +0 -151
- package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-XUMZVFCK.mjs +0 -23
- package/dist/lib/node-esm/ai-service-XUMZVFCK.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-NM3JDLQ2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs +0 -170
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7YOGZI66.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LVTG5JTW.mjs +0 -217
- package/dist/lib/node-esm/chunk-LVTG5JTW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QG2KT3AT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VFY2JG62.mjs +0 -22
- package/dist/lib/node-esm/chunk-VFY2JG62.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VH3LTD76.mjs +0 -300
- package/dist/lib/node-esm/chunk-VH3LTD76.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XD4CDA4R.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZIDP7HBI.mjs +0 -1975
- package/dist/lib/node-esm/chunk-ZIDP7HBI.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-NRHLLTSC.mjs +0 -156
- package/dist/lib/node-esm/compute-runtime-NRHLLTSC.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-UE5TLLJZ.mjs +0 -23
- package/dist/lib/node-esm/edge-model-resolver-UE5TLLJZ.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-VIINHFMT.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-JBEFVVZA.mjs +0 -22
- package/dist/lib/node-esm/local-model-resolver-JBEFVVZA.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-GP3LU6DX.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-2F2OL6WB.mjs +0 -192
- package/dist/lib/node-esm/toolkit-2F2OL6WB.mjs.map +0 -7
- package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +0 -8
- package/dist/types/src/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/components/PromptSettings.d.ts +0 -6
- package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
- package/dist/types/src/components/SequenceContainer.d.ts +0 -8
- package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -267
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
- package/dist/types/src/components/SequenceEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +0 -5
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/index.d.ts +0 -2
- package/dist/types/src/components/Toolbar/index.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +0 -11
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +0 -1
- package/dist/types/src/execution-graph/execution-graph.d.ts +0 -21
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +0 -1
- package/dist/types/src/execution-graph/index.d.ts +0 -2
- package/dist/types/src/execution-graph/index.d.ts.map +0 -1
- package/dist/types/src/functions/list.d.ts.map +0 -1
- package/dist/types/src/functions/load.d.ts.map +0 -1
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +0 -8
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +0 -1
- package/dist/types/src/hooks/useExecutionGraph.d.ts +0 -6
- package/dist/types/src/hooks/useExecutionGraph.d.ts.map +0 -1
- package/dist/types/src/stories/Chat.stories.d.ts +0 -30
- package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +0 -4
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/ChatContainer.d.ts +0 -4
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/ChessContainer.d.ts +0 -4
- package/dist/types/src/stories/components/ChessContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/CommentsContainer.d.ts +0 -4
- package/dist/types/src/stories/components/CommentsContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/DebugCard.d.ts +0 -8
- package/dist/types/src/stories/components/DebugCard.d.ts.map +0 -1
- package/dist/types/src/stories/components/GraphContainer.d.ts +0 -6
- package/dist/types/src/stories/components/GraphContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/InvocationsContainer.d.ts +0 -4
- package/dist/types/src/stories/components/InvocationsContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/LoggingContainer.d.ts +0 -7
- package/dist/types/src/stories/components/LoggingContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/MessageContainer.d.ts +0 -4
- package/dist/types/src/stories/components/MessageContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/PromptContainer.d.ts +0 -6
- package/dist/types/src/stories/components/PromptContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/ResearchInputStack.d.ts +0 -4
- package/dist/types/src/stories/components/ResearchInputStack.d.ts.map +0 -1
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts +0 -4
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts.map +0 -1
- package/dist/types/src/stories/components/TasksContainer.d.ts +0 -4
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts +0 -3
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/TriggersContainer.d.ts +0 -14
- package/dist/types/src/stories/components/TriggersContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/index.d.ts +0 -16
- package/dist/types/src/stories/components/index.d.ts.map +0 -1
- package/dist/types/src/stories/components/types.d.ts +0 -7
- package/dist/types/src/stories/components/types.d.ts.map +0 -1
- package/dist/types/src/stories/testing/data.d.ts +0 -9
- package/dist/types/src/stories/testing/data.d.ts.map +0 -1
- package/dist/types/src/stories/testing/index.d.ts +0 -3
- package/dist/types/src/stories/testing/index.d.ts.map +0 -1
- package/dist/types/src/stories/testing/schema.d.ts +0 -7
- package/dist/types/src/stories/testing/schema.d.ts.map +0 -1
- package/dist/types/src/stories/testing/testing.d.ts +0 -48
- package/dist/types/src/stories/testing/testing.d.ts.map +0 -1
- package/dist/types/src/testing/test-data.d.ts +0 -14
- package/dist/types/src/testing/test-data.d.ts.map +0 -1
- package/dist/types/src/testing/test-functions.d.ts +0 -6
- package/dist/types/src/testing/test-functions.d.ts.map +0 -1
- package/src/capabilities/compute-runtime.ts +0 -124
- package/src/components/BlueprintContainer.tsx +0 -24
- package/src/components/PromptSettings.tsx +0 -90
- package/src/components/SequenceContainer.tsx +0 -131
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -33
- package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
- package/src/components/SequenceEditor/index.ts +0 -5
- package/src/components/TemplateEditor/handlebars-extension.ts +0 -165
- package/src/components/Toolbar/Toolbar.tsx +0 -21
- package/src/components/Toolbar/index.ts +0 -5
- package/src/components/Toolbar/useChatToolbarActions.ts +0 -126
- package/src/execution-graph/execution-graph.ts +0 -211
- package/src/execution-graph/index.ts +0 -5
- package/src/hooks/useComputeRuntimeCallback.ts +0 -25
- package/src/hooks/useExecutionGraph.ts +0 -20
- package/src/stories/Chat.stories.tsx +0 -657
- package/src/stories/components/BlueprintContainer.tsx +0 -34
- package/src/stories/components/ChatContainer.tsx +0 -74
- package/src/stories/components/ChessContainer.tsx +0 -17
- package/src/stories/components/CommentsContainer.tsx +0 -25
- package/src/stories/components/DebugCard.tsx +0 -61
- package/src/stories/components/GraphContainer.tsx +0 -119
- package/src/stories/components/InvocationsContainer.tsx +0 -17
- package/src/stories/components/LoggingContainer.tsx +0 -33
- package/src/stories/components/MessageContainer.tsx +0 -22
- package/src/stories/components/PromptContainer.tsx +0 -52
- package/src/stories/components/ResearchInputStack.tsx +0 -30
- package/src/stories/components/ResearchOutputStack.tsx +0 -29
- package/src/stories/components/TasksContainer.tsx +0 -49
- package/src/stories/components/TokenManagerContainer.tsx +0 -14
- package/src/stories/components/TriggersContainer.tsx +0 -75
- package/src/stories/components/index.ts +0 -20
- package/src/stories/components/types.ts +0 -11
- package/src/stories/testing/data.ts +0 -142
- package/src/stories/testing/index.ts +0 -6
- package/src/stories/testing/schema.ts +0 -17
- package/src/stories/testing/testing.tsx +0 -279
- package/src/testing/test-data.ts +0 -245
- package/src/testing/test-functions.ts +0 -16
- /package/dist/lib/browser/{blueprint-definition-VHFSRTEJ.mjs.map → blueprint-definition-5FT5JGPY.mjs.map} +0 -0
- /package/dist/lib/node-esm/{blueprint-definition-4E6XTLVN.mjs.map → blueprint-definition-XW6QQVLV.mjs.map} +0 -0
- /package/dist/types/src/components/TemplateEditor/{handlebars-extension.d.ts → extensions/handlebars-extension.d.ts} +0 -0
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
Capabilities,
|
|
@@ -13,15 +14,16 @@ import {
|
|
|
13
14
|
contributes,
|
|
14
15
|
createIntent,
|
|
15
16
|
} from '@dxos/app-framework';
|
|
17
|
+
import { Prompt } from '@dxos/blueprints';
|
|
16
18
|
import { Sequence } from '@dxos/conductor';
|
|
17
|
-
import { Obj } from '@dxos/echo';
|
|
19
|
+
import { DXN, Obj } from '@dxos/echo';
|
|
18
20
|
import { invariant } from '@dxos/invariant';
|
|
19
21
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
20
22
|
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
21
|
-
import { ROOT_ID,
|
|
23
|
+
import { ROOT_ID, atomFromSignal, createExtension } from '@dxos/plugin-graph';
|
|
22
24
|
import { getActiveSpace } from '@dxos/plugin-space';
|
|
23
25
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
24
|
-
import { Query, type Space,
|
|
26
|
+
import { Query, type Space, getSpace } from '@dxos/react-client/echo';
|
|
25
27
|
|
|
26
28
|
import { ASSISTANT_DIALOG, meta } from '../meta';
|
|
27
29
|
import { Assistant, AssistantAction } from '../types';
|
|
@@ -30,11 +32,42 @@ import { AssistantCapabilities } from './capabilities';
|
|
|
30
32
|
|
|
31
33
|
export default (context: PluginContext) =>
|
|
32
34
|
contributes(Capabilities.AppGraphBuilder, [
|
|
35
|
+
createExtension({
|
|
36
|
+
id: `${meta.id}/root`,
|
|
37
|
+
actions: (node) =>
|
|
38
|
+
Atom.make((get) =>
|
|
39
|
+
Function.pipe(
|
|
40
|
+
get(node),
|
|
41
|
+
Option.flatMap((node) => {
|
|
42
|
+
return Obj.instanceOf(Assistant.Chat, node.data) ? Option.some(node.data) : Option.none();
|
|
43
|
+
}),
|
|
44
|
+
Option.map((object) => {
|
|
45
|
+
const id = Obj.getDXN(object).toString();
|
|
46
|
+
return [
|
|
47
|
+
{
|
|
48
|
+
id: `${AssistantAction.UpdateChatName._tag}/${id}`,
|
|
49
|
+
data: async () => {
|
|
50
|
+
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
51
|
+
await dispatch(createIntent(AssistantAction.UpdateChatName, { chat: object }));
|
|
52
|
+
},
|
|
53
|
+
properties: {
|
|
54
|
+
label: ['chat update name label', { ns: meta.id }],
|
|
55
|
+
icon: 'ph--magic-wand--regular',
|
|
56
|
+
disposition: 'list-item',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
}),
|
|
61
|
+
Option.getOrElse(() => []),
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
}),
|
|
65
|
+
|
|
33
66
|
createExtension({
|
|
34
67
|
id: `${meta.id}/assistant`,
|
|
35
68
|
actions: (node) =>
|
|
36
|
-
|
|
37
|
-
pipe(
|
|
69
|
+
Atom.make((get) =>
|
|
70
|
+
Function.pipe(
|
|
38
71
|
get(node),
|
|
39
72
|
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
40
73
|
Option.map(() => [
|
|
@@ -83,20 +116,31 @@ export default (context: PluginContext) =>
|
|
|
83
116
|
createExtension({
|
|
84
117
|
id: `${meta.id}/companion-chat`,
|
|
85
118
|
connector: (node) => {
|
|
86
|
-
return
|
|
87
|
-
pipe(
|
|
119
|
+
return Atom.make((get) =>
|
|
120
|
+
Function.pipe(
|
|
88
121
|
get(node),
|
|
89
122
|
Option.flatMap((node) => (Obj.isObject(node.data) ? Option.some(node.data) : Option.none())),
|
|
90
|
-
Option.
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
() => context.getCapability(AssistantCapabilities.State).currentChat[
|
|
123
|
+
Option.flatMap((object) => {
|
|
124
|
+
const currentChatState = get(
|
|
125
|
+
atomFromSignal(
|
|
126
|
+
() => context.getCapability(AssistantCapabilities.State).currentChat[Obj.getDXN(object).toString()],
|
|
94
127
|
),
|
|
95
128
|
);
|
|
129
|
+
// If no state, continue to allow chat initialization.
|
|
130
|
+
if (!currentChatState) {
|
|
131
|
+
return Option.some({ object, currentChat: undefined });
|
|
132
|
+
}
|
|
96
133
|
|
|
134
|
+
const space = getSpace(object);
|
|
135
|
+
const currentChatDxn = DXN.tryParse(currentChatState);
|
|
136
|
+
const currentChatRef = currentChatDxn ? space?.db.ref(currentChatDxn) : undefined;
|
|
137
|
+
const currentChat = get(atomFromSignal(() => currentChatRef?.target));
|
|
138
|
+
return currentChat ? Option.some({ object, currentChat }) : Option.none();
|
|
139
|
+
}),
|
|
140
|
+
Option.map(({ object, currentChat }) => {
|
|
97
141
|
return [
|
|
98
142
|
{
|
|
99
|
-
id: [
|
|
143
|
+
id: [Obj.getDXN(object).toString(), 'assistant-chat'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
100
144
|
type: PLANK_COMPANION_TYPE,
|
|
101
145
|
data: currentChat ?? 'assistant-chat',
|
|
102
146
|
properties: {
|
|
@@ -115,19 +159,23 @@ export default (context: PluginContext) =>
|
|
|
115
159
|
}),
|
|
116
160
|
|
|
117
161
|
createExtension({
|
|
118
|
-
id: `${meta.id}/
|
|
162
|
+
id: `${meta.id}/invocations`,
|
|
119
163
|
connector: (node) =>
|
|
120
|
-
|
|
121
|
-
pipe(
|
|
164
|
+
Atom.make((get) =>
|
|
165
|
+
Function.pipe(
|
|
122
166
|
get(node),
|
|
123
|
-
Option.flatMap((node) =>
|
|
167
|
+
Option.flatMap((node) =>
|
|
168
|
+
Obj.instanceOf(Sequence, node.data) || Obj.instanceOf(Prompt.Prompt, node.data)
|
|
169
|
+
? Option.some(node)
|
|
170
|
+
: Option.none(),
|
|
171
|
+
),
|
|
124
172
|
Option.map((node) => [
|
|
125
173
|
{
|
|
126
|
-
id: [node.id, '
|
|
174
|
+
id: [node.id, 'invocations'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
127
175
|
type: PLANK_COMPANION_TYPE,
|
|
128
|
-
data: '
|
|
176
|
+
data: 'invocations',
|
|
129
177
|
properties: {
|
|
130
|
-
label: ['
|
|
178
|
+
label: ['invocations label', { ns: meta.id }],
|
|
131
179
|
icon: 'ph--clock-countdown--regular',
|
|
132
180
|
disposition: 'hidden',
|
|
133
181
|
},
|
|
@@ -5,38 +5,38 @@
|
|
|
5
5
|
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
6
6
|
import { templates } from '@dxos/assistant';
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
Agent,
|
|
9
|
+
AssistantToolkit,
|
|
10
|
+
Discord,
|
|
11
|
+
DiscordBlueprint,
|
|
12
|
+
EntityExtraction,
|
|
13
|
+
Linear,
|
|
14
|
+
LinearBlueprint,
|
|
15
|
+
Research,
|
|
16
|
+
ResearchBlueprint,
|
|
17
|
+
SystemToolkit,
|
|
18
|
+
WebSearchBlueprint,
|
|
19
|
+
} from '@dxos/assistant-toolkit';
|
|
15
20
|
import { Blueprint } from '@dxos/blueprints';
|
|
16
21
|
import { type FunctionDefinition } from '@dxos/functions';
|
|
17
22
|
|
|
18
23
|
import { analysis, list, load } from '../functions';
|
|
19
24
|
|
|
25
|
+
// TODO(burdon): Document plugin structure (blueprint, functions, toolkit.)
|
|
26
|
+
// TODO(burdon): Test framework for developing functions. Error handling.
|
|
27
|
+
// TODO(burdon): Function naming pattern (noun-verb); fully-qualified?
|
|
28
|
+
|
|
29
|
+
// TODO(wittjosiah): Factor out to a generic app-framework blueprint.
|
|
30
|
+
const deckTools = ['open-item'];
|
|
31
|
+
|
|
20
32
|
const functions: FunctionDefinition[] = [analysis, list, load];
|
|
21
|
-
const tools = [
|
|
22
|
-
'add-to-context',
|
|
23
|
-
// TODO(wittjosiah): Factor out to an ECHO blueprint.
|
|
24
|
-
'get-schemas',
|
|
25
|
-
'add-schema',
|
|
26
|
-
'create-record',
|
|
27
|
-
// TODO(wittjosiah): Factor out to a generic app-framework blueprint.
|
|
28
|
-
'open-item',
|
|
29
|
-
// TODO(burdon): Anthropic only.
|
|
30
|
-
// https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool#example-str-replace-command
|
|
31
|
-
// AI_TOOL_NOT_FOUND: str_replace_based_edit_tool
|
|
32
|
-
// 'str_replace_based_edit_tool',
|
|
33
|
-
];
|
|
33
|
+
const tools = [...AssistantToolkit.tools, ...SystemToolkit.tools, ...deckTools];
|
|
34
34
|
|
|
35
|
-
export const
|
|
35
|
+
export const ASSISTANT_BLUEPRINT_KEY = 'dxos.org/blueprint/assistant';
|
|
36
36
|
|
|
37
37
|
export const createBlueprint = (): Blueprint.Blueprint =>
|
|
38
38
|
Blueprint.make({
|
|
39
|
-
key:
|
|
39
|
+
key: ASSISTANT_BLUEPRINT_KEY,
|
|
40
40
|
name: 'Assistant',
|
|
41
41
|
tools: Blueprint.toolDefinitions({ functions, tools }),
|
|
42
42
|
instructions: templates.system,
|
|
@@ -44,15 +44,23 @@ export const createBlueprint = (): Blueprint.Blueprint =>
|
|
|
44
44
|
|
|
45
45
|
const blueprint = createBlueprint();
|
|
46
46
|
|
|
47
|
-
// TODO(dmaretskyi): Consider splitting into multiple modules.
|
|
48
47
|
export default (): Capability<any>[] => [
|
|
49
48
|
contributes(Capabilities.Functions, functions),
|
|
50
|
-
contributes(Capabilities.Functions, [research]),
|
|
51
49
|
contributes(Capabilities.BlueprintDefinition, blueprint),
|
|
52
|
-
|
|
53
|
-
// TODO(burdon):
|
|
54
|
-
contributes(Capabilities.Functions, [
|
|
55
|
-
contributes(Capabilities.
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
|
|
51
|
+
// TODO(burdon): Factor out.
|
|
52
|
+
contributes(Capabilities.Functions, [Research.create, Research.research]),
|
|
53
|
+
contributes(Capabilities.BlueprintDefinition, ResearchBlueprint),
|
|
54
|
+
|
|
55
|
+
// TODO(burdon): Factor out.
|
|
56
|
+
contributes(Capabilities.Functions, [Agent.prompt, EntityExtraction.extract]),
|
|
57
|
+
contributes(Capabilities.BlueprintDefinition, WebSearchBlueprint),
|
|
58
|
+
|
|
59
|
+
// TODO(burdon): Factor out.
|
|
60
|
+
contributes(Capabilities.Functions, [Discord.fetch]),
|
|
61
|
+
contributes(Capabilities.BlueprintDefinition, DiscordBlueprint),
|
|
62
|
+
|
|
63
|
+
// TODO(burdon): Factor out.
|
|
64
|
+
contributes(Capabilities.Functions, [Linear.sync]),
|
|
65
|
+
contributes(Capabilities.BlueprintDefinition, LinearBlueprint),
|
|
58
66
|
];
|
|
@@ -2,70 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Layer, type ManagedRuntime } from 'effect';
|
|
6
|
-
|
|
7
|
-
import { type AiService, type AiServiceRouter, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
|
|
8
5
|
import { defineCapability } from '@dxos/app-framework';
|
|
9
|
-
import type {
|
|
10
|
-
CredentialsService,
|
|
11
|
-
DatabaseService,
|
|
12
|
-
FunctionImplementationResolver,
|
|
13
|
-
InvocationTracer,
|
|
14
|
-
LocalFunctionExecutionService,
|
|
15
|
-
QueueService,
|
|
16
|
-
RemoteFunctionExecutionService,
|
|
17
|
-
TriggerDispatcher,
|
|
18
|
-
TriggerStateStore,
|
|
19
|
-
} from '@dxos/functions';
|
|
20
|
-
import type { SpaceId } from '@dxos/keys';
|
|
21
6
|
import { type DeepReadonly } from '@dxos/util';
|
|
22
7
|
|
|
23
8
|
import { meta } from '../meta';
|
|
24
|
-
import { type Assistant } from '../types';
|
|
25
9
|
|
|
26
10
|
export namespace AssistantCapabilities {
|
|
27
11
|
export type AssistantState = {
|
|
28
|
-
/** Map of primary object
|
|
29
|
-
currentChat: Record<string,
|
|
12
|
+
/** Map of primary object dxn to current chat dxn. */
|
|
13
|
+
currentChat: Record<string, string | undefined>;
|
|
30
14
|
};
|
|
31
15
|
export const State = defineCapability<DeepReadonly<AssistantState>>(`${meta.id}/capability/state`);
|
|
32
16
|
export const MutableState = defineCapability<AssistantState>(`${meta.id}/capability/state`);
|
|
33
|
-
|
|
34
|
-
export type AiServiceLayer = Layer.Layer<AiService.AiService>;
|
|
35
|
-
export const AiServiceLayer = defineCapability<AiServiceLayer>(`${meta.id}/capability/ai-service-factory`);
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Plugins can contribute them to provide model resolvers.
|
|
39
|
-
*/
|
|
40
|
-
export const AiModelResolver = defineCapability<Layer.Layer<AiServiceRouter.AiModelResolver>>(
|
|
41
|
-
`${meta.id}/capability/ai-model-resolver`,
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Service stack for executing agents, functions, and triggers.
|
|
46
|
-
*/
|
|
47
|
-
export type ComputeServices =
|
|
48
|
-
| TriggerDispatcher
|
|
49
|
-
| AiService.AiService
|
|
50
|
-
| DatabaseService
|
|
51
|
-
| QueueService
|
|
52
|
-
| CredentialsService
|
|
53
|
-
| LocalFunctionExecutionService
|
|
54
|
-
| RemoteFunctionExecutionService
|
|
55
|
-
// TODO(dmaretskyi): This service is private and shouldn't be exposed as a part of public API.
|
|
56
|
-
| FunctionImplementationResolver
|
|
57
|
-
| InvocationTracer
|
|
58
|
-
| TriggerStateStore
|
|
59
|
-
// TODO(dmaretskyi): Those should be provided at AI-chat call site.
|
|
60
|
-
| ToolResolverService
|
|
61
|
-
| ToolExecutionService;
|
|
62
|
-
|
|
63
|
-
export interface ComputeRuntimeProvider {
|
|
64
|
-
getRuntime(spaceId: SpaceId): ManagedRuntime.ManagedRuntime<ComputeServices, never>;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Runtime for executing agents, functions, and triggers.
|
|
69
|
-
*/
|
|
70
|
-
export const ComputeRuntime = defineCapability<ComputeRuntimeProvider>(`${meta.id}/capability/compute-runtime`);
|
|
71
17
|
}
|
|
@@ -3,17 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as AnthropicClient from '@effect/ai-anthropic/AnthropicClient';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
8
8
|
|
|
9
|
-
import
|
|
10
|
-
import { type Capability, contributes } from '@dxos/app-framework';
|
|
11
|
-
|
|
12
|
-
import { AssistantCapabilities } from './capabilities';
|
|
9
|
+
import * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
10
|
+
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
13
11
|
|
|
14
12
|
export default (): Capability<any>[] => [
|
|
15
13
|
contributes(
|
|
16
|
-
|
|
14
|
+
Capabilities.AiModelResolver,
|
|
17
15
|
AiServiceRouter.AnthropicResolver.pipe(
|
|
18
16
|
Layer.provide(
|
|
19
17
|
AnthropicClient.layer({
|
|
@@ -14,7 +14,6 @@ export const LocalModelResolver = lazy(() => import('./local-model-resolver'));
|
|
|
14
14
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
15
15
|
export const Settings = lazy(() => import('./settings'));
|
|
16
16
|
export const Toolkit = lazy(() => import('./toolkit'));
|
|
17
|
-
export const ComputeRuntime = lazy(() => import('./compute-runtime'));
|
|
18
17
|
|
|
19
18
|
export * from './blueprint-definition';
|
|
20
19
|
export * from './capabilities';
|
|
@@ -2,35 +2,57 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
8
|
-
import { AiContextBinder } from '@dxos/assistant';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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';
|
|
11
12
|
import { Sequence } from '@dxos/conductor';
|
|
12
|
-
import { Filter, Key, Obj, Ref } from '@dxos/echo';
|
|
13
|
+
import { Filter, Key, Obj, Ref, Type } from '@dxos/echo';
|
|
14
|
+
import { TracingService, serializeFunction } from '@dxos/functions';
|
|
15
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
13
16
|
import { CollectionAction } from '@dxos/plugin-space/types';
|
|
17
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
18
|
+
import { type Message } from '@dxos/types';
|
|
14
19
|
|
|
20
|
+
import { type AiChatServices, updateName } from '../processor';
|
|
15
21
|
import { Assistant, AssistantAction } from '../types';
|
|
16
22
|
|
|
17
|
-
import {
|
|
23
|
+
import { ASSISTANT_BLUEPRINT_KEY, createBlueprint } from './blueprint-definition';
|
|
18
24
|
import { AssistantCapabilities } from './capabilities';
|
|
19
25
|
|
|
20
26
|
export default (context: PluginContext) => [
|
|
21
27
|
contributes(Capabilities.IntentResolver, [
|
|
22
28
|
createResolver({
|
|
23
|
-
intent: AssistantAction.
|
|
29
|
+
intent: AssistantAction.onCreateSpace,
|
|
24
30
|
resolve: ({ space, rootCollection }) =>
|
|
25
31
|
Effect.gen(function* () {
|
|
26
32
|
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
27
33
|
const { object: chatCollection } = yield* dispatch(
|
|
28
|
-
createIntent(CollectionAction.CreateQueryCollection, {
|
|
34
|
+
createIntent(CollectionAction.CreateQueryCollection, {
|
|
35
|
+
typename: Assistant.Chat.typename,
|
|
36
|
+
}),
|
|
29
37
|
);
|
|
30
38
|
const { object: blueprintCollection } = yield* dispatch(
|
|
31
|
-
createIntent(CollectionAction.CreateQueryCollection, {
|
|
39
|
+
createIntent(CollectionAction.CreateQueryCollection, {
|
|
40
|
+
typename: Blueprint.Blueprint.typename,
|
|
41
|
+
}),
|
|
32
42
|
);
|
|
33
|
-
|
|
43
|
+
const { object: promptCollection } = yield* dispatch(
|
|
44
|
+
createIntent(CollectionAction.CreateQueryCollection, {
|
|
45
|
+
typename: Type.getTypename(Prompt.Prompt),
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
rootCollection.objects.push(
|
|
49
|
+
Ref.make(chatCollection),
|
|
50
|
+
Ref.make(blueprintCollection),
|
|
51
|
+
Ref.make(promptCollection),
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
// TODO(wittjosiah): Remove once function registry is avaiable.
|
|
55
|
+
space.db.add(serializeFunction(Agent.prompt));
|
|
34
56
|
|
|
35
57
|
// Create default chat.
|
|
36
58
|
const { object: chat } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
@@ -41,28 +63,59 @@ export default (context: PluginContext) => [
|
|
|
41
63
|
intent: AssistantAction.CreateChat,
|
|
42
64
|
resolve: async ({ space, name }) => {
|
|
43
65
|
const queue = space.queues.create();
|
|
44
|
-
const chat =
|
|
45
|
-
|
|
66
|
+
const chat = Assistant.makeChat({ name, queue });
|
|
67
|
+
|
|
46
68
|
// TODO(wittjosiah): This should be a space-level setting.
|
|
47
69
|
// TODO(burdon): Clone when activated. Copy-on-write for template.
|
|
48
|
-
|
|
70
|
+
const { objects: blueprints } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
71
|
+
let defaultBlueprint = blueprints.find((blueprint) => blueprint.key === ASSISTANT_BLUEPRINT_KEY);
|
|
49
72
|
if (!defaultBlueprint) {
|
|
50
73
|
defaultBlueprint = space.db.add(createBlueprint());
|
|
51
74
|
}
|
|
52
75
|
|
|
53
76
|
const binder = new AiContextBinder(queue);
|
|
54
|
-
await binder.bind({ blueprints: [Ref.make(defaultBlueprint)] });
|
|
77
|
+
await binder.use((binder) => binder.bind({ blueprints: [Ref.make(defaultBlueprint)] }));
|
|
55
78
|
|
|
56
79
|
return {
|
|
57
80
|
data: { object: chat },
|
|
58
81
|
};
|
|
59
82
|
},
|
|
60
83
|
}),
|
|
84
|
+
createResolver({
|
|
85
|
+
intent: AssistantAction.UpdateChatName,
|
|
86
|
+
resolve: async ({ chat }) => {
|
|
87
|
+
const space = getSpace(chat);
|
|
88
|
+
const queue = chat.queue.target as Queue<Message.Message>;
|
|
89
|
+
if (!space || !queue) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const runtimeResolver = context.getCapability(AutomationCapabilities.ComputeRuntime);
|
|
94
|
+
const runtime = await runtimeResolver
|
|
95
|
+
.getRuntime(space.id)
|
|
96
|
+
.runPromise(Effect.runtime<AiChatServices>().pipe(Effect.provide(TracingService.layerNoop)));
|
|
97
|
+
|
|
98
|
+
await new AiConversation(queue).use(async (conversation) => updateName(runtime, conversation, chat));
|
|
99
|
+
},
|
|
100
|
+
}),
|
|
61
101
|
createResolver({
|
|
62
102
|
intent: AssistantAction.CreateBlueprint,
|
|
63
103
|
resolve: ({ key, name, description }) => ({
|
|
64
104
|
data: {
|
|
65
|
-
object: Blueprint.make({
|
|
105
|
+
object: Blueprint.make({
|
|
106
|
+
key,
|
|
107
|
+
name,
|
|
108
|
+
description,
|
|
109
|
+
instructions: Template.make(),
|
|
110
|
+
}),
|
|
111
|
+
},
|
|
112
|
+
}),
|
|
113
|
+
}),
|
|
114
|
+
createResolver({
|
|
115
|
+
intent: AssistantAction.CreatePrompt,
|
|
116
|
+
resolve: ({ name }) => ({
|
|
117
|
+
data: {
|
|
118
|
+
object: Prompt.make({ name }),
|
|
66
119
|
},
|
|
67
120
|
}),
|
|
68
121
|
}),
|
|
@@ -87,7 +140,7 @@ export default (context: PluginContext) => [
|
|
|
87
140
|
resolve: ({ companionTo, chat }) =>
|
|
88
141
|
Effect.gen(function* () {
|
|
89
142
|
const state = context.getCapability(AssistantCapabilities.MutableState);
|
|
90
|
-
state.currentChat[
|
|
143
|
+
state.currentChat[Obj.getDXN(companionTo).toString()] = chat && Obj.getDXN(chat).toString();
|
|
91
144
|
}),
|
|
92
145
|
}),
|
|
93
146
|
]),
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
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
8
|
|
|
9
|
-
import
|
|
10
|
-
import { type Capability, contributes } from '@dxos/app-framework';
|
|
11
|
-
|
|
12
|
-
import { AssistantCapabilities } from './capabilities';
|
|
9
|
+
import * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
10
|
+
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
13
|
* To start LM Studio server:
|
|
@@ -19,11 +17,11 @@ import { AssistantCapabilities } from './capabilities';
|
|
|
19
17
|
*/
|
|
20
18
|
export default (): Capability<any>[] => [
|
|
21
19
|
contributes(
|
|
22
|
-
|
|
20
|
+
Capabilities.AiModelResolver,
|
|
23
21
|
AiServiceRouter.LMStudioResolver.pipe(
|
|
24
22
|
Layer.provide(
|
|
25
23
|
OpenAiClient.layer({
|
|
26
|
-
apiUrl: AiServiceRouter.
|
|
24
|
+
apiUrl: AiServiceRouter.DEFAULT_LMSTUDIO_ENDPOINT,
|
|
27
25
|
}),
|
|
28
26
|
),
|
|
29
27
|
Layer.provide(FetchHttpClient.layer),
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
8
|
+
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
9
9
|
import { getSpace } from '@dxos/client/echo';
|
|
10
10
|
import { Sequence } from '@dxos/conductor';
|
|
11
11
|
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
@@ -15,12 +15,11 @@ import { StackItem } from '@dxos/react-ui-stack';
|
|
|
15
15
|
|
|
16
16
|
import {
|
|
17
17
|
AssistantSettings,
|
|
18
|
-
|
|
18
|
+
BlueprintArticle,
|
|
19
19
|
ChatCompanion,
|
|
20
20
|
ChatContainer,
|
|
21
21
|
ChatDialog,
|
|
22
|
-
|
|
23
|
-
SequenceContainer,
|
|
22
|
+
PromptArticle,
|
|
24
23
|
} from '../components';
|
|
25
24
|
import { ASSISTANT_DIALOG, meta } from '../meta';
|
|
26
25
|
import { Assistant } from '../types';
|
|
@@ -41,6 +40,7 @@ export default () =>
|
|
|
41
40
|
Obj.instanceOf(Assistant.Chat, data.subject) && data.variant !== 'assistant-chat',
|
|
42
41
|
component: ({ data, role }) => <ChatContainer role={role} chat={data.subject} />,
|
|
43
42
|
}),
|
|
43
|
+
// TODO(wittjosiah): This is flashing when chat changes.
|
|
44
44
|
createSurface({
|
|
45
45
|
id: `${meta.id}/companion-chat`,
|
|
46
46
|
role: 'article',
|
|
@@ -50,22 +50,18 @@ export default () =>
|
|
|
50
50
|
component: ({ data, role }) => <ChatCompanion role={role} data={data} />,
|
|
51
51
|
}),
|
|
52
52
|
createSurface({
|
|
53
|
-
id: `${meta.id}/
|
|
54
|
-
role: 'article',
|
|
55
|
-
filter: (data): data is { subject: Sequence } => Obj.instanceOf(Sequence, data.subject),
|
|
56
|
-
component: ({ data }) => <SequenceContainer sequence={data.subject} />,
|
|
57
|
-
}),
|
|
58
|
-
createSurface({
|
|
59
|
-
id: `${meta.id}/companion-logs`,
|
|
53
|
+
id: `${meta.id}/companion-invocations`,
|
|
60
54
|
role: 'article',
|
|
61
55
|
filter: (data): data is { companionTo: Sequence } =>
|
|
62
|
-
Obj.instanceOf(Sequence, data.companionTo)
|
|
63
|
-
|
|
64
|
-
component: ({ data
|
|
56
|
+
(Obj.instanceOf(Sequence, data.companionTo) || Obj.instanceOf(Prompt.Prompt, data.companionTo)) &&
|
|
57
|
+
data.subject === 'invocations',
|
|
58
|
+
component: ({ data }) => {
|
|
65
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;
|
|
66
62
|
return (
|
|
67
63
|
<StackItem.Content>
|
|
68
|
-
<InvocationTraceContainer space={space} target={
|
|
64
|
+
<InvocationTraceContainer space={space} target={target} detailAxis='block' />
|
|
69
65
|
</StackItem.Content>
|
|
70
66
|
);
|
|
71
67
|
},
|
|
@@ -74,13 +70,13 @@ export default () =>
|
|
|
74
70
|
id: `${meta.id}/blueprint`,
|
|
75
71
|
role: 'article',
|
|
76
72
|
filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
|
|
77
|
-
component: ({ data }) => <
|
|
73
|
+
component: ({ data }) => <BlueprintArticle subject={data.subject} />,
|
|
78
74
|
}),
|
|
79
75
|
createSurface({
|
|
80
|
-
id: `${meta.id}/prompt
|
|
81
|
-
role: '
|
|
82
|
-
filter: (data): data is { subject:
|
|
83
|
-
component: ({ data }) => <
|
|
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} />,
|
|
84
80
|
}),
|
|
85
81
|
createSurface({
|
|
86
82
|
id: ASSISTANT_DIALOG,
|