@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,50 +2,33 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import type * as Tool from '@effect/ai/Tool';
|
|
6
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type AgentStatus } from '@dxos/ai';
|
|
9
8
|
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
TextCrawl,
|
|
13
|
-
ToggleContainer,
|
|
14
|
-
chatMessageJson,
|
|
15
|
-
chatMessagePanel,
|
|
16
|
-
chatMessagePanelContent,
|
|
17
|
-
chatMessagePanelHeader,
|
|
18
|
-
} from '@dxos/react-ui-components';
|
|
9
|
+
import { NumericTabs, TextCrawl, ToggleContainer, type ToggleContainerRootProps } from '@dxos/react-ui-components';
|
|
10
|
+
import { type XmlWidgetProps } from '@dxos/react-ui-editor';
|
|
19
11
|
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
20
|
-
import { type ContentBlock, type
|
|
21
|
-
import { isNonNullable } from '@dxos/util';
|
|
22
|
-
import { safeParseJson } from '@dxos/util';
|
|
12
|
+
import { type ContentBlock, type Message } from '@dxos/types';
|
|
13
|
+
import { isNonNullable, safeParseJson } from '@dxos/util';
|
|
23
14
|
|
|
24
15
|
import { meta } from '../../meta';
|
|
25
16
|
|
|
26
|
-
export const isToolMessage = (message:
|
|
27
|
-
return message.blocks.some((block) => block._tag === 'toolCall' || block._tag === 'toolResult');
|
|
17
|
+
export const isToolMessage = (message: Message.Message) => {
|
|
18
|
+
return message.blocks.some((block: ContentBlock.Any) => block._tag === 'toolCall' || block._tag === 'toolResult');
|
|
28
19
|
};
|
|
29
20
|
|
|
30
|
-
export type ToolBlockProps = {
|
|
21
|
+
export type ToolBlockProps = XmlWidgetProps<{
|
|
31
22
|
blocks: ContentBlock.Any[];
|
|
32
|
-
}
|
|
23
|
+
}>;
|
|
33
24
|
|
|
34
|
-
export const ToolBlock = ({ blocks = [] }: ToolBlockProps) => {
|
|
25
|
+
export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
|
|
35
26
|
const { t } = useTranslation(meta.id);
|
|
36
27
|
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
return t('calling tool label');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return status?.message ?? tool.description ?? [t('calling label'), tool.name].join(' ');
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const items = useMemo(() => {
|
|
46
|
-
let lastToolCall: { tool: AiTool.Any | undefined; block: ContentBlock.ToolCall } | undefined;
|
|
28
|
+
const items = useMemo<ToolContainerParams['items']>(() => {
|
|
29
|
+
let lastToolCall: { tool: Tool.Any | undefined; block: ContentBlock.ToolCall } | undefined;
|
|
47
30
|
// TODO(burdon): Get from context?
|
|
48
|
-
const tools:
|
|
31
|
+
const tools: Tool.Any[] = []; //processor.conversation.toolkit?.tools ?? [];
|
|
49
32
|
return blocks
|
|
50
33
|
.filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult' || block._tag === 'summary')
|
|
51
34
|
.map((block) => {
|
|
@@ -58,7 +41,7 @@ export const ToolBlock = ({ blocks = [] }: ToolBlockProps) => {
|
|
|
58
41
|
const tool = tools.find((tool) => tool.name === block.name);
|
|
59
42
|
lastToolCall = { tool, block };
|
|
60
43
|
return {
|
|
61
|
-
title:
|
|
44
|
+
title: tool?.description ?? [t('tool call label'), tool?.name].join(' '),
|
|
62
45
|
content: {
|
|
63
46
|
...block,
|
|
64
47
|
input: safeParseJson(block.input),
|
|
@@ -70,12 +53,13 @@ export const ToolBlock = ({ blocks = [] }: ToolBlockProps) => {
|
|
|
70
53
|
// TODO(burdon): Parse error type.
|
|
71
54
|
if (block.error) {
|
|
72
55
|
return {
|
|
73
|
-
title: t('error label'),
|
|
56
|
+
title: t('tool error label'),
|
|
74
57
|
content: block,
|
|
75
58
|
};
|
|
76
59
|
}
|
|
77
60
|
|
|
78
|
-
const title =
|
|
61
|
+
const title =
|
|
62
|
+
lastToolCall?.tool?.description ?? [t('tool result label'), lastToolCall?.tool?.name].join(' ');
|
|
79
63
|
lastToolCall = undefined;
|
|
80
64
|
return {
|
|
81
65
|
title,
|
|
@@ -101,45 +85,52 @@ export const ToolBlock = ({ blocks = [] }: ToolBlockProps) => {
|
|
|
101
85
|
.filter(isNonNullable);
|
|
102
86
|
}, [blocks]);
|
|
103
87
|
|
|
88
|
+
const handleChangeOpen = useCallback(() => {
|
|
89
|
+
setTimeout(() => {
|
|
90
|
+
// Measure after animation.
|
|
91
|
+
view?.requestMeasure();
|
|
92
|
+
}, 1_000);
|
|
93
|
+
}, [view]);
|
|
94
|
+
|
|
104
95
|
if (!items.length) {
|
|
105
96
|
return null;
|
|
106
97
|
}
|
|
107
98
|
|
|
108
|
-
return <ToolContainer items={items} />;
|
|
99
|
+
return <ToolContainer items={items} onChangeOpen={handleChangeOpen} />;
|
|
109
100
|
};
|
|
110
101
|
|
|
111
102
|
ToolBlock.displayName = 'ToolBlock';
|
|
112
103
|
|
|
113
104
|
type ToolContainerParams = {
|
|
114
105
|
items: { title: string; content: any }[];
|
|
115
|
-
}
|
|
106
|
+
} & Pick<ToggleContainerRootProps, 'onChangeOpen'>;
|
|
116
107
|
|
|
117
|
-
export const ToolContainer = ({ items }: ToolContainerParams) => {
|
|
108
|
+
export const ToolContainer = ({ items, onChangeOpen }: ToolContainerParams) => {
|
|
118
109
|
const tabsRef = useRef<HTMLDivElement>(null);
|
|
119
110
|
const [selected, setSelected] = useState(0);
|
|
120
111
|
const [open, setOpen] = useState(false);
|
|
112
|
+
|
|
121
113
|
useEffect(() => {
|
|
114
|
+
onChangeOpen?.(open);
|
|
122
115
|
if (open) {
|
|
123
116
|
tabsRef.current?.focus();
|
|
124
117
|
}
|
|
125
|
-
}, [open]);
|
|
118
|
+
}, [onChangeOpen, open]);
|
|
126
119
|
|
|
127
120
|
const handleSelect = (index: number) => {
|
|
128
121
|
setSelected(index);
|
|
129
122
|
};
|
|
130
123
|
|
|
131
|
-
const data = items[selected]?.content;
|
|
132
|
-
|
|
133
124
|
return (
|
|
134
|
-
<ToggleContainer.Root classNames=
|
|
135
|
-
<ToggleContainer.Header classNames=
|
|
136
|
-
<TextCrawl key='status-roll' lines={items.map((item) => item.title)} />
|
|
125
|
+
<ToggleContainer.Root classNames='mbs-2 is-full rounded-sm' open={open} onChangeOpen={setOpen}>
|
|
126
|
+
<ToggleContainer.Header classNames='text-sm text-placeholder'>
|
|
127
|
+
<TextCrawl key='status-roll' lines={items.map((item) => item.title)} autoAdvance greedy />
|
|
137
128
|
</ToggleContainer.Header>
|
|
138
|
-
<ToggleContainer.Content classNames=
|
|
129
|
+
<ToggleContainer.Content classNames='grid grid-cols-[32px_1fr]'>
|
|
139
130
|
<NumericTabs ref={tabsRef} classNames='p-1' length={items.length} selected={selected} onSelect={handleSelect} />
|
|
140
131
|
<Json
|
|
141
|
-
data={
|
|
142
|
-
classNames=
|
|
132
|
+
data={items[selected]?.content}
|
|
133
|
+
classNames='p-1 text-xs bg-transparent'
|
|
143
134
|
replacer={{
|
|
144
135
|
maxDepth: 3,
|
|
145
136
|
maxArrayLen: 10,
|
|
@@ -2,27 +2,25 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
8
|
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
11
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import { capabilities } from '@dxos/assistant-
|
|
10
|
+
import { capabilities } from '@dxos/assistant-toolkit';
|
|
13
11
|
import { ChessPlugin } from '@dxos/plugin-chess';
|
|
14
12
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
15
13
|
import { MapPlugin } from '@dxos/plugin-map';
|
|
16
14
|
import { SpacePlugin } from '@dxos/plugin-space';
|
|
17
15
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
18
|
-
import {
|
|
16
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
19
17
|
|
|
20
18
|
import { translations } from '../../translations';
|
|
21
19
|
|
|
22
20
|
import { Toolbox, type ToolboxProps } from './Toolbox';
|
|
23
21
|
|
|
24
22
|
const DefaultStory = (props: ToolboxProps) => {
|
|
25
|
-
return <Toolbox {...props} classNames='
|
|
23
|
+
return <Toolbox {...props} classNames='is-[30rem] bs-[15rem] rounded-sm border border-separator plb-1' />;
|
|
26
24
|
};
|
|
27
25
|
|
|
28
26
|
const meta = {
|
|
@@ -30,6 +28,7 @@ const meta = {
|
|
|
30
28
|
component: Toolbox as any,
|
|
31
29
|
render: DefaultStory,
|
|
32
30
|
decorators: [
|
|
31
|
+
withTheme,
|
|
33
32
|
withPluginManager({
|
|
34
33
|
plugins: [
|
|
35
34
|
ClientPlugin({
|
|
@@ -37,7 +36,7 @@ const meta = {
|
|
|
37
36
|
await client.halo.createIdentity();
|
|
38
37
|
},
|
|
39
38
|
}),
|
|
40
|
-
SpacePlugin(),
|
|
39
|
+
SpacePlugin({}),
|
|
41
40
|
SettingsPlugin(),
|
|
42
41
|
IntentPlugin(),
|
|
43
42
|
ChessPlugin(),
|
|
@@ -46,8 +45,6 @@ const meta = {
|
|
|
46
45
|
],
|
|
47
46
|
capabilities,
|
|
48
47
|
}),
|
|
49
|
-
withTheme,
|
|
50
|
-
withLayout(),
|
|
51
48
|
],
|
|
52
49
|
parameters: {
|
|
53
50
|
layout: 'centered',
|
|
@@ -6,7 +6,7 @@ import React, { type FC, Fragment, useEffect, useState } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type Blueprint } from '@dxos/blueprints';
|
|
8
8
|
import { type Ref } from '@dxos/echo';
|
|
9
|
-
import {
|
|
9
|
+
import { Function } from '@dxos/functions';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
11
|
import { Filter, type Space, useQuery } from '@dxos/react-client/echo';
|
|
12
12
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
@@ -19,7 +19,7 @@ import { ServiceType } from '../../types';
|
|
|
19
19
|
|
|
20
20
|
export type ToolboxProps = ThemedClassName<{
|
|
21
21
|
services?: { service: ServiceType }[];
|
|
22
|
-
functions?:
|
|
22
|
+
functions?: Function.Function[];
|
|
23
23
|
// TODO(burdon): Combine into single array.
|
|
24
24
|
blueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
|
|
25
25
|
activeBlueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
|
|
@@ -77,11 +77,11 @@ const Section: FC<{
|
|
|
77
77
|
}> = ({ title, items, striped }) => {
|
|
78
78
|
const stripeClassNames = 'odd:bg-neutral-50 dark:odd:bg-neutral-800';
|
|
79
79
|
const gridClassNames = 'grid grid-cols-[8rem_1fr]';
|
|
80
|
-
const subGridClassNames = mx('col-span-full grid grid-cols-subgrid text-xs
|
|
80
|
+
const subGridClassNames = mx('col-span-full grid grid-cols-subgrid text-xs pli-2', striped && stripeClassNames);
|
|
81
81
|
|
|
82
82
|
return (
|
|
83
83
|
<div>
|
|
84
|
-
<h1 className='
|
|
84
|
+
<h1 className='pli-2 text-sm'>{title}</h1>
|
|
85
85
|
<div className={gridClassNames}>
|
|
86
86
|
{items.map(({ name, description, subitems }, i) => (
|
|
87
87
|
<Fragment key={i}>
|
|
@@ -125,7 +125,7 @@ export const ToolboxContainer = ({ classNames, space, processor }: ToolboxContai
|
|
|
125
125
|
}, [services]);
|
|
126
126
|
|
|
127
127
|
// Deployed functions.
|
|
128
|
-
const functions = useQuery(space, Filter.type(
|
|
128
|
+
const functions = useQuery(space, Filter.type(Function.Function));
|
|
129
129
|
|
|
130
130
|
return (
|
|
131
131
|
<Toolbox
|
package/src/components/index.ts
CHANGED
|
@@ -6,14 +6,11 @@ import { lazy } from 'react';
|
|
|
6
6
|
|
|
7
7
|
export * from './AssistantSettings';
|
|
8
8
|
export * from './Chat';
|
|
9
|
-
export * from './ChatProgress';
|
|
10
|
-
export * from './PromptSettings';
|
|
11
9
|
export * from './TemplateEditor';
|
|
12
|
-
export * from './Toolbar';
|
|
13
10
|
export * from './Toolbox';
|
|
14
11
|
|
|
15
|
-
export const
|
|
12
|
+
export const BlueprintArticle = lazy(() => import('./BlueprintArticle'));
|
|
16
13
|
export const ChatCompanion = lazy(() => import('./ChatCompanion'));
|
|
17
14
|
export const ChatContainer = lazy(() => import('./ChatContainer'));
|
|
18
15
|
export const ChatDialog = lazy(() => import('./ChatDialog'));
|
|
19
|
-
export const
|
|
16
|
+
export const PromptArticle = lazy(() => import('./PromptArticle'));
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
6
7
|
|
|
7
8
|
import { defineFunction } from '@dxos/functions';
|
|
8
9
|
import { log } from '@dxos/log';
|
|
9
10
|
|
|
10
11
|
export default defineFunction({
|
|
11
|
-
|
|
12
|
+
key: 'dxos.org/function/assistant-analysis',
|
|
13
|
+
name: 'Assistant analysis',
|
|
12
14
|
description: 'Enter analysis analysis mode.',
|
|
13
15
|
inputSchema: Schema.Struct({
|
|
14
16
|
enable: Schema.Boolean.annotations({ description: 'Enable or disable analysis mode.' }),
|
|
15
17
|
}),
|
|
16
18
|
outputSchema: Schema.Void,
|
|
17
19
|
handler: Effect.fn(function* ({ context, data: { enable } }) {
|
|
18
|
-
log.info('analysis mode', {
|
|
20
|
+
log.info('analysis mode', { enable });
|
|
19
21
|
}),
|
|
20
22
|
});
|
package/src/functions/index.ts
CHANGED
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
6
7
|
|
|
7
8
|
import { Filter, Obj, Query } from '@dxos/echo';
|
|
8
9
|
import { DatabaseService, defineFunction } from '@dxos/functions';
|
|
9
10
|
import { trim } from '@dxos/util';
|
|
10
11
|
|
|
11
|
-
// TODO(burdon):
|
|
12
|
+
// TODO(burdon): Move to toolkit (i.e., tool not function).
|
|
12
13
|
export default defineFunction({
|
|
13
|
-
|
|
14
|
+
key: 'dxos.org/function/assistant/object-list',
|
|
15
|
+
name: 'List objects',
|
|
14
16
|
description:
|
|
15
17
|
// TODO(wittjosiah): Find a better way to prompt for looking up typenames before querying with them.
|
|
16
18
|
trim`
|
|
17
19
|
Lists the objects of the given type.
|
|
18
|
-
Check the
|
|
20
|
+
Check the get-schemas tool for available types before calling this function.
|
|
19
21
|
`,
|
|
20
22
|
inputSchema: Schema.Struct({
|
|
21
23
|
typename: Schema.String.annotations({
|
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
8
|
+
import * as Schema from 'effect/Schema';
|
|
6
9
|
|
|
7
10
|
import { ArtifactId } from '@dxos/assistant';
|
|
8
11
|
import { Obj } from '@dxos/echo';
|
|
9
12
|
import { DatabaseService, defineFunction } from '@dxos/functions';
|
|
10
13
|
|
|
11
|
-
// TODO(burdon):
|
|
12
|
-
// TODO(burdon): Factor out to space plugin.
|
|
14
|
+
// TODO(burdon): Move to toolkit (i.e., tool not function).
|
|
13
15
|
export default defineFunction({
|
|
14
|
-
|
|
16
|
+
key: 'dxos.org/function/assistant/object-load',
|
|
17
|
+
name: 'Load object',
|
|
15
18
|
description: 'Loads the object.',
|
|
16
19
|
inputSchema: Schema.Struct({
|
|
17
20
|
id: ArtifactId.annotations({
|
|
@@ -27,7 +30,7 @@ export default defineFunction({
|
|
|
27
30
|
}),
|
|
28
31
|
handler: Effect.fn(function* ({ data: { id, typename } }) {
|
|
29
32
|
const object = yield* DatabaseService.resolve(ArtifactId.toDXN(id));
|
|
30
|
-
return yield* pipe(
|
|
33
|
+
return yield* Function.pipe(
|
|
31
34
|
Option.fromNullable(object),
|
|
32
35
|
Option.flatMap((object) => (Obj.getTypename(object) === typename ? Option.some(object) : Option.none())),
|
|
33
36
|
Option.match({
|
package/src/hooks/index.ts
CHANGED
|
@@ -5,12 +5,11 @@
|
|
|
5
5
|
export * from './useBlueprintRegistry';
|
|
6
6
|
export * from './useChatProcessor';
|
|
7
7
|
export * from './useChatServices';
|
|
8
|
+
export * from './useChatToolbarActions';
|
|
8
9
|
export * from './useContextBinder';
|
|
9
10
|
export * from './useContextObjects';
|
|
10
|
-
export * from './useExecutionGraph';
|
|
11
11
|
export * from './useFlush';
|
|
12
12
|
export * from './useItemTypes';
|
|
13
13
|
export * from './useOnline';
|
|
14
14
|
export * from './usePresets';
|
|
15
15
|
export * from './useReferencesProvider';
|
|
16
|
-
export * from './useComputeRuntimeCallback';
|
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
import { useSignalEffect } from '@preact/signals-react';
|
|
6
6
|
import { useCallback, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { Capabilities
|
|
8
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
9
|
+
import { useCapabilities } from '@dxos/app-framework/react';
|
|
9
10
|
import { type AiContextBinder } from '@dxos/assistant';
|
|
10
11
|
import { Blueprint } from '@dxos/blueprints';
|
|
11
12
|
import { type Space } from '@dxos/client/echo';
|
|
12
13
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
13
|
-
import {
|
|
14
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
15
|
+
import { distinctBy, isNonNullable } from '@dxos/util';
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* Provide a registry of blueprints from plugins.
|
|
@@ -21,8 +23,21 @@ export const useBlueprintRegistry = () => {
|
|
|
21
23
|
return useMemo(() => new Blueprint.Registry(blueprints), [blueprints]);
|
|
22
24
|
};
|
|
23
25
|
|
|
24
|
-
export const useBlueprints = ({
|
|
25
|
-
|
|
26
|
+
export const useBlueprints = ({
|
|
27
|
+
blueprintRegistry,
|
|
28
|
+
space,
|
|
29
|
+
}: {
|
|
30
|
+
blueprintRegistry?: Blueprint.Registry;
|
|
31
|
+
space?: Space;
|
|
32
|
+
}) => {
|
|
33
|
+
const staticBlueprints = useMemo(() => blueprintRegistry?.query() ?? [], [blueprintRegistry]);
|
|
34
|
+
const spaceBlueprints = useQuery(space, Filter.type(Blueprint.Blueprint));
|
|
35
|
+
return useMemo(() => {
|
|
36
|
+
const blueprints = distinctBy([...staticBlueprints, ...spaceBlueprints], (b) => b.key);
|
|
37
|
+
blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));
|
|
38
|
+
return blueprints;
|
|
39
|
+
}, [staticBlueprints, spaceBlueprints]);
|
|
40
|
+
};
|
|
26
41
|
|
|
27
42
|
/**
|
|
28
43
|
* Create reactive map of active blueprints (by key).
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { RegistryContext } from '@effect-
|
|
6
|
-
import
|
|
7
|
-
import { useContext, useMemo } from 'react';
|
|
5
|
+
import { RegistryContext } from '@effect-atom/atom-react';
|
|
6
|
+
import type * as Runtime from 'effect/Runtime';
|
|
7
|
+
import { useContext, useMemo, useState } from 'react';
|
|
8
8
|
|
|
9
9
|
import { AiConversation } from '@dxos/assistant';
|
|
10
10
|
import { type Blueprint } from '@dxos/blueprints';
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
|
-
import { type Queue } from '@dxos/react-client/echo';
|
|
12
|
+
import { type Queue, type Space } from '@dxos/react-client/echo';
|
|
13
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
13
14
|
|
|
14
15
|
import { AiChatProcessor, type AiChatServices, type AiServicePreset } from '../processor';
|
|
15
16
|
import { type Assistant } from '../types';
|
|
16
17
|
|
|
17
18
|
export type UseChatProcessorProps = {
|
|
19
|
+
space?: Space;
|
|
18
20
|
chat?: Assistant.Chat;
|
|
19
21
|
preset?: AiServicePreset;
|
|
20
22
|
services?: () => Promise<Runtime.Runtime<AiChatServices>>;
|
|
@@ -26,6 +28,7 @@ export type UseChatProcessorProps = {
|
|
|
26
28
|
* Configure and create AiChatProcessor.
|
|
27
29
|
*/
|
|
28
30
|
export const useChatProcessor = ({
|
|
31
|
+
space,
|
|
29
32
|
chat,
|
|
30
33
|
preset,
|
|
31
34
|
services,
|
|
@@ -35,13 +38,23 @@ export const useChatProcessor = ({
|
|
|
35
38
|
const observableRegistry = useContext(RegistryContext);
|
|
36
39
|
|
|
37
40
|
// Create conversation from chat queue.
|
|
38
|
-
const conversation =
|
|
39
|
-
|
|
41
|
+
const [conversation, setConversation] = useState<AiConversation>();
|
|
42
|
+
useAsyncEffect(async () => {
|
|
43
|
+
if (!space || !chat) {
|
|
40
44
|
return;
|
|
41
45
|
}
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
// NOTE: Passing in space and getting queue from space rather than resolving the reference.
|
|
48
|
+
// This is because if the chat isn't in a space yet, the reference will not be resolvable.
|
|
49
|
+
const queue = space.queues.get(chat.queue.dxn);
|
|
50
|
+
const conversation = new AiConversation(queue as Queue<any>);
|
|
51
|
+
await conversation.open();
|
|
52
|
+
setConversation(conversation);
|
|
53
|
+
return () => {
|
|
54
|
+
void conversation.close();
|
|
55
|
+
setConversation(undefined);
|
|
56
|
+
};
|
|
57
|
+
}, [space, chat?.queue.dxn.toString()]);
|
|
45
58
|
|
|
46
59
|
// Create processor.
|
|
47
60
|
const processor = useMemo(() => {
|
|
@@ -49,12 +62,7 @@ export const useChatProcessor = ({
|
|
|
49
62
|
return undefined;
|
|
50
63
|
}
|
|
51
64
|
|
|
52
|
-
log('creating processor', {
|
|
53
|
-
preset,
|
|
54
|
-
model: preset?.model,
|
|
55
|
-
settings,
|
|
56
|
-
});
|
|
57
|
-
|
|
65
|
+
log('creating processor', { preset, model: preset?.model, settings });
|
|
58
66
|
return new AiChatProcessor(conversation, services, {
|
|
59
67
|
observableRegistry,
|
|
60
68
|
blueprintRegistry,
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import type * as Runtime from 'effect/Runtime';
|
|
6
7
|
import { useMemo } from 'react';
|
|
7
8
|
|
|
8
|
-
import { useCapability } from '@dxos/app-framework';
|
|
9
|
+
import { useCapability } from '@dxos/app-framework/react';
|
|
9
10
|
import { type Space } from '@dxos/client/echo';
|
|
10
11
|
import { TracingService } from '@dxos/functions';
|
|
12
|
+
import { TracingServiceExt } from '@dxos/functions-runtime';
|
|
13
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
11
14
|
import { useClient } from '@dxos/react-client';
|
|
12
15
|
|
|
13
|
-
import { AssistantCapabilities } from '../capabilities';
|
|
14
16
|
import { type AiChatServices } from '../processor';
|
|
15
17
|
import { type Assistant } from '../types';
|
|
16
18
|
|
|
@@ -30,16 +32,17 @@ export const useChatServices = ({
|
|
|
30
32
|
const client = useClient();
|
|
31
33
|
space ??= client.spaces.default;
|
|
32
34
|
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
+
const runtimeResolver = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
35
36
|
return useMemo(() => {
|
|
36
|
-
const runtime =
|
|
37
|
+
const runtime = runtimeResolver.getRuntime(space.id);
|
|
37
38
|
return () =>
|
|
38
39
|
runtime.runPromise(
|
|
39
40
|
Effect.gen(function* () {
|
|
40
41
|
return yield* Effect.runtime<AiChatServices>().pipe(
|
|
41
42
|
Effect.provide(
|
|
42
|
-
chat?.traceQueue?.target
|
|
43
|
+
chat?.traceQueue?.target
|
|
44
|
+
? TracingServiceExt.layerQueue(chat.traceQueue?.target)
|
|
45
|
+
: TracingService.layerNoop,
|
|
43
46
|
),
|
|
44
47
|
);
|
|
45
48
|
}),
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import { useMemo } from 'react';
|
|
8
|
+
|
|
9
|
+
import { createIntent } from '@dxos/app-framework';
|
|
10
|
+
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
11
|
+
import { Filter, Obj, Query } from '@dxos/echo';
|
|
12
|
+
import { invariant } from '@dxos/invariant';
|
|
13
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
14
|
+
import { MenuBuilder, useMenuActions } from '@dxos/react-ui-menu';
|
|
15
|
+
|
|
16
|
+
import { useChatContext } from '../components';
|
|
17
|
+
import { meta } from '../meta';
|
|
18
|
+
import { Assistant, AssistantAction } from '../types';
|
|
19
|
+
|
|
20
|
+
export type ChatToolbarActionsProps = {
|
|
21
|
+
chat?: Assistant.Chat;
|
|
22
|
+
companionTo?: Obj.Any;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const useChatToolbarActions = ({ chat, companionTo }: ChatToolbarActionsProps) => {
|
|
26
|
+
const { dispatch } = useIntentDispatcher();
|
|
27
|
+
const { space } = useChatContext('useChatToolbarActions');
|
|
28
|
+
const query = companionTo
|
|
29
|
+
? Query.select(Filter.ids(companionTo.id)).targetOf(Assistant.CompanionTo).source()
|
|
30
|
+
: Query.select(Filter.nothing());
|
|
31
|
+
|
|
32
|
+
// TODO(wittjosiah): Query in react vs query in atom?
|
|
33
|
+
const chats = useQuery(space, query);
|
|
34
|
+
|
|
35
|
+
// Create stable reference for dependency array to avoid circular reference issues.
|
|
36
|
+
return useMenuActions(
|
|
37
|
+
useMemo(() => {
|
|
38
|
+
return Atom.make(() => {
|
|
39
|
+
const builder = MenuBuilder.make()
|
|
40
|
+
.root({
|
|
41
|
+
label: ['chat toolbar title', { ns: meta.id }],
|
|
42
|
+
})
|
|
43
|
+
.action(
|
|
44
|
+
'new',
|
|
45
|
+
{
|
|
46
|
+
label: ['new thread button', { ns: meta.id }],
|
|
47
|
+
icon: 'ph--plus--regular',
|
|
48
|
+
type: 'new',
|
|
49
|
+
},
|
|
50
|
+
() =>
|
|
51
|
+
dispatch(
|
|
52
|
+
createIntent(AssistantAction.SetCurrentChat, {
|
|
53
|
+
companionTo,
|
|
54
|
+
chat: undefined,
|
|
55
|
+
}),
|
|
56
|
+
).pipe(Effect.runPromise),
|
|
57
|
+
)
|
|
58
|
+
.action(
|
|
59
|
+
'rename',
|
|
60
|
+
{
|
|
61
|
+
label: ['rename thread button', { ns: meta.id }],
|
|
62
|
+
icon: 'ph--magic-wand--regular',
|
|
63
|
+
type: 'rename',
|
|
64
|
+
disabled: !chat,
|
|
65
|
+
},
|
|
66
|
+
() =>
|
|
67
|
+
Effect.gen(function* () {
|
|
68
|
+
invariant(chat);
|
|
69
|
+
yield* dispatch(createIntent(AssistantAction.UpdateChatName, { chat }));
|
|
70
|
+
}).pipe(Effect.runPromise),
|
|
71
|
+
)
|
|
72
|
+
.action(
|
|
73
|
+
'branch',
|
|
74
|
+
{
|
|
75
|
+
label: ['button branch thread', { ns: meta.id }],
|
|
76
|
+
icon: 'ph--git-branch--regular',
|
|
77
|
+
type: 'branch',
|
|
78
|
+
disabled: true,
|
|
79
|
+
},
|
|
80
|
+
() => {},
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
if (chats.length > 0) {
|
|
84
|
+
builder.group(
|
|
85
|
+
'chats',
|
|
86
|
+
{
|
|
87
|
+
label: ['chat history label', { ns: meta.id }],
|
|
88
|
+
icon: 'ph--clock-counter-clockwise--regular',
|
|
89
|
+
selectCardinality: 'single',
|
|
90
|
+
variant: 'dropdownMenu',
|
|
91
|
+
},
|
|
92
|
+
(builder) => {
|
|
93
|
+
chats
|
|
94
|
+
// TODO(wittjosiah): This should be the default sort order.
|
|
95
|
+
.toSorted((a, b) => a.id.localeCompare(b.id))
|
|
96
|
+
.forEach((chat) => {
|
|
97
|
+
builder.action(
|
|
98
|
+
chat.id,
|
|
99
|
+
{
|
|
100
|
+
label: Obj.getLabel(chat) ?? ['object name placeholder', { ns: Assistant.Chat.typename }],
|
|
101
|
+
},
|
|
102
|
+
() =>
|
|
103
|
+
Effect.gen(function* () {
|
|
104
|
+
invariant(companionTo);
|
|
105
|
+
yield* dispatch(
|
|
106
|
+
createIntent(AssistantAction.SetCurrentChat, {
|
|
107
|
+
companionTo,
|
|
108
|
+
chat,
|
|
109
|
+
}),
|
|
110
|
+
);
|
|
111
|
+
}).pipe(Effect.runPromise),
|
|
112
|
+
);
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return builder.build();
|
|
119
|
+
});
|
|
120
|
+
}, [chats.length, space?.id, companionTo?.id, chat?.id, dispatch]),
|
|
121
|
+
);
|
|
122
|
+
};
|