@dxos/plugin-assistant 0.8.4-main.28f8d3d → 0.8.4-main.2c6827d
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-IMCR3642.mjs +36 -0
- package/dist/lib/browser/BlueprintArticle-IMCR3642.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-4MS4NMZY.mjs +158 -0
- package/dist/lib/browser/ChatCompanion-4MS4NMZY.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-OUVSX5V5.mjs → ChatContainer-GJZN3SIJ.mjs} +27 -26
- package/dist/lib/browser/ChatContainer-GJZN3SIJ.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-P4FLEOHG.mjs → ChatDialog-E2X6DTDX.mjs} +17 -13
- package/dist/lib/browser/ChatDialog-E2X6DTDX.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-45QX25Y5.mjs +59 -0
- package/dist/lib/browser/PromptArticle-45QX25Y5.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-AVHHQ3KV.mjs → app-graph-builder-VZEXMDTY.mjs} +72 -39
- package/dist/lib/browser/app-graph-builder-VZEXMDTY.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-5FT5JGPY.mjs +12 -0
- package/dist/lib/browser/blueprint-definition-5FT5JGPY.mjs.map +7 -0
- package/dist/lib/browser/chunk-2BOE3OTW.mjs +262 -0
- package/dist/lib/browser/chunk-2BOE3OTW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HRLMD35M.mjs → chunk-BNTPFZ7O.mjs} +60 -22
- package/dist/lib/browser/chunk-BNTPFZ7O.mjs.map +7 -0
- package/dist/lib/browser/chunk-FJQ4ZRYJ.mjs +335 -0
- package/dist/lib/browser/chunk-FJQ4ZRYJ.mjs.map +7 -0
- package/dist/lib/browser/{blueprint-definition-CMGIZAOW.mjs → chunk-IXIIS4QA.mjs} +78 -48
- package/dist/lib/browser/chunk-IXIIS4QA.mjs.map +7 -0
- package/dist/lib/browser/chunk-LRE4VEZV.mjs +16 -0
- package/dist/lib/browser/chunk-LRE4VEZV.mjs.map +7 -0
- package/dist/lib/browser/chunk-TCAQJ26D.mjs +1929 -0
- package/dist/lib/browser/chunk-TCAQJ26D.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 +162 -73
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-AK5O4GUW.mjs +143 -0
- package/dist/lib/browser/intent-resolver-AK5O4GUW.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-XWAR5ZVL.mjs +98 -0
- package/dist/lib/browser/react-surface-XWAR5ZVL.mjs.map +7 -0
- package/dist/lib/browser/{settings-G2EZXMWT.mjs → settings-NYJGNQ5I.mjs} +5 -5
- package/dist/lib/browser/{settings-G2EZXMWT.mjs.map → settings-NYJGNQ5I.mjs.map} +1 -1
- package/dist/lib/browser/state-GG7Z3NB7.mjs +25 -0
- package/dist/lib/browser/state-GG7Z3NB7.mjs.map +7 -0
- 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-OL2HUY6Q.mjs +37 -0
- package/dist/lib/node-esm/BlueprintArticle-OL2HUY6Q.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-TYRR7BXD.mjs +159 -0
- package/dist/lib/node-esm/ChatCompanion-TYRR7BXD.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-D5FABDNE.mjs → ChatContainer-MT4INE7Z.mjs} +27 -26
- package/dist/lib/node-esm/ChatContainer-MT4INE7Z.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-NKWVXHJP.mjs → ChatDialog-G4EWBIJM.mjs} +17 -13
- package/dist/lib/node-esm/ChatDialog-G4EWBIJM.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-OUKFSJQV.mjs +60 -0
- package/dist/lib/node-esm/PromptArticle-OUKFSJQV.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-RMOUJMMG.mjs → app-graph-builder-VRN6ESRR.mjs} +72 -39
- package/dist/lib/node-esm/app-graph-builder-VRN6ESRR.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-XW6QQVLV.mjs +13 -0
- package/dist/lib/node-esm/blueprint-definition-XW6QQVLV.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-F7RXCX5Y.mjs → chunk-AB74FOA2.mjs} +60 -22
- package/dist/lib/node-esm/chunk-AB74FOA2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KJGD4EBJ.mjs +336 -0
- package/dist/lib/node-esm/chunk-KJGD4EBJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KM24SYPM.mjs +1930 -0
- package/dist/lib/node-esm/chunk-KM24SYPM.mjs.map +7 -0
- package/dist/lib/node-esm/{blueprint-definition-AEWYMW6I.mjs → chunk-UXTUHH24.mjs} +78 -47
- package/dist/lib/node-esm/chunk-UXTUHH24.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-X6AANUHZ.mjs → chunk-YWFWT57N.mjs} +4 -4
- package/dist/lib/node-esm/chunk-YWFWT57N.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 +162 -73
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-L2F3N45L.mjs +144 -0
- package/dist/lib/node-esm/intent-resolver-L2F3N45L.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-JXB7Q6QR.mjs +99 -0
- package/dist/lib/node-esm/react-surface-JXB7Q6QR.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-AIP5FOJG.mjs → settings-RRHYI5KO.mjs} +5 -5
- package/dist/lib/node-esm/{settings-AIP5FOJG.mjs.map → settings-RRHYI5KO.mjs.map} +1 -1
- package/dist/lib/node-esm/state-FSUHFMDM.mjs +26 -0
- package/dist/lib/node-esm/state-FSUHFMDM.mjs.map +7 -0
- 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 +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +7 -8
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +2 -3
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +7 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +10 -0
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +4 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit.d.ts +2 -3
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.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 +32 -16
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +9 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +13 -0
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer.d.ts +8 -6
- 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 +7 -0
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
- package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
- package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +11 -4
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -4
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +12 -10
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +191 -82
- 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 +40 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +1 -0
- 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 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +312 -7
- 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 +309 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts +12 -0
- 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 +3 -5
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +314 -5
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -7
- 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} +3 -3
- package/dist/types/src/functions/object-load.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +5 -4
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +3 -7
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -5
- 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 +4 -0
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/useItemTypes.d.ts +4 -0
- package/dist/types/src/hooks/useItemTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +2 -2
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
- 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 +4 -0
- package/dist/types/src/processor/index.d.ts.map +1 -0
- package/dist/types/src/{hooks → processor}/presets.d.ts +1 -1
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +74 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts +2 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- 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 -1
- 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-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- 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 +257 -33
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +15 -7
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +49 -7
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +21 -12
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +96 -97
- package/src/AssistantPlugin.tsx +156 -116
- package/src/capabilities/ai-service.ts +6 -7
- package/src/capabilities/app-graph-builder.ts +95 -54
- package/src/capabilities/blueprint-definition.ts +56 -22
- package/src/capabilities/capabilities.ts +7 -12
- package/src/capabilities/edge-model-resolver.ts +17 -21
- package/src/capabilities/index.ts +5 -2
- package/src/capabilities/intent-resolver.ts +91 -17
- package/src/capabilities/local-model-resolver.ts +30 -0
- package/src/capabilities/react-surface.tsx +23 -81
- package/src/capabilities/state.ts +22 -0
- package/src/capabilities/toolkit.ts +9 -98
- package/src/components/AssistantSettings/AssistantSettings.tsx +82 -75
- package/src/components/BlueprintArticle.tsx +29 -0
- package/src/components/Chat/Chat.tsx +252 -222
- package/src/components/Chat/events.ts +13 -0
- package/src/components/ChatCompanion.tsx +155 -0
- package/src/components/ChatContainer.tsx +33 -41
- package/src/components/ChatDialog.tsx +19 -12
- package/src/components/ChatProgress/ChatProgress.tsx +67 -0
- package/src/components/{Timeline → ChatProgress}/index.ts +1 -1
- package/src/components/ChatPrompt/ChatActions.tsx +10 -26
- package/src/components/ChatPrompt/ChatOptions.tsx +203 -34
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +29 -36
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatThread/ChatThread.stories.tsx +92 -204
- package/src/components/ChatThread/ChatThread.tsx +65 -35
- package/src/components/ChatThread/Link.tsx +8 -21
- package/src/components/ChatThread/reducers.ts +151 -0
- 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 +29 -15
- package/src/components/TemplateEditor/TemplateEditor.tsx +28 -53
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +7 -9
- package/src/components/TemplateEditor/TemplateForm.tsx +3 -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/ToolBlock/ToolBlock.tsx +143 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +11 -14
- package/src/components/Toolbox/Toolbox.tsx +15 -21
- package/src/components/index.ts +3 -4
- package/src/functions/analysis.ts +5 -3
- package/src/functions/index.ts +2 -2
- package/src/functions/{list.ts → object-list.ts} +11 -5
- package/src/functions/{load.ts → object-load.ts} +9 -7
- package/src/hooks/index.ts +5 -5
- package/src/hooks/useBlueprintRegistry.ts +26 -10
- package/src/hooks/useChatProcessor.ts +26 -33
- package/src/hooks/useChatServices.ts +32 -53
- package/src/hooks/useChatToolbarActions.ts +122 -0
- package/src/hooks/useContextBinder.ts +30 -0
- package/src/hooks/useContextObjects.ts +58 -0
- package/src/hooks/useItemTypes.ts +37 -0
- package/src/hooks/usePresets.ts +4 -5
- package/src/hooks/useReferencesProvider.ts +2 -1
- package/src/index.ts +2 -0
- package/src/meta.ts +9 -6
- package/src/processor/index.ts +7 -0
- package/src/{hooks → processor}/presets.ts +11 -4
- package/src/processor/processor.test.ts +71 -0
- package/src/processor/processor.ts +277 -0
- package/src/processor/update-name.ts +56 -0
- package/src/queue-logger.ts +9 -13
- package/src/testing/index.ts +1 -1
- package/src/testing/test-generator.ts +261 -0
- package/src/testing/test-sequence.ts +1 -26
- package/src/testing/test-services.ts +2 -8
- package/src/translations.ts +44 -24
- package/src/types/Assistant.ts +11 -7
- package/src/types/AssistantAction.ts +31 -6
- package/src/types/service.ts +17 -9
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/BlueprintContainer-H7H4BQ2C.mjs +0 -29
- package/dist/lib/browser/BlueprintContainer-H7H4BQ2C.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-OUVSX5V5.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-P4FLEOHG.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-627OQ557.mjs +0 -163
- package/dist/lib/browser/SequenceContainer-627OQ557.mjs.map +0 -7
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs +0 -22
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-AVHHQ3KV.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-CMGIZAOW.mjs.map +0 -7
- package/dist/lib/browser/chunk-BRLHDHOF.mjs +0 -244
- package/dist/lib/browser/chunk-BRLHDHOF.mjs.map +0 -7
- package/dist/lib/browser/chunk-HRLMD35M.mjs.map +0 -7
- package/dist/lib/browser/chunk-LKP65RPA.mjs +0 -20
- package/dist/lib/browser/chunk-LKP65RPA.mjs.map +0 -7
- package/dist/lib/browser/chunk-NZDCKQ6W.mjs +0 -89
- package/dist/lib/browser/chunk-NZDCKQ6W.mjs.map +0 -7
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs +0 -16
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs.map +0 -7
- package/dist/lib/browser/chunk-VEBVAHNM.mjs +0 -2231
- package/dist/lib/browser/chunk-VEBVAHNM.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs +0 -24
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MVOIEJXZ.mjs +0 -81
- package/dist/lib/browser/intent-resolver-MVOIEJXZ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-4HXS3YLT.mjs +0 -163
- package/dist/lib/browser/react-surface-4HXS3YLT.mjs.map +0 -7
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs +0 -105
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-VH4EE4CM.mjs +0 -30
- package/dist/lib/node-esm/BlueprintContainer-VH4EE4CM.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-D5FABDNE.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-NKWVXHJP.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-EQ5NP2PG.mjs +0 -164
- package/dist/lib/node-esm/SequenceContainer-EQ5NP2PG.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-LDD32477.mjs +0 -23
- package/dist/lib/node-esm/ai-service-LDD32477.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-RMOUJMMG.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-AEWYMW6I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3SOC5GOP.mjs +0 -2232
- package/dist/lib/node-esm/chunk-3SOC5GOP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F7RXCX5Y.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GAWXJ7K5.mjs +0 -90
- package/dist/lib/node-esm/chunk-GAWXJ7K5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KOC6ESG7.mjs +0 -22
- package/dist/lib/node-esm/chunk-KOC6ESG7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RD755HN3.mjs +0 -245
- package/dist/lib/node-esm/chunk-RD755HN3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-X6AANUHZ.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs +0 -25
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-DTDNCX3C.mjs +0 -82
- package/dist/lib/node-esm/intent-resolver-DTDNCX3C.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-V6JNEZVO.mjs +0 -164
- package/dist/lib/node-esm/react-surface-V6JNEZVO.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-2VNUL77B.mjs +0 -106
- package/dist/lib/node-esm/toolkit-2VNUL77B.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 -18
- 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/ChatThread/reducer.d.ts +0 -12
- package/dist/types/src/components/ChatThread/reducer.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 -8
- 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/Timeline/Timeline.d.ts +0 -24
- package/dist/types/src/components/Timeline/Timeline.d.ts.map +0 -1
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts +0 -9
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts.map +0 -1
- package/dist/types/src/components/Timeline/index.d.ts +0 -2
- package/dist/types/src/components/Timeline/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/chat-processor.d.ts +0 -72
- package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
- package/dist/types/src/hooks/errors.d.ts +0 -4
- package/dist/types/src/hooks/errors.d.ts.map +0 -1
- package/dist/types/src/hooks/presets.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 -268
- package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +0 -5
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/ChatContainer.d.ts +0 -5
- package/dist/types/src/stories/components/ChatContainer.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 -5
- package/dist/types/src/stories/components/LoggingContainer.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 -5
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/index.d.ts +0 -8
- 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/hooks/index.d.ts +0 -3
- package/dist/types/src/stories/hooks/index.d.ts.map +0 -1
- package/dist/types/src/stories/hooks/useFlush.d.ts.map +0 -1
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts +0 -3
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts.map +0 -1
- package/dist/types/src/stories/testing/data.d.ts +0 -142
- 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 -26
- package/dist/types/src/stories/testing/testing.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/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/src/components/BlueprintContainer.tsx +0 -24
- package/src/components/ChatThread/ChatMessage.tsx +0 -282
- package/src/components/ChatThread/ToolBlock.tsx +0 -125
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/components/PromptSettings.tsx +0 -89
- package/src/components/SequenceContainer.tsx +0 -133
- 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/Timeline/Timeline.stories.tsx +0 -53
- package/src/components/Timeline/Timeline.tsx +0 -159
- package/src/hooks/chat-processor.ts +0 -260
- package/src/hooks/errors.ts +0 -8
- package/src/hooks/useResolveRef.ts +0 -33
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -74
- 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 -34
- package/src/shims.d.ts +0 -8
- package/src/stories/Chat.stories.tsx +0 -317
- package/src/stories/components/BlueprintContainer.tsx +0 -34
- package/src/stories/components/ChatContainer.tsx +0 -80
- package/src/stories/components/GraphContainer.tsx +0 -118
- package/src/stories/components/LoggingContainer.tsx +0 -22
- package/src/stories/components/SurfaceContainer.tsx +0 -62
- package/src/stories/components/TasksContainer.tsx +0 -51
- package/src/stories/components/index.ts +0 -12
- package/src/stories/components/types.ts +0 -11
- package/src/stories/hooks/index.ts +0 -6
- package/src/stories/hooks/useMatcherExtension.ts +0 -45
- package/src/stories/testing/data.ts +0 -130
- package/src/stories/testing/index.ts +0 -6
- package/src/stories/testing/testing.tsx +0 -162
- package/src/testing/test-functions.ts +0 -16
- package/src/tools/function.ts +0 -49
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -219
- package/src/tools/openapi.ts +0 -341
- package/src/typings.d.ts +0 -9
- /package/dist/types/src/{stories/hooks → hooks}/useFlush.d.ts +0 -0
- /package/src/{stories/hooks → hooks}/useFlush.ts +0 -0
|
@@ -2,34 +2,33 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
8
|
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
11
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import { capabilities } from '@dxos/assistant-
|
|
10
|
+
import { capabilities } from '@dxos/assistant-toolkit';
|
|
13
11
|
import { ChessPlugin } from '@dxos/plugin-chess';
|
|
14
12
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
15
13
|
import { MapPlugin } from '@dxos/plugin-map';
|
|
16
14
|
import { SpacePlugin } from '@dxos/plugin-space';
|
|
17
15
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
18
|
-
import {
|
|
16
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
19
17
|
|
|
20
18
|
import { translations } from '../../translations';
|
|
21
19
|
|
|
22
20
|
import { Toolbox, type ToolboxProps } from './Toolbox';
|
|
23
21
|
|
|
24
22
|
const DefaultStory = (props: ToolboxProps) => {
|
|
25
|
-
return <Toolbox {...props} classNames='
|
|
23
|
+
return <Toolbox {...props} classNames='is-[30rem] bs-[15rem] rounded-sm border border-separator plb-1' />;
|
|
26
24
|
};
|
|
27
25
|
|
|
28
|
-
const meta
|
|
26
|
+
const meta = {
|
|
29
27
|
title: 'plugins/plugin-assistant/Toolbox',
|
|
30
|
-
component: Toolbox,
|
|
28
|
+
component: Toolbox as any,
|
|
31
29
|
render: DefaultStory,
|
|
32
30
|
decorators: [
|
|
31
|
+
withTheme,
|
|
33
32
|
withPluginManager({
|
|
34
33
|
plugins: [
|
|
35
34
|
ClientPlugin({
|
|
@@ -37,7 +36,7 @@ const meta: Meta<typeof Toolbox> = {
|
|
|
37
36
|
await client.halo.createIdentity();
|
|
38
37
|
},
|
|
39
38
|
}),
|
|
40
|
-
SpacePlugin(),
|
|
39
|
+
SpacePlugin({}),
|
|
41
40
|
SettingsPlugin(),
|
|
42
41
|
IntentPlugin(),
|
|
43
42
|
ChessPlugin(),
|
|
@@ -46,17 +45,15 @@ const meta: Meta<typeof Toolbox> = {
|
|
|
46
45
|
],
|
|
47
46
|
capabilities,
|
|
48
47
|
}),
|
|
49
|
-
withTheme,
|
|
50
|
-
withLayout(),
|
|
51
48
|
],
|
|
52
49
|
parameters: {
|
|
53
50
|
layout: 'centered',
|
|
54
51
|
translations,
|
|
55
52
|
},
|
|
56
|
-
}
|
|
53
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
57
54
|
|
|
58
55
|
export default meta;
|
|
59
56
|
|
|
60
|
-
type Story =
|
|
57
|
+
type Story = StoryObj<typeof meta>;
|
|
61
58
|
|
|
62
|
-
export const Default = {}
|
|
59
|
+
export const Default: Story = {};
|
|
@@ -4,24 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type FC, Fragment, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type Tool } from '@dxos/ai';
|
|
8
7
|
import { type Blueprint } from '@dxos/blueprints';
|
|
9
8
|
import { type Ref } from '@dxos/echo';
|
|
10
|
-
import {
|
|
9
|
+
import { Function } from '@dxos/functions';
|
|
11
10
|
import { log } from '@dxos/log';
|
|
12
11
|
import { Filter, type Space, useQuery } from '@dxos/react-client/echo';
|
|
13
12
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
14
13
|
import { useTranslation } from '@dxos/react-ui';
|
|
15
14
|
import { mx } from '@dxos/react-ui-theme';
|
|
16
15
|
|
|
17
|
-
import { type AiChatProcessor } from '../../hooks';
|
|
18
16
|
import { meta } from '../../meta';
|
|
19
|
-
import {
|
|
17
|
+
import { type AiChatProcessor } from '../../processor';
|
|
20
18
|
import { ServiceType } from '../../types';
|
|
21
19
|
|
|
22
20
|
export type ToolboxProps = ThemedClassName<{
|
|
23
|
-
services?: { service: ServiceType
|
|
24
|
-
functions?:
|
|
21
|
+
services?: { service: ServiceType }[];
|
|
22
|
+
functions?: Function.Function[];
|
|
25
23
|
// TODO(burdon): Combine into single array.
|
|
26
24
|
blueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
|
|
27
25
|
activeBlueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
|
|
@@ -57,10 +55,10 @@ export const Toolbox = ({ classNames, functions, services, blueprints, activeBlu
|
|
|
57
55
|
{services && services.length > 0 && (
|
|
58
56
|
<Section
|
|
59
57
|
title='Services'
|
|
60
|
-
items={services.map(({ service: { serviceId, name, description }
|
|
58
|
+
items={services.map(({ service: { serviceId, name, description } }) => ({
|
|
61
59
|
name: name ?? serviceId,
|
|
62
60
|
description,
|
|
63
|
-
subitems: tools.map(({ name, description }) => ({ name: `∙ ${name}`, description })),
|
|
61
|
+
// subitems: tools.map(({ name, description }) => ({ name: `∙ ${name}`, description })),
|
|
64
62
|
}))}
|
|
65
63
|
/>
|
|
66
64
|
)}
|
|
@@ -68,10 +66,6 @@ export const Toolbox = ({ classNames, functions, services, blueprints, activeBlu
|
|
|
68
66
|
{functions && functions.length > 0 && (
|
|
69
67
|
<Section title='Functions' items={functions.map(({ name, description }) => ({ name, description }))} />
|
|
70
68
|
)}
|
|
71
|
-
|
|
72
|
-
{!blueprints?.length && !activeBlueprints?.length && !services?.length && !functions?.length && (
|
|
73
|
-
<div>{t('no tools')}</div>
|
|
74
|
-
)}
|
|
75
69
|
</div>
|
|
76
70
|
);
|
|
77
71
|
};
|
|
@@ -83,11 +77,11 @@ const Section: FC<{
|
|
|
83
77
|
}> = ({ title, items, striped }) => {
|
|
84
78
|
const stripeClassNames = 'odd:bg-neutral-50 dark:odd:bg-neutral-800';
|
|
85
79
|
const gridClassNames = 'grid grid-cols-[8rem_1fr]';
|
|
86
|
-
const subGridClassNames = mx('col-span-full grid grid-cols-subgrid text-xs
|
|
80
|
+
const subGridClassNames = mx('col-span-full grid grid-cols-subgrid text-xs pli-2', striped && stripeClassNames);
|
|
87
81
|
|
|
88
82
|
return (
|
|
89
83
|
<div>
|
|
90
|
-
<h1 className='
|
|
84
|
+
<h1 className='pli-2 text-sm'>{title}</h1>
|
|
91
85
|
<div className={gridClassNames}>
|
|
92
86
|
{items.map(({ name, description, subitems }, i) => (
|
|
93
87
|
<Fragment key={i}>
|
|
@@ -118,20 +112,20 @@ export type ToolboxContainerProps = ThemedClassName<{
|
|
|
118
112
|
export const ToolboxContainer = ({ classNames, space, processor }: ToolboxContainerProps) => {
|
|
119
113
|
// Registered services.
|
|
120
114
|
const services = useQuery(space, Filter.type(ServiceType));
|
|
121
|
-
const [serviceTools, setServiceTools] = useState<{ service: ServiceType
|
|
115
|
+
const [serviceTools, setServiceTools] = useState<{ service: ServiceType }[]>([]);
|
|
122
116
|
useEffect(() => {
|
|
123
117
|
log('creating service tools...', { services: services.length });
|
|
124
118
|
queueMicrotask(async () => {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
setServiceTools(tools);
|
|
119
|
+
// TODO(burdon): Fix.
|
|
120
|
+
// const tools = await Promise.all(
|
|
121
|
+
// services.map(async (service) => ({ service, tools: await createToolsFromService(service) })),
|
|
122
|
+
// );
|
|
123
|
+
// setServiceTools(tools);
|
|
130
124
|
});
|
|
131
125
|
}, [services]);
|
|
132
126
|
|
|
133
127
|
// Deployed functions.
|
|
134
|
-
const functions = useQuery(space, Filter.type(
|
|
128
|
+
const functions = useQuery(space, Filter.type(Function.Function));
|
|
135
129
|
|
|
136
130
|
return (
|
|
137
131
|
<Toolbox
|
package/src/components/index.ts
CHANGED
|
@@ -6,12 +6,11 @@ import { lazy } from 'react';
|
|
|
6
6
|
|
|
7
7
|
export * from './AssistantSettings';
|
|
8
8
|
export * from './Chat';
|
|
9
|
-
export * from './PromptSettings';
|
|
10
9
|
export * from './TemplateEditor';
|
|
11
|
-
export * from './Timeline';
|
|
12
10
|
export * from './Toolbox';
|
|
13
11
|
|
|
14
|
-
export const
|
|
12
|
+
export const BlueprintArticle = lazy(() => import('./BlueprintArticle'));
|
|
13
|
+
export const ChatCompanion = lazy(() => import('./ChatCompanion'));
|
|
15
14
|
export const ChatContainer = lazy(() => import('./ChatContainer'));
|
|
16
15
|
export const ChatDialog = lazy(() => import('./ChatDialog'));
|
|
17
|
-
export const
|
|
16
|
+
export const PromptArticle = lazy(() => import('./PromptArticle'));
|
|
@@ -2,19 +2,21 @@
|
|
|
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 { defineFunction } from '@dxos/functions';
|
|
8
9
|
import { log } from '@dxos/log';
|
|
9
10
|
|
|
10
11
|
export default defineFunction({
|
|
11
|
-
|
|
12
|
+
key: 'dxos.org/function/assistant-analysis',
|
|
13
|
+
name: 'Assistant analysis',
|
|
12
14
|
description: 'Enter analysis analysis mode.',
|
|
13
15
|
inputSchema: Schema.Struct({
|
|
14
16
|
enable: Schema.Boolean.annotations({ description: 'Enable or disable analysis mode.' }),
|
|
15
17
|
}),
|
|
16
18
|
outputSchema: Schema.Void,
|
|
17
|
-
handler: Effect.fn(function* ({ data: { enable } }) {
|
|
19
|
+
handler: Effect.fn(function* ({ context, data: { enable } }) {
|
|
18
20
|
log.info('analysis mode', { enable });
|
|
19
21
|
}),
|
|
20
22
|
});
|
package/src/functions/index.ts
CHANGED
|
@@ -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({
|
|
@@ -31,7 +33,11 @@ export default defineFunction({
|
|
|
31
33
|
),
|
|
32
34
|
}),
|
|
33
35
|
handler: Effect.fn(function* ({ data: { typename } }) {
|
|
34
|
-
|
|
36
|
+
// TODO(wittjosiah): Typename query is not working for dynamic schemas.
|
|
37
|
+
const [schema] = yield* DatabaseService.runSchemaQuery({ typename });
|
|
38
|
+
const filter = schema ? Filter.type(schema) : Filter.typename(typename);
|
|
39
|
+
|
|
40
|
+
const { objects } = yield* DatabaseService.runQuery(Query.select(filter));
|
|
35
41
|
const results = objects.map((object) => ({
|
|
36
42
|
dxn: Obj.getDXN(object).toString(),
|
|
37
43
|
label: Obj.getLabel(object),
|
|
@@ -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({
|
|
@@ -28,13 +30,13 @@ export default defineFunction({
|
|
|
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
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './chat-processor';
|
|
6
|
-
export * from './errors';
|
|
7
|
-
export * from './presets';
|
|
8
|
-
|
|
9
5
|
export * from './useBlueprintRegistry';
|
|
10
6
|
export * from './useChatProcessor';
|
|
11
7
|
export * from './useChatServices';
|
|
8
|
+
export * from './useChatToolbarActions';
|
|
9
|
+
export * from './useContextBinder';
|
|
10
|
+
export * from './useContextObjects';
|
|
11
|
+
export * from './useFlush';
|
|
12
|
+
export * from './useItemTypes';
|
|
12
13
|
export * from './useOnline';
|
|
13
14
|
export * from './usePresets';
|
|
14
15
|
export * from './useReferencesProvider';
|
|
15
|
-
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,25 +23,38 @@ export const useBlueprintRegistry = () => {
|
|
|
21
23
|
return useMemo(() => new Blueprint.Registry(blueprints), [blueprints]);
|
|
22
24
|
};
|
|
23
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
|
+
};
|
|
41
|
+
|
|
24
42
|
/**
|
|
25
43
|
* Create reactive map of active blueprints (by key).
|
|
26
44
|
*/
|
|
27
|
-
export const
|
|
45
|
+
export const useActiveBlueprints = ({ context }: { context?: AiContextBinder }) => {
|
|
28
46
|
const [active, setActive] = useState<Map<string, Blueprint.Blueprint>>(new Map());
|
|
47
|
+
|
|
29
48
|
useSignalEffect(() => {
|
|
30
49
|
const refs = [...(context?.blueprints.value ?? [])];
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
setActive(new Map(blueprints.map((blueprint) => [blueprint.key, blueprint])));
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
return () => clearTimeout(t);
|
|
50
|
+
const blueprints = refs.map((ref) => ref.target).filter(isNonNullable);
|
|
51
|
+
setActive(new Map(blueprints.map((blueprint) => [blueprint.key, blueprint])));
|
|
37
52
|
});
|
|
38
53
|
|
|
39
54
|
return active;
|
|
40
55
|
};
|
|
41
56
|
|
|
42
|
-
// TODO(burdon):
|
|
57
|
+
// TODO(burdon): Move logic into binder.
|
|
43
58
|
export const useBlueprintHandlers = ({
|
|
44
59
|
space,
|
|
45
60
|
context,
|
|
@@ -64,6 +79,7 @@ export const useBlueprintHandlers = ({
|
|
|
64
79
|
if (!blueprint) {
|
|
65
80
|
return;
|
|
66
81
|
}
|
|
82
|
+
|
|
67
83
|
// NOTE: Possible race condition with other peers.
|
|
68
84
|
storedBlueprint = space.db.add(Obj.clone(blueprint));
|
|
69
85
|
}
|
|
@@ -2,24 +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
|
-
import { useIntentDispatcher } from '@dxos/app-framework';
|
|
10
9
|
import { AiConversation } from '@dxos/assistant';
|
|
11
10
|
import { type Blueprint } from '@dxos/blueprints';
|
|
12
11
|
import { log } from '@dxos/log';
|
|
13
|
-
import { type Queue, type Space
|
|
12
|
+
import { type Queue, type Space } from '@dxos/react-client/echo';
|
|
13
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
14
14
|
|
|
15
|
-
import { AiChatProcessor, type AiChatServices, type AiServicePreset } from '../
|
|
15
|
+
import { AiChatProcessor, type AiChatServices, type AiServicePreset } from '../processor';
|
|
16
16
|
import { type Assistant } from '../types';
|
|
17
17
|
|
|
18
18
|
export type UseChatProcessorProps = {
|
|
19
19
|
space?: Space;
|
|
20
20
|
chat?: Assistant.Chat;
|
|
21
21
|
preset?: AiServicePreset;
|
|
22
|
-
services?:
|
|
22
|
+
services?: () => Promise<Runtime.Runtime<AiChatServices>>;
|
|
23
23
|
blueprintRegistry?: Blueprint.Registry;
|
|
24
24
|
settings?: Assistant.Settings;
|
|
25
25
|
};
|
|
@@ -36,46 +36,39 @@ export const useChatProcessor = ({
|
|
|
36
36
|
settings,
|
|
37
37
|
}: UseChatProcessorProps): AiChatProcessor | undefined => {
|
|
38
38
|
const observableRegistry = useContext(RegistryContext);
|
|
39
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
40
39
|
|
|
41
|
-
//
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const conversation = useMemo(() => {
|
|
46
|
-
if (!chat?.queue.target) {
|
|
40
|
+
// Create conversation from chat queue.
|
|
41
|
+
const [conversation, setConversation] = useState<AiConversation>();
|
|
42
|
+
useAsyncEffect(async () => {
|
|
43
|
+
if (!space || !chat) {
|
|
47
44
|
return;
|
|
48
45
|
}
|
|
49
46
|
|
|
50
|
-
|
|
51
|
-
|
|
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()]);
|
|
52
58
|
|
|
53
59
|
// Create processor.
|
|
54
|
-
// TODO(burdon): Updated on each query update above; should just update current processor?
|
|
55
60
|
const processor = useMemo(() => {
|
|
56
61
|
if (!services || !conversation) {
|
|
57
62
|
return undefined;
|
|
58
63
|
}
|
|
59
64
|
|
|
60
|
-
log('creating processor', {
|
|
61
|
-
|
|
62
|
-
model: preset?.model,
|
|
63
|
-
settings,
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
return new AiChatProcessor(services, conversation, {
|
|
67
|
-
extensions,
|
|
68
|
-
blueprintRegistry,
|
|
65
|
+
log('creating processor', { preset, model: preset?.model, settings });
|
|
66
|
+
return new AiChatProcessor(conversation, services, {
|
|
69
67
|
observableRegistry,
|
|
68
|
+
blueprintRegistry,
|
|
70
69
|
model: preset?.model,
|
|
71
70
|
});
|
|
72
|
-
}, [services, conversation, blueprintRegistry,
|
|
71
|
+
}, [services, conversation, blueprintRegistry, preset]);
|
|
73
72
|
|
|
74
73
|
return processor;
|
|
75
74
|
};
|
|
76
|
-
|
|
77
|
-
// TODO(dmaretskyi): Extract.
|
|
78
|
-
export const Stable = Object.freeze({
|
|
79
|
-
array: [] as readonly never[],
|
|
80
|
-
object: {} as {},
|
|
81
|
-
});
|
|
@@ -2,71 +2,50 @@
|
|
|
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 { Capabilities, useCapabilities } from '@dxos/app-framework';
|
|
11
|
-
import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
|
|
9
|
+
import { useCapability } from '@dxos/app-framework/react';
|
|
12
10
|
import { type Space } from '@dxos/client/echo';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
LocalFunctionExecutionService,
|
|
18
|
-
QueueService,
|
|
19
|
-
RemoteFunctionExecutionService,
|
|
20
|
-
TracingService,
|
|
21
|
-
} 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';
|
|
22
15
|
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
// TODO(burdon): Deconstruct into separate layers?
|
|
26
|
-
export type AiChatServices =
|
|
27
|
-
| AiService.AiService
|
|
28
|
-
| CredentialsService
|
|
29
|
-
| DatabaseService
|
|
30
|
-
| QueueService
|
|
31
|
-
| RemoteFunctionExecutionService
|
|
32
|
-
| ToolResolverService
|
|
33
|
-
| ToolExecutionService
|
|
34
|
-
| TracingService;
|
|
16
|
+
import { type AiChatServices } from '../processor';
|
|
17
|
+
import { type Assistant } from '../types';
|
|
35
18
|
|
|
36
19
|
export type UseChatServicesProps = {
|
|
37
20
|
space?: Space;
|
|
21
|
+
chat?: Assistant.Chat;
|
|
38
22
|
};
|
|
39
23
|
|
|
40
24
|
/**
|
|
41
25
|
* Construct service layer.
|
|
42
26
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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;
|
|
48
34
|
|
|
35
|
+
const runtimeResolver = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
49
36
|
return useMemo(() => {
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
space ? QueueService.layer(space.queues) : QueueService.notAvailable,
|
|
65
|
-
TracingService.layerNoop,
|
|
66
|
-
LocalFunctionExecutionService.layer,
|
|
67
|
-
RemoteFunctionExecutionService.mockLayer,
|
|
68
|
-
),
|
|
69
|
-
),
|
|
70
|
-
);
|
|
71
|
-
}, [space, functions, toolkits, handlers]);
|
|
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]);
|
|
72
51
|
};
|