@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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { type Database, type Type } from '@dxos/echo';
|
|
9
|
+
import { EntityKind, SystemTypeAnnotation, getTypeAnnotation } from '@dxos/echo/internal';
|
|
10
|
+
|
|
11
|
+
// TODO(burdon): Pass in filter.
|
|
12
|
+
// TODO(wittjosiah): Factor out.
|
|
13
|
+
export const useFilteredTypes = (db?: Database.Database): Type.AnyEntity[] => {
|
|
14
|
+
const [types, setTypes] = useState<Type.AnyEntity[]>([]);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!db) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return db.schemaRegistry.query({ location: ['database', 'runtime'] }).subscribe(
|
|
21
|
+
(query) => {
|
|
22
|
+
const types = Array.from(
|
|
23
|
+
new Set(
|
|
24
|
+
query.results
|
|
25
|
+
.filter((schema) => getTypeAnnotation(schema)?.kind !== EntityKind.Relation)
|
|
26
|
+
.filter((schema) => SystemTypeAnnotation.get(schema).pipe(Option.getOrElse(() => false))),
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
setTypes(types);
|
|
31
|
+
},
|
|
32
|
+
{ fire: true },
|
|
33
|
+
);
|
|
34
|
+
}, [db]);
|
|
35
|
+
|
|
36
|
+
return types;
|
|
37
|
+
};
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, useCapabilities } from '@dxos/app-framework';
|
|
8
7
|
import { type Space } from '@dxos/client/echo';
|
|
9
8
|
import { Filter, Obj } from '@dxos/echo';
|
|
10
9
|
import { type ReferencesProvider } from '@dxos/react-ui-chat';
|
|
@@ -13,8 +12,6 @@ import { type ReferencesProvider } from '@dxos/react-ui-chat';
|
|
|
13
12
|
* Resolve references to objects in the space.
|
|
14
13
|
*/
|
|
15
14
|
export const useReferencesProvider = (space?: Space): ReferencesProvider | undefined => {
|
|
16
|
-
const blueprints = useCapabilities(Capabilities.BlueprintDefinition);
|
|
17
|
-
|
|
18
15
|
return useMemo<ReferencesProvider | undefined>((): ReferencesProvider | undefined => {
|
|
19
16
|
if (!space) {
|
|
20
17
|
return undefined;
|
|
@@ -24,11 +21,11 @@ export const useReferencesProvider = (space?: Space): ReferencesProvider | undef
|
|
|
24
21
|
getReferences: async ({ query }) => {
|
|
25
22
|
// TODO(burdon): Previously we filtered by types declared by the artifact definitions.
|
|
26
23
|
// const schemas = blueprints.map((blueprint) => blueprint.schema).flat();
|
|
27
|
-
// const
|
|
24
|
+
// const objects = await space.db
|
|
28
25
|
// .query(Filter.or(...schemas.map((schema) => Filter.type(schema as Type.Schema))))
|
|
29
26
|
// .run();
|
|
30
27
|
|
|
31
|
-
const
|
|
28
|
+
const objects = await space.db.query(Filter.everything()).run();
|
|
32
29
|
|
|
33
30
|
return (
|
|
34
31
|
objects
|
|
@@ -39,7 +36,7 @@ export const useReferencesProvider = (space?: Space): ReferencesProvider | undef
|
|
|
39
36
|
// })
|
|
40
37
|
.filter((object) => stringMatch(query, Obj.getLabel(object as any) ?? ''))
|
|
41
38
|
// TODO(dmaretskyi): `Type.getDXN` (at the point of writing) didn't work here as it was schema-only.
|
|
42
|
-
.filter((object) => !!Obj.getDXN(object as Obj.
|
|
39
|
+
.filter((object) => !!Obj.getDXN(object as Obj.Unknown))
|
|
43
40
|
.map((object) => ({
|
|
44
41
|
uri: Obj.getDXN(object as any).toString(),
|
|
45
42
|
label: Obj.getLabel(object as any) ?? '',
|
|
@@ -47,11 +44,11 @@ export const useReferencesProvider = (space?: Space): ReferencesProvider | undef
|
|
|
47
44
|
);
|
|
48
45
|
},
|
|
49
46
|
resolveReference: async ({ uri }) => {
|
|
50
|
-
const object = await space.db.query(Filter.
|
|
47
|
+
const object = await space.db.query(Filter.id(uri)).first();
|
|
51
48
|
return { uri, label: Obj.getLabel(object) ?? '' };
|
|
52
49
|
},
|
|
53
50
|
} satisfies ReferencesProvider;
|
|
54
|
-
}, [space
|
|
51
|
+
}, [space]);
|
|
55
52
|
};
|
|
56
53
|
|
|
57
54
|
const stringMatch = (query: string, label: string) => label.toLowerCase().startsWith(query.toLowerCase());
|
package/src/index.ts
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
export * from './blueprints';
|
|
5
6
|
export * from './capabilities';
|
|
6
7
|
export * from './components';
|
|
7
|
-
export * from './
|
|
8
|
+
export * from './hooks';
|
|
8
9
|
export * from './meta';
|
|
10
|
+
export * from './translations';
|
|
9
11
|
export * from './types';
|
|
10
12
|
|
|
11
13
|
export * from './AssistantPlugin';
|
package/src/meta.ts
CHANGED
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
6
7
|
|
|
7
|
-
export const meta:
|
|
8
|
+
export const meta: Plugin.Meta = {
|
|
8
9
|
id: 'dxos.org/plugin/assistant',
|
|
9
10
|
name: 'Assistant',
|
|
10
|
-
description:
|
|
11
|
+
description: trim`
|
|
12
|
+
Intelligent AI assistant that can analyze and interact with objects across your spaces.
|
|
13
|
+
Chat naturally to get insights, search content, and perform actions using AI-powered context awareness.
|
|
14
|
+
`,
|
|
11
15
|
icon: 'ph--atom--regular',
|
|
16
|
+
iconHue: 'sky',
|
|
12
17
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-assistant',
|
|
13
18
|
tags: ['labs'],
|
|
14
19
|
};
|
package/src/processor/index.ts
CHANGED
package/src/processor/presets.ts
CHANGED
|
@@ -10,31 +10,24 @@ import * as Layer from 'effect/Layer';
|
|
|
10
10
|
import * as Schema from 'effect/Schema';
|
|
11
11
|
|
|
12
12
|
import { AiService } from '@dxos/ai';
|
|
13
|
+
import { GenericToolkit } from '@dxos/ai';
|
|
13
14
|
import { AiServiceTestingPreset } from '@dxos/ai/testing';
|
|
14
|
-
import { AiConversation,
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
QueueService,
|
|
21
|
-
TracingService,
|
|
22
|
-
} from '@dxos/functions';
|
|
23
|
-
import { TestDatabaseLayer } from '@dxos/functions/testing';
|
|
24
|
-
import { type DataType } from '@dxos/schema';
|
|
15
|
+
import { AiConversation, ToolExecutionServices } from '@dxos/assistant';
|
|
16
|
+
import { acquireReleaseResource } from '@dxos/effect';
|
|
17
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
18
|
+
import { CredentialsService, QueueService, TracingService } from '@dxos/functions';
|
|
19
|
+
import { FunctionInvocationServiceLayerTestMocked, TestDatabaseLayer } from '@dxos/functions-runtime/testing';
|
|
20
|
+
import { type Message } from '@dxos/types';
|
|
25
21
|
|
|
26
22
|
import { AiChatProcessor, type AiChatServices } from './processor';
|
|
27
23
|
|
|
28
|
-
|
|
24
|
+
const TestToolkit = Toolkit.make(
|
|
29
25
|
Tool.make('random', {
|
|
30
26
|
description: 'Random number generator',
|
|
31
27
|
parameters: {},
|
|
32
28
|
success: Schema.Number,
|
|
33
29
|
}),
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
// TODO(burdon): Create minimal toolkit.
|
|
37
|
-
const toolkit = Toolkit.merge(TestToolkit) as Toolkit.Toolkit<any>;
|
|
30
|
+
);
|
|
38
31
|
|
|
39
32
|
// TODO(burdon): Explain structure.
|
|
40
33
|
const TestServicesLayer = Layer.mergeAll(
|
|
@@ -45,29 +38,28 @@ const TestServicesLayer = Layer.mergeAll(
|
|
|
45
38
|
// types: [],
|
|
46
39
|
}),
|
|
47
40
|
// CredentialsService.configuredLayer([{ service: 'exa.ai', apiKey: EXA_API_KEY }]),
|
|
48
|
-
|
|
49
|
-
Layer.provideMerge(ComputeEventLogger.layerFromTracing),
|
|
50
|
-
Layer.provideMerge(TracingService.layerNoop),
|
|
51
|
-
),
|
|
41
|
+
FunctionInvocationServiceLayerTestMocked({ functions: [] }).pipe(Layer.provideMerge(TracingService.layerNoop)),
|
|
52
42
|
);
|
|
53
43
|
|
|
54
44
|
const TestLayer: Layer.Layer<AiChatServices, never, never> = Layer.mergeAll(
|
|
55
45
|
AiService.model('@anthropic/claude-opus-4-0'),
|
|
56
|
-
|
|
57
|
-
makeToolExecutionServiceFromFunctions(toolkit, toolkit.toLayer({}) as any),
|
|
46
|
+
ToolExecutionServices,
|
|
58
47
|
CredentialsService.layerFromDatabase(),
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
).pipe(
|
|
49
|
+
Layer.provideMerge(GenericToolkit.providerLayer(GenericToolkit.make(TestToolkit, TestToolkit.toLayer({} as any)))),
|
|
50
|
+
Layer.provideMerge(TestServicesLayer),
|
|
51
|
+
Layer.orDie,
|
|
52
|
+
);
|
|
61
53
|
|
|
62
54
|
// TODO(burdon): Create actual test with mock LLM.
|
|
63
55
|
describe('Chat processor', () => {
|
|
64
|
-
it.
|
|
56
|
+
it.scoped(
|
|
65
57
|
'basic',
|
|
66
58
|
Effect.fn(
|
|
67
59
|
function* ({ expect }) {
|
|
68
60
|
const services = yield* Effect.runtime<AiChatServices>();
|
|
69
|
-
const queue = yield* QueueService.createQueue<
|
|
70
|
-
const conversation = new AiConversation({ queue });
|
|
61
|
+
const queue = yield* QueueService.createQueue<Message.Message>();
|
|
62
|
+
const conversation = yield* acquireReleaseResource(() => new AiConversation({ queue }));
|
|
71
63
|
const processor = new AiChatProcessor(conversation, async () => services);
|
|
72
64
|
const result = yield* Effect.promise(() => processor.request({ message: 'Hello' }));
|
|
73
65
|
void processor.cancel();
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import type * as Tool from '@effect/ai/Tool';
|
|
6
|
+
import { Atom, Registry } from '@effect-atom/atom-react';
|
|
6
7
|
import * as Cause from 'effect/Cause';
|
|
7
8
|
import * as Effect from 'effect/Effect';
|
|
8
9
|
import * as Exit from 'effect/Exit';
|
|
@@ -19,32 +20,33 @@ import {
|
|
|
19
20
|
type ToolResolverService,
|
|
20
21
|
} from '@dxos/ai';
|
|
21
22
|
import {
|
|
23
|
+
AiContextService,
|
|
22
24
|
type AiConversation,
|
|
23
|
-
type
|
|
24
|
-
AiSession,
|
|
25
|
+
type AiConversationRunProps,
|
|
25
26
|
ArtifactDiffResolver,
|
|
26
27
|
GenerationObserver,
|
|
27
28
|
createSystemPrompt,
|
|
28
29
|
} from '@dxos/assistant';
|
|
30
|
+
import { formatSystemPrompt } from '@dxos/assistant';
|
|
31
|
+
import { type Chat } from '@dxos/assistant-toolkit';
|
|
29
32
|
import { type Blueprint } from '@dxos/blueprints';
|
|
30
33
|
import { Obj } from '@dxos/echo';
|
|
31
|
-
import {
|
|
34
|
+
import { type Database } from '@dxos/echo';
|
|
35
|
+
import { runAndForwardErrors, throwCause, unwrapExit } from '@dxos/effect';
|
|
32
36
|
import {
|
|
33
37
|
type CredentialsService,
|
|
34
|
-
type DatabaseService,
|
|
35
38
|
type FunctionInvocationService,
|
|
36
39
|
type QueueService,
|
|
37
40
|
type TracingService,
|
|
38
41
|
} from '@dxos/functions';
|
|
39
42
|
import { log } from '@dxos/log';
|
|
40
|
-
import { type ContentBlock,
|
|
41
|
-
import { trim } from '@dxos/util';
|
|
43
|
+
import { type ContentBlock, Message } from '@dxos/types';
|
|
42
44
|
|
|
43
|
-
import {
|
|
45
|
+
import { updateName } from './update-name';
|
|
44
46
|
|
|
45
47
|
export type AiChatServices =
|
|
46
48
|
| CredentialsService
|
|
47
|
-
|
|
|
49
|
+
| Database.Service
|
|
48
50
|
| QueueService
|
|
49
51
|
| FunctionInvocationService
|
|
50
52
|
| AiService.AiService
|
|
@@ -58,7 +60,7 @@ export type AiChatProcessorOptions = {
|
|
|
58
60
|
blueprintRegistry?: Blueprint.Registry;
|
|
59
61
|
observableRegistry?: Registry.Registry;
|
|
60
62
|
extensions?: ToolContextExtensions;
|
|
61
|
-
} & Pick<
|
|
63
|
+
} & Pick<AiConversationRunProps, 'system'>;
|
|
62
64
|
|
|
63
65
|
const defaultOptions: Partial<AiChatProcessorOptions> = {
|
|
64
66
|
model: DEFAULT_EDGE_MODEL,
|
|
@@ -77,39 +79,34 @@ export type AiRequest = {
|
|
|
77
79
|
* Handles streaming responses from the conversation.
|
|
78
80
|
*/
|
|
79
81
|
export class AiChatProcessor {
|
|
80
|
-
private readonly
|
|
82
|
+
private readonly _registry: Registry.Registry;
|
|
81
83
|
|
|
82
84
|
/** External observer. */
|
|
83
85
|
private readonly _observer: GenerationObserver;
|
|
84
86
|
|
|
87
|
+
/** Pending messages (incl. the current user request). */
|
|
88
|
+
private readonly _pending = Atom.make<Message.Message[]>([]);
|
|
89
|
+
|
|
90
|
+
/** Currently streaming message (from the AI service). */
|
|
91
|
+
private readonly _streaming = Atom.make<Message.Message[]>([]);
|
|
92
|
+
|
|
85
93
|
/** Currently active request fiber. */
|
|
86
94
|
private _fiber: Fiber.Fiber<void, any> | undefined;
|
|
87
95
|
|
|
88
96
|
/** Last request (for retries). */
|
|
89
97
|
private _lastRequest: AiRequest | undefined;
|
|
90
98
|
|
|
91
|
-
/** Pending messages (incl. the current user request). */
|
|
92
|
-
private readonly _pending = Rx.make<DataType.Message[]>([]);
|
|
93
|
-
|
|
94
|
-
/** Currently streaming message (from the AI service). */
|
|
95
|
-
private readonly _streaming = Rx.make<Option.Option<DataType.Message>>(Option.none());
|
|
96
|
-
|
|
97
99
|
/** Streaming state. */
|
|
98
|
-
public readonly streaming =
|
|
100
|
+
public readonly streaming = Atom.make<boolean>((get) => get(this._streaming).length > 0);
|
|
99
101
|
|
|
100
102
|
/** Active state. */
|
|
101
|
-
public readonly active =
|
|
103
|
+
public readonly active = Atom.make(false);
|
|
102
104
|
|
|
103
105
|
/** Array of Messages (incl. the current message being streamed). */
|
|
104
|
-
public readonly messages =
|
|
105
|
-
Option.match(get(this._streaming), {
|
|
106
|
-
onNone: () => get(this._pending),
|
|
107
|
-
onSome: (streaming) => [...get(this._pending), streaming],
|
|
108
|
-
}),
|
|
109
|
-
);
|
|
106
|
+
public readonly messages = Atom.make<Message.Message[]>((get) => [...get(this._pending), ...get(this._streaming)]);
|
|
110
107
|
|
|
111
108
|
/** Last error. */
|
|
112
|
-
public readonly error =
|
|
109
|
+
public readonly error = Atom.make<Option.Option<Error>>(Option.none());
|
|
113
110
|
|
|
114
111
|
constructor(
|
|
115
112
|
private readonly _conversation: AiConversation,
|
|
@@ -118,7 +115,7 @@ export class AiChatProcessor {
|
|
|
118
115
|
private readonly _options: AiChatProcessorOptions = defaultOptions,
|
|
119
116
|
) {
|
|
120
117
|
// Initialize registries and defaults before using in other logic.
|
|
121
|
-
this.
|
|
118
|
+
this._registry = this._options.observableRegistry ?? Registry.make();
|
|
122
119
|
this._observer = GenerationObserver.make({
|
|
123
120
|
onBlock: this._onBlock,
|
|
124
121
|
onMessage: this._onMessage,
|
|
@@ -141,37 +138,59 @@ export class AiChatProcessor {
|
|
|
141
138
|
return this._options.blueprintRegistry;
|
|
142
139
|
}
|
|
143
140
|
|
|
141
|
+
get system(): string {
|
|
142
|
+
return this._options.system ?? '';
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async getTools(): Promise<Record<string, Tool.Any>> {
|
|
146
|
+
return unwrapExit(await this._conversation.getTools().pipe(await Runtime.runPromiseExit(await this._services())));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
async getSystemPrompt(): Promise<string> {
|
|
150
|
+
return unwrapExit(
|
|
151
|
+
await Effect.gen(this, function* () {
|
|
152
|
+
const blueprints = this.context.getBlueprints();
|
|
153
|
+
const objects = this.context.getObjects();
|
|
154
|
+
const system = yield* formatSystemPrompt({ system: this._options.system, blueprints, objects });
|
|
155
|
+
return system;
|
|
156
|
+
}).pipe(
|
|
157
|
+
Effect.provideService(AiContextService, {
|
|
158
|
+
binder: this.context,
|
|
159
|
+
}),
|
|
160
|
+
await Runtime.runPromiseExit(await this._services()),
|
|
161
|
+
),
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
144
165
|
/**
|
|
145
166
|
* Initiates a new request.
|
|
146
167
|
*/
|
|
147
|
-
async request(
|
|
168
|
+
async request(requestProp: AiRequest): Promise<void> {
|
|
148
169
|
if (this._fiber) {
|
|
149
170
|
await this.cancel();
|
|
150
171
|
}
|
|
151
172
|
|
|
152
173
|
try {
|
|
153
|
-
this._lastRequest =
|
|
154
|
-
this.
|
|
155
|
-
this.
|
|
174
|
+
this._lastRequest = requestProp;
|
|
175
|
+
this._registry.set(this.error, Option.none());
|
|
176
|
+
this._registry.set(this.active, true);
|
|
177
|
+
|
|
178
|
+
const services = await this._services();
|
|
156
179
|
|
|
157
180
|
// Create request.
|
|
158
181
|
const request = this._conversation.createRequest({
|
|
159
182
|
system: this._options.system,
|
|
160
|
-
prompt:
|
|
183
|
+
prompt: requestProp.message,
|
|
161
184
|
observer: this._observer,
|
|
162
185
|
});
|
|
163
186
|
|
|
164
|
-
const runtime = await this._services();
|
|
165
|
-
|
|
166
187
|
// Create fiber.
|
|
167
188
|
this._fiber = request.pipe(
|
|
168
189
|
Effect.provide(AiService.model(this._options.model ?? DEFAULT_EDGE_MODEL)),
|
|
169
|
-
|
|
170
190
|
// TODO(dmaretskyi): Move ArtifactDiffResolver upstream.
|
|
171
191
|
Effect.provideService(ArtifactDiffResolver, this._artifactDiffResolver),
|
|
172
|
-
|
|
173
192
|
Effect.asVoid,
|
|
174
|
-
Runtime.runFork(
|
|
193
|
+
Runtime.runFork(services), // Runs in the background.
|
|
175
194
|
);
|
|
176
195
|
|
|
177
196
|
// Execute request.
|
|
@@ -180,15 +199,15 @@ export class AiChatProcessor {
|
|
|
180
199
|
throwCause(response.cause);
|
|
181
200
|
}
|
|
182
201
|
|
|
183
|
-
this.
|
|
202
|
+
this._registry.set(this.error, Option.none());
|
|
184
203
|
this._lastRequest = undefined;
|
|
185
204
|
this._fiber = undefined;
|
|
186
|
-
} catch (
|
|
187
|
-
log.error('request failed', { error });
|
|
188
|
-
this.
|
|
205
|
+
} catch (err) {
|
|
206
|
+
log.error('request failed', { error: err });
|
|
207
|
+
this._registry.set(this.error, Option.some(new Error('AI service error', { cause: err })));
|
|
189
208
|
} finally {
|
|
209
|
+
this._registry.set(this.active, false);
|
|
190
210
|
this._fiber = undefined;
|
|
191
|
-
this._rx.set(this.active, false);
|
|
192
211
|
}
|
|
193
212
|
}
|
|
194
213
|
|
|
@@ -196,7 +215,7 @@ export class AiChatProcessor {
|
|
|
196
215
|
* Cancels the current request.
|
|
197
216
|
*/
|
|
198
217
|
async cancel(): Promise<void> {
|
|
199
|
-
await
|
|
218
|
+
await runAndForwardErrors(
|
|
200
219
|
Effect.gen(this, function* () {
|
|
201
220
|
if (this._fiber) {
|
|
202
221
|
yield* this._fiber.pipe(Fiber.interrupt);
|
|
@@ -205,7 +224,7 @@ export class AiChatProcessor {
|
|
|
205
224
|
);
|
|
206
225
|
|
|
207
226
|
this._fiber = undefined;
|
|
208
|
-
this.
|
|
227
|
+
this._registry.set(this.active, false);
|
|
209
228
|
}
|
|
210
229
|
|
|
211
230
|
/**
|
|
@@ -220,35 +239,9 @@ export class AiChatProcessor {
|
|
|
220
239
|
/**
|
|
221
240
|
* Update the current chat's name.
|
|
222
241
|
*/
|
|
223
|
-
async updateName(chat:
|
|
242
|
+
async updateName(chat: Chat.Chat): Promise<void> {
|
|
224
243
|
const runtime = await this._services();
|
|
225
|
-
|
|
226
|
-
const system = trim`
|
|
227
|
-
It is extremely important that you respond only with the title and nothing else.
|
|
228
|
-
If you cannot do this effectively respond with "New Chat".
|
|
229
|
-
`;
|
|
230
|
-
|
|
231
|
-
const history = await this._conversation.getHistory();
|
|
232
|
-
const fiber = Effect.gen(this, function* () {
|
|
233
|
-
const session = new AiSession();
|
|
234
|
-
return yield* session.run({ system, prompt: 'Suggest a name for this chat', history });
|
|
235
|
-
}).pipe(
|
|
236
|
-
// TODO(burdon): Use simpler model.
|
|
237
|
-
Effect.provide(AiService.model(this._options.model ?? DEFAULT_EDGE_MODEL)),
|
|
238
|
-
Effect.tap((messages) => {
|
|
239
|
-
const message = messages.find((message) => message.sender.role === 'assistant');
|
|
240
|
-
const title = message?.blocks.find((b) => b._tag === 'text')?.text;
|
|
241
|
-
if (title) {
|
|
242
|
-
chat.name = title;
|
|
243
|
-
}
|
|
244
|
-
}),
|
|
245
|
-
Runtime.runFork(runtime), // Run in the background.
|
|
246
|
-
);
|
|
247
|
-
|
|
248
|
-
const response = await fiber.pipe(Fiber.join, Effect.runPromiseExit);
|
|
249
|
-
if (!Exit.isSuccess(response)) {
|
|
250
|
-
throwCause(response.cause);
|
|
251
|
-
}
|
|
244
|
+
await updateName(runtime, this._conversation, chat, this._options.model);
|
|
252
245
|
}
|
|
253
246
|
|
|
254
247
|
// TODO(burdon): Fix/factor out.
|
|
@@ -259,7 +252,7 @@ export class AiChatProcessor {
|
|
|
259
252
|
// artifacts.map(async (artifact) => {
|
|
260
253
|
// const {
|
|
261
254
|
// objects: [object],
|
|
262
|
-
// } = await space.db.query(Filter.
|
|
255
|
+
// } = await space.db.query(Filter.id(artifact.id)).run();
|
|
263
256
|
// if (!object) {
|
|
264
257
|
// return;
|
|
265
258
|
// }
|
|
@@ -275,29 +268,29 @@ export class AiChatProcessor {
|
|
|
275
268
|
},
|
|
276
269
|
};
|
|
277
270
|
|
|
278
|
-
|
|
279
|
-
function* (this: AiChatProcessor, message: DataType.Message) {
|
|
280
|
-
this._rx.set(this._streaming, Option.none());
|
|
281
|
-
this._rx.update(this._pending, (pending) => [...pending, message]);
|
|
282
|
-
}.bind(this),
|
|
283
|
-
);
|
|
284
|
-
|
|
271
|
+
// TODO(dmaretskyi): Due to the way effect streams do buffering, we cannot rely on _onBlock and _onMessage to be called in order.
|
|
285
272
|
private _onBlock = Effect.fn(
|
|
286
273
|
function* (this: AiChatProcessor, block: ContentBlock.Any) {
|
|
287
|
-
this.
|
|
288
|
-
const blocks = streaming.
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
Obj.make(DataType.Message, {
|
|
274
|
+
this._registry.update(this._streaming, (streaming) => {
|
|
275
|
+
const blocks = streaming.filter((message) => message.blocks.every((block) => !block.pending));
|
|
276
|
+
|
|
277
|
+
// AiSession emits a message per each assistant content-block, so we do the same.
|
|
278
|
+
return [
|
|
279
|
+
...blocks,
|
|
280
|
+
Obj.make(Message.Message, {
|
|
295
281
|
created: new Date().toISOString(),
|
|
296
282
|
sender: { role: 'assistant' },
|
|
297
|
-
blocks: [
|
|
283
|
+
blocks: [block],
|
|
298
284
|
}),
|
|
299
|
-
|
|
285
|
+
];
|
|
300
286
|
});
|
|
301
287
|
}.bind(this),
|
|
302
288
|
);
|
|
289
|
+
|
|
290
|
+
private _onMessage = Effect.fn(
|
|
291
|
+
function* (this: AiChatProcessor, message: Message.Message) {
|
|
292
|
+
this._registry.set(this._streaming, []);
|
|
293
|
+
this._registry.update(this._pending, (pending) => [...pending, message]);
|
|
294
|
+
}.bind(this),
|
|
295
|
+
);
|
|
303
296
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Exit from 'effect/Exit';
|
|
7
|
+
import * as Fiber from 'effect/Fiber';
|
|
8
|
+
import * as Runtime from 'effect/Runtime';
|
|
9
|
+
|
|
10
|
+
import { AiService, DEFAULT_EDGE_MODEL, type ModelName } from '@dxos/ai';
|
|
11
|
+
import { type AiConversation, AiSession } from '@dxos/assistant';
|
|
12
|
+
import { type Chat } from '@dxos/assistant-toolkit';
|
|
13
|
+
import { Obj } from '@dxos/echo';
|
|
14
|
+
import { throwCause } from '@dxos/effect';
|
|
15
|
+
import { trim } from '@dxos/util';
|
|
16
|
+
|
|
17
|
+
import { type AiChatServices } from './processor';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Update the current chat's name.
|
|
21
|
+
*/
|
|
22
|
+
// TODO(burdon): Convert this into a plugin tool.
|
|
23
|
+
export const updateName = async (
|
|
24
|
+
runtime: Runtime.Runtime<AiChatServices>,
|
|
25
|
+
conversation: AiConversation,
|
|
26
|
+
chat: Chat.Chat,
|
|
27
|
+
model: ModelName = DEFAULT_EDGE_MODEL,
|
|
28
|
+
): Promise<void> => {
|
|
29
|
+
const history = await conversation.getHistory();
|
|
30
|
+
const system = trim`
|
|
31
|
+
It is extremely important that you respond only with the title and nothing else.
|
|
32
|
+
If you cannot do this effectively respond with "New Chat".
|
|
33
|
+
`;
|
|
34
|
+
const prompt = 'Suggest a name for this chat';
|
|
35
|
+
|
|
36
|
+
const fiber = Effect.gen(this, function* () {
|
|
37
|
+
const session = new AiSession();
|
|
38
|
+
return yield* session.run({ system, prompt, history });
|
|
39
|
+
}).pipe(
|
|
40
|
+
Effect.provide(AiService.model(model)),
|
|
41
|
+
Effect.tap((messages) => {
|
|
42
|
+
// TODO(burdon): Parse response (should update via tool).
|
|
43
|
+
const message = messages.find((message) => message.sender.role === 'assistant');
|
|
44
|
+
const title = message?.blocks.find((block) => block._tag === 'text')?.text;
|
|
45
|
+
if (title) {
|
|
46
|
+
Obj.change(chat, (c) => {
|
|
47
|
+
c.name = title;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}),
|
|
51
|
+
Runtime.runFork(runtime), // Run in the background.
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const response = await fiber.pipe(Fiber.join, Effect.runPromiseExit);
|
|
55
|
+
if (!Exit.isSuccess(response)) {
|
|
56
|
+
throwCause(response.cause);
|
|
57
|
+
}
|
|
58
|
+
};
|
package/src/queue-logger.ts
CHANGED
|
@@ -5,14 +5,10 @@
|
|
|
5
5
|
import { type Queue, Ref, type Space, getSpace } from '@dxos/client/echo';
|
|
6
6
|
import { type Sequence, type SequenceEvent, type SequenceLogger } from '@dxos/conductor';
|
|
7
7
|
import { DXN, Key, Obj } from '@dxos/echo';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
InvocationTraceEventType,
|
|
13
|
-
InvocationTraceStartEvent,
|
|
14
|
-
TraceEvent,
|
|
15
|
-
} from '@dxos/functions';
|
|
8
|
+
import { InvocationTraceEndEvent, InvocationTraceEventType, InvocationTraceStartEvent } from '@dxos/functions-runtime';
|
|
9
|
+
import { TraceEvent } from '@dxos/functions-runtime';
|
|
10
|
+
import { InvocationOutcome } from '@dxos/functions-runtime';
|
|
11
|
+
import { type InvocationTraceEvent } from '@dxos/functions-runtime';
|
|
16
12
|
import { invariant } from '@dxos/invariant';
|
|
17
13
|
import { QueueSubspaceTags } from '@dxos/keys';
|
|
18
14
|
|
|
@@ -27,7 +23,10 @@ export class QueueLogger implements SequenceLogger {
|
|
|
27
23
|
let dxn = this._space.properties.invocationTraceQueue?.dxn;
|
|
28
24
|
if (!dxn) {
|
|
29
25
|
dxn = DXN.fromQueue(QueueSubspaceTags.TRACE, this._space.id, Key.ObjectId.random());
|
|
30
|
-
|
|
26
|
+
const newDxn = dxn;
|
|
27
|
+
Obj.change(this._space.properties, (p) => {
|
|
28
|
+
p.invocationTraceQueue = Ref.fromDXN(newDxn);
|
|
29
|
+
});
|
|
31
30
|
}
|
|
32
31
|
this._invocationTraceQueue = this._space.queues.get(dxn);
|
|
33
32
|
}
|