@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
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
6
|
-
|
|
7
|
-
import { SequenceDefinition } from '@dxos/conductor';
|
|
8
|
-
import { Type } from '@dxos/echo';
|
|
9
|
-
import { type ThemedClassName, useThemeContext } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
11
|
-
type EditorView,
|
|
12
|
-
createBasicExtensions,
|
|
13
|
-
createJsonExtensions,
|
|
14
|
-
createThemeExtensions,
|
|
15
|
-
useTextEditor,
|
|
16
|
-
} from '@dxos/react-ui-editor';
|
|
17
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
18
|
-
|
|
19
|
-
export type SequenceEditorProps = ThemedClassName<{
|
|
20
|
-
sequence: SequenceDefinition;
|
|
21
|
-
}>;
|
|
22
|
-
|
|
23
|
-
// TODO(burdon): Factor out JsonEditor.
|
|
24
|
-
export const SequenceEditor = forwardRef<EditorView | undefined, SequenceEditorProps>(
|
|
25
|
-
({ classNames, sequence }, forwardedRef) => {
|
|
26
|
-
const { themeMode } = useThemeContext();
|
|
27
|
-
const { parentRef, view } = useTextEditor({
|
|
28
|
-
initialValue: JSON.stringify(sequence, null, 2),
|
|
29
|
-
extensions: [
|
|
30
|
-
createBasicExtensions({
|
|
31
|
-
lineNumbers: true,
|
|
32
|
-
lineWrapping: false,
|
|
33
|
-
monospace: true,
|
|
34
|
-
scrollPastEnd: true,
|
|
35
|
-
}),
|
|
36
|
-
createThemeExtensions({
|
|
37
|
-
themeMode,
|
|
38
|
-
syntaxHighlighting: true,
|
|
39
|
-
}),
|
|
40
|
-
createJsonExtensions({
|
|
41
|
-
schema: Type.toJsonSchema(SequenceDefinition, { strict: true }),
|
|
42
|
-
}),
|
|
43
|
-
],
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
useImperativeHandle(forwardedRef, () => view, [view]);
|
|
47
|
-
|
|
48
|
-
return <div ref={parentRef} className={mx('overflow-hidden', classNames)} />;
|
|
49
|
-
},
|
|
50
|
-
);
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { AgentStatus } from '@dxos/ai';
|
|
6
|
-
import { Obj, type Ref } from '@dxos/echo';
|
|
7
|
-
import { MESSAGE_PROPERTY_TOOL_CALL_ID } from '@dxos/functions';
|
|
8
|
-
import { type ObjectId } from '@dxos/keys';
|
|
9
|
-
import { LogLevel } from '@dxos/log';
|
|
10
|
-
import { type Commit } from '@dxos/react-ui-components';
|
|
11
|
-
import { ContentBlock, DataType } from '@dxos/schema';
|
|
12
|
-
import { isNotFalsy } from '@dxos/util';
|
|
13
|
-
|
|
14
|
-
// TODO(burdon): Move to assistant.
|
|
15
|
-
|
|
16
|
-
// TODO(burdon): Add colors?
|
|
17
|
-
enum IconType {
|
|
18
|
-
// General status.
|
|
19
|
-
SUCCESS = 'ph--check-circle--regular',
|
|
20
|
-
WARNING = 'ph--warning-circle--regular',
|
|
21
|
-
ERROR = 'ph--x-circle--regular',
|
|
22
|
-
FLAG = 'ph--flag--regular',
|
|
23
|
-
ROCKET = 'ph--rocket--regular',
|
|
24
|
-
TIMER = 'ph--timer--regular',
|
|
25
|
-
|
|
26
|
-
// Interactions.
|
|
27
|
-
USER = 'ph--user--regular',
|
|
28
|
-
USER_INTERACTION = 'ph--user-sound--regular',
|
|
29
|
-
AGENT = 'ph--robot--regular',
|
|
30
|
-
THINKING = 'ph--brain--regular',
|
|
31
|
-
LINK = 'ph--link--regular',
|
|
32
|
-
TOOL = 'ph--wrench--regular',
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Models the execution graph based on a stream of events.
|
|
37
|
-
*/
|
|
38
|
-
export class ExecutionGraph {
|
|
39
|
-
// TODO(dmaretskyi): Evolve the internal state to support chats, functions, circuit workflows, etc.
|
|
40
|
-
private _commits: Commit[] = [];
|
|
41
|
-
private _branchNames = new Set<string>();
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Adds events to the graph.
|
|
45
|
-
*/
|
|
46
|
-
addEvents(events: Obj.Any[]) {
|
|
47
|
-
for (const event of events) {
|
|
48
|
-
if (Obj.instanceOf(DataType.Message, event)) {
|
|
49
|
-
const messageCommits = messageToCommit(event);
|
|
50
|
-
this._commits.push(...messageCommits);
|
|
51
|
-
messageCommits.map((c) => c.branch).forEach((branch) => this._branchNames.add(branch));
|
|
52
|
-
} else if (Obj.instanceOf(AgentStatus, event)) {
|
|
53
|
-
const branch = getBranchName({ parentMessage: event.parentMessage, toolCallId: event.toolCallId });
|
|
54
|
-
this._branchNames.add(branch);
|
|
55
|
-
this._commits.push({
|
|
56
|
-
id: event.id,
|
|
57
|
-
branch,
|
|
58
|
-
message: event.message,
|
|
59
|
-
icon: IconType.FLAG,
|
|
60
|
-
parents:
|
|
61
|
-
event.parentMessage && event.toolCallId
|
|
62
|
-
? [getToolCallId(event.parentMessage, event.toolCallId)]
|
|
63
|
-
: undefined, // TODO(burdon): Fix.
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Returns the current state of the graph.
|
|
71
|
-
*/
|
|
72
|
-
getGraph(lastRequest = false): { branches: string[]; commits: Commit[] } {
|
|
73
|
-
const idx = lastRequest ? this._commits.findLastIndex((c) => c.tags?.includes('user')) : -1;
|
|
74
|
-
const commits = idx === -1 ? this._commits : this._commits.slice(idx);
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
branches: Array.from(this._branchNames),
|
|
78
|
-
commits: commits,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// TODO(burdon): Pass in AiToolProvider.
|
|
84
|
-
const messageToCommit = (message: DataType.Message): Commit[] => {
|
|
85
|
-
return message.blocks
|
|
86
|
-
.map((block, idx) => {
|
|
87
|
-
const branch = getMessageBranch(message);
|
|
88
|
-
const parent = getParentId(message);
|
|
89
|
-
const parents = parent ? [parent] : [];
|
|
90
|
-
switch (block._tag) {
|
|
91
|
-
case 'text':
|
|
92
|
-
if (!block.text.trim().length) {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
return {
|
|
96
|
-
id: getGenericBlockId(message.id, idx),
|
|
97
|
-
branch,
|
|
98
|
-
parents,
|
|
99
|
-
...(message.sender.role === 'user'
|
|
100
|
-
? {
|
|
101
|
-
icon: IconType.USER,
|
|
102
|
-
tags: ['user'],
|
|
103
|
-
message: 'Processing request...',
|
|
104
|
-
}
|
|
105
|
-
: {
|
|
106
|
-
icon: IconType.AGENT,
|
|
107
|
-
message: `Response (${block.text.split(' ').length} words)`,
|
|
108
|
-
}),
|
|
109
|
-
} satisfies Commit;
|
|
110
|
-
case 'toolCall':
|
|
111
|
-
return {
|
|
112
|
-
id: getToolCallId(message.id, block.toolCallId),
|
|
113
|
-
branch,
|
|
114
|
-
parents,
|
|
115
|
-
icon: IconType.TOOL,
|
|
116
|
-
level: LogLevel.INFO,
|
|
117
|
-
// TODO(burdon): Lookup tool name/description?
|
|
118
|
-
message: `Calling tool (${block.name})`,
|
|
119
|
-
} satisfies Commit;
|
|
120
|
-
case 'toolResult':
|
|
121
|
-
return {
|
|
122
|
-
id: getToolResultId(message.id, block.toolCallId),
|
|
123
|
-
branch,
|
|
124
|
-
parents,
|
|
125
|
-
icon: block.error ? IconType.ERROR : IconType.SUCCESS,
|
|
126
|
-
level: block.error ? LogLevel.ERROR : LogLevel.INFO,
|
|
127
|
-
message: block.error ? 'Tool error: ' + block.error : 'Tool call succeeded',
|
|
128
|
-
} satisfies Commit;
|
|
129
|
-
case 'summary':
|
|
130
|
-
return {
|
|
131
|
-
id: getGenericBlockId(message.id, idx),
|
|
132
|
-
branch,
|
|
133
|
-
parents,
|
|
134
|
-
icon: IconType.ROCKET,
|
|
135
|
-
level: LogLevel.INFO,
|
|
136
|
-
message: ContentBlock.createSummaryMessage(block),
|
|
137
|
-
} satisfies Commit;
|
|
138
|
-
case 'status':
|
|
139
|
-
return {
|
|
140
|
-
id: getGenericBlockId(message.id, idx),
|
|
141
|
-
branch,
|
|
142
|
-
parents,
|
|
143
|
-
message: block.statusText,
|
|
144
|
-
level: LogLevel.INFO,
|
|
145
|
-
icon: IconType.FLAG,
|
|
146
|
-
} satisfies Commit;
|
|
147
|
-
case 'reasoning':
|
|
148
|
-
return {
|
|
149
|
-
id: getGenericBlockId(message.id, idx),
|
|
150
|
-
branch,
|
|
151
|
-
parents,
|
|
152
|
-
message: block.reasoningText ?? 'Thinking...',
|
|
153
|
-
icon: IconType.THINKING,
|
|
154
|
-
} satisfies Commit;
|
|
155
|
-
case 'reference':
|
|
156
|
-
return {
|
|
157
|
-
id: getGenericBlockId(message.id, idx),
|
|
158
|
-
branch,
|
|
159
|
-
parents,
|
|
160
|
-
icon: IconType.LINK,
|
|
161
|
-
message: stringifyRef(block.reference),
|
|
162
|
-
} satisfies Commit;
|
|
163
|
-
default:
|
|
164
|
-
return null;
|
|
165
|
-
}
|
|
166
|
-
})
|
|
167
|
-
.filter(isNotFalsy);
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
const getToolCallId = (messageId: ObjectId, toolCallId: string) => `${messageId}_toolCall_${toolCallId}`;
|
|
171
|
-
|
|
172
|
-
const getToolResultId = (messageId: ObjectId, toolCallId: string) => `${messageId}_toolResult_${toolCallId}`;
|
|
173
|
-
|
|
174
|
-
const getGenericBlockId = (messageId: ObjectId, idx: number) => `${messageId}_block_${idx}`;
|
|
175
|
-
|
|
176
|
-
const getBranchName = (options: { parentMessage?: ObjectId; toolCallId?: string }) => {
|
|
177
|
-
if (options.parentMessage && options.toolCallId) {
|
|
178
|
-
return `${options.parentMessage}_${options.toolCallId}`;
|
|
179
|
-
} else if (options.parentMessage) {
|
|
180
|
-
return options.parentMessage;
|
|
181
|
-
} else {
|
|
182
|
-
return 'main';
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
const getMessageBranch = (message: DataType.Message) => {
|
|
187
|
-
return getBranchName({
|
|
188
|
-
parentMessage: message.parentMessage,
|
|
189
|
-
toolCallId: message.properties?.[MESSAGE_PROPERTY_TOOL_CALL_ID],
|
|
190
|
-
});
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
const getParentId = (message: DataType.Message) => {
|
|
194
|
-
if (message.parentMessage && message.properties?.[MESSAGE_PROPERTY_TOOL_CALL_ID]) {
|
|
195
|
-
return getToolCallId(message.parentMessage, message.properties[MESSAGE_PROPERTY_TOOL_CALL_ID]);
|
|
196
|
-
} else {
|
|
197
|
-
return undefined;
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
const stringifyRef = (ref: Ref.Any) => {
|
|
202
|
-
if (ref.target) {
|
|
203
|
-
return stringifyObject(ref.target);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
return ref.dxn.asEchoDXN()?.echoId ?? ref.dxn.asQueueDXN()?.objectId ?? '';
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
const stringifyObject = (obj: Obj.Any) => {
|
|
210
|
-
return Obj.getLabel(obj) ?? Obj.getTypename(obj) ?? obj.id;
|
|
211
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Queue } from '@dxos/client/echo';
|
|
8
|
-
import { Obj, type Ref } from '@dxos/echo';
|
|
9
|
-
import { useQueue } from '@dxos/react-client/echo';
|
|
10
|
-
|
|
11
|
-
import { ExecutionGraph } from '../execution-graph';
|
|
12
|
-
|
|
13
|
-
export const useExecutionGraph = (queueRef?: Ref.Ref<Queue>, lastRequest = false) => {
|
|
14
|
-
const queue = useQueue(queueRef?.dxn);
|
|
15
|
-
return useMemo(() => {
|
|
16
|
-
const graph = new ExecutionGraph();
|
|
17
|
-
graph.addEvents(queue?.objects.filter(Obj.isObject) ?? []);
|
|
18
|
-
return graph.getGraph(lastRequest);
|
|
19
|
-
}, [queue?.objects, lastRequest]);
|
|
20
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Space } from '@dxos/client/echo';
|
|
8
|
-
import { Type } from '@dxos/echo';
|
|
9
|
-
import { type TypeaheadContext, matchCompletion, staticCompletion, typeahead } from '@dxos/react-ui-editor';
|
|
10
|
-
|
|
11
|
-
// TODO(burdon): Move def to @dxos/echo.
|
|
12
|
-
export const useMatcherExtension = (space: Space) => {
|
|
13
|
-
return useMemo(() => {
|
|
14
|
-
const handleComplete = ({ line }: TypeaheadContext) => {
|
|
15
|
-
const words = line.split(/\s+/).filter(Boolean);
|
|
16
|
-
if (words.length > 0) {
|
|
17
|
-
const word = words.at(-1)!;
|
|
18
|
-
|
|
19
|
-
// Match type.
|
|
20
|
-
const match = word.match(/^type:(.+)/);
|
|
21
|
-
if (match) {
|
|
22
|
-
const part = match[1];
|
|
23
|
-
for (const schema of space?.db.graph.schemaRegistry.schemas ?? []) {
|
|
24
|
-
const typename = Type.getTypename(schema);
|
|
25
|
-
if (typename) {
|
|
26
|
-
const completion = matchCompletion(typename, part);
|
|
27
|
-
if (completion) {
|
|
28
|
-
return completion;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Match static.
|
|
35
|
-
return staticCompletion(['type:', 'AND', 'OR', 'NOT'])({ line });
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return [
|
|
40
|
-
typeahead({
|
|
41
|
-
onComplete: handleComplete,
|
|
42
|
-
}),
|
|
43
|
-
];
|
|
44
|
-
}, [space]);
|
|
45
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useMemo, useSyncExternalStore } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Space } from '@dxos/client/echo';
|
|
8
|
-
import { type Ref } from '@dxos/echo';
|
|
9
|
-
|
|
10
|
-
// TODO(burdon): Factor out.
|
|
11
|
-
export const useResolvedRef = <T>(space: Space, ref: Ref.Ref<T>): T | undefined => {
|
|
12
|
-
const { subscribe, getSnapshot } = useMemo(() => {
|
|
13
|
-
const resolver = space.db.graph.createRefResolver({});
|
|
14
|
-
let currentCallback: (() => void) | undefined = undefined;
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
subscribe: (cb: () => void) => {
|
|
18
|
-
currentCallback = cb;
|
|
19
|
-
return () => {
|
|
20
|
-
if (currentCallback === cb) {
|
|
21
|
-
currentCallback = undefined;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
getSnapshot: () =>
|
|
26
|
-
resolver?.resolveSync(ref.dxn, true, () => {
|
|
27
|
-
currentCallback?.();
|
|
28
|
-
}) as T | undefined,
|
|
29
|
-
};
|
|
30
|
-
}, [space, ref.dxn.toString()]);
|
|
31
|
-
|
|
32
|
-
return useSyncExternalStore<T | undefined>(subscribe, getSnapshot);
|
|
33
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { describe, test } from 'vitest';
|
|
6
|
-
|
|
7
|
-
import { Filter } from '@dxos/echo';
|
|
8
|
-
|
|
9
|
-
import { createFilter } from './filter-generator';
|
|
10
|
-
import { QueryParser } from './query-parser';
|
|
11
|
-
|
|
12
|
-
describe('FilterGenerator', () => {
|
|
13
|
-
test('simple queries', ({ expect }) => {
|
|
14
|
-
const parser = new QueryParser('type:example.com/type/Person');
|
|
15
|
-
const ast = parser.parse();
|
|
16
|
-
expect(ast).toEqual({
|
|
17
|
-
type: 'binary',
|
|
18
|
-
operator: 'EQ',
|
|
19
|
-
left: {
|
|
20
|
-
type: 'identifier',
|
|
21
|
-
name: 'type',
|
|
22
|
-
},
|
|
23
|
-
right: {
|
|
24
|
-
type: 'literal',
|
|
25
|
-
value: 'example.com/type/Person',
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const filter = createFilter(ast);
|
|
30
|
-
expect(filter).toEqual(Filter.typename('example.com/type/Person'));
|
|
31
|
-
});
|
|
32
|
-
});
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Filter } from '@dxos/echo';
|
|
6
|
-
|
|
7
|
-
// TODO(burdon): Factor out.
|
|
8
|
-
|
|
9
|
-
import { type Expression, type Identifier, type Literal, type RelationalOperator } from './types';
|
|
10
|
-
|
|
11
|
-
const relationalOperators: Record<RelationalOperator, (value: any) => Filter<any>> = {
|
|
12
|
-
EQ: Filter.eq,
|
|
13
|
-
LT: Filter.lt,
|
|
14
|
-
GT: Filter.gt,
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const specialPredicates: Record<string, (value: string) => Filter<any>> = {
|
|
18
|
-
['type' as const]: Filter.typename,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const createFilter = (ast: Expression): Filter<any> => {
|
|
22
|
-
switch (ast.type) {
|
|
23
|
-
case 'binary': {
|
|
24
|
-
const { operator, left, right } = ast;
|
|
25
|
-
|
|
26
|
-
// Handle logical operators.
|
|
27
|
-
if (operator === 'AND') {
|
|
28
|
-
return Filter.and(createFilter(left), createFilter(right));
|
|
29
|
-
}
|
|
30
|
-
if (operator === 'OR') {
|
|
31
|
-
return Filter.or(createFilter(left), createFilter(right));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Handle special predicates (e.g., "type:Person")
|
|
35
|
-
const predicateName = (left as Identifier).name;
|
|
36
|
-
const specialFilter = specialPredicates[predicateName];
|
|
37
|
-
if (specialFilter) {
|
|
38
|
-
return specialFilter((right as Literal).value);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Handle relational operators
|
|
42
|
-
const filterFn = relationalOperators[operator];
|
|
43
|
-
if (filterFn) {
|
|
44
|
-
return filterFn((right as Literal).value);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
throw new Error(`Unsupported operator: ${operator}`);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
case 'unary': {
|
|
51
|
-
const { operator, argument } = ast;
|
|
52
|
-
if (operator === 'NOT') {
|
|
53
|
-
return Filter.not(createFilter(argument));
|
|
54
|
-
}
|
|
55
|
-
throw new Error(`Unsupported unary operator: ${operator}`);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
case 'identifier': {
|
|
59
|
-
const { name } = ast;
|
|
60
|
-
return Filter._props({ [name]: true });
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
case 'literal': {
|
|
64
|
-
const { value } = ast;
|
|
65
|
-
// Handle special '*' value for empty input.
|
|
66
|
-
if (value === '*') {
|
|
67
|
-
return Filter.everything();
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return Filter.eq(value);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
default:
|
|
74
|
-
throw new Error(`Unsupported expression type: ${(ast as any).type}`);
|
|
75
|
-
}
|
|
76
|
-
};
|
package/src/parser/index.ts
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { describe, test } from 'vitest';
|
|
6
|
-
|
|
7
|
-
import { QueryParser } from './query-parser';
|
|
8
|
-
|
|
9
|
-
describe('QueryParser', () => {
|
|
10
|
-
test('empty', ({ expect }) => {
|
|
11
|
-
const parser = new QueryParser('');
|
|
12
|
-
expect(parser.parse()).toEqual({
|
|
13
|
-
type: 'literal',
|
|
14
|
-
value: '*',
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
test('invalid queries', ({ expect }) => {
|
|
19
|
-
const cases = [
|
|
20
|
-
//
|
|
21
|
-
'!',
|
|
22
|
-
'X:',
|
|
23
|
-
':Y',
|
|
24
|
-
'X;Y',
|
|
25
|
-
'x==100',
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
for (const query of cases) {
|
|
29
|
-
const parser = new QueryParser(query);
|
|
30
|
-
expect(() => parser.parse()).toThrow();
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
test('valid queries', ({ expect }) => {
|
|
35
|
-
const cases = [
|
|
36
|
-
//
|
|
37
|
-
'',
|
|
38
|
-
'type:Person',
|
|
39
|
-
'$title = "foo"',
|
|
40
|
-
'(type:Person OR type:Organization) AND $title = "DXOS" AND $ts < TODAY',
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
for (const query of cases) {
|
|
44
|
-
const parser = new QueryParser(query);
|
|
45
|
-
expect(parser.parse()).to.exist;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
test('simple queries', ({ expect }) => {
|
|
50
|
-
const cases = [
|
|
51
|
-
{
|
|
52
|
-
query: 'type:Person',
|
|
53
|
-
ast: {
|
|
54
|
-
type: 'binary',
|
|
55
|
-
operator: 'EQ',
|
|
56
|
-
left: { type: 'identifier', name: 'type' },
|
|
57
|
-
right: { type: 'literal', value: 'Person' },
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
query: '$title = "DXOS"',
|
|
62
|
-
ast: {
|
|
63
|
-
type: 'binary',
|
|
64
|
-
operator: 'EQ',
|
|
65
|
-
left: { type: 'identifier', name: '$title' },
|
|
66
|
-
right: { type: 'literal', value: 'DXOS' },
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
query: '(type:Person OR type:Organization) AND $title = "DXOS" AND $ts < TODAY',
|
|
71
|
-
ast: {
|
|
72
|
-
left: {
|
|
73
|
-
left: {
|
|
74
|
-
left: {
|
|
75
|
-
left: {
|
|
76
|
-
name: 'type',
|
|
77
|
-
type: 'identifier',
|
|
78
|
-
},
|
|
79
|
-
operator: 'EQ',
|
|
80
|
-
right: {
|
|
81
|
-
type: 'literal',
|
|
82
|
-
value: 'Person',
|
|
83
|
-
},
|
|
84
|
-
type: 'binary',
|
|
85
|
-
},
|
|
86
|
-
operator: 'OR',
|
|
87
|
-
right: {
|
|
88
|
-
left: {
|
|
89
|
-
name: 'type',
|
|
90
|
-
type: 'identifier',
|
|
91
|
-
},
|
|
92
|
-
operator: 'EQ',
|
|
93
|
-
right: {
|
|
94
|
-
type: 'literal',
|
|
95
|
-
value: 'Organization',
|
|
96
|
-
},
|
|
97
|
-
type: 'binary',
|
|
98
|
-
},
|
|
99
|
-
type: 'binary',
|
|
100
|
-
},
|
|
101
|
-
operator: 'AND',
|
|
102
|
-
right: {
|
|
103
|
-
left: {
|
|
104
|
-
name: '$title',
|
|
105
|
-
type: 'identifier',
|
|
106
|
-
},
|
|
107
|
-
operator: 'EQ',
|
|
108
|
-
right: {
|
|
109
|
-
type: 'literal',
|
|
110
|
-
value: 'DXOS',
|
|
111
|
-
},
|
|
112
|
-
type: 'binary',
|
|
113
|
-
},
|
|
114
|
-
type: 'binary',
|
|
115
|
-
},
|
|
116
|
-
operator: 'AND',
|
|
117
|
-
right: {
|
|
118
|
-
left: {
|
|
119
|
-
name: '$ts',
|
|
120
|
-
type: 'identifier',
|
|
121
|
-
},
|
|
122
|
-
operator: 'LT',
|
|
123
|
-
right: {
|
|
124
|
-
type: 'literal',
|
|
125
|
-
value: 'TODAY',
|
|
126
|
-
},
|
|
127
|
-
type: 'binary',
|
|
128
|
-
},
|
|
129
|
-
type: 'binary',
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
];
|
|
133
|
-
|
|
134
|
-
for (const { query, ast } of cases) {
|
|
135
|
-
const parser = new QueryParser(query);
|
|
136
|
-
expect(parser.parse()).toEqual(ast);
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
});
|