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