@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,8 +2,9 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
Capabilities,
|
|
@@ -13,15 +14,16 @@ import {
|
|
|
13
14
|
contributes,
|
|
14
15
|
createIntent,
|
|
15
16
|
} from '@dxos/app-framework';
|
|
17
|
+
import { Prompt } from '@dxos/blueprints';
|
|
16
18
|
import { Sequence } from '@dxos/conductor';
|
|
17
|
-
import { Obj } from '@dxos/echo';
|
|
19
|
+
import { DXN, Obj } from '@dxos/echo';
|
|
18
20
|
import { invariant } from '@dxos/invariant';
|
|
19
21
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
20
22
|
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
21
|
-
import { ROOT_ID,
|
|
23
|
+
import { ROOT_ID, atomFromSignal, createExtension } from '@dxos/plugin-graph';
|
|
22
24
|
import { getActiveSpace } from '@dxos/plugin-space';
|
|
23
25
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
24
|
-
import { Query, type Space,
|
|
26
|
+
import { Query, type Space, getSpace } from '@dxos/react-client/echo';
|
|
25
27
|
|
|
26
28
|
import { ASSISTANT_DIALOG, meta } from '../meta';
|
|
27
29
|
import { Assistant, AssistantAction } from '../types';
|
|
@@ -30,11 +32,42 @@ import { AssistantCapabilities } from './capabilities';
|
|
|
30
32
|
|
|
31
33
|
export default (context: PluginContext) =>
|
|
32
34
|
contributes(Capabilities.AppGraphBuilder, [
|
|
35
|
+
createExtension({
|
|
36
|
+
id: `${meta.id}/root`,
|
|
37
|
+
actions: (node) =>
|
|
38
|
+
Atom.make((get) =>
|
|
39
|
+
Function.pipe(
|
|
40
|
+
get(node),
|
|
41
|
+
Option.flatMap((node) => {
|
|
42
|
+
return Obj.instanceOf(Assistant.Chat, node.data) ? Option.some(node.data) : Option.none();
|
|
43
|
+
}),
|
|
44
|
+
Option.map((object) => {
|
|
45
|
+
const id = Obj.getDXN(object).toString();
|
|
46
|
+
return [
|
|
47
|
+
{
|
|
48
|
+
id: `${AssistantAction.UpdateChatName._tag}/${id}`,
|
|
49
|
+
data: async () => {
|
|
50
|
+
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
51
|
+
await dispatch(createIntent(AssistantAction.UpdateChatName, { chat: object }));
|
|
52
|
+
},
|
|
53
|
+
properties: {
|
|
54
|
+
label: ['chat update name label', { ns: meta.id }],
|
|
55
|
+
icon: 'ph--magic-wand--regular',
|
|
56
|
+
disposition: 'list-item',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
}),
|
|
61
|
+
Option.getOrElse(() => []),
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
}),
|
|
65
|
+
|
|
33
66
|
createExtension({
|
|
34
67
|
id: `${meta.id}/assistant`,
|
|
35
68
|
actions: (node) =>
|
|
36
|
-
|
|
37
|
-
pipe(
|
|
69
|
+
Atom.make((get) =>
|
|
70
|
+
Function.pipe(
|
|
38
71
|
get(node),
|
|
39
72
|
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
40
73
|
Option.map(() => [
|
|
@@ -83,20 +116,31 @@ export default (context: PluginContext) =>
|
|
|
83
116
|
createExtension({
|
|
84
117
|
id: `${meta.id}/companion-chat`,
|
|
85
118
|
connector: (node) => {
|
|
86
|
-
return
|
|
87
|
-
pipe(
|
|
119
|
+
return Atom.make((get) =>
|
|
120
|
+
Function.pipe(
|
|
88
121
|
get(node),
|
|
89
122
|
Option.flatMap((node) => (Obj.isObject(node.data) ? Option.some(node.data) : Option.none())),
|
|
90
|
-
Option.
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
() => context.getCapability(AssistantCapabilities.State).currentChat[
|
|
123
|
+
Option.flatMap((object): Option.Option<{ object: Obj.Any; currentChat: Obj.Any | undefined }> => {
|
|
124
|
+
const currentChatState = get(
|
|
125
|
+
atomFromSignal(
|
|
126
|
+
() => context.getCapability(AssistantCapabilities.State).currentChat[Obj.getDXN(object).toString()],
|
|
94
127
|
),
|
|
95
128
|
);
|
|
129
|
+
// If no state, continue to allow chat initialization.
|
|
130
|
+
if (!currentChatState) {
|
|
131
|
+
return Option.some({ object, currentChat: undefined });
|
|
132
|
+
}
|
|
96
133
|
|
|
134
|
+
const space = getSpace(object);
|
|
135
|
+
const currentChatDxn = DXN.tryParse(currentChatState);
|
|
136
|
+
const currentChatRef = currentChatDxn ? space?.db.makeRef(currentChatDxn) : undefined;
|
|
137
|
+
const currentChat = get(atomFromSignal(() => currentChatRef?.target));
|
|
138
|
+
return Obj.isObject(currentChat) ? Option.some({ object, currentChat }) : Option.none();
|
|
139
|
+
}),
|
|
140
|
+
Option.map(({ object, currentChat }) => {
|
|
97
141
|
return [
|
|
98
142
|
{
|
|
99
|
-
id: [
|
|
143
|
+
id: [Obj.getDXN(object).toString(), 'assistant-chat'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
100
144
|
type: PLANK_COMPANION_TYPE,
|
|
101
145
|
data: currentChat ?? 'assistant-chat',
|
|
102
146
|
properties: {
|
|
@@ -115,19 +159,23 @@ export default (context: PluginContext) =>
|
|
|
115
159
|
}),
|
|
116
160
|
|
|
117
161
|
createExtension({
|
|
118
|
-
id: `${meta.id}/
|
|
162
|
+
id: `${meta.id}/invocations`,
|
|
119
163
|
connector: (node) =>
|
|
120
|
-
|
|
121
|
-
pipe(
|
|
164
|
+
Atom.make((get) =>
|
|
165
|
+
Function.pipe(
|
|
122
166
|
get(node),
|
|
123
|
-
Option.flatMap((node) =>
|
|
167
|
+
Option.flatMap((node) =>
|
|
168
|
+
Obj.instanceOf(Sequence, node.data) || Obj.instanceOf(Prompt.Prompt, node.data)
|
|
169
|
+
? Option.some(node)
|
|
170
|
+
: Option.none(),
|
|
171
|
+
),
|
|
124
172
|
Option.map((node) => [
|
|
125
173
|
{
|
|
126
|
-
id: [node.id, '
|
|
174
|
+
id: [node.id, 'invocations'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
127
175
|
type: PLANK_COMPANION_TYPE,
|
|
128
|
-
data: '
|
|
176
|
+
data: 'invocations',
|
|
129
177
|
properties: {
|
|
130
|
-
label: ['
|
|
178
|
+
label: ['invocations label', { ns: meta.id }],
|
|
131
179
|
icon: 'ph--clock-countdown--regular',
|
|
132
180
|
disposition: 'hidden',
|
|
133
181
|
},
|
|
@@ -4,31 +4,39 @@
|
|
|
4
4
|
|
|
5
5
|
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
6
6
|
import { templates } from '@dxos/assistant';
|
|
7
|
+
import {
|
|
8
|
+
Agent,
|
|
9
|
+
AssistantToolkit,
|
|
10
|
+
Discord,
|
|
11
|
+
DiscordBlueprint,
|
|
12
|
+
EntityExtraction,
|
|
13
|
+
Linear,
|
|
14
|
+
LinearBlueprint,
|
|
15
|
+
Research,
|
|
16
|
+
ResearchBlueprint,
|
|
17
|
+
SystemToolkit,
|
|
18
|
+
WebSearchBlueprint,
|
|
19
|
+
} from '@dxos/assistant-toolkit';
|
|
7
20
|
import { Blueprint } from '@dxos/blueprints';
|
|
8
21
|
import { type FunctionDefinition } from '@dxos/functions';
|
|
9
22
|
|
|
10
23
|
import { analysis, list, load } from '../functions';
|
|
11
24
|
|
|
25
|
+
// TODO(burdon): Document plugin structure (blueprint, functions, toolkit.)
|
|
26
|
+
// TODO(burdon): Test framework for developing functions. Error handling.
|
|
27
|
+
// TODO(burdon): Function naming pattern (noun-verb); fully-qualified?
|
|
28
|
+
|
|
29
|
+
// TODO(wittjosiah): Factor out to a generic app-framework blueprint.
|
|
30
|
+
const deckTools = ['open-item'];
|
|
31
|
+
|
|
12
32
|
const functions: FunctionDefinition[] = [analysis, list, load];
|
|
13
|
-
const tools = [
|
|
14
|
-
'add-to-context',
|
|
15
|
-
// TODO(wittjosiah): Factor out to an ECHO blueprint.
|
|
16
|
-
'get-schemas',
|
|
17
|
-
'add-schema',
|
|
18
|
-
'create-record',
|
|
19
|
-
// TODO(wittjosiah): Factor out to a generic app-framework blueprint.
|
|
20
|
-
'open-item',
|
|
21
|
-
// TODO(burdon): Anthropic only.
|
|
22
|
-
// https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool#example-str-replace-command
|
|
23
|
-
// AI_TOOL_NOT_FOUND: str_replace_based_edit_tool
|
|
24
|
-
// 'str_replace_based_edit_tool',
|
|
25
|
-
];
|
|
33
|
+
const tools = [...AssistantToolkit.tools, ...SystemToolkit.tools, ...deckTools];
|
|
26
34
|
|
|
27
|
-
export const
|
|
35
|
+
export const ASSISTANT_BLUEPRINT_KEY = 'dxos.org/blueprint/assistant';
|
|
28
36
|
|
|
29
37
|
export const createBlueprint = (): Blueprint.Blueprint =>
|
|
30
38
|
Blueprint.make({
|
|
31
|
-
key:
|
|
39
|
+
key: ASSISTANT_BLUEPRINT_KEY,
|
|
32
40
|
name: 'Assistant',
|
|
33
41
|
tools: Blueprint.toolDefinitions({ functions, tools }),
|
|
34
42
|
instructions: templates.system,
|
|
@@ -39,4 +47,20 @@ const blueprint = createBlueprint();
|
|
|
39
47
|
export default (): Capability<any>[] => [
|
|
40
48
|
contributes(Capabilities.Functions, functions),
|
|
41
49
|
contributes(Capabilities.BlueprintDefinition, blueprint),
|
|
50
|
+
|
|
51
|
+
// TODO(burdon): Factor out.
|
|
52
|
+
contributes(Capabilities.Functions, [Research.create, Research.research]),
|
|
53
|
+
contributes(Capabilities.BlueprintDefinition, ResearchBlueprint),
|
|
54
|
+
|
|
55
|
+
// TODO(burdon): Factor out.
|
|
56
|
+
contributes(Capabilities.Functions, [Agent.prompt, EntityExtraction.extract]),
|
|
57
|
+
contributes(Capabilities.BlueprintDefinition, WebSearchBlueprint),
|
|
58
|
+
|
|
59
|
+
// TODO(burdon): Factor out.
|
|
60
|
+
contributes(Capabilities.Functions, [Discord.fetch]),
|
|
61
|
+
contributes(Capabilities.BlueprintDefinition, DiscordBlueprint),
|
|
62
|
+
|
|
63
|
+
// TODO(burdon): Factor out.
|
|
64
|
+
contributes(Capabilities.Functions, [Linear.sync]),
|
|
65
|
+
contributes(Capabilities.BlueprintDefinition, LinearBlueprint),
|
|
42
66
|
];
|
|
@@ -2,30 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Layer } from 'effect';
|
|
6
|
-
|
|
7
|
-
import { type AiService, type AiServiceRouter } from '@dxos/ai';
|
|
8
5
|
import { defineCapability } from '@dxos/app-framework';
|
|
9
6
|
import { type DeepReadonly } from '@dxos/util';
|
|
10
7
|
|
|
11
8
|
import { meta } from '../meta';
|
|
12
|
-
import { type Assistant } from '../types';
|
|
13
9
|
|
|
14
10
|
export namespace AssistantCapabilities {
|
|
15
11
|
export type AssistantState = {
|
|
16
|
-
/** Map of primary object
|
|
17
|
-
currentChat: Record<string,
|
|
12
|
+
/** Map of primary object dxn to current chat dxn. */
|
|
13
|
+
currentChat: Record<string, string | undefined>;
|
|
18
14
|
};
|
|
19
15
|
export const State = defineCapability<DeepReadonly<AssistantState>>(`${meta.id}/capability/state`);
|
|
20
16
|
export const MutableState = defineCapability<AssistantState>(`${meta.id}/capability/state`);
|
|
21
|
-
|
|
22
|
-
export type AiServiceLayer = Layer.Layer<AiService.AiService>;
|
|
23
|
-
export const AiServiceLayer = defineCapability<AiServiceLayer>(`${meta.id}/capability/ai-service-factory`);
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Plugins can contribute them to provide model resolvers.
|
|
27
|
-
*/
|
|
28
|
-
export const AiModelResolver = defineCapability<Layer.Layer<AiServiceRouter.AiModelResolver>>(
|
|
29
|
-
`${meta.id}/capability/ai-model-resolver`,
|
|
30
|
-
);
|
|
31
17
|
}
|
|
@@ -3,17 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as AnthropicClient from '@effect/ai-anthropic/AnthropicClient';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
8
8
|
|
|
9
|
-
import
|
|
10
|
-
import { type Capability, contributes } from '@dxos/app-framework';
|
|
11
|
-
|
|
12
|
-
import { AssistantCapabilities } from './capabilities';
|
|
9
|
+
import * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
10
|
+
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
13
11
|
|
|
14
12
|
export default (): Capability<any>[] => [
|
|
15
13
|
contributes(
|
|
16
|
-
|
|
14
|
+
Capabilities.AiModelResolver,
|
|
17
15
|
AiServiceRouter.AnthropicResolver.pipe(
|
|
18
16
|
Layer.provide(
|
|
19
17
|
AnthropicClient.layer({
|
|
@@ -12,6 +12,7 @@ export const EdgeModelResolver = lazy(() => import('./edge-model-resolver'));
|
|
|
12
12
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
13
13
|
export const LocalModelResolver = lazy(() => import('./local-model-resolver'));
|
|
14
14
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
15
|
+
export const Repair = lazy(() => import('./repair'));
|
|
15
16
|
export const Settings = lazy(() => import('./settings'));
|
|
16
17
|
export const Toolkit = lazy(() => import('./toolkit'));
|
|
17
18
|
|
|
@@ -2,35 +2,45 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
8
|
-
import { AiContextBinder } from '@dxos/assistant';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { AiContextBinder, AiConversation } from '@dxos/assistant';
|
|
9
|
+
import { Agent } from '@dxos/assistant-toolkit';
|
|
10
|
+
import { Blueprint, Prompt, Template } from '@dxos/blueprints';
|
|
11
|
+
import { type Queue } from '@dxos/client/echo';
|
|
11
12
|
import { Sequence } from '@dxos/conductor';
|
|
12
|
-
import { Filter, Key, Obj, Ref } from '@dxos/echo';
|
|
13
|
-
import {
|
|
13
|
+
import { Filter, Key, Obj, Ref, Type } from '@dxos/echo';
|
|
14
|
+
import { TracingService, serializeFunction } from '@dxos/functions';
|
|
15
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
16
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
17
|
+
import { Collection } from '@dxos/schema';
|
|
18
|
+
import { type Message } from '@dxos/types';
|
|
14
19
|
|
|
20
|
+
import { type AiChatServices, updateName } from '../processor';
|
|
15
21
|
import { Assistant, AssistantAction } from '../types';
|
|
16
22
|
|
|
17
|
-
import {
|
|
23
|
+
import { ASSISTANT_BLUEPRINT_KEY, createBlueprint } from './blueprint-definition';
|
|
18
24
|
import { AssistantCapabilities } from './capabilities';
|
|
19
25
|
|
|
20
26
|
export default (context: PluginContext) => [
|
|
21
27
|
contributes(Capabilities.IntentResolver, [
|
|
22
28
|
createResolver({
|
|
23
|
-
intent: AssistantAction.
|
|
29
|
+
intent: AssistantAction.OnCreateSpace,
|
|
24
30
|
resolve: ({ space, rootCollection }) =>
|
|
25
31
|
Effect.gen(function* () {
|
|
26
32
|
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
27
|
-
const {
|
|
28
|
-
|
|
33
|
+
const chatCollection = Collection.makeManaged({ key: Assistant.Chat.typename });
|
|
34
|
+
const blueprintCollection = Collection.makeManaged({ key: Blueprint.Blueprint.typename });
|
|
35
|
+
const promptCollection = Collection.makeManaged({ key: Type.getTypename(Prompt.Prompt) });
|
|
36
|
+
rootCollection.objects.push(
|
|
37
|
+
Ref.make(chatCollection),
|
|
38
|
+
Ref.make(blueprintCollection),
|
|
39
|
+
Ref.make(promptCollection),
|
|
29
40
|
);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
);
|
|
33
|
-
rootCollection.objects.push(Ref.make(chatCollection), Ref.make(blueprintCollection));
|
|
41
|
+
|
|
42
|
+
// TODO(wittjosiah): Remove once function registry is avaiable.
|
|
43
|
+
space.db.add(serializeFunction(Agent.prompt));
|
|
34
44
|
|
|
35
45
|
// Create default chat.
|
|
36
46
|
const { object: chat } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
@@ -41,28 +51,59 @@ export default (context: PluginContext) => [
|
|
|
41
51
|
intent: AssistantAction.CreateChat,
|
|
42
52
|
resolve: async ({ space, name }) => {
|
|
43
53
|
const queue = space.queues.create();
|
|
44
|
-
const chat =
|
|
45
|
-
|
|
54
|
+
const chat = Assistant.makeChat({ name, queue });
|
|
55
|
+
|
|
46
56
|
// TODO(wittjosiah): This should be a space-level setting.
|
|
47
57
|
// TODO(burdon): Clone when activated. Copy-on-write for template.
|
|
48
|
-
|
|
58
|
+
const { objects: blueprints } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
59
|
+
let defaultBlueprint = blueprints.find((blueprint) => blueprint.key === ASSISTANT_BLUEPRINT_KEY);
|
|
49
60
|
if (!defaultBlueprint) {
|
|
50
61
|
defaultBlueprint = space.db.add(createBlueprint());
|
|
51
62
|
}
|
|
52
63
|
|
|
53
64
|
const binder = new AiContextBinder(queue);
|
|
54
|
-
await binder.bind({ blueprints: [Ref.make(defaultBlueprint)] });
|
|
65
|
+
await binder.use((binder) => binder.bind({ blueprints: [Ref.make(defaultBlueprint)] }));
|
|
55
66
|
|
|
56
67
|
return {
|
|
57
68
|
data: { object: chat },
|
|
58
69
|
};
|
|
59
70
|
},
|
|
60
71
|
}),
|
|
72
|
+
createResolver({
|
|
73
|
+
intent: AssistantAction.UpdateChatName,
|
|
74
|
+
resolve: async ({ chat }) => {
|
|
75
|
+
const space = getSpace(chat);
|
|
76
|
+
const queue = chat.queue.target as Queue<Message.Message>;
|
|
77
|
+
if (!space || !queue) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const runtimeResolver = context.getCapability(AutomationCapabilities.ComputeRuntime);
|
|
82
|
+
const runtime = await runtimeResolver
|
|
83
|
+
.getRuntime(space.id)
|
|
84
|
+
.runPromise(Effect.runtime<AiChatServices>().pipe(Effect.provide(TracingService.layerNoop)));
|
|
85
|
+
|
|
86
|
+
await new AiConversation(queue).use(async (conversation) => updateName(runtime, conversation, chat));
|
|
87
|
+
},
|
|
88
|
+
}),
|
|
61
89
|
createResolver({
|
|
62
90
|
intent: AssistantAction.CreateBlueprint,
|
|
63
91
|
resolve: ({ key, name, description }) => ({
|
|
64
92
|
data: {
|
|
65
|
-
object: Blueprint.make({
|
|
93
|
+
object: Blueprint.make({
|
|
94
|
+
key,
|
|
95
|
+
name,
|
|
96
|
+
description,
|
|
97
|
+
instructions: Template.make(),
|
|
98
|
+
}),
|
|
99
|
+
},
|
|
100
|
+
}),
|
|
101
|
+
}),
|
|
102
|
+
createResolver({
|
|
103
|
+
intent: AssistantAction.CreatePrompt,
|
|
104
|
+
resolve: ({ name }) => ({
|
|
105
|
+
data: {
|
|
106
|
+
object: Prompt.make({ name }),
|
|
66
107
|
},
|
|
67
108
|
}),
|
|
68
109
|
}),
|
|
@@ -87,7 +128,7 @@ export default (context: PluginContext) => [
|
|
|
87
128
|
resolve: ({ companionTo, chat }) =>
|
|
88
129
|
Effect.gen(function* () {
|
|
89
130
|
const state = context.getCapability(AssistantCapabilities.MutableState);
|
|
90
|
-
state.currentChat[
|
|
131
|
+
state.currentChat[Obj.getDXN(companionTo).toString()] = chat && Obj.getDXN(chat).toString();
|
|
91
132
|
}),
|
|
92
133
|
}),
|
|
93
134
|
]),
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import * as OpenAiClient from '@effect/ai-openai/OpenAiClient';
|
|
6
|
+
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
8
8
|
|
|
9
|
-
import
|
|
10
|
-
import { type Capability, contributes } from '@dxos/app-framework';
|
|
11
|
-
|
|
12
|
-
import { AssistantCapabilities } from './capabilities';
|
|
9
|
+
import * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
10
|
+
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
13
|
* To start LM Studio server:
|
|
@@ -19,11 +17,11 @@ import { AssistantCapabilities } from './capabilities';
|
|
|
19
17
|
*/
|
|
20
18
|
export default (): Capability<any>[] => [
|
|
21
19
|
contributes(
|
|
22
|
-
|
|
20
|
+
Capabilities.AiModelResolver,
|
|
23
21
|
AiServiceRouter.LMStudioResolver.pipe(
|
|
24
22
|
Layer.provide(
|
|
25
23
|
OpenAiClient.layer({
|
|
26
|
-
apiUrl: AiServiceRouter.
|
|
24
|
+
apiUrl: AiServiceRouter.DEFAULT_LMSTUDIO_ENDPOINT,
|
|
27
25
|
}),
|
|
28
26
|
),
|
|
29
27
|
Layer.provide(FetchHttpClient.layer),
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
8
|
+
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
9
9
|
import { getSpace } from '@dxos/client/echo';
|
|
10
10
|
import { Sequence } from '@dxos/conductor';
|
|
11
11
|
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
@@ -15,12 +15,11 @@ import { StackItem } from '@dxos/react-ui-stack';
|
|
|
15
15
|
|
|
16
16
|
import {
|
|
17
17
|
AssistantSettings,
|
|
18
|
-
|
|
18
|
+
BlueprintArticle,
|
|
19
19
|
ChatCompanion,
|
|
20
20
|
ChatContainer,
|
|
21
21
|
ChatDialog,
|
|
22
|
-
|
|
23
|
-
SequenceContainer,
|
|
22
|
+
PromptArticle,
|
|
24
23
|
} from '../components';
|
|
25
24
|
import { ASSISTANT_DIALOG, meta } from '../meta';
|
|
26
25
|
import { Assistant } from '../types';
|
|
@@ -41,6 +40,7 @@ export default () =>
|
|
|
41
40
|
Obj.instanceOf(Assistant.Chat, data.subject) && data.variant !== 'assistant-chat',
|
|
42
41
|
component: ({ data, role }) => <ChatContainer role={role} chat={data.subject} />,
|
|
43
42
|
}),
|
|
43
|
+
// TODO(wittjosiah): This is flashing when chat changes.
|
|
44
44
|
createSurface({
|
|
45
45
|
id: `${meta.id}/companion-chat`,
|
|
46
46
|
role: 'article',
|
|
@@ -50,22 +50,18 @@ export default () =>
|
|
|
50
50
|
component: ({ data, role }) => <ChatCompanion role={role} data={data} />,
|
|
51
51
|
}),
|
|
52
52
|
createSurface({
|
|
53
|
-
id: `${meta.id}/
|
|
54
|
-
role: 'article',
|
|
55
|
-
filter: (data): data is { subject: Sequence } => Obj.instanceOf(Sequence, data.subject),
|
|
56
|
-
component: ({ data }) => <SequenceContainer sequence={data.subject} />,
|
|
57
|
-
}),
|
|
58
|
-
createSurface({
|
|
59
|
-
id: `${meta.id}/companion-logs`,
|
|
53
|
+
id: `${meta.id}/companion-invocations`,
|
|
60
54
|
role: 'article',
|
|
61
55
|
filter: (data): data is { companionTo: Sequence } =>
|
|
62
|
-
Obj.instanceOf(Sequence, data.companionTo)
|
|
63
|
-
|
|
64
|
-
component: ({ data
|
|
56
|
+
(Obj.instanceOf(Sequence, data.companionTo) || Obj.instanceOf(Prompt.Prompt, data.companionTo)) &&
|
|
57
|
+
data.subject === 'invocations',
|
|
58
|
+
component: ({ data }) => {
|
|
65
59
|
const space = getSpace(data.companionTo);
|
|
60
|
+
// TODO(wittjosiah): Support invocation filtering for prompts.
|
|
61
|
+
const target = Obj.instanceOf(Prompt.Prompt, data.companionTo) ? undefined : data.companionTo;
|
|
66
62
|
return (
|
|
67
63
|
<StackItem.Content>
|
|
68
|
-
<InvocationTraceContainer space={space} target={
|
|
64
|
+
<InvocationTraceContainer space={space} target={target} detailAxis='block' />
|
|
69
65
|
</StackItem.Content>
|
|
70
66
|
);
|
|
71
67
|
},
|
|
@@ -74,13 +70,13 @@ export default () =>
|
|
|
74
70
|
id: `${meta.id}/blueprint`,
|
|
75
71
|
role: 'article',
|
|
76
72
|
filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
|
|
77
|
-
component: ({ data }) => <
|
|
73
|
+
component: ({ data }) => <BlueprintArticle subject={data.subject} />,
|
|
78
74
|
}),
|
|
79
75
|
createSurface({
|
|
80
|
-
id: `${meta.id}/prompt
|
|
81
|
-
role: '
|
|
82
|
-
filter: (data): data is { subject:
|
|
83
|
-
component: ({ data }) => <
|
|
76
|
+
id: `${meta.id}/prompt`,
|
|
77
|
+
role: 'article',
|
|
78
|
+
filter: (data): data is { subject: Prompt.Prompt } => Obj.instanceOf(Prompt.Prompt, data.subject),
|
|
79
|
+
component: ({ data }) => <PromptArticle subject={data.subject} />,
|
|
84
80
|
}),
|
|
85
81
|
createSurface({
|
|
86
82
|
id: ASSISTANT_DIALOG,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { contributes } from '@dxos/app-framework';
|
|
6
|
+
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
7
|
+
import { Obj, Ref, Type } from '@dxos/echo';
|
|
8
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
9
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
10
|
+
import { Collection } from '@dxos/schema';
|
|
11
|
+
|
|
12
|
+
import { Assistant } from '../types';
|
|
13
|
+
|
|
14
|
+
export default () =>
|
|
15
|
+
contributes(SpaceCapabilities.Repair, async ({ space }) => {
|
|
16
|
+
await ensureSystemCollections(space);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Ensure the root collection has system collections for AI Chats, Blueprints, and Prompts.
|
|
21
|
+
*/
|
|
22
|
+
const ensureSystemCollections = async (space: Space) => {
|
|
23
|
+
const rootCollection: Collection.Collection = await space.properties[Collection.Collection.typename]?.load();
|
|
24
|
+
if (!rootCollection) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const objects = await Promise.all(rootCollection.objects.map((ref) => ref.load()));
|
|
29
|
+
const chats = objects.find(
|
|
30
|
+
(object) => Obj.instanceOf(Collection.Managed, object) && object.key === Assistant.Chat.typename,
|
|
31
|
+
);
|
|
32
|
+
if (!chats) {
|
|
33
|
+
rootCollection.objects.push(Ref.make(Collection.makeManaged({ key: Assistant.Chat.typename })));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const blueprints = objects.find(
|
|
37
|
+
(object) => Obj.instanceOf(Collection.Managed, object) && object.key === Blueprint.Blueprint.typename,
|
|
38
|
+
);
|
|
39
|
+
if (!blueprints) {
|
|
40
|
+
rootCollection.objects.push(Ref.make(Collection.makeManaged({ key: Blueprint.Blueprint.typename })));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const prompts = objects.find(
|
|
44
|
+
(object) => Obj.instanceOf(Collection.Managed, object) && object.key === Type.getTypename(Prompt.Prompt),
|
|
45
|
+
);
|
|
46
|
+
if (!prompts) {
|
|
47
|
+
rootCollection.objects.push(Ref.make(Collection.makeManaged({ key: Type.getTypename(Prompt.Prompt) })));
|
|
48
|
+
}
|
|
49
|
+
};
|