@blackbelt-technology/pi-dashboard-flows-plugin 0.5.3 → 0.5.4

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.
Files changed (35) hide show
  1. package/package.json +39 -4
  2. package/src/__tests__/FlowsSessionStateContext.test.tsx +260 -0
  3. package/src/__tests__/FlowsUiStateContext.test.tsx +140 -0
  4. package/src/__tests__/flowsAvailability.test.ts +92 -0
  5. package/src/__tests__/manifest-discoverability.test.ts +97 -0
  6. package/src/__tests__/render-actions.test.ts +63 -0
  7. package/src/bridge/flow-question-adapter.ts +93 -0
  8. package/src/bridge/index.ts +30 -0
  9. package/src/client/FlowActivityBadge.tsx +36 -9
  10. package/src/client/FlowAgentCard.tsx +180 -41
  11. package/src/client/FlowAgentDetail.tsx +95 -154
  12. package/src/client/FlowAgentPopoutClaim.tsx +66 -0
  13. package/src/client/FlowAgentPopoutPage.tsx +177 -0
  14. package/src/client/FlowArchitect.tsx +297 -220
  15. package/src/client/FlowArchitectPopoutClaim.tsx +52 -0
  16. package/src/client/FlowArchitectPopoutPage.tsx +133 -0
  17. package/src/client/FlowDashboard.tsx +194 -31
  18. package/src/client/FlowGraph.tsx +6 -2
  19. package/src/client/FlowLaunchDialog.tsx +8 -2
  20. package/src/client/FlowQuestionCard.tsx +213 -0
  21. package/src/client/FlowQuestionTranscriptPill.tsx +58 -0
  22. package/src/client/FlowSummary.tsx +43 -21
  23. package/src/client/FlowYamlPopoverButton.tsx +109 -0
  24. package/src/client/FlowYamlPreview.tsx +65 -0
  25. package/src/client/FlowsCommandRoutes.tsx +237 -0
  26. package/src/client/FlowsSessionStateContext.tsx +161 -0
  27. package/src/client/FlowsUiStateContext.tsx +169 -0
  28. package/src/client/SessionFlowActions.tsx +96 -5
  29. package/src/client/flowsAvailability.ts +103 -0
  30. package/src/client/index.tsx +94 -7
  31. package/src/client/popout-url.ts +59 -0
  32. package/src/client/shouldRender.ts +26 -0
  33. package/src/server/index.ts +87 -0
  34. package/src/server/render-actions.ts +88 -0
  35. package/src/server/state-store.ts +85 -0
@@ -1,173 +1,114 @@
1
+ /**
2
+ * FlowAgentDetail — thin adapter shim over `MinimalChatView`.
3
+ *
4
+ * Maps `FlowAgentState` → `MinimalChatViewProps`. Preserves the existing
5
+ * public API (`agent`, `onBack`) so `FlowAgentCard`'s eye-button popover
6
+ * (and the future `FlowAgentPopoutPage` route) keep working without change.
7
+ *
8
+ * See change: extract-minimal-chat-view.
9
+ */
1
10
  import React from "react";
2
- import { Icon } from "@mdi/react";
3
- import { mdiArrowLeft, mdiCheckCircle, mdiCloseCircle, mdiAlertCircle, mdiCircle, mdiCircleOutline } from "@mdi/js";
4
- import type { FlowAgentState, FlowDetailEntry } from "@blackbelt-technology/pi-dashboard-shared/types.js";
5
- import { MarkdownContent } from "../../../client/src/components/MarkdownContent.js";
11
+ import type {
12
+ FlowAgentState,
13
+ FlowAgentStatus,
14
+ FlowDetailEntry,
15
+ } from "@blackbelt-technology/pi-dashboard-shared/types.js";
16
+ import { UI_PRIMITIVE_KEYS } from "@blackbelt-technology/pi-dashboard-shared/dashboard-plugin/ui-primitives.js";
17
+ import { useUiPrimitive } from "@blackbelt-technology/dashboard-plugin-runtime";
18
+ import {
19
+ MinimalChatView,
20
+ type MinimalChatEntry,
21
+ type MinimalChatStatus,
22
+ } from "@blackbelt-technology/pi-dashboard-client-utils/minimal-chat";
6
23
 
7
- function formatTokens(n: number): string {
8
- if (n < 1000) return String(n);
9
- return Math.round(n / 1000) + "k";
10
- }
11
-
12
- function formatDuration(ms: number): string {
13
- const sec = ms / 1000;
14
- return sec < 60 ? `${sec.toFixed(1)}s` : `${Math.floor(sec / 60)}m ${Math.floor(sec % 60)}s`;
15
- }
16
-
17
- function extractInputPreview(toolName: string, input: unknown): string {
18
- if (!input || typeof input !== "object") return "";
19
- const inp = input as Record<string, unknown>;
20
- switch (toolName.toLowerCase()) {
21
- case "read":
22
- case "write":
23
- case "edit":
24
- return String(inp.file_path || inp.path || "");
25
- case "bash":
26
- return String(inp.command || "").slice(0, 80);
27
- case "grep":
28
- return String(inp.pattern || "").slice(0, 40);
29
- default:
30
- return JSON.stringify(input).slice(0, 60);
24
+ function mapFlowStatus(status: FlowAgentStatus): MinimalChatStatus {
25
+ switch (status) {
26
+ case "pending":
27
+ return "pending";
28
+ case "running":
29
+ return "running";
30
+ case "complete":
31
+ return "complete";
32
+ case "error":
33
+ return "error";
34
+ case "blocked":
35
+ return "blocked";
36
+ default: {
37
+ const _exhaustive: never = status;
38
+ void _exhaustive;
39
+ return "pending";
40
+ }
31
41
  }
32
42
  }
33
43
 
34
- function ToolCallEntry({ entry }: { entry: FlowDetailEntry & { kind: "tool" } }) {
35
- const preview = extractInputPreview(entry.toolName, entry.input);
36
- const hasOutput = entry.output !== undefined;
37
- const [expanded, setExpanded] = React.useState(false);
38
-
39
- return (
40
- <div className={`border-l-2 pl-3 py-1.5 ${entry.isError ? "border-red-500/50" : "border-blue-500/30"}`}>
41
- <div
42
- className="flex items-center gap-1.5 cursor-pointer"
43
- onClick={() => hasOutput && setExpanded(!expanded)}
44
- >
45
- <span className={`text-xs font-mono ${entry.isError ? "text-red-400" : "text-blue-400"}`}>
46
- {entry.toolName}
47
- </span>
48
- <span className="text-xs text-[var(--text-tertiary)] truncate">{preview}</span>
49
- {hasOutput && (
50
- <span className="text-[10px] text-[var(--text-muted)] ml-auto flex-shrink-0">
51
- {expanded ? "▾" : "▸"}
52
- </span>
53
- )}
54
- </div>
55
- {expanded && hasOutput && (
56
- <pre className="text-[11px] text-[var(--text-secondary)] mt-1 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap break-words bg-[var(--bg-tertiary)] rounded p-2">
57
- {typeof entry.output === "string" ? entry.output : JSON.stringify(entry.output, null, 2)}
58
- </pre>
59
- )}
60
- </div>
61
- );
62
- }
63
-
64
- function TextEntry({ text }: { text: string }) {
65
- return (
66
- <div className="py-1.5 pl-3">
67
- <MarkdownContent content={text} />
68
- </div>
69
- );
70
- }
71
-
72
- function ThinkingEntry({ text }: { text: string }) {
73
- const [expanded, setExpanded] = React.useState(false);
74
- return (
75
- <div className="py-1 pl-3">
76
- <div
77
- className="flex items-center gap-1 cursor-pointer text-[11px] text-purple-400/70"
78
- onClick={() => setExpanded(!expanded)}
79
- >
80
- <span>{expanded ? "▾" : "▸"}</span>
81
- <span>Thinking</span>
82
- </div>
83
- {expanded && (
84
- <pre className="text-[11px] text-[var(--text-muted)] mt-1 whitespace-pre-wrap break-words max-h-64 overflow-y-auto">
85
- {text}
86
- </pre>
87
- )}
88
- </div>
89
- );
44
+ function mapFlowEntries(detailHistory: FlowDetailEntry[]): MinimalChatEntry[] {
45
+ return detailHistory.map((e) => {
46
+ switch (e.kind) {
47
+ case "tool":
48
+ return {
49
+ kind: "tool",
50
+ toolName: e.toolName,
51
+ input: e.input,
52
+ output: e.output,
53
+ isError: e.isError,
54
+ };
55
+ case "text":
56
+ return { kind: "text", text: e.text };
57
+ case "thinking":
58
+ return { kind: "thinking", text: e.text };
59
+ case "error":
60
+ return { kind: "error", text: e.text };
61
+ default: {
62
+ const _exhaustive: never = e;
63
+ void _exhaustive;
64
+ return { kind: "error", text: "(unknown entry)" };
65
+ }
66
+ }
67
+ });
90
68
  }
91
69
 
92
70
  export function FlowAgentDetail({
93
71
  agent,
94
72
  onBack,
73
+ sessionId,
95
74
  }: {
96
75
  agent: FlowAgentState;
97
- onBack: () => void;
76
+ onBack?: () => void;
77
+ /** Forwarded to MinimalChatView so per-tool renderers can build session-scoped links. */
78
+ sessionId?: string;
98
79
  }) {
99
- const displayName = agent.label || agent.agentName;
100
- const isComplete = agent.status === "complete" || agent.status === "error" || agent.status === "blocked";
80
+ const MarkdownContent = useUiPrimitive(UI_PRIMITIVE_KEYS.markdownContent);
81
+ const title = agent.label || agent.agentName;
82
+ const status = mapFlowStatus(agent.status);
83
+ const isComplete =
84
+ agent.status === "complete" || agent.status === "error" || agent.status === "blocked";
101
85
 
102
- const statusIconPath = agent.status === "complete" ? mdiCheckCircle
103
- : agent.status === "error" ? mdiCloseCircle
104
- : agent.status === "blocked" ? mdiAlertCircle
105
- : agent.status === "running" ? mdiCircle
106
- : mdiCircleOutline;
86
+ const entries = mapFlowEntries(agent.detailHistory);
107
87
 
108
- const statusColor = agent.status === "complete" ? "text-green-400"
109
- : agent.status === "error" ? "text-red-400"
110
- : agent.status === "blocked" ? "text-orange-400"
111
- : agent.status === "running" ? "text-yellow-400"
112
- : "text-[var(--text-tertiary)]";
113
-
114
- return (
115
- <div className="flex flex-col h-full overflow-hidden">
116
- {/* Header */}
117
- <div className="px-3 py-2 border-b border-[var(--border-subtle)] bg-[var(--bg-secondary)] flex items-center gap-2">
118
- <button
119
- onClick={onBack}
120
- className="text-[var(--text-tertiary)] hover:text-[var(--text-primary)] transition-colors"
121
- >
122
- <Icon path={mdiArrowLeft} size={0.7} />
123
- </button>
124
- <span className={`${statusColor} inline-flex`}><Icon path={statusIconPath} size={0.6} /></span>
125
- <span className="text-sm font-medium text-[var(--text-primary)]">{displayName}</span>
126
- {agent.model && (
127
- <span className="text-[11px] text-[var(--text-tertiary)]">{agent.model}</span>
128
- )}
129
- {isComplete && agent.tokens && (
130
- <span className="text-[11px] text-[var(--text-muted)] ml-auto">
131
- ↑{formatTokens(agent.tokens.input)} ↓{formatTokens(agent.tokens.output)} · {formatDuration(agent.duration ?? 0)}
132
- </span>
133
- )}
134
- </div>
88
+ const footer = agent.summary ? (
89
+ <div className="mt-3 pt-2 border-t border-[var(--border-subtle)]">
90
+ <div className="text-[11px] text-[var(--text-muted)] mb-1">Summary</div>
91
+ <MarkdownContent content={agent.summary} />
92
+ </div>
93
+ ) : undefined;
135
94
 
136
- {/* Detail history */}
137
- <div className="flex-1 overflow-y-auto px-3 py-2 space-y-0.5">
138
- {agent.detailHistory.length === 0 ? (
139
- <div className="text-sm text-[var(--text-muted)] py-4 text-center">
140
- {agent.status === "pending" ? "Waiting to start..." : "No activity yet"}
141
- </div>
142
- ) : (
143
- agent.detailHistory.map((entry, i) => {
144
- switch (entry.kind) {
145
- case "tool":
146
- return <ToolCallEntry key={i} entry={entry} />;
147
- case "text":
148
- return <TextEntry key={i} text={entry.text} />;
149
- case "thinking":
150
- return <ThinkingEntry key={i} text={entry.text} />;
151
- case "error":
152
- return (
153
- <div key={i} className="py-1.5 pl-3 text-sm text-red-400">
154
- {entry.text}
155
- </div>
156
- );
157
- default:
158
- return null;
159
- }
160
- })
161
- )}
95
+ const emptyMessage = agent.status === "pending" ? "Waiting to start..." : "No activity yet";
162
96
 
163
- {/* Summary at bottom */}
164
- {agent.summary && (
165
- <div className="mt-3 pt-2 border-t border-[var(--border-subtle)]">
166
- <div className="text-[11px] text-[var(--text-muted)] mb-1">Summary</div>
167
- <MarkdownContent content={agent.summary} />
168
- </div>
169
- )}
170
- </div>
171
- </div>
97
+ return (
98
+ <MinimalChatView
99
+ title={title}
100
+ status={status}
101
+ entries={entries}
102
+ mode="popout"
103
+ onBack={onBack}
104
+ sessionId={sessionId}
105
+ meta={{
106
+ modelName: agent.model,
107
+ tokens: agent.tokens,
108
+ durationMs: isComplete ? agent.duration : undefined,
109
+ }}
110
+ emptyMessage={emptyMessage}
111
+ footer={footer}
112
+ />
172
113
  );
173
114
  }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * FlowAgentPopoutClaim — slot-claim wrapper for the `shell-overlay-route`
3
+ * registration `/session/:sid/flow/:flowId/agent/:agentId`.
4
+ *
5
+ * Self-derived from the slot props:
6
+ * - Reads `params.sid` / `params.flowId` (URL-decoded) / `params.agentId`.
7
+ * - Receives `session: DashboardSession | undefined` from the slot consumer.
8
+ * - Cold-open subscribes to the parent session via `usePluginSend`.
9
+ * - Reads flow state via `useFlowsSessionState(params.sid)`.
10
+ * - Renders the existing `FlowAgentPopoutPage` body.
11
+ *
12
+ * See change: add-flow-agent-popout.
13
+ */
14
+ import React, { useEffect, useRef } from "react";
15
+ import {
16
+ usePluginSend,
17
+ useShellConnectionStatus,
18
+ } from "@blackbelt-technology/dashboard-plugin-runtime";
19
+ import type { DashboardSession } from "@blackbelt-technology/pi-dashboard-shared/types.js";
20
+ import { useFlowsSessionState } from "./FlowsSessionStateContext.js";
21
+ import { FlowAgentPopoutPage } from "./FlowAgentPopoutPage.js";
22
+
23
+ export interface FlowAgentPopoutClaimProps {
24
+ params: Record<string, string>;
25
+ session?: DashboardSession;
26
+ onBack: () => void;
27
+ }
28
+
29
+ export function FlowAgentPopoutClaim({ params, session, onBack }: FlowAgentPopoutClaimProps) {
30
+ const sessionId = params.sid ?? "";
31
+ const flowId = params.flowId ?? "";
32
+ const agentId = params.agentId ?? "";
33
+ const send = usePluginSend();
34
+ const { flowStates } = useFlowsSessionState(sessionId);
35
+ const connectionStatus = useShellConnectionStatus();
36
+
37
+ // Cold-open subscribe exactly once, AFTER the WebSocket is open.
38
+ // See change: fix-flows-plugin-polish (popout cold-open subscribe).
39
+ const subscribedRef = useRef(false);
40
+ useEffect(() => {
41
+ if (!sessionId || subscribedRef.current) return;
42
+ if (connectionStatus !== "connected") return;
43
+ subscribedRef.current = true;
44
+ send({ type: "subscribe", sessionId, lastSeq: 0 });
45
+ }, [sessionId, send, connectionStatus]);
46
+
47
+ // The popout page's empty-state ladder evaluates loading → no session →
48
+ // no flow → no agent. We forward `flowStates` via the lightweight shape
49
+ // FlowAgentPopoutPage expects.
50
+ const subscriptionResolved = !!session || flowStates.size > 0;
51
+ const sessionLike = session || flowStates.size > 0
52
+ ? { flowStates }
53
+ : undefined;
54
+
55
+ return (
56
+ <FlowAgentPopoutPage
57
+ sessionId={sessionId}
58
+ flowId={flowId}
59
+ agentId={agentId}
60
+ session={sessionLike}
61
+ subscriptionResolved={subscriptionResolved}
62
+ parentLabel={session?.cwd}
63
+ onBack={onBack}
64
+ />
65
+ );
66
+ }
@@ -0,0 +1,177 @@
1
+ /**
2
+ * FlowAgentPopoutPage — fullscreen route content for
3
+ * `/session/:sid/flow/:flowId/agent/:agentId`.
4
+ *
5
+ * Mounts `FlowAgentDetail` in popout mode plus a chrome header. Graceful
6
+ * empty-state ladder:
7
+ * 1. Subscription not yet resolved → "Loading parent session…"
8
+ * 2. Parent session not found → close-tab CTA
9
+ * 3. Flow not present on parent session → "Flow not found"
10
+ * 4. Agent not present in flow → "Agent not found"
11
+ *
12
+ * Mirrors `SubagentPopoutPage` structurally; both popouts share the same
13
+ * four-tier empty-state contract.
14
+ *
15
+ * See change: add-flow-agent-popout.
16
+ */
17
+ import React, { useEffect } from "react";
18
+ import { Icon } from "@mdi/react";
19
+ import { mdiArrowLeft, mdiClose } from "@mdi/js";
20
+ import type { FlowState } from "@blackbelt-technology/pi-dashboard-shared/types.js";
21
+ import { FlowAgentDetail } from "./FlowAgentDetail.js";
22
+
23
+ /** Minimal session-state shape this page consumes. */
24
+ export interface FlowAgentPopoutSessionLike {
25
+ // Read-only: page only calls `.get(flowId)`. ReadonlyMap allows passing the
26
+ // frozen map returned by `useFlowsSessionState` directly.
27
+ flowStates?: ReadonlyMap<string, FlowState>;
28
+ }
29
+
30
+ export interface FlowAgentPopoutPageProps {
31
+ sessionId: string;
32
+ flowId: string;
33
+ agentId: string;
34
+ /** Parent session state (or undefined if not yet subscribed). */
35
+ session: FlowAgentPopoutSessionLike | undefined;
36
+ /** True once the parent session's subscription has resolved. */
37
+ subscriptionResolved: boolean;
38
+ /** Optional parent-session display label (e.g. cwd basename) for the breadcrumb. */
39
+ parentLabel?: string;
40
+ onBack?: () => void;
41
+ }
42
+
43
+ export function FlowAgentPopoutPage({
44
+ sessionId,
45
+ flowId,
46
+ agentId,
47
+ session,
48
+ subscriptionResolved,
49
+ parentLabel,
50
+ onBack,
51
+ }: FlowAgentPopoutPageProps) {
52
+ const flow = session?.flowStates?.get(flowId);
53
+ const agent = flow?.agents.get(agentId);
54
+ const agentName = agent?.label || agent?.agentName || agentId;
55
+
56
+ useEffect(() => {
57
+ document.title = `${agentName} · ${flowId} · ${parentLabel ?? sessionId} · pi`;
58
+ return () => {
59
+ document.title = "pi";
60
+ };
61
+ }, [agentName, flowId, parentLabel, sessionId]);
62
+
63
+ // (1) Loading: subscription has not resolved yet.
64
+ if (!subscriptionResolved) {
65
+ return (
66
+ <div
67
+ data-testid="flow-agent-popout-loading"
68
+ className="flex flex-col h-full items-center justify-center text-sm text-[var(--text-muted)] gap-2"
69
+ >
70
+ <div>Loading parent session…</div>
71
+ </div>
72
+ );
73
+ }
74
+
75
+ // (2) Parent session not found.
76
+ if (!session) {
77
+ return (
78
+ <div
79
+ data-testid="flow-agent-popout-no-session"
80
+ className="flex flex-col h-full items-center justify-center text-sm text-[var(--text-muted)] gap-3 px-6 text-center"
81
+ >
82
+ <div className="text-base text-[var(--text-primary)]">Parent session not found</div>
83
+ <div className="max-w-md">
84
+ It may have been archived or deleted. Close this tab — the session
85
+ this flow was launched from is no longer available in the dashboard.
86
+ </div>
87
+ <button
88
+ onClick={() => window.close()}
89
+ className="text-xs text-[var(--text-tertiary)] hover:text-[var(--text-primary)] inline-flex items-center gap-1 mt-2 px-3 py-1 border border-[var(--border-primary)] rounded"
90
+ >
91
+ <Icon path={mdiClose} size={0.5} /> Close tab
92
+ </button>
93
+ </div>
94
+ );
95
+ }
96
+
97
+ // (3) Flow not found on parent session.
98
+ if (!flow) {
99
+ return (
100
+ <div data-testid="flow-agent-popout-no-flow" className="flex flex-col h-full overflow-hidden">
101
+ <div className="px-3 py-2 border-b border-[var(--border-subtle)] bg-[var(--bg-secondary)] flex items-center gap-2 flex-shrink-0">
102
+ {onBack && (
103
+ <button
104
+ onClick={onBack}
105
+ className="text-[var(--text-tertiary)] hover:text-[var(--text-primary)] transition-colors"
106
+ title="Back"
107
+ >
108
+ <Icon path={mdiArrowLeft} size={0.7} />
109
+ </button>
110
+ )}
111
+ <span className="text-sm text-[var(--text-primary)]">
112
+ Flow · {parentLabel ?? sessionId}
113
+ </span>
114
+ </div>
115
+ <div className="flex-1 flex items-center justify-center text-sm text-[var(--text-muted)] px-6 text-center">
116
+ Flow “{flowId}” is no longer active on this session.
117
+ </div>
118
+ </div>
119
+ );
120
+ }
121
+
122
+ // (4) Agent not found in flow.
123
+ if (!agent) {
124
+ return (
125
+ <div data-testid="flow-agent-popout-no-agent" className="flex flex-col h-full overflow-hidden">
126
+ <div className="px-3 py-2 border-b border-[var(--border-subtle)] bg-[var(--bg-secondary)] flex items-center gap-2 flex-shrink-0">
127
+ {onBack && (
128
+ <button
129
+ onClick={onBack}
130
+ className="text-[var(--text-tertiary)] hover:text-[var(--text-primary)] transition-colors"
131
+ title="Back"
132
+ >
133
+ <Icon path={mdiArrowLeft} size={0.7} />
134
+ </button>
135
+ )}
136
+ <span className="text-sm text-[var(--text-primary)]">
137
+ {parentLabel ?? sessionId} › {flowId}
138
+ </span>
139
+ </div>
140
+ <div className="flex-1 flex items-center justify-center text-sm text-[var(--text-muted)] px-6 text-center">
141
+ Agent “{agentId}” not found in this flow — it may have been cleared.
142
+ </div>
143
+ </div>
144
+ );
145
+ }
146
+
147
+ // (5) Found — render the detail view with a chrome header.
148
+ return (
149
+ <div data-testid="flow-agent-popout" className="flex flex-col h-full overflow-hidden">
150
+ <div className="px-3 py-2 border-b border-[var(--border-primary)] bg-[var(--bg-primary)] flex items-center gap-2 flex-shrink-0">
151
+ {onBack && (
152
+ <button
153
+ onClick={onBack}
154
+ className="text-[var(--text-tertiary)] hover:text-[var(--text-primary)] transition-colors"
155
+ title="Back"
156
+ >
157
+ <Icon path={mdiArrowLeft} size={0.7} />
158
+ </button>
159
+ )}
160
+ <span className="text-[11px] text-[var(--text-tertiary)] truncate flex-shrink-0">
161
+ {parentLabel ?? sessionId} › {flowId} ›
162
+ </span>
163
+ <span className="text-sm font-medium text-[var(--text-primary)] truncate flex-1 min-w-0">
164
+ {agentName}
165
+ </span>
166
+ </div>
167
+ {/* `min-h-0` required so body scrolls instead of overflowing.
168
+ See change: fix-flows-plugin-polish (scrollbar fix). */}
169
+ <div className="flex-1 min-h-0 overflow-hidden">
170
+ {/* FlowAgentDetail's own header carries status/model/tokens; the chrome
171
+ above carries breadcrumb + back nav. We omit `onBack` so the inner
172
+ header does not render a duplicate back arrow. */}
173
+ <FlowAgentDetail agent={agent} sessionId={sessionId} />
174
+ </div>
175
+ </div>
176
+ );
177
+ }