@dxos/plugin-assistant 0.8.4-main.5ea62a8 → 0.8.4-main.66e292d
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/BlueprintArticle-BWSLH6LG.mjs +36 -0
- package/dist/lib/browser/BlueprintArticle-BWSLH6LG.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-OSZZZSWV.mjs +158 -0
- package/dist/lib/browser/ChatCompanion-OSZZZSWV.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-YBJBIVUZ.mjs → ChatContainer-2W6FNSJD.mjs} +22 -20
- package/dist/lib/browser/ChatContainer-2W6FNSJD.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-MTPJLEHM.mjs → ChatDialog-XQ3KDYWE.mjs} +12 -11
- package/dist/lib/browser/ChatDialog-XQ3KDYWE.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-Q7JYGFQV.mjs +59 -0
- package/dist/lib/browser/PromptArticle-Q7JYGFQV.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-LM6GVHQO.mjs} +67 -21
- package/dist/lib/browser/app-graph-builder-LM6GVHQO.mjs.map +7 -0
- package/dist/lib/browser/{blueprint-definition-CRZPIA5A.mjs → blueprint-definition-VBEOXNBS.mjs} +4 -4
- package/dist/lib/browser/chunk-2BOE3OTW.mjs +262 -0
- package/dist/lib/browser/chunk-2BOE3OTW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SMIVXXAI.mjs → chunk-5JZRYQZL.mjs} +52 -25
- package/dist/lib/browser/chunk-5JZRYQZL.mjs.map +7 -0
- package/dist/lib/browser/chunk-7ZJIXQ2Y.mjs +335 -0
- package/dist/lib/browser/chunk-7ZJIXQ2Y.mjs.map +7 -0
- package/dist/lib/browser/{chunk-IJAJRAR7.mjs → chunk-LRE4VEZV.mjs} +2 -4
- package/dist/lib/browser/chunk-LRE4VEZV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OYFQS7JM.mjs → chunk-NC2QNMBF.mjs} +60 -41
- package/dist/lib/browser/chunk-NC2QNMBF.mjs.map +7 -0
- package/dist/lib/browser/chunk-PWSTPQUY.mjs +1929 -0
- package/dist/lib/browser/chunk-PWSTPQUY.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 +142 -103
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-BQO5SVGI.mjs → intent-resolver-EEYS2GJF.mjs} +62 -31
- package/dist/lib/browser/intent-resolver-EEYS2GJF.mjs.map +7 -0
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs +17 -0
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-VNCD2H7C.mjs → react-surface-ECKZNDSU.mjs} +24 -35
- package/dist/lib/browser/react-surface-ECKZNDSU.mjs.map +7 -0
- package/dist/lib/browser/repair-3MZXLUHO.mjs +44 -0
- package/dist/lib/browser/repair-3MZXLUHO.mjs.map +7 -0
- package/dist/lib/browser/{settings-36V3VUMW.mjs → settings-HD5WA24I.mjs} +5 -5
- package/dist/lib/browser/{settings-36V3VUMW.mjs.map → settings-HD5WA24I.mjs.map} +1 -1
- package/dist/lib/browser/{state-D5IVKNYG.mjs → state-GG7Z3NB7.mjs} +9 -5
- package/dist/lib/browser/{state-D5IVKNYG.mjs.map → state-GG7Z3NB7.mjs.map} +3 -3
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs +17 -0
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs +37 -0
- package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-IUMU7WRQ.mjs +159 -0
- package/dist/lib/node-esm/ChatCompanion-IUMU7WRQ.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-TUCITJJW.mjs → ChatContainer-CTUNUEU3.mjs} +22 -20
- package/dist/lib/node-esm/ChatContainer-CTUNUEU3.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-JLM7RDZQ.mjs → ChatDialog-X42ASXQD.mjs} +12 -11
- package/dist/lib/node-esm/ChatDialog-X42ASXQD.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.mjs +60 -0
- package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.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-6XUAGTRS.mjs} +67 -21
- package/dist/lib/node-esm/app-graph-builder-6XUAGTRS.mjs.map +7 -0
- package/dist/lib/node-esm/{blueprint-definition-275J3XL2.mjs → blueprint-definition-RDCLLIQH.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-CAQKGW3B.mjs → chunk-25GMMNY5.mjs} +60 -41
- package/dist/lib/node-esm/chunk-25GMMNY5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3Q22TTXW.mjs +264 -0
- package/dist/lib/node-esm/chunk-3Q22TTXW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CKW4IYLY.mjs +336 -0
- package/dist/lib/node-esm/chunk-CKW4IYLY.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7YOGZI66.mjs → chunk-E4JSYCWZ.mjs} +52 -25
- package/dist/lib/node-esm/chunk-E4JSYCWZ.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-YPXEA46Q.mjs → chunk-YWFWT57N.mjs} +2 -4
- package/dist/lib/node-esm/chunk-YWFWT57N.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-Z37USO4K.mjs +1930 -0
- package/dist/lib/node-esm/chunk-Z37USO4K.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 +142 -103
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-FIS3T5KP.mjs → intent-resolver-4SRYLDK5.mjs} +62 -31
- package/dist/lib/node-esm/intent-resolver-4SRYLDK5.mjs.map +7 -0
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs +18 -0
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-4NLRKNBU.mjs → react-surface-NLIG5VAI.mjs} +24 -35
- package/dist/lib/node-esm/react-surface-NLIG5VAI.mjs.map +7 -0
- package/dist/lib/node-esm/repair-RER5H7Y6.mjs +45 -0
- package/dist/lib/node-esm/repair-RER5H7Y6.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-7ZCZ6AS5.mjs → settings-YJQVKHH5.mjs} +5 -5
- package/dist/lib/node-esm/{settings-7ZCZ6AS5.mjs.map → settings-YJQVKHH5.mjs.map} +1 -1
- package/dist/lib/node-esm/{state-4VLKPLW3.mjs → state-FSUHFMDM.mjs} +9 -5
- package/dist/lib/node-esm/{state-4VLKPLW3.mjs.map → state-FSUHFMDM.mjs.map} +3 -3
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs +18 -0
- package/dist/lib/node-esm/toolkit-HFJZLVIR.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 +2 -11
- 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/index.d.ts +1 -0
- package/dist/types/src/capabilities/index.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/repair.d.ts +4 -0
- package/dist/types/src/capabilities/repair.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +7 -0
- package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -0
- package/dist/types/src/components/Chat/Chat.d.ts +22 -11
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +4 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +2 -2
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +7 -4
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +10 -8
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +140 -77
- 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/reducers.d.ts +5 -5
- package/dist/types/src/components/ChatThread/reducers.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 +42 -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/PromptArticle.d.ts +7 -0
- package/dist/types/src/components/PromptArticle.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 +121 -62
- 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 +121 -62
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +21 -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 +121 -62
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -9
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/functions/analysis.d.ts +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} +2 -2
- package/dist/types/src/functions/object-list.d.ts.map +1 -0
- package/dist/types/src/functions/{load.d.ts → object-load.d.ts} +2 -2
- package/dist/types/src/functions/object-load.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -4
- 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 +5 -3
- 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/useChatToolbarActions.d.ts +8 -0
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +2 -2
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts +4 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.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 +17 -23
- 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/queue-logger.d.ts.map +1 -1
- 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/translations.d.ts +246 -27
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +16 -13
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +38 -16
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +129 -82
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +96 -111
- package/src/AssistantPlugin.tsx +138 -134
- package/src/capabilities/ai-service.ts +6 -7
- package/src/capabilities/app-graph-builder.ts +69 -21
- package/src/capabilities/blueprint-definition.ts +39 -15
- package/src/capabilities/capabilities.ts +2 -16
- package/src/capabilities/edge-model-resolver.ts +5 -7
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +61 -20
- package/src/capabilities/local-model-resolver.ts +7 -9
- package/src/capabilities/react-surface.tsx +16 -20
- package/src/capabilities/repair.ts +49 -0
- package/src/capabilities/state.ts +2 -0
- package/src/capabilities/toolkit.ts +9 -155
- package/src/components/BlueprintArticle.tsx +29 -0
- package/src/components/Chat/Chat.tsx +177 -140
- package/src/components/Chat/events.ts +6 -0
- package/src/components/ChatCompanion.tsx +93 -49
- package/src/components/ChatContainer.tsx +27 -17
- package/src/components/ChatDialog.tsx +17 -10
- package/src/components/ChatProgress/ChatProgress.tsx +3 -4
- package/src/components/ChatPrompt/ChatActions.tsx +2 -4
- package/src/components/ChatPrompt/ChatOptions.tsx +48 -47
- package/src/components/ChatPrompt/ChatReferences.tsx +2 -2
- package/src/components/ChatThread/ChatThread.stories.tsx +90 -225
- package/src/components/ChatThread/ChatThread.tsx +59 -51
- package/src/components/ChatThread/Link.tsx +11 -8
- package/src/components/ChatThread/reducers.ts +6 -6
- package/src/components/ChatThread/registry.tsx +174 -0
- package/src/components/ChatThread/sync.test.ts +89 -0
- package/src/components/ChatThread/sync.ts +148 -0
- package/src/components/ChatThread/testing/thread.md +37 -0
- package/src/components/PromptArticle.tsx +51 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +15 -7
- package/src/components/TemplateEditor/TemplateEditor.tsx +21 -12
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +4 -6
- package/src/components/TemplateEditor/TemplateForm.tsx +2 -2
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +269 -0
- package/src/components/TemplateEditor/extensions/index.ts +6 -0
- package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
- package/src/components/{ChatThread → ToolBlock}/ToolBlock.tsx +46 -50
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +5 -8
- package/src/components/Toolbox/Toolbox.tsx +5 -5
- package/src/components/index.ts +2 -5
- package/src/functions/analysis.ts +5 -3
- 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} +10 -8
- package/src/hooks/index.ts +2 -4
- package/src/hooks/useBlueprintRegistry.ts +19 -4
- package/src/hooks/useChatProcessor.ts +23 -15
- package/src/hooks/useChatServices.ts +29 -42
- package/src/hooks/useChatToolbarActions.ts +122 -0
- package/src/hooks/useContextBinder.ts +19 -7
- package/src/hooks/useContextObjects.ts +1 -1
- package/src/hooks/{useItemTypes.ts → useFilteredTypes.ts} +8 -7
- package/src/hooks/useReferencesProvider.ts +2 -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 +2 -2
- package/src/processor/processor.test.ts +21 -27
- package/src/processor/processor.ts +47 -74
- package/src/processor/update-name.ts +56 -0
- package/src/queue-logger.ts +9 -13
- 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/translations.ts +30 -18
- package/src/types/Assistant.ts +11 -9
- package/src/types/AssistantAction.ts +23 -6
- package/src/types/service.ts +17 -9
- package/dist/lib/browser/BlueprintContainer-OWUSKPRK.mjs +0 -29
- package/dist/lib/browser/BlueprintContainer-OWUSKPRK.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-FRCVSLPP.mjs +0 -126
- 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/chunk-6QMISAU6.mjs +0 -167
- package/dist/lib/browser/chunk-6QMISAU6.mjs.map +0 -7
- package/dist/lib/browser/chunk-CFXXQM25.mjs +0 -182
- 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 +0 -218
- 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 +0 -30
- package/dist/lib/node-esm/BlueprintContainer-UFVWCRN6.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-ZNRZEKH5.mjs +0 -127
- 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 +0 -183
- package/dist/lib/node-esm/chunk-FNZJJL7G.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RLBN4RNR.mjs +0 -168
- package/dist/lib/node-esm/chunk-RLBN4RNR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UWUUZQWJ.mjs +0 -219
- 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/BlueprintContainer.d.ts +0 -8
- package/dist/types/src/components/BlueprintContainer.d.ts.map +0 -1
- 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/TemplateEditor/handlebars-extension.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 +0 -11
- 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/useItemTypes.d.ts +0 -4
- package/dist/types/src/hooks/useItemTypes.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/BlueprintContainer.tsx +0 -24
- 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/components/TemplateEditor/handlebars-extension.ts +0 -165
- package/src/components/Toolbar/Toolbar.tsx +0 -20
- package/src/components/Toolbar/index.ts +0 -5
- package/src/components/Toolbar/useChatToolbarActions.ts +0 -125
- 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-VBEOXNBS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{blueprint-definition-275J3XL2.mjs.map → blueprint-definition-RDCLLIQH.mjs.map} +0 -0
- /package/dist/types/src/components/TemplateEditor/{handlebars-extension.d.ts → extensions/handlebars-extension.d.ts} +0 -0
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
6
7
|
|
|
7
8
|
import { Filter, Obj, Query } from '@dxos/echo';
|
|
8
9
|
import { DatabaseService, defineFunction } from '@dxos/functions';
|
|
9
10
|
import { trim } from '@dxos/util';
|
|
10
11
|
|
|
11
|
-
// TODO(burdon):
|
|
12
|
+
// TODO(burdon): Move to toolkit (i.e., tool not function).
|
|
12
13
|
export default defineFunction({
|
|
13
|
-
|
|
14
|
+
key: 'dxos.org/function/assistant/object-list',
|
|
15
|
+
name: 'List objects',
|
|
14
16
|
description:
|
|
15
17
|
// TODO(wittjosiah): Find a better way to prompt for looking up typenames before querying with them.
|
|
16
18
|
trim`
|
|
17
19
|
Lists the objects of the given type.
|
|
18
|
-
Check the
|
|
20
|
+
Check the get-schemas tool for available types before calling this function.
|
|
19
21
|
`,
|
|
20
22
|
inputSchema: Schema.Struct({
|
|
21
23
|
typename: Schema.String.annotations({
|
|
@@ -2,17 +2,19 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
8
|
+
import * as Schema from 'effect/Schema';
|
|
6
9
|
|
|
7
10
|
import { ArtifactId } from '@dxos/assistant';
|
|
8
11
|
import { Obj } from '@dxos/echo';
|
|
9
12
|
import { DatabaseService, defineFunction } from '@dxos/functions';
|
|
10
|
-
import { log } from '@dxos/log';
|
|
11
13
|
|
|
12
|
-
// TODO(burdon):
|
|
13
|
-
// TODO(burdon): Factor out to space plugin.
|
|
14
|
+
// TODO(burdon): Move to toolkit (i.e., tool not function).
|
|
14
15
|
export default defineFunction({
|
|
15
|
-
|
|
16
|
+
key: 'dxos.org/function/assistant/object-load',
|
|
17
|
+
name: 'Load object',
|
|
16
18
|
description: 'Loads the object.',
|
|
17
19
|
inputSchema: Schema.Struct({
|
|
18
20
|
id: ArtifactId.annotations({
|
|
@@ -23,18 +25,18 @@ export default defineFunction({
|
|
|
23
25
|
}),
|
|
24
26
|
}),
|
|
25
27
|
outputSchema: Schema.Struct({
|
|
26
|
-
// TODO(wittjosiah): Type.
|
|
28
|
+
// TODO(wittjosiah): Type.Entity.Any
|
|
27
29
|
object: Schema.Any,
|
|
28
30
|
}),
|
|
29
31
|
handler: Effect.fn(function* ({ data: { id, typename } }) {
|
|
30
32
|
const object = yield* DatabaseService.resolve(ArtifactId.toDXN(id));
|
|
31
|
-
return yield* pipe(
|
|
33
|
+
return yield* Function.pipe(
|
|
32
34
|
Option.fromNullable(object),
|
|
33
35
|
Option.flatMap((object) => (Obj.getTypename(object) === typename ? Option.some(object) : Option.none())),
|
|
34
36
|
Option.match({
|
|
35
37
|
onNone: () => Effect.fail('Object not found.'),
|
|
36
38
|
onSome: (object) => {
|
|
37
|
-
log.info('object', { object });
|
|
39
|
+
// log.info('object', { object });
|
|
38
40
|
return Effect.succeed({ object });
|
|
39
41
|
},
|
|
40
42
|
}),
|
package/src/hooks/index.ts
CHANGED
|
@@ -5,13 +5,11 @@
|
|
|
5
5
|
export * from './useBlueprintRegistry';
|
|
6
6
|
export * from './useChatProcessor';
|
|
7
7
|
export * from './useChatServices';
|
|
8
|
+
export * from './useChatToolbarActions';
|
|
8
9
|
export * from './useContextBinder';
|
|
9
10
|
export * from './useContextObjects';
|
|
10
|
-
export * from './
|
|
11
|
+
export * from './useFilteredTypes';
|
|
11
12
|
export * from './useFlush';
|
|
12
|
-
export * from './useItemTypes';
|
|
13
|
-
export * from './useMatcherExtension';
|
|
14
13
|
export * from './useOnline';
|
|
15
14
|
export * from './usePresets';
|
|
16
15
|
export * from './useReferencesProvider';
|
|
17
|
-
export * from './useResolveRef';
|
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
import { useSignalEffect } from '@preact/signals-react';
|
|
6
6
|
import { useCallback, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { Capabilities
|
|
8
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
9
|
+
import { useCapabilities } from '@dxos/app-framework/react';
|
|
9
10
|
import { type AiContextBinder } from '@dxos/assistant';
|
|
10
11
|
import { Blueprint } from '@dxos/blueprints';
|
|
11
12
|
import { type Space } from '@dxos/client/echo';
|
|
12
13
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
13
|
-
import {
|
|
14
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
15
|
+
import { distinctBy, isNonNullable } from '@dxos/util';
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* Provide a registry of blueprints from plugins.
|
|
@@ -21,8 +23,21 @@ export const useBlueprintRegistry = () => {
|
|
|
21
23
|
return useMemo(() => new Blueprint.Registry(blueprints), [blueprints]);
|
|
22
24
|
};
|
|
23
25
|
|
|
24
|
-
export const useBlueprints = ({
|
|
25
|
-
|
|
26
|
+
export const useBlueprints = ({
|
|
27
|
+
blueprintRegistry,
|
|
28
|
+
space,
|
|
29
|
+
}: {
|
|
30
|
+
blueprintRegistry?: Blueprint.Registry;
|
|
31
|
+
space?: Space;
|
|
32
|
+
}) => {
|
|
33
|
+
const staticBlueprints = useMemo(() => blueprintRegistry?.query() ?? [], [blueprintRegistry]);
|
|
34
|
+
const spaceBlueprints = useQuery(space, Filter.type(Blueprint.Blueprint));
|
|
35
|
+
return useMemo(() => {
|
|
36
|
+
const blueprints = distinctBy([...staticBlueprints, ...spaceBlueprints], (b) => b.key);
|
|
37
|
+
blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));
|
|
38
|
+
return blueprints;
|
|
39
|
+
}, [staticBlueprints, spaceBlueprints]);
|
|
40
|
+
};
|
|
26
41
|
|
|
27
42
|
/**
|
|
28
43
|
* Create reactive map of active blueprints (by key).
|
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { RegistryContext } from '@effect-
|
|
6
|
-
import
|
|
7
|
-
import { useContext, useMemo } from 'react';
|
|
5
|
+
import { RegistryContext } from '@effect-atom/atom-react';
|
|
6
|
+
import type * as Runtime from 'effect/Runtime';
|
|
7
|
+
import { useContext, useMemo, useState } from 'react';
|
|
8
8
|
|
|
9
9
|
import { AiConversation } from '@dxos/assistant';
|
|
10
10
|
import { type Blueprint } from '@dxos/blueprints';
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
|
-
import { type Queue } from '@dxos/react-client/echo';
|
|
12
|
+
import { type Queue, type Space } from '@dxos/react-client/echo';
|
|
13
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
13
14
|
|
|
14
15
|
import { AiChatProcessor, type AiChatServices, type AiServicePreset } from '../processor';
|
|
15
16
|
import { type Assistant } from '../types';
|
|
16
17
|
|
|
17
18
|
export type UseChatProcessorProps = {
|
|
19
|
+
space?: Space;
|
|
18
20
|
chat?: Assistant.Chat;
|
|
19
21
|
preset?: AiServicePreset;
|
|
20
|
-
services?:
|
|
22
|
+
services?: () => Promise<Runtime.Runtime<AiChatServices>>;
|
|
21
23
|
blueprintRegistry?: Blueprint.Registry;
|
|
22
24
|
settings?: Assistant.Settings;
|
|
23
25
|
};
|
|
@@ -26,6 +28,7 @@ export type UseChatProcessorProps = {
|
|
|
26
28
|
* Configure and create AiChatProcessor.
|
|
27
29
|
*/
|
|
28
30
|
export const useChatProcessor = ({
|
|
31
|
+
space,
|
|
29
32
|
chat,
|
|
30
33
|
preset,
|
|
31
34
|
services,
|
|
@@ -35,13 +38,23 @@ export const useChatProcessor = ({
|
|
|
35
38
|
const observableRegistry = useContext(RegistryContext);
|
|
36
39
|
|
|
37
40
|
// Create conversation from chat queue.
|
|
38
|
-
const conversation =
|
|
39
|
-
|
|
41
|
+
const [conversation, setConversation] = useState<AiConversation>();
|
|
42
|
+
useAsyncEffect(async () => {
|
|
43
|
+
if (!space || !chat) {
|
|
40
44
|
return;
|
|
41
45
|
}
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
// NOTE: Passing in space and getting queue from space rather than resolving the reference.
|
|
48
|
+
// This is because if the chat isn't in a space yet, the reference will not be resolvable.
|
|
49
|
+
const queue = space.queues.get(chat.queue.dxn);
|
|
50
|
+
const conversation = new AiConversation(queue as Queue<any>);
|
|
51
|
+
await conversation.open();
|
|
52
|
+
setConversation(conversation);
|
|
53
|
+
return () => {
|
|
54
|
+
void conversation.close();
|
|
55
|
+
setConversation(undefined);
|
|
56
|
+
};
|
|
57
|
+
}, [space, chat?.queue.dxn.toString()]);
|
|
45
58
|
|
|
46
59
|
// Create processor.
|
|
47
60
|
const processor = useMemo(() => {
|
|
@@ -49,12 +62,7 @@ export const useChatProcessor = ({
|
|
|
49
62
|
return undefined;
|
|
50
63
|
}
|
|
51
64
|
|
|
52
|
-
log('creating processor', {
|
|
53
|
-
preset,
|
|
54
|
-
model: preset?.model,
|
|
55
|
-
settings,
|
|
56
|
-
});
|
|
57
|
-
|
|
65
|
+
log('creating processor', { preset, model: preset?.model, settings });
|
|
58
66
|
return new AiChatProcessor(conversation, services, {
|
|
59
67
|
observableRegistry,
|
|
60
68
|
blueprintRegistry,
|
|
@@ -2,24 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import type * as Runtime from 'effect/Runtime';
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
|
|
9
|
+
import { useCapability } from '@dxos/app-framework/react';
|
|
11
10
|
import { type Space } from '@dxos/client/echo';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
LocalFunctionExecutionService,
|
|
17
|
-
QueueService,
|
|
18
|
-
RemoteFunctionExecutionService,
|
|
19
|
-
TracingService,
|
|
20
|
-
} from '@dxos/functions';
|
|
11
|
+
import { TracingService } from '@dxos/functions';
|
|
12
|
+
import { TracingServiceExt } from '@dxos/functions-runtime';
|
|
13
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
14
|
+
import { useClient } from '@dxos/react-client';
|
|
21
15
|
|
|
22
|
-
import { AssistantCapabilities } from '../capabilities';
|
|
23
16
|
import { type AiChatServices } from '../processor';
|
|
24
17
|
import { type Assistant } from '../types';
|
|
25
18
|
|
|
@@ -31,34 +24,28 @@ export type UseChatServicesProps = {
|
|
|
31
24
|
/**
|
|
32
25
|
* Construct service layer.
|
|
33
26
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
// TODO(dmaretskyi): Better return type.
|
|
28
|
+
export const useChatServices = ({
|
|
29
|
+
space,
|
|
30
|
+
chat,
|
|
31
|
+
}: UseChatServicesProps): (() => Promise<Runtime.Runtime<AiChatServices>>) | undefined => {
|
|
32
|
+
const client = useClient();
|
|
33
|
+
space ??= client.spaces.default;
|
|
39
34
|
|
|
35
|
+
const runtimeResolver = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
40
36
|
return useMemo(() => {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
space ? DatabaseService.layer(space.db) : DatabaseService.notAvailable,
|
|
56
|
-
space ? QueueService.layer(space.queues) : QueueService.notAvailable,
|
|
57
|
-
chat?.traceQueue?.target ? TracingService.layerQueue(chat.traceQueue?.target) : TracingService.layerNoop,
|
|
58
|
-
LocalFunctionExecutionService.layer,
|
|
59
|
-
RemoteFunctionExecutionService.mockLayer,
|
|
60
|
-
),
|
|
61
|
-
),
|
|
62
|
-
);
|
|
63
|
-
}, [space, functions, toolkits, handlers, chat?.traceQueue?.target]);
|
|
37
|
+
const runtime = runtimeResolver.getRuntime(space.id);
|
|
38
|
+
return () =>
|
|
39
|
+
runtime.runPromise(
|
|
40
|
+
Effect.gen(function* () {
|
|
41
|
+
return yield* Effect.runtime<AiChatServices>().pipe(
|
|
42
|
+
Effect.provide(
|
|
43
|
+
chat?.traceQueue?.target
|
|
44
|
+
? TracingServiceExt.layerQueue(chat.traceQueue?.target)
|
|
45
|
+
: TracingService.layerNoop,
|
|
46
|
+
),
|
|
47
|
+
);
|
|
48
|
+
}),
|
|
49
|
+
);
|
|
50
|
+
}, [space, chat?.traceQueue?.target]);
|
|
64
51
|
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import { useMemo } from 'react';
|
|
8
|
+
|
|
9
|
+
import { createIntent } from '@dxos/app-framework';
|
|
10
|
+
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
11
|
+
import { Filter, Obj, Query } from '@dxos/echo';
|
|
12
|
+
import { invariant } from '@dxos/invariant';
|
|
13
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
14
|
+
import { MenuBuilder, useMenuActions } from '@dxos/react-ui-menu';
|
|
15
|
+
|
|
16
|
+
import { useChatContext } from '../components';
|
|
17
|
+
import { meta } from '../meta';
|
|
18
|
+
import { Assistant, AssistantAction } from '../types';
|
|
19
|
+
|
|
20
|
+
export type ChatToolbarActionsProps = {
|
|
21
|
+
chat?: Assistant.Chat;
|
|
22
|
+
companionTo?: Obj.Any;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const useChatToolbarActions = ({ chat, companionTo }: ChatToolbarActionsProps) => {
|
|
26
|
+
const { dispatch } = useIntentDispatcher();
|
|
27
|
+
const { space } = useChatContext('useChatToolbarActions');
|
|
28
|
+
const query = companionTo
|
|
29
|
+
? Query.select(Filter.ids(companionTo.id)).targetOf(Assistant.CompanionTo).source()
|
|
30
|
+
: Query.select(Filter.nothing());
|
|
31
|
+
|
|
32
|
+
// TODO(wittjosiah): Query in react vs query in atom?
|
|
33
|
+
const chats = useQuery(space, query);
|
|
34
|
+
|
|
35
|
+
// Create stable reference for dependency array to avoid circular reference issues.
|
|
36
|
+
return useMenuActions(
|
|
37
|
+
useMemo(() => {
|
|
38
|
+
return Atom.make(() => {
|
|
39
|
+
const builder = MenuBuilder.make()
|
|
40
|
+
.root({
|
|
41
|
+
label: ['chat toolbar title', { ns: meta.id }],
|
|
42
|
+
})
|
|
43
|
+
.action(
|
|
44
|
+
'new',
|
|
45
|
+
{
|
|
46
|
+
label: ['new thread button', { ns: meta.id }],
|
|
47
|
+
icon: 'ph--plus--regular',
|
|
48
|
+
type: 'new',
|
|
49
|
+
},
|
|
50
|
+
() =>
|
|
51
|
+
dispatch(
|
|
52
|
+
createIntent(AssistantAction.SetCurrentChat, {
|
|
53
|
+
companionTo,
|
|
54
|
+
chat: undefined,
|
|
55
|
+
}),
|
|
56
|
+
).pipe(Effect.runPromise),
|
|
57
|
+
)
|
|
58
|
+
.action(
|
|
59
|
+
'rename',
|
|
60
|
+
{
|
|
61
|
+
label: ['rename thread button', { ns: meta.id }],
|
|
62
|
+
icon: 'ph--magic-wand--regular',
|
|
63
|
+
type: 'rename',
|
|
64
|
+
disabled: !chat,
|
|
65
|
+
},
|
|
66
|
+
() =>
|
|
67
|
+
Effect.gen(function* () {
|
|
68
|
+
invariant(chat);
|
|
69
|
+
yield* dispatch(createIntent(AssistantAction.UpdateChatName, { chat }));
|
|
70
|
+
}).pipe(Effect.runPromise),
|
|
71
|
+
)
|
|
72
|
+
.action(
|
|
73
|
+
'branch',
|
|
74
|
+
{
|
|
75
|
+
label: ['button branch thread', { ns: meta.id }],
|
|
76
|
+
icon: 'ph--git-branch--regular',
|
|
77
|
+
type: 'branch',
|
|
78
|
+
disabled: true,
|
|
79
|
+
},
|
|
80
|
+
() => {},
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
if (chats.length > 0) {
|
|
84
|
+
builder.group(
|
|
85
|
+
'chats',
|
|
86
|
+
{
|
|
87
|
+
label: ['chat history label', { ns: meta.id }],
|
|
88
|
+
icon: 'ph--clock-counter-clockwise--regular',
|
|
89
|
+
selectCardinality: 'single',
|
|
90
|
+
variant: 'dropdownMenu',
|
|
91
|
+
},
|
|
92
|
+
(builder) => {
|
|
93
|
+
chats
|
|
94
|
+
// TODO(wittjosiah): This should be the default sort order.
|
|
95
|
+
.toSorted((a, b) => a.id.localeCompare(b.id))
|
|
96
|
+
.forEach((chat) => {
|
|
97
|
+
builder.action(
|
|
98
|
+
chat.id,
|
|
99
|
+
{
|
|
100
|
+
label: Obj.getLabel(chat) ?? ['object name placeholder', { ns: Assistant.Chat.typename }],
|
|
101
|
+
},
|
|
102
|
+
() =>
|
|
103
|
+
Effect.gen(function* () {
|
|
104
|
+
invariant(companionTo);
|
|
105
|
+
yield* dispatch(
|
|
106
|
+
createIntent(AssistantAction.SetCurrentChat, {
|
|
107
|
+
companionTo,
|
|
108
|
+
chat,
|
|
109
|
+
}),
|
|
110
|
+
);
|
|
111
|
+
}).pipe(Effect.runPromise),
|
|
112
|
+
);
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return builder.build();
|
|
119
|
+
});
|
|
120
|
+
}, [chats.length, space?.id, companionTo?.id, chat?.id, dispatch]),
|
|
121
|
+
);
|
|
122
|
+
};
|
|
@@ -2,17 +2,29 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { AiContextBinder } from '@dxos/assistant';
|
|
8
|
+
import { type Queue } from '@dxos/react-client/echo';
|
|
9
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
// NOTE: This takes a queue rather than a chat because the chat may not be in a space yet.
|
|
12
|
+
export const useContextBinder = (queue: Queue | undefined): AiContextBinder | undefined => {
|
|
13
|
+
const [binder, setBinder] = useState<AiContextBinder>();
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
useAsyncEffect(async () => {
|
|
16
|
+
if (!queue) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const binder = new AiContextBinder(queue);
|
|
21
|
+
await binder.open();
|
|
22
|
+
setBinder(binder);
|
|
23
|
+
|
|
24
|
+
return () => {
|
|
25
|
+
void binder.close();
|
|
26
|
+
};
|
|
27
|
+
}, [queue]);
|
|
16
28
|
|
|
17
29
|
return binder;
|
|
18
30
|
};
|
|
@@ -35,7 +35,7 @@ export const useContextObjects = ({
|
|
|
35
35
|
|
|
36
36
|
// Load the object by DXN/id from the current space.
|
|
37
37
|
const id = dxn.asEchoDXN();
|
|
38
|
-
const object = id &&
|
|
38
|
+
const object = id && space.db.getObjectById(id.echoId);
|
|
39
39
|
if (!object) {
|
|
40
40
|
log.warn('Object not found', { dxn, id });
|
|
41
41
|
return;
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
6
6
|
import { useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { type Type } from '@dxos/echo';
|
|
9
|
+
import { EntityKind, SystemTypeAnnotation, getTypeAnnotation } from '@dxos/echo/internal';
|
|
9
10
|
import { type Space } from '@dxos/react-client/echo';
|
|
10
|
-
import { ItemAnnotation } from '@dxos/schema';
|
|
11
11
|
|
|
12
12
|
// TODO(burdon): Pass in filter.
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
// TODO(wittjosiah): Factor out.
|
|
14
|
+
export const useFilteredTypes = (space?: Space): Type.Entity.Any[] => {
|
|
15
|
+
const [types, setTypes] = useState<Type.Entity.Any[]>([]);
|
|
15
16
|
useEffect(() => {
|
|
16
17
|
if (!space) {
|
|
17
18
|
return;
|
|
@@ -21,9 +22,9 @@ export const useItemTypes = (space?: Space): Type.Obj.Any[] => {
|
|
|
21
22
|
(query) => {
|
|
22
23
|
const types = Array.from(
|
|
23
24
|
new Set(
|
|
24
|
-
[...space.db.graph.schemaRegistry.schemas, ...query.results]
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
[...space.db.graph.schemaRegistry.schemas, ...query.results]
|
|
26
|
+
.filter((schema) => getTypeAnnotation(schema)?.kind !== EntityKind.Relation)
|
|
27
|
+
.filter((schema) => SystemTypeAnnotation.get(schema).pipe(Option.getOrElse(() => false))),
|
|
27
28
|
),
|
|
28
29
|
);
|
|
29
30
|
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Capabilities
|
|
7
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
8
|
+
import { useCapabilities } from '@dxos/app-framework/react';
|
|
8
9
|
import { type Space } from '@dxos/client/echo';
|
|
9
10
|
import { Filter, Obj } from '@dxos/echo';
|
|
10
11
|
import { type ReferencesProvider } from '@dxos/react-ui-chat';
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -3,16 +3,19 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
export const ASSISTANT_PLUGIN = 'dxos.org/plugin/assistant';
|
|
8
|
-
|
|
9
|
-
export const ASSISTANT_DIALOG = `${ASSISTANT_PLUGIN}/assistant/dialog`;
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
10
7
|
|
|
11
8
|
export const meta: PluginMeta = {
|
|
12
|
-
id:
|
|
9
|
+
id: 'dxos.org/plugin/assistant',
|
|
13
10
|
name: 'Assistant',
|
|
14
|
-
description:
|
|
11
|
+
description: trim`
|
|
12
|
+
Intelligent AI assistant that can analyze and interact with objects across your spaces.
|
|
13
|
+
Chat naturally to get insights, search content, and perform actions using AI-powered context awareness.
|
|
14
|
+
`,
|
|
15
15
|
icon: 'ph--atom--regular',
|
|
16
|
+
iconHue: 'sky',
|
|
16
17
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-assistant',
|
|
17
18
|
tags: ['labs'],
|
|
18
19
|
};
|
|
20
|
+
|
|
21
|
+
export const ASSISTANT_DIALOG = `${meta.id}/assistant/dialog`;
|
package/src/processor/index.ts
CHANGED
package/src/processor/presets.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
7
|
import { type ModelName } from '@dxos/ai';
|
|
8
8
|
|
|
@@ -43,7 +43,7 @@ export const AiServicePresets: AiServicePreset[] = [
|
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
provider: 'lm-studio' as const,
|
|
46
|
-
model: '@
|
|
46
|
+
model: '@meta/llama-3.2-3b-instruct' as const,
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
model: 'deepseek-r1:latest' as const,
|