@dxos/plugin-assistant 0.8.4-main.ead640a → 0.8.4-main.effb148878
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/AgentArticle-UPXYXYFJ.mjs +166 -0
- package/dist/lib/neutral/AgentArticle-UPXYXYFJ.mjs.map +7 -0
- package/dist/lib/neutral/AgentProperties-W6LD56IB.mjs +40 -0
- package/dist/lib/neutral/AgentProperties-W6LD56IB.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.mjs +10 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs +62 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.workerd.mjs +40 -0
- package/dist/lib/neutral/AssistantPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/AssistantSettings-GG52BLKS.mjs +40 -0
- package/dist/lib/neutral/AssistantSettings-GG52BLKS.mjs.map +7 -0
- package/dist/lib/neutral/BlueprintArticle-U7LUBFOS.mjs +27 -0
- package/dist/lib/neutral/BlueprintArticle-U7LUBFOS.mjs.map +7 -0
- package/dist/lib/neutral/ChatArticle-WVAFZPVI.mjs +8 -0
- package/dist/lib/neutral/ChatCompanion-PA5WC4ND.mjs +133 -0
- package/dist/lib/neutral/ChatCompanion-PA5WC4ND.mjs.map +7 -0
- package/dist/lib/neutral/ChatDialog-QKZLG7SQ.mjs +72 -0
- package/dist/lib/neutral/ChatDialog-QKZLG7SQ.mjs.map +7 -0
- package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs +28 -0
- package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs.map +7 -0
- package/dist/lib/neutral/RoutineArticle-HWB5ZQ6O.mjs +119 -0
- package/dist/lib/neutral/RoutineArticle-HWB5ZQ6O.mjs.map +7 -0
- package/dist/lib/neutral/RoutineList-SO5ETHNT.mjs +48 -0
- package/dist/lib/neutral/RoutineList-SO5ETHNT.mjs.map +7 -0
- package/dist/lib/neutral/RoutineProperties-FISLMW2R.mjs +17 -0
- package/dist/lib/neutral/RoutineProperties-FISLMW2R.mjs.map +7 -0
- package/dist/lib/neutral/TracePanel-75DMDJEB.mjs +136 -0
- package/dist/lib/neutral/TracePanel-75DMDJEB.mjs.map +7 -0
- package/dist/lib/neutral/TriggerStatus-WTFYUIG5.mjs +92 -0
- package/dist/lib/neutral/TriggerStatus-WTFYUIG5.mjs.map +7 -0
- package/dist/lib/neutral/ai-context-ERNAJDGG.mjs +42 -0
- package/dist/lib/neutral/ai-context-ERNAJDGG.mjs.map +7 -0
- package/dist/lib/neutral/ai-service-7SQH5S4F.mjs +34 -0
- package/dist/lib/neutral/ai-service-7SQH5S4F.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-VBWAKZE5.mjs +199 -0
- package/dist/lib/neutral/app-graph-builder-VBWAKZE5.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-VXJYQ5AE.mjs +32 -0
- package/dist/lib/neutral/blueprint-definition-VXJYQ5AE.mjs.map +7 -0
- package/dist/lib/neutral/blueprints/index.mjs +8 -0
- package/dist/lib/neutral/capabilities/index.mjs +37 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-5H6UJHLF.mjs +30 -0
- package/dist/lib/neutral/chunk-5H6UJHLF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-6UMJI6ON.mjs +110 -0
- package/dist/lib/neutral/chunk-6UMJI6ON.mjs.map +7 -0
- package/dist/lib/neutral/chunk-CJXRQ2YX.mjs +386 -0
- package/dist/lib/neutral/chunk-CJXRQ2YX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-JUCBGMF3.mjs +8 -0
- package/dist/lib/neutral/chunk-JUCBGMF3.mjs.map +7 -0
- package/dist/lib/neutral/chunk-SLIPV6NN.mjs +106 -0
- package/dist/lib/neutral/chunk-SLIPV6NN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZWY6Y5IW.mjs +41 -0
- package/dist/lib/neutral/chunk-ZWY6Y5IW.mjs.map +7 -0
- package/dist/lib/neutral/companion-chat-provisioner-7RTSXL6M.mjs +116 -0
- package/dist/lib/neutral/companion-chat-provisioner-7RTSXL6M.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +2373 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +29 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-chat-QQZURUBW.mjs +71 -0
- package/dist/lib/neutral/create-chat-QQZURUBW.mjs.map +7 -0
- package/dist/lib/neutral/create-object-XPVVVEKF.mjs +89 -0
- package/dist/lib/neutral/create-object-XPVVVEKF.mjs.map +7 -0
- package/dist/lib/neutral/edge-model-resolver-XDNBZ3US.mjs +21 -0
- package/dist/lib/neutral/edge-model-resolver-XDNBZ3US.mjs.map +7 -0
- package/dist/lib/neutral/ensure-companion-chat-AMOF3C66.mjs +58 -0
- package/dist/lib/neutral/ensure-companion-chat-AMOF3C66.mjs.map +7 -0
- package/dist/lib/neutral/execution-graph/index.mjs +658 -0
- package/dist/lib/neutral/execution-graph/index.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +952 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +32 -0
- package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs +24 -0
- package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs.map +7 -0
- package/dist/lib/neutral/markdown-KTBFOMFM.mjs +110 -0
- package/dist/lib/neutral/markdown-KTBFOMFM.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +12 -0
- package/dist/lib/neutral/migrations-7DEMVBOG.mjs +28 -0
- package/dist/lib/neutral/migrations-7DEMVBOG.mjs.map +7 -0
- package/dist/lib/neutral/on-create-space-Q2R7OSP6.mjs +19 -0
- package/dist/lib/neutral/on-create-space-Q2R7OSP6.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-SF36MOB5.mjs +13 -0
- package/dist/lib/neutral/operation-handler-SF36MOB5.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-CC6J7D4K.mjs +174 -0
- package/dist/lib/neutral/react-surface-CC6J7D4K.mjs.map +7 -0
- package/dist/lib/neutral/resolve-navigation-targets-ZHIMMH7L.mjs +22 -0
- package/dist/lib/neutral/resolve-navigation-targets-ZHIMMH7L.mjs.map +7 -0
- package/dist/lib/neutral/run-prompt-in-new-chat-KPXN5YJ2.mjs +102 -0
- package/dist/lib/neutral/run-prompt-in-new-chat-KPXN5YJ2.mjs.map +7 -0
- package/dist/lib/neutral/set-current-chat-VWBPSIMZ.mjs +48 -0
- package/dist/lib/neutral/set-current-chat-VWBPSIMZ.mjs.map +7 -0
- package/dist/lib/neutral/settings-W4BLWQ53.mjs +28 -0
- package/dist/lib/neutral/settings-W4BLWQ53.mjs.map +7 -0
- package/dist/lib/neutral/state-H3G7QCU6.mjs +28 -0
- package/dist/lib/neutral/state-H3G7QCU6.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/testing.mjs.map +7 -0
- package/dist/lib/neutral/toggle-trace-panel-debug-JGTB6KVJ.mjs +21 -0
- package/dist/lib/neutral/toggle-trace-panel-debug-JGTB6KVJ.mjs.map +7 -0
- package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs +14 -0
- package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +175 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +20 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/update-chat-name-ENXRUMDJ.mjs +54 -0
- package/dist/lib/neutral/update-chat-name-ENXRUMDJ.mjs.map +7 -0
- package/dist/types/src/AssistantPlugin.d.ts +3 -1
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/AssistantPlugin.node.d.ts +4 -0
- package/dist/types/src/AssistantPlugin.node.d.ts.map +1 -0
- package/dist/types/src/AssistantPlugin.test.d.ts +2 -0
- package/dist/types/src/AssistantPlugin.test.d.ts.map +1 -0
- package/dist/types/src/AssistantPlugin.workerd.d.ts +4 -0
- package/dist/types/src/AssistantPlugin.workerd.d.ts.map +1 -0
- 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.node.test.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/blueprint.node.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-context.d.ts +6 -0
- package/dist/types/src/capabilities/ai-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service.d.ts +5 -2
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +4 -6
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts +9 -0
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +31 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +6 -3
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +56 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +9 -3
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +5 -0
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/migrations.d.ts +6 -0
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +4 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +19 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +4 -2
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/AgentProperties/AgentProperties.d.ts +7 -0
- package/dist/types/src/components/AgentProperties/AgentProperties.d.ts.map +1 -0
- package/dist/types/src/components/AgentProperties/AgentProperties.stories.d.ts +15 -0
- package/dist/types/src/components/AgentProperties/AgentProperties.stories.d.ts.map +1 -0
- package/dist/types/src/components/AgentProperties/index.d.ts +2 -0
- package/dist/types/src/components/AgentProperties/index.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -4
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts +15 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/index.d.ts +1 -1
- package/dist/types/src/components/AssistantSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +42 -33
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/context.d.ts +29 -0
- package/dist/types/src/components/Chat/context.d.ts.map +1 -0
- 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/ChatPrompt/ChatActions.d.ts +2 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts +12 -0
- package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +10 -6
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +19 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts +28 -0
- package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +5 -5
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +3 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Anchor.stories.d.ts +14 -0
- package/dist/types/src/components/ChatThread/Anchor.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +11 -11
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +15 -266
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts +2 -2
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +42 -0
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +19 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +51 -18
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/tool-widget-state.d.ts +18 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +8 -0
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts +25 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts +18 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts +9 -0
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts +14 -0
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts +12 -0
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +12 -0
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts +11 -0
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts +5 -0
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts +9 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts +15 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/defaults.d.ts +5 -0
- package/dist/types/src/components/ChatThread/widgets/defaults.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts +10 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +11 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +7 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/index.d.ts +2 -0
- package/dist/types/src/components/ProcessTree/index.d.ts.map +1 -0
- package/dist/types/src/components/RoutineProperties/RoutineProperties.d.ts +7 -0
- package/dist/types/src/components/RoutineProperties/RoutineProperties.d.ts.map +1 -0
- package/dist/types/src/components/RoutineProperties/RoutineProperties.stories.d.ts +15 -0
- package/dist/types/src/components/RoutineProperties/RoutineProperties.stories.d.ts.map +1 -0
- package/dist/types/src/components/RoutineProperties/index.d.ts +2 -0
- package/dist/types/src/components/RoutineProperties/index.d.ts.map +1 -0
- package/dist/types/src/components/TaskList/TaskList.d.ts +10 -0
- package/dist/types/src/components/TaskList/TaskList.d.ts.map +1 -0
- package/dist/types/src/components/TaskList/TaskList.stories.d.ts +16 -0
- package/dist/types/src/components/TaskList/TaskList.stories.d.ts.map +1 -0
- package/dist/types/src/components/TaskList/index.d.ts +2 -0
- package/dist/types/src/components/TaskList/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +7 -5
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +1 -253
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +12 -3
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +2 -254
- 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 +9 -16
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +14 -13
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +1 -253
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +6 -11
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts +6 -0
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -0
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts +21 -0
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/AgentArticle/index.d.ts +2 -0
- package/dist/types/src/containers/AgentArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts +6 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -0
- package/dist/types/src/containers/AgentProperties/index.d.ts +2 -0
- package/dist/types/src/containers/AgentProperties/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 +2 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatArticle/ChatArticle.d.ts +12 -0
- package/dist/types/src/containers/ChatArticle/ChatArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChatArticle/ChatArticle.stories.d.ts +15 -0
- package/dist/types/src/containers/ChatArticle/ChatArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChatArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ChatArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +26 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts +2 -0
- package/dist/types/src/containers/ChatCompanion/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 +2 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts +6 -0
- package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PlanArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PlanArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +6 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts +15 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/index.d.ts +2 -0
- package/dist/types/src/containers/RoutineArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineList/RoutineList.d.ts +6 -0
- package/dist/types/src/containers/RoutineList/RoutineList.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts +21 -0
- package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineList/index.d.ts +2 -0
- package/dist/types/src/containers/RoutineList/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts +8 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +15 -0
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +19 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts +2 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/index.d.ts +4 -0
- package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/testing/index.d.ts +3 -0
- package/dist/types/src/containers/TracePanel/testing/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts +14 -0
- package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts +12 -0
- package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +5 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts +2 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +13 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts +108 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph/execution-graph.test.d.ts +2 -0
- package/dist/types/src/execution-graph/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/index.d.ts +3 -0
- package/dist/types/src/execution-graph/index.d.ts.map +1 -0
- package/dist/types/src/execution-graph/remote-snapshot.test.d.ts +2 -0
- package/dist/types/src/execution-graph/remote-snapshot.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/span-tree.d.ts +76 -0
- package/dist/types/src/execution-graph/span-tree.d.ts.map +1 -0
- package/dist/types/src/execution-graph/span-tree.test.d.ts +2 -0
- package/dist/types/src/execution-graph/span-tree.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts +40 -0
- package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts.map +1 -0
- package/dist/types/src/execution-graph/testing/index.d.ts +2 -0
- package/dist/types/src/execution-graph/testing/index.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +2 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/extensions/prompt-extension.d.ts +10 -0
- package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -0
- package/dist/types/src/feed-logger.d.ts +13 -0
- package/dist/types/src/feed-logger.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +4 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +57 -11
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatKeymap.d.ts +12 -0
- package/dist/types/src/hooks/useChatKeymap.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +10 -7
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +9 -8
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +4 -3
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts +10 -9
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useDebug.d.ts +10 -0
- package/dist/types/src/hooks/useDebug.d.ts.map +1 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts +1 -1
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -1
- package/dist/types/src/hooks/usePresets.d.ts +1 -1
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -6
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +5 -0
- package/dist/types/src/operations/create-chat.d.ts.map +1 -0
- package/dist/types/src/operations/ensure-companion-chat.d.ts +5 -0
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/on-create-space.d.ts +5 -0
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
- package/dist/types/src/operations/prompt.node.test.d.ts +2 -0
- package/dist/types/src/operations/prompt.node.test.d.ts.map +1 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts +17 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -0
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +5 -0
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -0
- package/dist/types/src/operations/set-current-chat.d.ts +5 -0
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -0
- package/dist/types/src/operations/toggle-trace-panel-debug.d.ts +5 -0
- package/dist/types/src/operations/toggle-trace-panel-debug.d.ts.map +1 -0
- package/dist/types/src/operations/update-chat-name.d.ts +5 -0
- package/dist/types/src/operations/update-chat-name.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/processor/index.d.ts +0 -1
- package/dist/types/src/processor/index.d.ts.map +1 -1
- package/dist/types/src/processor/presets.d.ts +1 -1
- package/dist/types/src/processor/presets.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +261 -40
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/processor.node.test.d.ts +2 -0
- package/dist/types/src/processor/processor.node.test.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/snapshot.d.ts +21 -0
- package/dist/types/src/testing/snapshot.d.ts.map +1 -0
- package/dist/types/src/testing/test-generator.d.ts +4 -4
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.test.d.ts +2 -0
- package/dist/types/src/testing/test-generator.test.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +10 -3
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts +1 -1
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/testing/test-trace.d.ts +5 -0
- package/dist/types/src/testing/test-trace.d.ts.map +1 -0
- package/dist/types/src/testing/trace-timeline.node.test.d.ts +2 -0
- package/dist/types/src/testing/trace-timeline.node.test.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -88
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +34 -48
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantCapabilities.d.ts +30 -0
- package/dist/types/src/types/AssistantCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/AssistantEvents.d.ts +3 -0
- package/dist/types/src/types/AssistantEvents.d.ts.map +1 -0
- package/dist/types/src/types/AssistantOperation.d.ts +145 -0
- package/dist/types/src/types/AssistantOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +27 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +10 -213
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/src/util/suggestions.d.ts +9 -0
- package/dist/types/src/util/suggestions.d.ts.map +1 -0
- package/dist/types/src/util/suggestions.test.d.ts +2 -0
- package/dist/types/src/util/suggestions.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +206 -110
- package/src/AssistantPlugin.node.ts +71 -0
- package/src/AssistantPlugin.test.ts +49 -0
- package/src/AssistantPlugin.ts +140 -0
- package/src/AssistantPlugin.workerd.ts +41 -0
- package/src/blueprints/assistant/blueprint.node.test.ts +46 -0
- package/src/blueprints/assistant/blueprint.ts +31 -0
- package/src/blueprints/assistant/index.ts +5 -0
- package/src/{components/Toolbar → blueprints}/index.ts +1 -1
- package/src/capabilities/ai-context.ts +85 -0
- package/src/capabilities/ai-service.ts +34 -17
- package/src/capabilities/app-graph-builder.ts +174 -171
- package/src/capabilities/blueprint-definition.ts +47 -55
- package/src/capabilities/companion-chat-provisioner.ts +163 -0
- package/src/capabilities/create-object.ts +98 -0
- package/src/capabilities/edge-model-resolver.ts +22 -14
- package/src/capabilities/index.ts +24 -14
- package/src/capabilities/local-model-resolver.ts +31 -13
- package/src/capabilities/markdown.ts +40 -0
- package/src/capabilities/migrations.ts +28 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +161 -78
- package/src/capabilities/settings.ts +24 -12
- package/src/capabilities/state.ts +27 -12
- package/src/capabilities/toolkit.ts +6 -161
- package/src/components/AgentProperties/AgentProperties.stories.tsx +74 -0
- package/src/components/AgentProperties/AgentProperties.tsx +102 -0
- package/src/components/AgentProperties/index.ts +5 -0
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +35 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +30 -99
- package/src/components/AssistantSettings/index.ts +2 -2
- package/src/components/Chat/Chat.tsx +162 -258
- package/src/components/Chat/context.ts +39 -0
- package/src/components/Chat/events.ts +7 -1
- package/src/components/ChatPrompt/ChatActions.tsx +34 -16
- package/src/components/ChatPrompt/ChatMcpErrors.tsx +50 -0
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +136 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +311 -90
- package/src/components/ChatPrompt/ChatPrompt.tsx +182 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +28 -18
- package/src/components/ChatPrompt/ChatStatus.tsx +123 -0
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +2 -2
- package/src/components/ChatPrompt/index.ts +3 -0
- package/src/components/ChatThread/Anchor.stories.tsx +95 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +81 -71
- package/src/components/ChatThread/ChatThread.tsx +62 -46
- package/src/components/ChatThread/DEBUG.md +41 -0
- package/src/components/ChatThread/Link.tsx +6 -6
- package/src/components/ChatThread/MarkdownStream.stories.tsx +281 -0
- package/src/components/ChatThread/registry.tsx +184 -78
- package/src/components/ChatThread/sync.test.ts +201 -25
- package/src/components/ChatThread/sync.ts +105 -68
- package/src/components/ChatThread/testing/reasoning.md +25 -0
- package/src/components/ChatThread/testing/thinking.md +21 -0
- package/src/components/ChatThread/testing/thread-1.md +30 -0
- package/src/components/ChatThread/testing/thread-2.md +56 -0
- package/src/components/ChatThread/testing/thread-widgets.md +79 -0
- package/src/components/ChatThread/tool-widget-state.test.ts +34 -0
- package/src/components/ChatThread/tool-widget-state.ts +48 -0
- package/src/components/ChatThread/widgets/FallbackWidget.tsx +26 -0
- package/src/components/ChatThread/widgets/ReasoningWidget.stories.tsx +68 -0
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +133 -0
- package/src/components/ChatThread/widgets/ReferenceWidget.ts +33 -0
- package/src/components/ChatThread/widgets/SelectWidget.ts +39 -0
- package/src/components/ChatThread/widgets/StatsWidget.ts +31 -0
- package/src/components/ChatThread/widgets/StatusWidget.ts +53 -0
- package/src/components/ChatThread/widgets/SuggestionWidget.ts +41 -0
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +27 -0
- package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +55 -0
- package/src/components/ChatThread/widgets/ToolWidget.tsx +156 -0
- package/src/components/ChatThread/widgets/defaults.ts +8 -0
- package/src/components/ChatThread/widgets/index.ts +13 -0
- package/src/components/ProcessTree/ProcessTree.stories.tsx +83 -0
- package/src/components/ProcessTree/ProcessTree.tsx +122 -0
- package/src/components/ProcessTree/index.ts +5 -0
- package/src/components/RoutineProperties/RoutineProperties.stories.tsx +59 -0
- package/src/components/RoutineProperties/RoutineProperties.tsx +23 -0
- package/src/components/RoutineProperties/index.ts +5 -0
- package/src/components/TaskList/TaskList.stories.tsx +44 -0
- package/src/components/TaskList/TaskList.tsx +45 -0
- package/src/components/TaskList/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +18 -14
- package/src/components/TemplateEditor/TemplateEditor.tsx +58 -42
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +21 -15
- package/src/components/TemplateEditor/TemplateForm.tsx +111 -86
- 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 +46 -54
- package/src/components/Toolbox/Toolbox.stories.tsx +16 -18
- package/src/components/Toolbox/Toolbox.tsx +72 -66
- package/src/components/index.ts +6 -10
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +120 -0
- package/src/containers/AgentArticle/AgentArticle.tsx +197 -0
- package/src/containers/AgentArticle/index.ts +5 -0
- package/src/containers/AgentProperties/AgentProperties.tsx +43 -0
- package/src/containers/AgentProperties/index.ts +5 -0
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +29 -0
- package/src/containers/BlueprintArticle/index.ts +5 -0
- package/src/containers/ChatArticle/ChatArticle.stories.tsx +76 -0
- package/src/containers/ChatArticle/ChatArticle.tsx +107 -0
- package/src/containers/ChatArticle/index.ts +5 -0
- package/src/containers/ChatCompanion/ChatCompanion.tsx +133 -0
- package/src/containers/ChatCompanion/index.ts +5 -0
- package/src/{components → containers/ChatDialog}/ChatDialog.tsx +14 -16
- package/src/containers/ChatDialog/index.ts +5 -0
- package/src/containers/PlanArticle/PlanArticle.tsx +33 -0
- package/src/containers/PlanArticle/index.ts +5 -0
- package/src/containers/RoutineArticle/RoutineArticle.stories.tsx +75 -0
- package/src/containers/RoutineArticle/RoutineArticle.tsx +109 -0
- package/src/containers/RoutineArticle/index.ts +5 -0
- package/src/containers/RoutineList/RoutineList.stories.tsx +130 -0
- package/src/containers/RoutineList/RoutineList.tsx +50 -0
- package/src/containers/RoutineList/index.ts +5 -0
- package/src/containers/TracePanel/TracePanel.stories.tsx +319 -0
- package/src/containers/TracePanel/TracePanel.tsx +213 -0
- package/src/containers/TracePanel/dxn-extractor.test.ts +153 -0
- package/src/containers/TracePanel/dxn-extractor.ts +168 -0
- package/src/containers/TracePanel/index.ts +9 -0
- package/src/containers/TracePanel/testing/index.ts +6 -0
- package/src/containers/TracePanel/testing/simulated-agent.ts +114 -0
- package/src/containers/TracePanel/testing/snapshot-playback.ts +45 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +129 -0
- package/src/containers/TriggerStatus/index.ts +5 -0
- package/src/containers/index.ts +17 -0
- package/src/execution-graph/SPEC.md +678 -0
- package/src/execution-graph/execution-graph.test.ts +799 -0
- package/src/execution-graph/execution-graph.ts +714 -0
- package/src/execution-graph/index.ts +24 -0
- package/src/execution-graph/remote-snapshot.test.ts +116 -0
- package/src/execution-graph/span-tree.test.ts +249 -0
- package/src/execution-graph/span-tree.ts +259 -0
- package/src/execution-graph/testing/collect-trace-events.ts +74 -0
- package/src/execution-graph/testing/index.ts +5 -0
- package/src/extensions/index.ts +5 -0
- package/src/extensions/prompt-extension.ts +111 -0
- package/src/feed-logger.ts +149 -0
- package/src/hooks/index.ts +4 -1
- package/src/hooks/useBlueprintRegistry.ts +48 -27
- package/src/hooks/useChatKeymap.ts +52 -0
- package/src/hooks/useChatProcessor.ts +60 -28
- package/src/hooks/useChatServices.ts +14 -35
- package/src/hooks/useChatToolbarActions.ts +120 -0
- package/src/hooks/useContextBinder.ts +23 -10
- package/src/hooks/useContextObjects.ts +20 -27
- package/src/hooks/useDebug.ts +38 -0
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/usePresets.ts +2 -1
- package/src/hooks/useReferencesProvider.ts +11 -22
- package/src/index.ts +1 -7
- package/src/meta.ts +33 -7
- package/src/operations/create-chat.ts +84 -0
- package/src/operations/ensure-companion-chat.ts +63 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/on-create-space.ts +24 -0
- package/src/operations/prompt.node.test.ts +80 -0
- package/src/operations/resolve-navigation-targets.ts +31 -0
- package/src/operations/run-prompt-in-new-chat.ts +113 -0
- package/src/operations/set-current-chat.ts +49 -0
- package/src/operations/toggle-trace-panel-debug.ts +27 -0
- package/src/operations/update-chat-name.ts +61 -0
- package/src/plugin.ts +11 -0
- package/src/processor/index.ts +0 -1
- package/src/processor/presets.ts +12 -4
- package/src/processor/processor.node.test.ts +41 -0
- package/src/processor/processor.ts +287 -163
- package/src/testing/data/trace-timeline-multiple.dx.json +1 -0
- package/src/testing/data/trace-timeline-remote.dx.json +1 -0
- package/src/testing/data/trace-timeline.dx.json +4657 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/snapshot.ts +35 -0
- package/src/testing/test-generator.test.ts +71 -0
- package/src/testing/test-generator.ts +217 -194
- package/src/testing/test-sequence.ts +6 -6
- package/src/testing/test-services.ts +9 -7
- package/src/testing/test-trace.ts +20 -0
- package/src/testing/trace-timeline.node.conversations.json +1 -0
- package/src/testing/trace-timeline.node.test.ts +250 -0
- package/src/testing.ts +9 -0
- package/src/translations.ts +162 -82
- package/src/types/Assistant.ts +17 -55
- package/src/types/AssistantCapabilities.ts +35 -0
- package/src/types/AssistantEvents.ts +11 -0
- package/src/types/AssistantOperation.ts +152 -0
- package/src/types/Settings.ts +82 -0
- package/src/types/index.ts +8 -2
- package/src/types/service.ts +9 -11
- package/src/util/suggestions.test.ts +52 -0
- package/src/util/suggestions.ts +42 -0
- package/dist/lib/browser/BlueprintContainer-FOZTO447.mjs +0 -28
- package/dist/lib/browser/BlueprintContainer-FOZTO447.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-EC6LBEWF.mjs +0 -150
- package/dist/lib/browser/ChatCompanion-EC6LBEWF.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-A2SL6WO5.mjs +0 -73
- package/dist/lib/browser/ChatContainer-A2SL6WO5.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-XMOUFX2P.mjs +0 -86
- package/dist/lib/browser/ChatDialog-XMOUFX2P.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-7AE4R5KJ.mjs +0 -183
- package/dist/lib/browser/app-graph-builder-7AE4R5KJ.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-37VMDB4P.mjs +0 -220
- package/dist/lib/browser/chunk-37VMDB4P.mjs.map +0 -7
- package/dist/lib/browser/chunk-3EWE2UQD.mjs +0 -220
- package/dist/lib/browser/chunk-3EWE2UQD.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-7THOIN6F.mjs +0 -1802
- package/dist/lib/browser/chunk-7THOIN6F.mjs.map +0 -7
- package/dist/lib/browser/chunk-HYYWP3KP.mjs +0 -170
- package/dist/lib/browser/chunk-HYYWP3KP.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z7DQT64Z.mjs +0 -301
- package/dist/lib/browser/chunk-Z7DQT64Z.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/index.mjs +0 -370
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-BZUU4UNA.mjs +0 -130
- package/dist/lib/browser/intent-resolver-BZUU4UNA.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/meta.json +0 -1
- package/dist/lib/browser/react-surface-KRRUOMYY.mjs +0 -107
- package/dist/lib/browser/react-surface-KRRUOMYY.mjs.map +0 -7
- package/dist/lib/browser/settings-PSR3WF3X.mjs +0 -23
- package/dist/lib/browser/settings-PSR3WF3X.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/browser/types/index.mjs +0 -19
- package/dist/lib/node-esm/BlueprintContainer-6HSEVQ7U.mjs +0 -29
- package/dist/lib/node-esm/BlueprintContainer-6HSEVQ7U.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-NDYEAUQN.mjs +0 -151
- package/dist/lib/node-esm/ChatCompanion-NDYEAUQN.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-NMDQM5HG.mjs +0 -74
- package/dist/lib/node-esm/ChatContainer-NMDQM5HG.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QPRWMRU4.mjs +0 -87
- package/dist/lib/node-esm/ChatDialog-QPRWMRU4.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-SJCOS64C.mjs +0 -184
- package/dist/lib/node-esm/app-graph-builder-SJCOS64C.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-WD2IVMAI.mjs +0 -13
- package/dist/lib/node-esm/chunk-73ABYRYX.mjs +0 -20
- package/dist/lib/node-esm/chunk-73ABYRYX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HDZX6TSZ.mjs +0 -221
- package/dist/lib/node-esm/chunk-HDZX6TSZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-TMCGJPAN.mjs +0 -171
- package/dist/lib/node-esm/chunk-TMCGJPAN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TW2WKKSR.mjs +0 -302
- package/dist/lib/node-esm/chunk-TW2WKKSR.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-XQGWSZ4T.mjs +0 -17
- package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YZYGXFVG.mjs +0 -1803
- package/dist/lib/node-esm/chunk-YZYGXFVG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZQ3THJ2W.mjs +0 -221
- package/dist/lib/node-esm/chunk-ZQ3THJ2W.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/index.mjs +0 -371
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-B7YAS3NT.mjs +0 -131
- package/dist/lib/node-esm/intent-resolver-B7YAS3NT.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/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-VRDDARFF.mjs +0 -108
- package/dist/lib/node-esm/react-surface-VRDDARFF.mjs.map +0 -7
- package/dist/lib/node-esm/settings-4EBIOJVK.mjs +0 -24
- package/dist/lib/node-esm/settings-4EBIOJVK.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/lib/node-esm/types/index.mjs +0 -20
- 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/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.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/BlueprintSettings.d.ts +0 -6
- package/dist/types/src/components/BlueprintSettings.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/ChatProgress/ChatProgress.d.ts +0 -7
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +0 -1
- package/dist/types/src/components/ChatProgress/index.d.ts +0 -2
- package/dist/types/src/components/ChatProgress/index.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/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 -272
- 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 -9
- 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/processor/processor.test.d.ts +0 -2
- package/dist/types/src/processor/processor.test.d.ts.map +0 -1
- package/dist/types/src/processor/update-name.d.ts +0 -10
- package/dist/types/src/processor/update-name.d.ts.map +0 -1
- package/dist/types/src/queue-logger.d.ts +0 -11
- package/dist/types/src/queue-logger.d.ts.map +0 -1
- package/dist/types/src/types/AssistantAction.d.ts +0 -122
- package/dist/types/src/types/AssistantAction.d.ts.map +0 -1
- package/dist/types/src/types/defs.d.ts +0 -2
- package/dist/types/src/types/defs.d.ts.map +0 -1
- package/src/AssistantPlugin.tsx +0 -170
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/intent-resolver.ts +0 -117
- package/src/components/BlueprintContainer.tsx +0 -24
- package/src/components/BlueprintSettings.tsx +0 -15
- package/src/components/ChatCompanion.tsx +0 -136
- package/src/components/ChatContainer.tsx +0 -51
- package/src/components/ChatProgress/ChatProgress.tsx +0 -67
- package/src/components/ChatProgress/index.ts +0 -5
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/components/SequenceContainer.tsx +0 -131
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -34
- 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/processor/processor.test.ts +0 -81
- package/src/processor/update-name.ts +0 -57
- package/src/queue-logger.ts +0 -125
- package/src/types/AssistantAction.ts +0 -70
- package/src/types/defs.ts +0 -5
- /package/dist/lib/{browser/blueprint-definition-NSJARW5U.mjs.map → neutral/AssistantPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/ChatArticle-WVAFZPVI.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-WD2IVMAI.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/types/src/components/TemplateEditor/{handlebars-extension.d.ts → extensions/handlebars-extension.d.ts} +0 -0
|
@@ -2,127 +2,152 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import * as Cause from 'effect/Cause';
|
|
5
|
+
import { Atom, Registry } from '@effect-atom/atom-react';
|
|
7
6
|
import * as Effect from 'effect/Effect';
|
|
8
|
-
import * as Exit from 'effect/Exit';
|
|
9
7
|
import * as Fiber from 'effect/Fiber';
|
|
8
|
+
import * as Layer from 'effect/Layer';
|
|
10
9
|
import * as Option from 'effect/Option';
|
|
11
|
-
import * as
|
|
10
|
+
import * as Stream from 'effect/Stream';
|
|
12
11
|
|
|
12
|
+
import { type AiService, DEFAULT_EDGE_MODEL, type ModelName, type ModelRegistry, type OpaqueToolkit } from '@dxos/ai';
|
|
13
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
13
14
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type ModelName,
|
|
17
|
-
type ModelRegistry,
|
|
18
|
-
type ToolExecutionService,
|
|
19
|
-
type ToolResolverService,
|
|
20
|
-
} from '@dxos/ai';
|
|
21
|
-
import {
|
|
22
|
-
type AiConversation,
|
|
23
|
-
type AiConversationRunParams,
|
|
24
|
-
ArtifactDiffResolver,
|
|
25
|
-
GenerationObserver,
|
|
15
|
+
AiContext,
|
|
16
|
+
AiSession,
|
|
26
17
|
createSystemPrompt,
|
|
18
|
+
formatSystemPrompt,
|
|
19
|
+
McpServerError,
|
|
20
|
+
PartialBlock,
|
|
21
|
+
ToolExecutionServices,
|
|
27
22
|
} from '@dxos/assistant';
|
|
28
|
-
import { type
|
|
29
|
-
import { Obj } from '@dxos/echo';
|
|
30
|
-
import { throwCause } from '@dxos/effect';
|
|
23
|
+
import { type Chat } from '@dxos/assistant-toolkit';
|
|
31
24
|
import {
|
|
32
|
-
type
|
|
33
|
-
type
|
|
34
|
-
|
|
35
|
-
type
|
|
36
|
-
type
|
|
37
|
-
|
|
25
|
+
type Blueprint,
|
|
26
|
+
type Credential,
|
|
27
|
+
Operation,
|
|
28
|
+
type OperationRegistry,
|
|
29
|
+
type ServiceNotAvailableError,
|
|
30
|
+
Trace,
|
|
31
|
+
} from '@dxos/compute';
|
|
32
|
+
import { type Database, Feed, Obj, Ref } from '@dxos/echo';
|
|
33
|
+
import { runAndForwardErrors, unwrapExit } from '@dxos/effect';
|
|
34
|
+
import { AgentService } from '@dxos/functions-runtime';
|
|
38
35
|
import { log } from '@dxos/log';
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
import { type Assistant } from '../types';
|
|
36
|
+
import { Message } from '@dxos/types';
|
|
42
37
|
|
|
43
|
-
import {
|
|
38
|
+
import { AssistantOperation } from '#types';
|
|
44
39
|
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated Services type for the old direct-conversation processor path.
|
|
42
|
+
* Retained for backward compatibility with CLI and update-name.
|
|
43
|
+
*/
|
|
45
44
|
export type AiChatServices =
|
|
46
|
-
| CredentialsService
|
|
47
|
-
|
|
|
48
|
-
| QueueService
|
|
49
|
-
| FunctionInvocationService
|
|
45
|
+
| Credential.CredentialsService
|
|
46
|
+
| Database.Service
|
|
50
47
|
| AiService.AiService
|
|
51
|
-
|
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
| Trace.TraceService;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Space-scoped services materialised by the layer passed into
|
|
52
|
+
* {@link AiChatProcessor}. Mirrors the tag list that
|
|
53
|
+
* {@link useChatProcessor} passes to {@link ServiceResolver.provide}.
|
|
54
|
+
*/
|
|
55
|
+
export type SpaceServices =
|
|
56
|
+
| Database.Service
|
|
57
|
+
| Feed.FeedService
|
|
58
|
+
| Credential.CredentialsService
|
|
59
|
+
| AiService.AiService
|
|
60
|
+
| AgentService.AgentService
|
|
61
|
+
| OperationRegistry.Service
|
|
62
|
+
| OpaqueToolkit.OpaqueToolkitProvider;
|
|
54
63
|
|
|
55
64
|
export type AiChatProcessorOptions = {
|
|
56
65
|
model?: ModelName;
|
|
57
66
|
modelRegistry?: ModelRegistry;
|
|
58
67
|
blueprintRegistry?: Blueprint.Registry;
|
|
59
68
|
observableRegistry?: Registry.Registry;
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
/**
|
|
70
|
+
* For tracing.
|
|
71
|
+
*/
|
|
72
|
+
chat?: Ref.Ref<Chat.Chat>;
|
|
73
|
+
system?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Probability of automatically updating chat name after each request.
|
|
76
|
+
* Chat name is always updated if it has no name.
|
|
77
|
+
* @default 0.1 (10%)
|
|
78
|
+
*/
|
|
79
|
+
autoUpdateNameChance?: number;
|
|
80
|
+
};
|
|
62
81
|
|
|
63
82
|
const defaultOptions: Partial<AiChatProcessorOptions> = {
|
|
64
83
|
model: DEFAULT_EDGE_MODEL,
|
|
84
|
+
autoUpdateNameChance: 0.1,
|
|
65
85
|
};
|
|
66
86
|
|
|
67
|
-
|
|
68
|
-
export type AiRequestOptions = {};
|
|
87
|
+
export type ProcessorRequestOptions = {};
|
|
69
88
|
|
|
70
|
-
export type
|
|
89
|
+
export type ProcessorRequest = {
|
|
71
90
|
message: string;
|
|
72
|
-
options?:
|
|
91
|
+
options?: ProcessorRequestOptions;
|
|
73
92
|
};
|
|
74
93
|
|
|
75
94
|
/**
|
|
76
95
|
* Handles interactions with the AI service.
|
|
77
|
-
*
|
|
96
|
+
* Uses AgentService to spawn a process-backed agent and subscribes to ephemeral trace events for streaming.
|
|
78
97
|
*/
|
|
79
98
|
export class AiChatProcessor {
|
|
80
|
-
|
|
99
|
+
readonly #registry: Registry.Registry;
|
|
81
100
|
|
|
82
|
-
/**
|
|
83
|
-
|
|
101
|
+
/** Pending messages (finalized, non-streaming). */
|
|
102
|
+
readonly #pending = Atom.make<Message.Message[]>([]);
|
|
84
103
|
|
|
85
|
-
/** Currently
|
|
86
|
-
|
|
104
|
+
/** Currently streaming messages (from ephemeral trace events). */
|
|
105
|
+
readonly #streaming = Atom.make<Message.Message[]>([]);
|
|
87
106
|
|
|
88
|
-
/**
|
|
89
|
-
|
|
107
|
+
/** Set of message IDs that have been finalized (non-pending delivered via ephemeral). */
|
|
108
|
+
readonly #finalizedIds = new Set<string>();
|
|
90
109
|
|
|
91
|
-
/**
|
|
92
|
-
|
|
110
|
+
/** Currently active request fiber. */
|
|
111
|
+
#requestFiber: Fiber.RuntimeFiber<void, unknown> | undefined;
|
|
93
112
|
|
|
94
|
-
/**
|
|
95
|
-
|
|
113
|
+
/** Last request (for retries). */
|
|
114
|
+
#lastRequest: ProcessorRequest | undefined;
|
|
96
115
|
|
|
97
116
|
/** Streaming state. */
|
|
98
|
-
public readonly streaming =
|
|
117
|
+
public readonly streaming = Atom.make<boolean>((get) => get(this.#streaming).length > 0);
|
|
99
118
|
|
|
100
119
|
/** Active state. */
|
|
101
|
-
public readonly active =
|
|
120
|
+
public readonly active = Atom.make(false);
|
|
102
121
|
|
|
103
122
|
/** 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
|
-
);
|
|
123
|
+
public readonly messages = Atom.make<Message.Message[]>((get) => [...get(this.#pending), ...get(this.#streaming)]);
|
|
110
124
|
|
|
111
125
|
/** Last error. */
|
|
112
|
-
public readonly error =
|
|
126
|
+
public readonly error = Atom.make<Option.Option<Error>>(Option.none());
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* MCP server connection errors observed during the most recent request.
|
|
130
|
+
* Misconfigured/unreachable servers are dropped from the toolkit so the chat
|
|
131
|
+
* keeps working; the entries here let the UI display which servers failed.
|
|
132
|
+
*/
|
|
133
|
+
public readonly mcpErrors = Atom.make<readonly Trace.PayloadType<typeof McpServerError>[]>([]);
|
|
113
134
|
|
|
114
135
|
constructor(
|
|
115
|
-
private readonly _conversation:
|
|
116
|
-
|
|
117
|
-
private readonly
|
|
136
|
+
private readonly _conversation: AiSession.Session,
|
|
137
|
+
private readonly _runtime: Capabilities.ProcessManagerRuntime,
|
|
138
|
+
private readonly _feed: Feed.Feed,
|
|
139
|
+
/**
|
|
140
|
+
* Pre-built layer that materialises {@link SpaceServices}. Built via
|
|
141
|
+
* {@link ServiceResolver.provide} with the {@link ServiceResolver} already
|
|
142
|
+
* supplied (hence `RIn = never`); the {@link ServiceNotAvailableError}
|
|
143
|
+
* error channel surfaces when a tag is not available for the space.
|
|
144
|
+
* Provided to every effect run by the processor so the underlying
|
|
145
|
+
* {@link ProcessManagerRuntime} has access to space-affinity services.
|
|
146
|
+
*/
|
|
147
|
+
private readonly _spaceLayer: Layer.Layer<SpaceServices, ServiceNotAvailableError, never>,
|
|
118
148
|
private readonly _options: AiChatProcessorOptions = defaultOptions,
|
|
119
149
|
) {
|
|
120
|
-
|
|
121
|
-
this._rx = this._options.observableRegistry ?? Registry.make();
|
|
122
|
-
this._observer = GenerationObserver.make({
|
|
123
|
-
onBlock: this._onBlock,
|
|
124
|
-
onMessage: this._onMessage,
|
|
125
|
-
});
|
|
150
|
+
this.#registry = this._options.observableRegistry ?? Registry.make();
|
|
126
151
|
if (this._options.model && !this._options.system) {
|
|
127
152
|
const capabilities = this._options.modelRegistry?.getCapabilities(this._options.model) ?? {};
|
|
128
153
|
this._options.system = createSystemPrompt(capabilities);
|
|
@@ -141,54 +166,96 @@ export class AiChatProcessor {
|
|
|
141
166
|
return this._options.blueprintRegistry;
|
|
142
167
|
}
|
|
143
168
|
|
|
169
|
+
get system(): string {
|
|
170
|
+
return this._options.system ?? '';
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async getTools(): Promise<Record<string, any>> {
|
|
174
|
+
return this._runtime.runPromise(
|
|
175
|
+
Effect.provide(this._conversation.getTools(), ToolExecutionServices).pipe(Effect.provide(this._spaceLayer)),
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
async getSystemPrompt(): Promise<string> {
|
|
180
|
+
return this._runtime.runPromise(
|
|
181
|
+
Effect.gen(this, function* () {
|
|
182
|
+
const blueprints = this.context.getBlueprints();
|
|
183
|
+
const objects = this.context.getObjects();
|
|
184
|
+
return yield* formatSystemPrompt({ system: this._options.system, blueprints, objects });
|
|
185
|
+
}).pipe(
|
|
186
|
+
Effect.provideService(AiContext.Service, { binder: this.context }),
|
|
187
|
+
Effect.provide(this._spaceLayer),
|
|
188
|
+
Effect.orDie,
|
|
189
|
+
),
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
144
193
|
/**
|
|
145
|
-
* Initiates a new request.
|
|
194
|
+
* Initiates a new request via AgentService.
|
|
146
195
|
*/
|
|
147
|
-
async request(
|
|
148
|
-
if (this
|
|
196
|
+
async request(requestProp: ProcessorRequest): Promise<void> {
|
|
197
|
+
if (this.#requestFiber) {
|
|
149
198
|
await this.cancel();
|
|
150
199
|
}
|
|
151
200
|
|
|
152
201
|
try {
|
|
153
|
-
this
|
|
154
|
-
this.
|
|
155
|
-
this.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
202
|
+
this.#lastRequest = requestProp;
|
|
203
|
+
this.#registry.set(this.error, Option.none());
|
|
204
|
+
this.#registry.set(this.mcpErrors, []);
|
|
205
|
+
this.#registry.set(this.active, true);
|
|
206
|
+
|
|
207
|
+
const effect = Effect.gen(this, function* () {
|
|
208
|
+
// NOTE: Gets or creates a session for the feed.
|
|
209
|
+
log.info('init agent session', { feed: Obj.getURI(this._feed), model: this._options.model });
|
|
210
|
+
const session = yield* AgentService.getSession(this._feed, { model: this._options.model });
|
|
211
|
+
const ephemeralStream = session.subscribeEphemeral();
|
|
212
|
+
yield* ephemeralStream.pipe(
|
|
213
|
+
Stream.runForEach((message) =>
|
|
214
|
+
Effect.sync(() => {
|
|
215
|
+
for (const event of message.events) {
|
|
216
|
+
if (Trace.isOfType(PartialBlock, event)) {
|
|
217
|
+
this.#handleEphemeralMessage(event.data);
|
|
218
|
+
} else if (Trace.isOfType(McpServerError, event)) {
|
|
219
|
+
this.#handleMcpError(event.data);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}),
|
|
223
|
+
),
|
|
224
|
+
Effect.fork,
|
|
225
|
+
);
|
|
163
226
|
|
|
164
|
-
|
|
227
|
+
log('chat processor submitting prompt', { length: requestProp.message.length });
|
|
228
|
+
yield* session.submitPrompt(requestProp.message);
|
|
229
|
+
log('chat processor submitPrompt returned, waiting for agent', {});
|
|
230
|
+
yield* session.waitForCompletion();
|
|
231
|
+
log.info('session complete');
|
|
165
232
|
|
|
166
|
-
|
|
167
|
-
this._fiber = request.pipe(
|
|
168
|
-
Effect.provide(AiService.model(this._options.model ?? DEFAULT_EDGE_MODEL)),
|
|
233
|
+
this.#flushStreaming();
|
|
169
234
|
|
|
170
|
-
|
|
171
|
-
|
|
235
|
+
yield* this.#maybeUpdateChatName();
|
|
236
|
+
});
|
|
172
237
|
|
|
173
|
-
|
|
174
|
-
Runtime.runFork(runtime), // Runs in the background.
|
|
175
|
-
);
|
|
238
|
+
this.#requestFiber = this._runtime.runFork(effect.pipe(Effect.provide(this._spaceLayer)));
|
|
176
239
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
240
|
+
try {
|
|
241
|
+
await this._runtime.runPromise(Fiber.join(this.#requestFiber));
|
|
242
|
+
} catch (err: any) {
|
|
243
|
+
if (err._tag === 'InterruptedException' || err.message?.includes('interrupted')) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
throw err;
|
|
181
247
|
}
|
|
182
248
|
|
|
183
|
-
this.
|
|
184
|
-
this
|
|
185
|
-
this
|
|
186
|
-
} catch (
|
|
187
|
-
log.error('request failed', { error });
|
|
188
|
-
this.
|
|
249
|
+
this.#registry.set(this.error, Option.none());
|
|
250
|
+
this.#lastRequest = undefined;
|
|
251
|
+
this.#requestFiber = undefined;
|
|
252
|
+
} catch (err) {
|
|
253
|
+
log.error('request failed', { error: err });
|
|
254
|
+
this.#registry.set(this.error, Option.some(new Error('AI service error', { cause: err })));
|
|
189
255
|
} finally {
|
|
190
|
-
|
|
191
|
-
this.
|
|
256
|
+
log.info('setting active to false');
|
|
257
|
+
this.#registry.set(this.active, false);
|
|
258
|
+
this.#requestFiber = undefined;
|
|
192
259
|
}
|
|
193
260
|
}
|
|
194
261
|
|
|
@@ -196,82 +263,139 @@ export class AiChatProcessor {
|
|
|
196
263
|
* Cancels the current request.
|
|
197
264
|
*/
|
|
198
265
|
async cancel(): Promise<void> {
|
|
199
|
-
await
|
|
266
|
+
await runAndForwardErrors(
|
|
200
267
|
Effect.gen(this, function* () {
|
|
201
|
-
if (this
|
|
202
|
-
yield*
|
|
268
|
+
if (this.#requestFiber) {
|
|
269
|
+
yield* Fiber.interrupt(this.#requestFiber);
|
|
203
270
|
}
|
|
204
271
|
}),
|
|
205
272
|
);
|
|
206
273
|
|
|
207
|
-
this
|
|
208
|
-
this.
|
|
274
|
+
this.#requestFiber = undefined;
|
|
275
|
+
this.#registry.set(this.active, false);
|
|
209
276
|
}
|
|
210
277
|
|
|
211
278
|
/**
|
|
212
279
|
* Retry last failed request.
|
|
213
280
|
*/
|
|
214
281
|
async retry(): Promise<void> {
|
|
215
|
-
if (this
|
|
216
|
-
return this.request(this
|
|
282
|
+
if (this.#lastRequest) {
|
|
283
|
+
return this.request(this.#lastRequest);
|
|
217
284
|
}
|
|
218
285
|
}
|
|
219
286
|
|
|
287
|
+
/**
|
|
288
|
+
* Clears the recorded MCP server errors (e.g. after the user dismisses the warning banner).
|
|
289
|
+
*/
|
|
290
|
+
dismissMcpErrors(): void {
|
|
291
|
+
this.#registry.set(this.mcpErrors, []);
|
|
292
|
+
}
|
|
293
|
+
|
|
220
294
|
/**
|
|
221
295
|
* Update the current chat's name.
|
|
222
296
|
*/
|
|
223
|
-
async updateName(chat:
|
|
224
|
-
const
|
|
225
|
-
|
|
297
|
+
async updateName(chat: Chat.Chat): Promise<void> {
|
|
298
|
+
const spaceId = Obj.getDatabase(chat)?.spaceId;
|
|
299
|
+
if (!spaceId) {
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
unwrapExit(
|
|
303
|
+
await this._runtime.runPromiseExit(
|
|
304
|
+
Operation.invoke(AssistantOperation.UpdateChatName, { chat }, { spaceId }).pipe(
|
|
305
|
+
Effect.provide(this._spaceLayer),
|
|
306
|
+
),
|
|
307
|
+
),
|
|
308
|
+
);
|
|
226
309
|
}
|
|
227
310
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
// version: getVersion(object),
|
|
243
|
-
// diff: `Current state: ${JSON.stringify(object)}`,
|
|
244
|
-
// });
|
|
245
|
-
// }),
|
|
246
|
-
// );
|
|
247
|
-
|
|
248
|
-
return versions;
|
|
249
|
-
},
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
private _onMessage = Effect.fn(
|
|
253
|
-
function* (this: AiChatProcessor, message: DataType.Message) {
|
|
254
|
-
this._rx.set(this._streaming, Option.none());
|
|
255
|
-
this._rx.update(this._pending, (pending) => [...pending, message]);
|
|
256
|
-
}.bind(this),
|
|
257
|
-
);
|
|
258
|
-
|
|
259
|
-
private _onBlock = Effect.fn(
|
|
260
|
-
function* (this: AiChatProcessor, block: ContentBlock.Any) {
|
|
261
|
-
this._rx.update(this._streaming, (streaming) => {
|
|
262
|
-
const blocks = streaming.pipe(
|
|
263
|
-
Option.map((streaming) => streaming.blocks.filter((b) => !b.pending)),
|
|
264
|
-
Option.getOrElse(() => []),
|
|
265
|
-
);
|
|
311
|
+
/**
|
|
312
|
+
* Handles an ephemeral message from the agent process.
|
|
313
|
+
* Both pending and completed blocks arrive here. Completed blocks are deduped
|
|
314
|
+
* against messages already written to the feed queue to handle the race between
|
|
315
|
+
* ephemeral delivery and feed replication.
|
|
316
|
+
*/
|
|
317
|
+
#handleEphemeralMessage(event: Trace.PayloadType<typeof PartialBlock>) {
|
|
318
|
+
const isPending = event.block.pending;
|
|
319
|
+
const message = Obj.make(Message.Message, {
|
|
320
|
+
id: event.messageId,
|
|
321
|
+
created: new Date().toISOString(),
|
|
322
|
+
sender: { role: event.role },
|
|
323
|
+
blocks: [event.block],
|
|
324
|
+
});
|
|
266
325
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
)
|
|
326
|
+
if (isPending) {
|
|
327
|
+
if (this.#finalizedIds.has(event.messageId)) {
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
this.#registry.update(this.#streaming, (streaming) => {
|
|
331
|
+
const idx = streaming.findIndex((existing) => existing.id === event.messageId);
|
|
332
|
+
if (idx >= 0) {
|
|
333
|
+
const updated = [...streaming];
|
|
334
|
+
updated[idx] = message;
|
|
335
|
+
return updated;
|
|
336
|
+
}
|
|
337
|
+
return [...streaming, message];
|
|
274
338
|
});
|
|
275
|
-
}
|
|
276
|
-
|
|
339
|
+
} else {
|
|
340
|
+
this.#finalizedIds.add(event.messageId);
|
|
341
|
+
this.#registry.update(this.#streaming, (streaming) => streaming.filter((existing) => existing.id !== message.id));
|
|
342
|
+
this.#registry.update(this.#pending, (pending) => {
|
|
343
|
+
if (pending.some((existing) => existing.id === message.id)) {
|
|
344
|
+
return pending;
|
|
345
|
+
}
|
|
346
|
+
return [...pending, message];
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Records a per-server MCP failure, deduped by url+protocol so repeat misconfigurations
|
|
353
|
+
* across turns do not spam the UI.
|
|
354
|
+
*/
|
|
355
|
+
#handleMcpError(event: Trace.PayloadType<typeof McpServerError>) {
|
|
356
|
+
log.warn('MCP server error', event);
|
|
357
|
+
this.#registry.update(this.mcpErrors, (errors) => {
|
|
358
|
+
if (errors.some((existing) => existing.url === event.url && existing.protocol === event.protocol)) {
|
|
359
|
+
return errors;
|
|
360
|
+
}
|
|
361
|
+
return [...errors, event];
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Move remaining streaming messages to pending (called when agent completes).
|
|
367
|
+
*/
|
|
368
|
+
#flushStreaming() {
|
|
369
|
+
const remaining = this.#registry.get(this.#streaming);
|
|
370
|
+
if (remaining.length > 0) {
|
|
371
|
+
this.#registry.update(this.#pending, (pending) => [...pending, ...remaining]);
|
|
372
|
+
this.#registry.set(this.#streaming, []);
|
|
373
|
+
}
|
|
374
|
+
this.#finalizedIds.clear();
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Conditionally schedule chat name update in detached fork mode.
|
|
379
|
+
* Updates if chat has no name OR based on random chance (default 10%).
|
|
380
|
+
*/
|
|
381
|
+
#maybeUpdateChatName(): Effect.Effect<void, never, Operation.Service> {
|
|
382
|
+
const chat = this._options.chat?.target;
|
|
383
|
+
if (!chat) {
|
|
384
|
+
return Effect.void;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
const chance = this._options.autoUpdateNameChance ?? defaultOptions.autoUpdateNameChance ?? 0.1;
|
|
388
|
+
const shouldUpdate = !chat.name || Math.random() < chance;
|
|
389
|
+
if (!shouldUpdate) {
|
|
390
|
+
return Effect.void;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
const spaceId = Obj.getDatabase(chat)?.spaceId;
|
|
394
|
+
if (!spaceId) {
|
|
395
|
+
return Effect.void;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
log.info('scheduling chat name update', { hasName: !!chat.name, chance });
|
|
399
|
+
return Operation.schedule(AssistantOperation.UpdateChatName, { chat }, { spaceId });
|
|
400
|
+
}
|
|
277
401
|
}
|