@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
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Live, type Space } from '@dxos/client/echo';
|
|
6
|
-
import { Obj, Relation, type Type } from '@dxos/echo';
|
|
7
|
-
import { invariant } from '@dxos/invariant';
|
|
8
|
-
import { DataType } from '@dxos/schema';
|
|
9
|
-
|
|
10
|
-
// import { faker } from '@dxos/random';
|
|
11
|
-
// import { DataType } from '@dxos/schema';
|
|
12
|
-
// import { type ValueGenerator, createGenerator } from '@dxos/schema/testing';
|
|
13
|
-
// faker.seed(1);
|
|
14
|
-
// const generator = faker as any as ValueGenerator;
|
|
15
|
-
// const objectGenerator = createGenerator(generator, DataType.Organization, { force: true });
|
|
16
|
-
|
|
17
|
-
export const testTypes: Type.Obj.Any[] = [
|
|
18
|
-
DataType.Organization,
|
|
19
|
-
DataType.Person,
|
|
20
|
-
DataType.Employer,
|
|
21
|
-
DataType.HasConnection,
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
export const organizations: (Type.Properties<DataType.Organization> & { id: string })[] = [
|
|
25
|
-
{ id: 'dxos', name: 'DXOS', website: 'https://dxos.org' },
|
|
26
|
-
{ id: 'socket_supply', name: 'Socket Supply', website: 'https://socketsupply.com' },
|
|
27
|
-
{ id: 'ink_and_switch', name: 'Ink & Switch', website: 'https://inkandswitch.com' },
|
|
28
|
-
{ id: 'effectful', name: 'Effectful', website: 'https://effect.co' },
|
|
29
|
-
{ id: 'blueyard', name: 'Blue Yard', website: 'https://blueyard.com' },
|
|
30
|
-
{ id: 'backed', name: 'Backed', website: 'https://backed.vc' },
|
|
31
|
-
{ id: 'protocol_labs', name: 'Protocol Labs', website: 'https://protocol.ai' },
|
|
32
|
-
{ id: 'newlab', name: 'Newlab', website: 'https://newlab.com' },
|
|
33
|
-
{ id: 'google', name: 'Google', website: 'https://google.com' },
|
|
34
|
-
{ id: 'microsoft', name: 'Microsoft', website: 'https://microsoft.com' },
|
|
35
|
-
{ id: 'openai', name: 'OpenAI', website: 'https://openai.com' },
|
|
36
|
-
{ id: 'anthropic', name: 'Anthropic', website: 'https://anthropic.com' },
|
|
37
|
-
{ id: 'amazon', name: 'Amazon', website: 'https://amazon.com' },
|
|
38
|
-
{ id: 'deshaw', name: 'D. E. Shaw & Co.', website: 'https://deshaw.com' },
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
const people: (Type.Properties<DataType.Person> & { id: string })[] = [
|
|
42
|
-
{ id: 'rich_burdon', fullName: 'Rich Burdon' },
|
|
43
|
-
{ id: 'josiah_witt', fullName: 'Josiah Witt' },
|
|
44
|
-
{ id: 'dima_dmaretskyi', fullName: 'Dima Maretskyi' },
|
|
45
|
-
{ id: 'chad_fowler', fullName: 'Chad Fowler' },
|
|
46
|
-
{ id: 'ciaran_oleary', fullName: "Ciarán O'Leary" },
|
|
47
|
-
{ id: 'jason_whitmire', fullName: 'Jason Whitmire' },
|
|
48
|
-
{ id: 'alex_brunicki', fullName: 'Alex Brunicki' },
|
|
49
|
-
{ id: 'andre_de_haes', fullName: 'Andre de Haes' },
|
|
50
|
-
{ id: 'scott_cohen', fullName: 'Scott Cohen' },
|
|
51
|
-
{ id: 'juan_benet', fullName: 'Juan Benet' },
|
|
52
|
-
{ id: 'satya_nadella', fullName: 'Satya Nadella' },
|
|
53
|
-
{ id: 'kevin_scott', fullName: 'Kevin Scott' },
|
|
54
|
-
{ id: 'jeff_bezos', fullName: 'Jeff Bezos' },
|
|
55
|
-
];
|
|
56
|
-
|
|
57
|
-
const testObjects: Record<string, any[]> = {
|
|
58
|
-
[DataType.Organization.typename]: organizations,
|
|
59
|
-
[DataType.Person.typename]: people,
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const testRelationships: Record<
|
|
63
|
-
string,
|
|
64
|
-
({
|
|
65
|
-
source: string;
|
|
66
|
-
target: string;
|
|
67
|
-
} & Record<string, any>)[]
|
|
68
|
-
> = {
|
|
69
|
-
[DataType.Employer.typename]: [
|
|
70
|
-
// prettier-ignore
|
|
71
|
-
{ source: 'rich_burdon', target: 'dxos' },
|
|
72
|
-
{ source: 'rich_burdon', target: 'google', active: false }, // TODO(burdon): Should not contribute to force.
|
|
73
|
-
{ source: 'rich_burdon', target: 'deshaw', active: false },
|
|
74
|
-
{ source: 'josiah_witt', target: 'dxos' },
|
|
75
|
-
{ source: 'dima_dmaretskyi', target: 'dxos' },
|
|
76
|
-
{ source: 'chad_fowler', target: 'blueyard' },
|
|
77
|
-
{ source: 'chad_fowler', target: 'microsoft', active: false },
|
|
78
|
-
{ source: 'ciaran_oleary', target: 'blueyard' },
|
|
79
|
-
{ source: 'jason_whitmire', target: 'blueyard' },
|
|
80
|
-
{ source: 'juan_benet', target: 'protocol_labs' },
|
|
81
|
-
{ source: 'alex_brunicki', target: 'backed' },
|
|
82
|
-
{ source: 'andre_de_haes', target: 'backed' },
|
|
83
|
-
{ source: 'scott_cohen', target: 'newlab' },
|
|
84
|
-
{ source: 'satya_nadella', target: 'microsoft' },
|
|
85
|
-
{ source: 'kevin_scott', target: 'microsoft' },
|
|
86
|
-
{ source: 'kevin_scott', target: 'google', active: false },
|
|
87
|
-
{ source: 'jeff_bezos', target: 'amazon' },
|
|
88
|
-
{ source: 'jeff_bezos', target: 'deshaw', active: false },
|
|
89
|
-
],
|
|
90
|
-
|
|
91
|
-
// TODO(burdon): Limit graph view to selected relationship types.
|
|
92
|
-
[DataType.HasConnection.typename]: [
|
|
93
|
-
// prettier-ignore
|
|
94
|
-
{ kind: 'partner', source: 'dxos', target: 'ink_and_switch' },
|
|
95
|
-
{ kind: 'partner', source: 'dxos', target: 'effectful' },
|
|
96
|
-
{ kind: 'partner', source: 'dxos', target: 'socket_supply' },
|
|
97
|
-
|
|
98
|
-
// prettier-ignore
|
|
99
|
-
{ kind: 'investor', source: 'blueyard', target: 'dxos' },
|
|
100
|
-
{ kind: 'investor', source: 'blueyard', target: 'protocol_labs' },
|
|
101
|
-
{ kind: 'investor', source: 'protocol_labs', target: 'dxos' },
|
|
102
|
-
{ kind: 'investor', source: 'backed', target: 'dxos' },
|
|
103
|
-
{ kind: 'investor', source: 'newlab', target: 'dxos' },
|
|
104
|
-
{ kind: 'investor', source: 'microsoft', target: 'openai' },
|
|
105
|
-
{ kind: 'investor', source: 'google', target: 'anthropic' },
|
|
106
|
-
{ kind: 'investor', source: 'amazon', target: 'anthropic' },
|
|
107
|
-
],
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export const addTestData = async (space: Space): Promise<void> => {
|
|
111
|
-
const objectMap = new Map<string, Live<any>>();
|
|
112
|
-
|
|
113
|
-
for (const [typename, objects] of Object.entries(testObjects)) {
|
|
114
|
-
const schema = space.db.graph.schemaRegistry.getSchema(typename);
|
|
115
|
-
invariant(schema, `Schema not found: ${typename}`);
|
|
116
|
-
for (const { id, ...data } of objects) {
|
|
117
|
-
const object = space.db.add(Obj.make(schema, data));
|
|
118
|
-
objectMap.set(id, object);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
for (const [typename, relationships] of Object.entries(testRelationships)) {
|
|
123
|
-
const schema = space.db.graph.schemaRegistry.getSchema(typename);
|
|
124
|
-
invariant(schema, `Schema not found: ${typename}`);
|
|
125
|
-
|
|
126
|
-
for (const { source, target, ...data } of relationships) {
|
|
127
|
-
const sourceObject = objectMap.get(source);
|
|
128
|
-
const targetObject = objectMap.get(target);
|
|
129
|
-
invariant(sourceObject, `Source object not found: ${source}`);
|
|
130
|
-
invariant(targetObject, `Target object not found: ${target}`);
|
|
131
|
-
|
|
132
|
-
space.db.add(
|
|
133
|
-
Relation.make(schema, {
|
|
134
|
-
// TODO(burdon): Test source/target types match.
|
|
135
|
-
[Relation.Source]: sourceObject,
|
|
136
|
-
[Relation.Target]: targetObject,
|
|
137
|
-
...data,
|
|
138
|
-
}),
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
|
-
|
|
7
|
-
import { Type } from '@dxos/echo';
|
|
8
|
-
import { Queue } from '@dxos/echo-db';
|
|
9
|
-
|
|
10
|
-
export const ResearchInputQueue = Schema.Struct({
|
|
11
|
-
queue: Type.Ref(Queue),
|
|
12
|
-
}).pipe(
|
|
13
|
-
Type.Obj({
|
|
14
|
-
typename: 'dxos.org/type/ResearchInputQueue',
|
|
15
|
-
version: '0.1.0',
|
|
16
|
-
}),
|
|
17
|
-
);
|
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { AiTool, AiToolkit } from '@effect/ai';
|
|
6
|
-
import { Console, Schema } from 'effect';
|
|
7
|
-
|
|
8
|
-
import { SERVICES_CONFIG } from '@dxos/ai/testing';
|
|
9
|
-
import {
|
|
10
|
-
Capabilities,
|
|
11
|
-
Events,
|
|
12
|
-
IntentPlugin,
|
|
13
|
-
LayoutAction,
|
|
14
|
-
type Plugin,
|
|
15
|
-
type PluginContext,
|
|
16
|
-
SettingsPlugin,
|
|
17
|
-
allOf,
|
|
18
|
-
contributes,
|
|
19
|
-
createIntent,
|
|
20
|
-
createResolver,
|
|
21
|
-
defineModule,
|
|
22
|
-
definePlugin,
|
|
23
|
-
} from '@dxos/app-framework';
|
|
24
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
25
|
-
import { AiContextBinder, ArtifactId } from '@dxos/assistant';
|
|
26
|
-
import {
|
|
27
|
-
DESIGN_BLUEPRINT,
|
|
28
|
-
PLANNING_BLUEPRINT,
|
|
29
|
-
readDocument,
|
|
30
|
-
readTasks,
|
|
31
|
-
research,
|
|
32
|
-
updateDocument,
|
|
33
|
-
updateTasks,
|
|
34
|
-
} from '@dxos/assistant-testing';
|
|
35
|
-
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
36
|
-
import { type Space } from '@dxos/client/echo';
|
|
37
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
38
|
-
import { FunctionTrigger, FunctionType, exampleFunctions } from '@dxos/functions';
|
|
39
|
-
import { log } from '@dxos/log';
|
|
40
|
-
import { AttentionPlugin } from '@dxos/plugin-attention';
|
|
41
|
-
import { ClientCapabilities, ClientEvents, ClientPlugin } from '@dxos/plugin-client';
|
|
42
|
-
import { type ClientPluginOptions } from '@dxos/plugin-client/types';
|
|
43
|
-
import { DeckAction } from '@dxos/plugin-deck/types';
|
|
44
|
-
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
45
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
46
|
-
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
47
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
48
|
-
import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
49
|
-
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
50
|
-
import { Config } from '@dxos/react-client';
|
|
51
|
-
import { defaultTx } from '@dxos/react-ui-theme';
|
|
52
|
-
import { DataType } from '@dxos/schema';
|
|
53
|
-
import { withLayout } from '@dxos/storybook-utils';
|
|
54
|
-
import { trim } from '@dxos/util';
|
|
55
|
-
|
|
56
|
-
import { AssistantPlugin } from '../../AssistantPlugin';
|
|
57
|
-
import { Assistant, AssistantAction } from '../../types';
|
|
58
|
-
|
|
59
|
-
// TODO(burdon): Factor out.
|
|
60
|
-
export const config = {
|
|
61
|
-
remote: new Config({
|
|
62
|
-
runtime: {
|
|
63
|
-
services: SERVICES_CONFIG.REMOTE,
|
|
64
|
-
},
|
|
65
|
-
}),
|
|
66
|
-
persistent: new Config({
|
|
67
|
-
runtime: {
|
|
68
|
-
client: {
|
|
69
|
-
storage: {
|
|
70
|
-
persistent: true,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
services: SERVICES_CONFIG.REMOTE,
|
|
74
|
-
},
|
|
75
|
-
}),
|
|
76
|
-
local: new Config({
|
|
77
|
-
runtime: {
|
|
78
|
-
services: SERVICES_CONFIG.LOCAL,
|
|
79
|
-
},
|
|
80
|
-
}),
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
class TestingToolkit extends AiToolkit.make(
|
|
84
|
-
AiTool.make('open-item', {
|
|
85
|
-
description: trim`
|
|
86
|
-
Opens an item in the application.
|
|
87
|
-
`,
|
|
88
|
-
parameters: {
|
|
89
|
-
id: ArtifactId,
|
|
90
|
-
},
|
|
91
|
-
success: Schema.Any,
|
|
92
|
-
failure: Schema.Never,
|
|
93
|
-
}),
|
|
94
|
-
) {
|
|
95
|
-
static layer = (_context: PluginContext) =>
|
|
96
|
-
TestingToolkit.toLayer({
|
|
97
|
-
'open-item': ({ id }) => Console.log('Called open-item', { id }),
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
type DecoratorsProps = Omit<ClientPluginOptions, 'onClientInitialized' | 'onSpacesReady'> & {
|
|
102
|
-
plugins?: Plugin[];
|
|
103
|
-
accessTokens?: DataType.AccessToken[];
|
|
104
|
-
onInit?: (props: { space: Space }) => Promise<void>;
|
|
105
|
-
onChatCreated?: (props: { space: Space; chat: Assistant.Chat; binder: AiContextBinder }) => Promise<void>;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Create storybook decorators.
|
|
110
|
-
*/
|
|
111
|
-
export const getDecorators = ({
|
|
112
|
-
types = [],
|
|
113
|
-
plugins = [],
|
|
114
|
-
accessTokens = [],
|
|
115
|
-
onInit,
|
|
116
|
-
onChatCreated,
|
|
117
|
-
...props
|
|
118
|
-
}: DecoratorsProps) => [
|
|
119
|
-
withPluginManager({
|
|
120
|
-
plugins: [
|
|
121
|
-
// System plugins.
|
|
122
|
-
AttentionPlugin(),
|
|
123
|
-
GraphPlugin(),
|
|
124
|
-
IntentPlugin(),
|
|
125
|
-
SettingsPlugin(),
|
|
126
|
-
SpacePlugin(),
|
|
127
|
-
ClientPlugin({
|
|
128
|
-
types: [
|
|
129
|
-
Markdown.Document,
|
|
130
|
-
Assistant.Chat,
|
|
131
|
-
Blueprint.Blueprint,
|
|
132
|
-
Prompt.Prompt,
|
|
133
|
-
DataType.AccessToken,
|
|
134
|
-
FunctionTrigger,
|
|
135
|
-
FunctionType,
|
|
136
|
-
...types,
|
|
137
|
-
],
|
|
138
|
-
onClientInitialized: async ({ client }) => {
|
|
139
|
-
log('onClientInitialized', { identity: client.halo.identity.get()?.did });
|
|
140
|
-
// Abort if already initialized.
|
|
141
|
-
if (client.halo.identity.get()) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
await client.halo.createIdentity();
|
|
146
|
-
await client.spaces.waitUntilReady();
|
|
147
|
-
|
|
148
|
-
const space = client.spaces.default;
|
|
149
|
-
// TODO(burdon): Should not require this.
|
|
150
|
-
// ERROR: invariant violation: Database was not initialized with root object.
|
|
151
|
-
// TODO(burdon): onSpacesReady is never called.
|
|
152
|
-
await space.waitUntilReady();
|
|
153
|
-
|
|
154
|
-
// Add tokens.
|
|
155
|
-
for (const accessToken of accessTokens) {
|
|
156
|
-
space.db.add(Obj.clone(accessToken));
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
await space.db.flush({ indexes: true });
|
|
160
|
-
await onInit?.({ space });
|
|
161
|
-
await space.db.flush({ indexes: true });
|
|
162
|
-
},
|
|
163
|
-
...props,
|
|
164
|
-
}),
|
|
165
|
-
|
|
166
|
-
// Cards
|
|
167
|
-
ThemePlugin({ tx: defaultTx }),
|
|
168
|
-
StorybookLayoutPlugin(),
|
|
169
|
-
PreviewPlugin(),
|
|
170
|
-
|
|
171
|
-
// User plugins.
|
|
172
|
-
AssistantPlugin(),
|
|
173
|
-
|
|
174
|
-
// Custom.
|
|
175
|
-
definePlugin({ id: 'example.com/plugin/testing', name: 'Testing' }, [
|
|
176
|
-
defineModule({
|
|
177
|
-
id: 'example.com/plugin/testing/module/testing',
|
|
178
|
-
activatesOn: Events.SetupArtifactDefinition,
|
|
179
|
-
activate: () => [
|
|
180
|
-
// TODO(burdon): Move into assistnat?
|
|
181
|
-
contributes(Capabilities.BlueprintDefinition, DESIGN_BLUEPRINT),
|
|
182
|
-
contributes(Capabilities.BlueprintDefinition, PLANNING_BLUEPRINT),
|
|
183
|
-
contributes(Capabilities.Functions, [readDocument, updateDocument]),
|
|
184
|
-
contributes(Capabilities.Functions, [readTasks, updateTasks]),
|
|
185
|
-
contributes(Capabilities.Functions, [research]),
|
|
186
|
-
contributes(Capabilities.Functions, [exampleFunctions.reply]),
|
|
187
|
-
],
|
|
188
|
-
}),
|
|
189
|
-
defineModule({
|
|
190
|
-
id: 'example.com/plugin/testing/module/toolkit',
|
|
191
|
-
activatesOn: Events.Startup,
|
|
192
|
-
activate: (context) => [
|
|
193
|
-
contributes(Capabilities.Toolkit, TestingToolkit),
|
|
194
|
-
contributes(Capabilities.ToolkitHandler, TestingToolkit.layer(context)),
|
|
195
|
-
],
|
|
196
|
-
}),
|
|
197
|
-
defineModule({
|
|
198
|
-
id: 'example.com/plugin/testing/module/setup',
|
|
199
|
-
activatesOn: allOf(Events.DispatcherReady, ClientEvents.SpacesReady),
|
|
200
|
-
activate: async (context) => {
|
|
201
|
-
const client = context.getCapability(ClientCapabilities.Client);
|
|
202
|
-
const space = client.spaces.default;
|
|
203
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
204
|
-
|
|
205
|
-
// Ensure workspace is set.
|
|
206
|
-
await dispatch(createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: space.id }));
|
|
207
|
-
|
|
208
|
-
// Create initial chat.
|
|
209
|
-
await dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
210
|
-
|
|
211
|
-
return [];
|
|
212
|
-
},
|
|
213
|
-
}),
|
|
214
|
-
defineModule({
|
|
215
|
-
id: 'example.com/plugin/testing/module/intent-resolver',
|
|
216
|
-
activatesOn: Events.SetupIntentResolver,
|
|
217
|
-
activate: () => [
|
|
218
|
-
contributes(Capabilities.IntentResolver, [
|
|
219
|
-
createResolver({
|
|
220
|
-
intent: DeckAction.ChangeCompanion,
|
|
221
|
-
resolve: () => ({}),
|
|
222
|
-
}),
|
|
223
|
-
createResolver({
|
|
224
|
-
intent: AssistantAction.CreateChat,
|
|
225
|
-
position: 'hoist',
|
|
226
|
-
resolve: async ({ space, name }) => {
|
|
227
|
-
const queue = space.queues.create();
|
|
228
|
-
const traceQueue = space.queues.create();
|
|
229
|
-
const chat = Obj.make(Assistant.Chat, {
|
|
230
|
-
name,
|
|
231
|
-
queue: Ref.fromDXN(queue.dxn),
|
|
232
|
-
traceQueue: Ref.fromDXN(traceQueue.dxn),
|
|
233
|
-
});
|
|
234
|
-
const binder = new AiContextBinder(queue);
|
|
235
|
-
|
|
236
|
-
// Story-specific behaviour to allow chat creation to be extended.
|
|
237
|
-
space.db.add(chat);
|
|
238
|
-
await space.db.flush({ indexes: true });
|
|
239
|
-
await onChatCreated?.({ space, chat, binder });
|
|
240
|
-
|
|
241
|
-
return {
|
|
242
|
-
data: { object: chat },
|
|
243
|
-
};
|
|
244
|
-
},
|
|
245
|
-
}),
|
|
246
|
-
]),
|
|
247
|
-
],
|
|
248
|
-
}),
|
|
249
|
-
]),
|
|
250
|
-
|
|
251
|
-
// Test-specific.
|
|
252
|
-
...plugins,
|
|
253
|
-
],
|
|
254
|
-
}),
|
|
255
|
-
withLayout({
|
|
256
|
-
fullscreen: true,
|
|
257
|
-
classNames: 'justify-center bg-deckSurface',
|
|
258
|
-
}),
|
|
259
|
-
];
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Creates access tokens from environment variables.
|
|
263
|
-
* @param tokens - Record of token sources mapped to their VITE_ prefixed environment variable values
|
|
264
|
-
* @returns Array of AccessToken objects for non-empty token values
|
|
265
|
-
* @example
|
|
266
|
-
* ```tsx
|
|
267
|
-
* const tokens = accessTokensFromEnv({
|
|
268
|
-
* 'exa.ai': process.env.VITE_EXA_API_KEY,
|
|
269
|
-
* 'linear.app': process.env.VITE_LINEAR_API_KEY
|
|
270
|
-
* });
|
|
271
|
-
* ```
|
|
272
|
-
* @note All environment variables should use the VITE_ prefix for proper Vite bundling
|
|
273
|
-
*/
|
|
274
|
-
|
|
275
|
-
export const accessTokensFromEnv = (tokens: Record<string, string | undefined>) => {
|
|
276
|
-
return Object.entries(tokens)
|
|
277
|
-
.filter(([, token]) => !!token)
|
|
278
|
-
.map(([source, token]) => Obj.make(DataType.AccessToken, { source, token: token! }));
|
|
279
|
-
};
|