@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
|
@@ -6,21 +6,20 @@ import { type Extension, Prec } from '@codemirror/state';
|
|
|
6
6
|
import { keymap } from '@codemirror/view';
|
|
7
7
|
import { useRxValue } from '@effect-rx/rx-react';
|
|
8
8
|
import { createContext } from '@radix-ui/react-context';
|
|
9
|
-
import
|
|
9
|
+
import * as Array from 'effect/Array';
|
|
10
|
+
import * as Option from 'effect/Option';
|
|
10
11
|
import React, { type PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
11
12
|
|
|
12
13
|
import { Event } from '@dxos/async';
|
|
13
14
|
import { Obj } from '@dxos/echo';
|
|
14
|
-
import { log } from '@dxos/log';
|
|
15
15
|
import { useVoiceInput } from '@dxos/plugin-transcription';
|
|
16
16
|
import { type Space, getSpace, useQueue } from '@dxos/react-client/echo';
|
|
17
17
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
18
|
-
import { Input, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
18
|
+
import { Input, type ThemedClassName, useDynamicRef, useTranslation } from '@dxos/react-ui';
|
|
19
19
|
import { ChatEditor, type ChatEditorController, type ChatEditorProps, references } from '@dxos/react-ui-chat';
|
|
20
|
-
import { type ScrollController } from '@dxos/react-ui-components';
|
|
21
20
|
import { mx } from '@dxos/react-ui-theme';
|
|
22
21
|
import { DataType } from '@dxos/schema';
|
|
23
|
-
import {
|
|
22
|
+
import { isTruthy } from '@dxos/util';
|
|
24
23
|
|
|
25
24
|
import { useReferencesProvider } from '../../hooks';
|
|
26
25
|
import { meta } from '../../meta';
|
|
@@ -34,7 +33,11 @@ import {
|
|
|
34
33
|
ChatReferences,
|
|
35
34
|
ChatStatusIndicator,
|
|
36
35
|
} from '../ChatPrompt';
|
|
37
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
type ChatThreadController,
|
|
38
|
+
ChatThread as NaturalChatThread,
|
|
39
|
+
type ChatThreadProps as NaturalChatThreadProps,
|
|
40
|
+
} from '../ChatThread';
|
|
38
41
|
|
|
39
42
|
import { type ChatEvent } from './events';
|
|
40
43
|
|
|
@@ -53,7 +56,6 @@ type ChatContextValue = {
|
|
|
53
56
|
processor: AiChatProcessor;
|
|
54
57
|
};
|
|
55
58
|
|
|
56
|
-
// NOTE: Do not export.
|
|
57
59
|
export const [ChatContextProvider, useChatContext] = createContext<ChatContextValue>('Chat');
|
|
58
60
|
|
|
59
61
|
//
|
|
@@ -76,7 +78,6 @@ const ChatRoot = ({ classNames, children, chat, processor, onEvent, ...props }:
|
|
|
76
78
|
const queue = useQueue<DataType.Message>(chat?.queue.dxn);
|
|
77
79
|
const pending = useRxValue(processor.messages);
|
|
78
80
|
const streaming = useRxValue(processor.streaming);
|
|
79
|
-
|
|
80
81
|
const lastPrompt = useRef<string | undefined>(undefined);
|
|
81
82
|
|
|
82
83
|
const messages = useMemo(() => {
|
|
@@ -90,18 +91,15 @@ const ChatRoot = ({ classNames, children, chat, processor, onEvent, ...props }:
|
|
|
90
91
|
return event.on((ev) => {
|
|
91
92
|
switch (ev.type) {
|
|
92
93
|
case 'toggle-debug': {
|
|
93
|
-
setDebug((current) =>
|
|
94
|
-
const debug = !current;
|
|
95
|
-
log.info('toggle-debug', { debug });
|
|
96
|
-
return debug;
|
|
97
|
-
});
|
|
94
|
+
setDebug((current) => !current);
|
|
98
95
|
break;
|
|
99
96
|
}
|
|
100
97
|
|
|
101
98
|
case 'submit': {
|
|
102
|
-
|
|
99
|
+
const text = ev.text.trim();
|
|
100
|
+
if (!streaming && text.length) {
|
|
103
101
|
lastPrompt.current = ev.text;
|
|
104
|
-
void processor.request({ message:
|
|
102
|
+
void processor.request({ message: text });
|
|
105
103
|
}
|
|
106
104
|
break;
|
|
107
105
|
}
|
|
@@ -140,11 +138,11 @@ const ChatRoot = ({ classNames, children, chat, processor, onEvent, ...props }:
|
|
|
140
138
|
event={event}
|
|
141
139
|
chat={chat}
|
|
142
140
|
space={space}
|
|
143
|
-
processor={processor}
|
|
144
141
|
messages={messages}
|
|
142
|
+
processor={processor}
|
|
145
143
|
{...props}
|
|
146
144
|
>
|
|
147
|
-
<div role='none' className={mx('flex flex-col
|
|
145
|
+
<div role='none' className={mx('flex flex-col bs-full is-full', classNames)}>
|
|
148
146
|
{children}
|
|
149
147
|
</div>
|
|
150
148
|
</ChatContextProvider>
|
|
@@ -160,6 +158,7 @@ ChatRoot.displayName = 'Chat.Root';
|
|
|
160
158
|
type ChatPromptProps = ThemedClassName<
|
|
161
159
|
{
|
|
162
160
|
outline?: boolean;
|
|
161
|
+
settings?: boolean;
|
|
163
162
|
} & Pick<ChatEditorProps, 'placeholder'> &
|
|
164
163
|
Omit<ChatPresetsProps, 'onChange'> & {
|
|
165
164
|
expandable?: boolean;
|
|
@@ -172,6 +171,7 @@ type ChatPromptProps = ThemedClassName<
|
|
|
172
171
|
const ChatPrompt = ({
|
|
173
172
|
classNames,
|
|
174
173
|
outline,
|
|
174
|
+
settings = true,
|
|
175
175
|
placeholder,
|
|
176
176
|
expandable,
|
|
177
177
|
online,
|
|
@@ -185,11 +185,11 @@ const ChatPrompt = ({
|
|
|
185
185
|
|
|
186
186
|
const error = useRxValue(processor.error).pipe(Option.getOrUndefined);
|
|
187
187
|
const streaming = useRxValue(processor.streaming);
|
|
188
|
-
const
|
|
188
|
+
const active = useRxValue(processor.active);
|
|
189
|
+
const activeRef = useDynamicRef(active);
|
|
189
190
|
|
|
190
191
|
const editorRef = useRef<ChatEditorController>(null);
|
|
191
|
-
|
|
192
|
-
const [active, setActive] = useState(false);
|
|
192
|
+
const [recordingState, setRecordingState] = useState(false);
|
|
193
193
|
useEffect(() => {
|
|
194
194
|
return event.on((event) => {
|
|
195
195
|
switch (event.type) {
|
|
@@ -200,10 +200,10 @@ const ChatPrompt = ({
|
|
|
200
200
|
}
|
|
201
201
|
break;
|
|
202
202
|
case 'record-start':
|
|
203
|
-
|
|
203
|
+
setRecordingState(true);
|
|
204
204
|
break;
|
|
205
205
|
case 'record-stop':
|
|
206
|
-
|
|
206
|
+
setRecordingState(false);
|
|
207
207
|
break;
|
|
208
208
|
}
|
|
209
209
|
});
|
|
@@ -211,7 +211,7 @@ const ChatPrompt = ({
|
|
|
211
211
|
|
|
212
212
|
// TODO(burdon): Configure capability in TranscriptionPlugin.
|
|
213
213
|
const { recording } = useVoiceInput({
|
|
214
|
-
active,
|
|
214
|
+
active: recordingState,
|
|
215
215
|
onUpdate: (text) => {
|
|
216
216
|
editorRef.current?.setText(text);
|
|
217
217
|
editorRef.current?.focus();
|
|
@@ -250,15 +250,15 @@ const ChatPrompt = ({
|
|
|
250
250
|
return true;
|
|
251
251
|
},
|
|
252
252
|
},
|
|
253
|
-
].filter(
|
|
253
|
+
].filter(isTruthy),
|
|
254
254
|
),
|
|
255
255
|
),
|
|
256
|
-
].filter(
|
|
256
|
+
].filter(isTruthy);
|
|
257
257
|
}, [event, expandable, referencesProvider]);
|
|
258
258
|
|
|
259
259
|
const handleSubmit = useCallback<NonNullable<ChatEditorProps['onSubmit']>>(
|
|
260
260
|
(text) => {
|
|
261
|
-
if (!
|
|
261
|
+
if (!activeRef.current) {
|
|
262
262
|
event.emit({ type: 'submit', text });
|
|
263
263
|
return true;
|
|
264
264
|
}
|
|
@@ -275,15 +275,16 @@ const ChatPrompt = ({
|
|
|
275
275
|
|
|
276
276
|
return (
|
|
277
277
|
<div
|
|
278
|
+
role='group'
|
|
278
279
|
className={mx(
|
|
279
|
-
'
|
|
280
|
+
'flex flex-col is-full density-fine',
|
|
280
281
|
outline && [
|
|
281
282
|
'p-2 bg-groupSurface border border-subduedSeparator transition transition-border [&:has(.cm-content:focus)]:border-separator rounded',
|
|
282
283
|
],
|
|
283
284
|
classNames,
|
|
284
285
|
)}
|
|
285
286
|
>
|
|
286
|
-
<div className='flex gap-2'>
|
|
287
|
+
<div role='none' className='flex gap-2'>
|
|
287
288
|
<ChatStatusIndicator classNames='p-1' preset={preset} error={error} processing={streaming} />
|
|
288
289
|
|
|
289
290
|
<ChatEditor
|
|
@@ -297,34 +298,37 @@ const ChatPrompt = ({
|
|
|
297
298
|
/>
|
|
298
299
|
</div>
|
|
299
300
|
|
|
300
|
-
|
|
301
|
-
<
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
<
|
|
301
|
+
{settings && (
|
|
302
|
+
<div role='none' className='flex pbs-2 items-center'>
|
|
303
|
+
<ChatOptions
|
|
304
|
+
space={space}
|
|
305
|
+
blueprintRegistry={processor.blueprintRegistry}
|
|
306
|
+
context={processor.context}
|
|
307
|
+
preset={preset}
|
|
308
|
+
presets={presets}
|
|
309
|
+
onPresetChange={onPresetChange}
|
|
310
|
+
/>
|
|
311
|
+
|
|
312
|
+
<div role='none' className='pli-cardSpacingChrome grow'>
|
|
313
|
+
<ChatReferences space={space} context={processor.context} />
|
|
314
|
+
</div>
|
|
315
|
+
|
|
316
|
+
<ChatActions
|
|
317
|
+
classNames='col-span-2'
|
|
318
|
+
microphone={true}
|
|
319
|
+
recording={recording}
|
|
320
|
+
processing={streaming}
|
|
321
|
+
onEvent={handleEvent}
|
|
322
|
+
>
|
|
323
|
+
{online !== undefined && (
|
|
324
|
+
<Input.Root>
|
|
325
|
+
<Input.Label srOnly>{t('online switch label')}</Input.Label>
|
|
326
|
+
<Input.Switch classNames='mis-2 mie-2' checked={online} onCheckedChange={onOnlineChange} />
|
|
327
|
+
</Input.Root>
|
|
328
|
+
)}
|
|
329
|
+
</ChatActions>
|
|
312
330
|
</div>
|
|
313
|
-
|
|
314
|
-
<ChatActions
|
|
315
|
-
classNames='col-span-2'
|
|
316
|
-
microphone={true}
|
|
317
|
-
recording={recording}
|
|
318
|
-
processing={streaming}
|
|
319
|
-
onEvent={handleEvent}
|
|
320
|
-
>
|
|
321
|
-
{online !== undefined && (
|
|
322
|
-
<Input.Root>
|
|
323
|
-
<Input.Switch classNames='mis-2 mie-2' checked={online} onCheckedChange={onOnlineChange} />
|
|
324
|
-
</Input.Root>
|
|
325
|
-
)}
|
|
326
|
-
</ChatActions>
|
|
327
|
-
</div>
|
|
331
|
+
)}
|
|
328
332
|
</div>
|
|
329
333
|
);
|
|
330
334
|
};
|
|
@@ -335,46 +339,44 @@ ChatPrompt.displayName = 'Chat.Prompt';
|
|
|
335
339
|
// Thread
|
|
336
340
|
//
|
|
337
341
|
|
|
338
|
-
type ChatThreadProps = Omit<
|
|
342
|
+
type ChatThreadProps = Omit<NaturalChatThreadProps, 'identity' | 'messages' | 'tools'>;
|
|
339
343
|
|
|
340
344
|
const ChatThread = (props: ChatThreadProps) => {
|
|
341
|
-
const {
|
|
345
|
+
const { event, messages, processor } = useChatContext(ChatThread.displayName);
|
|
342
346
|
const identity = useIdentity();
|
|
343
|
-
|
|
344
347
|
const error = useRxValue(processor.error).pipe(Option.getOrUndefined);
|
|
345
348
|
|
|
346
|
-
const
|
|
347
|
-
() => processor.conversation.toolkit?.tools ?? [],
|
|
348
|
-
[processor],
|
|
349
|
-
);
|
|
350
|
-
|
|
351
|
-
const scrollerRef = useRef<ScrollController>(null);
|
|
349
|
+
const scrollerRef = useRef<ChatThreadController | null>(null);
|
|
352
350
|
useEffect(() => {
|
|
353
351
|
return event.on((event) => {
|
|
354
352
|
switch (event.type) {
|
|
355
353
|
case 'submit':
|
|
356
354
|
case 'scroll-to-bottom':
|
|
357
|
-
scrollerRef.current?.scrollToBottom(
|
|
355
|
+
scrollerRef.current?.scrollToBottom();
|
|
358
356
|
break;
|
|
359
357
|
}
|
|
360
358
|
});
|
|
361
359
|
}, [event]);
|
|
362
360
|
|
|
361
|
+
const handleEvent = useCallback<NonNullable<NaturalChatThreadProps['onEvent']>>(
|
|
362
|
+
(ev) => {
|
|
363
|
+
event.emit(ev);
|
|
364
|
+
},
|
|
365
|
+
[event],
|
|
366
|
+
);
|
|
367
|
+
|
|
363
368
|
if (!identity) {
|
|
364
369
|
return null;
|
|
365
370
|
}
|
|
366
371
|
|
|
367
372
|
return (
|
|
368
|
-
<
|
|
373
|
+
<NaturalChatThread
|
|
369
374
|
{...props}
|
|
370
375
|
ref={scrollerRef}
|
|
371
|
-
debug={debug}
|
|
372
376
|
identity={identity}
|
|
373
|
-
space={space}
|
|
374
377
|
messages={messages}
|
|
375
378
|
error={error}
|
|
376
|
-
|
|
377
|
-
onEvent={(ev) => event.emit(ev)}
|
|
379
|
+
onEvent={handleEvent}
|
|
378
380
|
/>
|
|
379
381
|
);
|
|
380
382
|
};
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Array from 'effect/Array';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Function from 'effect/Function';
|
|
8
|
+
import * as Option from 'effect/Option';
|
|
6
9
|
import React, { useMemo } from 'react';
|
|
7
10
|
|
|
8
11
|
import { Capabilities, createIntent, useCapabilities, useIntentDispatcher } from '@dxos/app-framework';
|
|
@@ -15,7 +18,7 @@ import { useQuery } from '@dxos/react-client/echo';
|
|
|
15
18
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
16
19
|
|
|
17
20
|
import { ChatContainer } from '../components';
|
|
18
|
-
import { useContextBinder } from '../hooks';
|
|
21
|
+
import { useBlueprintRegistry, useContextBinder } from '../hooks';
|
|
19
22
|
import { Assistant, AssistantAction } from '../types';
|
|
20
23
|
|
|
21
24
|
export type ChatCompanionProps = {
|
|
@@ -27,6 +30,7 @@ export const ChatCompanion = ({ role, data }: ChatCompanionProps) => {
|
|
|
27
30
|
const companionTo = data.companionTo;
|
|
28
31
|
const space = getSpace(companionTo);
|
|
29
32
|
const chat = data.subject === 'assistant-chat' ? undefined : data.subject;
|
|
33
|
+
const blueprintRegistry = useBlueprintRegistry();
|
|
30
34
|
const binder = useContextBinder(chat);
|
|
31
35
|
const { dispatch } = useIntentDispatcher();
|
|
32
36
|
|
|
@@ -66,7 +70,7 @@ export const ChatCompanion = ({ role, data }: ChatCompanionProps) => {
|
|
|
66
70
|
const metadata = useCapabilities(Capabilities.Metadata);
|
|
67
71
|
const blueprintKeys = useMemo(
|
|
68
72
|
() =>
|
|
69
|
-
pipe(
|
|
73
|
+
Function.pipe(
|
|
70
74
|
metadata,
|
|
71
75
|
Array.findFirst(
|
|
72
76
|
(capability): capability is { id: string; metadata: { blueprints?: string[] } } =>
|
|
@@ -77,14 +81,35 @@ export const ChatCompanion = ({ role, data }: ChatCompanionProps) => {
|
|
|
77
81
|
),
|
|
78
82
|
[metadata, companionTo],
|
|
79
83
|
);
|
|
80
|
-
const
|
|
84
|
+
const existingBlueprints = useQuery(space, Filter.type(Blueprint.Blueprint));
|
|
81
85
|
const pluginBlueprints = useMemo(
|
|
82
|
-
() =>
|
|
83
|
-
[
|
|
86
|
+
() => existingBlueprints.filter((blueprint) => blueprintKeys.includes(blueprint.key)),
|
|
87
|
+
[existingBlueprints, blueprintKeys],
|
|
84
88
|
);
|
|
85
89
|
|
|
86
|
-
//
|
|
87
|
-
|
|
90
|
+
// Initialize related blueprints that are not already in the space.
|
|
91
|
+
useAsyncEffect(async () => {
|
|
92
|
+
if (!space) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// NOTE: This must be run instead of using the useQuery result to avoid duplicates.
|
|
97
|
+
const { objects: existingBlueprints } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
98
|
+
for (const key of blueprintKeys) {
|
|
99
|
+
const existingBlueprint = existingBlueprints.find((blueprint) => blueprint.key === key);
|
|
100
|
+
if (existingBlueprint) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const blueprint = blueprintRegistry.getByKey(key);
|
|
105
|
+
if (!blueprint) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
space.db.add(Obj.clone(blueprint));
|
|
110
|
+
}
|
|
111
|
+
}, [space, blueprintRegistry, blueprintKeys]);
|
|
112
|
+
|
|
88
113
|
useAsyncEffect(async () => {
|
|
89
114
|
if (!binder) {
|
|
90
115
|
return;
|
|
@@ -14,7 +14,7 @@ import { meta } from '../meta';
|
|
|
14
14
|
import { type Assistant } from '../types';
|
|
15
15
|
|
|
16
16
|
import { Chat } from './Chat';
|
|
17
|
-
import {
|
|
17
|
+
import { ChatToolbar } from './ChatToolbar';
|
|
18
18
|
|
|
19
19
|
export type ChatContainerProps = {
|
|
20
20
|
chat: Assistant.Chat;
|
|
@@ -36,9 +36,9 @@ export const ChatContainer = ({ chat, companionTo }: ChatContainerProps) => {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
|
-
<StackItem.Content toolbar
|
|
40
|
-
|
|
41
|
-
<Chat.Root chat={chat} processor={processor}>
|
|
39
|
+
<StackItem.Content toolbar>
|
|
40
|
+
<ChatToolbar chat={chat} companionTo={companionTo} />
|
|
41
|
+
<Chat.Root classNames='container-max-width' chat={chat} processor={processor}>
|
|
42
42
|
<Chat.Thread />
|
|
43
43
|
<div className='p-2'>
|
|
44
44
|
<Chat.Prompt {...chatProps} outline preset={preset?.id} online={online} onOnlineChange={setOnline} />
|
|
@@ -7,7 +7,7 @@ import React, { useCallback, useState } from 'react';
|
|
|
7
7
|
import { Capabilities, useCapability } from '@dxos/app-framework';
|
|
8
8
|
import { getSpace } from '@dxos/client/echo';
|
|
9
9
|
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { ChatDialog as
|
|
10
|
+
import { ChatDialog as NaturalChatDialog } from '@dxos/react-ui-chat';
|
|
11
11
|
|
|
12
12
|
import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '../hooks';
|
|
13
13
|
import { meta } from '../meta';
|
|
@@ -52,15 +52,15 @@ export const ChatDialog = ({ chat }: ChatDialogProps) => {
|
|
|
52
52
|
|
|
53
53
|
return (
|
|
54
54
|
<Chat.Root chat={chat} processor={processor} onEvent={handleEvent}>
|
|
55
|
-
<
|
|
56
|
-
<
|
|
57
|
-
<
|
|
55
|
+
<NaturalChatDialog.Root open={open} expanded={expanded} onOpenChange={setOpen}>
|
|
56
|
+
<NaturalChatDialog.Header title={t('assistant dialog title')} />
|
|
57
|
+
<NaturalChatDialog.Content>
|
|
58
58
|
<Chat.Thread />
|
|
59
|
-
</
|
|
60
|
-
<
|
|
59
|
+
</NaturalChatDialog.Content>
|
|
60
|
+
<NaturalChatDialog.Footer classNames='p-1.5'>
|
|
61
61
|
<Chat.Prompt {...chatProps} preset={preset?.id} online={online} onOnlineChange={setOnline} expandable />
|
|
62
|
-
</
|
|
63
|
-
</
|
|
62
|
+
</NaturalChatDialog.Footer>
|
|
63
|
+
</NaturalChatDialog.Root>
|
|
64
64
|
</Chat.Root>
|
|
65
65
|
);
|
|
66
66
|
};
|
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { addEventListener } from '@dxos/async';
|
|
8
|
-
import { Flex, ProgressBar, type ProgressBarProps, TextCrawl } from '@dxos/react-ui-components';
|
|
8
|
+
import { Flex, ProgressBar, type ProgressBarProps, TextCrawl, useExecutionGraph } from '@dxos/react-ui-components';
|
|
9
9
|
|
|
10
|
-
import { useExecutionGraph } from '../../hooks';
|
|
11
10
|
import { type Assistant } from '../../types';
|
|
12
11
|
|
|
13
12
|
// TODO(burdon): Reset after each session.
|
|
@@ -28,7 +27,7 @@ export type ChatProgressProps = {
|
|
|
28
27
|
};
|
|
29
28
|
|
|
30
29
|
export const ChatProgress = ({ chat }: ChatProgressProps) => {
|
|
31
|
-
const { commits } = useExecutionGraph(chat.traceQueue, true);
|
|
30
|
+
const { commits } = useExecutionGraph(chat.traceQueue?.target, true);
|
|
32
31
|
const nodes = useMemo(() => commits.map((commit) => ({ id: commit.id, message: commit.message })), [commits]);
|
|
33
32
|
const lines = useMemo(() => commits.map((commit) => commit.message), [commits]);
|
|
34
33
|
|
|
@@ -9,13 +9,13 @@ import { type Blueprint } from '@dxos/blueprints';
|
|
|
9
9
|
import { Filter, Obj, Type } from '@dxos/echo';
|
|
10
10
|
import { type Space, useQuery } from '@dxos/react-client/echo';
|
|
11
11
|
import { Icon, IconButton, Popover, Select, useTranslation } from '@dxos/react-ui';
|
|
12
|
-
import { SearchList } from '@dxos/react-ui-searchlist';
|
|
12
|
+
import { Listbox, SearchList } from '@dxos/react-ui-searchlist';
|
|
13
13
|
import { Tabs } from '@dxos/react-ui-tabs';
|
|
14
14
|
|
|
15
15
|
import { useActiveBlueprints, useBlueprintHandlers, useBlueprints, useContextObjects, useItemTypes } from '../../hooks';
|
|
16
16
|
import { meta } from '../../meta';
|
|
17
17
|
|
|
18
|
-
const panelClassNames = 'is-[calc(100dvw-.5rem)] sm:is-max md:is-
|
|
18
|
+
const panelClassNames = 'is-[calc(100dvw-.5rem)] sm:is-max md:is-72 max-is-[--text-content]';
|
|
19
19
|
|
|
20
20
|
export type ChatOptionsProps = {
|
|
21
21
|
space: Space;
|
|
@@ -65,12 +65,12 @@ export const ChatOptions = ({
|
|
|
65
65
|
</Popover.Trigger>
|
|
66
66
|
<Popover.Portal>
|
|
67
67
|
<Popover.Content side='top' classNames={panelClassNames}>
|
|
68
|
-
<Tabs.Root orientation='horizontal' defaultValue='blueprints' defaultActivePart='list'>
|
|
68
|
+
<Tabs.Root orientation='horizontal' defaultValue='blueprints' defaultActivePart='list' tabIndex={-1}>
|
|
69
69
|
<Tabs.Viewport classNames='max-bs-[--radix-popover-content-available-height] grid grid-rows-[1fr_min-content] [&_[cmdk-root]]:contents [&_[role="tabpanel"]]:grid [&_[role="tabpanel"]]:grid-rows-[1fr_min-content] [&_[role="listbox"]]:min-bs-0 [&_[role="listbox"]]:overflow-y-auto [&_[role="tabpanel"]]:min-bs-0 [&_[role="tabpanel"]]:pli-cardSpacingChrome [&_[role="tabpanel"][data-state="active"]]:order-first [&_[role="tabpanel"][data-state="inactive"]]:hidden'>
|
|
70
|
-
<Tabs.Tabpanel value='blueprints'>
|
|
70
|
+
<Tabs.Tabpanel value='blueprints' tabIndex={-1} classNames='dx-focus-ring-inset'>
|
|
71
71
|
<BlueprintsPanel blueprintRegistry={blueprintRegistry} space={space} context={context} />
|
|
72
72
|
</Tabs.Tabpanel>
|
|
73
|
-
<Tabs.Tabpanel value='model'>
|
|
73
|
+
<Tabs.Tabpanel value='model' tabIndex={-1} classNames='dx-focus-ring-inset !pli-0'>
|
|
74
74
|
<ModelsPanel presets={presets} preset={preset} onPresetChange={onPresetChange} />
|
|
75
75
|
</Tabs.Tabpanel>
|
|
76
76
|
<Tabs.Tablist classNames='sm:overflow-x-hidden justify-center p-[--dx-cardSpacingChrome] border-bs border-subduedSeparator order-last'>
|
|
@@ -98,7 +98,7 @@ const BlueprintsPanel = ({
|
|
|
98
98
|
}: Pick<ChatOptionsProps, 'blueprintRegistry' | 'space' | 'context'>) => {
|
|
99
99
|
const { t } = useTranslation(meta.id);
|
|
100
100
|
|
|
101
|
-
const blueprints = useBlueprints({ blueprintRegistry });
|
|
101
|
+
const blueprints = useBlueprints({ blueprintRegistry, space });
|
|
102
102
|
const activeBlueprints = useActiveBlueprints({ context });
|
|
103
103
|
const { onUpdateBlueprint } = useBlueprintHandlers({ space, context, blueprintRegistry });
|
|
104
104
|
|
|
@@ -120,7 +120,7 @@ const BlueprintsPanel = ({
|
|
|
120
120
|
);
|
|
121
121
|
})}
|
|
122
122
|
</SearchList.Content>
|
|
123
|
-
<SearchList.Input placeholder={t('search placeholder')} classNames='mbe-cardSpacingChrome' />
|
|
123
|
+
<SearchList.Input placeholder={t('search placeholder')} classNames='mbe-cardSpacingChrome' autoFocus />
|
|
124
124
|
</SearchList.Root>
|
|
125
125
|
);
|
|
126
126
|
};
|
|
@@ -131,24 +131,16 @@ const ModelsPanel = ({
|
|
|
131
131
|
onPresetChange,
|
|
132
132
|
}: Pick<ChatOptionsProps, 'presets' | 'preset' | 'onPresetChange'>) => {
|
|
133
133
|
return (
|
|
134
|
-
<
|
|
134
|
+
<Listbox.Root value={preset} onValueChange={onPresetChange} autoFocus>
|
|
135
135
|
{presets?.map(({ id, label }) => {
|
|
136
|
-
const isActive = preset === id;
|
|
137
136
|
return (
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
tabIndex={0}
|
|
143
|
-
className='overflow-hidden dx-focus-ring flex gap-2 p-1 pis-2 pie-2 items-center rounded-sm select-none cursor-pointer hover:bg-hoverOverlay'
|
|
144
|
-
onClick={() => onPresetChange?.(id)}
|
|
145
|
-
>
|
|
146
|
-
<div className='grow truncate'>{label}</div>
|
|
147
|
-
<Icon icon='ph--check--regular' classNames={[!isActive && 'invisible']} />
|
|
148
|
-
</li>
|
|
137
|
+
<Listbox.Option key={id} value={id}>
|
|
138
|
+
<Listbox.OptionLabel>{label}</Listbox.OptionLabel>
|
|
139
|
+
<Listbox.OptionIndicator />
|
|
140
|
+
</Listbox.Option>
|
|
149
141
|
);
|
|
150
142
|
})}
|
|
151
|
-
</
|
|
143
|
+
</Listbox.Root>
|
|
152
144
|
);
|
|
153
145
|
};
|
|
154
146
|
|
|
@@ -184,8 +176,8 @@ const ObjectsPanel = ({ space, context }: Pick<ChatOptionsProps, 'space' | 'cont
|
|
|
184
176
|
const { objects: contextObjects, onUpdateObject } = useContextObjects({ space, context });
|
|
185
177
|
|
|
186
178
|
return (
|
|
187
|
-
<SearchList.Root
|
|
188
|
-
<SearchList.Content classNames='
|
|
179
|
+
<SearchList.Root>
|
|
180
|
+
<SearchList.Content classNames='p-cardSpacingChrome [&:has([cmdk-list-sizer]:empty)]:plb-0'>
|
|
189
181
|
{objects.length ? (
|
|
190
182
|
objects.map((object) => {
|
|
191
183
|
const label = Obj.getLabel(object) ?? Obj.getTypename(object) ?? object.id;
|
|
@@ -207,7 +199,7 @@ const ObjectsPanel = ({ space, context }: Pick<ChatOptionsProps, 'space' | 'cont
|
|
|
207
199
|
)}
|
|
208
200
|
</SearchList.Content>
|
|
209
201
|
|
|
210
|
-
<div role='none' className='grid grid-cols-[min-content_1fr] gap-2 mbe-cardSpacingChrome'>
|
|
202
|
+
<div role='none' className='grid grid-cols-[min-content_1fr] gap-2 pli-cardSpacingChrome mbe-cardSpacingChrome'>
|
|
211
203
|
<Select.Root value={typename === ANY ? undefined : typename} onValueChange={setTypename}>
|
|
212
204
|
<Select.TriggerButton density='fine' placeholder={t('type filter placeholder')} />
|
|
213
205
|
<Select.Portal>
|
|
@@ -226,7 +218,7 @@ const ObjectsPanel = ({ space, context }: Pick<ChatOptionsProps, 'space' | 'cont
|
|
|
226
218
|
</Select.Content>
|
|
227
219
|
</Select.Portal>
|
|
228
220
|
</Select.Root>
|
|
229
|
-
<SearchList.Input placeholder={t('search placeholder')} classNames='mbe-0' />
|
|
221
|
+
<SearchList.Input placeholder={t('search placeholder')} classNames='mbe-0' autoFocus />
|
|
230
222
|
</div>
|
|
231
223
|
</SearchList.Root>
|
|
232
224
|
);
|