@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
|
@@ -4,31 +4,39 @@
|
|
|
4
4
|
|
|
5
5
|
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
6
6
|
import { templates } from '@dxos/assistant';
|
|
7
|
+
import {
|
|
8
|
+
Agent,
|
|
9
|
+
Discord,
|
|
10
|
+
DiscordBlueprint,
|
|
11
|
+
EntityExtraction,
|
|
12
|
+
Linear,
|
|
13
|
+
LinearBlueprint,
|
|
14
|
+
Research,
|
|
15
|
+
ResearchBlueprint,
|
|
16
|
+
WebSearchBlueprint,
|
|
17
|
+
} from '@dxos/assistant-toolkit';
|
|
7
18
|
import { Blueprint } from '@dxos/blueprints';
|
|
8
19
|
import { type FunctionDefinition } from '@dxos/functions';
|
|
9
20
|
|
|
10
21
|
import { analysis, list, load } from '../functions';
|
|
22
|
+
import { AssistantToolkit, SystemToolkit } from '../toolkits';
|
|
23
|
+
|
|
24
|
+
// TODO(burdon): Function naming pattern (noun-verb); fully-qualified?
|
|
25
|
+
// TODO(burdon): Document plugin structure (blueprint, functions, toolkit.)
|
|
26
|
+
// TODO(burdon): Test framework for developing functions. Error handling.
|
|
27
|
+
// TODO(burdon): Convert tools to functions? (Deps).
|
|
28
|
+
|
|
29
|
+
// TODO(wittjosiah): Factor out to a generic app-framework blueprint.
|
|
30
|
+
const deckTools = ['open-item'];
|
|
11
31
|
|
|
12
32
|
const functions: FunctionDefinition[] = [analysis, list, load];
|
|
13
|
-
const tools = [
|
|
14
|
-
'add-to-context',
|
|
15
|
-
// TODO(wittjosiah): Factor out to an ECHO blueprint.
|
|
16
|
-
'get-schemas',
|
|
17
|
-
'add-schema',
|
|
18
|
-
'create-record',
|
|
19
|
-
// TODO(wittjosiah): Factor out to a generic app-framework blueprint.
|
|
20
|
-
'open-item',
|
|
21
|
-
// TODO(burdon): Anthropic only.
|
|
22
|
-
// https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool#example-str-replace-command
|
|
23
|
-
// AI_TOOL_NOT_FOUND: str_replace_based_edit_tool
|
|
24
|
-
// 'str_replace_based_edit_tool',
|
|
25
|
-
];
|
|
33
|
+
const tools = [...AssistantToolkit.tools, ...SystemToolkit.tools, ...deckTools];
|
|
26
34
|
|
|
27
|
-
export const
|
|
35
|
+
export const ASSISTANT_BLUEPRINT_KEY = 'dxos.org/blueprint/assistant';
|
|
28
36
|
|
|
29
37
|
export const createBlueprint = (): Blueprint.Blueprint =>
|
|
30
38
|
Blueprint.make({
|
|
31
|
-
key:
|
|
39
|
+
key: ASSISTANT_BLUEPRINT_KEY,
|
|
32
40
|
name: 'Assistant',
|
|
33
41
|
tools: Blueprint.toolDefinitions({ functions, tools }),
|
|
34
42
|
instructions: templates.system,
|
|
@@ -39,4 +47,20 @@ const blueprint = createBlueprint();
|
|
|
39
47
|
export default (): Capability<any>[] => [
|
|
40
48
|
contributes(Capabilities.Functions, functions),
|
|
41
49
|
contributes(Capabilities.BlueprintDefinition, blueprint),
|
|
50
|
+
|
|
51
|
+
// TODO(burdon): Factor out.
|
|
52
|
+
contributes(Capabilities.Functions, [Research.create, Research.research]),
|
|
53
|
+
contributes(Capabilities.BlueprintDefinition, ResearchBlueprint),
|
|
54
|
+
|
|
55
|
+
// TODO(burdon): Factor out.
|
|
56
|
+
contributes(Capabilities.Functions, [Agent.prompt, EntityExtraction.extract]),
|
|
57
|
+
contributes(Capabilities.BlueprintDefinition, WebSearchBlueprint),
|
|
58
|
+
|
|
59
|
+
// TODO(burdon): Factor out.
|
|
60
|
+
contributes(Capabilities.Functions, [Discord.fetch]),
|
|
61
|
+
contributes(Capabilities.BlueprintDefinition, DiscordBlueprint),
|
|
62
|
+
|
|
63
|
+
// TODO(burdon): Factor out.
|
|
64
|
+
contributes(Capabilities.Functions, [Linear.sync]),
|
|
65
|
+
contributes(Capabilities.BlueprintDefinition, LinearBlueprint),
|
|
42
66
|
];
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Layer } from 'effect';
|
|
6
|
-
|
|
7
|
-
import { type AiService, type AiServiceRouter } from '@dxos/ai';
|
|
8
5
|
import { defineCapability } from '@dxos/app-framework';
|
|
9
6
|
import { type DeepReadonly } from '@dxos/util';
|
|
10
7
|
|
|
@@ -18,14 +15,4 @@ export namespace AssistantCapabilities {
|
|
|
18
15
|
};
|
|
19
16
|
export const State = defineCapability<DeepReadonly<AssistantState>>(`${meta.id}/capability/state`);
|
|
20
17
|
export const MutableState = defineCapability<AssistantState>(`${meta.id}/capability/state`);
|
|
21
|
-
|
|
22
|
-
export type AiServiceLayer = Layer.Layer<AiService.AiService>;
|
|
23
|
-
export const AiServiceLayer = defineCapability<AiServiceLayer>(`${meta.id}/capability/ai-service-factory`);
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Plugins can contribute them to provide model resolvers.
|
|
27
|
-
*/
|
|
28
|
-
export const AiModelResolver = defineCapability<Layer.Layer<AiServiceRouter.AiModelResolver>>(
|
|
29
|
-
`${meta.id}/capability/ai-model-resolver`,
|
|
30
|
-
);
|
|
31
18
|
}
|
|
@@ -3,17 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as AnthropicClient from '@effect/ai-anthropic/AnthropicClient';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
8
8
|
|
|
9
|
-
import
|
|
10
|
-
import { type Capability, contributes } from '@dxos/app-framework';
|
|
11
|
-
|
|
12
|
-
import { AssistantCapabilities } from './capabilities';
|
|
9
|
+
import * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
10
|
+
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
13
11
|
|
|
14
12
|
export default (): Capability<any>[] => [
|
|
15
13
|
contributes(
|
|
16
|
-
|
|
14
|
+
Capabilities.AiModelResolver,
|
|
17
15
|
AiServiceRouter.AnthropicResolver.pipe(
|
|
18
16
|
Layer.provide(
|
|
19
17
|
AnthropicClient.layer({
|
|
@@ -2,25 +2,31 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
8
|
-
import { AiContextBinder } from '@dxos/assistant';
|
|
8
|
+
import { AiContextBinder, AiConversation } from '@dxos/assistant';
|
|
9
9
|
import { Blueprint, Template } from '@dxos/blueprints';
|
|
10
10
|
import { fullyQualifiedId } from '@dxos/client/echo';
|
|
11
|
+
import { type Queue } from '@dxos/client/echo';
|
|
11
12
|
import { Sequence } from '@dxos/conductor';
|
|
12
13
|
import { Filter, Key, Obj, Ref } from '@dxos/echo';
|
|
14
|
+
import { TracingService } from '@dxos/functions';
|
|
15
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
13
16
|
import { CollectionAction } from '@dxos/plugin-space/types';
|
|
17
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
18
|
+
import { type DataType } from '@dxos/schema';
|
|
14
19
|
|
|
20
|
+
import { type AiChatServices, updateName } from '../processor';
|
|
15
21
|
import { Assistant, AssistantAction } from '../types';
|
|
16
22
|
|
|
17
|
-
import {
|
|
23
|
+
import { ASSISTANT_BLUEPRINT_KEY, createBlueprint } from './blueprint-definition';
|
|
18
24
|
import { AssistantCapabilities } from './capabilities';
|
|
19
25
|
|
|
20
26
|
export default (context: PluginContext) => [
|
|
21
27
|
contributes(Capabilities.IntentResolver, [
|
|
22
28
|
createResolver({
|
|
23
|
-
intent: AssistantAction.
|
|
29
|
+
intent: AssistantAction.onCreateSpace,
|
|
24
30
|
resolve: ({ space, rootCollection }) =>
|
|
25
31
|
Effect.gen(function* () {
|
|
26
32
|
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
@@ -41,23 +47,44 @@ export default (context: PluginContext) => [
|
|
|
41
47
|
intent: AssistantAction.CreateChat,
|
|
42
48
|
resolve: async ({ space, name }) => {
|
|
43
49
|
const queue = space.queues.create();
|
|
44
|
-
const chat =
|
|
50
|
+
const chat = Assistant.makeChat({ name, queue });
|
|
45
51
|
const { objects: blueprints } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
46
52
|
// TODO(wittjosiah): This should be a space-level setting.
|
|
47
53
|
// TODO(burdon): Clone when activated. Copy-on-write for template.
|
|
48
|
-
let defaultBlueprint = blueprints.find((blueprint) => blueprint.key ===
|
|
54
|
+
let defaultBlueprint = blueprints.find((blueprint) => blueprint.key === ASSISTANT_BLUEPRINT_KEY);
|
|
49
55
|
if (!defaultBlueprint) {
|
|
50
56
|
defaultBlueprint = space.db.add(createBlueprint());
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
const binder = new AiContextBinder(queue);
|
|
60
|
+
await binder.open();
|
|
54
61
|
await binder.bind({ blueprints: [Ref.make(defaultBlueprint)] });
|
|
62
|
+
await binder.close();
|
|
55
63
|
|
|
56
64
|
return {
|
|
57
65
|
data: { object: chat },
|
|
58
66
|
};
|
|
59
67
|
},
|
|
60
68
|
}),
|
|
69
|
+
createResolver({
|
|
70
|
+
intent: AssistantAction.UpdateChatName,
|
|
71
|
+
resolve: async ({ chat }) => {
|
|
72
|
+
const space = getSpace(chat);
|
|
73
|
+
const queue = chat.queue.target as Queue<DataType.Message>;
|
|
74
|
+
if (!space || !queue) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const runtimeResolver = context.getCapability(AutomationCapabilities.ComputeRuntime);
|
|
79
|
+
const runtime = await runtimeResolver.getRuntime(space.id).runPromise(
|
|
80
|
+
Effect.gen(function* () {
|
|
81
|
+
return yield* Effect.runtime<AiChatServices>().pipe(Effect.provide(TracingService.layerNoop));
|
|
82
|
+
}),
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
await new AiConversation(queue).use(async (conversation) => updateName(runtime, conversation, chat));
|
|
86
|
+
},
|
|
87
|
+
}),
|
|
61
88
|
createResolver({
|
|
62
89
|
intent: AssistantAction.CreateBlueprint,
|
|
63
90
|
resolve: ({ key, name, description }) => ({
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import * as OpenAiClient from '@effect/ai-openai/OpenAiClient';
|
|
6
|
+
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
8
8
|
|
|
9
|
-
import
|
|
10
|
-
import { type Capability, contributes } from '@dxos/app-framework';
|
|
11
|
-
|
|
12
|
-
import { AssistantCapabilities } from './capabilities';
|
|
9
|
+
import * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
10
|
+
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
13
|
* To start LM Studio server:
|
|
@@ -19,7 +17,7 @@ import { AssistantCapabilities } from './capabilities';
|
|
|
19
17
|
*/
|
|
20
18
|
export default (): Capability<any>[] => [
|
|
21
19
|
contributes(
|
|
22
|
-
|
|
20
|
+
Capabilities.AiModelResolver,
|
|
23
21
|
AiServiceRouter.LMStudioResolver.pipe(
|
|
24
22
|
Layer.provide(
|
|
25
23
|
OpenAiClient.layer({
|
|
@@ -13,15 +13,7 @@ import { Obj } from '@dxos/echo';
|
|
|
13
13
|
import { SettingsStore } from '@dxos/local-storage';
|
|
14
14
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
15
15
|
|
|
16
|
-
import {
|
|
17
|
-
AssistantSettings,
|
|
18
|
-
BlueprintContainer,
|
|
19
|
-
ChatCompanion,
|
|
20
|
-
ChatContainer,
|
|
21
|
-
ChatDialog,
|
|
22
|
-
PromptSettings,
|
|
23
|
-
SequenceContainer,
|
|
24
|
-
} from '../components';
|
|
16
|
+
import { AssistantSettings, BlueprintContainer, ChatCompanion, ChatContainer, ChatDialog } from '../components';
|
|
25
17
|
import { ASSISTANT_DIALOG, meta } from '../meta';
|
|
26
18
|
import { Assistant } from '../types';
|
|
27
19
|
|
|
@@ -49,12 +41,6 @@ export default () =>
|
|
|
49
41
|
(Obj.instanceOf(Assistant.Chat, data.subject) || data.subject === 'assistant-chat'),
|
|
50
42
|
component: ({ data, role }) => <ChatCompanion role={role} data={data} />,
|
|
51
43
|
}),
|
|
52
|
-
createSurface({
|
|
53
|
-
id: `${meta.id}/sequence`,
|
|
54
|
-
role: 'article',
|
|
55
|
-
filter: (data): data is { subject: Sequence } => Obj.instanceOf(Sequence, data.subject),
|
|
56
|
-
component: ({ data }) => <SequenceContainer sequence={data.subject} />,
|
|
57
|
-
}),
|
|
58
44
|
createSurface({
|
|
59
45
|
id: `${meta.id}/companion-logs`,
|
|
60
46
|
role: 'article',
|
|
@@ -76,12 +62,6 @@ export default () =>
|
|
|
76
62
|
filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
|
|
77
63
|
component: ({ data }) => <BlueprintContainer blueprint={data.subject} />,
|
|
78
64
|
}),
|
|
79
|
-
createSurface({
|
|
80
|
-
id: `${meta.id}/prompt-settings`,
|
|
81
|
-
role: 'object-settings',
|
|
82
|
-
filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
|
|
83
|
-
component: ({ data }) => <PromptSettings template={data.subject.instructions} />,
|
|
84
|
-
}),
|
|
85
65
|
createSurface({
|
|
86
66
|
id: ASSISTANT_DIALOG,
|
|
87
67
|
role: 'dialog',
|
|
@@ -2,162 +2,18 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Capabilities, type Capability, type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
|
+
import { WebSearchToolkit } from '@dxos/assistant-toolkit';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { AiContextService, ArtifactId } from '@dxos/assistant';
|
|
10
|
-
import { Filter, Obj, Ref, Type } from '@dxos/echo';
|
|
11
|
-
import { DatabaseService } from '@dxos/functions';
|
|
12
|
-
import { invariant } from '@dxos/invariant';
|
|
13
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
14
|
-
import { SpaceCapabilities, getActiveSpace } from '@dxos/plugin-space';
|
|
15
|
-
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
16
|
-
import { DataType } from '@dxos/schema';
|
|
17
|
-
import { trim } from '@dxos/util';
|
|
8
|
+
import { AssistantToolkit, SystemToolkit } from '../toolkits';
|
|
18
9
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
description: trim`
|
|
23
|
-
Adds the object to the chat context.
|
|
24
|
-
`,
|
|
25
|
-
parameters: {
|
|
26
|
-
id: ArtifactId.annotations({
|
|
27
|
-
description: 'The ID of the document to read.',
|
|
28
|
-
}),
|
|
29
|
-
},
|
|
30
|
-
success: Schema.Void,
|
|
31
|
-
failure: Schema.Never,
|
|
32
|
-
}).addRequirement<AiContextService | DatabaseService>(), // TODO(burdon): Define standard contract.
|
|
33
|
-
|
|
34
|
-
AiTool.make('get-schemas', {
|
|
35
|
-
description: trim`
|
|
36
|
-
Retrieves schemas definitions.
|
|
37
|
-
`,
|
|
38
|
-
parameters: {
|
|
39
|
-
// TODO(wittjosiah): Remove this once parameter-less tools are fixed.
|
|
40
|
-
limit: Schema.Number,
|
|
41
|
-
},
|
|
42
|
-
// TODO(dmaretskyi): Effect returns ({ result, encodedResult })
|
|
43
|
-
success: Schema.Any,
|
|
44
|
-
failure: Schema.Never,
|
|
45
|
-
}),
|
|
46
|
-
|
|
47
|
-
AiTool.make('add-schema', {
|
|
48
|
-
description: trim`
|
|
49
|
-
Adds a schema to the space.
|
|
50
|
-
The name will be used when displayed to the user.
|
|
51
|
-
The typename must be in the format of "example.com/type/Type".
|
|
52
|
-
`,
|
|
53
|
-
parameters: {
|
|
54
|
-
name: Schema.String,
|
|
55
|
-
typename: Schema.String,
|
|
56
|
-
jsonSchema: Schema.Any,
|
|
57
|
-
},
|
|
58
|
-
success: Schema.Any,
|
|
59
|
-
failure: Schema.Never,
|
|
60
|
-
}),
|
|
61
|
-
|
|
62
|
-
AiTool.make('create-record', {
|
|
63
|
-
description: trim`
|
|
64
|
-
Creates a new record and adds it to the current space.
|
|
65
|
-
Get the schema from the get-schemas tool and ensure that the data matches the corresponding schema.
|
|
66
|
-
Note that only record schemas are supported.
|
|
67
|
-
`,
|
|
68
|
-
parameters: {
|
|
69
|
-
typename: Schema.String,
|
|
70
|
-
data: Schema.Any,
|
|
71
|
-
},
|
|
72
|
-
success: Schema.Any,
|
|
73
|
-
failure: Schema.Never,
|
|
74
|
-
}),
|
|
75
|
-
) {
|
|
76
|
-
static layer = (context: PluginContext) =>
|
|
77
|
-
Toolkit.toLayer({
|
|
78
|
-
'add-to-context': Effect.fnUntraced(function* ({ id }) {
|
|
79
|
-
const { binder } = yield* AiContextService;
|
|
80
|
-
const { db } = yield* DatabaseService;
|
|
81
|
-
const ref = Ref.fromDXN(ArtifactId.toDXN(id, db.spaceId));
|
|
82
|
-
yield* Effect.promise(() =>
|
|
83
|
-
binder.bind({
|
|
84
|
-
blueprints: [],
|
|
85
|
-
objects: [ref],
|
|
86
|
-
}),
|
|
87
|
-
);
|
|
88
|
-
}),
|
|
89
|
-
|
|
90
|
-
'get-schemas': () => {
|
|
91
|
-
const space = getActiveSpace(context);
|
|
92
|
-
invariant(space, 'No active space');
|
|
93
|
-
|
|
94
|
-
return Effect.gen(function* () {
|
|
95
|
-
const whitelist = context
|
|
96
|
-
.getCapabilities(ClientCapabilities.SchemaWhiteList)
|
|
97
|
-
.flat()
|
|
98
|
-
.map((schema) => ({
|
|
99
|
-
typename: Type.getTypename(schema),
|
|
100
|
-
jsonSchema: Type.toJsonSchema(schema),
|
|
101
|
-
kind: 'record',
|
|
102
|
-
}));
|
|
103
|
-
|
|
104
|
-
// TODO(burdon): Why ObjectForm (bad name for data capability; UI term)?
|
|
105
|
-
const forms = context.getCapabilities(SpaceCapabilities.ObjectForm).map((form) => ({
|
|
106
|
-
typename: Type.getTypename(form.objectSchema),
|
|
107
|
-
jsonSchema: Type.toJsonSchema(form.objectSchema),
|
|
108
|
-
kind: 'item',
|
|
109
|
-
}));
|
|
110
|
-
|
|
111
|
-
const schemas = [...whitelist, ...forms];
|
|
112
|
-
if (space) {
|
|
113
|
-
const { objects } = yield* DatabaseService.runQuery(Filter.type(DataType.StoredSchema));
|
|
114
|
-
schemas.push(
|
|
115
|
-
...objects.map((object) => ({
|
|
116
|
-
typename: object.typename,
|
|
117
|
-
jsonSchema: object.jsonSchema,
|
|
118
|
-
kind: 'record',
|
|
119
|
-
})),
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return schemas;
|
|
124
|
-
}).pipe(Effect.provide(DatabaseService.layer(space.db)));
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
'add-schema': ({ name, typename, jsonSchema }) => {
|
|
128
|
-
return Effect.gen(function* () {
|
|
129
|
-
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
130
|
-
const space = getActiveSpace(context);
|
|
131
|
-
invariant(space, 'No active space');
|
|
132
|
-
|
|
133
|
-
const schema = Type.toEffectSchema(jsonSchema).pipe(Type.Obj({ typename, version: '0.1.0' }));
|
|
134
|
-
yield* dispatch(createIntent(SpaceAction.AddSchema, { space, name, typename, schema }));
|
|
135
|
-
}).pipe(Effect.orDie);
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
'create-record': ({ typename, data }) => {
|
|
139
|
-
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
140
|
-
const space = getActiveSpace(context);
|
|
141
|
-
invariant(space, 'No active space');
|
|
142
|
-
|
|
143
|
-
return Effect.gen(function* () {
|
|
144
|
-
const schemas = context.getCapabilities(ClientCapabilities.SchemaWhiteList).flat();
|
|
145
|
-
const { objects } = yield* DatabaseService.runQuery(Filter.type(DataType.StoredSchema));
|
|
146
|
-
schemas.push(...objects.map((object) => Type.toEffectSchema(object.jsonSchema)));
|
|
147
|
-
const schema = schemas.find((schema) => Type.getTypename(schema) === typename);
|
|
148
|
-
if (!schema) {
|
|
149
|
-
throw new Error(`Schema not found for ${typename}`);
|
|
150
|
-
}
|
|
10
|
+
export default (context: PluginContext): Capability<any>[] => [
|
|
11
|
+
contributes(Capabilities.Toolkit, AssistantToolkit),
|
|
12
|
+
contributes(Capabilities.ToolkitHandler, AssistantToolkit.createLayer(context)),
|
|
151
13
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}).pipe(Effect.provide(DatabaseService.layer(space.db)), Effect.orDie);
|
|
156
|
-
},
|
|
157
|
-
});
|
|
158
|
-
}
|
|
14
|
+
// TODO(burdon): How to manage dependencies?
|
|
15
|
+
contributes(Capabilities.Toolkit, SystemToolkit.Toolkit),
|
|
16
|
+
contributes(Capabilities.ToolkitHandler, SystemToolkit.createLayer(context)),
|
|
159
17
|
|
|
160
|
-
|
|
161
|
-
contributes(Capabilities.Toolkit, Toolkit),
|
|
162
|
-
contributes(Capabilities.ToolkitHandler, Toolkit.layer(context)),
|
|
18
|
+
contributes(Capabilities.Toolkit, WebSearchToolkit),
|
|
163
19
|
];
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { type Blueprint } from '@dxos/blueprints';
|
|
8
|
+
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
9
|
+
import { Toolbar } from '@dxos/react-ui';
|
|
10
|
+
import { useAttention } from '@dxos/react-ui-attention';
|
|
8
11
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
9
12
|
|
|
10
13
|
import { TemplateEditor } from './TemplateEditor';
|
|
@@ -14,9 +17,12 @@ export type BlueprintContainerProps = {
|
|
|
14
17
|
};
|
|
15
18
|
|
|
16
19
|
export const BlueprintContainer = ({ blueprint }: BlueprintContainerProps) => {
|
|
20
|
+
const { hasAttention } = useAttention(fullyQualifiedId(blueprint));
|
|
21
|
+
|
|
17
22
|
return (
|
|
18
|
-
<StackItem.Content
|
|
19
|
-
<
|
|
23
|
+
<StackItem.Content toolbar>
|
|
24
|
+
<Toolbar.Root disabled={!hasAttention} />
|
|
25
|
+
<TemplateEditor id={blueprint.id} template={blueprint.instructions} classNames='container-max-width' />
|
|
20
26
|
</StackItem.Content>
|
|
21
27
|
);
|
|
22
28
|
};
|