@dxos/plugin-assistant 0.8.4-main.67995b8 → 0.8.4-main.69d29f4
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-ECQYUQ2B.mjs +153 -0
- package/dist/lib/browser/ChatCompanion-ECQYUQ2B.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-QCCOFBUX.mjs +73 -0
- package/dist/lib/browser/ChatContainer-QCCOFBUX.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-SMK4RSZU.mjs +85 -0
- package/dist/lib/browser/ChatDialog-SMK4RSZU.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/blueprint-definition-DGHH7MUU.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +12 -0
- package/dist/lib/browser/blueprints/index.mjs.map +7 -0
- package/dist/lib/browser/chunk-3JYPE2MM.mjs +1832 -0
- package/dist/lib/browser/chunk-3JYPE2MM.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-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.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 +264 -168
- 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-NCITRSJJ.mjs +109 -0
- package/dist/lib/browser/react-surface-NCITRSJJ.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 +11 -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-Q4FUZ2MW.mjs +154 -0
- package/dist/lib/node-esm/ChatCompanion-Q4FUZ2MW.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-AKI33HIB.mjs +74 -0
- package/dist/lib/node-esm/ChatContainer-AKI33HIB.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-AP45PVZR.mjs +86 -0
- package/dist/lib/node-esm/ChatDialog-AP45PVZR.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-SEMDEIYG.mjs +15 -0
- 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-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-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.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-XI5T3MJC.mjs +1833 -0
- package/dist/lib/node-esm/chunk-XI5T3MJC.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 +264 -168
- 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-ST6V7LPE.mjs +110 -0
- package/dist/lib/node-esm/react-surface-ST6V7LPE.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 +11 -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 +11 -4
- 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 +33 -20
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +10 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +13 -0
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer.d.ts +15 -7
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +7 -0
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
- package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
- package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +5 -6
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +13 -11
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +198 -56
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +42 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/PromptArticle.d.ts +7 -0
- package/dist/types/src/components/PromptArticle.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +317 -7
- 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 +314 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +21 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
- package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +9 -15
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +318 -5
- 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 -6
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +4 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/object-list.d.ts +10 -0
- package/dist/types/src/functions/object-list.d.ts.map +1 -0
- package/dist/types/src/functions/object-load.d.ts +8 -0
- 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 +8 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +25 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +8 -19
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +7 -8
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +4 -0
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnline.d.ts +3 -0
- package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +7 -0
- package/dist/types/src/hooks/usePresets.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 +4 -0
- package/dist/types/src/processor/index.d.ts.map +1 -0
- package/dist/types/src/{hooks → processor}/presets.d.ts +3 -3
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +75 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts +2 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/processor/update-name.d.ts +10 -0
- package/dist/types/src/processor/update-name.d.ts.map +1 -0
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +8 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts +2 -2
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +262 -28
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +42 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +95 -0
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
- 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/defs.d.ts +2 -0
- package/dist/types/src/types/defs.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 +5 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +14 -213
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +124 -100
- package/src/AssistantPlugin.tsx +125 -113
- 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 +11 -6
- 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 +92 -77
- package/src/components/BlueprintArticle.tsx +29 -0
- package/src/components/Chat/Chat.tsx +237 -194
- package/src/components/Chat/events.ts +14 -1
- package/src/components/ChatCompanion.tsx +163 -0
- package/src/components/ChatContainer.tsx +48 -32
- package/src/components/ChatDialog.tsx +28 -18
- package/src/components/ChatProgress/ChatProgress.tsx +54 -0
- package/src/components/{SequenceEditor → ChatProgress}/index.ts +1 -1
- package/src/components/ChatPrompt/ChatActions.tsx +11 -27
- package/src/components/ChatPrompt/ChatOptions.tsx +238 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +32 -38
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatPrompt/index.ts +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +123 -116
- package/src/components/ChatThread/ChatThread.tsx +66 -36
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/components/ChatThread/registry.tsx +174 -0
- package/src/components/ChatThread/sync.test.ts +97 -0
- package/src/components/ChatThread/sync.ts +154 -0
- package/src/components/ChatThread/testing/thread.md +37 -0
- package/src/components/PromptArticle.tsx +50 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +38 -17
- package/src/components/TemplateEditor/TemplateEditor.tsx +33 -54
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +28 -15
- package/src/components/TemplateEditor/TemplateForm.tsx +80 -31
- 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 +143 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +18 -28
- package/src/components/Toolbox/Toolbox.tsx +37 -68
- 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 +3 -7
- package/src/functions/index.ts +7 -0
- package/src/functions/object-list.ts +49 -0
- package/src/functions/object-load.ts +47 -0
- package/src/functions/object-search.ts +46 -0
- package/src/hooks/index.ts +8 -4
- package/src/hooks/useBlueprintRegistry.ts +105 -0
- package/src/hooks/useChatProcessor.ts +38 -104
- package/src/hooks/useChatServices.ts +31 -51
- package/src/hooks/useChatToolbarActions.ts +121 -0
- package/src/hooks/useContextBinder.ts +32 -0
- package/src/hooks/useContextObjects.ts +46 -0
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/useFlush.ts +35 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +44 -0
- package/src/hooks/useReferencesProvider.ts +15 -12
- package/src/index.ts +2 -1
- package/src/meta.ts +11 -8
- package/src/processor/index.ts +7 -0
- package/src/{hooks → processor}/presets.ts +16 -8
- package/src/processor/processor.test.ts +72 -0
- package/src/processor/processor.ts +275 -0
- package/src/processor/update-name.ts +59 -0
- package/src/queue-logger.ts +17 -18
- package/src/testing/index.ts +1 -1
- package/src/testing/test-generator.ts +262 -0
- package/src/testing/test-sequence.ts +2 -27
- package/src/testing/test-services.ts +10 -14
- package/src/translations.ts +49 -18
- package/src/types/Assistant.ts +62 -0
- package/src/types/AssistantAction.ts +75 -0
- package/src/types/capabilities.ts +27 -0
- package/src/types/defs.ts +5 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +6 -1
- package/src/types/service.ts +25 -14
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/BlueprintContainer-IZ4AK5EO.mjs +0 -28
- package/dist/lib/browser/BlueprintContainer-IZ4AK5EO.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-RP3QEXYX.mjs +0 -54
- package/dist/lib/browser/ChatContainer-RP3QEXYX.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-ZVLXFHEY.mjs +0 -72
- package/dist/lib/browser/ChatDialog-ZVLXFHEY.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs +0 -162
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-XSEOKJLG.mjs +0 -164
- package/dist/lib/browser/app-graph-builder-XSEOKJLG.mjs.map +0 -7
- package/dist/lib/browser/chunk-63GG6U6D.mjs +0 -2226
- package/dist/lib/browser/chunk-63GG6U6D.mjs.map +0 -7
- package/dist/lib/browser/chunk-7W7LHTRH.mjs +0 -171
- package/dist/lib/browser/chunk-7W7LHTRH.mjs.map +0 -7
- package/dist/lib/browser/chunk-FDCJSQYF.mjs +0 -40
- package/dist/lib/browser/chunk-FDCJSQYF.mjs.map +0 -7
- package/dist/lib/browser/chunk-KFXSBNZR.mjs +0 -89
- package/dist/lib/browser/chunk-KFXSBNZR.mjs.map +0 -7
- package/dist/lib/browser/chunk-LERGF5YG.mjs +0 -108
- package/dist/lib/browser/chunk-LERGF5YG.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MV3VSZLS.mjs +0 -75
- package/dist/lib/browser/intent-resolver-MV3VSZLS.mjs.map +0 -7
- package/dist/lib/browser/react-surface-3GYEHQRP.mjs +0 -150
- package/dist/lib/browser/react-surface-3GYEHQRP.mjs.map +0 -7
- package/dist/lib/browser/settings-5GTTCVGD.mjs +0 -22
- package/dist/lib/browser/settings-5GTTCVGD.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-RGTMNLNX.mjs +0 -29
- package/dist/lib/node-esm/BlueprintContainer-RGTMNLNX.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-W3W6FWV3.mjs +0 -55
- package/dist/lib/node-esm/ChatContainer-W3W6FWV3.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QW4JRKVO.mjs +0 -73
- package/dist/lib/node-esm/ChatDialog-QW4JRKVO.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs +0 -163
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-PANCJUHV.mjs +0 -165
- package/dist/lib/node-esm/app-graph-builder-PANCJUHV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BFO3KHYL.mjs +0 -2227
- package/dist/lib/node-esm/chunk-BFO3KHYL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MS3PJARN.mjs +0 -109
- package/dist/lib/node-esm/chunk-MS3PJARN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +0 -41
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VIIMA3XQ.mjs +0 -90
- package/dist/lib/node-esm/chunk-VIIMA3XQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z7PUODRT.mjs +0 -172
- package/dist/lib/node-esm/chunk-Z7PUODRT.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-3FMC3GHC.mjs +0 -76
- package/dist/lib/node-esm/intent-resolver-3FMC3GHC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-QDQWJ7FZ.mjs +0 -151
- package/dist/lib/node-esm/react-surface-QDQWJ7FZ.mjs.map +0 -7
- package/dist/lib/node-esm/settings-J2EXEM5H.mjs +0 -23
- package/dist/lib/node-esm/settings-J2EXEM5H.mjs.map +0 -7
- 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/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-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/capability-definitions.d.ts +0 -7
- package/dist/types/src/capability-definitions.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/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -17
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
- package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
- package/dist/types/src/components/PromptSettings.d.ts +0 -6
- package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
- package/dist/types/src/components/SequenceContainer.d.ts +0 -8
- package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -8
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
- package/dist/types/src/components/SequenceEditor/index.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.d.ts +0 -86
- package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.test.d.ts +0 -2
- package/dist/types/src/hooks/chat-processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/presets.d.ts.map +0 -1
- package/dist/types/src/hooks/useBlueprints.d.ts +0 -9
- package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/stories/Chat.stories.d.ts +0 -207
- package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/testing/test-functions.d.ts +0 -3
- package/dist/types/src/testing/test-functions.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -120
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -169
- package/src/capabilities/intent-resolver.ts +0 -72
- package/src/capabilities/react-surface.tsx +0 -138
- package/src/capabilities/settings.ts +0 -19
- package/src/capability-definitions.ts +0 -15
- package/src/components/BlueprintContainer.tsx +0 -24
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
- package/src/components/ChatThread/ChatMessage.tsx +0 -268
- package/src/components/ChatThread/ToolBlock.tsx +0 -121
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/components/PromptSettings.tsx +0 -89
- package/src/components/SequenceContainer.tsx +0 -132
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -32
- package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
- package/src/events.ts +0 -11
- package/src/hooks/chat-processor.test.ts +0 -16
- package/src/hooks/chat-processor.ts +0 -314
- package/src/hooks/useBlueprints.ts +0 -57
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -81
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/stories/Chat.stories.tsx +0 -371
- package/src/testing/test-functions.ts +0 -11
- package/src/tools/function.ts +0 -46
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -217
- package/src/tools/openapi.ts +0 -338
- package/src/types/schema.ts +0 -108
- package/src/typings.d.ts +0 -9
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type JSX, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AiContextBinder } from '@dxos/assistant';
|
|
8
|
+
import { type Blueprint } from '@dxos/blueprints';
|
|
9
|
+
import { type Database, Filter, Obj, Type } from '@dxos/echo';
|
|
10
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
11
|
+
import { IconButton, Popover, Select, useTranslation } from '@dxos/react-ui';
|
|
12
|
+
import { Listbox, SearchList, useSearchListResults } from '@dxos/react-ui-searchlist';
|
|
13
|
+
import { Tabs } from '@dxos/react-ui-tabs';
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
useActiveBlueprints,
|
|
17
|
+
useBlueprintHandlers,
|
|
18
|
+
useBlueprints,
|
|
19
|
+
useContextObjects,
|
|
20
|
+
useFilteredTypes,
|
|
21
|
+
} from '../../hooks';
|
|
22
|
+
import { meta } from '../../meta';
|
|
23
|
+
|
|
24
|
+
const panelClassNames = 'is-[calc(100dvw-.5rem)] sm:is-max md:is-72 max-is-[--text-content]';
|
|
25
|
+
|
|
26
|
+
export type ChatOptionsProps = {
|
|
27
|
+
db: Database.Database;
|
|
28
|
+
context: AiContextBinder;
|
|
29
|
+
blueprintRegistry?: Blueprint.Registry;
|
|
30
|
+
presets?: { id: string; label: string }[];
|
|
31
|
+
preset?: string;
|
|
32
|
+
onPresetChange?: (id: string) => void;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Manages the runtime context for the chat.
|
|
37
|
+
*/
|
|
38
|
+
export const ChatOptions = ({ db, context, blueprintRegistry, presets, preset, onPresetChange }: ChatOptionsProps) => {
|
|
39
|
+
const { t } = useTranslation(meta.id);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div role='none' className='flex p-2'>
|
|
43
|
+
<Popover.Root>
|
|
44
|
+
<Popover.Trigger asChild>
|
|
45
|
+
<IconButton variant='ghost' icon='ph--plus--regular' iconOnly label={t('context objects button')} />
|
|
46
|
+
</Popover.Trigger>
|
|
47
|
+
<Popover.Portal>
|
|
48
|
+
<Popover.Content side='top' classNames={panelClassNames}>
|
|
49
|
+
<Popover.Viewport>
|
|
50
|
+
<ObjectsPanel db={db} context={context} />
|
|
51
|
+
</Popover.Viewport>
|
|
52
|
+
<Popover.Arrow />
|
|
53
|
+
</Popover.Content>
|
|
54
|
+
</Popover.Portal>
|
|
55
|
+
</Popover.Root>
|
|
56
|
+
|
|
57
|
+
<Popover.Root>
|
|
58
|
+
<Popover.Trigger asChild>
|
|
59
|
+
<IconButton
|
|
60
|
+
variant='ghost'
|
|
61
|
+
icon='ph--sliders-horizontal--regular'
|
|
62
|
+
iconOnly
|
|
63
|
+
label={t('context settings button')}
|
|
64
|
+
/>
|
|
65
|
+
</Popover.Trigger>
|
|
66
|
+
<Popover.Portal>
|
|
67
|
+
<Popover.Content side='top' classNames={panelClassNames}>
|
|
68
|
+
<Popover.Viewport>
|
|
69
|
+
<Tabs.Root orientation='horizontal' defaultValue='blueprints' defaultActivePart='list' tabIndex={-1}>
|
|
70
|
+
<Tabs.Viewport classNames='max-bs-[--radix-popover-content-available-height] grid grid-rows-[1fr_min-content] [&_[cmdk-root]]:contents [&_[role="tabpanel"]]:grid [&_[role="tabpanel"]]:grid-rows-[1fr_min-content] [&_[role="listbox"]]:min-bs-0 [&_[role="listbox"]]:overflow-y-auto [&_[role="tabpanel"]]:min-bs-0 [&_[role="tabpanel"]]:pli-cardSpacingChrome [&_[role="tabpanel"][data-state="active"]]:order-first [&_[role="tabpanel"][data-state="inactive"]]:hidden'>
|
|
71
|
+
<Tabs.Tabpanel value='blueprints' tabIndex={-1} classNames='dx-focus-ring-inset'>
|
|
72
|
+
<BlueprintsPanel blueprintRegistry={blueprintRegistry} db={db} context={context} />
|
|
73
|
+
</Tabs.Tabpanel>
|
|
74
|
+
<Tabs.Tabpanel value='model' tabIndex={-1} classNames='dx-focus-ring-inset !pli-0'>
|
|
75
|
+
<ModelsPanel presets={presets} preset={preset} onPresetChange={onPresetChange} />
|
|
76
|
+
</Tabs.Tabpanel>
|
|
77
|
+
<Tabs.Tablist classNames='sm:overflow-x-hidden justify-center p-[--dx-cardSpacingChrome] border-bs border-subduedSeparator order-last'>
|
|
78
|
+
<Tabs.IconTab
|
|
79
|
+
value='blueprints'
|
|
80
|
+
icon='ph--blueprint--regular'
|
|
81
|
+
label={t('blueprints in context title')}
|
|
82
|
+
/>
|
|
83
|
+
<Tabs.IconTab value='model' label={t('chat model title')} icon='ph--cpu--regular' />
|
|
84
|
+
</Tabs.Tablist>
|
|
85
|
+
</Tabs.Viewport>
|
|
86
|
+
</Tabs.Root>
|
|
87
|
+
</Popover.Viewport>
|
|
88
|
+
<Popover.Arrow />
|
|
89
|
+
</Popover.Content>
|
|
90
|
+
</Popover.Portal>
|
|
91
|
+
</Popover.Root>
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const BlueprintsPanel = ({
|
|
97
|
+
blueprintRegistry,
|
|
98
|
+
db,
|
|
99
|
+
context,
|
|
100
|
+
}: Pick<ChatOptionsProps, 'blueprintRegistry' | 'db' | 'context'>) => {
|
|
101
|
+
const { t } = useTranslation(meta.id);
|
|
102
|
+
|
|
103
|
+
const blueprints = useBlueprints({ blueprintRegistry, db });
|
|
104
|
+
const activeBlueprints = useActiveBlueprints({ context });
|
|
105
|
+
const { onUpdateBlueprint } = useBlueprintHandlers({ db, context, blueprintRegistry });
|
|
106
|
+
|
|
107
|
+
const { results, handleSearch } = useSearchListResults({
|
|
108
|
+
items: blueprints,
|
|
109
|
+
extract: (blueprint) => blueprint.name,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<SearchList.Root onSearch={handleSearch}>
|
|
114
|
+
<SearchList.Content classNames='plb-cardSpacingChrome'>
|
|
115
|
+
<SearchList.Viewport>
|
|
116
|
+
{results.map((blueprint) => {
|
|
117
|
+
const isActive = activeBlueprints.has(blueprint.key);
|
|
118
|
+
return (
|
|
119
|
+
<SearchList.Item
|
|
120
|
+
classNames='flex items-center overflow-hidden'
|
|
121
|
+
key={blueprint.key}
|
|
122
|
+
value={blueprint.key}
|
|
123
|
+
label={blueprint.name}
|
|
124
|
+
checked={isActive}
|
|
125
|
+
onSelect={() => onUpdateBlueprint?.(blueprint.key, !isActive)}
|
|
126
|
+
/>
|
|
127
|
+
);
|
|
128
|
+
})}
|
|
129
|
+
</SearchList.Viewport>
|
|
130
|
+
</SearchList.Content>
|
|
131
|
+
<SearchList.Input placeholder={t('search placeholder')} classNames='mbe-cardSpacingChrome' autoFocus />
|
|
132
|
+
</SearchList.Root>
|
|
133
|
+
);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const ModelsPanel = ({
|
|
137
|
+
presets,
|
|
138
|
+
preset,
|
|
139
|
+
onPresetChange,
|
|
140
|
+
}: Pick<ChatOptionsProps, 'presets' | 'preset' | 'onPresetChange'>) => {
|
|
141
|
+
return (
|
|
142
|
+
<Listbox.Root value={preset} onValueChange={onPresetChange} autoFocus>
|
|
143
|
+
{presets?.map(({ id, label }) => {
|
|
144
|
+
return (
|
|
145
|
+
<Listbox.Option key={id} value={id}>
|
|
146
|
+
<Listbox.OptionLabel>{label}</Listbox.OptionLabel>
|
|
147
|
+
<Listbox.OptionIndicator />
|
|
148
|
+
</Listbox.Option>
|
|
149
|
+
);
|
|
150
|
+
})}
|
|
151
|
+
</Listbox.Root>
|
|
152
|
+
);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const ANY = '__any__';
|
|
156
|
+
|
|
157
|
+
const ObjectsPanel = ({ db, context }: Pick<ChatOptionsProps, 'db' | 'context'>): JSX.Element => {
|
|
158
|
+
const { t } = useTranslation(meta.id);
|
|
159
|
+
|
|
160
|
+
// Item types sorted by label.
|
|
161
|
+
const types = useFilteredTypes(db);
|
|
162
|
+
const typenames = useMemo(() => {
|
|
163
|
+
const typenames = types.map((type) => {
|
|
164
|
+
const typename = Type.getTypename(type);
|
|
165
|
+
return {
|
|
166
|
+
typename,
|
|
167
|
+
label: t('typename label', { ns: typename, defaultValue: typename }),
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
typenames.sort((a, b) => a.label.localeCompare(b.label));
|
|
172
|
+
return typenames;
|
|
173
|
+
}, [types]);
|
|
174
|
+
|
|
175
|
+
// Current type and filter.
|
|
176
|
+
const [typename, setTypename] = useState<string>(ANY);
|
|
177
|
+
const anyFilter = useMemo(
|
|
178
|
+
() => Filter.or(...typenames.map(({ typename }) => Filter.typename(typename))),
|
|
179
|
+
[typenames],
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
// Context objects.
|
|
183
|
+
const objects = useQuery(db, typename === ANY ? anyFilter : Filter.typename(typename));
|
|
184
|
+
const { objects: contextObjects, onUpdateObject } = useContextObjects({ db, context });
|
|
185
|
+
|
|
186
|
+
const { results, handleSearch } = useSearchListResults({
|
|
187
|
+
items: objects,
|
|
188
|
+
extract: (object) => Obj.getLabel(object) ?? Obj.getTypename(object) ?? object.id,
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
<SearchList.Root onSearch={handleSearch}>
|
|
193
|
+
<SearchList.Content classNames='p-cardSpacingChrome [&:has([cmdk-list-sizer]:empty)]:plb-0'>
|
|
194
|
+
<SearchList.Viewport>
|
|
195
|
+
{results.length ? (
|
|
196
|
+
results.map((object) => {
|
|
197
|
+
const isActive = contextObjects.findIndex((obj) => obj.id === object.id) !== -1;
|
|
198
|
+
return (
|
|
199
|
+
<SearchList.Item
|
|
200
|
+
classNames='flex items-center overflow-hidden'
|
|
201
|
+
key={object.id}
|
|
202
|
+
value={object.id}
|
|
203
|
+
label={Obj.getLabel(object) ?? Obj.getTypename(object) ?? object.id}
|
|
204
|
+
checked={isActive}
|
|
205
|
+
onSelect={() => onUpdateObject?.(Obj.getDXN(object), !isActive)}
|
|
206
|
+
/>
|
|
207
|
+
);
|
|
208
|
+
})
|
|
209
|
+
) : (
|
|
210
|
+
<SearchList.Item value='__empty__' label={t('no results')} />
|
|
211
|
+
)}
|
|
212
|
+
</SearchList.Viewport>
|
|
213
|
+
</SearchList.Content>
|
|
214
|
+
|
|
215
|
+
<div role='none' className='grid grid-cols-[min-content_1fr] gap-2 pli-cardSpacingChrome mbe-cardSpacingChrome'>
|
|
216
|
+
<Select.Root value={typename === ANY ? undefined : typename} onValueChange={setTypename}>
|
|
217
|
+
<Select.TriggerButton density='fine' placeholder={t('type filter placeholder')} />
|
|
218
|
+
<Select.Portal>
|
|
219
|
+
<Select.Content>
|
|
220
|
+
<Select.ScrollUpButton />
|
|
221
|
+
<Select.Viewport>
|
|
222
|
+
<Select.Option value={ANY}>{t('any type filter label')}</Select.Option>
|
|
223
|
+
{typenames.map(({ typename, label }) => (
|
|
224
|
+
<Select.Option key={typename} value={typename}>
|
|
225
|
+
{label}
|
|
226
|
+
</Select.Option>
|
|
227
|
+
))}
|
|
228
|
+
</Select.Viewport>
|
|
229
|
+
<Select.ScrollDownButton />
|
|
230
|
+
<Select.Arrow />
|
|
231
|
+
</Select.Content>
|
|
232
|
+
</Select.Portal>
|
|
233
|
+
</Select.Root>
|
|
234
|
+
<SearchList.Input placeholder={t('search placeholder')} classNames='mbe-0' autoFocus />
|
|
235
|
+
</div>
|
|
236
|
+
</SearchList.Root>
|
|
237
|
+
);
|
|
238
|
+
};
|
|
@@ -2,52 +2,46 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React
|
|
5
|
+
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
8
|
-
import { type
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { TagPicker, type TagPickerItemData, type TagPickerOptions } from '@dxos/react-ui-tag-picker';
|
|
12
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
13
|
-
import { isNonNullable } from '@dxos/util';
|
|
7
|
+
import { type AiContextBinder } from '@dxos/assistant';
|
|
8
|
+
import { type Database, Obj } from '@dxos/echo';
|
|
9
|
+
import { IconButton, type Label, type ThemedClassName, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { mx } from '@dxos/ui-theme';
|
|
14
11
|
|
|
12
|
+
import { useContextObjects } from '../../hooks';
|
|
15
13
|
import { meta } from '../../meta';
|
|
16
14
|
|
|
17
15
|
export type ChatReferencesProps = ThemedClassName<{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
onUpdate?: (ids: string[]) => void;
|
|
16
|
+
context: AiContextBinder;
|
|
17
|
+
db: Database.Database;
|
|
21
18
|
}>;
|
|
22
19
|
|
|
23
|
-
export const ChatReferences = ({ classNames,
|
|
24
|
-
const { t
|
|
25
|
-
|
|
26
|
-
const [items] = useAsyncState<TagPickerItemData[]>(async () => {
|
|
27
|
-
const objects = await Ref.Array.loadAll(context.objects.value ?? []);
|
|
28
|
-
return objects.filter(isNonNullable).map((obj) => ({ id: obj.id, label: Obj.getLabel(obj) ?? obj.id }));
|
|
29
|
-
}, [context]);
|
|
30
|
-
|
|
31
|
-
const handleSearch = useCallback<NonNullable<TagPickerOptions['onSearch']>>(
|
|
32
|
-
(text, ids) => {
|
|
33
|
-
// TODO(burdon): Filter by Item tag (e.g., exclude "contacts") and Query by object label.
|
|
34
|
-
// TODO(burdon): Change to Filter.text().
|
|
35
|
-
const objects = space.db.query(Filter.everything()).runSync();
|
|
36
|
-
return objects
|
|
37
|
-
.map(({ object }) => ({ id: object.id, label: Obj.getLabel(object) ?? '' }))
|
|
38
|
-
.filter(({ id, label }) => !ids.includes(id) && label.toLocaleLowerCase().includes(text.toLocaleLowerCase()));
|
|
39
|
-
},
|
|
40
|
-
[space],
|
|
41
|
-
);
|
|
20
|
+
export const ChatReferences = ({ classNames, context, db }: ChatReferencesProps) => {
|
|
21
|
+
const { t } = useTranslation(meta.id);
|
|
22
|
+
const { objects, onUpdateObject } = useContextObjects({ db, context });
|
|
42
23
|
|
|
43
24
|
return (
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
25
|
+
<ul className={mx('flex', classNames)}>
|
|
26
|
+
{objects.map((obj) => {
|
|
27
|
+
const dxn = Obj.getDXN(obj);
|
|
28
|
+
const typename = Obj.getTypename(obj);
|
|
29
|
+
const label: Label = Obj.getLabel(obj) ?? (typename ? ['object name placeholder', { ns: typename }] : obj.id);
|
|
30
|
+
return (
|
|
31
|
+
<li key={dxn.toString()} className='dx-tag plb-0 pis-2 flex items-center' data-hue='neutral'>
|
|
32
|
+
{toLocalizedString(label, t)}
|
|
33
|
+
<IconButton
|
|
34
|
+
icon='ph--x--bold'
|
|
35
|
+
iconOnly
|
|
36
|
+
variant='ghost'
|
|
37
|
+
label={t('remove object in context label')}
|
|
38
|
+
classNames='p-0 hover:bg-transparent'
|
|
39
|
+
size={3}
|
|
40
|
+
onClick={() => onUpdateObject?.(dxn, false)}
|
|
41
|
+
/>
|
|
42
|
+
</li>
|
|
43
|
+
);
|
|
44
|
+
})}
|
|
45
|
+
</ul>
|
|
52
46
|
);
|
|
53
47
|
};
|
|
@@ -4,36 +4,39 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { Spinner } from '@dxos/react-ui-sfx';
|
|
9
|
-
import {
|
|
7
|
+
import { type ThemedClassName, Tooltip, useTimeout } from '@dxos/react-ui';
|
|
8
|
+
import { Spinner, type SpinnerProps } from '@dxos/react-ui-sfx';
|
|
9
|
+
import { mx } from '@dxos/ui-theme';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const period = 3_000;
|
|
12
|
+
|
|
13
|
+
export type ChatStatusIndicatorProps = ThemedClassName<
|
|
14
|
+
{
|
|
15
|
+
preset?: string;
|
|
16
|
+
processing?: boolean;
|
|
17
|
+
error?: Error;
|
|
18
|
+
} & Pick<SpinnerProps, 'size' | 'onClick'>
|
|
19
|
+
>;
|
|
16
20
|
|
|
17
|
-
export const ChatStatusIndicator = ({ preset, error,
|
|
21
|
+
export const ChatStatusIndicator = ({ classNames, preset, processing, error, ...props }: ChatStatusIndicatorProps) => {
|
|
18
22
|
const [init, setInit] = useState(false);
|
|
19
|
-
useEffect(() =>
|
|
20
|
-
setInit(false);
|
|
21
|
-
}, [preset]);
|
|
23
|
+
useEffect(() => setInit(false), [preset]);
|
|
22
24
|
useTimeout(
|
|
23
25
|
async () => {
|
|
24
26
|
setInit(true);
|
|
25
27
|
},
|
|
26
|
-
|
|
28
|
+
period / 2,
|
|
27
29
|
[preset],
|
|
28
30
|
);
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
return (
|
|
33
|
+
<div role='none' className={mx('relative flex', classNames)}>
|
|
34
|
+
<Spinner duration={period} state={!init ? 'flash' : error ? 'error' : processing ? 'spin' : 'pulse'} {...props} />
|
|
35
|
+
{error && (
|
|
36
|
+
<Tooltip.Trigger asChild content={error.message}>
|
|
37
|
+
<div className='absolute inset-0' />
|
|
38
|
+
</Tooltip.Trigger>
|
|
39
|
+
)}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
39
42
|
};
|
|
@@ -2,142 +2,149 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Fiber from 'effect/Fiber';
|
|
8
|
+
import * as Layer from 'effect/Layer';
|
|
9
|
+
import React, { type CSSProperties, useEffect, useMemo, useState } from 'react';
|
|
10
|
+
|
|
11
|
+
import { Database } from '@dxos/echo';
|
|
12
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
13
|
+
import { ContextQueueService } from '@dxos/functions';
|
|
11
14
|
import { faker } from '@dxos/random';
|
|
15
|
+
import { useQueue, useSpace } from '@dxos/react-client/echo';
|
|
12
16
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
+
import { Popover } from '@dxos/react-ui';
|
|
18
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
19
|
+
import { MarkdownStream } from '@dxos/react-ui-components';
|
|
20
|
+
import { EditorPreviewProvider, useEditorPreview } from '@dxos/react-ui-editor';
|
|
21
|
+
import { Card } from '@dxos/react-ui-mosaic';
|
|
22
|
+
import { render } from '@dxos/storybook-utils';
|
|
23
|
+
import { type Message, Organization, Person } from '@dxos/types';
|
|
24
|
+
|
|
25
|
+
import { createMessageGenerator } from '../../testing';
|
|
17
26
|
import { translations } from '../../translations';
|
|
18
27
|
|
|
28
|
+
import { ChatThread, type ChatThreadProps } from './ChatThread';
|
|
29
|
+
import { componentRegistry } from './registry';
|
|
30
|
+
import TEXT from './testing/thread.md?raw';
|
|
31
|
+
|
|
19
32
|
faker.seed(1);
|
|
20
33
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
type MessageGenerator = Effect.Effect<void, never, Database.Service | ContextQueueService>;
|
|
35
|
+
|
|
36
|
+
type StoryProps = { generator?: MessageGenerator[]; delay?: number; wait?: boolean } & ChatThreadProps;
|
|
37
|
+
|
|
38
|
+
const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: StoryProps) => {
|
|
39
|
+
const space = useSpace();
|
|
40
|
+
const queueDxn = useMemo(() => space?.queues.create().dxn, [space]);
|
|
41
|
+
const queue = useQueue<Message.Message>(queueDxn);
|
|
42
|
+
const [done, setDone] = useState(false);
|
|
43
|
+
|
|
44
|
+
// Generate messages.
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (!space || !queue) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const fiber = Effect.runFork(
|
|
51
|
+
Effect.gen(function* () {
|
|
52
|
+
for (const step of generator) {
|
|
53
|
+
yield* step;
|
|
54
|
+
if (delay) {
|
|
55
|
+
yield* Effect.sleep(delay);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
setDone(true);
|
|
59
|
+
}).pipe(Effect.provide(Layer.mergeAll(Database.Service.layer(space.db), ContextQueueService.layer(queue)))),
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
return () => {
|
|
63
|
+
void runAndForwardErrors(Fiber.interrupt(fiber));
|
|
64
|
+
};
|
|
65
|
+
}, [space, queue, generator]);
|
|
66
|
+
|
|
67
|
+
if (wait && !done) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<EditorPreviewProvider onLookup={async ({ label, ref }) => ({ label, text: ref })}>
|
|
73
|
+
<ChatThread {...props} messages={queue?.objects} />
|
|
74
|
+
<PreviewCard />
|
|
75
|
+
</EditorPreviewProvider>
|
|
76
|
+
);
|
|
27
77
|
};
|
|
28
78
|
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_tag: 'text',
|
|
47
|
-
text: Array.from({ length: faker.number.int({ min: 2, max: 5 }) })
|
|
48
|
-
.map(() => faker.lorem.paragraphs())
|
|
49
|
-
.join('\n\n'),
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
_tag: 'toolCall',
|
|
53
|
-
toolCallId: '1234',
|
|
54
|
-
name: 'search',
|
|
55
|
-
input: {},
|
|
56
|
-
} satisfies ContentBlock.ToolCall,
|
|
57
|
-
]),
|
|
58
|
-
|
|
59
|
-
createMessage('user', [
|
|
60
|
-
{
|
|
61
|
-
_tag: 'toolResult',
|
|
62
|
-
toolCallId: '1234',
|
|
63
|
-
name: 'search',
|
|
64
|
-
result: 'This is a tool result.',
|
|
65
|
-
} satisfies ContentBlock.ToolResult,
|
|
66
|
-
]),
|
|
67
|
-
|
|
68
|
-
createMessage('assistant', [
|
|
69
|
-
{
|
|
70
|
-
_tag: 'toolCall',
|
|
71
|
-
toolCallId: '4567',
|
|
72
|
-
name: 'create',
|
|
73
|
-
input: {},
|
|
74
|
-
} satisfies ContentBlock.ToolCall,
|
|
75
|
-
]),
|
|
76
|
-
|
|
77
|
-
createMessage('user', [
|
|
78
|
-
{
|
|
79
|
-
_tag: 'toolResult',
|
|
80
|
-
toolCallId: '4567',
|
|
81
|
-
name: 'create',
|
|
82
|
-
result: 'This is a tool result.',
|
|
83
|
-
} satisfies ContentBlock.ToolResult,
|
|
84
|
-
]),
|
|
85
|
-
|
|
86
|
-
createMessage('assistant', [
|
|
87
|
-
{
|
|
88
|
-
_tag: 'text',
|
|
89
|
-
text: faker.lorem.paragraphs(1),
|
|
90
|
-
} satisfies ContentBlock.Text,
|
|
91
|
-
]),
|
|
92
|
-
|
|
93
|
-
createMessage('assistant', [
|
|
94
|
-
{
|
|
95
|
-
_tag: 'json',
|
|
96
|
-
disposition: 'suggest',
|
|
97
|
-
data: JSON.stringify({ text: 'Search...' }),
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
_tag: 'json',
|
|
101
|
-
disposition: 'suggest',
|
|
102
|
-
data: JSON.stringify({ text: faker.lorem.paragraphs(1) }),
|
|
103
|
-
} satisfies ContentBlock.Json,
|
|
104
|
-
]),
|
|
105
|
-
];
|
|
79
|
+
const PreviewCard = () => {
|
|
80
|
+
const { target } = useEditorPreview('PreviewCard');
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<Popover.Portal>
|
|
84
|
+
<Popover.Content onOpenAutoFocus={(event) => event.preventDefault()}>
|
|
85
|
+
<Popover.Viewport>
|
|
86
|
+
<Card.Root>
|
|
87
|
+
<Card.Heading>{target?.label}</Card.Heading>
|
|
88
|
+
{target && <Card.Text classNames='truncate line-clamp-3'>{target.text}</Card.Text>}
|
|
89
|
+
</Card.Root>
|
|
90
|
+
</Popover.Viewport>
|
|
91
|
+
<Popover.Arrow />
|
|
92
|
+
</Popover.Content>
|
|
93
|
+
</Popover.Portal>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
106
96
|
|
|
107
97
|
const meta = {
|
|
108
98
|
title: 'plugins/plugin-assistant/ChatThread',
|
|
109
99
|
component: ChatThread,
|
|
110
|
-
|
|
100
|
+
render: render(DefaultStory),
|
|
101
|
+
decorators: [
|
|
102
|
+
withTheme,
|
|
103
|
+
withLayout({ layout: 'column' }),
|
|
104
|
+
withClientProvider({
|
|
105
|
+
createIdentity: true,
|
|
106
|
+
createSpace: true,
|
|
107
|
+
types: [Organization.Organization, Person.Person],
|
|
108
|
+
}),
|
|
109
|
+
],
|
|
111
110
|
parameters: {
|
|
111
|
+
layout: 'fullscreen',
|
|
112
112
|
translations,
|
|
113
113
|
},
|
|
114
|
-
} satisfies Meta<
|
|
114
|
+
} satisfies Meta<StoryProps>;
|
|
115
115
|
|
|
116
116
|
export default meta;
|
|
117
117
|
|
|
118
|
-
type Story = StoryObj<
|
|
118
|
+
type Story = StoryObj<StoryProps>;
|
|
119
119
|
|
|
120
|
-
export const Default = {
|
|
120
|
+
export const Default: Story = {
|
|
121
121
|
args: {
|
|
122
|
-
|
|
122
|
+
generator: createMessageGenerator(),
|
|
123
|
+
wait: true,
|
|
123
124
|
},
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export const Incremental = {
|
|
127
|
-
render: () => {
|
|
128
|
-
const [messages, setMessages] = useState<DataType.Message[]>([]);
|
|
129
|
-
useEffect(() => {
|
|
130
|
-
let i = 0;
|
|
131
|
-
const interval = setInterval(() => {
|
|
132
|
-
setMessages((messages) => [...messages, TEST_MESSAGES[i++]]);
|
|
133
|
-
if (i >= TEST_MESSAGES.length) {
|
|
134
|
-
clearInterval(interval);
|
|
135
|
-
}
|
|
136
|
-
}, 2_000);
|
|
137
|
-
|
|
138
|
-
return () => clearInterval(interval);
|
|
139
|
-
}, []);
|
|
125
|
+
};
|
|
140
126
|
|
|
141
|
-
|
|
127
|
+
export const Delayed: Story = {
|
|
128
|
+
args: {
|
|
129
|
+
generator: createMessageGenerator(),
|
|
130
|
+
delay: 1_000,
|
|
131
|
+
fadeIn: true,
|
|
132
|
+
cursor: false,
|
|
142
133
|
},
|
|
143
|
-
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const Raw: Story = {
|
|
137
|
+
render: () => (
|
|
138
|
+
<div className='contents' style={{ '--user-fill': 'var(--dx-amberFill)' } as CSSProperties}>
|
|
139
|
+
<MarkdownStream content={TEXT} />
|
|
140
|
+
</div>
|
|
141
|
+
),
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const Static: Story = {
|
|
145
|
+
render: () => (
|
|
146
|
+
<div className='contents' style={{ '--user-fill': 'var(--dx-amberFill)' } as CSSProperties}>
|
|
147
|
+
<MarkdownStream content={TEXT} registry={componentRegistry} />
|
|
148
|
+
</div>
|
|
149
|
+
),
|
|
150
|
+
};
|