@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,199 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { invariant } from '@dxos/invariant';
|
|
6
|
-
|
|
7
|
-
import { type BinaryOperator, type Expression, type RelationalOperator } from './types';
|
|
8
|
-
|
|
9
|
-
// TODO(burdon): Move to echo-schema?
|
|
10
|
-
|
|
11
|
-
type RelationalSymbol = '=' | '<' | '>';
|
|
12
|
-
|
|
13
|
-
const operators: Record<RelationalSymbol, RelationalOperator> = {
|
|
14
|
-
'=': 'EQ',
|
|
15
|
-
'<': 'LT',
|
|
16
|
-
'>': 'GT',
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export class QueryParser {
|
|
20
|
-
private tokens: string[] = [];
|
|
21
|
-
private current = 0;
|
|
22
|
-
|
|
23
|
-
constructor(input: string) {
|
|
24
|
-
// Tokenize the input string.
|
|
25
|
-
this.tokens = this.tokenize(input);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
private tokenize(input: string): string[] {
|
|
29
|
-
// Handle empty input.
|
|
30
|
-
if (!input.trim()) {
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Split on spaces but preserve quoted strings.
|
|
35
|
-
const tokens: string[] = [];
|
|
36
|
-
let current = '';
|
|
37
|
-
let inQuotes = false;
|
|
38
|
-
|
|
39
|
-
for (let i = 0; i < input.length; i++) {
|
|
40
|
-
const char = input[i];
|
|
41
|
-
|
|
42
|
-
if (char === '"') {
|
|
43
|
-
// Handle quoted strings.
|
|
44
|
-
inQuotes = !inQuotes;
|
|
45
|
-
current += char;
|
|
46
|
-
} else if (char === '(' || char === ')') {
|
|
47
|
-
// If we have accumulated tokens, add them first.
|
|
48
|
-
if (current) {
|
|
49
|
-
tokens.push(current);
|
|
50
|
-
current = '';
|
|
51
|
-
}
|
|
52
|
-
// Add the parenthesis as a separate token.
|
|
53
|
-
tokens.push(char);
|
|
54
|
-
} else if (operators[char as RelationalSymbol]) {
|
|
55
|
-
// If we have accumulated tokens, add them first.
|
|
56
|
-
if (current) {
|
|
57
|
-
tokens.push(current);
|
|
58
|
-
current = '';
|
|
59
|
-
}
|
|
60
|
-
// Add the operator as a separate token.
|
|
61
|
-
tokens.push(operators[char as RelationalSymbol]);
|
|
62
|
-
} else if (char === ' ' && !inQuotes) {
|
|
63
|
-
if (current) {
|
|
64
|
-
tokens.push(current);
|
|
65
|
-
current = '';
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
current += char;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (current) {
|
|
73
|
-
tokens.push(current);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return tokens;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
private peek(): string {
|
|
80
|
-
return this.tokens[this.current];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
private advance(): string {
|
|
84
|
-
return this.tokens[this.current++];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
private match(type: string): boolean {
|
|
88
|
-
if (this.peek() === type) {
|
|
89
|
-
this.advance();
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private isAtEnd(): boolean {
|
|
96
|
-
return this.current >= this.tokens.length;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
private parseExpression(): Expression {
|
|
100
|
-
let expr = this.parseTerm();
|
|
101
|
-
|
|
102
|
-
while (!this.isAtEnd()) {
|
|
103
|
-
const operator = this.peek();
|
|
104
|
-
if (operator === 'AND' || operator === 'OR') {
|
|
105
|
-
this.advance();
|
|
106
|
-
const right = this.parseTerm();
|
|
107
|
-
expr = {
|
|
108
|
-
type: 'binary',
|
|
109
|
-
operator: operator as BinaryOperator,
|
|
110
|
-
left: expr,
|
|
111
|
-
right,
|
|
112
|
-
};
|
|
113
|
-
} else {
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return expr;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
private parseTerm(): Expression {
|
|
122
|
-
// Handle NOT operator
|
|
123
|
-
if (this.peek() === 'NOT') {
|
|
124
|
-
this.advance();
|
|
125
|
-
const argument = this.parseTerm();
|
|
126
|
-
return {
|
|
127
|
-
type: 'unary',
|
|
128
|
-
operator: 'NOT',
|
|
129
|
-
argument,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Handle parentheses.
|
|
134
|
-
if (this.match('(')) {
|
|
135
|
-
const expr = this.parseExpression();
|
|
136
|
-
if (!this.match(')')) {
|
|
137
|
-
throw new Error('Expected closing parenthesis');
|
|
138
|
-
}
|
|
139
|
-
return expr;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const token = this.peek();
|
|
143
|
-
|
|
144
|
-
// Handle type:Person style expressions.
|
|
145
|
-
if (token.includes(':')) {
|
|
146
|
-
const [field, value] = token.split(':');
|
|
147
|
-
this.advance();
|
|
148
|
-
if (!field || !value) {
|
|
149
|
-
throw new Error(`Invalid type expression: ${token}`);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return {
|
|
153
|
-
type: 'binary',
|
|
154
|
-
operator: 'EQ',
|
|
155
|
-
left: { type: 'identifier', name: field },
|
|
156
|
-
right: { type: 'literal', value },
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Handle $field expressions with operators.
|
|
161
|
-
if (token.startsWith('$')) {
|
|
162
|
-
const field = token;
|
|
163
|
-
this.advance();
|
|
164
|
-
|
|
165
|
-
// Get the operator.
|
|
166
|
-
const operator = this.peek();
|
|
167
|
-
if (operator !== 'EQ' && operator !== 'LT' && operator !== 'GT') {
|
|
168
|
-
throw new Error(`Expected operator after field ${field}, got ${operator}`);
|
|
169
|
-
}
|
|
170
|
-
this.advance();
|
|
171
|
-
|
|
172
|
-
// Get the value
|
|
173
|
-
const value = this.peek();
|
|
174
|
-
this.advance();
|
|
175
|
-
invariant(value);
|
|
176
|
-
|
|
177
|
-
return {
|
|
178
|
-
type: 'binary',
|
|
179
|
-
operator: operator as BinaryOperator,
|
|
180
|
-
left: { type: 'identifier', name: field },
|
|
181
|
-
right: { type: 'literal', value: value.replace(/^"|"$/g, '') },
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
throw new Error(`Unexpected token: ${token}`);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
public parse(): Expression {
|
|
189
|
-
// Return a special expression for empty input.
|
|
190
|
-
if (this.tokens.length === 0) {
|
|
191
|
-
return {
|
|
192
|
-
type: 'literal',
|
|
193
|
-
value: '*',
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return this.parseExpression();
|
|
198
|
-
}
|
|
199
|
-
}
|
package/src/parser/types.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
// TODO(burdon): Factor out.
|
|
6
|
-
|
|
7
|
-
export type UnaryOperator = 'NOT';
|
|
8
|
-
|
|
9
|
-
export type RelationalOperator = 'EQ' | 'LT' | 'GT';
|
|
10
|
-
|
|
11
|
-
export type BinaryOperator = RelationalOperator | 'AND' | 'OR';
|
|
12
|
-
|
|
13
|
-
export type Expression = BinaryExpression | UnaryExpression | Identifier | Literal;
|
|
14
|
-
|
|
15
|
-
export interface BinaryExpression {
|
|
16
|
-
type: 'binary';
|
|
17
|
-
operator: BinaryOperator;
|
|
18
|
-
left: Expression;
|
|
19
|
-
right: Expression;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface UnaryExpression {
|
|
23
|
-
type: 'unary';
|
|
24
|
-
operator: UnaryOperator;
|
|
25
|
-
argument: Expression;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface Identifier {
|
|
29
|
-
type: 'identifier';
|
|
30
|
-
name: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface Literal {
|
|
34
|
-
type: 'literal';
|
|
35
|
-
value: string;
|
|
36
|
-
}
|
|
@@ -1,469 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
-
import React, { type FC, useCallback } from 'react';
|
|
9
|
-
|
|
10
|
-
import { EXA_API_KEY } from '@dxos/ai/testing';
|
|
11
|
-
import { Capabilities, useCapabilities } from '@dxos/app-framework';
|
|
12
|
-
import { AiContextBinder } from '@dxos/assistant';
|
|
13
|
-
import { LINEAR_BLUEPRINT, RESEARCH_BLUEPRINT, ResearchDataTypes, ResearchGraph } from '@dxos/assistant-testing';
|
|
14
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
15
|
-
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
16
|
-
import { log } from '@dxos/log';
|
|
17
|
-
import { Board, BoardPlugin } from '@dxos/plugin-board';
|
|
18
|
-
import { Chess, ChessPlugin } from '@dxos/plugin-chess';
|
|
19
|
-
import { InboxPlugin } from '@dxos/plugin-inbox';
|
|
20
|
-
import { Mailbox } from '@dxos/plugin-inbox/types';
|
|
21
|
-
import { Map, MapPlugin } from '@dxos/plugin-map';
|
|
22
|
-
import { createLocationSchema } from '@dxos/plugin-map/testing';
|
|
23
|
-
import { Markdown, MarkdownPlugin } from '@dxos/plugin-markdown';
|
|
24
|
-
import { TablePlugin } from '@dxos/plugin-table';
|
|
25
|
-
import { ThreadPlugin } from '@dxos/plugin-thread';
|
|
26
|
-
import { TokenManagerPlugin } from '@dxos/plugin-token-manager';
|
|
27
|
-
import { TranscriptionPlugin } from '@dxos/plugin-transcription';
|
|
28
|
-
import { Transcript } from '@dxos/plugin-transcription/types';
|
|
29
|
-
import { useClient } from '@dxos/react-client';
|
|
30
|
-
import { useSpace } from '@dxos/react-client/echo';
|
|
31
|
-
import { useAsyncEffect } from '@dxos/react-ui';
|
|
32
|
-
import { Table } from '@dxos/react-ui-table/types';
|
|
33
|
-
import { DataType } from '@dxos/schema';
|
|
34
|
-
import { render } from '@dxos/storybook-utils';
|
|
35
|
-
import { isNonNullable, trim } from '@dxos/util';
|
|
36
|
-
|
|
37
|
-
import { BLUEPRINT_KEY } from '../capabilities';
|
|
38
|
-
import { createTestMailbox, createTestTranscription } from '../testing';
|
|
39
|
-
import { translations } from '../translations';
|
|
40
|
-
import { Assistant } from '../types';
|
|
41
|
-
|
|
42
|
-
import {
|
|
43
|
-
BlueprintContainer,
|
|
44
|
-
ChatContainer,
|
|
45
|
-
CommentsContainer,
|
|
46
|
-
type ComponentProps,
|
|
47
|
-
GraphContainer,
|
|
48
|
-
LoggingContainer,
|
|
49
|
-
MessageContainer,
|
|
50
|
-
SurfaceContainer,
|
|
51
|
-
TasksContainer,
|
|
52
|
-
TokenManagerContainer,
|
|
53
|
-
} from './components';
|
|
54
|
-
import { accessTokensFromEnv, addTestData, config, getDecorators, testTypes } from './testing';
|
|
55
|
-
|
|
56
|
-
const panelClassNames = 'flex flex-col overflow-hidden bg-baseSurface rounded border border-separator';
|
|
57
|
-
|
|
58
|
-
const DefaultStory = ({
|
|
59
|
-
debug = true,
|
|
60
|
-
components,
|
|
61
|
-
blueprints = [],
|
|
62
|
-
}: {
|
|
63
|
-
debug?: boolean;
|
|
64
|
-
components: (FC<ComponentProps> | FC<ComponentProps>[])[];
|
|
65
|
-
blueprints?: string[];
|
|
66
|
-
}) => {
|
|
67
|
-
const client = useClient();
|
|
68
|
-
const space = useSpace();
|
|
69
|
-
|
|
70
|
-
const blueprintsDefinitions = useCapabilities(Capabilities.BlueprintDefinition);
|
|
71
|
-
useAsyncEffect(async () => {
|
|
72
|
-
if (!space) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const { objects: chats = [] } = await space.db.query(Filter.type(Assistant.Chat)).run();
|
|
76
|
-
const chat = chats[0];
|
|
77
|
-
if (!chat) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Add blueprints to context.
|
|
82
|
-
const binder = new AiContextBinder(await chat.queue.load());
|
|
83
|
-
const registry = new Blueprint.Registry(blueprintsDefinitions);
|
|
84
|
-
const blueprintObjects = blueprints
|
|
85
|
-
.map((key) => {
|
|
86
|
-
const blueprint = registry.getByKey(key);
|
|
87
|
-
if (blueprint) {
|
|
88
|
-
return space.db.add(Obj.clone(blueprint));
|
|
89
|
-
}
|
|
90
|
-
})
|
|
91
|
-
.filter(isNonNullable);
|
|
92
|
-
await binder.bind({ blueprints: blueprintObjects.map((blueprint) => Ref.make(blueprint)) });
|
|
93
|
-
}, [space, blueprints, blueprintsDefinitions]);
|
|
94
|
-
|
|
95
|
-
const handleEvent = useCallback<NonNullable<ComponentProps['onEvent']>>((event) => {
|
|
96
|
-
log.info('event', { event });
|
|
97
|
-
switch (event) {
|
|
98
|
-
case 'reset': {
|
|
99
|
-
void client?.reset().then(() => {
|
|
100
|
-
document.location.reload();
|
|
101
|
-
});
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}, []);
|
|
106
|
-
|
|
107
|
-
if (!space) {
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return (
|
|
112
|
-
<div
|
|
113
|
-
className='grid grid-cols gap-2 m-2'
|
|
114
|
-
style={{ gridTemplateColumns: `repeat(${components.length}, minmax(0, 40rem))` }}
|
|
115
|
-
>
|
|
116
|
-
{components.map((Component, index) =>
|
|
117
|
-
Array.isArray(Component) ? (
|
|
118
|
-
<div
|
|
119
|
-
key={index}
|
|
120
|
-
className='grid grid-rows gap-2 overflow-hidden'
|
|
121
|
-
style={{ gridTemplateRows: `repeat(${Component.length}, 1fr)` }}
|
|
122
|
-
>
|
|
123
|
-
{Component.map((Component, index) => (
|
|
124
|
-
<div key={index} className={panelClassNames}>
|
|
125
|
-
<Component space={space} debug={debug} onEvent={handleEvent} />
|
|
126
|
-
</div>
|
|
127
|
-
))}
|
|
128
|
-
</div>
|
|
129
|
-
) : (
|
|
130
|
-
<div key={index} className={panelClassNames}>
|
|
131
|
-
<Component space={space} debug={debug} onEvent={handleEvent} />
|
|
132
|
-
</div>
|
|
133
|
-
),
|
|
134
|
-
)}
|
|
135
|
-
</div>
|
|
136
|
-
);
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const storybook: Meta<typeof DefaultStory> = {
|
|
140
|
-
title: 'plugins/plugin-assistant/Chat',
|
|
141
|
-
render: render(DefaultStory),
|
|
142
|
-
parameters: {
|
|
143
|
-
translations,
|
|
144
|
-
controls: { disable: true },
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
export default storybook;
|
|
149
|
-
|
|
150
|
-
type Story = StoryObj<typeof storybook>;
|
|
151
|
-
|
|
152
|
-
//
|
|
153
|
-
// Stories
|
|
154
|
-
//
|
|
155
|
-
|
|
156
|
-
const MARKDOWN_DOCUMENT = trim`
|
|
157
|
-
# Hello, world!
|
|
158
|
-
|
|
159
|
-
This is a test document that contains Markdown content. Markdown is a lightweight markup language for writing formatted text in plain text form. Its goal is to be easy to read and write in raw form, easy to convert to HTML.
|
|
160
|
-
|
|
161
|
-
Markdown’s simplicity makes it highly adaptable: it can be written in any text editor, stored in plain .md files, and rendered into HTML, PDF, or other formats with converters. Because of this portability, it’s widely used in software documentation, static site generators, technical blogging, and collaborative platforms like GitHub and Notion.
|
|
162
|
-
|
|
163
|
-
Many applications extend the core syntax with extras (e.g., tables, task lists, math notation), but the core idea remains the same—clean, minimal markup that stays readable even without rendering.
|
|
164
|
-
`;
|
|
165
|
-
|
|
166
|
-
const STYLE_GUIDE = trim`
|
|
167
|
-
# Style Guide
|
|
168
|
-
- Use short, simple sentences.
|
|
169
|
-
- Organize content with headings and bullet points.
|
|
170
|
-
- Avoid jargon and explain technical terms.
|
|
171
|
-
- Use active voice whenever possible.
|
|
172
|
-
- Highlight key points in bold.
|
|
173
|
-
- Keep paragraphs brief and focused on one idea.
|
|
174
|
-
- Proofread for clarity and correctness.
|
|
175
|
-
`;
|
|
176
|
-
|
|
177
|
-
const addSpellingMistakes = (text: string, n: number): string => {
|
|
178
|
-
const words = text.split(' ');
|
|
179
|
-
for (let i = 0; i < n; i++) {
|
|
180
|
-
const idx = Math.floor(Math.random() * words.length);
|
|
181
|
-
const word = words[idx];
|
|
182
|
-
const charIdx = Math.floor(Math.random() * word.length);
|
|
183
|
-
const typoChar = String.fromCharCode(word.charCodeAt(charIdx) + 1);
|
|
184
|
-
words[idx] = word.slice(0, charIdx) + typoChar + word.slice(charIdx + 1);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return words.join(' ');
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
export const Default: Story = {
|
|
191
|
-
decorators: getDecorators({
|
|
192
|
-
plugins: [MarkdownPlugin()],
|
|
193
|
-
config: config.remote,
|
|
194
|
-
}),
|
|
195
|
-
args: {
|
|
196
|
-
components: [ChatContainer, SurfaceContainer],
|
|
197
|
-
},
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
// Test with prompt: Propose changes to my document based on the style guide.
|
|
201
|
-
export const WithDocument: Story = {
|
|
202
|
-
decorators: getDecorators({
|
|
203
|
-
plugins: [MarkdownPlugin(), ThreadPlugin()],
|
|
204
|
-
config: config.remote, // TODO(burdon): Issue making persistent.
|
|
205
|
-
onInit: async ({ space, binder }) => {
|
|
206
|
-
const doc = space.db.add(
|
|
207
|
-
Markdown.makeDocument({
|
|
208
|
-
name: 'My Document',
|
|
209
|
-
content: addSpellingMistakes(MARKDOWN_DOCUMENT, 2),
|
|
210
|
-
}),
|
|
211
|
-
);
|
|
212
|
-
const styleGuide = space.db.add(
|
|
213
|
-
Markdown.makeDocument({
|
|
214
|
-
name: 'Style Guide',
|
|
215
|
-
content: STYLE_GUIDE,
|
|
216
|
-
}),
|
|
217
|
-
);
|
|
218
|
-
await binder.bind({ objects: [Ref.make(doc), Ref.make(styleGuide)] });
|
|
219
|
-
},
|
|
220
|
-
}),
|
|
221
|
-
args: {
|
|
222
|
-
components: [ChatContainer, [SurfaceContainer, CommentsContainer, LoggingContainer]],
|
|
223
|
-
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/markdown'],
|
|
224
|
-
},
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
export const WithBlueprints: Story = {
|
|
228
|
-
decorators: getDecorators({
|
|
229
|
-
plugins: [InboxPlugin(), MarkdownPlugin(), TablePlugin()],
|
|
230
|
-
config: config.remote,
|
|
231
|
-
onInit: async ({ space, binder }) => {
|
|
232
|
-
const object = space.db.add(Markdown.makeDocument({ name: 'Tasks' }));
|
|
233
|
-
await binder.bind({ objects: [Ref.make(object)] });
|
|
234
|
-
},
|
|
235
|
-
}),
|
|
236
|
-
args: {
|
|
237
|
-
components: [ChatContainer, [TasksContainer, BlueprintContainer]],
|
|
238
|
-
},
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
export const WithChess: Story = {
|
|
242
|
-
decorators: getDecorators({
|
|
243
|
-
plugins: [ChessPlugin()],
|
|
244
|
-
config: config.remote,
|
|
245
|
-
types: [Chess.Game],
|
|
246
|
-
onInit: async ({ space, binder }) => {
|
|
247
|
-
// TODO(burdon): Add player DID (for user and assistant).
|
|
248
|
-
const object = space.db.add(
|
|
249
|
-
Chess.makeGame({
|
|
250
|
-
name: 'Challenge',
|
|
251
|
-
pgn: [
|
|
252
|
-
'1. e4 e5',
|
|
253
|
-
'2. Nf3 Nc6',
|
|
254
|
-
'3. Bc4 Bc5',
|
|
255
|
-
'4. c3 Nf6',
|
|
256
|
-
'5. d4 exd4',
|
|
257
|
-
'6. cxd4 Bb4+',
|
|
258
|
-
'7. Nc3 d5',
|
|
259
|
-
'8. exd5 Nxd5',
|
|
260
|
-
'9. O-O Be6',
|
|
261
|
-
'10. Qb3 Na5',
|
|
262
|
-
'11. Qa4+ c6',
|
|
263
|
-
'12. Bxd5 Bxc3',
|
|
264
|
-
'13. Bxe6 fxe6',
|
|
265
|
-
'*',
|
|
266
|
-
].join(' '),
|
|
267
|
-
}),
|
|
268
|
-
);
|
|
269
|
-
await binder.bind({ objects: [Ref.make(object)] });
|
|
270
|
-
},
|
|
271
|
-
}),
|
|
272
|
-
args: {
|
|
273
|
-
components: [ChatContainer, [SurfaceContainer, LoggingContainer]],
|
|
274
|
-
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/chess'],
|
|
275
|
-
},
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
// Test with prompt: Summarize my mailbox and write the summary in a new document.
|
|
279
|
-
export const WithMail: Story = {
|
|
280
|
-
decorators: getDecorators({
|
|
281
|
-
plugins: [InboxPlugin(), MarkdownPlugin(), ThreadPlugin()],
|
|
282
|
-
config: config.remote,
|
|
283
|
-
types: [Mailbox.Mailbox],
|
|
284
|
-
onInit: async ({ space, binder }) => {
|
|
285
|
-
const queue = space.queues.create();
|
|
286
|
-
const messages = createTestMailbox();
|
|
287
|
-
await queue.append(messages);
|
|
288
|
-
const mailbox = space.db.add(Mailbox.make({ name: 'Mailbox', queue: queue.dxn }));
|
|
289
|
-
await binder.bind({ objects: [Ref.make(mailbox)] });
|
|
290
|
-
},
|
|
291
|
-
}),
|
|
292
|
-
args: {
|
|
293
|
-
components: [ChatContainer, [SurfaceContainer, MessageContainer]],
|
|
294
|
-
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/inbox'],
|
|
295
|
-
},
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
export const WithGmail: Story = {
|
|
299
|
-
decorators: getDecorators({
|
|
300
|
-
plugins: [InboxPlugin(), TokenManagerPlugin()],
|
|
301
|
-
config: config.remote,
|
|
302
|
-
types: [Mailbox.Mailbox],
|
|
303
|
-
onInit: async ({ space, binder }) => {
|
|
304
|
-
const queue = space.queues.create();
|
|
305
|
-
const mailbox = space.db.add(Mailbox.make({ name: 'Mailbox', queue: queue.dxn }));
|
|
306
|
-
await binder.bind({ objects: [Ref.make(mailbox)] });
|
|
307
|
-
},
|
|
308
|
-
}),
|
|
309
|
-
args: {
|
|
310
|
-
components: [ChatContainer, [SurfaceContainer, MessageContainer, TokenManagerContainer]],
|
|
311
|
-
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/inbox'],
|
|
312
|
-
},
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
// Test with prompt: Create 10 locations.
|
|
316
|
-
export const WithMap: Story = {
|
|
317
|
-
decorators: getDecorators({
|
|
318
|
-
plugins: [MapPlugin(), TablePlugin()],
|
|
319
|
-
config: config.remote,
|
|
320
|
-
types: [DataType.View, Map.Map, Table.Table],
|
|
321
|
-
onInit: async ({ space, binder }) => {
|
|
322
|
-
const [schema] = await space.db.schemaRegistry.register([createLocationSchema()]);
|
|
323
|
-
const { view: tableView } = await Table.makeView({ name: 'Table', space, typename: schema.typename });
|
|
324
|
-
const { view: mapView } = await Map.makeView({
|
|
325
|
-
name: 'Map',
|
|
326
|
-
space,
|
|
327
|
-
typename: schema.typename,
|
|
328
|
-
pivotFieldName: 'location',
|
|
329
|
-
});
|
|
330
|
-
space.db.add(tableView);
|
|
331
|
-
space.db.add(mapView);
|
|
332
|
-
await binder.bind({ objects: [Ref.make(tableView), Ref.make(mapView)] });
|
|
333
|
-
},
|
|
334
|
-
}),
|
|
335
|
-
args: {
|
|
336
|
-
components: [ChatContainer, SurfaceContainer],
|
|
337
|
-
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/map'],
|
|
338
|
-
},
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
export const WithTrip: Story = {
|
|
342
|
-
decorators: getDecorators({
|
|
343
|
-
plugins: [MarkdownPlugin(), MapPlugin()],
|
|
344
|
-
config: config.remote,
|
|
345
|
-
types: [Map.Map],
|
|
346
|
-
onInit: async ({ space, binder }) => {
|
|
347
|
-
// TODO(burdon): Table.
|
|
348
|
-
{
|
|
349
|
-
const object = space.db.add(Map.make({ name: 'Trip' }));
|
|
350
|
-
await binder.bind({ objects: [Ref.make(object)] });
|
|
351
|
-
}
|
|
352
|
-
{
|
|
353
|
-
const object = space.db.add(
|
|
354
|
-
Markdown.makeDocument({
|
|
355
|
-
name: 'Itinerary',
|
|
356
|
-
content: trim`
|
|
357
|
-
# Itinerary
|
|
358
|
-
|
|
359
|
-
## Day 1
|
|
360
|
-
- Visit the Sagrada Familia
|
|
361
|
-
- Visit the Park Güell
|
|
362
|
-
- Visit the Casa Batlló
|
|
363
|
-
|
|
364
|
-
## Day 2
|
|
365
|
-
- Visit the Eiffel Tower
|
|
366
|
-
- Visit the Louvre
|
|
367
|
-
- Visit the Musée d'Orsay
|
|
368
|
-
`,
|
|
369
|
-
}),
|
|
370
|
-
);
|
|
371
|
-
await binder.bind({ objects: [Ref.make(object)] });
|
|
372
|
-
}
|
|
373
|
-
{
|
|
374
|
-
const object = space.db.add(
|
|
375
|
-
Markdown.makeDocument({
|
|
376
|
-
name: 'Barcelona',
|
|
377
|
-
content: trim`
|
|
378
|
-
# Barcelona
|
|
379
|
-
|
|
380
|
-
Barcelona is the capital and most populous city of Catalonia, an autonomous community in northeastern Spain.
|
|
381
|
-
It is located on the Mediterranean coast, on the banks of the Llobregat River, in the comarca of the Baix Llobregat.
|
|
382
|
-
The city is known for its rich history, vibrant culture, and stunning architecture, including the Sagrada Familia, Park Güell, and Casa Batlló.
|
|
383
|
-
`,
|
|
384
|
-
}),
|
|
385
|
-
);
|
|
386
|
-
await binder.bind({ objects: [Ref.make(object)] });
|
|
387
|
-
}
|
|
388
|
-
},
|
|
389
|
-
}),
|
|
390
|
-
args: {
|
|
391
|
-
components: [ChatContainer, SurfaceContainer],
|
|
392
|
-
},
|
|
393
|
-
};
|
|
394
|
-
|
|
395
|
-
export const WithBoard: Story = {
|
|
396
|
-
decorators: getDecorators({
|
|
397
|
-
plugins: [BoardPlugin()],
|
|
398
|
-
config: config.remote,
|
|
399
|
-
types: [Board.Board],
|
|
400
|
-
onInit: async ({ space, binder }) => {
|
|
401
|
-
const object = space.db.add(Board.makeBoard());
|
|
402
|
-
await binder.bind({ objects: [Ref.make(object)] });
|
|
403
|
-
},
|
|
404
|
-
}),
|
|
405
|
-
args: {
|
|
406
|
-
debug: true,
|
|
407
|
-
components: [ChatContainer, SurfaceContainer],
|
|
408
|
-
},
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
export const WithResearch: Story = {
|
|
412
|
-
decorators: getDecorators({
|
|
413
|
-
plugins: [MarkdownPlugin(), TablePlugin()],
|
|
414
|
-
config: config.persistent,
|
|
415
|
-
types: [...ResearchDataTypes, ResearchGraph],
|
|
416
|
-
accessTokens: [Obj.make(DataType.AccessToken, { source: 'exa.ai', token: EXA_API_KEY })],
|
|
417
|
-
}),
|
|
418
|
-
args: {
|
|
419
|
-
components: [ChatContainer, [GraphContainer, LoggingContainer]],
|
|
420
|
-
blueprints: [RESEARCH_BLUEPRINT.key],
|
|
421
|
-
},
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
export const WithSearch: Story = {
|
|
425
|
-
decorators: getDecorators({
|
|
426
|
-
config: config.remote,
|
|
427
|
-
types: testTypes,
|
|
428
|
-
onInit: async ({ space }) => {
|
|
429
|
-
await addTestData(space);
|
|
430
|
-
},
|
|
431
|
-
}),
|
|
432
|
-
args: {
|
|
433
|
-
components: [ChatContainer, [GraphContainer, LoggingContainer]],
|
|
434
|
-
},
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
export const WithTranscription: Story = {
|
|
438
|
-
decorators: getDecorators({
|
|
439
|
-
plugins: [TranscriptionPlugin()],
|
|
440
|
-
config: config.remote,
|
|
441
|
-
types: [Transcript.Transcript],
|
|
442
|
-
onInit: async ({ space, binder }) => {
|
|
443
|
-
const queue = space.queues.create();
|
|
444
|
-
const messages = createTestTranscription();
|
|
445
|
-
await queue.append(messages);
|
|
446
|
-
const transcript = space.db.add(Transcript.makeTranscript(queue.dxn));
|
|
447
|
-
await binder.bind({ objects: [Ref.make(transcript)] });
|
|
448
|
-
},
|
|
449
|
-
}),
|
|
450
|
-
args: {
|
|
451
|
-
components: [ChatContainer, [SurfaceContainer, LoggingContainer]],
|
|
452
|
-
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/transcription'],
|
|
453
|
-
},
|
|
454
|
-
};
|
|
455
|
-
|
|
456
|
-
export const WithLinearSync: Story = {
|
|
457
|
-
decorators: getDecorators({
|
|
458
|
-
plugins: [],
|
|
459
|
-
config: config.remote,
|
|
460
|
-
types: [DataType.Task, DataType.Person, DataType.Project],
|
|
461
|
-
accessTokens: accessTokensFromEnv({
|
|
462
|
-
'linear.app': import.meta.env.VITE_LINEAR_API_KEY,
|
|
463
|
-
}),
|
|
464
|
-
}),
|
|
465
|
-
args: {
|
|
466
|
-
components: [ChatContainer, [GraphContainer]],
|
|
467
|
-
blueprints: [LINEAR_BLUEPRINT.key],
|
|
468
|
-
},
|
|
469
|
-
};
|