@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,804 +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
|
-
import { Schema } from 'effect';
|
|
9
|
-
import React, { type FC, useCallback } from 'react';
|
|
10
|
-
|
|
11
|
-
import { EXA_API_KEY } from '@dxos/ai/testing';
|
|
12
|
-
import { Capabilities, Surface, useCapabilities } from '@dxos/app-framework';
|
|
13
|
-
import { AiContextBinder } from '@dxos/assistant';
|
|
14
|
-
import {
|
|
15
|
-
LINEAR_BLUEPRINT,
|
|
16
|
-
RESEARCH_BLUEPRINT,
|
|
17
|
-
ResearchDataTypes,
|
|
18
|
-
ResearchGraph,
|
|
19
|
-
ResearchOn,
|
|
20
|
-
agent,
|
|
21
|
-
} from '@dxos/assistant-testing';
|
|
22
|
-
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
23
|
-
import { Filter, Obj, Query, Ref, Relation, Type } from '@dxos/echo';
|
|
24
|
-
import { FunctionTrigger, exampleFunctions, serializeFunction } from '@dxos/functions';
|
|
25
|
-
import { log } from '@dxos/log';
|
|
26
|
-
import { Board, BoardPlugin } from '@dxos/plugin-board';
|
|
27
|
-
import { Chess, ChessPlugin } from '@dxos/plugin-chess';
|
|
28
|
-
import * as chessFunctions from '@dxos/plugin-chess/functions';
|
|
29
|
-
import { InboxPlugin } from '@dxos/plugin-inbox';
|
|
30
|
-
import { Mailbox } from '@dxos/plugin-inbox/types';
|
|
31
|
-
import { Map, MapPlugin } from '@dxos/plugin-map';
|
|
32
|
-
import { createLocationSchema } from '@dxos/plugin-map/testing';
|
|
33
|
-
import { Markdown, MarkdownPlugin } from '@dxos/plugin-markdown';
|
|
34
|
-
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
35
|
-
import { ProjectPlugin } from '@dxos/plugin-project';
|
|
36
|
-
import { TablePlugin } from '@dxos/plugin-table';
|
|
37
|
-
import { ThreadPlugin } from '@dxos/plugin-thread';
|
|
38
|
-
import { TokenManagerPlugin } from '@dxos/plugin-token-manager';
|
|
39
|
-
import { TranscriptionPlugin } from '@dxos/plugin-transcription';
|
|
40
|
-
import { Transcript } from '@dxos/plugin-transcription/types';
|
|
41
|
-
import { useClient } from '@dxos/react-client';
|
|
42
|
-
import { useQuery, useSpace } from '@dxos/react-client/echo';
|
|
43
|
-
import { useAsyncEffect, useSignalsMemo } from '@dxos/react-ui';
|
|
44
|
-
import { Stack, StackItem } from '@dxos/react-ui-stack';
|
|
45
|
-
import { Table } from '@dxos/react-ui-table/types';
|
|
46
|
-
import { DataType, createView } from '@dxos/schema';
|
|
47
|
-
import { render } from '@dxos/storybook-utils';
|
|
48
|
-
import { isNonNullable, trim } from '@dxos/util';
|
|
49
|
-
|
|
50
|
-
import { BLUEPRINT_KEY } from '../capabilities';
|
|
51
|
-
import { useContextBinder } from '../hooks';
|
|
52
|
-
import { addTestData, createTestMailbox, createTestTranscription, organizations, testTypes } from '../testing';
|
|
53
|
-
import { translations } from '../translations';
|
|
54
|
-
import { Assistant } from '../types';
|
|
55
|
-
|
|
56
|
-
import {
|
|
57
|
-
BlueprintContainer,
|
|
58
|
-
ChatContainer,
|
|
59
|
-
ChessContainer,
|
|
60
|
-
CommentsContainer,
|
|
61
|
-
type ComponentProps,
|
|
62
|
-
GraphContainer,
|
|
63
|
-
InvocationsContainer,
|
|
64
|
-
LoggingContainer,
|
|
65
|
-
MessageContainer,
|
|
66
|
-
ProjectContainer,
|
|
67
|
-
PromptContainer,
|
|
68
|
-
ResearchInputStack,
|
|
69
|
-
ResearchOutputStack,
|
|
70
|
-
TasksContainer,
|
|
71
|
-
TokenManagerContainer,
|
|
72
|
-
TriggersContainer,
|
|
73
|
-
} from './components';
|
|
74
|
-
import { ResearchInputQueue, accessTokensFromEnv, config, getDecorators } from './testing';
|
|
75
|
-
|
|
76
|
-
const panelClassNames = 'bg-baseSurface rounded border border-separator overflow-hidden mbe-[--stack-gap] last:mbe-0';
|
|
77
|
-
|
|
78
|
-
type StoryProps = {
|
|
79
|
-
debug?: boolean;
|
|
80
|
-
deckComponents: (FC<ComponentProps> | 'surfaces')[][];
|
|
81
|
-
blueprints?: string[];
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const DefaultStory = ({ debug = true, deckComponents, blueprints = [] }: StoryProps) => {
|
|
85
|
-
const client = useClient();
|
|
86
|
-
const space = useSpace();
|
|
87
|
-
|
|
88
|
-
const blueprintsDefinitions = useCapabilities(Capabilities.BlueprintDefinition);
|
|
89
|
-
useAsyncEffect(async () => {
|
|
90
|
-
if (!space) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const { objects: chats = [] } = await space.db.query(Filter.type(Assistant.Chat)).run();
|
|
94
|
-
const chat = chats[0];
|
|
95
|
-
if (!chat) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Add blueprints to context.
|
|
100
|
-
const binder = new AiContextBinder(await chat.queue.load());
|
|
101
|
-
const registry = new Blueprint.Registry(blueprintsDefinitions);
|
|
102
|
-
const blueprintObjects = blueprints
|
|
103
|
-
.map((key) => {
|
|
104
|
-
const blueprint = registry.getByKey(key);
|
|
105
|
-
if (blueprint) {
|
|
106
|
-
return space.db.add(Obj.clone(blueprint));
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
.filter(isNonNullable);
|
|
110
|
-
await binder.bind({ blueprints: blueprintObjects.map((blueprint) => Ref.make(blueprint)) });
|
|
111
|
-
}, [space, blueprints, blueprintsDefinitions]);
|
|
112
|
-
|
|
113
|
-
const handleEvent = useCallback<NonNullable<ComponentProps['onEvent']>>((event) => {
|
|
114
|
-
log.info('event', { event });
|
|
115
|
-
switch (event) {
|
|
116
|
-
case 'reset': {
|
|
117
|
-
void client?.reset().then(() => {
|
|
118
|
-
document.location.reload();
|
|
119
|
-
});
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}, []);
|
|
124
|
-
|
|
125
|
-
const chats = useQuery(space, Filter.type(Assistant.Chat));
|
|
126
|
-
const binder = useContextBinder(chats.at(-1));
|
|
127
|
-
const objects = useSignalsMemo(
|
|
128
|
-
() => binder?.objects.value.map((ref) => ref.target).filter(isNonNullable) ?? [],
|
|
129
|
-
[binder],
|
|
130
|
-
);
|
|
131
|
-
|
|
132
|
-
if (!space) {
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return (
|
|
137
|
-
<Stack
|
|
138
|
-
orientation='horizontal'
|
|
139
|
-
size='split'
|
|
140
|
-
rail={false}
|
|
141
|
-
itemsCount={deckComponents.length}
|
|
142
|
-
classNames='absolute inset-0 gap-[--stack-gap]'
|
|
143
|
-
>
|
|
144
|
-
{deckComponents.map((plankComponents, i) => {
|
|
145
|
-
const Components: FC<ComponentProps>[] = plankComponents.filter((item) => item !== 'surfaces');
|
|
146
|
-
const renderSurfaces = plankComponents.includes('surfaces');
|
|
147
|
-
let j = 0;
|
|
148
|
-
return (
|
|
149
|
-
<StackItem.Root order={i + 1} item={{ id: `${i}` }} key={i}>
|
|
150
|
-
<Stack
|
|
151
|
-
orientation='vertical'
|
|
152
|
-
size={i > 0 ? 'contain' : 'split'}
|
|
153
|
-
rail={false}
|
|
154
|
-
itemsCount={plankComponents.length + (i > 0 ? objects.length : 0)}
|
|
155
|
-
>
|
|
156
|
-
{Components.map((Component) => {
|
|
157
|
-
const item = (
|
|
158
|
-
<StackItem.Root key={j} order={j + 1} item={{ id: `${i}:${j}` }} classNames={panelClassNames}>
|
|
159
|
-
<Component space={space} debug={debug} onEvent={handleEvent} />
|
|
160
|
-
</StackItem.Root>
|
|
161
|
-
);
|
|
162
|
-
j += 1;
|
|
163
|
-
return item;
|
|
164
|
-
})}
|
|
165
|
-
|
|
166
|
-
{renderSurfaces &&
|
|
167
|
-
objects.map((object, index) => {
|
|
168
|
-
const k = index + j;
|
|
169
|
-
return (
|
|
170
|
-
<StackItem.Root key={k} order={k + 1} item={{ id: `${k}` }} classNames={panelClassNames}>
|
|
171
|
-
{debug && (
|
|
172
|
-
<div role='heading' className='flex gap-2 items-center text-xs justify-center text-subdued'>
|
|
173
|
-
<span>{Obj.getTypename(object)}</span>
|
|
174
|
-
<span>{object.id}</span>
|
|
175
|
-
</div>
|
|
176
|
-
)}
|
|
177
|
-
<Surface role='section' limit={1} data={{ subject: object }} />
|
|
178
|
-
</StackItem.Root>
|
|
179
|
-
);
|
|
180
|
-
})}
|
|
181
|
-
</Stack>
|
|
182
|
-
</StackItem.Root>
|
|
183
|
-
);
|
|
184
|
-
})}
|
|
185
|
-
</Stack>
|
|
186
|
-
);
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
const storybook: Meta<typeof DefaultStory> = {
|
|
190
|
-
title: 'plugins/plugin-assistant/Chat',
|
|
191
|
-
render: render(DefaultStory),
|
|
192
|
-
parameters: {
|
|
193
|
-
translations,
|
|
194
|
-
controls: { disable: true },
|
|
195
|
-
},
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
export default storybook;
|
|
199
|
-
|
|
200
|
-
type Story = StoryObj<typeof storybook>;
|
|
201
|
-
|
|
202
|
-
//
|
|
203
|
-
// Stories
|
|
204
|
-
//
|
|
205
|
-
|
|
206
|
-
const MARKDOWN_DOCUMENT = trim`
|
|
207
|
-
# Hello, world!
|
|
208
|
-
|
|
209
|
-
This is a test document that contains Markdown content. Markdown is a lightweight markup language for writing formatted text in plain text form. Its goal is to be easy to read and write in raw form, easy to convert to HTML.
|
|
210
|
-
|
|
211
|
-
Markdown’s simplicity makes it highly adaptable: it can be written in any text editor, stored in plain .md files, and rendered into HTML, PDF, or other formats with converters. Because of this portability, it’s widely used in software documentation, static site generators, technical blogging, and collaborative platforms like GitHub and Notion.
|
|
212
|
-
|
|
213
|
-
Many applications extend the core syntax with extras (e.g., tables, task lists, math notation), but the core idea remains the same—clean, minimal markup that stays readable even without rendering.
|
|
214
|
-
`;
|
|
215
|
-
|
|
216
|
-
const STYLE_GUIDE = trim`
|
|
217
|
-
# Style Guide
|
|
218
|
-
- Use short, simple sentences.
|
|
219
|
-
- Organize content with headings and bullet points.
|
|
220
|
-
- Avoid jargon and explain technical terms.
|
|
221
|
-
- Use active voice whenever possible.
|
|
222
|
-
- Highlight key points in bold.
|
|
223
|
-
- Keep paragraphs brief and focused on one idea.
|
|
224
|
-
- Proofread for clarity and correctness.
|
|
225
|
-
`;
|
|
226
|
-
|
|
227
|
-
const addSpellingMistakes = (text: string, n: number): string => {
|
|
228
|
-
const words = text.split(' ');
|
|
229
|
-
for (let i = 0; i < n; i++) {
|
|
230
|
-
const idx = Math.floor(Math.random() * words.length);
|
|
231
|
-
const word = words[idx];
|
|
232
|
-
const charIdx = Math.floor(Math.random() * word.length);
|
|
233
|
-
const typoChar = String.fromCharCode(word.charCodeAt(charIdx) + 1);
|
|
234
|
-
words[idx] = word.slice(0, charIdx) + typoChar + word.slice(charIdx + 1);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
return words.join(' ');
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
export const Default: Story = {
|
|
241
|
-
decorators: getDecorators({
|
|
242
|
-
plugins: [MarkdownPlugin()],
|
|
243
|
-
config: config.remote,
|
|
244
|
-
}),
|
|
245
|
-
args: {
|
|
246
|
-
deckComponents: [[ChatContainer]],
|
|
247
|
-
},
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
// Test with prompt: Propose changes to my document based on the style guide.
|
|
251
|
-
export const WithDocument: Story = {
|
|
252
|
-
decorators: getDecorators({
|
|
253
|
-
plugins: [MarkdownPlugin(), ThreadPlugin()],
|
|
254
|
-
config: config.remote, // TODO(burdon): Issue making persistent.
|
|
255
|
-
onInit: async ({ space }) => {
|
|
256
|
-
space.db.add(
|
|
257
|
-
Markdown.makeDocument({
|
|
258
|
-
name: 'My Document',
|
|
259
|
-
content: addSpellingMistakes(MARKDOWN_DOCUMENT, 2),
|
|
260
|
-
}),
|
|
261
|
-
);
|
|
262
|
-
space.db.add(
|
|
263
|
-
Markdown.makeDocument({
|
|
264
|
-
name: 'Style Guide',
|
|
265
|
-
content: STYLE_GUIDE,
|
|
266
|
-
}),
|
|
267
|
-
);
|
|
268
|
-
},
|
|
269
|
-
onChatCreated: async ({ space, binder }) => {
|
|
270
|
-
const { objects } = await space.db.query(Filter.type(Markdown.Document)).run();
|
|
271
|
-
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
272
|
-
},
|
|
273
|
-
}),
|
|
274
|
-
args: {
|
|
275
|
-
deckComponents: [[ChatContainer], ['surfaces', CommentsContainer]],
|
|
276
|
-
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/markdown'],
|
|
277
|
-
},
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
export const WithBlueprints: Story = {
|
|
281
|
-
decorators: getDecorators({
|
|
282
|
-
plugins: [InboxPlugin(), MarkdownPlugin(), TablePlugin()],
|
|
283
|
-
config: config.remote,
|
|
284
|
-
onInit: async ({ space }) => {
|
|
285
|
-
space.db.add(Markdown.makeDocument({ name: 'Tasks' }));
|
|
286
|
-
},
|
|
287
|
-
onChatCreated: async ({ space, binder }) => {
|
|
288
|
-
const { objects } = await space.db.query(Filter.type(Markdown.Document)).run();
|
|
289
|
-
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
290
|
-
},
|
|
291
|
-
}),
|
|
292
|
-
args: {
|
|
293
|
-
deckComponents: [[ChatContainer], [TasksContainer, BlueprintContainer]],
|
|
294
|
-
},
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
export const WithChess: Story = {
|
|
298
|
-
decorators: getDecorators({
|
|
299
|
-
plugins: [ChessPlugin()],
|
|
300
|
-
config: config.remote,
|
|
301
|
-
types: [Chess.Game],
|
|
302
|
-
onInit: async ({ space }) => {
|
|
303
|
-
// TODO(burdon): Add player DID (for user and assistant).
|
|
304
|
-
space.db.add(
|
|
305
|
-
Chess.makeGame({
|
|
306
|
-
name: 'Challenge',
|
|
307
|
-
pgn: [
|
|
308
|
-
'1. e4 e5',
|
|
309
|
-
'2. Nf3 Nc6',
|
|
310
|
-
'3. Bc4 Bc5',
|
|
311
|
-
'4. c3 Nf6',
|
|
312
|
-
'5. d4 exd4',
|
|
313
|
-
'6. cxd4 Bb4+',
|
|
314
|
-
'7. Nc3 d5',
|
|
315
|
-
'8. exd5 Nxd5',
|
|
316
|
-
'9. O-O Be6',
|
|
317
|
-
'10. Qb3 Na5',
|
|
318
|
-
'11. Qa4+ c6',
|
|
319
|
-
'12. Bxd5 Bxc3',
|
|
320
|
-
'13. Bxe6 fxe6',
|
|
321
|
-
'*',
|
|
322
|
-
].join(' '),
|
|
323
|
-
}),
|
|
324
|
-
);
|
|
325
|
-
},
|
|
326
|
-
onChatCreated: async ({ space, binder }) => {
|
|
327
|
-
const { objects } = await space.db.query(Filter.type(Chess.Game)).run();
|
|
328
|
-
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
329
|
-
},
|
|
330
|
-
}),
|
|
331
|
-
args: {
|
|
332
|
-
deckComponents: [[ChatContainer], ['surfaces']],
|
|
333
|
-
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/chess'],
|
|
334
|
-
},
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
// Test with prompt: Summarize my mailbox and write the summary in a new document.
|
|
338
|
-
export const WithMail: Story = {
|
|
339
|
-
decorators: getDecorators({
|
|
340
|
-
plugins: [InboxPlugin(), MarkdownPlugin(), ThreadPlugin()],
|
|
341
|
-
config: config.remote,
|
|
342
|
-
types: [Mailbox.Mailbox],
|
|
343
|
-
onInit: async ({ space }) => {
|
|
344
|
-
const queue = space.queues.create();
|
|
345
|
-
const messages = createTestMailbox();
|
|
346
|
-
await queue.append(messages);
|
|
347
|
-
space.db.add(Mailbox.make({ name: 'Mailbox', queue: queue.dxn }));
|
|
348
|
-
},
|
|
349
|
-
onChatCreated: async ({ space, binder }) => {
|
|
350
|
-
const { objects } = await space.db.query(Filter.type(Mailbox.Mailbox)).run();
|
|
351
|
-
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
352
|
-
},
|
|
353
|
-
}),
|
|
354
|
-
args: {
|
|
355
|
-
deckComponents: [[ChatContainer], ['surfaces', MessageContainer]],
|
|
356
|
-
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/inbox', 'dxos.org/blueprint/markdown'],
|
|
357
|
-
},
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
// Test with prompt: Sync my email.
|
|
361
|
-
export const WithGmail: Story = {
|
|
362
|
-
decorators: getDecorators({
|
|
363
|
-
plugins: [InboxPlugin(), TokenManagerPlugin()],
|
|
364
|
-
config: config.remote,
|
|
365
|
-
types: [Mailbox.Mailbox],
|
|
366
|
-
onInit: async ({ space }) => {
|
|
367
|
-
const queue = space.queues.create();
|
|
368
|
-
space.db.add(Mailbox.make({ name: 'Mailbox', queue: queue.dxn }));
|
|
369
|
-
},
|
|
370
|
-
onChatCreated: async ({ space, binder }) => {
|
|
371
|
-
const { objects } = await space.db.query(Filter.type(Mailbox.Mailbox)).run();
|
|
372
|
-
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
373
|
-
},
|
|
374
|
-
}),
|
|
375
|
-
args: {
|
|
376
|
-
deckComponents: [[ChatContainer], ['surfaces', MessageContainer, TokenManagerContainer]],
|
|
377
|
-
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/inbox'],
|
|
378
|
-
},
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
// Test with prompt: Create 10 locations.
|
|
382
|
-
export const WithMap: Story = {
|
|
383
|
-
decorators: getDecorators({
|
|
384
|
-
plugins: [MapPlugin(), TablePlugin()],
|
|
385
|
-
config: config.remote,
|
|
386
|
-
types: [DataType.View, Map.Map, Table.Table],
|
|
387
|
-
onInit: async ({ space }) => {
|
|
388
|
-
const [schema] = await space.db.schemaRegistry.register([createLocationSchema()]);
|
|
389
|
-
const { view: tableView } = await Table.makeView({ name: 'Table', space, typename: schema.typename });
|
|
390
|
-
const { view: mapView } = await Map.makeView({
|
|
391
|
-
name: 'Map',
|
|
392
|
-
space,
|
|
393
|
-
typename: schema.typename,
|
|
394
|
-
pivotFieldName: 'location',
|
|
395
|
-
});
|
|
396
|
-
space.db.add(tableView);
|
|
397
|
-
space.db.add(mapView);
|
|
398
|
-
},
|
|
399
|
-
onChatCreated: async ({ space, binder }) => {
|
|
400
|
-
const { objects } = await space.db.query(Filter.type(DataType.View)).run();
|
|
401
|
-
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
402
|
-
},
|
|
403
|
-
}),
|
|
404
|
-
args: {
|
|
405
|
-
deckComponents: [[ChatContainer], ['surfaces']],
|
|
406
|
-
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/map'],
|
|
407
|
-
},
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
export const WithTrip: Story = {
|
|
411
|
-
decorators: getDecorators({
|
|
412
|
-
plugins: [MarkdownPlugin(), MapPlugin()],
|
|
413
|
-
config: config.remote,
|
|
414
|
-
types: [Map.Map],
|
|
415
|
-
onInit: async ({ space }) => {
|
|
416
|
-
// TODO(burdon): Table.
|
|
417
|
-
space.db.add(Map.make({ name: 'Trip' }));
|
|
418
|
-
space.db.add(
|
|
419
|
-
Markdown.makeDocument({
|
|
420
|
-
name: 'Itinerary',
|
|
421
|
-
content: trim`
|
|
422
|
-
# Itinerary
|
|
423
|
-
|
|
424
|
-
## Day 1
|
|
425
|
-
- Visit the Sagrada Familia
|
|
426
|
-
- Visit the Park Güell
|
|
427
|
-
- Visit the Casa Batlló
|
|
428
|
-
|
|
429
|
-
## Day 2
|
|
430
|
-
- Visit the Eiffel Tower
|
|
431
|
-
- Visit the Louvre
|
|
432
|
-
- Visit the Musée d'Orsay
|
|
433
|
-
`,
|
|
434
|
-
}),
|
|
435
|
-
);
|
|
436
|
-
space.db.add(
|
|
437
|
-
Markdown.makeDocument({
|
|
438
|
-
name: 'Barcelona',
|
|
439
|
-
content: trim`
|
|
440
|
-
# Barcelona
|
|
441
|
-
|
|
442
|
-
Barcelona is the capital and most populous city of Catalonia, an autonomous community in northeastern Spain.
|
|
443
|
-
It is located on the Mediterranean coast, on the banks of the Llobregat River, in the comarca of the Baix Llobregat.
|
|
444
|
-
The city is known for its rich history, vibrant culture, and stunning architecture, including the Sagrada Familia, Park Güell, and Casa Batlló.
|
|
445
|
-
`,
|
|
446
|
-
}),
|
|
447
|
-
);
|
|
448
|
-
},
|
|
449
|
-
onChatCreated: async ({ space, binder }) => {
|
|
450
|
-
const { objects } = await space.db.query(Filter.or(Filter.type(Map.Map), Filter.type(Markdown.Document))).run();
|
|
451
|
-
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
452
|
-
},
|
|
453
|
-
}),
|
|
454
|
-
args: {
|
|
455
|
-
deckComponents: [[ChatContainer], ['surfaces']],
|
|
456
|
-
},
|
|
457
|
-
};
|
|
458
|
-
|
|
459
|
-
export const WithBoard: Story = {
|
|
460
|
-
decorators: getDecorators({
|
|
461
|
-
plugins: [BoardPlugin()],
|
|
462
|
-
config: config.remote,
|
|
463
|
-
types: [Board.Board],
|
|
464
|
-
onInit: async ({ space }) => {
|
|
465
|
-
space.db.add(Board.makeBoard());
|
|
466
|
-
},
|
|
467
|
-
onChatCreated: async ({ space, binder }) => {
|
|
468
|
-
const { objects } = await space.db.query(Filter.type(Board.Board)).run();
|
|
469
|
-
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
470
|
-
},
|
|
471
|
-
}),
|
|
472
|
-
args: {
|
|
473
|
-
debug: true,
|
|
474
|
-
deckComponents: [[ChatContainer], ['surfaces']],
|
|
475
|
-
},
|
|
476
|
-
};
|
|
477
|
-
|
|
478
|
-
export const WithResearch: Story = {
|
|
479
|
-
decorators: getDecorators({
|
|
480
|
-
plugins: [MarkdownPlugin(), TablePlugin()],
|
|
481
|
-
config: config.persistent,
|
|
482
|
-
types: [...ResearchDataTypes, ResearchGraph],
|
|
483
|
-
accessTokens: [Obj.make(DataType.AccessToken, { source: 'exa.ai', token: EXA_API_KEY })],
|
|
484
|
-
}),
|
|
485
|
-
args: {
|
|
486
|
-
deckComponents: [[ChatContainer], [GraphContainer, LoggingContainer]],
|
|
487
|
-
blueprints: [RESEARCH_BLUEPRINT.key],
|
|
488
|
-
},
|
|
489
|
-
};
|
|
490
|
-
|
|
491
|
-
export const WithSearch: Story = {
|
|
492
|
-
decorators: getDecorators({
|
|
493
|
-
config: config.remote,
|
|
494
|
-
types: testTypes,
|
|
495
|
-
onInit: async ({ space }) => {
|
|
496
|
-
await addTestData(space);
|
|
497
|
-
},
|
|
498
|
-
}),
|
|
499
|
-
args: {
|
|
500
|
-
deckComponents: [[ChatContainer], [GraphContainer]],
|
|
501
|
-
},
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
export const WithTranscription: Story = {
|
|
505
|
-
decorators: getDecorators({
|
|
506
|
-
plugins: [TranscriptionPlugin(), PreviewPlugin()],
|
|
507
|
-
config: config.remote,
|
|
508
|
-
types: [Transcript.Transcript],
|
|
509
|
-
onInit: async ({ space }) => {
|
|
510
|
-
const queue = space.queues.create();
|
|
511
|
-
const messages = createTestTranscription();
|
|
512
|
-
await queue.append(messages);
|
|
513
|
-
space.db.add(Transcript.makeTranscript(queue.dxn));
|
|
514
|
-
},
|
|
515
|
-
onChatCreated: async ({ space, binder }) => {
|
|
516
|
-
const { objects } = await space.db.query(Filter.type(Transcript.Transcript)).run();
|
|
517
|
-
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
518
|
-
},
|
|
519
|
-
}),
|
|
520
|
-
args: {
|
|
521
|
-
deckComponents: [[ChatContainer], ['surfaces']],
|
|
522
|
-
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/transcription'],
|
|
523
|
-
},
|
|
524
|
-
};
|
|
525
|
-
|
|
526
|
-
export const WithLinearSync: Story = {
|
|
527
|
-
decorators: getDecorators({
|
|
528
|
-
plugins: [],
|
|
529
|
-
config: config.remote,
|
|
530
|
-
types: [DataType.Task, DataType.Person, DataType.Project],
|
|
531
|
-
accessTokens: accessTokensFromEnv({
|
|
532
|
-
'linear.app': import.meta.env.VITE_LINEAR_API_KEY,
|
|
533
|
-
}),
|
|
534
|
-
}),
|
|
535
|
-
args: {
|
|
536
|
-
deckComponents: [[ChatContainer], [GraphContainer]],
|
|
537
|
-
blueprints: [LINEAR_BLUEPRINT.key],
|
|
538
|
-
},
|
|
539
|
-
};
|
|
540
|
-
|
|
541
|
-
export const WithTriggers: Story = {
|
|
542
|
-
decorators: getDecorators({
|
|
543
|
-
plugins: [],
|
|
544
|
-
config: config.remote,
|
|
545
|
-
onInit: async ({ space }) => {
|
|
546
|
-
space.db.add(
|
|
547
|
-
Obj.make(FunctionTrigger, {
|
|
548
|
-
function: Ref.make(serializeFunction(exampleFunctions.reply)),
|
|
549
|
-
enabled: true,
|
|
550
|
-
spec: {
|
|
551
|
-
kind: 'timer',
|
|
552
|
-
cron: '*/5 * * * * *', // Every 5 seconds
|
|
553
|
-
},
|
|
554
|
-
}),
|
|
555
|
-
);
|
|
556
|
-
},
|
|
557
|
-
}),
|
|
558
|
-
args: {
|
|
559
|
-
deckComponents: [[ChatContainer], [TriggersContainer, InvocationsContainer]],
|
|
560
|
-
blueprints: [],
|
|
561
|
-
},
|
|
562
|
-
};
|
|
563
|
-
|
|
564
|
-
export const WithChessTrigger: Story = {
|
|
565
|
-
decorators: getDecorators({
|
|
566
|
-
plugins: [ChessPlugin()],
|
|
567
|
-
config: config.remote,
|
|
568
|
-
types: [Chess.Game],
|
|
569
|
-
onInit: async ({ space }) => {
|
|
570
|
-
// TODO(burdon): Add player DID (for user and assistant).
|
|
571
|
-
space.db.add(
|
|
572
|
-
Chess.makeGame({
|
|
573
|
-
name: 'Challenge',
|
|
574
|
-
pgn: [
|
|
575
|
-
'1. e4 e5',
|
|
576
|
-
'2. Nf3 Nc6',
|
|
577
|
-
'3. Bc4 Bc5',
|
|
578
|
-
'4. c3 Nf6',
|
|
579
|
-
'5. d4 exd4',
|
|
580
|
-
'6. cxd4 Bb4+',
|
|
581
|
-
'7. Nc3 d5',
|
|
582
|
-
'8. exd5 Nxd5',
|
|
583
|
-
'9. O-O Be6',
|
|
584
|
-
'10. Qb3 Na5',
|
|
585
|
-
'11. Qa4+ c6',
|
|
586
|
-
'12. Bxd5 Bxc3',
|
|
587
|
-
'13. Bxe6 fxe6',
|
|
588
|
-
'*',
|
|
589
|
-
].join(' '),
|
|
590
|
-
}),
|
|
591
|
-
);
|
|
592
|
-
|
|
593
|
-
space.db.add(
|
|
594
|
-
Obj.make(FunctionTrigger, {
|
|
595
|
-
function: Ref.make(serializeFunction(chessFunctions.play)),
|
|
596
|
-
enabled: true,
|
|
597
|
-
spec: {
|
|
598
|
-
kind: 'subscription',
|
|
599
|
-
query: Query.select(Filter.type(Chess.Game)).ast,
|
|
600
|
-
},
|
|
601
|
-
input: {
|
|
602
|
-
id: '{{event.changedObjectId}}',
|
|
603
|
-
side: 'black', // NOTE: Removing it makes the bot play itself.
|
|
604
|
-
},
|
|
605
|
-
}),
|
|
606
|
-
);
|
|
607
|
-
},
|
|
608
|
-
}),
|
|
609
|
-
args: {
|
|
610
|
-
deckComponents: [[ChessContainer], [TriggersContainer, InvocationsContainer]],
|
|
611
|
-
blueprints: [],
|
|
612
|
-
},
|
|
613
|
-
};
|
|
614
|
-
|
|
615
|
-
export const WithResearchQueue: Story = {
|
|
616
|
-
decorators: getDecorators({
|
|
617
|
-
plugins: [],
|
|
618
|
-
config: config.local,
|
|
619
|
-
types: [...ResearchDataTypes, ResearchGraph, ResearchInputQueue],
|
|
620
|
-
accessTokens: [Obj.make(DataType.AccessToken, { source: 'exa.ai', token: EXA_API_KEY })],
|
|
621
|
-
onInit: async ({ space }) => {
|
|
622
|
-
const researchInputQueue = space.db.add(
|
|
623
|
-
Obj.make(ResearchInputQueue, { queue: Ref.fromDXN(space.queues.create().dxn) }),
|
|
624
|
-
);
|
|
625
|
-
const orgs = organizations.map(({ id: _, ...org }) => Obj.make(DataType.Organization, org));
|
|
626
|
-
await researchInputQueue.queue.target!.append(orgs);
|
|
627
|
-
|
|
628
|
-
const researchPrompt = space.db.add(
|
|
629
|
-
Prompt.make({
|
|
630
|
-
name: 'Research',
|
|
631
|
-
description: 'Research organization',
|
|
632
|
-
input: Schema.Struct({
|
|
633
|
-
org: Schema.Any,
|
|
634
|
-
}),
|
|
635
|
-
output: Schema.Any,
|
|
636
|
-
|
|
637
|
-
instructions:
|
|
638
|
-
'Research the organization provided as input. Create a research note for it at the end. NOTE: Do mocked reseach (set mockSearch to true).',
|
|
639
|
-
blueprints: [Ref.make(RESEARCH_BLUEPRINT)],
|
|
640
|
-
}),
|
|
641
|
-
);
|
|
642
|
-
|
|
643
|
-
space.db.add(
|
|
644
|
-
Obj.make(FunctionTrigger, {
|
|
645
|
-
function: Ref.make(serializeFunction(agent)),
|
|
646
|
-
enabled: true,
|
|
647
|
-
spec: {
|
|
648
|
-
kind: 'queue',
|
|
649
|
-
queue: researchInputQueue.queue.dxn.toString(),
|
|
650
|
-
},
|
|
651
|
-
input: {
|
|
652
|
-
prompt: Ref.make(researchPrompt),
|
|
653
|
-
input: '{{event.item}}',
|
|
654
|
-
},
|
|
655
|
-
}),
|
|
656
|
-
);
|
|
657
|
-
},
|
|
658
|
-
}),
|
|
659
|
-
args: {
|
|
660
|
-
deckComponents: [
|
|
661
|
-
[ResearchInputStack],
|
|
662
|
-
[TriggersContainer, PromptContainer, InvocationsContainer, LoggingContainer, GraphContainer],
|
|
663
|
-
[ResearchOutputStack],
|
|
664
|
-
],
|
|
665
|
-
blueprints: [RESEARCH_BLUEPRINT.key],
|
|
666
|
-
},
|
|
667
|
-
};
|
|
668
|
-
|
|
669
|
-
export const WithProject: Story = {
|
|
670
|
-
decorators: getDecorators({
|
|
671
|
-
plugins: [InboxPlugin(), MarkdownPlugin(), ProjectPlugin()],
|
|
672
|
-
config: config.remote,
|
|
673
|
-
accessTokens: [Obj.make(DataType.AccessToken, { source: 'exa.ai', token: EXA_API_KEY })],
|
|
674
|
-
types: [
|
|
675
|
-
DataType.Employer,
|
|
676
|
-
DataType.HasConnection,
|
|
677
|
-
DataType.Message,
|
|
678
|
-
DataType.Organization,
|
|
679
|
-
DataType.Person,
|
|
680
|
-
DataType.Project,
|
|
681
|
-
DataType.View,
|
|
682
|
-
Mailbox.Mailbox,
|
|
683
|
-
ResearchOn,
|
|
684
|
-
],
|
|
685
|
-
onInit: async ({ space }) => {
|
|
686
|
-
await addTestData(space);
|
|
687
|
-
const { objects: people } = await space.db.query(Filter.type(DataType.Person)).run();
|
|
688
|
-
const { objects: organizations } = await space.db.query(Filter.type(DataType.Organization)).run();
|
|
689
|
-
|
|
690
|
-
people.slice(0, 4).forEach((person) => {
|
|
691
|
-
person.notes = 'Project';
|
|
692
|
-
});
|
|
693
|
-
|
|
694
|
-
const queue = space.queues.create();
|
|
695
|
-
const messages = createTestMailbox(people);
|
|
696
|
-
await queue.append(messages);
|
|
697
|
-
const mailbox = space.db.add(Mailbox.make({ name: 'Mailbox', queue: queue.dxn }));
|
|
698
|
-
|
|
699
|
-
const dxosResearch = space.db.add(
|
|
700
|
-
Markdown.makeDocument({
|
|
701
|
-
name: 'DXOS Research',
|
|
702
|
-
content: 'DXOS builds Composer, an open-source AI-powered malleable application.',
|
|
703
|
-
}),
|
|
704
|
-
);
|
|
705
|
-
const blueyardResearch = space.db.add(
|
|
706
|
-
Markdown.makeDocument({
|
|
707
|
-
name: 'Blue Yard Research',
|
|
708
|
-
content: 'Blue Yard is a venture capital firm that invests in early-stage startups.',
|
|
709
|
-
}),
|
|
710
|
-
);
|
|
711
|
-
|
|
712
|
-
const dxos = organizations.find((org) => org.name === 'DXOS')!;
|
|
713
|
-
const blueyard = organizations.find((org) => org.name === 'Blue Yard')!;
|
|
714
|
-
console.log(dxos, blueyard);
|
|
715
|
-
space.db.add(
|
|
716
|
-
Relation.make(ResearchOn, {
|
|
717
|
-
[Relation.Source]: dxosResearch,
|
|
718
|
-
[Relation.Target]: dxos,
|
|
719
|
-
completedAt: new Date().toISOString(),
|
|
720
|
-
}),
|
|
721
|
-
);
|
|
722
|
-
space.db.add(
|
|
723
|
-
Relation.make(ResearchOn, {
|
|
724
|
-
[Relation.Source]: blueyardResearch,
|
|
725
|
-
[Relation.Target]: blueyard,
|
|
726
|
-
completedAt: new Date().toISOString(),
|
|
727
|
-
}),
|
|
728
|
-
);
|
|
729
|
-
|
|
730
|
-
const contactsQuery = Query.select(Filter.type(DataType.Person, { notes: 'Project' }));
|
|
731
|
-
const organizationsQuery = contactsQuery.sourceOf(DataType.Employer, { active: true }).target();
|
|
732
|
-
const notesQuery = organizationsQuery.targetOf(ResearchOn).source();
|
|
733
|
-
|
|
734
|
-
const researchPrompt = space.db.add(
|
|
735
|
-
Prompt.make({
|
|
736
|
-
name: 'Research',
|
|
737
|
-
description: 'Research organization',
|
|
738
|
-
input: Schema.Struct({
|
|
739
|
-
org: Schema.Any,
|
|
740
|
-
}),
|
|
741
|
-
output: Schema.Any,
|
|
742
|
-
|
|
743
|
-
instructions:
|
|
744
|
-
'Research the organization provided as input. Absolutely, in all cases, create a research note for it at the end. NOTE: Do mocked reseach (set mockSearch to true).',
|
|
745
|
-
blueprints: [Ref.make(RESEARCH_BLUEPRINT)],
|
|
746
|
-
}),
|
|
747
|
-
);
|
|
748
|
-
|
|
749
|
-
const researchTrigger = Obj.make(FunctionTrigger, {
|
|
750
|
-
function: Ref.make(serializeFunction(agent)),
|
|
751
|
-
enabled: true,
|
|
752
|
-
spec: {
|
|
753
|
-
kind: 'subscription',
|
|
754
|
-
query: organizationsQuery.ast,
|
|
755
|
-
},
|
|
756
|
-
input: {
|
|
757
|
-
prompt: Ref.make(researchPrompt),
|
|
758
|
-
input: '{{event.subject}}',
|
|
759
|
-
},
|
|
760
|
-
});
|
|
761
|
-
space.db.add(researchTrigger);
|
|
762
|
-
|
|
763
|
-
const mailboxView = createView({
|
|
764
|
-
name: 'Mailbox',
|
|
765
|
-
query: Query.select(
|
|
766
|
-
Filter.type(DataType.Message, { properties: { labels: Filter.contains('Project') } }),
|
|
767
|
-
).options({
|
|
768
|
-
queues: [mailbox.queue.dxn.toString()],
|
|
769
|
-
}),
|
|
770
|
-
jsonSchema: Type.toJsonSchema(DataType.Message),
|
|
771
|
-
presentation: Obj.make(DataType.Collection, { objects: [] }),
|
|
772
|
-
});
|
|
773
|
-
const contactsView = createView({
|
|
774
|
-
name: 'Contacts',
|
|
775
|
-
query: contactsQuery,
|
|
776
|
-
jsonSchema: Type.toJsonSchema(DataType.Person),
|
|
777
|
-
presentation: Obj.make(DataType.Collection, { objects: [] }),
|
|
778
|
-
});
|
|
779
|
-
const organizationsView = createView({
|
|
780
|
-
name: 'Organizations',
|
|
781
|
-
query: organizationsQuery,
|
|
782
|
-
jsonSchema: Type.toJsonSchema(DataType.Organization),
|
|
783
|
-
presentation: Obj.make(DataType.Collection, { objects: [] }),
|
|
784
|
-
});
|
|
785
|
-
const notesView = createView({
|
|
786
|
-
name: 'Notes',
|
|
787
|
-
query: notesQuery,
|
|
788
|
-
jsonSchema: Type.toJsonSchema(Markdown.Document),
|
|
789
|
-
presentation: Obj.make(DataType.Collection, { objects: [] }),
|
|
790
|
-
});
|
|
791
|
-
|
|
792
|
-
space.db.add(
|
|
793
|
-
DataType.makeProject({
|
|
794
|
-
name: 'Investor Research',
|
|
795
|
-
collections: [mailboxView, contactsView, organizationsView, notesView].map((view) => Ref.make(view)),
|
|
796
|
-
}),
|
|
797
|
-
);
|
|
798
|
-
},
|
|
799
|
-
}),
|
|
800
|
-
args: {
|
|
801
|
-
deckComponents: [[ProjectContainer], [TriggersContainer, InvocationsContainer]],
|
|
802
|
-
blueprints: [],
|
|
803
|
-
},
|
|
804
|
-
};
|