@dxos/plugin-assistant 0.8.4-main.e8ec1fe → 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 -43
- 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 +1 -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 +8 -5
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +11 -311
- 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 +47 -20
- 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 +6 -5
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +1 -300
- 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 -301
- 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 -1
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +5 -14
- 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 -300
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +6 -6
- 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 +3 -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 +8 -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 +3 -3
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- 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 +257 -36
- 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 +2 -2
- 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 -300
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +34 -45
- 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 -219
- 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 -112
- 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/ChatProgress → 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 -187
- package/src/capabilities/blueprint-definition.ts +47 -57
- 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 +160 -73
- package/src/capabilities/settings.ts +24 -12
- package/src/capabilities/state.ts +26 -13
- package/src/capabilities/toolkit.ts +7 -11
- 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 +128 -259
- package/src/components/Chat/context.ts +39 -0
- package/src/components/Chat/events.ts +1 -1
- package/src/components/ChatPrompt/ChatActions.tsx +34 -14
- package/src/components/ChatPrompt/ChatMcpErrors.tsx +50 -0
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +136 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +299 -81
- package/src/components/ChatPrompt/ChatPrompt.tsx +182 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +26 -16
- 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 +71 -80
- package/src/components/ChatThread/ChatThread.tsx +50 -24
- 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 +172 -56
- package/src/components/ChatThread/sync.test.ts +193 -25
- package/src/components/ChatThread/sync.ts +96 -94
- 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.md → thread-2.md} +19 -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 +8 -12
- package/src/components/TemplateEditor/TemplateEditor.tsx +54 -43
- 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 +15 -10
- package/src/components/ToolBlock/ToolBlock.tsx +26 -25
- package/src/components/Toolbox/Toolbox.stories.tsx +16 -18
- package/src/components/Toolbox/Toolbox.tsx +74 -68
- package/src/components/index.ts +6 -7
- 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 -23
- 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/{queue-logger.ts → feed-logger.ts} +48 -20
- package/src/hooks/index.ts +3 -1
- package/src/hooks/useBlueprintRegistry.ts +48 -28
- package/src/hooks/useChatKeymap.ts +52 -0
- package/src/hooks/useChatProcessor.ts +57 -25
- package/src/hooks/useChatServices.ts +14 -37
- package/src/hooks/useChatToolbarActions.ts +98 -100
- package/src/hooks/useContextBinder.ts +22 -9
- 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 -23
- package/src/index.ts +1 -7
- package/src/meta.ts +29 -8
- 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 +11 -3
- package/src/processor/processor.node.test.ts +41 -0
- package/src/processor/processor.ts +284 -160
- 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 +214 -191
- 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 +160 -87
- package/src/types/Assistant.ts +17 -54
- 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/BlueprintArticle-IMCR3642.mjs +0 -36
- package/dist/lib/browser/BlueprintArticle-IMCR3642.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-JYD2RIBJ.mjs +0 -158
- package/dist/lib/browser/ChatCompanion-JYD2RIBJ.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-XCPBWYIR.mjs +0 -77
- package/dist/lib/browser/ChatContainer-XCPBWYIR.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-DT7KFCRL.mjs +0 -90
- package/dist/lib/browser/ChatDialog-DT7KFCRL.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-45QX25Y5.mjs +0 -59
- package/dist/lib/browser/PromptArticle-45QX25Y5.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-VZEXMDTY.mjs +0 -199
- package/dist/lib/browser/app-graph-builder-VZEXMDTY.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-5FT5JGPY.mjs +0 -12
- package/dist/lib/browser/chunk-2BOE3OTW.mjs +0 -262
- package/dist/lib/browser/chunk-2BOE3OTW.mjs.map +0 -7
- package/dist/lib/browser/chunk-BNTPFZ7O.mjs +0 -229
- package/dist/lib/browser/chunk-BNTPFZ7O.mjs.map +0 -7
- package/dist/lib/browser/chunk-FJQ4ZRYJ.mjs +0 -335
- package/dist/lib/browser/chunk-FJQ4ZRYJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-IXIIS4QA.mjs +0 -176
- package/dist/lib/browser/chunk-IXIIS4QA.mjs.map +0 -7
- package/dist/lib/browser/chunk-LRE4VEZV.mjs +0 -16
- package/dist/lib/browser/chunk-LRE4VEZV.mjs.map +0 -7
- package/dist/lib/browser/chunk-U62BTGDF.mjs +0 -1929
- package/dist/lib/browser/chunk-U62BTGDF.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBG5PTSX.mjs +0 -23
- package/dist/lib/browser/chunk-WBG5PTSX.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -382
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-AK5O4GUW.mjs +0 -143
- package/dist/lib/browser/intent-resolver-AK5O4GUW.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-YCSR2MSR.mjs +0 -98
- package/dist/lib/browser/react-surface-YCSR2MSR.mjs.map +0 -7
- package/dist/lib/browser/settings-NYJGNQ5I.mjs +0 -23
- package/dist/lib/browser/settings-NYJGNQ5I.mjs.map +0 -7
- package/dist/lib/browser/state-GG7Z3NB7.mjs +0 -25
- package/dist/lib/browser/state-GG7Z3NB7.mjs.map +0 -7
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs +0 -17
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -19
- package/dist/lib/node-esm/BlueprintArticle-OL2HUY6Q.mjs +0 -37
- package/dist/lib/node-esm/BlueprintArticle-OL2HUY6Q.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-AHKJS25S.mjs +0 -159
- package/dist/lib/node-esm/ChatCompanion-AHKJS25S.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-K7OGPE3G.mjs +0 -78
- package/dist/lib/node-esm/ChatContainer-K7OGPE3G.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QT6ZBX45.mjs +0 -91
- package/dist/lib/node-esm/ChatDialog-QT6ZBX45.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-OUKFSJQV.mjs +0 -60
- package/dist/lib/node-esm/PromptArticle-OUKFSJQV.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-VRN6ESRR.mjs +0 -200
- package/dist/lib/node-esm/app-graph-builder-VRN6ESRR.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-XW6QQVLV.mjs +0 -13
- package/dist/lib/node-esm/chunk-3Q22TTXW.mjs +0 -264
- package/dist/lib/node-esm/chunk-3Q22TTXW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AB74FOA2.mjs +0 -230
- package/dist/lib/node-esm/chunk-AB74FOA2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BHS747K7.mjs +0 -1930
- package/dist/lib/node-esm/chunk-BHS747K7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-KJGD4EBJ.mjs +0 -336
- package/dist/lib/node-esm/chunk-KJGD4EBJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UXTUHH24.mjs +0 -178
- package/dist/lib/node-esm/chunk-UXTUHH24.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs +0 -25
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YWFWT57N.mjs +0 -17
- package/dist/lib/node-esm/chunk-YWFWT57N.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 -383
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-L2F3N45L.mjs +0 -144
- package/dist/lib/node-esm/intent-resolver-L2F3N45L.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-CTW44GEM.mjs +0 -99
- package/dist/lib/node-esm/react-surface-CTW44GEM.mjs.map +0 -7
- package/dist/lib/node-esm/settings-RRHYI5KO.mjs +0 -24
- package/dist/lib/node-esm/settings-RRHYI5KO.mjs.map +0 -7
- package/dist/lib/node-esm/state-FSUHFMDM.mjs +0 -26
- package/dist/lib/node-esm/state-FSUHFMDM.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs +0 -18
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -20
- package/dist/types/src/capabilities/capabilities.d.ts +0 -10
- 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/BlueprintArticle.d.ts +0 -7
- package/dist/types/src/components/BlueprintArticle.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 -14
- 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/PromptArticle.d.ts +0 -7
- package/dist/types/src/components/PromptArticle.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/object-list.d.ts +0 -10
- package/dist/types/src/functions/object-list.d.ts.map +0 -1
- package/dist/types/src/functions/object-load.d.ts +0 -8
- package/dist/types/src/functions/object-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 -132
- 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 -185
- package/src/capabilities/capabilities.ts +0 -17
- package/src/capabilities/intent-resolver.ts +0 -147
- package/src/components/BlueprintArticle.tsx +0 -29
- package/src/components/ChatCompanion.tsx +0 -155
- package/src/components/ChatContainer.tsx +0 -61
- package/src/components/ChatProgress/ChatProgress.tsx +0 -67
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/components/PromptArticle.tsx +0 -51
- package/src/events.ts +0 -11
- package/src/functions/analysis.ts +0 -22
- package/src/functions/index.ts +0 -7
- package/src/functions/object-list.ts +0 -48
- package/src/functions/object-load.ts +0 -45
- package/src/hooks/useItemTypes.ts +0 -37
- package/src/processor/processor.test.ts +0 -71
- package/src/processor/update-name.ts +0 -56
- package/src/types/AssistantAction.ts +0 -79
- package/src/types/defs.ts +0 -5
- /package/dist/lib/{browser/blueprint-definition-5FT5JGPY.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-XW6QQVLV.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
|
@@ -0,0 +1,678 @@
|
|
|
1
|
+
# Trace Execution Graph — Specification
|
|
2
|
+
|
|
3
|
+
This document specifies the pure-data layer that powers the `TracePanel` Timeline view.
|
|
4
|
+
Source: `packages/plugins/plugin-assistant/src/execution-graph/`.
|
|
5
|
+
|
|
6
|
+
## 1. Purpose & scope
|
|
7
|
+
|
|
8
|
+
The module converts a flat list of `Trace.Message` records (and a snapshot of active
|
|
9
|
+
processes) into a Mercurial/Git-style commit graph consumable by the
|
|
10
|
+
`@dxos/react-ui-components` `Timeline` component.
|
|
11
|
+
|
|
12
|
+
In scope:
|
|
13
|
+
|
|
14
|
+
- Hierarchical grouping of trace events into spans (`buildSpanTree`).
|
|
15
|
+
- Translation of the span tree into commits + branches with explicit parent edges
|
|
16
|
+
(`buildExecutionGraph` → `spanTreeToCommits`).
|
|
17
|
+
- A commit-query DSL (`CommitSelector`) used internally for parent computation.
|
|
18
|
+
- A `details` map exposing the underlying `Trace.FlatEvent` for each commit
|
|
19
|
+
(used by the inspector / Syntax pane).
|
|
20
|
+
|
|
21
|
+
Out of scope:
|
|
22
|
+
|
|
23
|
+
- React rendering, styling, layout.
|
|
24
|
+
- Trace transport, persistence, or feed queries (the panel reads these via ECHO atoms).
|
|
25
|
+
- Filtering / search of commits.
|
|
26
|
+
- Mutating, ack-ing, or replaying trace events.
|
|
27
|
+
|
|
28
|
+
Inputs: `traceMessages: Trace.Message[]`, `activeProcesses?: Process.Info[]`, `eventLimit?: number`.
|
|
29
|
+
Output: `ExecutionGraph = { branches, commits, spanTree, details }`.
|
|
30
|
+
|
|
31
|
+
## 2. Inputs
|
|
32
|
+
|
|
33
|
+
### 2.1 `Trace.Message`
|
|
34
|
+
|
|
35
|
+
Defined in `packages/core/compute/compute/src/Trace.ts#L154`.
|
|
36
|
+
A `Message` is `{ meta: Meta, isEphemeral: boolean, events: Event[] }`. The builder
|
|
37
|
+
flattens via `Trace.flatten` (`Trace.ts#L178`) so every event inherits its message's
|
|
38
|
+
`meta` — there is no per-event meta override.
|
|
39
|
+
|
|
40
|
+
`Meta` fields (`Trace.ts#L102`):
|
|
41
|
+
|
|
42
|
+
| Field | Read by the builder | Purpose |
|
|
43
|
+
| ---------------- | ---------------------------------------- | ---------------------------------------------------------------------------- |
|
|
44
|
+
| `pid` | Yes | Identifies the span the event belongs to and the branch the commit lives on. |
|
|
45
|
+
| `parentPid` | Yes | Links a span to its parent span at begin time. |
|
|
46
|
+
| `processName` | No (carried in `SpanMeta` for consumers) | — |
|
|
47
|
+
| `space` | No | — |
|
|
48
|
+
| `conversationId` | No (carried in `SpanMeta`) | — |
|
|
49
|
+
| `triggerId` | No (carried in `SpanMeta`) | — |
|
|
50
|
+
| `toolCallId` | No (carried in `SpanMeta`) | — |
|
|
51
|
+
| `runtimeName` | No (carried in `SpanMeta`) | — |
|
|
52
|
+
|
|
53
|
+
Only `pid` and `parentPid` participate in graph topology. The remaining fields are
|
|
54
|
+
forwarded as `SpanMeta` for downstream display but never branch or anchor logic.
|
|
55
|
+
|
|
56
|
+
`isEphemeral` is preserved on `FlatEvent` but is not consulted; ephemeral events
|
|
57
|
+
participate exactly like persistent events.
|
|
58
|
+
|
|
59
|
+
### 2.2 `Process.Info` (active processes)
|
|
60
|
+
|
|
61
|
+
Defined in `packages/core/compute/compute/src/Process.ts#L365`.
|
|
62
|
+
Optional input via `activeProcesses` (defaults to `[]`). Fields the builder reads:
|
|
63
|
+
|
|
64
|
+
- `pid` — used both as a commit-id suffix and as the branch name for the spinner.
|
|
65
|
+
- `key` — compared against `AGENT_PROCESS_KEY` (`'org.dxos.testing.process.agent'`,
|
|
66
|
+
`packages/core/compute/functions-runtime/src/agent-service/agent-process.ts#L54`).
|
|
67
|
+
- `state` — gated on `Process.State.RUNNING` and `Process.State.HYBERNATING`
|
|
68
|
+
(spelling matches the runtime; `Process.ts#L321`).
|
|
69
|
+
- `params.target` — non-null required for the agent special case.
|
|
70
|
+
|
|
71
|
+
`parentPid`, `error`, `startedAt`, `completedAt`, `metrics` are ignored.
|
|
72
|
+
|
|
73
|
+
### 2.3 Configuration
|
|
74
|
+
|
|
75
|
+
- `buildExecutionGraph` defaults `eventLimit = 500`
|
|
76
|
+
(`execution-graph.ts#L94`).
|
|
77
|
+
- `TracePanel`'s `getExecutionGraph` defaults `eventLimit = 300`
|
|
78
|
+
(`TracePanel.tsx#L153`).
|
|
79
|
+
- The cap targets `Timeline` rendering cost, not memory; see §11 for what it bounds.
|
|
80
|
+
|
|
81
|
+
## 3. Outputs
|
|
82
|
+
|
|
83
|
+
### 3.1 `ExecutionGraph`
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
export type ExecutionGraph = {
|
|
87
|
+
branches: string[];
|
|
88
|
+
commits: Commit[];
|
|
89
|
+
spanTree: Span;
|
|
90
|
+
details: ExecutionGraphDetailsMap;
|
|
91
|
+
};
|
|
92
|
+
export type ExecutionGraphDetailsMap = Record<string, Trace.FlatEvent | undefined>;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
- `branches` — every branch name a commit was placed on; `'main'` is always present
|
|
96
|
+
(the builder seeds it). Order is insertion order from the underlying `Set`.
|
|
97
|
+
- `commits` — flat list, may be unordered (consumers should not rely on order; the
|
|
98
|
+
`Timeline` sorts by parent topology). Deduped by id.
|
|
99
|
+
- `spanTree` — the hierarchical intermediate representation; exposed for debug views.
|
|
100
|
+
- `details` — commit id → originating `Trace.FlatEvent`. Used by `TracePanel` to
|
|
101
|
+
render the Syntax pane when a commit is selected (`TracePanel.tsx#L118`). Only
|
|
102
|
+
commits that were emitted via `presentEvent` appear here.
|
|
103
|
+
|
|
104
|
+
### 3.2 `Commit` (set fields only)
|
|
105
|
+
|
|
106
|
+
From `packages/ui/react-ui-components/src/components/Timeline/Timeline.tsx#L40`. The
|
|
107
|
+
builder sets:
|
|
108
|
+
|
|
109
|
+
- `id` — see §9.
|
|
110
|
+
- `branch` — pid-derived (see §6).
|
|
111
|
+
- `parents` — see §8.
|
|
112
|
+
- `timestamp` — `new Date(event.timestamp)` (events) or `new Date()` (spinners).
|
|
113
|
+
- `icon`, `level`, `message` — from `presentEvent`.
|
|
114
|
+
|
|
115
|
+
The builder does not set `tags` or `link`. `CommitSelector.tag` / `.anyTags` exist
|
|
116
|
+
for consumers that add their own tags downstream.
|
|
117
|
+
|
|
118
|
+
## 4. Event classification
|
|
119
|
+
|
|
120
|
+
Two type sets defined in `span-tree.ts#L47`:
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
export const BEGIN_EVENT_TYPES = new Set([Trace.OperationStart.key, AgentRequestBegin.key]);
|
|
124
|
+
export const END_EVENT_TYPES = new Set([Trace.OperationEnd.key, AgentRequestEnd.key]);
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
- **Begin events**: `operation.start`, `assistant.agentRequestBegin`. Open a span.
|
|
128
|
+
- **End events**: `operation.end`, `assistant.agentRequestEnd`. Close a span.
|
|
129
|
+
- **Middle events**: every other event type carried by a `meta.pid`. Attached to the
|
|
130
|
+
currently-open span for that pid.
|
|
131
|
+
- **Pid-less events**: any event whose `meta.pid` is `undefined`. Attached to the
|
|
132
|
+
synthetic root span.
|
|
133
|
+
|
|
134
|
+
### 4.1 Which events produce commits (`presentEvent`)
|
|
135
|
+
|
|
136
|
+
`execution-graph.ts#L118`. Each branch validates `event.data` against the
|
|
137
|
+
event-type schema; on validation failure the event is silently dropped (log only).
|
|
138
|
+
|
|
139
|
+
| Event type | Condition | Icon | Level | Message | `idSuffix` |
|
|
140
|
+
| ------------------------------ | ----------------------- | ----------------------- | --------- | ------------------------------- | ------------------- |
|
|
141
|
+
| `AgentRequestBegin` | — | `ph--atom--regular` | `VERBOSE` | `"Agent processing request..."` | — |
|
|
142
|
+
| `AgentRequestEnd` | — | `ph--atom--regular` | `INFO` | `"Agent completed request"` | — |
|
|
143
|
+
| `CompleteBlock` text | `role === 'user'` | `ph--user--regular` | `VERBOSE` | trimmed `block.text` | — |
|
|
144
|
+
| `CompleteBlock` text | `role !== 'user'` | — (drop) | — | — | — |
|
|
145
|
+
| `CompleteBlock` status | — | `ph--info--regular` | `VERBOSE` | trimmed `block.statusText` | — |
|
|
146
|
+
| `CompleteBlock` other | — | — (drop) | — | — | — |
|
|
147
|
+
| `Trace.OperationStart` | — | `ph--function--regular` | `VERBOSE` | `data.name ?? data.key` | `${data.key}:start` |
|
|
148
|
+
| `Trace.OperationEnd` (success) | `outcome === 'success'` | `ph--function--regular` | `INFO` | `${name ?? key} - Success` | `${data.key}:end` |
|
|
149
|
+
| `Trace.OperationEnd` (failure) | `outcome !== 'success'` | `ph--function--regular` | `ERROR` | `${name ?? key} - Error` | `${data.key}:end` |
|
|
150
|
+
| anything else | — | — (drop) | — | — | — |
|
|
151
|
+
|
|
152
|
+
`trimText` clips to first 100 chars, trims whitespace, drops everything after the
|
|
153
|
+
first newline (`execution-graph.ts#L438`).
|
|
154
|
+
|
|
155
|
+
Dropped events (non-`presentEvent` types or filtered roles) never appear in
|
|
156
|
+
`commits` or `details`, but they remain in `spanTree.events`.
|
|
157
|
+
|
|
158
|
+
## 5. Span tree construction (`buildSpanTree`)
|
|
159
|
+
|
|
160
|
+
`span-tree.ts#L112`. Algorithm:
|
|
161
|
+
|
|
162
|
+
1. **Flatten** every message: `messages.flatMap(Trace.flatten)`. Each output is a
|
|
163
|
+
`FlatEvent` carrying the message's `meta` and `isEphemeral`.
|
|
164
|
+
2. **Sort** the flat stream chronologically by `event.timestamp` ascending. The
|
|
165
|
+
sort is in-place and uses subtraction (no NaN guard); identical timestamps
|
|
166
|
+
keep their relative order as `Array.prototype.sort` is stable in modern V8.
|
|
167
|
+
3. **Apply `eventLimit`** (see §5.2). Boundary events are immune.
|
|
168
|
+
4. **Linear scan** the (possibly trimmed) stream:
|
|
169
|
+
- Pid-less event → push onto root.
|
|
170
|
+
- Begin event with pid `P`, parentPid `Q`:
|
|
171
|
+
- Parent span = `openSpans.get(Q)` if `Q` is defined and open, else root.
|
|
172
|
+
- Allocate a fresh id `${P}#${spanCounter++}` and create the span.
|
|
173
|
+
- Push the begin event as the span's first event.
|
|
174
|
+
- **`openSpans.set(P, newSpan)`** — supersedes any previously open span for
|
|
175
|
+
this pid.
|
|
176
|
+
- End event with pid `P`:
|
|
177
|
+
- If a span is open for `P`: push the end event onto it and `openSpans.delete(P)`.
|
|
178
|
+
- Else: push the end event onto root (orphan end).
|
|
179
|
+
- Other event with pid `P`:
|
|
180
|
+
- If a span is open for `P`: push onto it.
|
|
181
|
+
- Else: push onto root.
|
|
182
|
+
5. **Sort children** of every span by `firstTimestamp` ascending (depth-first).
|
|
183
|
+
Determinism guarantee.
|
|
184
|
+
|
|
185
|
+
The `MutableSpan.firstTimestamp` is updated on every push via `noteTimestamp`
|
|
186
|
+
(`Math.min` against the current value, init `+Infinity`). Used only for sibling
|
|
187
|
+
ordering.
|
|
188
|
+
|
|
189
|
+
Spans are frozen via `freezeSpan` into the public `Span` shape; the
|
|
190
|
+
`firstTimestamp` field is internal and not exposed.
|
|
191
|
+
|
|
192
|
+
### 5.1 Same-pid sequential spans
|
|
193
|
+
|
|
194
|
+
Multiple complete begin/end pairs sharing a `pid` become **sibling spans under the
|
|
195
|
+
same parent**. The second begin orphans the first because `openSpans.set(pid, …)`
|
|
196
|
+
unconditionally supersedes. This is intended for _sequential_ execution within
|
|
197
|
+
one process (e.g. successive agent requests in a session) — not interleaved.
|
|
198
|
+
Each sibling receives a distinct synthetic id (`${pid}#${n}`); the shared `pid`
|
|
199
|
+
is preserved in `SpanMeta` and used for branch derivation (§6) so siblings share
|
|
200
|
+
a lane.
|
|
201
|
+
|
|
202
|
+
Test reference: `span-tree.test.ts#L80` ('sequential agent requests in one process
|
|
203
|
+
become sibling spans').
|
|
204
|
+
|
|
205
|
+
### 5.2 `eventLimit` semantics
|
|
206
|
+
|
|
207
|
+
`applyEventLimit` (`span-tree.ts#L211`) — runs _after_ chronological sort, _before_
|
|
208
|
+
tree construction.
|
|
209
|
+
|
|
210
|
+
Rule: only **non-boundary** events count toward `eventLimit`. Span boundaries
|
|
211
|
+
(`OperationStart` / `OperationEnd` / `AgentRequestBegin` / `AgentRequestEnd`) are
|
|
212
|
+
**always retained** regardless of the cap.
|
|
213
|
+
|
|
214
|
+
Why: dropping a begin event detaches every descendant whose `parentPid` lookup
|
|
215
|
+
fails — those children would fall back to root and re-render as top-level spans.
|
|
216
|
+
Dropping an end leaves a span open and corrupts the open-span map for any later
|
|
217
|
+
same-pid sibling. The motivating regression is documented in `remote-snapshot.test.ts`
|
|
218
|
+
(commit `eae07dad83`, "enhance event limit handling").
|
|
219
|
+
|
|
220
|
+
When the non-boundary count exceeds `eventLimit`, the _oldest_ non-boundary events
|
|
221
|
+
are dropped while preserving chronological order. Test reference:
|
|
222
|
+
`span-tree.test.ts#L134` ('eventLimit drops oldest non-boundary events but always
|
|
223
|
+
retains span boundaries') and `#L159` (regression for parent-child preservation).
|
|
224
|
+
|
|
225
|
+
### 5.3 Children ordering
|
|
226
|
+
|
|
227
|
+
Sibling spans are sorted by `firstTimestamp` ascending so output is deterministic
|
|
228
|
+
across runs that share inputs. Test: `span-tree.test.ts#L120`.
|
|
229
|
+
|
|
230
|
+
## 6. Span branch assignment (`branchOf`)
|
|
231
|
+
|
|
232
|
+
`execution-graph.ts#L263`. Pure function on a span:
|
|
233
|
+
|
|
234
|
+
1. `span === null` or `span.id === ROOT_SPAN_ID` → `MAIN_BRANCH = 'main'`.
|
|
235
|
+
2. Else → `span.meta.pid ?? span.id`.
|
|
236
|
+
|
|
237
|
+
Consequence: sequential same-pid sibling spans share a branch (their `meta.pid`
|
|
238
|
+
matches). Spans whose meta lacks a `pid` (synthetic / unusual cases) fall back to
|
|
239
|
+
the synthetic span id — guaranteeing a non-empty branch name.
|
|
240
|
+
|
|
241
|
+
The synthetic root id is `ROOT_SPAN_ID = '<main>'` (`span-tree.ts#L12`).
|
|
242
|
+
|
|
243
|
+
## 7. Collapsibility (`isCollapsibleSpan`)
|
|
244
|
+
|
|
245
|
+
`execution-graph.ts#L206`. A span is collapsible iff **all** of:
|
|
246
|
+
|
|
247
|
+
1. `span.id !== ROOT_SPAN_ID`.
|
|
248
|
+
2. `span.events.length === 2`.
|
|
249
|
+
3. `span.children.length === 0`.
|
|
250
|
+
4. `events[0]` is a begin event (`isSpanBeginEvent`).
|
|
251
|
+
5. `events[events.length-1]` is an end event (`isSpanEndEvent`).
|
|
252
|
+
6. `parent !== null` (i.e. the span has a parent in the tree).
|
|
253
|
+
|
|
254
|
+
Implication: a span whose end event hasn't arrived yet (pending) **never**
|
|
255
|
+
collapses, because its trailing event is a middle event, not an end. This matters
|
|
256
|
+
because the trailing middle event would otherwise be promoted to the parent
|
|
257
|
+
branch as a fake "end" commit — corrupting the visual. See test
|
|
258
|
+
`execution-graph.test.ts#L296` ('pending span with user message → user lands on
|
|
259
|
+
own branch, not parent').
|
|
260
|
+
|
|
261
|
+
Top-level spans (parent === root) **are** eligible — guard #6 only forbids
|
|
262
|
+
parent-less spans. A top-level operation with no inner events collapses to a
|
|
263
|
+
single end commit on `main` (test `execution-graph.test.ts#L194`).
|
|
264
|
+
|
|
265
|
+
## 8. Commit anchoring rules (`spanTreeToCommits`)
|
|
266
|
+
|
|
267
|
+
`execution-graph.ts#L239`. Walks the entire tree once via `walkSpanTree`, flattens
|
|
268
|
+
into a single chronological stream (sorted by `timestamp`, ties broken by
|
|
269
|
+
`globalIndex` = insertion order), then emits commits in that order. Each
|
|
270
|
+
emission depends on the event's role and the host span's collapsibility:
|
|
271
|
+
|
|
272
|
+
### 8.1 Root-level events (pid-less or orphans)
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
branch = 'main'
|
|
276
|
+
parents = lastInSpanContext(null) // i.e. tail of main
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### 8.2 Collapsible span — begin event
|
|
280
|
+
|
|
281
|
+
Skipped entirely. Only the end commit is emitted.
|
|
282
|
+
|
|
283
|
+
### 8.3 Collapsible span — end event
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
branch = parentBranch
|
|
287
|
+
parents = lastInSpanContext(parentSpan)
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Anchors to the parent's structural context (own-branch tail → parent's begin →
|
|
291
|
+
recurse). Critically, it does _not_ anchor to the immediate parent-branch tail,
|
|
292
|
+
because that tail could be a sibling span's commit; structural anchoring keeps
|
|
293
|
+
the fork visually attached to the correct span identity.
|
|
294
|
+
|
|
295
|
+
### 8.4 Non-collapsible begin event
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
branch = parentBranch // fork lives on the parent branch
|
|
299
|
+
parents = lastInSpanContext(parentSpan)
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
After emission: `beginCommitIdBySpan.set(span.id, commitId)` so any future
|
|
303
|
+
`lastInSpanContext(span)` call can fall back to this commit.
|
|
304
|
+
|
|
305
|
+
### 8.5 Non-collapsible end event — two parents
|
|
306
|
+
|
|
307
|
+
```
|
|
308
|
+
branch = parentBranch
|
|
309
|
+
parents = unionAll(
|
|
310
|
+
last commit on parentBranch, // chronological continuity on parent
|
|
311
|
+
last commit on ownBranch, // merge sub-flow back in
|
|
312
|
+
)
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
Parent #1 is the **immediate predecessor on the parent branch**, not the matching
|
|
316
|
+
begin commit. Pointing back to the begin would draw an edge that skips over any
|
|
317
|
+
sibling spans' commits emitted between begin and end (e.g. two top-level Routine
|
|
318
|
+
spans overlapping on `main`: R1.end would otherwise arrow back to R1.begin
|
|
319
|
+
crossing over R2.begin). Anchoring to the previous parent-branch commit keeps
|
|
320
|
+
main linear. Regression: commit `ff8db16d9c`, test
|
|
321
|
+
`remote-snapshot.test.ts#L49`.
|
|
322
|
+
|
|
323
|
+
### 8.6 Middle event
|
|
324
|
+
|
|
325
|
+
```
|
|
326
|
+
branch = ownBranch
|
|
327
|
+
parents = lastInSpanContext(span)
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
The first middle event of a span thereby forks from its own begin commit
|
|
331
|
+
(via `lastInSpanContext` fallback #2) rather than from a sibling's commit on
|
|
332
|
+
some shared ancestor.
|
|
333
|
+
|
|
334
|
+
### 8.7 `lastInSpanContext(span)` helper
|
|
335
|
+
|
|
336
|
+
`execution-graph.ts#L282`. Structural (pid-keyed) walk, _not_ topological:
|
|
337
|
+
|
|
338
|
+
```ts
|
|
339
|
+
lastInSpanContext(null) = branch('main').compose(last());
|
|
340
|
+
lastInSpanContext(span) = firstOf(
|
|
341
|
+
branch(branchOf(span)).compose(last()), // (a) own-branch tail
|
|
342
|
+
beginCommitIdBySpan.get(span.id), // (b) span's own begin commit
|
|
343
|
+
lastInSpanContext(parent(span)), // (c) recurse to parent
|
|
344
|
+
);
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
Why structural and not topological: if a sub-span of agent A fires before A has
|
|
348
|
+
emitted any middle commits, walking the parent's shared branch topologically
|
|
349
|
+
could land on a commit belonging to an unrelated sibling B (a different top-level
|
|
350
|
+
span sharing `main`). Structural anchoring guarantees the fork edge attaches to
|
|
351
|
+
A's identity (`A.begin`) regardless of B's interleaving. Commit `ff8db16d9c`.
|
|
352
|
+
|
|
353
|
+
## 9. Commit id format (`formatCommitId`)
|
|
354
|
+
|
|
355
|
+
`execution-graph.ts#L433`:
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
${span.id}:${globalIndex} // base
|
|
359
|
+
${span.id}:${globalIndex}:${suffix} // when EventPresentation.idSuffix is set
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
`globalIndex` is the index of the event in the post-sort flat stream — unique by
|
|
363
|
+
construction. `idSuffix` comes from `presentEvent`:
|
|
364
|
+
|
|
365
|
+
- `OperationStart` → `${data.key}:start`
|
|
366
|
+
- `OperationEnd` → `${data.key}:end`
|
|
367
|
+
- everything else → none
|
|
368
|
+
|
|
369
|
+
The suffix exists so a span hosting multiple sub-operations sharing the same
|
|
370
|
+
parent span id but different operation keys still produces distinct commit ids,
|
|
371
|
+
which the `Timeline` requires.
|
|
372
|
+
|
|
373
|
+
## 10. Active-process "running" indicators
|
|
374
|
+
|
|
375
|
+
After commit emission, `spanTreeToCommits` appends spinner commits for each
|
|
376
|
+
process in `activeProcesses` (`execution-graph.ts#L397`):
|
|
377
|
+
|
|
378
|
+
### 10.1 Agent special case
|
|
379
|
+
|
|
380
|
+
When **all** of:
|
|
381
|
+
|
|
382
|
+
- `process.key === AGENT_PROCESS_KEY` (`'org.dxos.testing.process.agent'`),
|
|
383
|
+
- `process.params.target` is truthy,
|
|
384
|
+
- `process.state ∈ { RUNNING, HYBERNATING }`,
|
|
385
|
+
|
|
386
|
+
emit:
|
|
387
|
+
|
|
388
|
+
```ts
|
|
389
|
+
{
|
|
390
|
+
id: `running:${process.pid}`,
|
|
391
|
+
branch: process.pid,
|
|
392
|
+
parents: last commit on branch(process.pid),
|
|
393
|
+
icon: 'ph--spinner-gap--regular',
|
|
394
|
+
level: VERBOSE,
|
|
395
|
+
message: 'Generating...',
|
|
396
|
+
timestamp: new Date(),
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
The branch is added by `addCommit` if it didn't already exist. This is the only
|
|
401
|
+
case where a spinner can introduce a new branch from thin air — the agent
|
|
402
|
+
process's pid always identifies a known conversational lane.
|
|
403
|
+
|
|
404
|
+
### 10.2 Generic running process
|
|
405
|
+
|
|
406
|
+
For any other process with `state === RUNNING` **and** `builder.hasBranch(process.pid)`,
|
|
407
|
+
emit the same shape with `message: 'Running...'`.
|
|
408
|
+
|
|
409
|
+
The branch-exists guard prevents fabricating empty branches for processes that
|
|
410
|
+
have not emitted any trace events yet. (The agent case bypasses this guard
|
|
411
|
+
because the agent's branch is its conversation lane, which we want surfaced
|
|
412
|
+
even when no events have arrived.)
|
|
413
|
+
|
|
414
|
+
`HYBERNATING` (note the runtime spelling) qualifies for the agent spinner but
|
|
415
|
+
not for the generic one — the generic case demands strictly `RUNNING`.
|
|
416
|
+
|
|
417
|
+
## 11. Graph hygiene (`GraphBuilder.doctor`)
|
|
418
|
+
|
|
419
|
+
`execution-graph.ts#L610`. Run once at `build()`:
|
|
420
|
+
|
|
421
|
+
1. **Dedupe commits by `id`** via `Array.dedupeWith`. The first occurrence wins;
|
|
422
|
+
subsequent commits with the same id are dropped. `addCommit` is purely
|
|
423
|
+
append-only, so dedupe is the safety net when an event slips past the unique
|
|
424
|
+
`globalIndex` guarantee (e.g. spinner ids reused if two snapshots collide on
|
|
425
|
+
the same pid — not currently possible but cheap to guard).
|
|
426
|
+
2. **Drop dangling parents** — for each surviving commit, filter `parents` to
|
|
427
|
+
ids that exist in the deduped commit set.
|
|
428
|
+
|
|
429
|
+
This matters when `eventLimit` trimming leaves an end commit whose own-branch
|
|
430
|
+
tail (the merge parent) was dropped — without doctor, the timeline component
|
|
431
|
+
would receive a parent id that doesn't resolve. Also defensive against partial
|
|
432
|
+
fixtures used in tests / Storybook stories.
|
|
433
|
+
|
|
434
|
+
`addBranch` is invoked by `addCommit` (`#L592`), so a branch is only present in
|
|
435
|
+
`branches` if at least one commit was written to it. `addBranch` is also called
|
|
436
|
+
explicitly for `MAIN_BRANCH` at the very start so `branches` always contains
|
|
437
|
+
`'main'`.
|
|
438
|
+
|
|
439
|
+
## 12. `CommitSelector` DSL
|
|
440
|
+
|
|
441
|
+
`execution-graph.ts#L442`. A `CommitSelector` is a pipeable wrapper around
|
|
442
|
+
`(commits: Commit[]) => Commit[]`. All selectors are pure and never mutate the
|
|
443
|
+
input.
|
|
444
|
+
|
|
445
|
+
| Combinator | Semantics |
|
|
446
|
+
| ----------------------- | ------------------------------------------------------------------------------------------------- |
|
|
447
|
+
| `make(fn)` | Wrap an arbitrary selector function; sets up `.pipe`. |
|
|
448
|
+
| `identity()` | Returns the input array unchanged. |
|
|
449
|
+
| `filter(pred)` | Keeps commits where `pred(commit)` is truthy. |
|
|
450
|
+
| `id(id)` | `filter(c => c.id === id)`. |
|
|
451
|
+
| `tag(t)` | `filter(c => t && c.tags?.includes(t))`. Falsy `t` (`undefined` / `null` / `false`) yields empty. |
|
|
452
|
+
| `anyTags(ts)` | `filter(c => ts.some(t => t && c.tags?.includes(t)))`. |
|
|
453
|
+
| `branch(b)` | `filter(c => b && c.branch === b)`. Falsy `b` yields empty (same foot-gun as `tag`). |
|
|
454
|
+
| `compose(next)` | Pipe: `next(prev(commits))`. Used as `prev.pipe(compose(next))`. |
|
|
455
|
+
| `orElse(next)` | If `prev` is non-empty return `prev`, else `next`. Equivalent to `firstOf(prev, next)`. |
|
|
456
|
+
| `andAlso(next)` | Alias for `unionAll(prev, next)`. |
|
|
457
|
+
| `first(n=1)` | `commits.slice(0, n)`. |
|
|
458
|
+
| `last(n=1)` | `commits.toReversed().slice(0, n)` — **note reversed order**. |
|
|
459
|
+
| `not(sel)` | `commits.filter(c => !sel(commits).includes(c))`. |
|
|
460
|
+
| `unionAll(...sels)` | Concat results, dedupe by `id`. |
|
|
461
|
+
| `intersectAll(...sels)` | First selector's hits that also appear in every other selector's hits (by id). |
|
|
462
|
+
| `firstOf(...sels)` | First selector that returns a non-empty result; else empty. |
|
|
463
|
+
|
|
464
|
+
Foot-guns:
|
|
465
|
+
|
|
466
|
+
- `last(n)` returns commits in **reverse chronological order** (most recent first).
|
|
467
|
+
Callers wanting the "single most recent commit on branch X" use
|
|
468
|
+
`branch(X).pipe(compose(last()))` and the array's first element. Internally
|
|
469
|
+
`computeParents` only consumes the ids and dedupes (`#L599`), so reverse-order
|
|
470
|
+
is invisible there.
|
|
471
|
+
- `tag` / `branch` accept falsy inputs intentionally (the union type is
|
|
472
|
+
`string | Falsy`) so `tag(maybeUndefined)` is a no-op rather than a type error.
|
|
473
|
+
- All selectors are immutable; `identity().select(input)` does not mutate
|
|
474
|
+
`input` (`execution-graph.test.ts#L56`).
|
|
475
|
+
|
|
476
|
+
## 13. Edge cases (exhaustive)
|
|
477
|
+
|
|
478
|
+
Each entry: **scenario → expected output → rationale**.
|
|
479
|
+
|
|
480
|
+
1. **Empty `traceMessages`**
|
|
481
|
+
- Tree: root span with no events, no children.
|
|
482
|
+
- `commits = []`, `branches = ['main']`.
|
|
483
|
+
- Why: `MAIN_BRANCH` is seeded by `addBranch` (`execution-graph.ts#L245`)
|
|
484
|
+
even when no commits exist. Test: `execution-graph.test.ts#L188`.
|
|
485
|
+
|
|
486
|
+
2. **Orphan end event** (end with no matching begin)
|
|
487
|
+
- Attached to root in `spanTree`; produces a single root-level commit on
|
|
488
|
+
`main`. Test: `span-tree.test.ts#L114`.
|
|
489
|
+
|
|
490
|
+
3. **Orphan middle event** (no open span for pid)
|
|
491
|
+
- Attached to root; commit emitted on `main` (if `presentEvent` returns
|
|
492
|
+
non-undefined). Test: `span-tree.test.ts#L107`.
|
|
493
|
+
|
|
494
|
+
4. **Two top-level spans overlapping in time, different pids**
|
|
495
|
+
- Two distinct branches off `main`; `main` stays linear; each end commit
|
|
496
|
+
merges its own-branch tail without skip-back edges across the sibling's
|
|
497
|
+
begin. Regression: commit `ff8db16d9c`, test `remote-snapshot.test.ts#L49`.
|
|
498
|
+
|
|
499
|
+
5. **Two top-level spans sequential, same pid**
|
|
500
|
+
- Sibling spans under root sharing the same branch (`branchOf` returns the
|
|
501
|
+
shared `pid`). The second begin's parent commit is the tail of that shared
|
|
502
|
+
branch — i.e. the first end commit on `main` plus the own-branch tail
|
|
503
|
+
(which is the first end on the same lane). Test:
|
|
504
|
+
`span-tree.test.ts#L80`; visual contract in
|
|
505
|
+
`trace-timeline.node.test.ts#L51` ('create objects via AgentService').
|
|
506
|
+
|
|
507
|
+
6. **Multiple sequential agent requests on one pid; sub-ops in the second session**
|
|
508
|
+
- Sub-op commits in the second session chain off the first session's
|
|
509
|
+
own-branch tail (because `branchOf` returns the shared pid). Visual
|
|
510
|
+
contract: `trace-timeline.node.test.ts#L122` ('sequential prompts in a
|
|
511
|
+
session') — note all three sessions share the `agent-1` branch lane.
|
|
512
|
+
|
|
513
|
+
7. **Parent begin dropped by `eventLimit` (pre-fix)**
|
|
514
|
+
- Before commit `eae07dad83`: the parent's begin event was sliced away when
|
|
515
|
+
verbose noise pushed it past the window. All descendants then re-parented
|
|
516
|
+
to root and rendered as top-level collapsed end commits on `main`.
|
|
517
|
+
- After the fix: boundaries are immune; the parent stays open and children
|
|
518
|
+
remain nested. Regression: `remote-snapshot.test.ts#L27`.
|
|
519
|
+
|
|
520
|
+
8. **Sub-op fires before parent has any middle commits**
|
|
521
|
+
- Sub-op's begin event anchors to its parent's `lastInSpanContext`. Lookup
|
|
522
|
+
order: parent's own-branch tail (absent) → parent's `beginCommitIdBySpan`
|
|
523
|
+
(present, this wins) → recurse to grandparent.
|
|
524
|
+
- Net effect: fork edge attaches to parent's begin commit.
|
|
525
|
+
|
|
526
|
+
9. **Sub-op fires after a sibling top-level span begins**
|
|
527
|
+
- Sub-op of A still anchors structurally to A (via `lastInSpanContext`),
|
|
528
|
+
not to whatever B-belonging commit happens to be the topological tail on
|
|
529
|
+
the shared ancestor branch. Commit `ff8db16d9c`.
|
|
530
|
+
|
|
531
|
+
10. **Collapsible span at root**
|
|
532
|
+
- `isCollapsibleSpan` returns `true` for top-level completed spans (parent
|
|
533
|
+
is root, not null). The span collapses to a single end commit on `main`.
|
|
534
|
+
Test: `execution-graph.test.ts#L194` ('top-level operation with no inner
|
|
535
|
+
events → collapsed to single end commit on main').
|
|
536
|
+
|
|
537
|
+
11. **Active process emits no trace events but appears in `activeProcesses`**
|
|
538
|
+
- Not the agent special case → no spinner (the branch doesn't exist, so the
|
|
539
|
+
`hasBranch` guard rejects). The process is invisible to the timeline.
|
|
540
|
+
- Is the agent special case → spinner appears on a brand-new branch named
|
|
541
|
+
after the pid.
|
|
542
|
+
|
|
543
|
+
12. **Identical timestamps on multiple events**
|
|
544
|
+
- Tie-break by `globalIndex` (insertion order before sort). Two layers:
|
|
545
|
+
`buildSpanTree` sorts the entire flat stream by `timestamp` only (stable
|
|
546
|
+
sort preserves insertion order); `spanTreeToCommits` sorts its event
|
|
547
|
+
stream by `timestamp` with explicit `globalIndex` tie-break
|
|
548
|
+
(`execution-graph.ts#L309`).
|
|
549
|
+
- Determinism is therefore guaranteed when input order is deterministic.
|
|
550
|
+
|
|
551
|
+
13. **`Trace.flatten` meta inheritance**
|
|
552
|
+
- Every `FlatEvent` carries its message's `meta` verbatim. There is no
|
|
553
|
+
per-event override mechanism. Events that need different meta must be
|
|
554
|
+
emitted as separate `Trace.Message`s.
|
|
555
|
+
|
|
556
|
+
14. **Pending span (begin without end)**
|
|
557
|
+
- Span is not collapsible (no trailing end event). Begin produces a fork
|
|
558
|
+
commit on the parent branch; middle events produce commits on the span's
|
|
559
|
+
own branch; no end commit is emitted. Test:
|
|
560
|
+
`execution-graph.test.ts#L296`.
|
|
561
|
+
|
|
562
|
+
15. **`CompleteBlock` with `role !== 'user'` text block**
|
|
563
|
+
- Dropped — no commit, no `details` entry. The event remains in
|
|
564
|
+
`spanTree.events`.
|
|
565
|
+
|
|
566
|
+
16. **`CompleteBlock` with unhandled block `_tag`**
|
|
567
|
+
- Dropped (neither `text` nor `status`).
|
|
568
|
+
|
|
569
|
+
17. **Schema-invalid event payload**
|
|
570
|
+
- Logged via `log('invalid trace event', …)` and dropped. The event still
|
|
571
|
+
occupies a position in `spanTree.events`.
|
|
572
|
+
|
|
573
|
+
## 14. Performance & complexity
|
|
574
|
+
|
|
575
|
+
- `buildSpanTree`: O(E log E) for the chronological sort, O(E) for the linear
|
|
576
|
+
scan, O(S log S) total over child sorts (S = span count). Memory O(E).
|
|
577
|
+
- `spanTreeToCommits`: O(E) walk of the tree + O(E log E) sort of the flat
|
|
578
|
+
stream. Commit emission is O(E) wall, but each emission's parent computation
|
|
579
|
+
is O(C) where C = current commit count (the selector linearly scans all
|
|
580
|
+
commits). Worst-case overall: O(E·C) — but in practice C ≪ E because most
|
|
581
|
+
events are dropped middle events with no `presentEvent` mapping, and
|
|
582
|
+
`lastInSpanContext` recursion depth equals tree depth D (typically ≤ 3-4).
|
|
583
|
+
- Expected scale: hundreds of commits, thousands of events. `eventLimit`
|
|
584
|
+
exists to bound `Timeline` rendering cost (DOM nodes, layout), not memory.
|
|
585
|
+
|
|
586
|
+
## 15. Known limitations & future work
|
|
587
|
+
|
|
588
|
+
- **Pending spans + active processes**: an end-commit-less span surfaces as
|
|
589
|
+
"Generating..." only for processes matching `AGENT_PROCESS_KEY`. Other
|
|
590
|
+
long-running spans must wait for their begin commit to land and the
|
|
591
|
+
generic `RUNNING + hasBranch` heuristic to trigger.
|
|
592
|
+
- **Interleaved same-pid begin/end pairs**: the data model assumes _sequential_
|
|
593
|
+
spans per pid. If a process emits `B1 B2 E1 E2` interleaved, the second `B2`
|
|
594
|
+
orphans the still-open `B1` (no `E1` ever closes the first span). The first
|
|
595
|
+
span receives only its begin event; the second receives `B2 E1 E2`.
|
|
596
|
+
Outcome: incorrect. Not currently supported.
|
|
597
|
+
- **Event types beyond `presentEvent`**: silently dropped from the commit
|
|
598
|
+
stream but retained in `spanTree.events`. Consumers wanting the full event
|
|
599
|
+
stream must read `spanTree`. Examples: `OperationInput`, `OperationOutput`,
|
|
600
|
+
`StatusUpdate`, `process.spawned`, `process.exited`, `assistant.mcpServerError`.
|
|
601
|
+
- **`details` only stores presented events**. Selecting a commit in TracePanel
|
|
602
|
+
shows that single event; there is no per-span aggregation surfaced via
|
|
603
|
+
`details`.
|
|
604
|
+
- **Same-pid sub-spans of one process**: a process that re-uses its own pid
|
|
605
|
+
for an inner operation (without supplying a distinct child pid via
|
|
606
|
+
`parentPid`) cannot be distinguished from sequential top-level spans.
|
|
607
|
+
- **Schema validation is silent**: invalid event payloads are dropped without
|
|
608
|
+
surfacing to the UI; only `log` records the drop.
|
|
609
|
+
|
|
610
|
+
## Appendix A: Source citations
|
|
611
|
+
|
|
612
|
+
| Symbol | File | Line |
|
|
613
|
+
| ------------------------------------------------------- | ---------------------------------------------------------------------------- | ----------- |
|
|
614
|
+
| `buildSpanTree` | `packages/plugins/plugin-assistant/src/execution-graph/span-tree.ts` | L112 |
|
|
615
|
+
| `applyEventLimit` | same | L211 |
|
|
616
|
+
| `ROOT_SPAN_ID` | same | L12 |
|
|
617
|
+
| `BEGIN_EVENT_TYPES`/`END_EVENT_TYPES` | same | L47 |
|
|
618
|
+
| `walkSpanTree`/`flattenSpanTree` | same | L245 |
|
|
619
|
+
| `buildExecutionGraph` | `packages/plugins/plugin-assistant/src/execution-graph/execution-graph.ts` | L91 |
|
|
620
|
+
| `presentEvent` | same | L118 |
|
|
621
|
+
| `isCollapsibleSpan` | same | L206 |
|
|
622
|
+
| `spanTreeToCommits` | same | L239 |
|
|
623
|
+
| `lastInSpanContext` | same | L282 |
|
|
624
|
+
| `formatCommitId` | same | L433 |
|
|
625
|
+
| `CommitSelector` | same | L446 |
|
|
626
|
+
| `GraphBuilder` / `doctor` | same | L579 / L610 |
|
|
627
|
+
| `Trace.Meta` / `Trace.flatten` | `packages/core/compute/compute/src/Trace.ts` | L102 / L178 |
|
|
628
|
+
| `Process.Info` / `Process.State` | `packages/core/compute/compute/src/Process.ts` | L365 / L321 |
|
|
629
|
+
| `AGENT_PROCESS_KEY` | `packages/core/compute/functions-runtime/src/agent-service/agent-process.ts` | L54 |
|
|
630
|
+
| `Commit` type | `packages/ui/react-ui-components/src/components/Timeline/Timeline.tsx` | L40 |
|
|
631
|
+
| `TracePanel` `useExecutionGraph` / default `eventLimit` | `packages/plugins/plugin-assistant/src/containers/TracePanel/TracePanel.tsx` | L138 / L153 |
|
|
632
|
+
|
|
633
|
+
## Appendix B: Visual contract examples
|
|
634
|
+
|
|
635
|
+
Top-level operation with no inner events (collapsed) —
|
|
636
|
+
`execution-graph.test.ts#L194`:
|
|
637
|
+
|
|
638
|
+
```
|
|
639
|
+
● [function] Reply - Success
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
Nested operation under an agent (sub-op collapsed) —
|
|
643
|
+
`execution-graph.test.ts#L223`:
|
|
644
|
+
|
|
645
|
+
```
|
|
646
|
+
● [atom] Agent processing request...
|
|
647
|
+
├──● [user] hello
|
|
648
|
+
│ ● [function] Lookup - Success
|
|
649
|
+
◆──╯ [atom] Agent completed request
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
Pending agent span with user message —
|
|
653
|
+
`execution-graph.test.ts#L296`:
|
|
654
|
+
|
|
655
|
+
```
|
|
656
|
+
● [atom] Agent processing request...
|
|
657
|
+
├──● [user] hello
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
Sequential agent requests on one pid (single shared lane) —
|
|
661
|
+
`trace-timeline.node.test.ts#L141`:
|
|
662
|
+
|
|
663
|
+
```
|
|
664
|
+
● [atom] Agent processing request...
|
|
665
|
+
├──● [user] List all available schemas. Tell me what typenames are available.
|
|
666
|
+
│ ● [function] List schemas - Success
|
|
667
|
+
◆──╯ [atom] Agent completed request
|
|
668
|
+
● │ [atom] Agent processing request...
|
|
669
|
+
│ ● [user] Create an organization called "DXOS" and a person named "Alice".
|
|
670
|
+
│ ● [function] Create object - Success
|
|
671
|
+
│ ● [function] Create object - Success
|
|
672
|
+
◆──╯ [atom] Agent completed request
|
|
673
|
+
● │ [atom] Agent processing request...
|
|
674
|
+
│ ● [user] Search for all organizations and persons.
|
|
675
|
+
│ ● [function] Query - Success
|
|
676
|
+
│ ● [function] Query - Success
|
|
677
|
+
◆──╯ [atom] Agent completed request
|
|
678
|
+
```
|