@dxos/plugin-assistant 0.8.4-main.abd8ff62ef → 0.8.4-main.bc2380dfbc
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-5XDDEXMP.mjs +169 -0
- package/dist/lib/neutral/AgentArticle-5XDDEXMP.mjs.map +7 -0
- package/dist/lib/neutral/AgentProperties-CNH4JMDZ.mjs +100 -0
- package/dist/lib/neutral/AgentProperties-CNH4JMDZ.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.mjs +10 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs +46 -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/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-DFRMRUK3.mjs +133 -0
- package/dist/lib/neutral/ChatCompanion-DFRMRUK3.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-H7ECM7AH.mjs +116 -0
- package/dist/lib/neutral/RoutineArticle-H7ECM7AH.mjs.map +7 -0
- package/dist/lib/neutral/RoutineList-CLDXGQUD.mjs +48 -0
- package/dist/lib/neutral/RoutineList-CLDXGQUD.mjs.map +7 -0
- package/dist/lib/neutral/TracePanel-C77SPEIS.mjs +672 -0
- package/dist/lib/neutral/TracePanel-C77SPEIS.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-service-GJXMI5OI.mjs +22 -0
- package/dist/lib/neutral/ai-service-GJXMI5OI.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-5QBICPYP.mjs +200 -0
- package/dist/lib/neutral/app-graph-builder-5QBICPYP.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 +35 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-3FIV362Z.mjs +8 -0
- package/dist/lib/neutral/chunk-3FIV362Z.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4CQZCMRP.mjs +25 -0
- package/dist/lib/neutral/chunk-4CQZCMRP.mjs.map +7 -0
- package/dist/lib/{browser/blueprints/index.mjs → neutral/chunk-5H6UJHLF.mjs} +4 -5
- package/dist/lib/neutral/chunk-5H6UJHLF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ITJX2YZZ.mjs +98 -0
- package/dist/lib/neutral/chunk-ITJX2YZZ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IZQWGJNG.mjs +380 -0
- package/dist/lib/neutral/chunk-IZQWGJNG.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/companion-chat-provisioner-2Y6PRSDK.mjs +116 -0
- package/dist/lib/neutral/companion-chat-provisioner-2Y6PRSDK.mjs.map +7 -0
- package/dist/lib/{browser/chunk-VK53MITK.mjs → neutral/components/index.mjs} +139 -141
- 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/{browser/create-chat-E2ZLVTLP.mjs → neutral/create-chat-QQZURUBW.mjs} +10 -12
- package/dist/lib/neutral/create-chat-QQZURUBW.mjs.map +7 -0
- package/dist/lib/neutral/create-object-UZCJCPWM.mjs +93 -0
- package/dist/lib/neutral/create-object-UZCJCPWM.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/{browser/ensure-companion-chat-7GDMXSQW.mjs → neutral/ensure-companion-chat-5S4LZM2H.mjs} +9 -16
- package/dist/lib/neutral/ensure-companion-chat-5S4LZM2H.mjs.map +7 -0
- package/dist/lib/{browser/chunk-M55MBYG7.mjs → neutral/hooks/index.mjs} +106 -111
- 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/{browser/on-create-space-4J3KTNAJ.mjs → neutral/on-create-space-Q2R7OSP6.mjs} +4 -7
- 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/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-T4R65UJU.mjs +174 -0
- package/dist/lib/neutral/react-surface-T4R65UJU.mjs.map +7 -0
- package/dist/lib/{browser/resolve-navigation-targets-3ZPQE6SZ.mjs → neutral/resolve-navigation-targets-VXBSWV5L.mjs} +3 -5
- package/dist/lib/neutral/resolve-navigation-targets-VXBSWV5L.mjs.map +7 -0
- package/dist/lib/{browser/run-prompt-in-new-chat-AA3KPBDN.mjs → neutral/run-prompt-in-new-chat-VJXXZ6SI.mjs} +16 -19
- package/dist/lib/neutral/run-prompt-in-new-chat-VJXXZ6SI.mjs.map +7 -0
- package/dist/lib/{browser/set-current-chat-P4VHI3YF.mjs → neutral/set-current-chat-ZFDCYK5I.mjs} +4 -10
- package/dist/lib/neutral/set-current-chat-ZFDCYK5I.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/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/{browser → neutral}/translations.mjs +5 -2
- 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/{browser/update-chat-name-VWKNUON7.mjs → neutral/update-chat-name-ENXRUMDJ.mjs} +3 -5
- package/dist/lib/neutral/update-chat-name-ENXRUMDJ.mjs.map +7 -0
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/AssistantPlugin.node.d.ts.map +1 -1
- 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/capabilities/companion-chat-provisioner.d.ts.map +1 -1
- 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/index.d.ts +27 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +2 -1
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +11 -5
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +2 -2
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +2 -2
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +2 -3
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +2 -15
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -1
- 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/TemplateForm.d.ts +1 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -1
- package/dist/types/src/containers/{ChatContainer/ChatContainer.d.ts → ChatArticle/ChatArticle.d.ts} +3 -3
- package/dist/types/src/containers/ChatArticle/ChatArticle.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.map +1 -1
- 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.map +1 -1
- 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/TracePanel/TracePanel.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts +11 -2
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/span-tree.d.ts +73 -0
- package/dist/types/src/containers/TracePanel/span-tree.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/span-tree.test.d.ts +2 -0
- package/dist/types/src/containers/TracePanel/span-tree.test.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -3
- package/dist/types/src/containers/index.d.ts.map +1 -1
- 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/useBlueprintRegistry.d.ts +3 -3
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextBinder.d.ts +2 -2
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts +2 -2
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +2 -2
- package/dist/types/src/operations/create-chat.d.ts.map +1 -1
- package/dist/types/src/operations/ensure-companion-chat.d.ts +2 -2
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +0 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/on-create-space.d.ts +2 -2
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +2 -2
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -1
- package/dist/types/src/operations/set-current-chat.d.ts +2 -2
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -1
- 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 +2 -2
- package/dist/types/src/operations/update-chat-name.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +11 -11
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +2 -3
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-sequence.d.ts +3 -3
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +1 -0
- 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/{operations/definitions.d.ts → types/AssistantOperation.d.ts} +10 -6
- package/dist/types/src/types/AssistantOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +1 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +3 -2
- package/dist/types/src/types/index.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 +152 -128
- package/src/AssistantPlugin.node.ts +7 -88
- package/src/AssistantPlugin.test.ts +3 -3
- package/src/AssistantPlugin.ts +126 -0
- package/src/AssistantPlugin.workerd.ts +41 -0
- package/src/blueprints/assistant/blueprint.ts +1 -1
- package/src/capabilities/app-graph-builder.ts +48 -9
- package/src/capabilities/companion-chat-provisioner.ts +4 -5
- package/src/capabilities/create-object.ts +107 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/markdown.ts +2 -2
- package/src/capabilities/migrations.ts +3 -3
- package/src/capabilities/react-surface.tsx +15 -7
- package/src/components/Chat/Chat.tsx +35 -5
- package/src/components/ChatPrompt/ChatMcpErrors.tsx +1 -1
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +4 -4
- package/src/components/ChatPrompt/ChatOptions.tsx +12 -11
- package/src/components/ChatPrompt/ChatPrompt.tsx +3 -3
- package/src/components/ChatPrompt/ChatReferences.tsx +3 -3
- package/src/components/ChatPrompt/ChatStatus.tsx +1 -1
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/Anchor.stories.tsx +3 -3
- package/src/components/ChatThread/ChatThread.stories.tsx +25 -29
- package/src/components/ChatThread/ChatThread.tsx +1 -1
- package/src/components/ChatThread/registry.tsx +8 -4
- package/src/components/ChatThread/sync.test.ts +4 -6
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +2 -2
- package/src/components/ChatThread/widgets/StatusWidget.ts +3 -83
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +1 -3
- package/src/components/ProcessTree/ProcessTree.tsx +2 -1
- package/src/components/TaskList/TaskList.stories.tsx +44 -0
- package/src/components/TaskList/TaskList.tsx +45 -0
- package/src/{cli → components/TaskList}/index.ts +1 -1
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +1 -1
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +2 -6
- package/src/components/TemplateEditor/TemplateForm.tsx +48 -69
- package/src/components/Toolbox/Toolbox.stories.tsx +4 -4
- package/src/components/Toolbox/Toolbox.tsx +2 -2
- package/src/components/index.ts +1 -0
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +7 -7
- package/src/containers/AgentArticle/AgentArticle.tsx +11 -7
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +4 -4
- package/src/containers/AgentProperties/AgentProperties.tsx +4 -4
- package/src/containers/{ChatContainer/ChatContainer.tsx → ChatArticle/ChatArticle.tsx} +11 -9
- package/src/containers/ChatArticle/index.ts +5 -0
- package/src/containers/ChatCompanion/ChatCompanion.tsx +20 -29
- 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 +74 -24
- package/src/containers/RoutineList/RoutineList.stories.tsx +3 -3
- package/src/containers/RoutineList/RoutineList.tsx +3 -3
- package/src/containers/TracePanel/TracePanel.stories.tsx +33 -26
- package/src/containers/TracePanel/TracePanel.tsx +72 -33
- package/src/containers/TracePanel/dxn-extractor.ts +7 -7
- package/src/containers/TracePanel/execution-graph.test.ts +218 -213
- package/src/containers/TracePanel/execution-graph.ts +316 -271
- package/src/containers/TracePanel/span-tree.test.ts +166 -0
- package/src/containers/TracePanel/span-tree.ts +214 -0
- package/src/containers/index.ts +4 -3
- package/src/{queue-logger.ts → feed-logger.ts} +37 -27
- package/src/hooks/useBlueprintRegistry.ts +12 -6
- package/src/hooks/useChatProcessor.ts +3 -3
- package/src/hooks/useChatServices.ts +1 -1
- package/src/hooks/useChatToolbarActions.ts +86 -88
- package/src/hooks/useContextBinder.ts +4 -4
- package/src/hooks/useContextObjects.ts +2 -2
- package/src/index.ts +2 -9
- package/src/operations/create-chat.ts +16 -11
- package/src/operations/ensure-companion-chat.ts +47 -45
- package/src/operations/index.ts +1 -2
- package/src/operations/on-create-space.ts +3 -3
- package/src/operations/prompt.test.ts +5 -5
- package/src/operations/resolve-navigation-targets.ts +2 -2
- package/src/operations/run-prompt-in-new-chat.ts +85 -84
- package/src/operations/set-current-chat.ts +3 -4
- package/src/operations/toggle-trace-panel-debug.ts +27 -0
- package/src/operations/update-chat-name.ts +2 -2
- package/src/plugin.ts +11 -0
- package/src/processor/processor.test.ts +1 -1
- package/src/processor/processor.ts +15 -15
- package/src/testing/test-generator.test.ts +41 -52
- package/src/testing/test-generator.ts +174 -189
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/trace-timeline.conversations.json +1 -1
- package/src/testing/trace-timeline.test.ts +3 -5
- package/src/testing.ts +7 -0
- package/src/translations.ts +5 -2
- package/src/types/Assistant.ts +2 -1
- package/src/types/AssistantCapabilities.ts +35 -0
- package/src/types/AssistantEvents.ts +11 -0
- package/src/{operations/definitions.ts → types/AssistantOperation.ts} +15 -0
- package/src/types/Settings.ts +6 -0
- package/src/types/index.ts +5 -2
- package/src/util/suggestions.test.ts +52 -0
- package/src/util/suggestions.ts +42 -0
- package/dist/lib/browser/blueprints/index.mjs.map +0 -7
- package/dist/lib/browser/chunk-DVOOFAWU.mjs +0 -175
- package/dist/lib/browser/chunk-DVOOFAWU.mjs.map +0 -7
- package/dist/lib/browser/chunk-M55MBYG7.mjs.map +0 -7
- package/dist/lib/browser/chunk-SEMCG4ZK.mjs +0 -195
- package/dist/lib/browser/chunk-SEMCG4ZK.mjs.map +0 -7
- package/dist/lib/browser/chunk-VK53MITK.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs +0 -73
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/components/index.mjs +0 -20
- package/dist/lib/browser/create-chat-E2ZLVTLP.mjs.map +0 -7
- package/dist/lib/browser/ensure-companion-chat-7GDMXSQW.mjs.map +0 -7
- package/dist/lib/browser/hooks/index.mjs +0 -39
- package/dist/lib/browser/index.mjs +0 -84
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/on-create-space-4J3KTNAJ.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -13
- package/dist/lib/browser/operations/index.mjs.map +0 -7
- package/dist/lib/browser/resolve-navigation-targets-3ZPQE6SZ.mjs.map +0 -7
- package/dist/lib/browser/run-prompt-in-new-chat-AA3KPBDN.mjs.map +0 -7
- package/dist/lib/browser/set-current-chat-P4VHI3YF.mjs.map +0 -7
- package/dist/lib/browser/translations.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -18
- package/dist/lib/browser/update-chat-name-VWKNUON7.mjs.map +0 -7
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs +0 -41
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -32
- package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FWC3ZGPH.mjs +0 -933
- package/dist/lib/node-esm/chunk-FWC3ZGPH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-JKEB3NFZ.mjs +0 -2302
- package/dist/lib/node-esm/chunk-JKEB3NFZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MBDVPB4V.mjs +0 -176
- package/dist/lib/node-esm/chunk-MBDVPB4V.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs +0 -196
- package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -74
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/components/index.mjs +0 -21
- package/dist/lib/node-esm/create-chat-UQQ3542N.mjs +0 -74
- package/dist/lib/node-esm/create-chat-UQQ3542N.mjs.map +0 -7
- package/dist/lib/node-esm/ensure-companion-chat-LVCPD4DJ.mjs +0 -66
- package/dist/lib/node-esm/ensure-companion-chat-LVCPD4DJ.mjs.map +0 -7
- package/dist/lib/node-esm/hooks/index.mjs +0 -40
- package/dist/lib/node-esm/index.mjs +0 -85
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/on-create-space-M63UBTTT.mjs +0 -23
- package/dist/lib/node-esm/on-create-space-M63UBTTT.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -14
- package/dist/lib/node-esm/operations/index.mjs.map +0 -7
- package/dist/lib/node-esm/resolve-navigation-targets-HO77CAFT.mjs +0 -23
- package/dist/lib/node-esm/resolve-navigation-targets-HO77CAFT.mjs.map +0 -7
- package/dist/lib/node-esm/run-prompt-in-new-chat-RIRYYYPK.mjs +0 -107
- package/dist/lib/node-esm/run-prompt-in-new-chat-RIRYYYPK.mjs.map +0 -7
- package/dist/lib/node-esm/set-current-chat-Z7GJ52VX.mjs +0 -55
- package/dist/lib/node-esm/set-current-chat-Z7GJ52VX.mjs.map +0 -7
- package/dist/lib/node-esm/translations.mjs +0 -173
- package/dist/lib/node-esm/translations.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -19
- package/dist/lib/node-esm/update-chat-name-GV4HX32Z.mjs +0 -57
- package/dist/lib/node-esm/update-chat-name-GV4HX32Z.mjs.map +0 -7
- package/dist/types/src/cli/index.d.ts +0 -2
- package/dist/types/src/cli/index.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts +0 -10
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/index.d.ts +0 -2
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.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/capabilities.d.ts +0 -32
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -5
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/AssistantPlugin.tsx +0 -238
- package/src/cli/plugin.ts +0 -83
- package/src/containers/ChatContainer/index.ts +0 -5
- package/src/types/capabilities.ts +0 -35
- package/src/types/events.ts +0 -11
- /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/AssistantPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser → neutral}/AssistantSettings-GG52BLKS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/AssistantSettings-GG52BLKS.mjs.map +0 -0
- /package/dist/lib/{browser/components/index.mjs.map → neutral/ChatArticle-WVAFZPVI.mjs.map} +0 -0
- /package/dist/lib/{browser/hooks → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/components → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/hooks → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/types/index.mjs.map → neutral/testing.mjs.map} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { useMemo } from 'react';
|
|
5
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
8
|
import { AgentPrompt } from '@dxos/assistant-toolkit';
|
|
@@ -13,47 +13,97 @@ import { invariant } from '@dxos/invariant';
|
|
|
13
13
|
import { useComputeRuntimeCallback } from '@dxos/plugin-automation/hooks';
|
|
14
14
|
import { Panel, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
15
15
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
16
|
+
import { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
16
17
|
|
|
17
18
|
import { TemplateEditor } from '#components';
|
|
18
19
|
import { meta } from '#meta';
|
|
19
20
|
|
|
20
21
|
export type RoutineArticleProps = AppSurface.ObjectArticleProps<Routine.Routine>;
|
|
21
22
|
|
|
23
|
+
type RunState =
|
|
24
|
+
| { status: 'idle' }
|
|
25
|
+
| { status: 'running' }
|
|
26
|
+
| { status: 'success'; result: unknown }
|
|
27
|
+
| { status: 'error'; error: Error };
|
|
28
|
+
|
|
29
|
+
// TODO(burdon): Trigger editor.
|
|
22
30
|
export const RoutineArticle = ({ role, attendableId, subject }: RoutineArticleProps) => {
|
|
23
31
|
const { t } = useTranslation(meta.id);
|
|
24
32
|
const { hasAttention } = useAttention(attendableId);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
: undefined,
|
|
35
|
-
[subject, db],
|
|
36
|
-
);
|
|
33
|
+
const invoke = usePromptHandler(subject);
|
|
34
|
+
const [state, setState] = useState<RunState>({ status: 'idle' });
|
|
35
|
+
const mountedRef = useRef(true);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
return () => {
|
|
38
|
+
mountedRef.current = false;
|
|
39
|
+
};
|
|
40
|
+
}, []);
|
|
37
41
|
|
|
38
|
-
const handleRun =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
const handleRun = useCallback(async () => {
|
|
43
|
+
setState({ status: 'running' });
|
|
44
|
+
try {
|
|
45
|
+
const result = await invoke();
|
|
46
|
+
if (mountedRef.current) {
|
|
47
|
+
setState({ status: 'success', result });
|
|
48
|
+
}
|
|
49
|
+
} catch (err) {
|
|
50
|
+
if (mountedRef.current) {
|
|
51
|
+
setState({ status: 'error', error: err instanceof Error ? err : new Error(String(err)) });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}, [invoke]);
|
|
46
55
|
|
|
47
56
|
return (
|
|
48
57
|
<Panel.Root role={role} className='dx-document'>
|
|
49
58
|
<Panel.Toolbar asChild>
|
|
50
|
-
<Toolbar.Root disabled={!hasAttention
|
|
51
|
-
<Toolbar.IconButton
|
|
59
|
+
<Toolbar.Root disabled={!hasAttention || state.status === 'running'}>
|
|
60
|
+
<Toolbar.IconButton
|
|
61
|
+
iconOnly
|
|
62
|
+
icon={state.status === 'running' ? 'ph--spinner-gap--regular' : 'ph--play--regular'}
|
|
63
|
+
label={t('run-prompt.label')}
|
|
64
|
+
onClick={handleRun}
|
|
65
|
+
/>
|
|
52
66
|
</Toolbar.Root>
|
|
53
67
|
</Panel.Toolbar>
|
|
54
|
-
<Panel.Content
|
|
68
|
+
<Panel.Content classNames='flex flex-col gap-2'>
|
|
55
69
|
<TemplateEditor id={subject.id} template={subject.instructions} />
|
|
70
|
+
<RoutineResult state={state} />
|
|
56
71
|
</Panel.Content>
|
|
57
72
|
</Panel.Root>
|
|
58
73
|
);
|
|
59
74
|
};
|
|
75
|
+
|
|
76
|
+
const RoutineResult = ({ state }: { state: RunState }) => {
|
|
77
|
+
const { t } = useTranslation(meta.id);
|
|
78
|
+
switch (state.status) {
|
|
79
|
+
case 'idle':
|
|
80
|
+
return null;
|
|
81
|
+
case 'running':
|
|
82
|
+
return <div className='p-2 text-sm text-subdued'>{t('routine-running.label')}</div>;
|
|
83
|
+
case 'error':
|
|
84
|
+
return <div className='p-2 text-sm text-error'>{state.error.message}</div>;
|
|
85
|
+
case 'success':
|
|
86
|
+
return <JsonHighlighter classNames='p-2! text-sm' data={state.result} />;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const usePromptHandler = (routine: Routine.Routine) => {
|
|
91
|
+
const db = Obj.getDatabase(routine);
|
|
92
|
+
const data = useMemo<Operation.Definition.Input<typeof AgentPrompt> | undefined>(() => {
|
|
93
|
+
if (db && routine) {
|
|
94
|
+
return {
|
|
95
|
+
prompt: db.makeRef(Obj.getDXN(routine)),
|
|
96
|
+
input: {},
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}, [routine, db]);
|
|
100
|
+
|
|
101
|
+
return useComputeRuntimeCallback(
|
|
102
|
+
db?.spaceId,
|
|
103
|
+
() => {
|
|
104
|
+
invariant(data);
|
|
105
|
+
return Operation.invoke(AgentPrompt, data);
|
|
106
|
+
},
|
|
107
|
+
[data],
|
|
108
|
+
);
|
|
109
|
+
};
|
|
@@ -10,9 +10,9 @@ import { SERVICES_CONFIG } from '@dxos/ai/testing';
|
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
11
|
import { Routine } from '@dxos/compute';
|
|
12
12
|
import { Filter } from '@dxos/echo';
|
|
13
|
-
import { AutomationPlugin } from '@dxos/plugin-automation';
|
|
14
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
15
|
-
import { Markdown } from '@dxos/plugin-markdown
|
|
13
|
+
import { AutomationPlugin } from '@dxos/plugin-automation/testing';
|
|
14
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
15
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
16
16
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
17
17
|
import { Config } from '@dxos/react-client';
|
|
18
18
|
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
@@ -9,11 +9,11 @@ import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
|
9
9
|
import { DatabaseBlueprint, WebSearchBlueprint } from '@dxos/assistant-toolkit';
|
|
10
10
|
import { Routine } from '@dxos/compute';
|
|
11
11
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
12
|
-
import { MarkdownBlueprint } from '@dxos/plugin-markdown
|
|
12
|
+
import { MarkdownBlueprint } from '@dxos/plugin-markdown';
|
|
13
13
|
import { useQuery } from '@dxos/react-client/echo';
|
|
14
14
|
import { IconButton } from '@dxos/react-ui';
|
|
15
15
|
|
|
16
|
-
import { AssistantOperation } from '#
|
|
16
|
+
import { AssistantOperation } from '#types';
|
|
17
17
|
|
|
18
18
|
export type RoutineListProps = AppSurface.ObjectSectionProps<Obj.Unknown>;
|
|
19
19
|
|
|
@@ -26,7 +26,7 @@ export const RoutineList = ({ subject }: RoutineListProps) => {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
|
-
<div
|
|
29
|
+
<div className='flex gap-2'>
|
|
30
30
|
{prompts.map((prompt, i) => (
|
|
31
31
|
<div key={i}>
|
|
32
32
|
<IconButton
|
|
@@ -12,19 +12,19 @@ import { Process, Trace } from '@dxos/compute';
|
|
|
12
12
|
import { Feed, Filter, Query } from '@dxos/echo';
|
|
13
13
|
import { FeedTraceSink, ProcessManager } from '@dxos/functions-runtime';
|
|
14
14
|
import { log } from '@dxos/log';
|
|
15
|
-
import { AutomationPlugin } from '@dxos/plugin-automation';
|
|
16
15
|
import { useComputeRuntime } from '@dxos/plugin-automation/hooks';
|
|
17
|
-
import {
|
|
16
|
+
import { AutomationPlugin } from '@dxos/plugin-automation/testing';
|
|
17
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
18
18
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
19
19
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
20
20
|
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
21
|
-
import { IconButton, Panel, Toolbar } from '@dxos/react-ui';
|
|
21
|
+
import { IconButton, Panel, ScrollContainer, Toolbar } from '@dxos/react-ui';
|
|
22
22
|
import { Timeline } from '@dxos/react-ui-components';
|
|
23
23
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
24
24
|
|
|
25
|
+
import { AssistantPlugin } from '#plugin';
|
|
25
26
|
import { translations } from '#translations';
|
|
26
27
|
|
|
27
|
-
import { AssistantPlugin } from '../../cli';
|
|
28
28
|
import { buildExecutionGraph } from './execution-graph';
|
|
29
29
|
import { PLAYBACK_INTERVAL_MS, STEP_STORAGE_KEY, SimulatedAgent, useLocalStorageNumber } from './testing';
|
|
30
30
|
import { TracePanel } from './TracePanel';
|
|
@@ -189,28 +189,35 @@ const SnapshotStory = () => {
|
|
|
189
189
|
}, [handleNext, handlePrev, handleTogglePlay, handleReset, handleShowAll]);
|
|
190
190
|
|
|
191
191
|
return (
|
|
192
|
-
<
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
<
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
192
|
+
<ScrollContainer.Root pin>
|
|
193
|
+
<BaseStory
|
|
194
|
+
toolbar={
|
|
195
|
+
<Toolbar.Root>
|
|
196
|
+
<IconButton iconOnly icon='ph--skip-back--regular' label='Reset (R)' onClick={handleReset} />
|
|
197
|
+
<IconButton iconOnly icon='ph--caret-left--regular' label='Step back (← / H)' onClick={handlePrev} />
|
|
198
|
+
<IconButton
|
|
199
|
+
iconOnly
|
|
200
|
+
icon={playing ? 'ph--pause--regular' : 'ph--play--regular'}
|
|
201
|
+
label={playing ? 'Pause (Space)' : 'Play (Space)'}
|
|
202
|
+
onClick={handleTogglePlay}
|
|
203
|
+
/>
|
|
204
|
+
<IconButton iconOnly icon='ph--caret-right--regular' label='Step forward (→ / L)' onClick={handleNext} />
|
|
205
|
+
<IconButton iconOnly icon='ph--skip-forward--regular' label='Show all (E / End)' onClick={handleShowAll} />
|
|
206
|
+
<Toolbar.Text className='text-right text-sm tabular-nums opacity-70'>
|
|
207
|
+
{step} / {total}
|
|
208
|
+
</Toolbar.Text>
|
|
209
|
+
</Toolbar.Root>
|
|
210
|
+
}
|
|
211
|
+
>
|
|
212
|
+
<ScrollContainer.Content thin>
|
|
213
|
+
<ScrollContainer.Viewport>
|
|
214
|
+
<Timeline branches={branches} commits={commits} showTimestamp />
|
|
215
|
+
</ScrollContainer.Viewport>
|
|
216
|
+
<ScrollContainer.ScrollDownButton />
|
|
217
|
+
<ScrollContainer.Fade />
|
|
218
|
+
</ScrollContainer.Content>
|
|
219
|
+
</BaseStory>
|
|
220
|
+
</ScrollContainer.Root>
|
|
214
221
|
);
|
|
215
222
|
};
|
|
216
223
|
|
|
@@ -7,7 +7,7 @@ import { useAtomValue } from '@effect-atom/atom-react';
|
|
|
7
7
|
import { pipe } from 'effect/Function';
|
|
8
8
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
10
|
+
import { useAtomCapability, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
11
11
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
12
12
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
13
13
|
import { Trace } from '@dxos/compute';
|
|
@@ -18,26 +18,34 @@ import { DXN } from '@dxos/keys';
|
|
|
18
18
|
import { log } from '@dxos/log';
|
|
19
19
|
import { useComputeRuntimeService } from '@dxos/plugin-automation/hooks';
|
|
20
20
|
import { type Space } from '@dxos/react-client/echo';
|
|
21
|
-
import {
|
|
21
|
+
import { ScrollContainer } from '@dxos/react-ui';
|
|
22
|
+
import { useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
22
23
|
import { Timeline, type Commit } from '@dxos/react-ui-components';
|
|
23
|
-
import {
|
|
24
|
+
import { Syntax } from '@dxos/react-ui-syntax-highlighter';
|
|
25
|
+
import { composable, composableProps, mx } from '@dxos/ui-theme';
|
|
24
26
|
|
|
25
27
|
import { ProcessTree, ProcessTreeProps } from '#components';
|
|
28
|
+
import { AssistantCapabilities } from '#types';
|
|
26
29
|
|
|
27
|
-
import { buildExecutionGraph } from './execution-graph';
|
|
30
|
+
import { buildExecutionGraph, type ExecutionGraph } from './execution-graph';
|
|
28
31
|
|
|
29
32
|
export type TracePanelProps = AppSurface.SpaceArticleProps<Pick<ProcessTreeProps, 'onProcessTerminate'>>;
|
|
30
33
|
|
|
31
34
|
export const TracePanel = composable<HTMLDivElement, TracePanelProps>(
|
|
32
|
-
({ space, onProcessTerminate, ...props }, forwardedRef) => {
|
|
35
|
+
({ space, attendableId, onProcessTerminate, ...props }, forwardedRef) => {
|
|
36
|
+
const attentionAttrs = useAttentionAttributes(attendableId);
|
|
33
37
|
const { invokePromise } = useOperationInvoker();
|
|
34
|
-
const
|
|
38
|
+
const settings = useAtomCapability(AssistantCapabilities.Settings);
|
|
39
|
+
const tracePanelDebug = settings.tracePanelDebug ?? false;
|
|
40
|
+
const { branches, commits, spanTree } = useExecutionGraph(space);
|
|
35
41
|
const runtime = useComputeRuntimeService(Process.ProcessMonitorService, space.id);
|
|
36
42
|
const processes = useAtomValue(runtime?.processTreeAtom ?? atomEmpty);
|
|
37
43
|
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
const [selectedCommit, setSelectedCommit] = useState<Commit | undefined>();
|
|
45
|
+
const handleCommitSelect = useCallback(
|
|
46
|
+
(commit: Commit | undefined) => {
|
|
47
|
+
setSelectedCommit(commit);
|
|
48
|
+
if (commit?.link) {
|
|
41
49
|
const dxn = DXN.tryParse(commit.link)?.asEchoDXN();
|
|
42
50
|
if (dxn?.spaceId && dxn.echoId) {
|
|
43
51
|
// TODO(dmaretskyi): Navigates, but fails to open.
|
|
@@ -47,7 +55,7 @@ export const TracePanel = composable<HTMLDivElement, TracePanelProps>(
|
|
|
47
55
|
}
|
|
48
56
|
}
|
|
49
57
|
},
|
|
50
|
-
[invokePromise],
|
|
58
|
+
[invokePromise, setSelectedCommit],
|
|
51
59
|
);
|
|
52
60
|
|
|
53
61
|
// Select current branch.
|
|
@@ -56,7 +64,6 @@ export const TracePanel = composable<HTMLDivElement, TracePanelProps>(
|
|
|
56
64
|
(process: Process.Info) => {
|
|
57
65
|
const branch = branches.find((branch) => branch === process.pid.toString());
|
|
58
66
|
if (branch) {
|
|
59
|
-
log.info('select', { process, branch });
|
|
60
67
|
setCurrentBranch(branch);
|
|
61
68
|
}
|
|
62
69
|
},
|
|
@@ -64,23 +71,60 @@ export const TracePanel = composable<HTMLDivElement, TracePanelProps>(
|
|
|
64
71
|
);
|
|
65
72
|
|
|
66
73
|
return (
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
74
|
+
<div
|
|
75
|
+
{...composableProps(props, {
|
|
76
|
+
...attentionAttrs,
|
|
77
|
+
classNames: mx(
|
|
78
|
+
'h-full grid divide-y divide-separator',
|
|
79
|
+
!tracePanelDebug && selectedCommit
|
|
80
|
+
? 'grid-rows-[minmax(0,4lh)_1fr_minmax(0,206px)]'
|
|
81
|
+
: 'grid-rows-[minmax(0,4lh)_1fr]',
|
|
82
|
+
),
|
|
83
|
+
})}
|
|
84
|
+
ref={forwardedRef}
|
|
85
|
+
>
|
|
86
|
+
<ProcessTree
|
|
87
|
+
processes={processes}
|
|
88
|
+
onProcessSelect={handleProcessSelect}
|
|
89
|
+
onProcessTerminate={onProcessTerminate}
|
|
90
|
+
/>
|
|
91
|
+
|
|
92
|
+
<ScrollContainer.Root pin>
|
|
93
|
+
<ScrollContainer.Content thin>
|
|
94
|
+
<ScrollContainer.Fade />
|
|
95
|
+
<ScrollContainer.Viewport>
|
|
96
|
+
{tracePanelDebug ? (
|
|
97
|
+
<Syntax.Root data={spanTree}>
|
|
98
|
+
<Syntax.Content>
|
|
99
|
+
<Syntax.Viewport>
|
|
100
|
+
<Syntax.Code className='text-xs' />
|
|
101
|
+
</Syntax.Viewport>
|
|
102
|
+
</Syntax.Content>
|
|
103
|
+
</Syntax.Root>
|
|
104
|
+
) : (
|
|
105
|
+
<Timeline
|
|
106
|
+
compact
|
|
107
|
+
commits={commits}
|
|
108
|
+
branches={branches}
|
|
109
|
+
currentBranch={currentBranch}
|
|
110
|
+
onSelect={handleCommitSelect}
|
|
111
|
+
/>
|
|
112
|
+
)}
|
|
113
|
+
</ScrollContainer.Viewport>
|
|
114
|
+
<ScrollContainer.ScrollDownButton />
|
|
115
|
+
</ScrollContainer.Content>
|
|
116
|
+
</ScrollContainer.Root>
|
|
117
|
+
|
|
118
|
+
{!tracePanelDebug && selectedCommit && (
|
|
119
|
+
<Syntax.Root data={selectedCommit}>
|
|
120
|
+
<Syntax.Content>
|
|
121
|
+
<Syntax.Viewport>
|
|
122
|
+
<Syntax.Code className='text-xs' />
|
|
123
|
+
</Syntax.Viewport>
|
|
124
|
+
</Syntax.Content>
|
|
125
|
+
</Syntax.Root>
|
|
126
|
+
)}
|
|
127
|
+
</div>
|
|
84
128
|
);
|
|
85
129
|
},
|
|
86
130
|
);
|
|
@@ -88,11 +132,6 @@ export const TracePanel = composable<HTMLDivElement, TracePanelProps>(
|
|
|
88
132
|
// Stable ref.
|
|
89
133
|
const atomEmpty = Atom.make(() => [] as const);
|
|
90
134
|
|
|
91
|
-
type ExecutionGraph = {
|
|
92
|
-
branches: string[];
|
|
93
|
-
commits: Commit[];
|
|
94
|
-
};
|
|
95
|
-
|
|
96
135
|
type UseExecutionGraphOptions = {
|
|
97
136
|
eventLimit?: number;
|
|
98
137
|
};
|
|
@@ -68,7 +68,7 @@ export const extractDxnsFromObject = (obj: unknown): DXN[] => {
|
|
|
68
68
|
const dxns: DXN[] = [];
|
|
69
69
|
const seen = new Set<string>();
|
|
70
70
|
|
|
71
|
-
const
|
|
71
|
+
const addDXN = (dxnStr: string) => {
|
|
72
72
|
if (!seen.has(dxnStr)) {
|
|
73
73
|
const dxn = DXN.tryParse(dxnStr);
|
|
74
74
|
if (dxn) {
|
|
@@ -86,14 +86,14 @@ export const extractDxnsFromObject = (obj: unknown): DXN[] => {
|
|
|
86
86
|
if (typeof value === 'string') {
|
|
87
87
|
// Check if the string itself is a DXN.
|
|
88
88
|
if (value.startsWith('dxn:')) {
|
|
89
|
-
|
|
89
|
+
addDXN(value);
|
|
90
90
|
} else if (value.startsWith('@dxn:')) {
|
|
91
|
-
|
|
91
|
+
addDXN(value.slice(1));
|
|
92
92
|
}
|
|
93
93
|
// Also extract DXNs from within the string.
|
|
94
94
|
const extracted = extractDxnFromString(value);
|
|
95
95
|
for (const dxn of extracted) {
|
|
96
|
-
|
|
96
|
+
addDXN(dxn.toString());
|
|
97
97
|
}
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
@@ -112,7 +112,7 @@ export const extractDxnsFromObject = (obj: unknown): DXN[] => {
|
|
|
112
112
|
if ('/' in record && typeof record['/'] === 'string') {
|
|
113
113
|
const dxnStr = record['/'];
|
|
114
114
|
if (typeof dxnStr === 'string' && dxnStr.startsWith('dxn:')) {
|
|
115
|
-
|
|
115
|
+
addDXN(dxnStr);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -120,7 +120,7 @@ export const extractDxnsFromObject = (obj: unknown): DXN[] => {
|
|
|
120
120
|
if ('@dxn' in record && typeof record['@dxn'] === 'string') {
|
|
121
121
|
const dxnStr = record['@dxn'];
|
|
122
122
|
if (typeof dxnStr === 'string' && dxnStr.startsWith('dxn:')) {
|
|
123
|
-
|
|
123
|
+
addDXN(dxnStr);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -128,7 +128,7 @@ export const extractDxnsFromObject = (obj: unknown): DXN[] => {
|
|
|
128
128
|
if (record._tag === 'reference' && record.reference && typeof record.reference === 'object') {
|
|
129
129
|
const ref = record.reference as Record<string, unknown>;
|
|
130
130
|
if (ref.dxn && typeof ref.dxn === 'string') {
|
|
131
|
-
|
|
131
|
+
addDXN(ref.dxn);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|