@dxos/plugin-assistant 0.8.4-main.422d1c7879 → 0.8.4-main.51f1e5ca51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/AssistantSettings-GG52BLKS.mjs +40 -0
- package/dist/lib/browser/AssistantSettings-GG52BLKS.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +26 -3
- package/dist/lib/browser/blueprints/index.mjs.map +4 -4
- package/dist/lib/browser/{chunk-ATHYBVGN.mjs → chunk-RIJNPAYC.mjs} +5 -5
- package/dist/lib/browser/chunk-RIJNPAYC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LMVTXH54.mjs → chunk-SEMCG4ZK.mjs} +58 -17
- package/dist/lib/browser/chunk-SEMCG4ZK.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +3 -4
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/{create-chat-LBZHGVSN.mjs → create-chat-FZJASOQS.mjs} +5 -13
- package/dist/lib/browser/create-chat-FZJASOQS.mjs.map +7 -0
- package/dist/lib/browser/{ensure-companion-chat-ZEZA34MZ.mjs → ensure-companion-chat-PHUWWFVY.mjs} +4 -4
- package/dist/lib/browser/ensure-companion-chat-PHUWWFVY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +804 -880
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{on-create-space-54RNX5JI.mjs → on-create-space-OQNCM7NC.mjs} +3 -3
- package/dist/lib/browser/{on-create-space-54RNX5JI.mjs.map → on-create-space-OQNCM7NC.mjs.map} +1 -1
- package/dist/lib/browser/operations/index.mjs +3 -3
- package/dist/lib/browser/operations/index.mjs.map +3 -3
- package/dist/lib/browser/{resolve-navigation-targets-NZOD66NY.mjs → resolve-navigation-targets-PMNR7D3P.mjs} +3 -3
- package/dist/lib/browser/{resolve-navigation-targets-NZOD66NY.mjs.map → resolve-navigation-targets-PMNR7D3P.mjs.map} +1 -1
- package/dist/lib/browser/{run-prompt-in-new-chat-THLK5YQC.mjs → run-prompt-in-new-chat-4XDYFKCV.mjs} +10 -39
- package/dist/lib/browser/run-prompt-in-new-chat-4XDYFKCV.mjs.map +7 -0
- package/dist/lib/browser/{set-current-chat-LRS3VFSH.mjs → set-current-chat-7V4DA66I.mjs} +4 -4
- package/dist/lib/browser/set-current-chat-7V4DA66I.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +171 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -3
- package/dist/lib/browser/{update-chat-name-3Y36KFAS.mjs → update-chat-name-ZGMU2UGN.mjs} +7 -22
- package/dist/lib/browser/update-chat-name-ZGMU2UGN.mjs.map +7 -0
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs +41 -0
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +26 -3
- package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
- package/dist/lib/node-esm/{chunk-PXAJSTGZ.mjs → chunk-NCIZY5ZV.mjs} +5 -5
- package/dist/lib/node-esm/chunk-NCIZY5ZV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-W3JZ2F4T.mjs → chunk-XAFVSEUJ.mjs} +58 -17
- package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +3 -4
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/{create-chat-3BEG4R6J.mjs → create-chat-RY6A4WUV.mjs} +5 -13
- package/dist/lib/node-esm/create-chat-RY6A4WUV.mjs.map +7 -0
- package/dist/lib/node-esm/{ensure-companion-chat-6K2WEWFP.mjs → ensure-companion-chat-BTDU5TS2.mjs} +4 -4
- package/dist/lib/node-esm/ensure-companion-chat-BTDU5TS2.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +804 -880
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{on-create-space-YRPZ6HZY.mjs → on-create-space-4LWCYT3H.mjs} +3 -3
- package/dist/lib/node-esm/{on-create-space-YRPZ6HZY.mjs.map → on-create-space-4LWCYT3H.mjs.map} +1 -1
- package/dist/lib/node-esm/operations/index.mjs +3 -3
- package/dist/lib/node-esm/operations/index.mjs.map +3 -3
- package/dist/lib/node-esm/{resolve-navigation-targets-3PPK7XLH.mjs → resolve-navigation-targets-GHS3XPVP.mjs} +3 -3
- package/dist/lib/node-esm/{resolve-navigation-targets-3PPK7XLH.mjs.map → resolve-navigation-targets-GHS3XPVP.mjs.map} +1 -1
- package/dist/lib/node-esm/{run-prompt-in-new-chat-OUYKCMQ7.mjs → run-prompt-in-new-chat-UF54E34O.mjs} +10 -39
- package/dist/lib/node-esm/run-prompt-in-new-chat-UF54E34O.mjs.map +7 -0
- package/dist/lib/node-esm/{set-current-chat-SMXZJD3F.mjs → set-current-chat-SWPAOLZL.mjs} +4 -4
- package/dist/lib/node-esm/set-current-chat-SWPAOLZL.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +172 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -3
- package/dist/lib/node-esm/{update-chat-name-HM2P4NSI.mjs → update-chat-name-CW6K5M37.mjs} +7 -22
- package/dist/lib/node-esm/update-chat-name-CW6K5M37.mjs.map +7 -0
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/assistant/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -1
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +29 -39
- 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/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +5 -3
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -1
- 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.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 +2 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Anchor.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +6 -3
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +4 -3
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts +18 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +4 -4
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -1
- 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 +1 -2
- package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +2 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +0 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -2
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +3 -3
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- 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 +4 -4
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +3 -3
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -1
- package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts.map +1 -1
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +1 -1
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +1 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -1
- 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/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/{PromptList/PromptList.stories.d.ts → RoutineList/RoutineList.stories.d.ts} +1 -1
- 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 +3 -2
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +1 -4
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +1 -1
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts +81 -1
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts +2 -0
- package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/containers/index.d.ts +2 -2
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +1 -1
- 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 +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +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.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +1 -1
- package/dist/types/src/operations/create-chat.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +24 -19
- package/dist/types/src/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/operations/ensure-companion-chat.d.ts +1 -1
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/on-create-space.d.ts +1 -1
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
- package/dist/types/src/operations/resolve-navigation-targets.d.ts +1 -1
- package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -1
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +1 -1
- 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 +1 -1
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -1
- package/dist/types/src/operations/update-chat-name.d.ts +1 -1
- package/dist/types/src/operations/update-chat-name.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +2 -2
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +1 -1
- package/dist/types/src/testing/test-generator.d.ts.map +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/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +22 -6
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +20 -5
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +1 -1
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +95 -91
- package/src/AssistantPlugin.tsx +10 -12
- package/src/blueprints/assistant/blueprint.test.ts +3 -3
- package/src/blueprints/assistant/blueprint.ts +3 -3
- package/src/capabilities/app-graph-builder.ts +3 -3
- package/src/capabilities/blueprint-definition.ts +0 -4
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/markdown.ts +1 -1
- package/src/capabilities/migrations.ts +1 -8
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +16 -10
- package/src/cli/plugin.ts +3 -4
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +3 -2
- package/src/components/AssistantSettings/AssistantSettings.tsx +22 -111
- package/src/components/Chat/Chat.tsx +56 -260
- package/src/components/Chat/context.ts +39 -0
- package/src/components/ChatPrompt/ChatActions.tsx +10 -10
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +24 -10
- package/src/components/ChatPrompt/ChatOptions.tsx +60 -31
- package/src/components/ChatPrompt/ChatPrompt.tsx +179 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +1 -1
- package/src/components/ChatPrompt/ChatStatus.tsx +123 -0
- package/src/components/ChatPrompt/index.ts +2 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +3 -3
- package/src/components/ChatThread/ChatThread.tsx +31 -18
- package/src/components/ChatThread/DEBUG.md +41 -0
- package/src/components/ChatThread/MarkdownStream.stories.tsx +5 -4
- package/src/components/ChatThread/registry.tsx +53 -14
- package/src/components/ChatThread/sync.test.ts +80 -12
- package/src/components/ChatThread/sync.ts +1 -1
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +6 -6
- package/src/components/ChatThread/widgets/ReferenceWidget.ts +3 -1
- package/src/components/ChatThread/widgets/SelectWidget.ts +3 -1
- package/src/components/ChatThread/widgets/StatsWidget.ts +3 -1
- package/src/components/ChatThread/widgets/StatusWidget.ts +3 -1
- package/src/components/ChatThread/widgets/SuggestionWidget.ts +1 -1
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +3 -2
- package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +2 -1
- package/src/components/ChatThread/widgets/defaults.ts +8 -0
- package/src/components/ChatThread/widgets/index.ts +1 -2
- package/src/components/ProcessTree/ProcessTree.stories.tsx +12 -38
- package/src/components/ProcessTree/ProcessTree.tsx +67 -35
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +3 -2
- package/src/components/TemplateEditor/TemplateEditor.tsx +5 -5
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +4 -3
- package/src/components/TemplateEditor/TemplateForm.tsx +3 -3
- package/src/components/Toolbox/Toolbox.stories.tsx +2 -1
- package/src/components/Toolbox/Toolbox.tsx +2 -2
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +1 -1
- package/src/containers/AgentArticle/AgentArticle.tsx +2 -2
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +2 -1
- package/src/containers/AgentProperties/AgentProperties.tsx +2 -2
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +1 -1
- package/src/containers/ChatCompanion/ChatCompanion.tsx +1 -1
- package/src/containers/ChatContainer/ChatContainer.tsx +16 -6
- package/src/containers/ChatDialog/ChatDialog.tsx +3 -9
- package/src/containers/{PromptArticle/PromptArticle.tsx → RoutineArticle/RoutineArticle.tsx} +4 -4
- package/src/containers/RoutineArticle/index.ts +5 -0
- package/src/containers/{PromptList/PromptList.stories.tsx → RoutineList/RoutineList.stories.tsx} +10 -9
- package/src/containers/{PromptList/PromptList.tsx → RoutineList/RoutineList.tsx} +6 -5
- package/src/containers/RoutineList/index.ts +5 -0
- package/src/containers/TracePanel/TracePanel.stories.tsx +204 -198
- package/src/containers/TracePanel/TracePanel.tsx +69 -44
- package/src/containers/TracePanel/dxn-extractor.test.ts +7 -7
- package/src/containers/TracePanel/dxn-extractor.ts +4 -4
- package/src/containers/TracePanel/execution-graph.test.ts +382 -0
- package/src/containers/TracePanel/execution-graph.ts +340 -213
- 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/index.ts +2 -2
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useBlueprintRegistry.ts +1 -1
- package/src/hooks/useChatKeymap.ts +52 -0
- package/src/hooks/useChatProcessor.ts +1 -1
- package/src/hooks/useDebug.ts +38 -0
- package/src/index.ts +0 -3
- package/src/operations/create-chat.ts +2 -2
- package/src/operations/definitions.ts +4 -4
- package/src/operations/ensure-companion-chat.ts +1 -1
- package/src/operations/index.ts +1 -1
- package/src/operations/on-create-space.ts +1 -1
- package/src/operations/prompt.test.ts +5 -6
- package/src/operations/resolve-navigation-targets.ts +1 -1
- package/src/operations/run-prompt-in-new-chat.ts +3 -3
- package/src/operations/set-current-chat.ts +1 -1
- package/src/operations/update-chat-name.ts +2 -2
- package/src/processor/processor.test.ts +1 -1
- package/src/processor/processor.ts +4 -4
- package/src/queue-logger.ts +1 -1
- package/src/testing/data/trace-timeline.dx.json +3737 -1200
- package/src/testing/index.ts +1 -0
- package/src/testing/test-generator.test.ts +1 -1
- package/src/testing/test-generator.ts +4 -4
- package/src/testing/test-trace.ts +20 -0
- package/src/testing/trace-timeline.conversations.json +1 -1
- package/src/testing/trace-timeline.test.ts +53 -49
- package/src/translations.ts +24 -31
- package/src/types/Assistant.ts +11 -0
- package/src/types/Settings.ts +62 -7
- package/src/types/index.ts +0 -1
- package/src/types/service.ts +1 -1
- package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs +0 -97
- package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs.map +0 -7
- package/dist/lib/browser/chunk-ATHYBVGN.mjs.map +0 -7
- package/dist/lib/browser/chunk-EZRS3J25.mjs +0 -30
- package/dist/lib/browser/chunk-EZRS3J25.mjs.map +0 -7
- package/dist/lib/browser/chunk-LMVTXH54.mjs.map +0 -7
- package/dist/lib/browser/create-chat-LBZHGVSN.mjs.map +0 -7
- package/dist/lib/browser/ensure-companion-chat-ZEZA34MZ.mjs.map +0 -7
- package/dist/lib/browser/run-prompt-in-new-chat-THLK5YQC.mjs.map +0 -7
- package/dist/lib/browser/set-current-chat-LRS3VFSH.mjs.map +0 -7
- package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs.map +0 -7
- package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs +0 -98
- package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs +0 -32
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-W3JZ2F4T.mjs.map +0 -7
- package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs.map +0 -7
- package/dist/lib/node-esm/ensure-companion-chat-6K2WEWFP.mjs.map +0 -7
- package/dist/lib/node-esm/run-prompt-in-new-chat-OUYKCMQ7.mjs.map +0 -7
- package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs.map +0 -7
- package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs.map +0 -7
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +0 -10
- 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/widgets/PromptWidget.d.ts +0 -15
- package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts.map +0 -1
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +0 -6
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +0 -1
- package/dist/types/src/containers/PromptArticle/index.d.ts +0 -2
- package/dist/types/src/containers/PromptArticle/index.d.ts.map +0 -1
- package/dist/types/src/containers/PromptList/PromptList.d.ts +0 -6
- package/dist/types/src/containers/PromptList/PromptList.d.ts.map +0 -1
- package/dist/types/src/containers/PromptList/PromptList.stories.d.ts.map +0 -1
- package/dist/types/src/containers/PromptList/index.d.ts +0 -2
- package/dist/types/src/containers/PromptList/index.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/components/ChatProgress/ChatProgress.tsx +0 -56
- package/src/components/ChatProgress/index.ts +0 -5
- package/src/components/ChatThread/widgets/PromptWidget.ts +0 -30
- package/src/containers/PromptArticle/index.ts +0 -5
- package/src/containers/PromptList/index.ts +0 -5
- package/src/types/defs.ts +0 -5
|
@@ -6,20 +6,21 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
8
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
9
|
-
import { DatabaseBlueprint,
|
|
10
|
-
import {
|
|
9
|
+
import { DatabaseBlueprint, WebSearchBlueprint } from '@dxos/assistant-toolkit';
|
|
10
|
+
import { Routine } from '@dxos/compute';
|
|
11
11
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
12
|
+
import { MarkdownBlueprint } from '@dxos/plugin-markdown/blueprints';
|
|
12
13
|
import { useQuery } from '@dxos/react-client/echo';
|
|
13
14
|
import { IconButton } from '@dxos/react-ui';
|
|
14
15
|
|
|
15
16
|
import { AssistantOperation } from '#operations';
|
|
16
17
|
|
|
17
|
-
export type
|
|
18
|
+
export type RoutineListProps = AppSurface.ObjectSectionProps<Obj.Unknown>;
|
|
18
19
|
|
|
19
|
-
export const
|
|
20
|
+
export const RoutineList = ({ subject }: RoutineListProps) => {
|
|
20
21
|
const { invokePromise } = useOperationInvoker();
|
|
21
22
|
const db = Obj.getDatabase(subject);
|
|
22
|
-
const prompts = useQuery(db, Filter.type(
|
|
23
|
+
const prompts = useQuery(db, Filter.type(Routine.Routine));
|
|
23
24
|
if (!db) {
|
|
24
25
|
return null;
|
|
25
26
|
}
|
|
@@ -2,271 +2,277 @@
|
|
|
2
2
|
// Copyright 2026 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Registry } from '@effect-atom/atom';
|
|
6
|
-
import * as KeyValueStore from '@effect/platform/KeyValueStore';
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import * as Effect from 'effect/Effect';
|
|
9
|
-
import
|
|
10
|
-
import * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
11
|
-
import * as Schema from 'effect/Schema';
|
|
12
|
-
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
7
|
+
import React, { PropsWithChildren, type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
13
8
|
|
|
14
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { Filter, Query } from '@dxos/echo';
|
|
18
|
-
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
19
|
-
import { Process, ServiceResolver, Trace } from '@dxos/functions';
|
|
10
|
+
import { addEventListener } from '@dxos/async';
|
|
11
|
+
import { Process, Trace } from '@dxos/compute';
|
|
12
|
+
import { Feed, Filter, Query } from '@dxos/echo';
|
|
20
13
|
import { FeedTraceSink, ProcessManager } from '@dxos/functions-runtime';
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
14
|
+
import { log } from '@dxos/log';
|
|
15
|
+
import { AutomationPlugin } from '@dxos/plugin-automation';
|
|
16
|
+
import { useComputeRuntime } from '@dxos/plugin-automation/hooks';
|
|
24
17
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
25
18
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
26
19
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
27
|
-
import {
|
|
28
|
-
import { useQuery } from '@dxos/react-client/echo';
|
|
20
|
+
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
29
21
|
import { IconButton, Panel, Toolbar } from '@dxos/react-ui';
|
|
30
22
|
import { Timeline } from '@dxos/react-ui-components';
|
|
31
|
-
import {
|
|
23
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
32
24
|
|
|
33
|
-
import { translations } from '
|
|
25
|
+
import { translations } from '#translations';
|
|
26
|
+
|
|
27
|
+
import { AssistantPlugin } from '../../cli';
|
|
34
28
|
import { buildExecutionGraph } from './execution-graph';
|
|
29
|
+
import { PLAYBACK_INTERVAL_MS, STEP_STORAGE_KEY, SimulatedAgent, useLocalStorageNumber } from './testing';
|
|
35
30
|
import { TracePanel } from './TracePanel';
|
|
36
31
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const delay = (ms: number) => Effect.promise(() => new Promise<void>((resolve) => setTimeout(resolve, ms)));
|
|
42
|
-
|
|
43
|
-
//
|
|
44
|
-
// Simulated agent scenarios.
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
const agentScenarios: { prompt: string; tools: string[] }[] = [
|
|
48
|
-
{
|
|
49
|
-
prompt: 'Create an organization called "Cyberdyne Systems"',
|
|
50
|
-
tools: ['list-schemas', 'create-object'],
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
prompt: 'Search for all organizations and persons',
|
|
54
|
-
tools: ['list-schemas', 'query', 'query'],
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
prompt: 'Create a person named "John Connor"',
|
|
58
|
-
tools: ['create-object'],
|
|
59
|
-
},
|
|
60
|
-
];
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Write a trace event and yield to the event loop so FeedTraceSink flushes it to ECHO before continuing.
|
|
64
|
-
*/
|
|
65
|
-
const writeAndFlush = <T,>(eventType: Trace.EventType<T>, payload: T) =>
|
|
66
|
-
Effect.gen(function* () {
|
|
67
|
-
yield* Trace.write(eventType, payload);
|
|
68
|
-
yield* Effect.promise(() => new Promise((resolve) => setTimeout(resolve, 100)));
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const SimulatedAgent = Process.make(
|
|
72
|
-
{
|
|
73
|
-
key: 'org.dxos.testing.process.agent',
|
|
74
|
-
input: Schema.Number,
|
|
75
|
-
output: Schema.Void,
|
|
76
|
-
services: [Trace.TraceService],
|
|
77
|
-
},
|
|
78
|
-
(ctx) =>
|
|
79
|
-
Effect.succeed({
|
|
80
|
-
onInput: (scenarioIndex: number) =>
|
|
81
|
-
Effect.gen(function* () {
|
|
82
|
-
const scenario = agentScenarios[scenarioIndex % agentScenarios.length];
|
|
83
|
-
const messageId = ObjectId.random();
|
|
84
|
-
|
|
85
|
-
// Agent begins processing.
|
|
86
|
-
yield* writeAndFlush(AgentRequestBegin, {});
|
|
87
|
-
|
|
88
|
-
// User message.
|
|
89
|
-
yield* writeAndFlush(CompleteBlock, {
|
|
90
|
-
messageId,
|
|
91
|
-
role: 'user',
|
|
92
|
-
block: { _tag: 'text', text: scenario.prompt },
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
// Simulate tool calls sequentially with delays.
|
|
96
|
-
for (const toolName of scenario.tools) {
|
|
97
|
-
const toolCallId = ObjectId.random();
|
|
98
|
-
|
|
99
|
-
// Tool call event.
|
|
100
|
-
yield* writeAndFlush(CompleteBlock, {
|
|
101
|
-
messageId,
|
|
102
|
-
role: 'assistant',
|
|
103
|
-
block: { _tag: 'toolCall', toolCallId, name: toolName, input: '{}', providerExecuted: false },
|
|
104
|
-
});
|
|
32
|
+
type BaseStoryProps = PropsWithChildren<{
|
|
33
|
+
toolbar: ReactNode;
|
|
34
|
+
}>;
|
|
105
35
|
|
|
106
|
-
|
|
107
|
-
|
|
36
|
+
const BaseStory = ({ children, toolbar }: BaseStoryProps) => (
|
|
37
|
+
<Panel.Root>
|
|
38
|
+
<Panel.Toolbar asChild>{toolbar}</Panel.Toolbar>
|
|
39
|
+
<Panel.Content asChild>{children}</Panel.Content>
|
|
40
|
+
</Panel.Root>
|
|
41
|
+
);
|
|
108
42
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
role: 'assistant',
|
|
113
|
-
block: { _tag: 'toolResult', toolCallId, name: toolName, providerExecuted: false },
|
|
114
|
-
});
|
|
115
|
-
}
|
|
43
|
+
const DefaultStory = () => {
|
|
44
|
+
const [space] = useSpaces();
|
|
45
|
+
const runtime = useComputeRuntime(space?.id);
|
|
116
46
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
onAlarm: () => Effect.void,
|
|
122
|
-
onChildEvent: () => Effect.void,
|
|
123
|
-
}),
|
|
124
|
-
);
|
|
47
|
+
const handleStart = useCallback(() => {
|
|
48
|
+
if (!runtime) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
125
51
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
52
|
+
void runtime.runPromise(
|
|
53
|
+
Effect.gen(function* () {
|
|
54
|
+
const manager = yield* ProcessManager.Service;
|
|
55
|
+
const handle = yield* manager.spawn(SimulatedAgent);
|
|
56
|
+
yield* handle.submitInput(Math.floor(Math.random() * 1_000));
|
|
57
|
+
log.info('submitInput', { handle });
|
|
58
|
+
}),
|
|
59
|
+
);
|
|
60
|
+
}, [runtime]);
|
|
61
|
+
|
|
62
|
+
// TODO(burdon): Implement.
|
|
63
|
+
const handleStop = useCallback(
|
|
64
|
+
(process: Process.Info) => {
|
|
65
|
+
log.info('stop', { process });
|
|
66
|
+
},
|
|
67
|
+
[runtime],
|
|
68
|
+
);
|
|
129
69
|
|
|
130
|
-
|
|
70
|
+
return (
|
|
71
|
+
<BaseStory
|
|
72
|
+
toolbar={
|
|
73
|
+
<Toolbar.Root>
|
|
74
|
+
<IconButton icon='ph--plus--regular' label='Start Agent' onClick={handleStart} />
|
|
75
|
+
</Toolbar.Root>
|
|
76
|
+
}
|
|
77
|
+
>
|
|
78
|
+
<TracePanel space={space} attendableId={space.id} onProcessTerminate={handleStop} />
|
|
79
|
+
</BaseStory>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
131
82
|
|
|
132
|
-
const
|
|
133
|
-
const
|
|
134
|
-
const
|
|
135
|
-
const traceSinkLayer = FeedTraceSink.layerLive.pipe(Layer.provide(dbLayer), Layer.provide(feedServiceLayer));
|
|
83
|
+
const SnapshotStory = () => {
|
|
84
|
+
const [space] = useSpaces();
|
|
85
|
+
const [feed] = useQuery(space?.db, FeedTraceSink.query);
|
|
136
86
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
Layer.provideMerge(Registry.layer),
|
|
142
|
-
Layer.provide(traceSinkLayer),
|
|
87
|
+
// All messages.
|
|
88
|
+
const allMessages = useQuery(
|
|
89
|
+
space?.db,
|
|
90
|
+
feed ? Query.select(Filter.everything()).from(feed) : Query.select(Filter.nothing()),
|
|
143
91
|
);
|
|
144
92
|
|
|
145
|
-
|
|
146
|
-
|
|
93
|
+
// Sort by first event timestamp so playback order is chronological regardless of query ordering.
|
|
94
|
+
const sortedMessages = useMemo(
|
|
95
|
+
() => [...allMessages].sort((a, b) => (a.events[0]?.timestamp ?? 0) - (b.events[0]?.timestamp ?? 0)),
|
|
96
|
+
[allMessages],
|
|
97
|
+
);
|
|
147
98
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
99
|
+
const total = sortedMessages.length;
|
|
100
|
+
const [step, setStep, stepHydrated] = useLocalStorageNumber(STEP_STORAGE_KEY, 0);
|
|
101
|
+
const [playing, setPlaying] = useState(false);
|
|
151
102
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const invokeCounterRef = useRef(0);
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
setStep((current) => Math.min(Math.max(current, 0), total));
|
|
105
|
+
}, [total, setStep]);
|
|
156
106
|
|
|
107
|
+
// Start with all messages loaded once the snapshot first arrives; afterwards the user controls `step`.
|
|
108
|
+
// Skip the auto-init if we restored a value from localStorage so we don't clobber the user's last position.
|
|
109
|
+
const hasInitializedRef = useRef(false);
|
|
157
110
|
useEffect(() => {
|
|
158
|
-
if (!
|
|
159
|
-
|
|
111
|
+
if (!hasInitializedRef.current && total > 0) {
|
|
112
|
+
hasInitializedRef.current = true;
|
|
113
|
+
if (!stepHydrated) {
|
|
114
|
+
setStep(total);
|
|
115
|
+
}
|
|
160
116
|
}
|
|
117
|
+
}, [total, stepHydrated, setStep]);
|
|
161
118
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
};
|
|
168
|
-
}, [space]);
|
|
119
|
+
const visibleMessages = useMemo(() => sortedMessages.slice(0, step), [sortedMessages, step]);
|
|
120
|
+
const { commits, branches } = useMemo(
|
|
121
|
+
() => buildExecutionGraph({ traceMessages: visibleMessages }),
|
|
122
|
+
[visibleMessages],
|
|
123
|
+
);
|
|
169
124
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (!
|
|
125
|
+
// Auto-play steps forward until we reach the end.
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
if (!playing) {
|
|
173
128
|
return;
|
|
174
129
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
})
|
|
183
|
-
);
|
|
130
|
+
const id = window.setInterval(() => {
|
|
131
|
+
setStep((current) => {
|
|
132
|
+
if (current >= total) {
|
|
133
|
+
setPlaying(false);
|
|
134
|
+
return current;
|
|
135
|
+
}
|
|
136
|
+
return current + 1;
|
|
137
|
+
});
|
|
138
|
+
}, PLAYBACK_INTERVAL_MS);
|
|
139
|
+
return () => window.clearInterval(id);
|
|
140
|
+
}, [playing, total]);
|
|
141
|
+
|
|
142
|
+
// Handlers.
|
|
143
|
+
const handleNext = useCallback(() => setStep((current) => Math.min(current + 1, total)), [total]);
|
|
144
|
+
const handlePrev = useCallback(() => setStep((current) => Math.max(current - 1, 0)), []);
|
|
145
|
+
const handleReset = useCallback(() => {
|
|
146
|
+
setStep(0);
|
|
147
|
+
setPlaying(false);
|
|
184
148
|
}, []);
|
|
149
|
+
const handleShowAll = useCallback(() => {
|
|
150
|
+
setStep(total);
|
|
151
|
+
setPlaying(false);
|
|
152
|
+
}, [total]);
|
|
153
|
+
const handleTogglePlay = useCallback(() => setPlaying((previous) => !previous), []);
|
|
185
154
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
155
|
+
// Keyboard shortcuts: ←/h step back, →/l step forward, space play/pause, r reset, e/End show all.
|
|
156
|
+
useEffect(() => {
|
|
157
|
+
return addEventListener(window, 'keydown', (event: KeyboardEvent) => {
|
|
158
|
+
const target = event.target as HTMLElement | null;
|
|
159
|
+
if (target?.tagName === 'INPUT' || target?.tagName === 'TEXTAREA' || target?.isContentEditable) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
switch (event.key) {
|
|
164
|
+
case 'ArrowRight':
|
|
165
|
+
case 'l':
|
|
166
|
+
event.preventDefault();
|
|
167
|
+
handleNext();
|
|
168
|
+
break;
|
|
169
|
+
case 'ArrowLeft':
|
|
170
|
+
case 'h':
|
|
171
|
+
event.preventDefault();
|
|
172
|
+
handlePrev();
|
|
173
|
+
break;
|
|
174
|
+
case ' ':
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
handleTogglePlay();
|
|
177
|
+
break;
|
|
178
|
+
case 'r':
|
|
179
|
+
event.preventDefault();
|
|
180
|
+
handleReset();
|
|
181
|
+
break;
|
|
182
|
+
case 'e':
|
|
183
|
+
case 'End':
|
|
184
|
+
event.preventDefault();
|
|
185
|
+
handleShowAll();
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}, [handleNext, handlePrev, handleTogglePlay, handleReset, handleShowAll]);
|
|
189
190
|
|
|
190
191
|
return (
|
|
191
|
-
<
|
|
192
|
-
|
|
192
|
+
<BaseStory
|
|
193
|
+
toolbar={
|
|
193
194
|
<Toolbar.Root>
|
|
194
|
-
<IconButton icon='ph--
|
|
195
|
+
<IconButton iconOnly icon='ph--skip-back--regular' label='Reset (R)' onClick={handleReset} />
|
|
196
|
+
<IconButton iconOnly icon='ph--caret-left--regular' label='Step back (← / H)' onClick={handlePrev} />
|
|
197
|
+
<IconButton
|
|
198
|
+
iconOnly
|
|
199
|
+
icon={playing ? 'ph--pause--regular' : 'ph--play--regular'}
|
|
200
|
+
label={playing ? 'Pause (Space)' : 'Play (Space)'}
|
|
201
|
+
onClick={handleTogglePlay}
|
|
202
|
+
/>
|
|
203
|
+
<IconButton iconOnly icon='ph--caret-right--regular' label='Step forward (→ / L)' onClick={handleNext} />
|
|
204
|
+
<IconButton iconOnly icon='ph--skip-forward--regular' label='Show all (E / End)' onClick={handleShowAll} />
|
|
205
|
+
<Toolbar.Separator />
|
|
206
|
+
<Toolbar.Text className='text-sm tabular-nums opacity-70'>
|
|
207
|
+
`${step} / ${total}`
|
|
208
|
+
</Toolbar.Text>
|
|
195
209
|
</Toolbar.Root>
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
</Panel.Root>
|
|
210
|
+
}
|
|
211
|
+
>
|
|
212
|
+
<Timeline branches={branches} commits={commits} showTimestamp />
|
|
213
|
+
</BaseStory>
|
|
201
214
|
);
|
|
202
215
|
};
|
|
203
216
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
space?.db,
|
|
210
|
-
feed ? Query.select(Filter.everything()).from(feed) : Query.select(Filter.nothing()),
|
|
211
|
-
);
|
|
212
|
-
dbg(traceMessages);
|
|
213
|
-
const { commits, branches } = useMemo(() => buildExecutionGraph({ traceMessages }), [traceMessages]);
|
|
214
|
-
dbg(commits);
|
|
215
|
-
return <Timeline branches={branches} commits={commits} showTimestamp />;
|
|
217
|
+
const meta = {
|
|
218
|
+
title: 'plugins/plugin-assistant/containers/TracePanel',
|
|
219
|
+
parameters: {
|
|
220
|
+
layout: 'fullscreen',
|
|
221
|
+
translations,
|
|
216
222
|
},
|
|
223
|
+
} satisfies Meta;
|
|
224
|
+
|
|
225
|
+
export default meta;
|
|
226
|
+
|
|
227
|
+
type Story = StoryObj<typeof meta>;
|
|
228
|
+
|
|
229
|
+
export const Default: Story = {
|
|
230
|
+
render: DefaultStory,
|
|
217
231
|
decorators: [
|
|
218
232
|
withTheme(),
|
|
219
|
-
withLayout({ layout: 'column' }),
|
|
233
|
+
withLayout({ layout: 'column', classNames: 'w-(--dx-complementary-sidebar-size) overflow-hidden' }),
|
|
220
234
|
withPluginManager({
|
|
221
235
|
plugins: [
|
|
222
236
|
...corePlugins(),
|
|
223
237
|
ClientPlugin({
|
|
224
238
|
types: [Feed.Feed, Trace.Message],
|
|
225
239
|
onClientInitialized: ({ client }) =>
|
|
226
|
-
Effect.
|
|
227
|
-
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
filename: 'trace-events.dx.json',
|
|
231
|
-
contents: new TextEncoder().encode(JSON.stringify(data)),
|
|
232
|
-
});
|
|
233
|
-
await space.db.flush();
|
|
240
|
+
Effect.gen(function* () {
|
|
241
|
+
yield* initializeIdentity(client);
|
|
242
|
+
const [space] = client.spaces.get();
|
|
243
|
+
yield* Effect.promise(() => space.waitUntilReady());
|
|
234
244
|
}),
|
|
235
245
|
}),
|
|
246
|
+
AssistantPlugin(),
|
|
247
|
+
AutomationPlugin(),
|
|
236
248
|
],
|
|
237
249
|
}),
|
|
238
250
|
],
|
|
239
251
|
};
|
|
240
252
|
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
render: DefaultStory,
|
|
253
|
+
export const WithSnapshot: Story = {
|
|
254
|
+
render: SnapshotStory,
|
|
244
255
|
decorators: [
|
|
245
256
|
withTheme(),
|
|
246
|
-
withLayout({ layout: 'column' }),
|
|
257
|
+
withLayout({ layout: 'column', classNames: 'w-(--dx-complementary-sidebar-size)' }),
|
|
247
258
|
withPluginManager({
|
|
248
259
|
plugins: [
|
|
249
260
|
...corePlugins(),
|
|
250
261
|
ClientPlugin({
|
|
251
262
|
types: [Feed.Feed, Trace.Message],
|
|
252
263
|
onClientInitialized: ({ client }) =>
|
|
253
|
-
Effect.
|
|
254
|
-
|
|
255
|
-
const
|
|
256
|
-
|
|
264
|
+
Effect.promise(async () => {
|
|
265
|
+
await client.halo.createIdentity();
|
|
266
|
+
const data = await import('../../testing/data/trace-timeline.dx.json');
|
|
267
|
+
const space = await client.spaces.import({
|
|
268
|
+
filename: 'trace-events.dx.json',
|
|
269
|
+
contents: new TextEncoder().encode(JSON.stringify(data)),
|
|
270
|
+
});
|
|
271
|
+
await space.db.flush();
|
|
257
272
|
}),
|
|
258
273
|
}),
|
|
274
|
+
AutomationPlugin(),
|
|
259
275
|
],
|
|
260
276
|
}),
|
|
261
277
|
],
|
|
262
|
-
|
|
263
|
-
layout: 'fullscreen',
|
|
264
|
-
translations,
|
|
265
|
-
},
|
|
266
|
-
} satisfies Meta;
|
|
267
|
-
|
|
268
|
-
export default meta;
|
|
269
|
-
|
|
270
|
-
type Story = StoryObj<typeof meta>;
|
|
271
|
-
|
|
272
|
-
export const Default: Story = {};
|
|
278
|
+
};
|