@dxos/plugin-assistant 0.8.4-main.1da679c → 0.8.4-main.21d9917
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-WP3G5GLG.mjs +31 -0
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-GFSJZTOT.mjs +153 -0
- package/dist/lib/browser/ChatCompanion-GFSJZTOT.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-IHAPBIZE.mjs +72 -0
- package/dist/lib/browser/ChatContainer-IHAPBIZE.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-EGRMPCTL.mjs +85 -0
- package/dist/lib/browser/ChatDialog-EGRMPCTL.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs +53 -0
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs.map +7 -0
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs +21 -0
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs +212 -0
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs +14 -0
- package/dist/lib/browser/blueprints/index.mjs +12 -0
- package/dist/lib/browser/chunk-A75V4MOQ.mjs +1832 -0
- package/dist/lib/browser/chunk-A75V4MOQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-DKQMSMBN.mjs +326 -0
- package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +7 -0
- package/dist/lib/browser/chunk-EXVT7D4B.mjs +23 -0
- package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +7 -0
- package/dist/lib/browser/chunk-ML3QCFKA.mjs +265 -0
- package/dist/lib/browser/chunk-ML3QCFKA.mjs.map +7 -0
- package/dist/lib/browser/chunk-MRJVYGLU.mjs +208 -0
- package/dist/lib/browser/chunk-MRJVYGLU.mjs.map +7 -0
- package/dist/lib/browser/chunk-V772AMZM.mjs +250 -0
- package/dist/lib/browser/chunk-V772AMZM.mjs.map +7 -0
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs +41 -0
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs +20 -0
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +229 -216
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs +19 -0
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs +132 -0
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs.map +7 -0
- package/dist/lib/browser/react-surface-S7SBFOSW.mjs +109 -0
- package/dist/lib/browser/react-surface-S7SBFOSW.mjs.map +7 -0
- package/dist/lib/browser/repair-6QGAKOVM.mjs +54 -0
- package/dist/lib/browser/repair-6QGAKOVM.mjs.map +7 -0
- package/dist/lib/browser/settings-4ZDLUMYE.mjs +32 -0
- package/dist/lib/browser/settings-4ZDLUMYE.mjs.map +7 -0
- package/dist/lib/browser/state-AN6336ZX.mjs +26 -0
- package/dist/lib/browser/state-AN6336ZX.mjs.map +7 -0
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs +18 -0
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -4
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs +32 -0
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-UR7DXZ54.mjs +154 -0
- package/dist/lib/node-esm/ChatCompanion-UR7DXZ54.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-YMLLGOZK.mjs +73 -0
- package/dist/lib/node-esm/ChatContainer-YMLLGOZK.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-D24WJPK4.mjs +86 -0
- package/dist/lib/node-esm/ChatDialog-D24WJPK4.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs +54 -0
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs +22 -0
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs +213 -0
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs.map +7 -0
- package/dist/lib/node-esm/{blueprint-definition-B6UDX5U3.mjs → blueprint-definition-SEMDEIYG.mjs} +6 -4
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +13 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-355W5B27.mjs +251 -0
- package/dist/lib/node-esm/chunk-355W5B27.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4BERCIES.mjs +1833 -0
- package/dist/lib/node-esm/chunk-4BERCIES.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs +327 -0
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs +209 -0
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs +42 -0
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs +25 -0
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs +267 -0
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs +21 -0
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +229 -216
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs +20 -0
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs +133 -0
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-ZR6FXGLF.mjs +110 -0
- package/dist/lib/node-esm/react-surface-ZR6FXGLF.mjs.map +7 -0
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs +55 -0
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs.map +7 -0
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs +33 -0
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs.map +7 -0
- package/dist/lib/node-esm/state-HDON4REW.mjs +27 -0
- package/dist/lib/node-esm/state-HDON4REW.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs +19 -0
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +8 -4
- package/dist/types/src/AssistantPlugin.d.ts +2 -1
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/assistant-blueprint.d.ts +209 -0
- package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +7 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts +5 -0
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service/index.d.ts +3 -0
- package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +21 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +4 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +6 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +10 -11
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +12 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/index.d.ts +3 -0
- package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
- package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +15 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +17 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +11 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +13 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +5 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -2
- 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 +23 -13
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +5 -1
- 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 +13 -5
- 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 +3 -3
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +7 -8
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +133 -74
- package/dist/types/src/components/ChatThread/ChatThread.stories.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 +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +12 -6
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- 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 +116 -61
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +12 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +117 -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 +10 -8
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +6 -7
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +116 -61
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +12 -0
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts +11 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +7 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts +5 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/index.d.ts +2 -0
- package/dist/types/src/components/Typewriter/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +10 -9
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +3 -3
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/functions/{list.d.ts → object-list.d.ts} +3 -3
- 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/functions/object-search.d.ts +10 -0
- package/dist/types/src/functions/object-search.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -2
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -4
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +4 -2
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +4 -4
- 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/useContextObjects.d.ts +7 -7
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -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 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -4
- 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 +19 -17
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/update-name.d.ts +10 -0
- package/dist/types/src/processor/update-name.d.ts.map +1 -0
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +0 -2
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +6 -5
- package/dist/types/src/testing/test-generator.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 +244 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +20 -20
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +89 -101
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +33 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +14 -216
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +118 -117
- package/src/AssistantPlugin.tsx +114 -146
- package/src/blueprints/assistant-blueprint.ts +62 -0
- package/src/blueprints/index.ts +12 -0
- package/src/capabilities/ai-service/ai-service.ts +29 -0
- package/src/capabilities/ai-service/index.ts +7 -0
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +180 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +60 -0
- package/src/capabilities/blueprint-definition/index.ts +8 -0
- package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +32 -0
- package/src/capabilities/edge-model-resolver/index.ts +7 -0
- package/src/capabilities/index.ts +10 -14
- package/src/capabilities/local-model-resolver/index.ts +7 -0
- package/src/capabilities/local-model-resolver/local-model-resolver.ts +37 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +110 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +95 -0
- package/src/capabilities/repair/index.ts +7 -0
- package/src/capabilities/repair/repair.ts +63 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +30 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +27 -0
- package/src/capabilities/toolkit/index.ts +7 -0
- package/src/capabilities/toolkit/toolkit.ts +26 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +13 -5
- package/src/components/BlueprintArticle.tsx +29 -0
- package/src/components/Chat/Chat.tsx +193 -151
- package/src/components/Chat/events.ts +7 -1
- package/src/components/ChatCompanion.tsx +143 -91
- package/src/components/ChatContainer.tsx +40 -30
- package/src/components/ChatDialog.tsx +13 -7
- package/src/components/ChatProgress/ChatProgress.tsx +4 -18
- package/src/components/ChatPrompt/ChatActions.tsx +3 -5
- package/src/components/ChatPrompt/ChatOptions.tsx +104 -99
- package/src/components/ChatPrompt/ChatReferences.tsx +7 -8
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +62 -42
- package/src/components/ChatThread/ChatThread.tsx +29 -35
- package/src/components/ChatThread/Link.tsx +3 -3
- package/src/components/ChatThread/reducers.ts +6 -6
- package/src/components/ChatThread/registry.tsx +26 -41
- package/src/components/ChatThread/sync.test.ts +33 -18
- package/src/components/ChatThread/sync.ts +54 -13
- package/src/components/ChatThread/testing/thread.md +37 -0
- package/src/components/PromptArticle.tsx +50 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +16 -8
- package/src/components/TemplateEditor/TemplateEditor.tsx +24 -12
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +17 -11
- package/src/components/TemplateEditor/TemplateForm.tsx +77 -30
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +274 -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 +40 -49
- package/src/components/Toolbox/Toolbox.stories.tsx +11 -15
- package/src/components/Toolbox/Toolbox.tsx +18 -19
- package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
- package/src/components/Typewriter/Typewriter.stories.tsx +83 -0
- package/src/components/Typewriter/Typewriter.tsx +54 -0
- package/src/components/Typewriter/assistant-extension.tsx +144 -0
- package/src/components/Typewriter/index.ts +5 -0
- package/src/components/index.ts +2 -5
- package/src/functions/index.ts +3 -3
- package/src/functions/{list.ts → object-list.ts} +10 -7
- package/src/functions/{load.ts → object-load.ts} +15 -10
- package/src/functions/object-search.ts +46 -0
- package/src/hooks/index.ts +2 -2
- package/src/hooks/useBlueprintRegistry.ts +44 -19
- package/src/hooks/useChatProcessor.ts +25 -14
- package/src/hooks/useChatServices.ts +16 -17
- package/src/hooks/useChatToolbarActions.ts +121 -0
- package/src/hooks/useContextBinder.ts +21 -7
- package/src/hooks/useContextObjects.ts +13 -25
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/useReferencesProvider.ts +7 -6
- package/src/index.ts +2 -1
- package/src/meta.ts +11 -8
- package/src/processor/index.ts +1 -0
- package/src/processor/presets.ts +2 -2
- package/src/processor/processor.test.ts +19 -24
- package/src/processor/processor.ts +51 -78
- package/src/processor/update-name.ts +59 -0
- package/src/queue-logger.ts +8 -9
- package/src/testing/index.ts +0 -2
- package/src/testing/test-generator.ts +19 -14
- package/src/testing/test-services.ts +10 -14
- package/src/translations.ts +28 -16
- package/src/types/Assistant.ts +13 -12
- package/src/types/AssistantAction.ts +65 -52
- package/src/types/capabilities.ts +27 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +3 -1
- package/src/types/service.ts +25 -14
- package/dist/lib/browser/BlueprintContainer-6MZHBQ25.mjs +0 -29
- package/dist/lib/browser/BlueprintContainer-6MZHBQ25.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-B4DLQE6Y.mjs +0 -124
- package/dist/lib/browser/ChatCompanion-B4DLQE6Y.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-Z7A3RKOY.mjs +0 -73
- package/dist/lib/browser/ChatContainer-Z7A3RKOY.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-PL5TSGD5.mjs +0 -86
- package/dist/lib/browser/ChatDialog-PL5TSGD5.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-4VESSFNB.mjs +0 -18
- package/dist/lib/browser/ai-service-4VESSFNB.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-BBDHBJXA.mjs +0 -153
- package/dist/lib/browser/app-graph-builder-BBDHBJXA.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-3SATLYJW.mjs +0 -12
- package/dist/lib/browser/chunk-BBT6KNXA.mjs +0 -165
- package/dist/lib/browser/chunk-BBT6KNXA.mjs.map +0 -7
- package/dist/lib/browser/chunk-JDI4FEKA.mjs +0 -299
- package/dist/lib/browser/chunk-JDI4FEKA.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-PQI3MGDN.mjs +0 -169
- package/dist/lib/browser/chunk-PQI3MGDN.mjs.map +0 -7
- package/dist/lib/browser/chunk-SMIVXXAI.mjs +0 -202
- package/dist/lib/browser/chunk-SMIVXXAI.mjs.map +0 -7
- package/dist/lib/browser/chunk-TMKK6VCA.mjs +0 -216
- package/dist/lib/browser/chunk-TMKK6VCA.mjs.map +0 -7
- package/dist/lib/browser/chunk-YKODYEYR.mjs +0 -16
- package/dist/lib/browser/chunk-YKODYEYR.mjs.map +0 -7
- package/dist/lib/browser/chunk-YOBHCEEI.mjs +0 -1941
- package/dist/lib/browser/chunk-YOBHCEEI.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-6YWYDPTS.mjs +0 -18
- package/dist/lib/browser/edge-model-resolver-6YWYDPTS.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MRZJU255.mjs +0 -112
- package/dist/lib/browser/intent-resolver-MRZJU255.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-QXLLTV2H.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-QXLLTV2H.mjs.map +0 -7
- package/dist/lib/browser/react-surface-UKMOARXR.mjs +0 -107
- package/dist/lib/browser/react-surface-UKMOARXR.mjs.map +0 -7
- package/dist/lib/browser/settings-4AJ34FKF.mjs +0 -23
- package/dist/lib/browser/settings-4AJ34FKF.mjs.map +0 -7
- package/dist/lib/browser/state-ABR7YSSA.mjs +0 -21
- package/dist/lib/browser/state-ABR7YSSA.mjs.map +0 -7
- package/dist/lib/browser/toolkit-U7SKGAIC.mjs +0 -191
- package/dist/lib/browser/toolkit-U7SKGAIC.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-MUHW5HNY.mjs +0 -30
- package/dist/lib/node-esm/BlueprintContainer-MUHW5HNY.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-DK6FULBU.mjs +0 -125
- package/dist/lib/node-esm/ChatCompanion-DK6FULBU.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-7IN7ZICQ.mjs +0 -74
- package/dist/lib/node-esm/ChatContainer-7IN7ZICQ.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-LPE653RZ.mjs +0 -87
- package/dist/lib/node-esm/ChatDialog-LPE653RZ.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-I5JU4JN2.mjs +0 -19
- package/dist/lib/node-esm/ai-service-I5JU4JN2.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-EMR5JF6Z.mjs +0 -154
- package/dist/lib/node-esm/app-graph-builder-EMR5JF6Z.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs +0 -170
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5MYWJPYA.mjs +0 -167
- package/dist/lib/node-esm/chunk-5MYWJPYA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7YOGZI66.mjs +0 -203
- package/dist/lib/node-esm/chunk-7YOGZI66.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FHRJMZ7L.mjs +0 -17
- package/dist/lib/node-esm/chunk-FHRJMZ7L.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GCNF3CQU.mjs +0 -217
- package/dist/lib/node-esm/chunk-GCNF3CQU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-H3ZC4UL7.mjs +0 -300
- package/dist/lib/node-esm/chunk-H3ZC4UL7.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-X2YUKRBE.mjs +0 -1942
- package/dist/lib/node-esm/chunk-X2YUKRBE.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-A7B6QHLL.mjs +0 -19
- package/dist/lib/node-esm/edge-model-resolver-A7B6QHLL.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-CIXO3KMY.mjs +0 -113
- package/dist/lib/node-esm/intent-resolver-CIXO3KMY.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-JCYDHAZY.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-JCYDHAZY.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-5NDJAWA2.mjs +0 -108
- package/dist/lib/node-esm/react-surface-5NDJAWA2.mjs.map +0 -7
- package/dist/lib/node-esm/settings-K2QW4ATZ.mjs +0 -24
- package/dist/lib/node-esm/settings-K2QW4ATZ.mjs.map +0 -7
- package/dist/lib/node-esm/state-6UHESJI5.mjs +0 -22
- package/dist/lib/node-esm/state-6UHESJI5.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-LNLRBVDU.mjs +0 -192
- package/dist/lib/node-esm/toolkit-LNLRBVDU.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-service.d.ts +0 -4
- package/dist/types/src/capabilities/ai-service.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -7
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -11
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +0 -10
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -4
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -4
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- 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/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 -267
- 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 -5
- 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/events.d.ts +0 -4
- package/dist/types/src/events.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/analysis.d.ts +0 -5
- package/dist/types/src/functions/analysis.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 -6
- 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/stories/Chat.stories.d.ts +0 -31
- 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/ChessContainer.d.ts +0 -4
- package/dist/types/src/stories/components/ChessContainer.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/DebugCard.d.ts +0 -8
- package/dist/types/src/stories/components/DebugCard.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/InvocationsContainer.d.ts +0 -4
- package/dist/types/src/stories/components/InvocationsContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/LoggingContainer.d.ts +0 -7
- 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/ProjectContainer.d.ts +0 -4
- package/dist/types/src/stories/components/ProjectContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/PromptContainer.d.ts +0 -6
- package/dist/types/src/stories/components/PromptContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/ResearchInputStack.d.ts +0 -4
- package/dist/types/src/stories/components/ResearchInputStack.d.ts.map +0 -1
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts +0 -4
- package/dist/types/src/stories/components/ResearchOutputStack.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/TriggersContainer.d.ts +0 -3
- package/dist/types/src/stories/components/TriggersContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/index.d.ts +0 -17
- 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 -9
- 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/schema.d.ts +0 -7
- package/dist/types/src/stories/testing/schema.d.ts.map +0 -1
- package/dist/types/src/stories/testing/testing.d.ts +0 -48
- package/dist/types/src/stories/testing/testing.d.ts.map +0 -1
- package/dist/types/src/testing/test-data.d.ts +0 -14
- 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/capabilities/ai-service.ts +0 -26
- package/src/capabilities/app-graph-builder.ts +0 -162
- package/src/capabilities/blueprint-definition.ts +0 -61
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/edge-model-resolver.ts +0 -25
- package/src/capabilities/intent-resolver.ts +0 -94
- package/src/capabilities/local-model-resolver.ts +0 -30
- package/src/capabilities/react-surface.tsx +0 -91
- package/src/capabilities/settings.ts +0 -19
- package/src/capabilities/state.ts +0 -20
- package/src/capabilities/toolkit.ts +0 -163
- package/src/components/BlueprintContainer.tsx +0 -24
- 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 -21
- package/src/components/Toolbar/index.ts +0 -5
- package/src/components/Toolbar/useChatToolbarActions.ts +0 -126
- package/src/events.ts +0 -11
- package/src/execution-graph/execution-graph.ts +0 -211
- package/src/execution-graph/index.ts +0 -5
- package/src/functions/analysis.ts +0 -20
- package/src/hooks/useExecutionGraph.ts +0 -20
- package/src/hooks/useItemTypes.ts +0 -37
- package/src/stories/Chat.stories.tsx +0 -804
- package/src/stories/components/BlueprintContainer.tsx +0 -34
- package/src/stories/components/ChatContainer.tsx +0 -74
- package/src/stories/components/ChessContainer.tsx +0 -17
- package/src/stories/components/CommentsContainer.tsx +0 -25
- package/src/stories/components/DebugCard.tsx +0 -61
- package/src/stories/components/GraphContainer.tsx +0 -119
- package/src/stories/components/InvocationsContainer.tsx +0 -17
- package/src/stories/components/LoggingContainer.tsx +0 -33
- package/src/stories/components/MessageContainer.tsx +0 -22
- package/src/stories/components/ProjectContainer.tsx +0 -17
- package/src/stories/components/PromptContainer.tsx +0 -52
- package/src/stories/components/ResearchInputStack.tsx +0 -30
- package/src/stories/components/ResearchOutputStack.tsx +0 -29
- package/src/stories/components/TasksContainer.tsx +0 -49
- package/src/stories/components/TokenManagerContainer.tsx +0 -14
- package/src/stories/components/TriggersContainer.tsx +0 -12
- package/src/stories/components/index.ts +0 -21
- 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/schema.ts +0 -17
- package/src/stories/testing/testing.tsx +0 -284
- package/src/testing/test-data.ts +0 -255
- package/src/testing/test-functions.ts +0 -16
- /package/dist/lib/browser/{blueprint-definition-3SATLYJW.mjs.map → blueprint-definition-DGHH7MUU.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-B6UDX5U3.mjs.map → browser/blueprints/index.mjs.map} +0 -0
- /package/dist/types/src/components/TemplateEditor/{handlebars-extension.d.ts → extensions/handlebars-extension.d.ts} +0 -0
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
9
|
-
import { getSpace } from '@dxos/client/echo';
|
|
10
|
-
import { Sequence } from '@dxos/conductor';
|
|
11
|
-
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
12
|
-
import { Obj } from '@dxos/echo';
|
|
13
|
-
import { SettingsStore } from '@dxos/local-storage';
|
|
14
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
AssistantSettings,
|
|
18
|
-
BlueprintContainer,
|
|
19
|
-
ChatCompanion,
|
|
20
|
-
ChatContainer,
|
|
21
|
-
ChatDialog,
|
|
22
|
-
PromptSettings,
|
|
23
|
-
SequenceContainer,
|
|
24
|
-
} from '../components';
|
|
25
|
-
import { ASSISTANT_DIALOG, meta } from '../meta';
|
|
26
|
-
import { Assistant } from '../types';
|
|
27
|
-
|
|
28
|
-
export default () =>
|
|
29
|
-
contributes(Capabilities.ReactSurface, [
|
|
30
|
-
createSurface({
|
|
31
|
-
id: `${meta.id}/plugin-settings`,
|
|
32
|
-
role: 'article',
|
|
33
|
-
filter: (data): data is { subject: SettingsStore<Assistant.Settings> } =>
|
|
34
|
-
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
35
|
-
component: ({ data: { subject } }) => <AssistantSettings settings={subject.value} />,
|
|
36
|
-
}),
|
|
37
|
-
createSurface({
|
|
38
|
-
id: `${meta.id}/chat`,
|
|
39
|
-
role: 'article',
|
|
40
|
-
filter: (data): data is { subject: Assistant.Chat; variant: undefined } =>
|
|
41
|
-
Obj.instanceOf(Assistant.Chat, data.subject) && data.variant !== 'assistant-chat',
|
|
42
|
-
component: ({ data, role }) => <ChatContainer role={role} chat={data.subject} />,
|
|
43
|
-
}),
|
|
44
|
-
createSurface({
|
|
45
|
-
id: `${meta.id}/companion-chat`,
|
|
46
|
-
role: 'article',
|
|
47
|
-
filter: (data): data is { companionTo: Obj.Any; subject: Assistant.Chat | 'assistant-chat' } =>
|
|
48
|
-
Obj.isObject(data.companionTo) &&
|
|
49
|
-
(Obj.instanceOf(Assistant.Chat, data.subject) || data.subject === 'assistant-chat'),
|
|
50
|
-
component: ({ data, role }) => <ChatCompanion role={role} data={data} />,
|
|
51
|
-
}),
|
|
52
|
-
createSurface({
|
|
53
|
-
id: `${meta.id}/sequence`,
|
|
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`,
|
|
60
|
-
role: 'article',
|
|
61
|
-
filter: (data): data is { companionTo: Sequence } =>
|
|
62
|
-
Obj.instanceOf(Sequence, data.companionTo) && data.subject === 'logs',
|
|
63
|
-
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
64
|
-
component: ({ data, role }) => {
|
|
65
|
-
const space = getSpace(data.companionTo);
|
|
66
|
-
return (
|
|
67
|
-
<StackItem.Content>
|
|
68
|
-
<InvocationTraceContainer space={space} target={data.companionTo} detailAxis='block' />
|
|
69
|
-
</StackItem.Content>
|
|
70
|
-
);
|
|
71
|
-
},
|
|
72
|
-
}),
|
|
73
|
-
createSurface({
|
|
74
|
-
id: `${meta.id}/blueprint`,
|
|
75
|
-
role: 'article',
|
|
76
|
-
filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
|
|
77
|
-
component: ({ data }) => <BlueprintContainer blueprint={data.subject} />,
|
|
78
|
-
}),
|
|
79
|
-
createSurface({
|
|
80
|
-
id: `${meta.id}/prompt-settings`,
|
|
81
|
-
role: 'object-settings',
|
|
82
|
-
filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
|
|
83
|
-
component: ({ data }) => <PromptSettings template={data.subject.instructions} />,
|
|
84
|
-
}),
|
|
85
|
-
createSurface({
|
|
86
|
-
id: ASSISTANT_DIALOG,
|
|
87
|
-
role: 'dialog',
|
|
88
|
-
filter: (data): data is { props: { chat: Assistant.Chat } } => data.component === ASSISTANT_DIALOG,
|
|
89
|
-
component: ({ data }) => <ChatDialog {...data.props} />,
|
|
90
|
-
}),
|
|
91
|
-
]);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { live } from '@dxos/live-object';
|
|
7
|
-
|
|
8
|
-
import { meta } from '../meta';
|
|
9
|
-
import { Assistant } from '../types';
|
|
10
|
-
|
|
11
|
-
export default () => {
|
|
12
|
-
const settings = live<Assistant.Settings>({});
|
|
13
|
-
|
|
14
|
-
return contributes(Capabilities.Settings, {
|
|
15
|
-
prefix: meta.id,
|
|
16
|
-
schema: Assistant.Settings,
|
|
17
|
-
value: settings,
|
|
18
|
-
});
|
|
19
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { contributes } from '@dxos/app-framework';
|
|
6
|
-
import { LocalStorageStore } from '@dxos/local-storage';
|
|
7
|
-
|
|
8
|
-
import { meta } from '../meta';
|
|
9
|
-
|
|
10
|
-
import { AssistantCapabilities } from './capabilities';
|
|
11
|
-
|
|
12
|
-
export default () => {
|
|
13
|
-
// NOTE: This needs to be a chat object rather than a string id to avoid a query race.
|
|
14
|
-
// TODO(wittjosiah): Handle serialization and hydration for this so it can be cached.
|
|
15
|
-
const state = new LocalStorageStore<AssistantCapabilities.AssistantState>(meta.id, {
|
|
16
|
-
currentChat: {},
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
return contributes(AssistantCapabilities.State, state.values, () => state.close());
|
|
20
|
-
};
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { AiTool, AiToolkit } from '@effect/ai';
|
|
6
|
-
import { Effect, Schema } from 'effect';
|
|
7
|
-
|
|
8
|
-
import { Capabilities, type Capability, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
9
|
-
import { AiContextService, ArtifactId } from '@dxos/assistant';
|
|
10
|
-
import { Filter, Obj, Ref, SchemaNotFoundError, Type } from '@dxos/echo';
|
|
11
|
-
import { DatabaseService } from '@dxos/functions';
|
|
12
|
-
import { invariant } from '@dxos/invariant';
|
|
13
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
14
|
-
import { SpaceCapabilities, getActiveSpace } from '@dxos/plugin-space';
|
|
15
|
-
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
16
|
-
import { DataType } from '@dxos/schema';
|
|
17
|
-
import { trim } from '@dxos/util';
|
|
18
|
-
|
|
19
|
-
// TODO(burdon): Reconcile with functions (currently reuses plugin framework intents).
|
|
20
|
-
class Toolkit extends AiToolkit.make(
|
|
21
|
-
AiTool.make('add-to-context', {
|
|
22
|
-
description: trim`
|
|
23
|
-
Adds the object to the chat context.
|
|
24
|
-
`,
|
|
25
|
-
parameters: {
|
|
26
|
-
id: ArtifactId.annotations({
|
|
27
|
-
description: 'The ID of the document to read.',
|
|
28
|
-
}),
|
|
29
|
-
},
|
|
30
|
-
success: Schema.Void,
|
|
31
|
-
failure: Schema.Never,
|
|
32
|
-
}).addRequirement<AiContextService | DatabaseService>(), // TODO(burdon): Define standard contract.
|
|
33
|
-
|
|
34
|
-
AiTool.make('get-schemas', {
|
|
35
|
-
description: trim`
|
|
36
|
-
Retrieves schemas definitions.
|
|
37
|
-
`,
|
|
38
|
-
parameters: {
|
|
39
|
-
// TODO(wittjosiah): Remove this once parameter-less tools are fixed.
|
|
40
|
-
limit: Schema.Number,
|
|
41
|
-
},
|
|
42
|
-
// TODO(dmaretskyi): Effect returns ({ result, encodedResult })
|
|
43
|
-
success: Schema.Any,
|
|
44
|
-
failure: Schema.Never,
|
|
45
|
-
}),
|
|
46
|
-
|
|
47
|
-
AiTool.make('add-schema', {
|
|
48
|
-
description: trim`
|
|
49
|
-
Adds a schema to the space.
|
|
50
|
-
The name will be used when displayed to the user.
|
|
51
|
-
The typename must be in the format of "example.com/type/Type".
|
|
52
|
-
`,
|
|
53
|
-
parameters: {
|
|
54
|
-
name: Schema.String,
|
|
55
|
-
typename: Schema.String,
|
|
56
|
-
jsonSchema: Schema.Any,
|
|
57
|
-
},
|
|
58
|
-
success: Schema.Any,
|
|
59
|
-
failure: Schema.Never,
|
|
60
|
-
}),
|
|
61
|
-
|
|
62
|
-
AiTool.make('create-record', {
|
|
63
|
-
description: trim`
|
|
64
|
-
Creates a new record and adds it to the current space.
|
|
65
|
-
Get the schema from the get-schemas tool and ensure that the data matches the corresponding schema.
|
|
66
|
-
Note that only record schemas are supported.
|
|
67
|
-
`,
|
|
68
|
-
parameters: {
|
|
69
|
-
typename: Schema.String,
|
|
70
|
-
data: Schema.Any,
|
|
71
|
-
},
|
|
72
|
-
success: Schema.Any,
|
|
73
|
-
failure: Schema.Never,
|
|
74
|
-
}),
|
|
75
|
-
) {
|
|
76
|
-
static layer = (context: PluginContext) =>
|
|
77
|
-
Toolkit.toLayer({
|
|
78
|
-
'add-to-context': Effect.fnUntraced(function* ({ id }) {
|
|
79
|
-
const { binder } = yield* AiContextService;
|
|
80
|
-
const { db } = yield* DatabaseService;
|
|
81
|
-
const ref = Ref.fromDXN(ArtifactId.toDXN(id, db.spaceId));
|
|
82
|
-
yield* Effect.promise(() =>
|
|
83
|
-
binder.bind({
|
|
84
|
-
blueprints: [],
|
|
85
|
-
objects: [ref],
|
|
86
|
-
}),
|
|
87
|
-
);
|
|
88
|
-
}),
|
|
89
|
-
|
|
90
|
-
'get-schemas': () => {
|
|
91
|
-
const space = getActiveSpace(context);
|
|
92
|
-
invariant(space, 'No active space');
|
|
93
|
-
|
|
94
|
-
return Effect.gen(function* () {
|
|
95
|
-
const whitelist = context
|
|
96
|
-
.getCapabilities(ClientCapabilities.SchemaWhiteList)
|
|
97
|
-
.flat()
|
|
98
|
-
.map((schema) => ({
|
|
99
|
-
typename: Type.getTypename(schema),
|
|
100
|
-
jsonSchema: Type.toJsonSchema(schema),
|
|
101
|
-
kind: 'record',
|
|
102
|
-
}));
|
|
103
|
-
|
|
104
|
-
// TODO(burdon): Why ObjectForm (bad name for data capability; UI term)?
|
|
105
|
-
const forms = context.getCapabilities(SpaceCapabilities.ObjectForm).map((form) => ({
|
|
106
|
-
typename: Type.getTypename(form.objectSchema),
|
|
107
|
-
jsonSchema: Type.toJsonSchema(form.objectSchema),
|
|
108
|
-
kind: 'item',
|
|
109
|
-
}));
|
|
110
|
-
|
|
111
|
-
const schemas = [...whitelist, ...forms];
|
|
112
|
-
if (space) {
|
|
113
|
-
const { objects } = yield* DatabaseService.runQuery(Filter.type(DataType.StoredSchema));
|
|
114
|
-
schemas.push(
|
|
115
|
-
...objects.map((object) => ({
|
|
116
|
-
typename: object.typename,
|
|
117
|
-
jsonSchema: object.jsonSchema,
|
|
118
|
-
kind: 'record',
|
|
119
|
-
})),
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return schemas;
|
|
124
|
-
}).pipe(Effect.provide(DatabaseService.layer(space.db)));
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
'add-schema': ({ name, typename, jsonSchema }) => {
|
|
128
|
-
return Effect.gen(function* () {
|
|
129
|
-
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
130
|
-
const space = getActiveSpace(context);
|
|
131
|
-
invariant(space, 'No active space');
|
|
132
|
-
|
|
133
|
-
const schema = Type.toEffectSchema(jsonSchema).pipe(Type.Obj({ typename, version: '0.1.0' }));
|
|
134
|
-
yield* dispatch(createIntent(SpaceAction.AddSchema, { space, name, typename, schema }));
|
|
135
|
-
}).pipe(Effect.orDie);
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
'create-record': ({ typename, data }) => {
|
|
139
|
-
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
140
|
-
const space = getActiveSpace(context);
|
|
141
|
-
invariant(space, 'No active space');
|
|
142
|
-
|
|
143
|
-
return Effect.gen(function* () {
|
|
144
|
-
const schemas = context.getCapabilities(ClientCapabilities.SchemaWhiteList).flat();
|
|
145
|
-
const { objects } = yield* DatabaseService.runQuery(Filter.type(DataType.StoredSchema));
|
|
146
|
-
schemas.push(...objects.map((object) => Type.toEffectSchema(object.jsonSchema)));
|
|
147
|
-
const schema = schemas.find((schema) => Type.getTypename(schema) === typename);
|
|
148
|
-
if (!schema) {
|
|
149
|
-
throw new SchemaNotFoundError(typename);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const object = Obj.make(schema, data);
|
|
153
|
-
yield* dispatch(createIntent(SpaceAction.AddObject, { object, target: space, hidden: true }));
|
|
154
|
-
return object;
|
|
155
|
-
}).pipe(Effect.provide(DatabaseService.layer(space.db)), Effect.orDie);
|
|
156
|
-
},
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export default (context: PluginContext): Capability<any>[] => [
|
|
161
|
-
contributes(Capabilities.Toolkit, Toolkit),
|
|
162
|
-
contributes(Capabilities.ToolkitHandler, Toolkit.layer(context)),
|
|
163
|
-
];
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Blueprint } from '@dxos/blueprints';
|
|
8
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
9
|
-
|
|
10
|
-
import { TemplateEditor } from './TemplateEditor';
|
|
11
|
-
|
|
12
|
-
export type BlueprintContainerProps = {
|
|
13
|
-
blueprint: Blueprint.Blueprint;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const BlueprintContainer = ({ blueprint }: BlueprintContainerProps) => {
|
|
17
|
-
return (
|
|
18
|
-
<StackItem.Content classNames='container-max-width'>
|
|
19
|
-
<TemplateEditor id={blueprint.id} template={blueprint.instructions} />
|
|
20
|
-
</StackItem.Content>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default BlueprintContainer;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Template } from '@dxos/blueprints';
|
|
8
|
-
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
|
|
10
|
-
import { meta } from '../meta';
|
|
11
|
-
|
|
12
|
-
export const PromptSettings = ({ template }: { template: Template.Template }) => {
|
|
13
|
-
const { t } = useTranslation(meta.id);
|
|
14
|
-
|
|
15
|
-
// const handleKindChange = useCallback(
|
|
16
|
-
// (value: string) => {
|
|
17
|
-
// const kind = Match.type<string>().pipe(
|
|
18
|
-
// Match.withReturnType<Schema.Schema.Type<typeof Template.Template>>(),
|
|
19
|
-
// Match.when('always', () => ({ include: 'always' })),
|
|
20
|
-
// Match.when('schema-matching', () => ({ include: 'schema-matching', typename: '' })),
|
|
21
|
-
// Match.when('automatically', () => ({ include: 'automatically', description: '' })),
|
|
22
|
-
// Match.orElse(() => ({ include: 'manual' })),
|
|
23
|
-
// )(value);
|
|
24
|
-
//
|
|
25
|
-
// template.kind = kind;
|
|
26
|
-
// },
|
|
27
|
-
// [template],
|
|
28
|
-
// );
|
|
29
|
-
|
|
30
|
-
// const handleTypenameChange = useCallback(
|
|
31
|
-
// debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
32
|
-
// if (template.kind.include === 'schema-matching') {
|
|
33
|
-
// template.kind.typename = event.target.value;
|
|
34
|
-
// }
|
|
35
|
-
// }, 300),
|
|
36
|
-
// [template.kind.include],
|
|
37
|
-
// );
|
|
38
|
-
|
|
39
|
-
// const handleDescriptionChange = useCallback(
|
|
40
|
-
// debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
41
|
-
// if (template.kind.include === 'automatically') {
|
|
42
|
-
// template.kind.description = event.target.value;
|
|
43
|
-
// }
|
|
44
|
-
// }, 300),
|
|
45
|
-
// [template.kind.include],
|
|
46
|
-
// );
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<div className='flex flex-col gap-4'>
|
|
50
|
-
<h2>{t('prompt rules label')}</h2>
|
|
51
|
-
<Toolbar.Root>
|
|
52
|
-
{/* <Select.Root value={template.kind.include} onValueChange={handleKindChange}>
|
|
53
|
-
<Toolbar.Button asChild>
|
|
54
|
-
<Select.TriggerButton />
|
|
55
|
-
</Toolbar.Button>
|
|
56
|
-
<Select.Portal>
|
|
57
|
-
<Select.Content>
|
|
58
|
-
<Select.Viewport>
|
|
59
|
-
{Template.Kinds.map((kind) => (
|
|
60
|
-
<Select.Option key={kind} value={kind}>
|
|
61
|
-
{kind}
|
|
62
|
-
</Select.Option>
|
|
63
|
-
))}
|
|
64
|
-
</Select.Viewport>
|
|
65
|
-
<Select.Arrow />
|
|
66
|
-
</Select.Content>
|
|
67
|
-
</Select.Portal>
|
|
68
|
-
</Select.Root> */}
|
|
69
|
-
{/* {template.kind.include === 'schema-matching' && (
|
|
70
|
-
<Input.Root>
|
|
71
|
-
<Input.TextInput
|
|
72
|
-
placeholder={t('typename placeholder')}
|
|
73
|
-
defaultValue={template.kind.typename}
|
|
74
|
-
onChange={handleTypenameChange}
|
|
75
|
-
/>
|
|
76
|
-
</Input.Root>
|
|
77
|
-
)} */}
|
|
78
|
-
{/* {template.kind.include === 'automatically' && (
|
|
79
|
-
<Input.Root>
|
|
80
|
-
<Input.TextInput
|
|
81
|
-
placeholder={t('description placeholder')}
|
|
82
|
-
defaultValue={template.kind.description}
|
|
83
|
-
onChange={handleDescriptionChange}
|
|
84
|
-
/>
|
|
85
|
-
</Input.Root>
|
|
86
|
-
)} */}
|
|
87
|
-
</Toolbar.Root>
|
|
88
|
-
</div>
|
|
89
|
-
);
|
|
90
|
-
};
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type EditorView } from '@codemirror/view';
|
|
6
|
-
import JSON5 from 'json5';
|
|
7
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
8
|
-
|
|
9
|
-
import { type Sequence, type SequenceDefinition } from '@dxos/conductor';
|
|
10
|
-
import { Key } from '@dxos/echo';
|
|
11
|
-
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
12
|
-
import { useSelectionManager } from '@dxos/react-ui-attention';
|
|
13
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
14
|
-
|
|
15
|
-
import { meta } from '../meta';
|
|
16
|
-
|
|
17
|
-
import { SequenceEditor } from './SequenceEditor';
|
|
18
|
-
|
|
19
|
-
// TODO(burdon): Move to config.
|
|
20
|
-
export const EXA_API_KEY = '9c7e17ff-0c85-4cd5-827a-8b489f139e03';
|
|
21
|
-
|
|
22
|
-
// TODO(burdon): Validate.
|
|
23
|
-
const parseSequence = (text: string): SequenceDefinition | undefined => {
|
|
24
|
-
try {
|
|
25
|
-
const json = JSON5.parse(text);
|
|
26
|
-
const { steps } = json;
|
|
27
|
-
return { steps };
|
|
28
|
-
} catch (error) {
|
|
29
|
-
// Ignore.
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const SequenceContainer = ({ sequence }: { sequence: Sequence }) => {
|
|
34
|
-
const { t } = useTranslation(meta.id);
|
|
35
|
-
const selectionManager = useSelectionManager();
|
|
36
|
-
const [definition, setDefinition] = useState<SequenceDefinition>();
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
setDefinition({
|
|
39
|
-
steps: sequence.steps.map(({ instructions, tools }) => ({ instructions, tools })),
|
|
40
|
-
});
|
|
41
|
-
}, [sequence]);
|
|
42
|
-
|
|
43
|
-
const editorRef = useRef<EditorView | undefined>(undefined);
|
|
44
|
-
|
|
45
|
-
// TODO(burdon): Factor out.
|
|
46
|
-
// const toolRegistry = useMemo(() => {
|
|
47
|
-
// const space = getSpace(sequence);
|
|
48
|
-
// if (!space) {
|
|
49
|
-
// return;
|
|
50
|
-
// }
|
|
51
|
-
|
|
52
|
-
// // TODO(burdon): How should the queue be created?
|
|
53
|
-
// // eslint-disable-next-line no-unused-vars
|
|
54
|
-
// const _queue = space.queues.create();
|
|
55
|
-
|
|
56
|
-
// return new ToolRegistry([
|
|
57
|
-
// // createExaTool({ apiKey: EXA_API_KEY }),
|
|
58
|
-
// // createLocalSearchTool(space.db, queue),
|
|
59
|
-
// // createGraphWriterTool({
|
|
60
|
-
// // db: space.db,
|
|
61
|
-
// // queue,
|
|
62
|
-
// // schema: [], // TODO(burdon): Get schema from client/sequence?
|
|
63
|
-
// // onDone: async (objects) => {
|
|
64
|
-
// // await queue.append(objects);
|
|
65
|
-
// // },
|
|
66
|
-
// // }),
|
|
67
|
-
// ]);
|
|
68
|
-
// }, [sequence]);
|
|
69
|
-
|
|
70
|
-
const formatAndSave = useCallback((): SequenceDefinition | undefined => {
|
|
71
|
-
if (!sequence) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const text = editorRef.current?.state.doc.toString();
|
|
76
|
-
if (!text) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const definition = parseSequence(text);
|
|
81
|
-
if (!definition) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
setDefinition(definition);
|
|
86
|
-
const formatted = JSON.stringify(definition, null, 2);
|
|
87
|
-
editorRef.current?.dispatch({
|
|
88
|
-
changes: { from: 0, to: text.length, insert: formatted },
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
sequence.steps.length = 0;
|
|
92
|
-
for (const step of definition.steps) {
|
|
93
|
-
sequence.steps.push({
|
|
94
|
-
id: Key.ObjectId.random(),
|
|
95
|
-
instructions: step.instructions,
|
|
96
|
-
tools: step.tools,
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return sequence;
|
|
101
|
-
}, [sequence]);
|
|
102
|
-
|
|
103
|
-
// TODO(burdon): Save raw sequence separately from parsed sequence? (like Script).
|
|
104
|
-
const handleSave = useCallback(() => formatAndSave(), [formatAndSave]);
|
|
105
|
-
|
|
106
|
-
const handleRun = useCallback(async () => {
|
|
107
|
-
// if (!aiClient?.value || !toolRegistry) {
|
|
108
|
-
// return;
|
|
109
|
-
// }
|
|
110
|
-
// formatAndSave();
|
|
111
|
-
// // Get input from selection.
|
|
112
|
-
// const input = Array.from(getSelectionSet(selectionManager)).map((id) => DXN.fromLocalObjectId(id));
|
|
113
|
-
// if (!input.length) {
|
|
114
|
-
// return;
|
|
115
|
-
// }
|
|
116
|
-
// const machine = new SequenceMachine(toolRegistry, sequence).setLogger(new QueueLogger(sequence));
|
|
117
|
-
// await machine.runToCompletion({ aiClient: aiClient.value, input });
|
|
118
|
-
}, [sequence, formatAndSave, selectionManager]);
|
|
119
|
-
|
|
120
|
-
return (
|
|
121
|
-
<StackItem.Content toolbar>
|
|
122
|
-
<Toolbar.Root>
|
|
123
|
-
<Toolbar.Button onClick={handleSave}>{t('button save')}</Toolbar.Button>
|
|
124
|
-
<Toolbar.Button onClick={handleRun}>{t('button run')}</Toolbar.Button>
|
|
125
|
-
</Toolbar.Root>
|
|
126
|
-
{definition && <SequenceEditor ref={editorRef} sequence={definition} />}
|
|
127
|
-
</StackItem.Content>
|
|
128
|
-
);
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
export default SequenceContainer;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
-
|
|
9
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
10
|
-
|
|
11
|
-
import { RESEARCH_SEQUENCE_DEFINITION } from '../../testing';
|
|
12
|
-
import { translations } from '../../translations';
|
|
13
|
-
|
|
14
|
-
import { SequenceEditor } from './SequenceEditor';
|
|
15
|
-
|
|
16
|
-
const meta = {
|
|
17
|
-
title: 'plugins/plugin-assistant/SequenceEditor',
|
|
18
|
-
component: SequenceEditor,
|
|
19
|
-
decorators: [withTheme, withLayout({ fullscreen: true, classNames: 'mli-auto max-is-[50rem] justify-center' })],
|
|
20
|
-
parameters: {
|
|
21
|
-
translations,
|
|
22
|
-
},
|
|
23
|
-
} satisfies Meta<typeof SequenceEditor>;
|
|
24
|
-
|
|
25
|
-
export default meta;
|
|
26
|
-
|
|
27
|
-
type Story = StoryObj<typeof SequenceEditor>;
|
|
28
|
-
|
|
29
|
-
export const Default: Story = {
|
|
30
|
-
args: {
|
|
31
|
-
sequence: RESEARCH_SEQUENCE_DEFINITION,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
6
|
-
|
|
7
|
-
import { SequenceDefinition } from '@dxos/conductor';
|
|
8
|
-
import { Type } from '@dxos/echo';
|
|
9
|
-
import { type ThemedClassName, useThemeContext } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
11
|
-
type EditorView,
|
|
12
|
-
createBasicExtensions,
|
|
13
|
-
createJsonExtensions,
|
|
14
|
-
createThemeExtensions,
|
|
15
|
-
useTextEditor,
|
|
16
|
-
} from '@dxos/react-ui-editor';
|
|
17
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
18
|
-
|
|
19
|
-
export type SequenceEditorProps = ThemedClassName<{
|
|
20
|
-
sequence: SequenceDefinition;
|
|
21
|
-
}>;
|
|
22
|
-
|
|
23
|
-
// TODO(burdon): Factor out JsonEditor.
|
|
24
|
-
export const SequenceEditor = forwardRef<EditorView | undefined, SequenceEditorProps>(
|
|
25
|
-
({ classNames, sequence }, forwardedRef) => {
|
|
26
|
-
const { themeMode } = useThemeContext();
|
|
27
|
-
const { parentRef, view } = useTextEditor({
|
|
28
|
-
initialValue: JSON.stringify(sequence, null, 2),
|
|
29
|
-
extensions: [
|
|
30
|
-
createBasicExtensions({
|
|
31
|
-
lineNumbers: true,
|
|
32
|
-
lineWrapping: false,
|
|
33
|
-
monospace: true,
|
|
34
|
-
scrollPastEnd: true,
|
|
35
|
-
}),
|
|
36
|
-
createThemeExtensions({
|
|
37
|
-
themeMode,
|
|
38
|
-
syntaxHighlighting: true,
|
|
39
|
-
}),
|
|
40
|
-
createJsonExtensions({
|
|
41
|
-
schema: Type.toJsonSchema(SequenceDefinition, { strict: true }),
|
|
42
|
-
}),
|
|
43
|
-
],
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
useImperativeHandle(forwardedRef, () => view, [view]);
|
|
47
|
-
|
|
48
|
-
return <div ref={parentRef} className={mx('overflow-hidden', classNames)} />;
|
|
49
|
-
},
|
|
50
|
-
);
|