@dxos/plugin-assistant 0.8.4-main.ae835ea → 0.8.4-main.bc674ce
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/blueprints/index.mjs +12 -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-WBG5PTSX.mjs → chunk-EXVT7D4B.mjs} +1 -1
- package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +7 -0
- package/dist/lib/browser/{chunk-L5OA5OGS.mjs → chunk-ML3QCFKA.mjs} +40 -37
- 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 +201 -214
- 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 +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-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-CFCUD2VC.mjs → blueprint-definition-SEMDEIYG.mjs} +6 -5
- 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-MSBPC4RJ.mjs +42 -0
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-WE6KTH72.mjs → chunk-POWB2BPC.mjs} +1 -1
- 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-7ZYOYW7F.mjs → chunk-ZRIPP7YF.mjs} +40 -37
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs.map +7 -0
- package/dist/lib/node-esm/{edge-model-resolver-2ARXDOYS.mjs → edge-model-resolver-G5KMODPO.mjs} +9 -7
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +201 -214
- 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 +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 +21 -12
- 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 -10
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +128 -73
- package/dist/types/src/components/ChatThread/ChatThread.stories.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.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +112 -60
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +11 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +113 -61
- 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 +4 -5
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +112 -60
- 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 -5
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +1 -1
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/functions/object-list.d.ts +2 -2
- package/dist/types/src/functions/object-list.d.ts.map +1 -1
- package/dist/types/src/functions/object-load.d.ts +1 -1
- package/dist/types/src/functions/object-load.d.ts.map +1 -1
- 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 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -5
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +3 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +3 -3
- 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 +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +17 -16
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/update-name.d.ts.map +1 -1
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +5 -4
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +243 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +16 -22
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +88 -112
- 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 +10 -212
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +113 -90
- package/src/AssistantPlugin.tsx +70 -105
- 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 +160 -125
- package/src/components/Chat/events.ts +7 -1
- package/src/components/ChatCompanion.tsx +132 -105
- package/src/components/ChatContainer.tsx +40 -30
- package/src/components/ChatDialog.tsx +13 -7
- package/src/components/ChatProgress/ChatProgress.tsx +4 -17
- package/src/components/ChatPrompt/ChatActions.tsx +3 -5
- package/src/components/ChatPrompt/ChatOptions.tsx +93 -80
- package/src/components/ChatPrompt/ChatReferences.tsx +7 -8
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +57 -36
- package/src/components/ChatThread/ChatThread.tsx +26 -36
- package/src/components/ChatThread/Link.tsx +3 -3
- package/src/components/ChatThread/registry.tsx +25 -35
- package/src/components/ChatThread/sync.test.ts +33 -17
- package/src/components/ChatThread/sync.ts +53 -12
- package/src/components/ChatThread/testing/thread.md +37 -0
- package/src/components/PromptArticle.tsx +50 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +12 -4
- package/src/components/TemplateEditor/TemplateEditor.tsx +14 -10
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +15 -7
- package/src/components/TemplateEditor/TemplateForm.tsx +76 -29
- 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 +36 -45
- package/src/components/Toolbox/Toolbox.stories.tsx +9 -10
- package/src/components/Toolbox/Toolbox.tsx +16 -17
- 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 -3
- package/src/functions/index.ts +1 -1
- package/src/functions/object-list.ts +4 -3
- package/src/functions/object-load.ts +7 -5
- package/src/functions/object-search.ts +46 -0
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useBlueprintRegistry.ts +31 -20
- package/src/hooks/useChatProcessor.ts +15 -12
- package/src/hooks/useChatServices.ts +13 -14
- package/src/hooks/useChatToolbarActions.ts +121 -0
- package/src/hooks/useContextBinder.ts +9 -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 +0 -1
- package/src/meta.ts +2 -2
- package/src/processor/presets.ts +1 -1
- package/src/processor/processor.test.ts +8 -17
- package/src/processor/processor.ts +41 -43
- package/src/processor/update-name.ts +4 -2
- package/src/queue-logger.ts +8 -9
- package/src/testing/test-generator.ts +14 -13
- package/src/testing/test-services.ts +8 -6
- package/src/translations.ts +27 -16
- package/src/types/Assistant.ts +9 -10
- package/src/types/AssistantAction.ts +59 -54
- 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 +10 -7
- package/dist/lib/browser/BlueprintContainer-GMSYKGSO.mjs +0 -36
- package/dist/lib/browser/BlueprintContainer-GMSYKGSO.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-M3FDKTQM.mjs +0 -151
- package/dist/lib/browser/ChatCompanion-M3FDKTQM.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-KAH7XITI.mjs +0 -74
- package/dist/lib/browser/ChatContainer-KAH7XITI.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-ZWRGABW6.mjs +0 -87
- package/dist/lib/browser/ChatDialog-ZWRGABW6.mjs.map +0 -7
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-R5T7BJPC.mjs +0 -183
- package/dist/lib/browser/app-graph-builder-R5T7BJPC.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-AGTDXTXO.mjs +0 -13
- package/dist/lib/browser/chunk-357IHWQL.mjs +0 -1519
- package/dist/lib/browser/chunk-357IHWQL.mjs.map +0 -7
- package/dist/lib/browser/chunk-A2NVNXPL.mjs +0 -170
- package/dist/lib/browser/chunk-A2NVNXPL.mjs.map +0 -7
- package/dist/lib/browser/chunk-CQW6UPJM.mjs +0 -199
- package/dist/lib/browser/chunk-CQW6UPJM.mjs.map +0 -7
- package/dist/lib/browser/chunk-GNI6HL6G.mjs +0 -219
- package/dist/lib/browser/chunk-GNI6HL6G.mjs.map +0 -7
- package/dist/lib/browser/chunk-GXHZTOWJ.mjs +0 -378
- package/dist/lib/browser/chunk-GXHZTOWJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-L5OA5OGS.mjs.map +0 -7
- package/dist/lib/browser/chunk-MEN5WTLA.mjs +0 -182
- package/dist/lib/browser/chunk-MEN5WTLA.mjs.map +0 -7
- package/dist/lib/browser/chunk-PUG24BEC.mjs +0 -277
- package/dist/lib/browser/chunk-PUG24BEC.mjs.map +0 -7
- package/dist/lib/browser/chunk-SJJV3HEX.mjs +0 -16
- package/dist/lib/browser/chunk-SJJV3HEX.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBG5PTSX.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3C5TABOX.mjs +0 -136
- package/dist/lib/browser/intent-resolver-3C5TABOX.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs.map +0 -7
- package/dist/lib/browser/react-surface-EYKA5IFU.mjs +0 -90
- package/dist/lib/browser/react-surface-EYKA5IFU.mjs.map +0 -7
- package/dist/lib/browser/settings-VMVBYZLN.mjs +0 -23
- package/dist/lib/browser/settings-VMVBYZLN.mjs.map +0 -7
- package/dist/lib/browser/state-CFREPBB6.mjs +0 -21
- package/dist/lib/browser/state-CFREPBB6.mjs.map +0 -7
- package/dist/lib/browser/toolkit-F3NQ7TSI.mjs +0 -21
- package/dist/lib/browser/toolkit-F3NQ7TSI.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-6GBLMK4Z.mjs +0 -37
- package/dist/lib/node-esm/BlueprintContainer-6GBLMK4Z.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-OV426GCP.mjs +0 -152
- package/dist/lib/node-esm/ChatCompanion-OV426GCP.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-UKY7NHFY.mjs +0 -75
- package/dist/lib/node-esm/ChatContainer-UKY7NHFY.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-2BDQIEXH.mjs +0 -88
- package/dist/lib/node-esm/ChatDialog-2BDQIEXH.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-I52RYVWH.mjs +0 -184
- package/dist/lib/node-esm/app-graph-builder-I52RYVWH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2CAETDW2.mjs +0 -183
- package/dist/lib/node-esm/chunk-2CAETDW2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4J5FYNNM.mjs +0 -171
- package/dist/lib/node-esm/chunk-4J5FYNNM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5ARE4R2I.mjs +0 -220
- package/dist/lib/node-esm/chunk-5ARE4R2I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7ZYOYW7F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HJPIYMWD.mjs +0 -1520
- package/dist/lib/node-esm/chunk-HJPIYMWD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-O36P4LN5.mjs +0 -200
- package/dist/lib/node-esm/chunk-O36P4LN5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XM4BVQQR.mjs +0 -278
- package/dist/lib/node-esm/chunk-XM4BVQQR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XQBL2SBL.mjs +0 -17
- package/dist/lib/node-esm/chunk-XQBL2SBL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YIO5MEPR.mjs +0 -380
- package/dist/lib/node-esm/chunk-YIO5MEPR.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-HQ27YALS.mjs +0 -137
- package/dist/lib/node-esm/intent-resolver-HQ27YALS.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-UOC3CBPH.mjs +0 -91
- package/dist/lib/node-esm/react-surface-UOC3CBPH.mjs.map +0 -7
- package/dist/lib/node-esm/settings-7AUVNDM2.mjs +0 -24
- package/dist/lib/node-esm/settings-7AUVNDM2.mjs.map +0 -7
- package/dist/lib/node-esm/state-XXND44OW.mjs +0 -22
- package/dist/lib/node-esm/state-XXND44OW.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-7CH5UNSQ.mjs +0 -22
- package/dist/lib/node-esm/toolkit-7CH5UNSQ.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/ChatThread/reducers.d.ts +0 -40
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +0 -1
- package/dist/types/src/components/ChatToolbar/ChatToolbar.d.ts +0 -6
- package/dist/types/src/components/ChatToolbar/ChatToolbar.d.ts.map +0 -1
- package/dist/types/src/components/ChatToolbar/index.d.ts +0 -2
- package/dist/types/src/components/ChatToolbar/index.d.ts.map +0 -1
- package/dist/types/src/components/ChatToolbar/useChatToolbarActions.d.ts +0 -9
- package/dist/types/src/components/ChatToolbar/useChatToolbarActions.d.ts.map +0 -1
- package/dist/types/src/components/TemplateEditor/handlebars-extension.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/functions/analysis.d.ts +0 -5
- package/dist/types/src/functions/analysis.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/toolkits/AssistantToolkit.d.ts +0 -21
- package/dist/types/src/toolkits/AssistantToolkit.d.ts.map +0 -1
- package/dist/types/src/toolkits/SystemToolkit.d.ts +0 -69
- package/dist/types/src/toolkits/SystemToolkit.d.ts.map +0 -1
- package/dist/types/src/toolkits/index.d.ts +0 -3
- package/dist/types/src/toolkits/index.d.ts.map +0 -1
- package/src/capabilities/ai-service.ts +0 -27
- package/src/capabilities/app-graph-builder.ts +0 -194
- package/src/capabilities/blueprint-definition.ts +0 -66
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/edge-model-resolver.ts +0 -25
- package/src/capabilities/intent-resolver.ts +0 -121
- package/src/capabilities/local-model-resolver.ts +0 -30
- package/src/capabilities/react-surface.tsx +0 -71
- package/src/capabilities/settings.ts +0 -19
- package/src/capabilities/state.ts +0 -20
- package/src/capabilities/toolkit.ts +0 -19
- package/src/components/BlueprintContainer.tsx +0 -30
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/components/ChatToolbar/ChatToolbar.tsx +0 -23
- package/src/components/ChatToolbar/index.ts +0 -5
- package/src/components/ChatToolbar/useChatToolbarActions.ts +0 -126
- package/src/components/TemplateEditor/handlebars-extension.ts +0 -166
- package/src/events.ts +0 -11
- package/src/functions/analysis.ts +0 -22
- package/src/hooks/useItemTypes.ts +0 -37
- package/src/toolkits/AssistantToolkit.ts +0 -55
- package/src/toolkits/SystemToolkit.ts +0 -292
- package/src/toolkits/index.ts +0 -6
- /package/dist/lib/browser/{blueprint-definition-AGTDXTXO.mjs.map → blueprint-definition-DGHH7MUU.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-CFCUD2VC.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,1519 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AiChatProcessor,
|
|
3
|
-
AiServicePresets
|
|
4
|
-
} from "./chunk-L5OA5OGS.mjs";
|
|
5
|
-
import {
|
|
6
|
-
meta
|
|
7
|
-
} from "./chunk-WBG5PTSX.mjs";
|
|
8
|
-
|
|
9
|
-
// src/hooks/useBlueprintRegistry.ts
|
|
10
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
11
|
-
import { useSignalEffect } from "@preact/signals-react";
|
|
12
|
-
import { useCallback, useMemo, useState } from "react";
|
|
13
|
-
import { Capabilities, useCapabilities } from "@dxos/app-framework";
|
|
14
|
-
import { Blueprint } from "@dxos/blueprints";
|
|
15
|
-
import { Filter, Obj, Ref } from "@dxos/echo";
|
|
16
|
-
import { useQuery } from "@dxos/react-client/echo";
|
|
17
|
-
import { distinctBy, isNonNullable } from "@dxos/util";
|
|
18
|
-
var useBlueprintRegistry = () => {
|
|
19
|
-
const blueprints = useCapabilities(Capabilities.BlueprintDefinition);
|
|
20
|
-
return useMemo(() => new Blueprint.Registry(blueprints), [
|
|
21
|
-
blueprints
|
|
22
|
-
]);
|
|
23
|
-
};
|
|
24
|
-
var useBlueprints = ({ blueprintRegistry, space }) => {
|
|
25
|
-
const staticBlueprints = useMemo(() => blueprintRegistry?.query() ?? [], [
|
|
26
|
-
blueprintRegistry
|
|
27
|
-
]);
|
|
28
|
-
const spaceBlueprints = useQuery(space, Filter.type(Blueprint.Blueprint));
|
|
29
|
-
return useMemo(() => {
|
|
30
|
-
const blueprints = distinctBy([
|
|
31
|
-
...staticBlueprints,
|
|
32
|
-
...spaceBlueprints
|
|
33
|
-
], (b) => b.key);
|
|
34
|
-
blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));
|
|
35
|
-
return blueprints;
|
|
36
|
-
}, [
|
|
37
|
-
staticBlueprints,
|
|
38
|
-
spaceBlueprints
|
|
39
|
-
]);
|
|
40
|
-
};
|
|
41
|
-
var useActiveBlueprints = ({ context }) => {
|
|
42
|
-
var _effect = _useSignals();
|
|
43
|
-
try {
|
|
44
|
-
const [active, setActive] = useState(/* @__PURE__ */ new Map());
|
|
45
|
-
useSignalEffect(() => {
|
|
46
|
-
const refs = [
|
|
47
|
-
...context?.blueprints.value ?? []
|
|
48
|
-
];
|
|
49
|
-
const blueprints = refs.map((ref) => ref.target).filter(isNonNullable);
|
|
50
|
-
setActive(new Map(blueprints.map((blueprint) => [
|
|
51
|
-
blueprint.key,
|
|
52
|
-
blueprint
|
|
53
|
-
])));
|
|
54
|
-
});
|
|
55
|
-
return active;
|
|
56
|
-
} finally {
|
|
57
|
-
_effect.f();
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var useBlueprintHandlers = ({ space, context, blueprintRegistry }) => {
|
|
61
|
-
const onUpdateBlueprint = useCallback(async (key, checked) => {
|
|
62
|
-
if (!context || !blueprintRegistry) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const { objects } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
66
|
-
let storedBlueprint = objects.find((blueprint) => blueprint.key === key);
|
|
67
|
-
if (checked) {
|
|
68
|
-
if (!storedBlueprint) {
|
|
69
|
-
const blueprint = blueprintRegistry.getByKey(key);
|
|
70
|
-
if (!blueprint) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
storedBlueprint = space.db.add(Obj.clone(blueprint));
|
|
74
|
-
}
|
|
75
|
-
await context.bind({
|
|
76
|
-
blueprints: [
|
|
77
|
-
Ref.make(storedBlueprint)
|
|
78
|
-
]
|
|
79
|
-
});
|
|
80
|
-
} else if (storedBlueprint) {
|
|
81
|
-
await context.unbind({
|
|
82
|
-
blueprints: [
|
|
83
|
-
Ref.make(storedBlueprint)
|
|
84
|
-
]
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}, [
|
|
88
|
-
space,
|
|
89
|
-
context,
|
|
90
|
-
blueprintRegistry
|
|
91
|
-
]);
|
|
92
|
-
return {
|
|
93
|
-
onUpdateBlueprint
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
// src/hooks/useChatProcessor.ts
|
|
98
|
-
import { RegistryContext } from "@effect-rx/rx-react";
|
|
99
|
-
import { useContext, useMemo as useMemo2, useState as useState2 } from "react";
|
|
100
|
-
import { AiConversation } from "@dxos/assistant";
|
|
101
|
-
import { log } from "@dxos/log";
|
|
102
|
-
import { useAsyncEffect } from "@dxos/react-ui";
|
|
103
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-assistant/src/hooks/useChatProcessor.ts";
|
|
104
|
-
var useChatProcessor = ({ chat, preset, services, blueprintRegistry, settings }) => {
|
|
105
|
-
const observableRegistry = useContext(RegistryContext);
|
|
106
|
-
const [conversation, setConversation] = useState2();
|
|
107
|
-
useAsyncEffect(async () => {
|
|
108
|
-
if (!chat?.queue.target) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
const conversation2 = new AiConversation(chat.queue.target);
|
|
112
|
-
await conversation2.open();
|
|
113
|
-
setConversation(conversation2);
|
|
114
|
-
return () => {
|
|
115
|
-
void conversation2.close();
|
|
116
|
-
};
|
|
117
|
-
}, [
|
|
118
|
-
chat?.queue.target
|
|
119
|
-
]);
|
|
120
|
-
const processor = useMemo2(() => {
|
|
121
|
-
if (!services || !conversation) {
|
|
122
|
-
return void 0;
|
|
123
|
-
}
|
|
124
|
-
log("creating processor", {
|
|
125
|
-
preset,
|
|
126
|
-
model: preset?.model,
|
|
127
|
-
settings
|
|
128
|
-
}, {
|
|
129
|
-
F: __dxlog_file,
|
|
130
|
-
L: 60,
|
|
131
|
-
S: void 0,
|
|
132
|
-
C: (f, a) => f(...a)
|
|
133
|
-
});
|
|
134
|
-
return new AiChatProcessor(conversation, services, {
|
|
135
|
-
observableRegistry,
|
|
136
|
-
blueprintRegistry,
|
|
137
|
-
model: preset?.model
|
|
138
|
-
});
|
|
139
|
-
}, [
|
|
140
|
-
services,
|
|
141
|
-
conversation,
|
|
142
|
-
blueprintRegistry,
|
|
143
|
-
preset
|
|
144
|
-
]);
|
|
145
|
-
return processor;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
// src/hooks/useChatServices.ts
|
|
149
|
-
import * as Effect from "effect/Effect";
|
|
150
|
-
import { useMemo as useMemo3 } from "react";
|
|
151
|
-
import { useCapability } from "@dxos/app-framework";
|
|
152
|
-
import { TracingService } from "@dxos/functions";
|
|
153
|
-
import { AutomationCapabilities } from "@dxos/plugin-automation";
|
|
154
|
-
import { useClient } from "@dxos/react-client";
|
|
155
|
-
var useChatServices = ({ space, chat }) => {
|
|
156
|
-
const client = useClient();
|
|
157
|
-
space ??= client.spaces.default;
|
|
158
|
-
const runtimeResolver = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
159
|
-
return useMemo3(() => {
|
|
160
|
-
const runtime2 = runtimeResolver.getRuntime(space.id);
|
|
161
|
-
return () => runtime2.runPromise(Effect.gen(function* () {
|
|
162
|
-
return yield* Effect.runtime().pipe(Effect.provide(chat?.traceQueue?.target ? TracingService.layerQueue(chat.traceQueue?.target) : TracingService.layerNoop));
|
|
163
|
-
}));
|
|
164
|
-
}, [
|
|
165
|
-
space,
|
|
166
|
-
chat?.traceQueue?.target
|
|
167
|
-
]);
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
// src/hooks/useContextBinder.ts
|
|
171
|
-
import { useState as useState3 } from "react";
|
|
172
|
-
import { AiContextBinder } from "@dxos/assistant";
|
|
173
|
-
import { useAsyncEffect as useAsyncEffect2 } from "@dxos/react-ui";
|
|
174
|
-
var useContextBinder = (chat) => {
|
|
175
|
-
const [binder, setBinder] = useState3();
|
|
176
|
-
useAsyncEffect2(async () => {
|
|
177
|
-
if (!chat?.queue.target) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
const binder2 = new AiContextBinder(chat.queue.target);
|
|
181
|
-
await binder2.open();
|
|
182
|
-
setBinder(binder2);
|
|
183
|
-
return () => {
|
|
184
|
-
void binder2.close();
|
|
185
|
-
};
|
|
186
|
-
}, [
|
|
187
|
-
chat?.queue.target
|
|
188
|
-
]);
|
|
189
|
-
return binder;
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
// src/hooks/useContextObjects.ts
|
|
193
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
194
|
-
import { useCallback as useCallback2 } from "react";
|
|
195
|
-
import { Ref as Ref2 } from "@dxos/echo";
|
|
196
|
-
import { log as log2 } from "@dxos/log";
|
|
197
|
-
import { isNonNullable as isNonNullable2 } from "@dxos/util";
|
|
198
|
-
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-assistant/src/hooks/useContextObjects.ts";
|
|
199
|
-
var useContextObjects = ({ space, context }) => {
|
|
200
|
-
var _effect = _useSignals2();
|
|
201
|
-
try {
|
|
202
|
-
const objects = context?.objects.value.map((ref) => ref.target).filter(isNonNullable2) ?? [];
|
|
203
|
-
const handleUpdateObject = useCallback2(async (dxn, checked) => {
|
|
204
|
-
if (!space || !context) {
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
const id = dxn.asEchoDXN();
|
|
208
|
-
const object = id && await space.db.getObjectById(id.echoId);
|
|
209
|
-
if (!object) {
|
|
210
|
-
log2.warn("Object not found", {
|
|
211
|
-
dxn,
|
|
212
|
-
id
|
|
213
|
-
}, {
|
|
214
|
-
F: __dxlog_file2,
|
|
215
|
-
L: 40,
|
|
216
|
-
S: void 0,
|
|
217
|
-
C: (f, a) => f(...a)
|
|
218
|
-
});
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
const ref = Ref2.fromDXN(dxn);
|
|
222
|
-
if (checked) {
|
|
223
|
-
await context.bind({
|
|
224
|
-
objects: [
|
|
225
|
-
ref
|
|
226
|
-
]
|
|
227
|
-
});
|
|
228
|
-
} else {
|
|
229
|
-
await context.unbind({
|
|
230
|
-
objects: [
|
|
231
|
-
ref
|
|
232
|
-
]
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
}, [
|
|
236
|
-
space,
|
|
237
|
-
context
|
|
238
|
-
]);
|
|
239
|
-
return {
|
|
240
|
-
objects,
|
|
241
|
-
onUpdateObject: handleUpdateObject
|
|
242
|
-
};
|
|
243
|
-
} finally {
|
|
244
|
-
_effect.f();
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
// src/hooks/useFlush.ts
|
|
249
|
-
import { useCallback as useCallback3, useRef, useState as useState4 } from "react";
|
|
250
|
-
var useFlush = (space) => {
|
|
251
|
-
const [state, setState] = useState4("idle");
|
|
252
|
-
const resetTimer = useRef(null);
|
|
253
|
-
const handleFlush = useCallback3(() => {
|
|
254
|
-
if (!space) {
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
queueMicrotask(async () => {
|
|
258
|
-
if (resetTimer.current) {
|
|
259
|
-
clearTimeout(resetTimer.current);
|
|
260
|
-
}
|
|
261
|
-
setState("flushing");
|
|
262
|
-
await space.db.flush();
|
|
263
|
-
setState("flushed");
|
|
264
|
-
resetTimer.current = setTimeout(() => {
|
|
265
|
-
setState("idle");
|
|
266
|
-
resetTimer.current = null;
|
|
267
|
-
}, 1e3);
|
|
268
|
-
});
|
|
269
|
-
}, [
|
|
270
|
-
space
|
|
271
|
-
]);
|
|
272
|
-
return {
|
|
273
|
-
state,
|
|
274
|
-
handleFlush
|
|
275
|
-
};
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
// src/hooks/useItemTypes.ts
|
|
279
|
-
import * as Option from "effect/Option";
|
|
280
|
-
import { useEffect, useState as useState5 } from "react";
|
|
281
|
-
import { ItemAnnotation } from "@dxos/schema";
|
|
282
|
-
var useItemTypes = (space) => {
|
|
283
|
-
const [types, setTypes] = useState5([]);
|
|
284
|
-
useEffect(() => {
|
|
285
|
-
if (!space) {
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
return space.db.schemaRegistry.query().subscribe((query) => {
|
|
289
|
-
const types2 = Array.from(new Set([
|
|
290
|
-
...space.db.graph.schemaRegistry.schemas,
|
|
291
|
-
...query.results
|
|
292
|
-
].filter((type) => Option.isSome(ItemAnnotation.get(type)))));
|
|
293
|
-
setTypes(types2);
|
|
294
|
-
}, {
|
|
295
|
-
fire: true
|
|
296
|
-
});
|
|
297
|
-
}, [
|
|
298
|
-
space
|
|
299
|
-
]);
|
|
300
|
-
return types;
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
// src/hooks/useOnline.ts
|
|
304
|
-
import { useState as useState6 } from "react";
|
|
305
|
-
var useOnline = () => {
|
|
306
|
-
const [online, setOnline] = useState6(true);
|
|
307
|
-
return [
|
|
308
|
-
online,
|
|
309
|
-
setOnline
|
|
310
|
-
];
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
// src/hooks/usePresets.ts
|
|
314
|
-
import { useCallback as useCallback4, useEffect as useEffect2, useMemo as useMemo4, useState as useState7 } from "react";
|
|
315
|
-
var usePresets = (online) => {
|
|
316
|
-
const [preset, setPreset] = useState7();
|
|
317
|
-
const presets = useMemo4(() => AiServicePresets.filter((preset2) => online === (preset2.provider === "dxos-remote")), [
|
|
318
|
-
online
|
|
319
|
-
]);
|
|
320
|
-
const presetOptions = useMemo4(() => presets.map(({ id, model, label }) => ({
|
|
321
|
-
id,
|
|
322
|
-
label: label ?? model
|
|
323
|
-
})), [
|
|
324
|
-
presets
|
|
325
|
-
]);
|
|
326
|
-
useEffect2(() => {
|
|
327
|
-
setPreset(presets[0]);
|
|
328
|
-
}, [
|
|
329
|
-
presets
|
|
330
|
-
]);
|
|
331
|
-
const handlePresetChange = useCallback4((id) => {
|
|
332
|
-
const preset2 = presets.find((preset3) => preset3.id === id);
|
|
333
|
-
if (preset2) {
|
|
334
|
-
setPreset(preset2);
|
|
335
|
-
}
|
|
336
|
-
}, [
|
|
337
|
-
presets
|
|
338
|
-
]);
|
|
339
|
-
return {
|
|
340
|
-
preset,
|
|
341
|
-
presets: presetOptions,
|
|
342
|
-
onPresetChange: handlePresetChange
|
|
343
|
-
};
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
// src/hooks/useReferencesProvider.ts
|
|
347
|
-
import { useMemo as useMemo5 } from "react";
|
|
348
|
-
import { Capabilities as Capabilities2, useCapabilities as useCapabilities2 } from "@dxos/app-framework";
|
|
349
|
-
import { Filter as Filter2, Obj as Obj2 } from "@dxos/echo";
|
|
350
|
-
var useReferencesProvider = (space) => {
|
|
351
|
-
const blueprints = useCapabilities2(Capabilities2.BlueprintDefinition);
|
|
352
|
-
return useMemo5(() => {
|
|
353
|
-
if (!space) {
|
|
354
|
-
return void 0;
|
|
355
|
-
}
|
|
356
|
-
return {
|
|
357
|
-
getReferences: async ({ query }) => {
|
|
358
|
-
const { objects } = await space.db.query(Filter2.everything()).run();
|
|
359
|
-
return objects.filter((object) => stringMatch(query, Obj2.getLabel(object) ?? "")).filter((object) => !!Obj2.getDXN(object)).map((object) => ({
|
|
360
|
-
uri: Obj2.getDXN(object).toString(),
|
|
361
|
-
label: Obj2.getLabel(object) ?? ""
|
|
362
|
-
}));
|
|
363
|
-
},
|
|
364
|
-
resolveReference: async ({ uri }) => {
|
|
365
|
-
const object = await space.db.query(Filter2.ids(uri)).first();
|
|
366
|
-
return {
|
|
367
|
-
uri,
|
|
368
|
-
label: Obj2.getLabel(object) ?? ""
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
}, [
|
|
373
|
-
space,
|
|
374
|
-
blueprints
|
|
375
|
-
]);
|
|
376
|
-
};
|
|
377
|
-
var stringMatch = (query, label) => label.toLowerCase().startsWith(query.toLowerCase());
|
|
378
|
-
|
|
379
|
-
// src/components/Chat/Chat.tsx
|
|
380
|
-
import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
|
|
381
|
-
import { Prec } from "@codemirror/state";
|
|
382
|
-
import { keymap } from "@codemirror/view";
|
|
383
|
-
import { useRxValue } from "@effect-rx/rx-react";
|
|
384
|
-
import { createContext } from "@radix-ui/react-context";
|
|
385
|
-
import * as Array2 from "effect/Array";
|
|
386
|
-
import * as Option2 from "effect/Option";
|
|
387
|
-
import React9, { useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo9, useRef as useRef3, useState as useState12 } from "react";
|
|
388
|
-
import { Event } from "@dxos/async";
|
|
389
|
-
import { Obj as Obj5 } from "@dxos/echo";
|
|
390
|
-
import { useVoiceInput } from "@dxos/plugin-transcription";
|
|
391
|
-
import { getSpace, useQueue } from "@dxos/react-client/echo";
|
|
392
|
-
import { useIdentity } from "@dxos/react-client/halo";
|
|
393
|
-
import { Input, useDynamicRef, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
394
|
-
import { ChatEditor, references } from "@dxos/react-ui-chat";
|
|
395
|
-
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
396
|
-
import { DataType } from "@dxos/schema";
|
|
397
|
-
import { isTruthy } from "@dxos/util";
|
|
398
|
-
|
|
399
|
-
// src/components/ChatPrompt/ChatActions.tsx
|
|
400
|
-
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
401
|
-
import React from "react";
|
|
402
|
-
import { IconButton, useTranslation } from "@dxos/react-ui";
|
|
403
|
-
import { mx } from "@dxos/react-ui-theme";
|
|
404
|
-
var ChatActions = ({ classNames, children, microphone, recording, processing, onEvent }) => {
|
|
405
|
-
var _effect = _useSignals3();
|
|
406
|
-
try {
|
|
407
|
-
const { t } = useTranslation(meta.id);
|
|
408
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
409
|
-
className: mx("flex items-center mie-1", classNames)
|
|
410
|
-
}, children, /* @__PURE__ */ React.createElement(IconButton, {
|
|
411
|
-
disabled: !processing,
|
|
412
|
-
variant: "ghost",
|
|
413
|
-
size: 5,
|
|
414
|
-
icon: "ph--x--regular",
|
|
415
|
-
iconOnly: true,
|
|
416
|
-
label: t("button cancel processing"),
|
|
417
|
-
onClick: () => onEvent?.({
|
|
418
|
-
type: "cancel"
|
|
419
|
-
})
|
|
420
|
-
}), microphone && /* @__PURE__ */ React.createElement(IconButton, {
|
|
421
|
-
disabled: !processing,
|
|
422
|
-
classNames: mx(recording && "bg-primary-500"),
|
|
423
|
-
variant: "ghost",
|
|
424
|
-
size: 5,
|
|
425
|
-
icon: "ph--microphone--regular",
|
|
426
|
-
iconOnly: true,
|
|
427
|
-
noTooltip: true,
|
|
428
|
-
label: t("button microphone"),
|
|
429
|
-
onMouseDown: () => onEvent?.({
|
|
430
|
-
type: "record-start"
|
|
431
|
-
}),
|
|
432
|
-
onMouseUp: () => onEvent?.({
|
|
433
|
-
type: "record-stop"
|
|
434
|
-
}),
|
|
435
|
-
onTouchStart: () => onEvent?.({
|
|
436
|
-
type: "record-start"
|
|
437
|
-
}),
|
|
438
|
-
onTouchEnd: () => onEvent?.({
|
|
439
|
-
type: "record-stop"
|
|
440
|
-
})
|
|
441
|
-
}));
|
|
442
|
-
} finally {
|
|
443
|
-
_effect.f();
|
|
444
|
-
}
|
|
445
|
-
};
|
|
446
|
-
|
|
447
|
-
// src/components/ChatPrompt/ChatOptions.tsx
|
|
448
|
-
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
449
|
-
import React2, { useMemo as useMemo6, useState as useState8 } from "react";
|
|
450
|
-
import { Filter as Filter3, Obj as Obj3, Type } from "@dxos/echo";
|
|
451
|
-
import { useQuery as useQuery2 } from "@dxos/react-client/echo";
|
|
452
|
-
import { Icon, IconButton as IconButton2, Popover, Select, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
453
|
-
import { Listbox, SearchList } from "@dxos/react-ui-searchlist";
|
|
454
|
-
import { Tabs } from "@dxos/react-ui-tabs";
|
|
455
|
-
var panelClassNames = "is-[calc(100dvw-.5rem)] sm:is-max md:is-72 max-is-[--text-content]";
|
|
456
|
-
var ChatOptions = ({ space, context, blueprintRegistry, presets, preset, onPresetChange }) => {
|
|
457
|
-
var _effect = _useSignals4();
|
|
458
|
-
try {
|
|
459
|
-
const { t } = useTranslation2(meta.id);
|
|
460
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
461
|
-
role: "none",
|
|
462
|
-
className: "flex gap-0.5"
|
|
463
|
-
}, /* @__PURE__ */ React2.createElement(Popover.Root, null, /* @__PURE__ */ React2.createElement(Popover.Trigger, {
|
|
464
|
-
asChild: true
|
|
465
|
-
}, /* @__PURE__ */ React2.createElement(IconButton2, {
|
|
466
|
-
variant: "ghost",
|
|
467
|
-
icon: "ph--plus--regular",
|
|
468
|
-
iconOnly: true,
|
|
469
|
-
size: 5,
|
|
470
|
-
label: t("button context objects")
|
|
471
|
-
})), /* @__PURE__ */ React2.createElement(Popover.Portal, null, /* @__PURE__ */ React2.createElement(Popover.Content, {
|
|
472
|
-
side: "top",
|
|
473
|
-
classNames: panelClassNames
|
|
474
|
-
}, /* @__PURE__ */ React2.createElement(ObjectsPanel, {
|
|
475
|
-
space,
|
|
476
|
-
context
|
|
477
|
-
}), /* @__PURE__ */ React2.createElement(Popover.Arrow, null)))), /* @__PURE__ */ React2.createElement(Popover.Root, null, /* @__PURE__ */ React2.createElement(Popover.Trigger, {
|
|
478
|
-
asChild: true
|
|
479
|
-
}, /* @__PURE__ */ React2.createElement(IconButton2, {
|
|
480
|
-
variant: "ghost",
|
|
481
|
-
icon: "ph--sliders-horizontal--regular",
|
|
482
|
-
iconOnly: true,
|
|
483
|
-
size: 5,
|
|
484
|
-
label: t("button context settings")
|
|
485
|
-
})), /* @__PURE__ */ React2.createElement(Popover.Portal, null, /* @__PURE__ */ React2.createElement(Popover.Content, {
|
|
486
|
-
side: "top",
|
|
487
|
-
classNames: panelClassNames
|
|
488
|
-
}, /* @__PURE__ */ React2.createElement(Tabs.Root, {
|
|
489
|
-
orientation: "horizontal",
|
|
490
|
-
defaultValue: "blueprints",
|
|
491
|
-
defaultActivePart: "list",
|
|
492
|
-
tabIndex: -1
|
|
493
|
-
}, /* @__PURE__ */ React2.createElement(Tabs.Viewport, {
|
|
494
|
-
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'
|
|
495
|
-
}, /* @__PURE__ */ React2.createElement(Tabs.Tabpanel, {
|
|
496
|
-
value: "blueprints",
|
|
497
|
-
tabIndex: -1,
|
|
498
|
-
classNames: "dx-focus-ring-inset"
|
|
499
|
-
}, /* @__PURE__ */ React2.createElement(BlueprintsPanel, {
|
|
500
|
-
blueprintRegistry,
|
|
501
|
-
space,
|
|
502
|
-
context
|
|
503
|
-
})), /* @__PURE__ */ React2.createElement(Tabs.Tabpanel, {
|
|
504
|
-
value: "model",
|
|
505
|
-
tabIndex: -1,
|
|
506
|
-
classNames: "dx-focus-ring-inset !pli-0"
|
|
507
|
-
}, /* @__PURE__ */ React2.createElement(ModelsPanel, {
|
|
508
|
-
presets,
|
|
509
|
-
preset,
|
|
510
|
-
onPresetChange
|
|
511
|
-
})), /* @__PURE__ */ React2.createElement(Tabs.Tablist, {
|
|
512
|
-
classNames: "sm:overflow-x-hidden justify-center p-[--dx-cardSpacingChrome] border-bs border-subduedSeparator order-last"
|
|
513
|
-
}, /* @__PURE__ */ React2.createElement(Tabs.IconTab, {
|
|
514
|
-
value: "blueprints",
|
|
515
|
-
icon: "ph--blueprint--regular",
|
|
516
|
-
label: t("blueprints in context title")
|
|
517
|
-
}), /* @__PURE__ */ React2.createElement(Tabs.IconTab, {
|
|
518
|
-
value: "model",
|
|
519
|
-
label: t("chat model title"),
|
|
520
|
-
icon: "ph--cpu--regular"
|
|
521
|
-
})))), /* @__PURE__ */ React2.createElement(Popover.Arrow, null)))));
|
|
522
|
-
} finally {
|
|
523
|
-
_effect.f();
|
|
524
|
-
}
|
|
525
|
-
};
|
|
526
|
-
var BlueprintsPanel = ({ blueprintRegistry, space, context }) => {
|
|
527
|
-
var _effect = _useSignals4();
|
|
528
|
-
try {
|
|
529
|
-
const { t } = useTranslation2(meta.id);
|
|
530
|
-
const blueprints = useBlueprints({
|
|
531
|
-
blueprintRegistry,
|
|
532
|
-
space
|
|
533
|
-
});
|
|
534
|
-
const activeBlueprints = useActiveBlueprints({
|
|
535
|
-
context
|
|
536
|
-
});
|
|
537
|
-
const { onUpdateBlueprint } = useBlueprintHandlers({
|
|
538
|
-
space,
|
|
539
|
-
context,
|
|
540
|
-
blueprintRegistry
|
|
541
|
-
});
|
|
542
|
-
return /* @__PURE__ */ React2.createElement(SearchList.Root, null, /* @__PURE__ */ React2.createElement(SearchList.Content, {
|
|
543
|
-
classNames: "plb-cardSpacingChrome"
|
|
544
|
-
}, blueprints.map((blueprint) => {
|
|
545
|
-
const isActive = activeBlueprints.has(blueprint.key);
|
|
546
|
-
return /* @__PURE__ */ React2.createElement(SearchList.Item, {
|
|
547
|
-
classNames: "flex items-center overflow-hidden",
|
|
548
|
-
key: blueprint.key,
|
|
549
|
-
value: blueprint.name,
|
|
550
|
-
onSelect: () => onUpdateBlueprint?.(blueprint.key, !isActive)
|
|
551
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
552
|
-
className: "grow truncate"
|
|
553
|
-
}, blueprint.name), /* @__PURE__ */ React2.createElement(Icon, {
|
|
554
|
-
icon: "ph--check--regular",
|
|
555
|
-
classNames: [
|
|
556
|
-
!isActive && "invisible"
|
|
557
|
-
]
|
|
558
|
-
}));
|
|
559
|
-
})), /* @__PURE__ */ React2.createElement(SearchList.Input, {
|
|
560
|
-
placeholder: t("search placeholder"),
|
|
561
|
-
classNames: "mbe-cardSpacingChrome",
|
|
562
|
-
autoFocus: true
|
|
563
|
-
}));
|
|
564
|
-
} finally {
|
|
565
|
-
_effect.f();
|
|
566
|
-
}
|
|
567
|
-
};
|
|
568
|
-
var ModelsPanel = ({ presets, preset, onPresetChange }) => {
|
|
569
|
-
var _effect = _useSignals4();
|
|
570
|
-
try {
|
|
571
|
-
return /* @__PURE__ */ React2.createElement(Listbox.Root, {
|
|
572
|
-
value: preset,
|
|
573
|
-
onValueChange: onPresetChange,
|
|
574
|
-
autoFocus: true
|
|
575
|
-
}, presets?.map(({ id, label }) => {
|
|
576
|
-
return /* @__PURE__ */ React2.createElement(Listbox.Option, {
|
|
577
|
-
key: id,
|
|
578
|
-
value: id
|
|
579
|
-
}, /* @__PURE__ */ React2.createElement(Listbox.OptionLabel, null, label), /* @__PURE__ */ React2.createElement(Listbox.OptionIndicator, null));
|
|
580
|
-
}));
|
|
581
|
-
} finally {
|
|
582
|
-
_effect.f();
|
|
583
|
-
}
|
|
584
|
-
};
|
|
585
|
-
var ANY = "__any__";
|
|
586
|
-
var ObjectsPanel = ({ space, context }) => {
|
|
587
|
-
var _effect = _useSignals4();
|
|
588
|
-
try {
|
|
589
|
-
const { t } = useTranslation2(meta.id);
|
|
590
|
-
const types = useItemTypes(space);
|
|
591
|
-
const typenames = useMemo6(() => {
|
|
592
|
-
const typenames2 = types.map((type) => {
|
|
593
|
-
const typename2 = Type.getTypename(type);
|
|
594
|
-
return {
|
|
595
|
-
typename: typename2,
|
|
596
|
-
label: t("typename label", {
|
|
597
|
-
ns: typename2,
|
|
598
|
-
defaultValue: typename2
|
|
599
|
-
})
|
|
600
|
-
};
|
|
601
|
-
});
|
|
602
|
-
typenames2.sort((a, b) => a.label.localeCompare(b.label));
|
|
603
|
-
return typenames2;
|
|
604
|
-
}, [
|
|
605
|
-
types
|
|
606
|
-
]);
|
|
607
|
-
const [typename, setTypename] = useState8(ANY);
|
|
608
|
-
const anyFilter = useMemo6(() => Filter3.or(...typenames.map(({ typename: typename2 }) => Filter3.typename(typename2))), [
|
|
609
|
-
typenames
|
|
610
|
-
]);
|
|
611
|
-
const objects = useQuery2(space, typename === ANY ? anyFilter : Filter3.typename(typename));
|
|
612
|
-
const { objects: contextObjects, onUpdateObject } = useContextObjects({
|
|
613
|
-
space,
|
|
614
|
-
context
|
|
615
|
-
});
|
|
616
|
-
return /* @__PURE__ */ React2.createElement(SearchList.Root, null, /* @__PURE__ */ React2.createElement(SearchList.Content, {
|
|
617
|
-
classNames: "p-cardSpacingChrome [&:has([cmdk-list-sizer]:empty)]:plb-0"
|
|
618
|
-
}, objects.length ? objects.map((object) => {
|
|
619
|
-
const label = Obj3.getLabel(object) ?? Obj3.getTypename(object) ?? object.id;
|
|
620
|
-
const isActive = contextObjects.findIndex((obj) => obj.id === object.id) !== -1;
|
|
621
|
-
return /* @__PURE__ */ React2.createElement(SearchList.Item, {
|
|
622
|
-
classNames: "flex items-center overflow-hidden",
|
|
623
|
-
key: object.id,
|
|
624
|
-
value: object.id,
|
|
625
|
-
onSelect: () => onUpdateObject?.(Obj3.getDXN(object), !isActive)
|
|
626
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
627
|
-
className: "grow truncate"
|
|
628
|
-
}, label), /* @__PURE__ */ React2.createElement(Icon, {
|
|
629
|
-
icon: "ph--check--regular",
|
|
630
|
-
classNames: [
|
|
631
|
-
!isActive && "invisible"
|
|
632
|
-
]
|
|
633
|
-
}));
|
|
634
|
-
}) : /* @__PURE__ */ React2.createElement(SearchList.Item, null, t("no results"))), /* @__PURE__ */ React2.createElement("div", {
|
|
635
|
-
role: "none",
|
|
636
|
-
className: "grid grid-cols-[min-content_1fr] gap-2 pli-cardSpacingChrome mbe-cardSpacingChrome"
|
|
637
|
-
}, /* @__PURE__ */ React2.createElement(Select.Root, {
|
|
638
|
-
value: typename === ANY ? void 0 : typename,
|
|
639
|
-
onValueChange: setTypename
|
|
640
|
-
}, /* @__PURE__ */ React2.createElement(Select.TriggerButton, {
|
|
641
|
-
density: "fine",
|
|
642
|
-
placeholder: t("type filter placeholder")
|
|
643
|
-
}), /* @__PURE__ */ React2.createElement(Select.Portal, null, /* @__PURE__ */ React2.createElement(Select.Content, null, /* @__PURE__ */ React2.createElement(Select.ScrollUpButton, null), /* @__PURE__ */ React2.createElement(Select.Viewport, null, /* @__PURE__ */ React2.createElement(Select.Option, {
|
|
644
|
-
value: ANY
|
|
645
|
-
}, t("any type filter label")), typenames.map(({ typename: typename2, label }) => /* @__PURE__ */ React2.createElement(Select.Option, {
|
|
646
|
-
key: typename2,
|
|
647
|
-
value: typename2
|
|
648
|
-
}, label))), /* @__PURE__ */ React2.createElement(Select.ScrollDownButton, null), /* @__PURE__ */ React2.createElement(Select.Arrow, null)))), /* @__PURE__ */ React2.createElement(SearchList.Input, {
|
|
649
|
-
placeholder: t("search placeholder"),
|
|
650
|
-
classNames: "mbe-0",
|
|
651
|
-
autoFocus: true
|
|
652
|
-
})));
|
|
653
|
-
} finally {
|
|
654
|
-
_effect.f();
|
|
655
|
-
}
|
|
656
|
-
};
|
|
657
|
-
|
|
658
|
-
// src/components/ChatPrompt/ChatPresets.tsx
|
|
659
|
-
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
660
|
-
import React3 from "react";
|
|
661
|
-
import { Select as Select2 } from "@dxos/react-ui";
|
|
662
|
-
|
|
663
|
-
// src/components/ChatPrompt/ChatReferences.tsx
|
|
664
|
-
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
665
|
-
import React4 from "react";
|
|
666
|
-
import { Obj as Obj4 } from "@dxos/echo";
|
|
667
|
-
import { IconButton as IconButton3, toLocalizedString, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
668
|
-
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
669
|
-
var ChatReferences = ({ classNames, context, space }) => {
|
|
670
|
-
var _effect = _useSignals6();
|
|
671
|
-
try {
|
|
672
|
-
const { t } = useTranslation3(meta.id);
|
|
673
|
-
const { objects, onUpdateObject } = useContextObjects({
|
|
674
|
-
space,
|
|
675
|
-
context
|
|
676
|
-
});
|
|
677
|
-
return /* @__PURE__ */ React4.createElement("ul", {
|
|
678
|
-
className: mx2("flex flex-wrap", classNames)
|
|
679
|
-
}, objects.map((obj) => {
|
|
680
|
-
const dxn = Obj4.getDXN(obj);
|
|
681
|
-
const typename = Obj4.getTypename(obj);
|
|
682
|
-
const label = Obj4.getLabel(obj) ?? (typename ? [
|
|
683
|
-
"object name placeholder",
|
|
684
|
-
{
|
|
685
|
-
ns: typename
|
|
686
|
-
}
|
|
687
|
-
] : obj.id);
|
|
688
|
-
return /* @__PURE__ */ React4.createElement("li", {
|
|
689
|
-
key: dxn.toString(),
|
|
690
|
-
className: "dx-tag plb-0 pis-2 flex items-center",
|
|
691
|
-
"data-hue": "neutral"
|
|
692
|
-
}, toLocalizedString(label, t), /* @__PURE__ */ React4.createElement(IconButton3, {
|
|
693
|
-
iconOnly: true,
|
|
694
|
-
variant: "ghost",
|
|
695
|
-
label: t("remove object in context label"),
|
|
696
|
-
classNames: "p-0 hover:bg-transparent",
|
|
697
|
-
size: 3,
|
|
698
|
-
icon: "ph--x--bold",
|
|
699
|
-
onClick: () => onUpdateObject?.(dxn, false)
|
|
700
|
-
}));
|
|
701
|
-
}));
|
|
702
|
-
} finally {
|
|
703
|
-
_effect.f();
|
|
704
|
-
}
|
|
705
|
-
};
|
|
706
|
-
|
|
707
|
-
// src/components/ChatPrompt/ChatStatusIndicator.tsx
|
|
708
|
-
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
709
|
-
import React5, { useEffect as useEffect3, useState as useState9 } from "react";
|
|
710
|
-
import { Tooltip, useTimeout } from "@dxos/react-ui";
|
|
711
|
-
import { Spinner } from "@dxos/react-ui-sfx";
|
|
712
|
-
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
713
|
-
var period = 3e3;
|
|
714
|
-
var ChatStatusIndicator = ({ classNames, preset, processing, error, ...props }) => {
|
|
715
|
-
var _effect = _useSignals7();
|
|
716
|
-
try {
|
|
717
|
-
const [init, setInit] = useState9(false);
|
|
718
|
-
useEffect3(() => setInit(false), [
|
|
719
|
-
preset
|
|
720
|
-
]);
|
|
721
|
-
useTimeout(async () => {
|
|
722
|
-
setInit(true);
|
|
723
|
-
}, period / 2, [
|
|
724
|
-
preset
|
|
725
|
-
]);
|
|
726
|
-
return /* @__PURE__ */ React5.createElement("div", {
|
|
727
|
-
role: "none",
|
|
728
|
-
className: mx3("relative flex", classNames)
|
|
729
|
-
}, /* @__PURE__ */ React5.createElement(Spinner, {
|
|
730
|
-
duration: period,
|
|
731
|
-
state: !init ? "flash" : error ? "error" : processing ? "spin" : "pulse",
|
|
732
|
-
...props
|
|
733
|
-
}), error && /* @__PURE__ */ React5.createElement(Tooltip.Trigger, {
|
|
734
|
-
asChild: true,
|
|
735
|
-
content: error.message
|
|
736
|
-
}, /* @__PURE__ */ React5.createElement("div", {
|
|
737
|
-
className: "absolute inset-0"
|
|
738
|
-
})));
|
|
739
|
-
} finally {
|
|
740
|
-
_effect.f();
|
|
741
|
-
}
|
|
742
|
-
};
|
|
743
|
-
|
|
744
|
-
// src/components/ChatThread/ChatThread.tsx
|
|
745
|
-
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
746
|
-
import React8, { forwardRef, useCallback as useCallback5, useEffect as useEffect5, useImperativeHandle, useMemo as useMemo8, useState as useState11 } from "react";
|
|
747
|
-
import { PublicKey } from "@dxos/keys";
|
|
748
|
-
import { MarkdownStream } from "@dxos/react-ui-components";
|
|
749
|
-
import { mx as mx4 } from "@dxos/react-ui-theme";
|
|
750
|
-
import { keyToFallback } from "@dxos/util";
|
|
751
|
-
|
|
752
|
-
// src/components/ChatThread/registry.tsx
|
|
753
|
-
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
754
|
-
import React7 from "react";
|
|
755
|
-
import { log as log3 } from "@dxos/log";
|
|
756
|
-
import { PromptWidget, ReferenceWidget, SelectWidget, SuggestionWidget, SummaryWidget, ToggleContainer as ToggleContainer2 } from "@dxos/react-ui-components";
|
|
757
|
-
import { getXmlTextChild } from "@dxos/react-ui-editor";
|
|
758
|
-
import { Json as Json2 } from "@dxos/react-ui-syntax-highlighter";
|
|
759
|
-
import { ContentBlock } from "@dxos/schema";
|
|
760
|
-
|
|
761
|
-
// src/components/ToolBlock/ToolBlock.tsx
|
|
762
|
-
import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
|
|
763
|
-
import React6, { useEffect as useEffect4, useMemo as useMemo7, useRef as useRef2, useState as useState10 } from "react";
|
|
764
|
-
import { useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
765
|
-
import { NumericTabs, TextCrawl, ToggleContainer, chatMessageJson, chatMessagePanel, chatMessagePanelContent, chatMessagePanelHeader } from "@dxos/react-ui-components";
|
|
766
|
-
import { Json } from "@dxos/react-ui-syntax-highlighter";
|
|
767
|
-
import { isNonNullable as isNonNullable3, safeParseJson } from "@dxos/util";
|
|
768
|
-
var ToolBlock = ({ blocks = [] }) => {
|
|
769
|
-
var _effect = _useSignals8();
|
|
770
|
-
try {
|
|
771
|
-
const { t } = useTranslation4(meta.id);
|
|
772
|
-
const getToolCaption = (tool, status) => {
|
|
773
|
-
if (!tool) {
|
|
774
|
-
return t("calling tool label");
|
|
775
|
-
}
|
|
776
|
-
return status?.message ?? tool.description ?? [
|
|
777
|
-
t("calling label"),
|
|
778
|
-
tool.name
|
|
779
|
-
].join(" ");
|
|
780
|
-
};
|
|
781
|
-
const items = useMemo7(() => {
|
|
782
|
-
let lastToolCall;
|
|
783
|
-
const tools = [];
|
|
784
|
-
return blocks.filter((block) => block._tag === "toolCall" || block._tag === "toolResult" || block._tag === "summary").map((block) => {
|
|
785
|
-
switch (block._tag) {
|
|
786
|
-
case "toolCall": {
|
|
787
|
-
if (block.pending && lastToolCall?.block.toolCallId === block.toolCallId) {
|
|
788
|
-
return null;
|
|
789
|
-
}
|
|
790
|
-
const tool = tools.find((tool2) => tool2.name === block.name);
|
|
791
|
-
lastToolCall = {
|
|
792
|
-
tool,
|
|
793
|
-
block
|
|
794
|
-
};
|
|
795
|
-
return {
|
|
796
|
-
title: getToolCaption(lastToolCall?.tool),
|
|
797
|
-
content: {
|
|
798
|
-
...block,
|
|
799
|
-
input: safeParseJson(block.input)
|
|
800
|
-
}
|
|
801
|
-
};
|
|
802
|
-
}
|
|
803
|
-
case "toolResult": {
|
|
804
|
-
if (block.error) {
|
|
805
|
-
return {
|
|
806
|
-
title: t("error label"),
|
|
807
|
-
content: block
|
|
808
|
-
};
|
|
809
|
-
}
|
|
810
|
-
const title = getToolCaption(lastToolCall?.tool ?? t("tool result label"));
|
|
811
|
-
lastToolCall = void 0;
|
|
812
|
-
return {
|
|
813
|
-
title,
|
|
814
|
-
content: {
|
|
815
|
-
...block,
|
|
816
|
-
result: safeParseJson(block.result)
|
|
817
|
-
}
|
|
818
|
-
};
|
|
819
|
-
}
|
|
820
|
-
case "summary": {
|
|
821
|
-
if (!lastToolCall) {
|
|
822
|
-
return null;
|
|
823
|
-
}
|
|
824
|
-
return {
|
|
825
|
-
title: t("summary label"),
|
|
826
|
-
content: block
|
|
827
|
-
};
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
}).filter(isNonNullable3);
|
|
831
|
-
}, [
|
|
832
|
-
blocks
|
|
833
|
-
]);
|
|
834
|
-
if (!items.length) {
|
|
835
|
-
return null;
|
|
836
|
-
}
|
|
837
|
-
return /* @__PURE__ */ React6.createElement(ToolContainer, {
|
|
838
|
-
items
|
|
839
|
-
});
|
|
840
|
-
} finally {
|
|
841
|
-
_effect.f();
|
|
842
|
-
}
|
|
843
|
-
};
|
|
844
|
-
ToolBlock.displayName = "ToolBlock";
|
|
845
|
-
var ToolContainer = ({ items }) => {
|
|
846
|
-
var _effect = _useSignals8();
|
|
847
|
-
try {
|
|
848
|
-
const tabsRef = useRef2(null);
|
|
849
|
-
const [selected, setSelected] = useState10(0);
|
|
850
|
-
const [open, setOpen] = useState10(false);
|
|
851
|
-
useEffect4(() => {
|
|
852
|
-
if (open) {
|
|
853
|
-
tabsRef.current?.focus();
|
|
854
|
-
}
|
|
855
|
-
}, [
|
|
856
|
-
open
|
|
857
|
-
]);
|
|
858
|
-
const handleSelect = (index) => {
|
|
859
|
-
setSelected(index);
|
|
860
|
-
};
|
|
861
|
-
const data = items[selected]?.content;
|
|
862
|
-
return /* @__PURE__ */ React6.createElement(ToggleContainer.Root, {
|
|
863
|
-
classNames: chatMessagePanel,
|
|
864
|
-
open,
|
|
865
|
-
onChangeOpen: setOpen
|
|
866
|
-
}, /* @__PURE__ */ React6.createElement(ToggleContainer.Header, {
|
|
867
|
-
classNames: chatMessagePanelHeader
|
|
868
|
-
}, /* @__PURE__ */ React6.createElement(TextCrawl, {
|
|
869
|
-
key: "status-roll",
|
|
870
|
-
lines: items.map((item) => item.title)
|
|
871
|
-
})), /* @__PURE__ */ React6.createElement(ToggleContainer.Content, {
|
|
872
|
-
classNames: [
|
|
873
|
-
"grid grid-cols-[32px_1fr]",
|
|
874
|
-
chatMessagePanelContent
|
|
875
|
-
]
|
|
876
|
-
}, /* @__PURE__ */ React6.createElement(NumericTabs, {
|
|
877
|
-
ref: tabsRef,
|
|
878
|
-
classNames: "p-1",
|
|
879
|
-
length: items.length,
|
|
880
|
-
selected,
|
|
881
|
-
onSelect: handleSelect
|
|
882
|
-
}), /* @__PURE__ */ React6.createElement(Json, {
|
|
883
|
-
data,
|
|
884
|
-
classNames: chatMessageJson,
|
|
885
|
-
replacer: {
|
|
886
|
-
maxDepth: 3,
|
|
887
|
-
maxArrayLen: 10,
|
|
888
|
-
maxStringLen: 128
|
|
889
|
-
}
|
|
890
|
-
})));
|
|
891
|
-
} finally {
|
|
892
|
-
_effect.f();
|
|
893
|
-
}
|
|
894
|
-
};
|
|
895
|
-
|
|
896
|
-
// src/components/ChatThread/registry.tsx
|
|
897
|
-
var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-assistant/src/components/ChatThread/registry.tsx";
|
|
898
|
-
var Fallback = ({ _tag, ...props }) => {
|
|
899
|
-
var _effect = _useSignals9();
|
|
900
|
-
try {
|
|
901
|
-
return /* @__PURE__ */ React7.createElement(ToggleContainer2.Root, {
|
|
902
|
-
classNames: "rounded-sm"
|
|
903
|
-
}, /* @__PURE__ */ React7.createElement(ToggleContainer2.Header, {
|
|
904
|
-
classNames: "bg-groupSurface"
|
|
905
|
-
}, _tag), /* @__PURE__ */ React7.createElement(ToggleContainer2.Content, {
|
|
906
|
-
classNames: "bg-modalSurface"
|
|
907
|
-
}, /* @__PURE__ */ React7.createElement(Json2, {
|
|
908
|
-
classNames: "!p-2 text-sm",
|
|
909
|
-
data: props
|
|
910
|
-
})));
|
|
911
|
-
} finally {
|
|
912
|
-
_effect.f();
|
|
913
|
-
}
|
|
914
|
-
};
|
|
915
|
-
var componentRegistry = {
|
|
916
|
-
//
|
|
917
|
-
// Widgets
|
|
918
|
-
//
|
|
919
|
-
["prompt"]: {
|
|
920
|
-
block: true,
|
|
921
|
-
factory: (props) => {
|
|
922
|
-
const text = getXmlTextChild(props.children);
|
|
923
|
-
return text ? new PromptWidget(text) : null;
|
|
924
|
-
}
|
|
925
|
-
},
|
|
926
|
-
["reference"]: {
|
|
927
|
-
block: false,
|
|
928
|
-
factory: (props) => {
|
|
929
|
-
const text = getXmlTextChild(props.children);
|
|
930
|
-
return text && props.ref ? new ReferenceWidget(text, props.ref) : null;
|
|
931
|
-
}
|
|
932
|
-
},
|
|
933
|
-
["select"]: {
|
|
934
|
-
block: true,
|
|
935
|
-
factory: (props) => {
|
|
936
|
-
const options = props.children?.map((option) => option._tag === "option" && getXmlTextChild(option.children)).filter(Boolean);
|
|
937
|
-
return options?.length ? new SelectWidget(options) : null;
|
|
938
|
-
}
|
|
939
|
-
},
|
|
940
|
-
["suggestion"]: {
|
|
941
|
-
block: true,
|
|
942
|
-
factory: (props) => {
|
|
943
|
-
const text = getXmlTextChild(props.children);
|
|
944
|
-
return text ? new SuggestionWidget(text) : null;
|
|
945
|
-
}
|
|
946
|
-
},
|
|
947
|
-
["summary"]: {
|
|
948
|
-
block: true,
|
|
949
|
-
factory: (props) => {
|
|
950
|
-
const text = getXmlTextChild(props.children);
|
|
951
|
-
return text ? new SummaryWidget(text) : null;
|
|
952
|
-
}
|
|
953
|
-
},
|
|
954
|
-
//
|
|
955
|
-
// React
|
|
956
|
-
//
|
|
957
|
-
["toolCall"]: {
|
|
958
|
-
block: true,
|
|
959
|
-
Component: ToolBlock
|
|
960
|
-
},
|
|
961
|
-
["toolResult"]: {
|
|
962
|
-
block: true,
|
|
963
|
-
Component: Fallback
|
|
964
|
-
},
|
|
965
|
-
["toolkit"]: {
|
|
966
|
-
block: true,
|
|
967
|
-
Component: Fallback
|
|
968
|
-
},
|
|
969
|
-
//
|
|
970
|
-
// Fallback
|
|
971
|
-
//
|
|
972
|
-
["json"]: {
|
|
973
|
-
block: true,
|
|
974
|
-
Component: Fallback
|
|
975
|
-
}
|
|
976
|
-
};
|
|
977
|
-
var blockToMarkdown = (context, message, block) => {
|
|
978
|
-
let str = _blockToMarkdown(context, message, block);
|
|
979
|
-
if (str && !block.pending) {
|
|
980
|
-
return str += "\n";
|
|
981
|
-
}
|
|
982
|
-
return str;
|
|
983
|
-
};
|
|
984
|
-
var _blockToMarkdown = (context, message, block) => {
|
|
985
|
-
log3("blockToMarkdown", {
|
|
986
|
-
block: JSON.stringify(block)
|
|
987
|
-
}, {
|
|
988
|
-
F: __dxlog_file3,
|
|
989
|
-
L: 125,
|
|
990
|
-
S: void 0,
|
|
991
|
-
C: (f, a) => f(...a)
|
|
992
|
-
});
|
|
993
|
-
switch (block._tag) {
|
|
994
|
-
case "text": {
|
|
995
|
-
if (message.sender.role === "user") {
|
|
996
|
-
return `
|
|
997
|
-
<prompt>${block.text}</prompt>
|
|
998
|
-
`;
|
|
999
|
-
} else {
|
|
1000
|
-
const text = block.text.trim();
|
|
1001
|
-
if (text.length > 0) {
|
|
1002
|
-
return text;
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
break;
|
|
1006
|
-
}
|
|
1007
|
-
case "suggestion": {
|
|
1008
|
-
if (block.pending) {
|
|
1009
|
-
return;
|
|
1010
|
-
}
|
|
1011
|
-
return `<suggestion>${block.text}</suggestion>`;
|
|
1012
|
-
}
|
|
1013
|
-
case "select": {
|
|
1014
|
-
if (block.pending || block.options.length === 0) {
|
|
1015
|
-
return;
|
|
1016
|
-
}
|
|
1017
|
-
return `<select>${block.options.map((option) => `<option>${option}</option>`).join("")}</select>`;
|
|
1018
|
-
}
|
|
1019
|
-
// TODO(burdon): Need label.
|
|
1020
|
-
case "reference": {
|
|
1021
|
-
return `<reference ref="${block.reference.dxn.toString()}">Ref</reference>`;
|
|
1022
|
-
}
|
|
1023
|
-
// case 'toolkit': {
|
|
1024
|
-
// return `<toolkit />`;
|
|
1025
|
-
// }
|
|
1026
|
-
case "toolCall": {
|
|
1027
|
-
context.updateWidget(block.toolCallId, {
|
|
1028
|
-
blocks: [
|
|
1029
|
-
block
|
|
1030
|
-
]
|
|
1031
|
-
});
|
|
1032
|
-
return `<toolCall id="${block.toolCallId}" />`;
|
|
1033
|
-
}
|
|
1034
|
-
case "toolResult": {
|
|
1035
|
-
context.updateWidget(block.toolCallId, ({ blocks = [] }) => ({
|
|
1036
|
-
blocks: [
|
|
1037
|
-
...blocks,
|
|
1038
|
-
block
|
|
1039
|
-
]
|
|
1040
|
-
}));
|
|
1041
|
-
break;
|
|
1042
|
-
}
|
|
1043
|
-
case "summary": {
|
|
1044
|
-
return `<summary>${ContentBlock.createSummaryMessage(block)}</summary>`;
|
|
1045
|
-
}
|
|
1046
|
-
// TODO(burdon): Need stable ID.
|
|
1047
|
-
default: {
|
|
1048
|
-
return `<json id="${message.id}">
|
|
1049
|
-
${JSON.stringify(block)}
|
|
1050
|
-
</json>`;
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
};
|
|
1054
|
-
|
|
1055
|
-
// src/components/ChatThread/sync.ts
|
|
1056
|
-
import { log as log4 } from "@dxos/log";
|
|
1057
|
-
var __dxlog_file4 = "/__w/dxos/dxos/packages/plugins/plugin-assistant/src/components/ChatThread/sync.ts";
|
|
1058
|
-
var MessageThreadContext = class {
|
|
1059
|
-
_widgetState;
|
|
1060
|
-
constructor(_widgetState) {
|
|
1061
|
-
this._widgetState = _widgetState;
|
|
1062
|
-
}
|
|
1063
|
-
updateWidget(id, value) {
|
|
1064
|
-
this._widgetState?.updateWidget(id, value);
|
|
1065
|
-
}
|
|
1066
|
-
};
|
|
1067
|
-
var MessageSyncer = class {
|
|
1068
|
-
_model;
|
|
1069
|
-
_blockRenderer;
|
|
1070
|
-
_initialMessageId;
|
|
1071
|
-
_currentMessageIndex = 0;
|
|
1072
|
-
_currentBlockIndex = 0;
|
|
1073
|
-
_currentBlockContent;
|
|
1074
|
-
_context;
|
|
1075
|
-
constructor(_model, _blockRenderer) {
|
|
1076
|
-
this._model = _model;
|
|
1077
|
-
this._blockRenderer = _blockRenderer;
|
|
1078
|
-
this._context = new MessageThreadContext(this._model);
|
|
1079
|
-
}
|
|
1080
|
-
get context() {
|
|
1081
|
-
return this._context;
|
|
1082
|
-
}
|
|
1083
|
-
reset() {
|
|
1084
|
-
log4("reset", void 0, {
|
|
1085
|
-
F: __dxlog_file4,
|
|
1086
|
-
L: 58,
|
|
1087
|
-
S: this,
|
|
1088
|
-
C: (f, a) => f(...a)
|
|
1089
|
-
});
|
|
1090
|
-
this._initialMessageId = void 0;
|
|
1091
|
-
this._currentMessageIndex = 0;
|
|
1092
|
-
this._currentBlockIndex = 0;
|
|
1093
|
-
this._currentBlockContent = void 0;
|
|
1094
|
-
void this._model.reset("");
|
|
1095
|
-
}
|
|
1096
|
-
sync(messages) {
|
|
1097
|
-
log4("sync", {
|
|
1098
|
-
messages: messages.map((message) => message.blocks.length),
|
|
1099
|
-
currentMessageIndex: this._currentMessageIndex,
|
|
1100
|
-
currentBlockIndex: this._currentBlockIndex,
|
|
1101
|
-
currentBlockContent: this._currentBlockContent
|
|
1102
|
-
}, {
|
|
1103
|
-
F: __dxlog_file4,
|
|
1104
|
-
L: 67,
|
|
1105
|
-
S: this,
|
|
1106
|
-
C: (f, a) => f(...a)
|
|
1107
|
-
});
|
|
1108
|
-
if (this._initialMessageId !== messages[0]?.id) {
|
|
1109
|
-
this.reset();
|
|
1110
|
-
this._initialMessageId = messages[0]?.id;
|
|
1111
|
-
}
|
|
1112
|
-
let i = this._currentMessageIndex;
|
|
1113
|
-
for (const message of messages.slice(this._currentMessageIndex)) {
|
|
1114
|
-
if (i > this._currentMessageIndex) {
|
|
1115
|
-
this._currentBlockIndex = 0;
|
|
1116
|
-
}
|
|
1117
|
-
this._currentMessageIndex = i;
|
|
1118
|
-
let j = this._currentBlockIndex;
|
|
1119
|
-
for (const block of message.blocks.slice(this._currentBlockIndex)) {
|
|
1120
|
-
this._currentBlockIndex = j;
|
|
1121
|
-
const currentBlockContent = this._blockRenderer(this._context, message, block);
|
|
1122
|
-
if (currentBlockContent) {
|
|
1123
|
-
let content = "";
|
|
1124
|
-
if (this._currentBlockContent && currentBlockContent.startsWith(this._currentBlockContent)) {
|
|
1125
|
-
content = currentBlockContent.slice(this._currentBlockContent.length);
|
|
1126
|
-
} else {
|
|
1127
|
-
content = currentBlockContent;
|
|
1128
|
-
}
|
|
1129
|
-
void this._model.append(content);
|
|
1130
|
-
this._currentBlockContent = currentBlockContent;
|
|
1131
|
-
log4("append", {
|
|
1132
|
-
message: i,
|
|
1133
|
-
block: j,
|
|
1134
|
-
content
|
|
1135
|
-
}, {
|
|
1136
|
-
F: __dxlog_file4,
|
|
1137
|
-
L: 99,
|
|
1138
|
-
S: this,
|
|
1139
|
-
C: (f, a) => f(...a)
|
|
1140
|
-
});
|
|
1141
|
-
}
|
|
1142
|
-
if (block.pending) {
|
|
1143
|
-
return;
|
|
1144
|
-
} else {
|
|
1145
|
-
this._currentBlockContent = void 0;
|
|
1146
|
-
this._currentBlockIndex++;
|
|
1147
|
-
}
|
|
1148
|
-
j++;
|
|
1149
|
-
}
|
|
1150
|
-
i++;
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
|
-
};
|
|
1154
|
-
|
|
1155
|
-
// src/components/ChatThread/ChatThread.tsx
|
|
1156
|
-
var ChatThread = /* @__PURE__ */ forwardRef(({ classNames, identity, messages = [], error, cursor = false, fadeIn = true, overscroll, onEvent }, forwardedRef) => {
|
|
1157
|
-
var _effect = _useSignals10();
|
|
1158
|
-
try {
|
|
1159
|
-
const userHue = useMemo8(() => {
|
|
1160
|
-
return identity?.profile?.data?.hue || keyToFallback(identity?.identityKey ?? PublicKey.random()).hue;
|
|
1161
|
-
}, [
|
|
1162
|
-
identity
|
|
1163
|
-
]);
|
|
1164
|
-
const [controller, setController] = useState11(null);
|
|
1165
|
-
useImperativeHandle(forwardedRef, () => controller ? controller : null, [
|
|
1166
|
-
controller
|
|
1167
|
-
]);
|
|
1168
|
-
useEffect5(() => {
|
|
1169
|
-
controller?.scrollToBottom();
|
|
1170
|
-
}, [
|
|
1171
|
-
controller,
|
|
1172
|
-
error
|
|
1173
|
-
]);
|
|
1174
|
-
const syncer = useMemo8(() => controller && new MessageSyncer(controller, blockToMarkdown), [
|
|
1175
|
-
controller
|
|
1176
|
-
]);
|
|
1177
|
-
useEffect5(() => {
|
|
1178
|
-
syncer?.sync(messages);
|
|
1179
|
-
}, [
|
|
1180
|
-
syncer,
|
|
1181
|
-
messages
|
|
1182
|
-
]);
|
|
1183
|
-
const handleEvent = useCallback5((ev) => {
|
|
1184
|
-
switch (ev.type) {
|
|
1185
|
-
case "submit": {
|
|
1186
|
-
ev.value && onEvent?.({
|
|
1187
|
-
type: "submit",
|
|
1188
|
-
text: ev.value
|
|
1189
|
-
});
|
|
1190
|
-
break;
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
}, [
|
|
1194
|
-
onEvent
|
|
1195
|
-
]);
|
|
1196
|
-
return /* @__PURE__ */ React8.createElement("div", {
|
|
1197
|
-
className: mx4("flex bs-full is-full justify-center overflow-hidden", classNames),
|
|
1198
|
-
style: {
|
|
1199
|
-
"--user-fill": `var(--dx-${userHue}Fill)`
|
|
1200
|
-
}
|
|
1201
|
-
}, /* @__PURE__ */ React8.createElement(MarkdownStream, {
|
|
1202
|
-
ref: setController,
|
|
1203
|
-
registry: componentRegistry,
|
|
1204
|
-
cursor,
|
|
1205
|
-
fadeIn,
|
|
1206
|
-
overscroll,
|
|
1207
|
-
onEvent: handleEvent
|
|
1208
|
-
}));
|
|
1209
|
-
} finally {
|
|
1210
|
-
_effect.f();
|
|
1211
|
-
}
|
|
1212
|
-
});
|
|
1213
|
-
|
|
1214
|
-
// src/components/Chat/Chat.tsx
|
|
1215
|
-
var [ChatContextProvider, useChatContext] = createContext("Chat");
|
|
1216
|
-
var ChatRoot = ({ classNames, children, chat, processor, onEvent, ...props }) => {
|
|
1217
|
-
var _effect = _useSignals11();
|
|
1218
|
-
try {
|
|
1219
|
-
const [debug, setDebug] = useState12(false);
|
|
1220
|
-
const space = getSpace(chat);
|
|
1221
|
-
const queue = useQueue(chat?.queue.dxn);
|
|
1222
|
-
const pending = useRxValue(processor.messages);
|
|
1223
|
-
const streaming = useRxValue(processor.streaming);
|
|
1224
|
-
const lastPrompt = useRef3(void 0);
|
|
1225
|
-
const messages = useMemo9(() => {
|
|
1226
|
-
const queueMessages = queue?.objects?.filter(Obj5.instanceOf(DataType.Message)) ?? [];
|
|
1227
|
-
return Array2.dedupeWith([
|
|
1228
|
-
...queueMessages,
|
|
1229
|
-
...pending
|
|
1230
|
-
], (a, b) => a.id === b.id);
|
|
1231
|
-
}, [
|
|
1232
|
-
queue?.objects,
|
|
1233
|
-
pending
|
|
1234
|
-
]);
|
|
1235
|
-
const event = useMemo9(() => new Event(), []);
|
|
1236
|
-
useEffect6(() => {
|
|
1237
|
-
return event.on((ev) => {
|
|
1238
|
-
switch (ev.type) {
|
|
1239
|
-
case "toggle-debug": {
|
|
1240
|
-
setDebug((current) => !current);
|
|
1241
|
-
break;
|
|
1242
|
-
}
|
|
1243
|
-
case "submit": {
|
|
1244
|
-
const text = ev.text.trim();
|
|
1245
|
-
if (!streaming && text.length) {
|
|
1246
|
-
lastPrompt.current = ev.text;
|
|
1247
|
-
void processor.request({
|
|
1248
|
-
message: text
|
|
1249
|
-
});
|
|
1250
|
-
}
|
|
1251
|
-
break;
|
|
1252
|
-
}
|
|
1253
|
-
case "retry": {
|
|
1254
|
-
if (!streaming) {
|
|
1255
|
-
void processor.retry();
|
|
1256
|
-
}
|
|
1257
|
-
break;
|
|
1258
|
-
}
|
|
1259
|
-
case "cancel": {
|
|
1260
|
-
if (streaming) {
|
|
1261
|
-
void processor.cancel();
|
|
1262
|
-
if (lastPrompt.current) {
|
|
1263
|
-
event.emit({
|
|
1264
|
-
type: "update-prompt",
|
|
1265
|
-
text: lastPrompt.current
|
|
1266
|
-
});
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
break;
|
|
1270
|
-
}
|
|
1271
|
-
default: {
|
|
1272
|
-
onEvent?.(ev);
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
});
|
|
1276
|
-
}, [
|
|
1277
|
-
event,
|
|
1278
|
-
processor,
|
|
1279
|
-
streaming,
|
|
1280
|
-
onEvent
|
|
1281
|
-
]);
|
|
1282
|
-
if (!space) {
|
|
1283
|
-
return null;
|
|
1284
|
-
}
|
|
1285
|
-
return /* @__PURE__ */ React9.createElement(ChatContextProvider, {
|
|
1286
|
-
debug,
|
|
1287
|
-
event,
|
|
1288
|
-
chat,
|
|
1289
|
-
space,
|
|
1290
|
-
messages,
|
|
1291
|
-
processor,
|
|
1292
|
-
...props
|
|
1293
|
-
}, /* @__PURE__ */ React9.createElement("div", {
|
|
1294
|
-
role: "none",
|
|
1295
|
-
className: mx5("flex flex-col bs-full is-full", classNames)
|
|
1296
|
-
}, children));
|
|
1297
|
-
} finally {
|
|
1298
|
-
_effect.f();
|
|
1299
|
-
}
|
|
1300
|
-
};
|
|
1301
|
-
ChatRoot.displayName = "Chat.Root";
|
|
1302
|
-
var ChatPrompt = ({ classNames, outline, settings = true, placeholder, expandable, online, presets, preset, onPresetChange, onOnlineChange }) => {
|
|
1303
|
-
var _effect = _useSignals11();
|
|
1304
|
-
try {
|
|
1305
|
-
const { t } = useTranslation5(meta.id);
|
|
1306
|
-
const { space, event, processor } = useChatContext(ChatPrompt.displayName);
|
|
1307
|
-
const error = useRxValue(processor.error).pipe(Option2.getOrUndefined);
|
|
1308
|
-
const streaming = useRxValue(processor.streaming);
|
|
1309
|
-
const active = useRxValue(processor.active);
|
|
1310
|
-
const activeRef = useDynamicRef(active);
|
|
1311
|
-
const editorRef = useRef3(null);
|
|
1312
|
-
const [recordingState, setRecordingState] = useState12(false);
|
|
1313
|
-
useEffect6(() => {
|
|
1314
|
-
return event.on((event2) => {
|
|
1315
|
-
switch (event2.type) {
|
|
1316
|
-
case "update-prompt":
|
|
1317
|
-
if (!editorRef.current?.getText()?.length) {
|
|
1318
|
-
editorRef.current?.setText(event2.text);
|
|
1319
|
-
editorRef.current?.focus();
|
|
1320
|
-
}
|
|
1321
|
-
break;
|
|
1322
|
-
case "record-start":
|
|
1323
|
-
setRecordingState(true);
|
|
1324
|
-
break;
|
|
1325
|
-
case "record-stop":
|
|
1326
|
-
setRecordingState(false);
|
|
1327
|
-
break;
|
|
1328
|
-
}
|
|
1329
|
-
});
|
|
1330
|
-
}, [
|
|
1331
|
-
event
|
|
1332
|
-
]);
|
|
1333
|
-
const { recording } = useVoiceInput({
|
|
1334
|
-
active: recordingState,
|
|
1335
|
-
onUpdate: (text) => {
|
|
1336
|
-
editorRef.current?.setText(text);
|
|
1337
|
-
editorRef.current?.focus();
|
|
1338
|
-
}
|
|
1339
|
-
});
|
|
1340
|
-
const referencesProvider = useReferencesProvider(space);
|
|
1341
|
-
const extensions = useMemo9(() => {
|
|
1342
|
-
return [
|
|
1343
|
-
referencesProvider && references({
|
|
1344
|
-
provider: referencesProvider
|
|
1345
|
-
}),
|
|
1346
|
-
Prec.highest(keymap.of([
|
|
1347
|
-
{
|
|
1348
|
-
key: "cmd-d",
|
|
1349
|
-
preventDefault: true,
|
|
1350
|
-
run: () => {
|
|
1351
|
-
event.emit({
|
|
1352
|
-
type: "toggle-debug"
|
|
1353
|
-
});
|
|
1354
|
-
return true;
|
|
1355
|
-
}
|
|
1356
|
-
},
|
|
1357
|
-
expandable && {
|
|
1358
|
-
key: "cmd-ArrowUp",
|
|
1359
|
-
preventDefault: true,
|
|
1360
|
-
run: () => {
|
|
1361
|
-
event.emit({
|
|
1362
|
-
type: "thread-open"
|
|
1363
|
-
});
|
|
1364
|
-
return true;
|
|
1365
|
-
}
|
|
1366
|
-
},
|
|
1367
|
-
expandable && {
|
|
1368
|
-
key: "cmd-ArrowDown",
|
|
1369
|
-
preventDefault: true,
|
|
1370
|
-
run: () => {
|
|
1371
|
-
event.emit({
|
|
1372
|
-
type: "thread-close"
|
|
1373
|
-
});
|
|
1374
|
-
return true;
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
].filter(isTruthy)))
|
|
1378
|
-
].filter(isTruthy);
|
|
1379
|
-
}, [
|
|
1380
|
-
event,
|
|
1381
|
-
expandable,
|
|
1382
|
-
referencesProvider
|
|
1383
|
-
]);
|
|
1384
|
-
const handleSubmit = useCallback6((text) => {
|
|
1385
|
-
if (!activeRef.current) {
|
|
1386
|
-
event.emit({
|
|
1387
|
-
type: "submit",
|
|
1388
|
-
text
|
|
1389
|
-
});
|
|
1390
|
-
return true;
|
|
1391
|
-
}
|
|
1392
|
-
}, [
|
|
1393
|
-
event
|
|
1394
|
-
]);
|
|
1395
|
-
const handleEvent = useCallback6((ev) => {
|
|
1396
|
-
event.emit(ev);
|
|
1397
|
-
}, [
|
|
1398
|
-
event
|
|
1399
|
-
]);
|
|
1400
|
-
return /* @__PURE__ */ React9.createElement("div", {
|
|
1401
|
-
role: "group",
|
|
1402
|
-
className: mx5("flex flex-col is-full density-fine", outline && [
|
|
1403
|
-
"p-2 bg-groupSurface border border-subduedSeparator transition transition-border [&:has(.cm-content:focus)]:border-separator rounded"
|
|
1404
|
-
], classNames)
|
|
1405
|
-
}, /* @__PURE__ */ React9.createElement("div", {
|
|
1406
|
-
role: "none",
|
|
1407
|
-
className: "flex gap-2"
|
|
1408
|
-
}, /* @__PURE__ */ React9.createElement(ChatStatusIndicator, {
|
|
1409
|
-
classNames: "p-1",
|
|
1410
|
-
preset,
|
|
1411
|
-
error,
|
|
1412
|
-
processing: streaming
|
|
1413
|
-
}), /* @__PURE__ */ React9.createElement(ChatEditor, {
|
|
1414
|
-
ref: editorRef,
|
|
1415
|
-
autoFocus: true,
|
|
1416
|
-
lineWrapping: true,
|
|
1417
|
-
classNames: "col-span-2 pbs-0.5",
|
|
1418
|
-
placeholder: placeholder ?? t("prompt placeholder"),
|
|
1419
|
-
extensions,
|
|
1420
|
-
onSubmit: handleSubmit
|
|
1421
|
-
})), settings && /* @__PURE__ */ React9.createElement("div", {
|
|
1422
|
-
role: "none",
|
|
1423
|
-
className: "flex pbs-2 items-center"
|
|
1424
|
-
}, /* @__PURE__ */ React9.createElement(ChatOptions, {
|
|
1425
|
-
space,
|
|
1426
|
-
blueprintRegistry: processor.blueprintRegistry,
|
|
1427
|
-
context: processor.context,
|
|
1428
|
-
preset,
|
|
1429
|
-
presets,
|
|
1430
|
-
onPresetChange
|
|
1431
|
-
}), /* @__PURE__ */ React9.createElement("div", {
|
|
1432
|
-
role: "none",
|
|
1433
|
-
className: "pli-cardSpacingChrome grow"
|
|
1434
|
-
}, /* @__PURE__ */ React9.createElement(ChatReferences, {
|
|
1435
|
-
space,
|
|
1436
|
-
context: processor.context
|
|
1437
|
-
})), /* @__PURE__ */ React9.createElement(ChatActions, {
|
|
1438
|
-
classNames: "col-span-2",
|
|
1439
|
-
microphone: true,
|
|
1440
|
-
recording,
|
|
1441
|
-
processing: streaming,
|
|
1442
|
-
onEvent: handleEvent
|
|
1443
|
-
}, online !== void 0 && /* @__PURE__ */ React9.createElement(Input.Root, null, /* @__PURE__ */ React9.createElement(Input.Label, {
|
|
1444
|
-
srOnly: true
|
|
1445
|
-
}, t("online switch label")), /* @__PURE__ */ React9.createElement(Input.Switch, {
|
|
1446
|
-
classNames: "mis-2 mie-2",
|
|
1447
|
-
checked: online,
|
|
1448
|
-
onCheckedChange: onOnlineChange
|
|
1449
|
-
})))));
|
|
1450
|
-
} finally {
|
|
1451
|
-
_effect.f();
|
|
1452
|
-
}
|
|
1453
|
-
};
|
|
1454
|
-
ChatPrompt.displayName = "Chat.Prompt";
|
|
1455
|
-
var ChatThread2 = (props) => {
|
|
1456
|
-
var _effect = _useSignals11();
|
|
1457
|
-
try {
|
|
1458
|
-
const { event, messages, processor } = useChatContext(ChatThread2.displayName);
|
|
1459
|
-
const identity = useIdentity();
|
|
1460
|
-
const error = useRxValue(processor.error).pipe(Option2.getOrUndefined);
|
|
1461
|
-
const scrollerRef = useRef3(null);
|
|
1462
|
-
useEffect6(() => {
|
|
1463
|
-
return event.on((event2) => {
|
|
1464
|
-
switch (event2.type) {
|
|
1465
|
-
case "submit":
|
|
1466
|
-
case "scroll-to-bottom":
|
|
1467
|
-
scrollerRef.current?.scrollToBottom();
|
|
1468
|
-
break;
|
|
1469
|
-
}
|
|
1470
|
-
});
|
|
1471
|
-
}, [
|
|
1472
|
-
event
|
|
1473
|
-
]);
|
|
1474
|
-
const handleEvent = useCallback6((ev) => {
|
|
1475
|
-
event.emit(ev);
|
|
1476
|
-
}, [
|
|
1477
|
-
event
|
|
1478
|
-
]);
|
|
1479
|
-
if (!identity) {
|
|
1480
|
-
return null;
|
|
1481
|
-
}
|
|
1482
|
-
return /* @__PURE__ */ React9.createElement(ChatThread, {
|
|
1483
|
-
...props,
|
|
1484
|
-
ref: scrollerRef,
|
|
1485
|
-
identity,
|
|
1486
|
-
messages,
|
|
1487
|
-
error,
|
|
1488
|
-
onEvent: handleEvent
|
|
1489
|
-
});
|
|
1490
|
-
} finally {
|
|
1491
|
-
_effect.f();
|
|
1492
|
-
}
|
|
1493
|
-
};
|
|
1494
|
-
ChatThread2.displayName = "Chat.Thread";
|
|
1495
|
-
var Chat = {
|
|
1496
|
-
Root: ChatRoot,
|
|
1497
|
-
Prompt: ChatPrompt,
|
|
1498
|
-
Thread: ChatThread2
|
|
1499
|
-
};
|
|
1500
|
-
|
|
1501
|
-
export {
|
|
1502
|
-
useBlueprintRegistry,
|
|
1503
|
-
useBlueprints,
|
|
1504
|
-
useActiveBlueprints,
|
|
1505
|
-
useBlueprintHandlers,
|
|
1506
|
-
useChatProcessor,
|
|
1507
|
-
useChatServices,
|
|
1508
|
-
useContextBinder,
|
|
1509
|
-
useContextObjects,
|
|
1510
|
-
useFlush,
|
|
1511
|
-
useItemTypes,
|
|
1512
|
-
useOnline,
|
|
1513
|
-
usePresets,
|
|
1514
|
-
useReferencesProvider,
|
|
1515
|
-
ChatContextProvider,
|
|
1516
|
-
useChatContext,
|
|
1517
|
-
Chat
|
|
1518
|
-
};
|
|
1519
|
-
//# sourceMappingURL=chunk-357IHWQL.mjs.map
|