@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
|
@@ -4,46 +4,40 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Extension, Prec } from '@codemirror/state';
|
|
6
6
|
import { keymap } from '@codemirror/view';
|
|
7
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
7
8
|
import { createContext } from '@radix-ui/react-context';
|
|
8
|
-
import
|
|
9
|
+
import * as Array from 'effect/Array';
|
|
10
|
+
import * as Option from 'effect/Option';
|
|
9
11
|
import React, { type PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
10
12
|
|
|
11
|
-
import { CollaborationActions, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
12
13
|
import { Event } from '@dxos/async';
|
|
13
|
-
import {
|
|
14
|
-
import { log } from '@dxos/log';
|
|
14
|
+
import { type Database, Obj } from '@dxos/echo';
|
|
15
15
|
import { useVoiceInput } from '@dxos/plugin-transcription';
|
|
16
|
-
import {
|
|
16
|
+
import { useQueue } from '@dxos/react-client/echo';
|
|
17
17
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
18
|
-
import { Input,
|
|
19
|
-
import { ChatEditor, type ChatEditorController, type ChatEditorProps
|
|
20
|
-
import { type
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
import {
|
|
18
|
+
import { Input, type ThemedClassName, useDynamicRef, useTranslation } from '@dxos/react-ui';
|
|
19
|
+
import { ChatEditor, type ChatEditorController, type ChatEditorProps } from '@dxos/react-ui-chat';
|
|
20
|
+
import { type MarkdownStreamController } from '@dxos/react-ui-components';
|
|
21
|
+
import { MenuProvider, ToolbarMenu } from '@dxos/react-ui-menu';
|
|
22
|
+
import { Message } from '@dxos/types';
|
|
23
|
+
import { mx } from '@dxos/ui-theme';
|
|
24
|
+
import { isTruthy } from '@dxos/util';
|
|
25
|
+
|
|
26
|
+
import { useChatToolbarActions } from '../../hooks';
|
|
27
27
|
import { meta } from '../../meta';
|
|
28
|
+
import { type AiChatProcessor } from '../../processor';
|
|
28
29
|
import { type Assistant } from '../../types';
|
|
29
30
|
import {
|
|
30
31
|
ChatActions,
|
|
31
32
|
type ChatActionsProps,
|
|
32
|
-
|
|
33
|
-
ChatPresets,
|
|
33
|
+
ChatOptions,
|
|
34
34
|
type ChatPresetsProps,
|
|
35
35
|
ChatReferences,
|
|
36
|
-
type ChatReferencesProps,
|
|
37
36
|
ChatStatusIndicator,
|
|
38
37
|
} from '../ChatPrompt';
|
|
39
|
-
import { ChatThread as
|
|
38
|
+
import { ChatThread as NaturalChatThread, type ChatThreadProps as NaturalChatThreadProps } from '../ChatThread';
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
const Endcap = ({ children }: PropsWithChildren) => {
|
|
43
|
-
return (
|
|
44
|
-
<div className='grid w-[var(--rail-action)] h-[var(--rail-action)] items-center justify-center'>{children}</div>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
40
|
+
import { type ChatEvent } from './events';
|
|
47
41
|
|
|
48
42
|
//
|
|
49
43
|
// Context
|
|
@@ -51,154 +45,163 @@ const Endcap = ({ children }: PropsWithChildren) => {
|
|
|
51
45
|
// Components outside of this Radix-style group shuld define their own APIs.
|
|
52
46
|
//
|
|
53
47
|
|
|
54
|
-
// TODO(burdon): Inject via effect layer.
|
|
55
48
|
type ChatContextValue = {
|
|
56
49
|
debug?: boolean;
|
|
57
50
|
event: Event<ChatEvent>;
|
|
58
|
-
|
|
59
|
-
chat
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/** @deprecated Remove and replace with context. */
|
|
64
|
-
artifact?: Expando;
|
|
51
|
+
db?: Database.Database;
|
|
52
|
+
chat?: Assistant.Chat;
|
|
53
|
+
messages: Message.Message[];
|
|
54
|
+
processor: AiChatProcessor;
|
|
65
55
|
};
|
|
66
56
|
|
|
67
|
-
|
|
68
|
-
const [ChatContextProvider, useChatContext] = createContext<ChatContextValue>('Chat');
|
|
57
|
+
export const [ChatContextProvider, useChatContext] = createContext<ChatContextValue>('Chat');
|
|
69
58
|
|
|
70
59
|
//
|
|
71
60
|
// Root
|
|
72
61
|
//
|
|
73
62
|
|
|
74
|
-
type ChatRootProps =
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
>
|
|
63
|
+
type ChatRootProps = PropsWithChildren<
|
|
64
|
+
Pick<ChatContextValue, 'db' | 'chat' | 'processor'> & {
|
|
65
|
+
onEvent?: (event: ChatEvent) => void;
|
|
66
|
+
}
|
|
80
67
|
>;
|
|
81
68
|
|
|
82
|
-
const ChatRoot = ({
|
|
69
|
+
const ChatRoot = ({ children, chat, processor, onEvent, ...props }: ChatRootProps) => {
|
|
83
70
|
const [debug, setDebug] = useState(false);
|
|
84
|
-
const
|
|
71
|
+
const pending = useAtomValue(processor.messages);
|
|
72
|
+
const streaming = useAtomValue(processor.streaming);
|
|
73
|
+
const lastPrompt = useRef<string | undefined>(undefined);
|
|
85
74
|
|
|
86
75
|
// Messages.
|
|
87
|
-
const queue = useQueue<
|
|
88
|
-
const messages = useMemo(
|
|
89
|
-
()
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
(a, b) => a.id === b.id,
|
|
93
|
-
),
|
|
94
|
-
[queue?.objects, processor?.messages.value],
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
// TODO(burdon): Replace with tool.
|
|
98
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
if (!processor?.streaming.value && queue?.objects && artifact) {
|
|
101
|
-
const message = queue.objects[queue.objects.length - 1];
|
|
102
|
-
if (dispatch && space && chat && message) {
|
|
103
|
-
void dispatch(
|
|
104
|
-
createIntent(CollaborationActions.InsertContent, {
|
|
105
|
-
target: artifact,
|
|
106
|
-
object: Ref.fromDXN(new DXN(DXN.kind.QUEUE, [...chat.queue.dxn.parts, message.id])),
|
|
107
|
-
label: 'View proposal',
|
|
108
|
-
}),
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}, [queue, processor?.streaming.value]);
|
|
76
|
+
const queue = useQueue<Message.Message>(chat?.queue.dxn);
|
|
77
|
+
const messages = useMemo(() => {
|
|
78
|
+
const queueMessages = queue?.objects?.filter(Obj.instanceOf(Message.Message)) ?? [];
|
|
79
|
+
return Array.dedupeWith([...queueMessages, ...pending], ({ id: a }, { id: b }) => a === b);
|
|
80
|
+
}, [queue?.objects, pending]);
|
|
113
81
|
|
|
114
82
|
// Events.
|
|
115
83
|
const event = useMemo(() => new Event<ChatEvent>(), []);
|
|
116
84
|
useEffect(() => {
|
|
117
|
-
return event.on((
|
|
118
|
-
switch (
|
|
85
|
+
return event.on((ev) => {
|
|
86
|
+
switch (ev.type) {
|
|
119
87
|
case 'toggle-debug': {
|
|
120
|
-
setDebug((
|
|
88
|
+
setDebug((current) => !current);
|
|
121
89
|
break;
|
|
122
90
|
}
|
|
123
91
|
|
|
124
92
|
case 'submit': {
|
|
125
|
-
|
|
126
|
-
|
|
93
|
+
const text = ev.text.trim();
|
|
94
|
+
if (!streaming && text.length) {
|
|
95
|
+
lastPrompt.current = ev.text;
|
|
96
|
+
void processor.request({ message: text });
|
|
127
97
|
}
|
|
128
98
|
break;
|
|
129
99
|
}
|
|
130
100
|
|
|
131
|
-
case '
|
|
132
|
-
|
|
101
|
+
case 'retry': {
|
|
102
|
+
if (!streaming) {
|
|
103
|
+
void processor.retry();
|
|
104
|
+
}
|
|
133
105
|
break;
|
|
134
106
|
}
|
|
135
107
|
|
|
136
|
-
|
|
137
|
-
|
|
108
|
+
case 'cancel': {
|
|
109
|
+
if (streaming) {
|
|
110
|
+
void processor.cancel();
|
|
111
|
+
if (lastPrompt.current) {
|
|
112
|
+
event.emit({ type: 'update-prompt', text: lastPrompt.current });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
break;
|
|
138
116
|
}
|
|
139
117
|
}
|
|
118
|
+
|
|
119
|
+
onEvent?.(ev);
|
|
140
120
|
});
|
|
141
|
-
}, [event, onEvent]);
|
|
121
|
+
}, [event, processor, streaming, onEvent]);
|
|
142
122
|
|
|
143
|
-
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
123
|
+
const db = props.db ?? (chat && Obj.getDatabase(chat));
|
|
146
124
|
|
|
147
125
|
return (
|
|
148
126
|
<ChatContextProvider
|
|
149
127
|
debug={debug}
|
|
150
128
|
event={event}
|
|
129
|
+
db={db}
|
|
151
130
|
chat={chat}
|
|
152
|
-
space={space}
|
|
153
|
-
processor={processor}
|
|
154
131
|
messages={messages}
|
|
132
|
+
processor={processor}
|
|
155
133
|
{...props}
|
|
156
134
|
>
|
|
157
|
-
|
|
158
|
-
{children}
|
|
159
|
-
</div>
|
|
135
|
+
{children}
|
|
160
136
|
</ChatContextProvider>
|
|
161
137
|
);
|
|
162
138
|
};
|
|
163
139
|
|
|
164
140
|
ChatRoot.displayName = 'Chat.Root';
|
|
165
141
|
|
|
142
|
+
//
|
|
143
|
+
// Viewport
|
|
144
|
+
//
|
|
145
|
+
|
|
146
|
+
type ChatViewportProps = ThemedClassName<PropsWithChildren>;
|
|
147
|
+
|
|
148
|
+
const ChatViewport = ({ classNames, children }: ChatViewportProps) => {
|
|
149
|
+
return (
|
|
150
|
+
<div role='none' className={mx('flex flex-col bs-full is-full', classNames)}>
|
|
151
|
+
{children}
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
};
|
|
155
|
+
|
|
166
156
|
//
|
|
167
157
|
// Thread
|
|
168
158
|
//
|
|
169
159
|
|
|
170
|
-
type ChatThreadProps = Omit<
|
|
160
|
+
type ChatThreadProps = Omit<NaturalChatThreadProps, 'identity' | 'messages' | 'tools'>;
|
|
171
161
|
|
|
172
162
|
const ChatThread = (props: ChatThreadProps) => {
|
|
173
|
-
const { debug, event,
|
|
163
|
+
const { debug, event, messages, processor } = useChatContext(ChatThread.displayName);
|
|
174
164
|
const identity = useIdentity();
|
|
165
|
+
const error = useAtomValue(processor.error).pipe(Option.getOrUndefined);
|
|
175
166
|
|
|
176
|
-
const
|
|
167
|
+
const controllerRef = useRef<MarkdownStreamController | null>(null);
|
|
177
168
|
useEffect(() => {
|
|
178
169
|
return event.on((event) => {
|
|
179
170
|
switch (event.type) {
|
|
180
171
|
case 'submit':
|
|
181
172
|
case 'scroll-to-bottom':
|
|
182
|
-
|
|
173
|
+
controllerRef.current?.scrollToBottom();
|
|
174
|
+
break;
|
|
175
|
+
case 'nav-previous':
|
|
176
|
+
controllerRef.current?.navigatePrevious();
|
|
177
|
+
break;
|
|
178
|
+
case 'nav-next':
|
|
179
|
+
controllerRef.current?.navigateNext();
|
|
183
180
|
break;
|
|
184
181
|
}
|
|
185
182
|
});
|
|
186
183
|
}, [event]);
|
|
187
184
|
|
|
185
|
+
const handleEvent = useCallback<NonNullable<NaturalChatThreadProps['onEvent']>>(
|
|
186
|
+
(ev) => {
|
|
187
|
+
event.emit(ev);
|
|
188
|
+
},
|
|
189
|
+
[event],
|
|
190
|
+
);
|
|
191
|
+
|
|
188
192
|
if (!identity) {
|
|
189
193
|
return null;
|
|
190
194
|
}
|
|
191
195
|
|
|
192
196
|
return (
|
|
193
|
-
<
|
|
197
|
+
<NaturalChatThread
|
|
194
198
|
{...props}
|
|
195
|
-
ref={scrollerRef}
|
|
196
|
-
debug={debug}
|
|
197
199
|
identity={identity}
|
|
198
|
-
space={space}
|
|
199
200
|
messages={messages}
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
error={error}
|
|
202
|
+
debug={debug}
|
|
203
|
+
onEvent={handleEvent}
|
|
204
|
+
ref={controllerRef}
|
|
202
205
|
/>
|
|
203
206
|
);
|
|
204
207
|
};
|
|
@@ -210,100 +213,117 @@ ChatThread.displayName = 'Chat.Thread';
|
|
|
210
213
|
//
|
|
211
214
|
|
|
212
215
|
type ChatPromptProps = ThemedClassName<
|
|
213
|
-
|
|
216
|
+
{
|
|
217
|
+
outline?: boolean;
|
|
218
|
+
settings?: boolean;
|
|
219
|
+
} & Pick<ChatEditorProps, 'placeholder'> &
|
|
214
220
|
Omit<ChatPresetsProps, 'onChange'> & {
|
|
215
221
|
expandable?: boolean;
|
|
216
222
|
online?: boolean;
|
|
217
|
-
|
|
218
|
-
|
|
223
|
+
onOnlineChange?: (online: boolean) => void;
|
|
224
|
+
onPresetChange?: ChatPresetsProps['onChange'];
|
|
219
225
|
}
|
|
220
226
|
>;
|
|
221
227
|
|
|
222
228
|
const ChatPrompt = ({
|
|
223
229
|
classNames,
|
|
230
|
+
outline,
|
|
231
|
+
settings = true,
|
|
224
232
|
placeholder,
|
|
225
233
|
expandable,
|
|
226
234
|
online,
|
|
227
235
|
presets,
|
|
228
236
|
preset,
|
|
229
|
-
|
|
230
|
-
|
|
237
|
+
onPresetChange,
|
|
238
|
+
onOnlineChange,
|
|
231
239
|
}: ChatPromptProps) => {
|
|
232
240
|
const { t } = useTranslation(meta.id);
|
|
233
|
-
const {
|
|
241
|
+
const { db, processor, event } = useChatContext(ChatPrompt.displayName);
|
|
242
|
+
|
|
243
|
+
const error = useAtomValue(processor.error).pipe(Option.getOrUndefined);
|
|
244
|
+
const streaming = useAtomValue(processor.streaming);
|
|
245
|
+
const active = useAtomValue(processor.active);
|
|
246
|
+
const activeRef = useDynamicRef(active);
|
|
234
247
|
|
|
235
|
-
const
|
|
248
|
+
const editorRef = useRef<ChatEditorController>(null);
|
|
249
|
+
const [recordingState, setRecordingState] = useState(false);
|
|
236
250
|
useEffect(() => {
|
|
237
251
|
return event.on((event) => {
|
|
238
252
|
switch (event.type) {
|
|
253
|
+
case 'update-prompt':
|
|
254
|
+
if (!editorRef.current?.getText()?.length) {
|
|
255
|
+
editorRef.current?.setText(event.text);
|
|
256
|
+
editorRef.current?.focus();
|
|
257
|
+
}
|
|
258
|
+
break;
|
|
239
259
|
case 'record-start':
|
|
240
|
-
|
|
260
|
+
setRecordingState(true);
|
|
241
261
|
break;
|
|
242
262
|
case 'record-stop':
|
|
243
|
-
|
|
263
|
+
setRecordingState(false);
|
|
244
264
|
break;
|
|
245
265
|
}
|
|
246
266
|
});
|
|
247
267
|
}, [event]);
|
|
248
268
|
|
|
249
|
-
const editorRef = useRef<ChatEditorController>(null);
|
|
250
|
-
|
|
251
269
|
// TODO(burdon): Configure capability in TranscriptionPlugin.
|
|
252
270
|
const { recording } = useVoiceInput({
|
|
253
|
-
active,
|
|
271
|
+
active: recordingState,
|
|
254
272
|
onUpdate: (text) => {
|
|
255
273
|
editorRef.current?.setText(text);
|
|
256
274
|
editorRef.current?.focus();
|
|
257
275
|
},
|
|
258
276
|
});
|
|
259
277
|
|
|
260
|
-
const [blueprints, handleUpdateBlueprints] = useBlueprints(space, processor.context, processor.blueprintRegistry);
|
|
261
|
-
|
|
262
|
-
// TODO(burdon): Reconcile with object tags.
|
|
263
|
-
const contextProvider = useReferencesProvider(space);
|
|
264
278
|
const extensions = useMemo<Extension[]>(() => {
|
|
265
279
|
return [
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
280
|
+
Prec.highest(
|
|
281
|
+
keymap.of([
|
|
282
|
+
{
|
|
283
|
+
key: 'Mod-d',
|
|
284
|
+
preventDefault: true,
|
|
285
|
+
run: () => {
|
|
286
|
+
event.emit({ type: 'toggle-debug' });
|
|
287
|
+
return true;
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
key: 'Mod-ArrowUp',
|
|
292
|
+
preventDefault: true,
|
|
293
|
+
run: () => {
|
|
294
|
+
event.emit({ type: 'nav-previous' });
|
|
295
|
+
return true;
|
|
277
296
|
},
|
|
278
|
-
{
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
run: () => {
|
|
282
|
-
event.emit({ type: 'thread-open' });
|
|
283
|
-
return true;
|
|
284
|
-
},
|
|
297
|
+
shift: () => {
|
|
298
|
+
event.emit({ type: 'thread-open' });
|
|
299
|
+
return true;
|
|
285
300
|
},
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
key: 'Mod-ArrowDown',
|
|
304
|
+
preventDefault: true,
|
|
305
|
+
run: () => {
|
|
306
|
+
event.emit({ type: 'nav-next' });
|
|
307
|
+
return true;
|
|
293
308
|
},
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
309
|
+
shift: () => {
|
|
310
|
+
event.emit({ type: 'thread-close' });
|
|
311
|
+
return true;
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
]),
|
|
315
|
+
),
|
|
316
|
+
].filter(isTruthy);
|
|
317
|
+
}, [event, expandable]);
|
|
298
318
|
|
|
299
319
|
const handleSubmit = useCallback<NonNullable<ChatEditorProps['onSubmit']>>(
|
|
300
320
|
(text) => {
|
|
301
|
-
if (!
|
|
321
|
+
if (!activeRef.current) {
|
|
302
322
|
event.emit({ type: 'submit', text });
|
|
303
323
|
return true;
|
|
304
324
|
}
|
|
305
325
|
},
|
|
306
|
-
[
|
|
326
|
+
[event],
|
|
307
327
|
);
|
|
308
328
|
|
|
309
329
|
const handleEvent = useCallback<NonNullable<ChatActionsProps['onEvent']>>(
|
|
@@ -313,76 +333,99 @@ const ChatPrompt = ({
|
|
|
313
333
|
[event],
|
|
314
334
|
);
|
|
315
335
|
|
|
316
|
-
// TODO(burdon): Update context.
|
|
317
|
-
const handleUpdateReferences = useCallback<NonNullable<ChatReferencesProps['onUpdate']>>((ids) => {
|
|
318
|
-
log.info('update', { ids });
|
|
319
|
-
}, []);
|
|
320
|
-
|
|
321
336
|
return (
|
|
322
337
|
<div
|
|
338
|
+
role='group'
|
|
323
339
|
className={mx(
|
|
324
|
-
'is-full
|
|
340
|
+
'flex flex-col is-full density-fine',
|
|
341
|
+
outline &&
|
|
342
|
+
'bg-groupSurface border border-subduedSeparator transition transition-border [&:has(.cm-content:focus)]:border-separator rounded',
|
|
325
343
|
classNames,
|
|
326
344
|
)}
|
|
327
345
|
>
|
|
328
|
-
<
|
|
329
|
-
<ChatStatusIndicator preset={preset} error={
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
346
|
+
<div role='none' className='flex p-2 gap-2'>
|
|
347
|
+
<ChatStatusIndicator classNames='p-1' preset={preset} error={error} processing={streaming} />
|
|
348
|
+
<ChatEditor
|
|
349
|
+
ref={editorRef}
|
|
350
|
+
autoFocus
|
|
351
|
+
lineWrapping
|
|
352
|
+
classNames='col-span-2 pbs-0.5'
|
|
353
|
+
placeholder={placeholder ?? t('prompt placeholder')}
|
|
354
|
+
extensions={extensions}
|
|
355
|
+
onSubmit={handleSubmit}
|
|
356
|
+
/>
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
{db && settings && (
|
|
360
|
+
<div role='none' className='flex items-center overflow-hidden'>
|
|
361
|
+
<ChatOptions
|
|
362
|
+
db={db}
|
|
363
|
+
blueprintRegistry={processor.blueprintRegistry}
|
|
364
|
+
context={processor.context}
|
|
365
|
+
preset={preset}
|
|
366
|
+
presets={presets}
|
|
367
|
+
onPresetChange={onPresetChange}
|
|
368
|
+
/>
|
|
369
|
+
|
|
370
|
+
<div role='none' className='flex grow overflow-x-auto scrollbar-none'>
|
|
371
|
+
<ChatReferences db={db} context={processor.context} />
|
|
372
|
+
</div>
|
|
373
|
+
|
|
374
|
+
<ChatActions
|
|
375
|
+
classNames='col-span-2'
|
|
376
|
+
microphone={true}
|
|
377
|
+
recording={recording}
|
|
378
|
+
processing={streaming}
|
|
379
|
+
onEvent={handleEvent}
|
|
380
|
+
>
|
|
381
|
+
{/* TODO(burdon): Move offline switch into dialog. */}
|
|
382
|
+
{online !== undefined && (
|
|
383
|
+
<Input.Root>
|
|
384
|
+
<Input.Label srOnly>{t('online switch label')}</Input.Label>
|
|
385
|
+
<Input.Switch classNames='mli-2' checked={online} onCheckedChange={onOnlineChange} />
|
|
386
|
+
</Input.Root>
|
|
387
|
+
)}
|
|
388
|
+
</ChatActions>
|
|
389
|
+
</div>
|
|
390
|
+
)}
|
|
372
391
|
</div>
|
|
373
392
|
);
|
|
374
393
|
};
|
|
375
394
|
|
|
376
395
|
ChatPrompt.displayName = 'Chat.Prompt';
|
|
377
396
|
|
|
397
|
+
//
|
|
398
|
+
// Toolbar
|
|
399
|
+
//
|
|
400
|
+
|
|
401
|
+
type ChatToolbarProps = ThemedClassName<{ companionTo?: Obj.Unknown }>;
|
|
402
|
+
|
|
403
|
+
const ChatToolbar = ({ classNames, companionTo }: ChatToolbarProps) => {
|
|
404
|
+
const { chat } = useChatContext(ChatToolbar.displayName);
|
|
405
|
+
const menu = useChatToolbarActions({ chat, companionTo });
|
|
406
|
+
|
|
407
|
+
return (
|
|
408
|
+
<MenuProvider
|
|
409
|
+
{...menu}
|
|
410
|
+
attendableId={companionTo ? Obj.getDXN(companionTo).toString() : chat ? Obj.getDXN(chat).toString() : ''}
|
|
411
|
+
>
|
|
412
|
+
<ToolbarMenu classNames={classNames} textBlockWidth />
|
|
413
|
+
</MenuProvider>
|
|
414
|
+
);
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
ChatToolbar.displayName = 'Chat.Toolbar';
|
|
418
|
+
|
|
378
419
|
//
|
|
379
420
|
// Chat
|
|
380
421
|
//
|
|
381
422
|
|
|
382
423
|
export const Chat = {
|
|
383
424
|
Root: ChatRoot,
|
|
425
|
+
Viewport: ChatViewport,
|
|
384
426
|
Thread: ChatThread,
|
|
385
427
|
Prompt: ChatPrompt,
|
|
428
|
+
Toolbar: ChatToolbar,
|
|
386
429
|
};
|
|
387
430
|
|
|
388
|
-
export type { ChatRootProps, ChatThreadProps, ChatPromptProps, ChatEvent };
|
|
431
|
+
export type { ChatRootProps, ChatViewportProps, ChatThreadProps, ChatPromptProps, ChatToolbarProps, ChatEvent };
|
|
@@ -19,6 +19,9 @@ export type ChatEvent =
|
|
|
19
19
|
type: 'submit';
|
|
20
20
|
text: string;
|
|
21
21
|
}
|
|
22
|
+
| {
|
|
23
|
+
type: 'retry';
|
|
24
|
+
}
|
|
22
25
|
| {
|
|
23
26
|
type: 'cancel';
|
|
24
27
|
}
|
|
@@ -28,14 +31,24 @@ export type ChatEvent =
|
|
|
28
31
|
}
|
|
29
32
|
| {
|
|
30
33
|
type: 'add';
|
|
31
|
-
object: Obj.
|
|
34
|
+
object: Obj.Unknown;
|
|
32
35
|
}
|
|
33
36
|
//
|
|
34
37
|
// UX
|
|
35
38
|
//
|
|
39
|
+
| {
|
|
40
|
+
type: 'update-prompt';
|
|
41
|
+
text: string;
|
|
42
|
+
}
|
|
36
43
|
| {
|
|
37
44
|
type: 'scroll-to-bottom';
|
|
38
45
|
}
|
|
46
|
+
| {
|
|
47
|
+
type: 'nav-previous';
|
|
48
|
+
}
|
|
49
|
+
| {
|
|
50
|
+
type: 'nav-next';
|
|
51
|
+
}
|
|
39
52
|
| {
|
|
40
53
|
type: 'thread-open';
|
|
41
54
|
}
|