@dxos/plugin-assistant 0.8.4-main.5ea62a8 → 0.8.4-main.ae835ea
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/{BlueprintContainer-OWUSKPRK.mjs → BlueprintContainer-GMSYKGSO.mjs} +13 -6
- package/dist/lib/browser/BlueprintContainer-GMSYKGSO.mjs.map +7 -0
- package/dist/lib/browser/{ChatCompanion-FRCVSLPP.mjs → ChatCompanion-M3FDKTQM.mjs} +39 -14
- package/dist/lib/browser/ChatCompanion-M3FDKTQM.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-YBJBIVUZ.mjs → ChatContainer-KAH7XITI.mjs} +10 -11
- package/dist/lib/browser/ChatContainer-KAH7XITI.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-MTPJLEHM.mjs → ChatDialog-ZWRGABW6.mjs} +8 -10
- package/dist/lib/browser/ChatDialog-ZWRGABW6.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-7AAWTWGA.mjs → app-graph-builder-R5T7BJPC.mjs} +41 -11
- package/dist/lib/browser/app-graph-builder-R5T7BJPC.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-AGTDXTXO.mjs +13 -0
- package/dist/lib/browser/chunk-357IHWQL.mjs +1519 -0
- package/dist/lib/browser/chunk-357IHWQL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6QMISAU6.mjs → chunk-A2NVNXPL.mjs} +15 -12
- package/dist/lib/browser/chunk-A2NVNXPL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-V5H5CCZA.mjs → chunk-CQW6UPJM.mjs} +24 -43
- package/dist/lib/browser/chunk-CQW6UPJM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SMIVXXAI.mjs → chunk-GNI6HL6G.mjs} +37 -20
- package/dist/lib/browser/chunk-GNI6HL6G.mjs.map +7 -0
- package/dist/lib/browser/chunk-GXHZTOWJ.mjs +378 -0
- package/dist/lib/browser/chunk-GXHZTOWJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-L5OA5OGS.mjs +262 -0
- package/dist/lib/browser/chunk-L5OA5OGS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OYFQS7JM.mjs → chunk-MEN5WTLA.mjs} +64 -39
- package/dist/lib/browser/chunk-MEN5WTLA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-CFXXQM25.mjs → chunk-PUG24BEC.mjs} +118 -23
- package/dist/lib/browser/chunk-PUG24BEC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-IJAJRAR7.mjs → chunk-SJJV3HEX.mjs} +2 -4
- package/dist/lib/browser/chunk-SJJV3HEX.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 +85 -51
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-BQO5SVGI.mjs → intent-resolver-3C5TABOX.mjs} +38 -14
- package/dist/lib/browser/intent-resolver-3C5TABOX.mjs.map +7 -0
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs +17 -0
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-VNCD2H7C.mjs → react-surface-EYKA5IFU.mjs} +11 -30
- package/dist/lib/browser/react-surface-EYKA5IFU.mjs.map +7 -0
- package/dist/lib/browser/{settings-36V3VUMW.mjs → settings-VMVBYZLN.mjs} +5 -5
- package/dist/lib/browser/{settings-36V3VUMW.mjs.map → settings-VMVBYZLN.mjs.map} +1 -1
- package/dist/lib/browser/{state-D5IVKNYG.mjs → state-CFREPBB6.mjs} +5 -5
- package/dist/lib/browser/{state-D5IVKNYG.mjs.map → state-CFREPBB6.mjs.map} +1 -1
- package/dist/lib/browser/toolkit-F3NQ7TSI.mjs +21 -0
- package/dist/lib/browser/toolkit-F3NQ7TSI.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{BlueprintContainer-UFVWCRN6.mjs → BlueprintContainer-6GBLMK4Z.mjs} +13 -6
- package/dist/lib/node-esm/BlueprintContainer-6GBLMK4Z.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatCompanion-ZNRZEKH5.mjs → ChatCompanion-OV426GCP.mjs} +39 -14
- package/dist/lib/node-esm/ChatCompanion-OV426GCP.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-TUCITJJW.mjs → ChatContainer-UKY7NHFY.mjs} +10 -11
- package/dist/lib/node-esm/ChatContainer-UKY7NHFY.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-JLM7RDZQ.mjs → ChatDialog-2BDQIEXH.mjs} +8 -10
- package/dist/lib/node-esm/ChatDialog-2BDQIEXH.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-PNAFQUYT.mjs → app-graph-builder-I52RYVWH.mjs} +41 -11
- package/dist/lib/node-esm/app-graph-builder-I52RYVWH.mjs.map +7 -0
- package/dist/lib/node-esm/{blueprint-definition-275J3XL2.mjs → blueprint-definition-CFCUD2VC.mjs} +5 -4
- package/dist/lib/node-esm/{chunk-CAQKGW3B.mjs → chunk-2CAETDW2.mjs} +63 -39
- package/dist/lib/node-esm/chunk-2CAETDW2.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-RLBN4RNR.mjs → chunk-4J5FYNNM.mjs} +15 -12
- package/dist/lib/node-esm/chunk-4J5FYNNM.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7YOGZI66.mjs → chunk-5ARE4R2I.mjs} +37 -20
- package/dist/lib/node-esm/chunk-5ARE4R2I.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7ZYOYW7F.mjs +264 -0
- package/dist/lib/node-esm/chunk-7ZYOYW7F.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HJPIYMWD.mjs +1520 -0
- package/dist/lib/node-esm/chunk-HJPIYMWD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UWUUZQWJ.mjs → chunk-O36P4LN5.mjs} +24 -43
- package/dist/lib/node-esm/chunk-O36P4LN5.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-FNZJJL7G.mjs → chunk-XM4BVQQR.mjs} +118 -23
- package/dist/lib/node-esm/chunk-XM4BVQQR.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-YPXEA46Q.mjs → chunk-XQBL2SBL.mjs} +2 -4
- package/dist/lib/node-esm/chunk-XQBL2SBL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YIO5MEPR.mjs +380 -0
- package/dist/lib/node-esm/chunk-YIO5MEPR.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 +85 -51
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-FIS3T5KP.mjs → intent-resolver-HQ27YALS.mjs} +38 -14
- package/dist/lib/node-esm/intent-resolver-HQ27YALS.mjs.map +7 -0
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs +18 -0
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-4NLRKNBU.mjs → react-surface-UOC3CBPH.mjs} +11 -30
- package/dist/lib/node-esm/react-surface-UOC3CBPH.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-7ZCZ6AS5.mjs → settings-7AUVNDM2.mjs} +5 -5
- package/dist/lib/node-esm/{settings-7ZCZ6AS5.mjs.map → settings-7AUVNDM2.mjs.map} +1 -1
- package/dist/lib/node-esm/{state-4VLKPLW3.mjs → state-XXND44OW.mjs} +5 -5
- package/dist/lib/node-esm/{state-4VLKPLW3.mjs.map → state-XXND44OW.mjs.map} +1 -1
- package/dist/lib/node-esm/toolkit-7CH5UNSQ.mjs +22 -0
- package/dist/lib/node-esm/toolkit-7CH5UNSQ.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 +0 -8
- 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/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/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintContainer.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +4 -3
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +10 -5
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +35 -26
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +36 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/ChatToolbar/ChatToolbar.d.ts +6 -0
- package/dist/types/src/components/ChatToolbar/ChatToolbar.d.ts.map +1 -0
- package/dist/types/src/components/ChatToolbar/index.d.ts +2 -0
- package/dist/types/src/components/ChatToolbar/index.d.ts.map +1 -0
- package/dist/types/src/components/{Toolbar → ChatToolbar}/useChatToolbarActions.d.ts +1 -3
- package/dist/types/src/components/ChatToolbar/useChatToolbarActions.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 +21 -14
- 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 +21 -14
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +19 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
- package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
- 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 +21 -14
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -5
- package/dist/types/src/components/index.d.ts.map +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} +1 -1
- package/dist/types/src/functions/object-list.d.ts.map +1 -0
- package/dist/types/src/functions/{load.d.ts → object-load.d.ts} +1 -1
- package/dist/types/src/functions/object-load.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +0 -3
- 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 +2 -2
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +2 -2
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextBinder.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 -17
- 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/testing/index.d.ts +1 -2
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +7 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- 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/toolkits/AssistantToolkit.d.ts +21 -0
- package/dist/types/src/toolkits/AssistantToolkit.d.ts.map +1 -0
- package/dist/types/src/toolkits/SystemToolkit.d.ts +69 -0
- package/dist/types/src/toolkits/SystemToolkit.d.ts.map +1 -0
- package/dist/types/src/toolkits/index.d.ts +3 -0
- package/dist/types/src/toolkits/index.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +6 -4
- 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 +18 -6
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +12 -12
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +93 -110
- package/src/AssistantPlugin.tsx +140 -129
- package/src/capabilities/ai-service.ts +6 -7
- package/src/capabilities/app-graph-builder.ts +36 -4
- package/src/capabilities/blueprint-definition.ts +39 -15
- package/src/capabilities/capabilities.ts +0 -13
- package/src/capabilities/edge-model-resolver.ts +5 -7
- package/src/capabilities/intent-resolver.ts +33 -6
- package/src/capabilities/local-model-resolver.ts +6 -8
- package/src/capabilities/react-surface.tsx +1 -21
- package/src/capabilities/toolkit.ts +10 -154
- package/src/components/BlueprintContainer.tsx +8 -2
- package/src/components/Chat/Chat.tsx +72 -70
- package/src/components/ChatCompanion.tsx +33 -8
- package/src/components/ChatContainer.tsx +4 -4
- package/src/components/ChatDialog.tsx +8 -8
- package/src/components/ChatProgress/ChatProgress.tsx +2 -3
- package/src/components/ChatPrompt/ChatOptions.tsx +17 -25
- package/src/components/ChatThread/ChatThread.stories.tsx +75 -229
- package/src/components/ChatThread/ChatThread.tsx +64 -46
- package/src/components/ChatThread/Link.tsx +11 -8
- package/src/components/ChatThread/registry.tsx +184 -0
- package/src/components/ChatThread/sync.test.ts +81 -0
- package/src/components/ChatThread/sync.ts +113 -0
- package/src/components/{Toolbar/Toolbar.tsx → ChatToolbar/ChatToolbar.tsx} +5 -2
- package/src/components/{Toolbar → ChatToolbar}/index.ts +1 -1
- package/src/components/{Toolbar → ChatToolbar}/useChatToolbarActions.ts +2 -1
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +5 -5
- package/src/components/TemplateEditor/TemplateEditor.tsx +18 -10
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +3 -5
- package/src/components/TemplateEditor/TemplateForm.tsx +1 -1
- package/src/components/TemplateEditor/handlebars-extension.ts +12 -11
- package/src/components/{ChatThread → ToolBlock}/ToolBlock.tsx +31 -26
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +4 -7
- package/src/components/Toolbox/Toolbox.tsx +3 -3
- package/src/components/index.ts +1 -3
- package/src/functions/analysis.ts +4 -2
- 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} +9 -7
- package/src/hooks/index.ts +0 -3
- package/src/hooks/useBlueprintRegistry.ts +17 -3
- package/src/hooks/useChatProcessor.ts +13 -5
- package/src/hooks/useChatServices.ts +26 -42
- package/src/hooks/useContextBinder.ts +17 -5
- package/src/hooks/useItemTypes.ts +1 -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 +1 -1
- package/src/processor/processor.test.ts +21 -17
- package/src/processor/processor.ts +30 -57
- package/src/processor/update-name.ts +57 -0
- package/src/queue-logger.ts +5 -5
- package/src/testing/index.ts +1 -2
- package/src/testing/test-generator.ts +261 -0
- package/src/testing/test-services.ts +2 -8
- package/src/toolkits/AssistantToolkit.ts +55 -0
- package/src/toolkits/SystemToolkit.ts +292 -0
- package/src/toolkits/index.ts +6 -0
- package/src/translations.ts +6 -5
- package/src/types/Assistant.ts +10 -8
- package/src/types/AssistantAction.ts +10 -2
- package/src/types/service.ts +17 -9
- package/dist/lib/browser/BlueprintContainer-OWUSKPRK.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-FRCVSLPP.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-YBJBIVUZ.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-MTPJLEHM.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-NRZPTUHO.mjs +0 -22
- package/dist/lib/browser/ai-service-NRZPTUHO.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-7AAWTWGA.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-CRZPIA5A.mjs +0 -12
- package/dist/lib/browser/chunk-6QMISAU6.mjs.map +0 -7
- package/dist/lib/browser/chunk-CFXXQM25.mjs.map +0 -7
- package/dist/lib/browser/chunk-IJAJRAR7.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-OYFQS7JM.mjs.map +0 -7
- package/dist/lib/browser/chunk-SMIVXXAI.mjs.map +0 -7
- package/dist/lib/browser/chunk-V5H5CCZA.mjs.map +0 -7
- package/dist/lib/browser/chunk-XL557TXF.mjs +0 -2332
- package/dist/lib/browser/chunk-XL557TXF.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-E5M3CC46.mjs +0 -22
- package/dist/lib/browser/edge-model-resolver-E5M3CC46.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-BQO5SVGI.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-VZ5WZQIC.mjs +0 -21
- package/dist/lib/browser/local-model-resolver-VZ5WZQIC.mjs.map +0 -7
- package/dist/lib/browser/react-surface-VNCD2H7C.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-UFVWCRN6.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-ZNRZEKH5.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-TUCITJJW.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-JLM7RDZQ.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-UDEPIPTO.mjs +0 -23
- package/dist/lib/node-esm/ai-service-UDEPIPTO.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-PNAFQUYT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2X6VEO32.mjs +0 -2333
- package/dist/lib/node-esm/chunk-2X6VEO32.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7YOGZI66.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CAQKGW3B.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FNZJJL7G.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RLBN4RNR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UWUUZQWJ.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-YPXEA46Q.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-SZHDLXCT.mjs +0 -23
- package/dist/lib/node-esm/edge-model-resolver-SZHDLXCT.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-FIS3T5KP.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-2KCBKMYA.mjs +0 -22
- package/dist/lib/node-esm/local-model-resolver-2KCBKMYA.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-4NLRKNBU.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/components/ChatThread/ChatMessage.d.ts +0 -33
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
- package/dist/types/src/components/ChatThread/ToolBlock.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 -263
- 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/Toolbar/Toolbar.d.ts +0 -4
- 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.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/useExecutionGraph.d.ts +0 -7
- package/dist/types/src/hooks/useExecutionGraph.d.ts.map +0 -1
- package/dist/types/src/hooks/useMatcherExtension.d.ts +0 -3
- package/dist/types/src/hooks/useMatcherExtension.d.ts.map +0 -1
- package/dist/types/src/hooks/useResolveRef.d.ts +0 -4
- package/dist/types/src/hooks/useResolveRef.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/stories/Chat.stories.d.ts +0 -26
- 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/CommentsContainer.d.ts +0 -4
- package/dist/types/src/stories/components/CommentsContainer.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/LoggingContainer.d.ts +0 -4
- 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/SurfaceContainer.d.ts +0 -8
- package/dist/types/src/stories/components/SurfaceContainer.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/index.d.ts +0 -11
- 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 -5
- 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/testing.d.ts +0 -44
- package/dist/types/src/stories/testing/testing.d.ts.map +0 -1
- package/dist/types/src/testing/test-data.d.ts +0 -4
- 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/components/ChatThread/ChatMessage.tsx +0 -334
- 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/execution-graph/execution-graph.ts +0 -211
- package/src/execution-graph/index.ts +0 -5
- package/src/hooks/useExecutionGraph.ts +0 -20
- package/src/hooks/useMatcherExtension.ts +0 -45
- package/src/hooks/useResolveRef.ts +0 -33
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -76
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -36
- package/src/stories/Chat.stories.tsx +0 -469
- package/src/stories/components/BlueprintContainer.tsx +0 -32
- package/src/stories/components/ChatContainer.tsx +0 -57
- package/src/stories/components/CommentsContainer.tsx +0 -25
- package/src/stories/components/GraphContainer.tsx +0 -118
- package/src/stories/components/LoggingContainer.tsx +0 -21
- package/src/stories/components/MessageContainer.tsx +0 -27
- package/src/stories/components/SurfaceContainer.tsx +0 -52
- package/src/stories/components/TasksContainer.tsx +0 -49
- package/src/stories/components/TokenManagerContainer.tsx +0 -14
- package/src/stories/components/index.ts +0 -15
- 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/testing.tsx +0 -254
- package/src/testing/test-data.ts +0 -109
- package/src/testing/test-functions.ts +0 -16
- /package/dist/lib/browser/{blueprint-definition-CRZPIA5A.mjs.map → blueprint-definition-AGTDXTXO.mjs.map} +0 -0
- /package/dist/lib/node-esm/{blueprint-definition-275J3XL2.mjs.map → blueprint-definition-CFCUD2VC.mjs.map} +0 -0
|
@@ -2,38 +2,38 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import type * as Tool from '@effect/ai/Tool';
|
|
6
6
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { type AgentStatus } from '@dxos/ai';
|
|
9
9
|
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
NumericTabs,
|
|
12
|
+
TextCrawl,
|
|
13
|
+
ToggleContainer,
|
|
14
|
+
chatMessageJson,
|
|
15
|
+
chatMessagePanel,
|
|
16
|
+
chatMessagePanelContent,
|
|
17
|
+
chatMessagePanelHeader,
|
|
18
|
+
} from '@dxos/react-ui-components';
|
|
11
19
|
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
12
20
|
import { type ContentBlock, type DataType } from '@dxos/schema';
|
|
13
|
-
import { isNonNullable,
|
|
14
|
-
import { safeParseJson } from '@dxos/util';
|
|
21
|
+
import { isNonNullable, safeParseJson } from '@dxos/util';
|
|
15
22
|
|
|
16
23
|
import { meta } from '../../meta';
|
|
17
24
|
|
|
18
|
-
import { styles } from './ChatMessage';
|
|
19
|
-
|
|
20
25
|
export const isToolMessage = (message: DataType.Message) => {
|
|
21
26
|
return message.blocks.some((block) => block._tag === 'toolCall' || block._tag === 'toolResult');
|
|
22
27
|
};
|
|
23
28
|
|
|
24
|
-
export type AiToolProvider = () => readonly AiTool.Any[];
|
|
25
|
-
|
|
26
29
|
export type ToolBlockProps = {
|
|
27
|
-
|
|
28
|
-
toolProvider: AiToolProvider;
|
|
30
|
+
blocks: ContentBlock.Any[];
|
|
29
31
|
};
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
export const ToolBlock = ({ message, toolProvider }: ToolBlockProps) => {
|
|
33
|
+
export const ToolBlock = ({ blocks = [] }: ToolBlockProps) => {
|
|
33
34
|
const { t } = useTranslation(meta.id);
|
|
34
|
-
const { blocks = [] } = message;
|
|
35
35
|
|
|
36
|
-
const getToolCaption = (tool?:
|
|
36
|
+
const getToolCaption = (tool?: Tool.Any, status?: AgentStatus) => {
|
|
37
37
|
if (!tool) {
|
|
38
38
|
return t('calling tool label');
|
|
39
39
|
}
|
|
@@ -42,8 +42,9 @@ export const ToolBlock = ({ message, toolProvider }: ToolBlockProps) => {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const items = useMemo(() => {
|
|
45
|
-
let lastToolCall: { tool:
|
|
46
|
-
|
|
45
|
+
let lastToolCall: { tool: Tool.Any | undefined; block: ContentBlock.ToolCall } | undefined;
|
|
46
|
+
// TODO(burdon): Get from context?
|
|
47
|
+
const tools: Tool.Any[] = []; //processor.conversation.toolkit?.tools ?? [];
|
|
47
48
|
return blocks
|
|
48
49
|
.filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult' || block._tag === 'summary')
|
|
49
50
|
.map((block) => {
|
|
@@ -99,13 +100,20 @@ export const ToolBlock = ({ message, toolProvider }: ToolBlockProps) => {
|
|
|
99
100
|
.filter(isNonNullable);
|
|
100
101
|
}, [blocks]);
|
|
101
102
|
|
|
103
|
+
if (!items.length) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
|
|
102
107
|
return <ToolContainer items={items} />;
|
|
103
108
|
};
|
|
104
109
|
|
|
110
|
+
ToolBlock.displayName = 'ToolBlock';
|
|
111
|
+
|
|
105
112
|
type ToolContainerParams = {
|
|
106
113
|
items: { title: string; content: any }[];
|
|
107
114
|
};
|
|
108
115
|
|
|
116
|
+
// TODO(burdon): Maintain scroll position when closing.
|
|
109
117
|
export const ToolContainer = ({ items }: ToolContainerParams) => {
|
|
110
118
|
const tabsRef = useRef<HTMLDivElement>(null);
|
|
111
119
|
const [selected, setSelected] = useState(0);
|
|
@@ -120,21 +128,18 @@ export const ToolContainer = ({ items }: ToolContainerParams) => {
|
|
|
120
128
|
setSelected(index);
|
|
121
129
|
};
|
|
122
130
|
|
|
123
|
-
const
|
|
124
|
-
const lines = items.map((item) => item.title).filter(isNotFalsy);
|
|
125
|
-
return <TextCrawl key='status-roll' lines={lines} autoAdvance />;
|
|
126
|
-
}, [items]);
|
|
127
|
-
|
|
128
|
-
const data = items[selected].content;
|
|
131
|
+
const data = items[selected]?.content;
|
|
129
132
|
|
|
130
133
|
return (
|
|
131
|
-
<ToggleContainer.Root classNames={
|
|
132
|
-
<ToggleContainer.Header classNames={
|
|
133
|
-
|
|
134
|
+
<ToggleContainer.Root classNames={chatMessagePanel} open={open} onChangeOpen={setOpen}>
|
|
135
|
+
<ToggleContainer.Header classNames={chatMessagePanelHeader}>
|
|
136
|
+
<TextCrawl key='status-roll' lines={items.map((item) => item.title)} />
|
|
137
|
+
</ToggleContainer.Header>
|
|
138
|
+
<ToggleContainer.Content classNames={['grid grid-cols-[32px_1fr]', chatMessagePanelContent]}>
|
|
134
139
|
<NumericTabs ref={tabsRef} classNames='p-1' length={items.length} selected={selected} onSelect={handleSelect} />
|
|
135
140
|
<Json
|
|
136
141
|
data={data}
|
|
137
|
-
classNames={
|
|
142
|
+
classNames={chatMessageJson}
|
|
138
143
|
replacer={{
|
|
139
144
|
maxDepth: 3,
|
|
140
145
|
maxArrayLen: 10,
|
|
@@ -2,20 +2,18 @@
|
|
|
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
|
|
|
@@ -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>[];
|
|
@@ -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
|
@@ -7,13 +7,11 @@ import { lazy } from 'react';
|
|
|
7
7
|
export * from './AssistantSettings';
|
|
8
8
|
export * from './Chat';
|
|
9
9
|
export * from './ChatProgress';
|
|
10
|
-
export * from './
|
|
10
|
+
export * from './ChatToolbar';
|
|
11
11
|
export * from './TemplateEditor';
|
|
12
|
-
export * from './Toolbar';
|
|
13
12
|
export * from './Toolbox';
|
|
14
13
|
|
|
15
14
|
export const BlueprintContainer = lazy(() => import('./BlueprintContainer'));
|
|
16
15
|
export const ChatCompanion = lazy(() => import('./ChatCompanion'));
|
|
17
16
|
export const ChatContainer = lazy(() => import('./ChatContainer'));
|
|
18
17
|
export const ChatDialog = lazy(() => import('./ChatDialog'));
|
|
19
|
-
export const SequenceContainer = lazy(() => import('./SequenceContainer'));
|
|
@@ -2,13 +2,15 @@
|
|
|
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.' }),
|
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,17 +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
|
-
import { log } from '@dxos/log';
|
|
11
13
|
|
|
12
|
-
// TODO(burdon):
|
|
13
|
-
// TODO(burdon): Factor out to space plugin.
|
|
14
|
+
// TODO(burdon): Move to toolkit (i.e., tool not function).
|
|
14
15
|
export default defineFunction({
|
|
15
|
-
|
|
16
|
+
key: 'dxos.org/function/assistant/object-load',
|
|
17
|
+
name: 'Load object',
|
|
16
18
|
description: 'Loads the object.',
|
|
17
19
|
inputSchema: Schema.Struct({
|
|
18
20
|
id: ArtifactId.annotations({
|
|
@@ -28,13 +30,13 @@ export default defineFunction({
|
|
|
28
30
|
}),
|
|
29
31
|
handler: Effect.fn(function* ({ data: { id, typename } }) {
|
|
30
32
|
const object = yield* DatabaseService.resolve(ArtifactId.toDXN(id));
|
|
31
|
-
return yield* pipe(
|
|
33
|
+
return yield* Function.pipe(
|
|
32
34
|
Option.fromNullable(object),
|
|
33
35
|
Option.flatMap((object) => (Obj.getTypename(object) === typename ? Option.some(object) : Option.none())),
|
|
34
36
|
Option.match({
|
|
35
37
|
onNone: () => Effect.fail('Object not found.'),
|
|
36
38
|
onSome: (object) => {
|
|
37
|
-
log.info('object', { object });
|
|
39
|
+
// log.info('object', { object });
|
|
38
40
|
return Effect.succeed({ object });
|
|
39
41
|
},
|
|
40
42
|
}),
|
package/src/hooks/index.ts
CHANGED
|
@@ -7,11 +7,8 @@ export * from './useChatProcessor';
|
|
|
7
7
|
export * from './useChatServices';
|
|
8
8
|
export * from './useContextBinder';
|
|
9
9
|
export * from './useContextObjects';
|
|
10
|
-
export * from './useExecutionGraph';
|
|
11
10
|
export * from './useFlush';
|
|
12
11
|
export * from './useItemTypes';
|
|
13
|
-
export * from './useMatcherExtension';
|
|
14
12
|
export * from './useOnline';
|
|
15
13
|
export * from './usePresets';
|
|
16
14
|
export * from './useReferencesProvider';
|
|
17
|
-
export * from './useResolveRef';
|
|
@@ -10,7 +10,8 @@ import { type AiContextBinder } from '@dxos/assistant';
|
|
|
10
10
|
import { Blueprint } from '@dxos/blueprints';
|
|
11
11
|
import { type Space } from '@dxos/client/echo';
|
|
12
12
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
13
|
-
import {
|
|
13
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
14
|
+
import { distinctBy, isNonNullable } from '@dxos/util';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Provide a registry of blueprints from plugins.
|
|
@@ -21,8 +22,21 @@ export const useBlueprintRegistry = () => {
|
|
|
21
22
|
return useMemo(() => new Blueprint.Registry(blueprints), [blueprints]);
|
|
22
23
|
};
|
|
23
24
|
|
|
24
|
-
export const useBlueprints = ({
|
|
25
|
-
|
|
25
|
+
export const useBlueprints = ({
|
|
26
|
+
blueprintRegistry,
|
|
27
|
+
space,
|
|
28
|
+
}: {
|
|
29
|
+
blueprintRegistry?: Blueprint.Registry;
|
|
30
|
+
space?: Space;
|
|
31
|
+
}) => {
|
|
32
|
+
const staticBlueprints = useMemo(() => blueprintRegistry?.query() ?? [], [blueprintRegistry]);
|
|
33
|
+
const spaceBlueprints = useQuery(space, Filter.type(Blueprint.Blueprint));
|
|
34
|
+
return useMemo(() => {
|
|
35
|
+
const blueprints = distinctBy([...staticBlueprints, ...spaceBlueprints], (b) => b.key);
|
|
36
|
+
blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));
|
|
37
|
+
return blueprints;
|
|
38
|
+
}, [staticBlueprints, spaceBlueprints]);
|
|
39
|
+
};
|
|
26
40
|
|
|
27
41
|
/**
|
|
28
42
|
* Create reactive map of active blueprints (by key).
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { RegistryContext } from '@effect-rx/rx-react';
|
|
6
|
-
import
|
|
7
|
-
import { useContext, useMemo } from '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
12
|
import { type Queue } 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';
|
|
@@ -17,7 +18,7 @@ import { type Assistant } from '../types';
|
|
|
17
18
|
export type UseChatProcessorProps = {
|
|
18
19
|
chat?: Assistant.Chat;
|
|
19
20
|
preset?: AiServicePreset;
|
|
20
|
-
services?:
|
|
21
|
+
services?: () => Promise<Runtime.Runtime<AiChatServices>>;
|
|
21
22
|
blueprintRegistry?: Blueprint.Registry;
|
|
22
23
|
settings?: Assistant.Settings;
|
|
23
24
|
};
|
|
@@ -35,12 +36,19 @@ export const useChatProcessor = ({
|
|
|
35
36
|
const observableRegistry = useContext(RegistryContext);
|
|
36
37
|
|
|
37
38
|
// Create conversation from chat queue.
|
|
38
|
-
const conversation =
|
|
39
|
+
const [conversation, setConversation] = useState<AiConversation>();
|
|
40
|
+
useAsyncEffect(async () => {
|
|
39
41
|
if (!chat?.queue.target) {
|
|
40
42
|
return;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
const conversation = new AiConversation(chat.queue.target as Queue<any>);
|
|
46
|
+
await conversation.open();
|
|
47
|
+
setConversation(conversation);
|
|
48
|
+
|
|
49
|
+
return () => {
|
|
50
|
+
void conversation.close();
|
|
51
|
+
};
|
|
44
52
|
}, [chat?.queue.target]);
|
|
45
53
|
|
|
46
54
|
// Create processor.
|
|
@@ -2,24 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import type * as Runtime from 'effect/Runtime';
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
|
|
9
|
+
import { useCapability } from '@dxos/app-framework';
|
|
11
10
|
import { type Space } from '@dxos/client/echo';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
DatabaseService,
|
|
16
|
-
LocalFunctionExecutionService,
|
|
17
|
-
QueueService,
|
|
18
|
-
RemoteFunctionExecutionService,
|
|
19
|
-
TracingService,
|
|
20
|
-
} from '@dxos/functions';
|
|
11
|
+
import { TracingService } from '@dxos/functions';
|
|
12
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
13
|
+
import { useClient } from '@dxos/react-client';
|
|
21
14
|
|
|
22
|
-
import { AssistantCapabilities } from '../capabilities';
|
|
23
15
|
import { type AiChatServices } from '../processor';
|
|
24
16
|
import { type Assistant } from '../types';
|
|
25
17
|
|
|
@@ -31,34 +23,26 @@ export type UseChatServicesProps = {
|
|
|
31
23
|
/**
|
|
32
24
|
* Construct service layer.
|
|
33
25
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
// TODO(dmaretskyi): Better return type.
|
|
27
|
+
export const useChatServices = ({
|
|
28
|
+
space,
|
|
29
|
+
chat,
|
|
30
|
+
}: UseChatServicesProps): (() => Promise<Runtime.Runtime<AiChatServices>>) | undefined => {
|
|
31
|
+
const client = useClient();
|
|
32
|
+
space ??= client.spaces.default;
|
|
39
33
|
|
|
34
|
+
const runtimeResolver = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
40
35
|
return useMemo(() => {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Layer.provideMerge(
|
|
54
|
-
Layer.mergeAll(
|
|
55
|
-
space ? DatabaseService.layer(space.db) : DatabaseService.notAvailable,
|
|
56
|
-
space ? QueueService.layer(space.queues) : QueueService.notAvailable,
|
|
57
|
-
chat?.traceQueue?.target ? TracingService.layerQueue(chat.traceQueue?.target) : TracingService.layerNoop,
|
|
58
|
-
LocalFunctionExecutionService.layer,
|
|
59
|
-
RemoteFunctionExecutionService.mockLayer,
|
|
60
|
-
),
|
|
61
|
-
),
|
|
62
|
-
);
|
|
63
|
-
}, [space, functions, toolkits, handlers, chat?.traceQueue?.target]);
|
|
36
|
+
const runtime = runtimeResolver.getRuntime(space.id);
|
|
37
|
+
return () =>
|
|
38
|
+
runtime.runPromise(
|
|
39
|
+
Effect.gen(function* () {
|
|
40
|
+
return yield* Effect.runtime<AiChatServices>().pipe(
|
|
41
|
+
Effect.provide(
|
|
42
|
+
chat?.traceQueue?.target ? TracingService.layerQueue(chat.traceQueue?.target) : TracingService.layerNoop,
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
}),
|
|
46
|
+
);
|
|
47
|
+
}, [space, chat?.traceQueue?.target]);
|
|
64
48
|
};
|
|
@@ -2,17 +2,29 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { AiContextBinder } from '@dxos/assistant';
|
|
8
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
8
9
|
|
|
9
10
|
import { type Assistant } from '../types';
|
|
10
11
|
|
|
11
12
|
export const useContextBinder = (chat: Assistant.Chat | undefined): AiContextBinder | undefined => {
|
|
12
|
-
const binder =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const [binder, setBinder] = useState<AiContextBinder>();
|
|
14
|
+
|
|
15
|
+
useAsyncEffect(async () => {
|
|
16
|
+
if (!chat?.queue.target) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const binder = new AiContextBinder(chat.queue.target);
|
|
21
|
+
await binder.open();
|
|
22
|
+
setBinder(binder);
|
|
23
|
+
|
|
24
|
+
return () => {
|
|
25
|
+
void binder.close();
|
|
26
|
+
};
|
|
27
|
+
}, [chat?.queue.target]);
|
|
16
28
|
|
|
17
29
|
return binder;
|
|
18
30
|
};
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -3,16 +3,19 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
export const ASSISTANT_PLUGIN = 'dxos.org/plugin/assistant';
|
|
8
|
-
|
|
9
|
-
export const ASSISTANT_DIALOG = `${ASSISTANT_PLUGIN}/assistant/dialog`;
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
10
7
|
|
|
11
8
|
export const meta: PluginMeta = {
|
|
12
|
-
id:
|
|
9
|
+
id: 'dxos.org/plugin/assistant',
|
|
13
10
|
name: 'Assistant',
|
|
14
|
-
description:
|
|
11
|
+
description: trim`
|
|
12
|
+
Intelligent AI assistant that can analyze and interact with objects across your spaces.
|
|
13
|
+
Chat naturally to get insights, search content, and perform actions using AI-powered context awareness.
|
|
14
|
+
`,
|
|
15
15
|
icon: 'ph--atom--regular',
|
|
16
|
+
iconHue: 'sky',
|
|
16
17
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-assistant',
|
|
17
18
|
tags: ['labs'],
|
|
18
19
|
};
|
|
20
|
+
|
|
21
|
+
export const ASSISTANT_DIALOG = `${meta.id}/assistant/dialog`;
|
package/src/processor/index.ts
CHANGED