footprint-explainable-ui 0.3.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/theme/ThemeProvider.tsx","../src/theme/tokens.ts","../src/theme/styles.ts","../src/theme/presets.ts","../src/components/MemoryInspector/MemoryInspector.tsx","../src/components/NarrativeLog/NarrativeLog.tsx","../src/components/NarrativeTrace/NarrativeTrace.tsx","../src/components/GanttTimeline/GanttTimeline.tsx","../src/components/SnapshotPanel/SnapshotPanel.tsx","../src/components/ScopeDiff/ScopeDiff.tsx","../src/components/ResultPanel/ResultPanel.tsx","../src/components/TimeTravelControls/TimeTravelControls.tsx","../src/components/ExplainableShell/ExplainableShell.tsx","../src/adapters/fromRuntimeSnapshot.ts"],"sourcesContent":["// Types\nexport type { StageSnapshot, Size, BaseComponentProps } from \"./types\";\n\n// Theme\nexport { FootprintTheme, useFootprintTheme } from \"./theme\";\nexport { tokensToCSSVars, defaultTokens } from \"./theme\";\nexport { themePresets, coolDark, warmDark, warmLight } from \"./theme\";\nexport type { ThemeTokens, ThemePresetName } from \"./theme\";\n\n// Core components (zero external deps beyond React)\nexport { MemoryInspector } from \"./components/MemoryInspector\";\nexport type { MemoryInspectorProps } from \"./components/MemoryInspector\";\n\nexport { NarrativeLog } from \"./components/NarrativeLog\";\nexport type { NarrativeLogProps } from \"./components/NarrativeLog\";\n\nexport { NarrativeTrace } from \"./components/NarrativeTrace\";\nexport type { NarrativeTraceProps } from \"./components/NarrativeTrace\";\n\nexport { GanttTimeline } from \"./components/GanttTimeline\";\nexport type { GanttTimelineProps } from \"./components/GanttTimeline\";\n\nexport { SnapshotPanel } from \"./components/SnapshotPanel\";\nexport type { SnapshotPanelProps } from \"./components/SnapshotPanel\";\n\nexport { ScopeDiff } from \"./components/ScopeDiff\";\nexport type { ScopeDiffProps, DiffEntry } from \"./components/ScopeDiff\";\n\nexport { ResultPanel } from \"./components/ResultPanel\";\nexport type { ResultPanelProps } from \"./components/ResultPanel\";\n\nexport { TimeTravelControls } from \"./components/TimeTravelControls\";\nexport type { TimeTravelControlsProps } from \"./components/TimeTravelControls\";\n\nexport { ExplainableShell } from \"./components/ExplainableShell\";\nexport type { ExplainableShellProps, ShellTab } from \"./components/ExplainableShell\";\n\n// Adapters\nexport { toVisualizationSnapshots, createSnapshots } from \"./adapters/fromRuntimeSnapshot\";\n","import { createContext, useContext } from \"react\";\nimport type { ThemeTokens } from \"./tokens\";\nimport { tokensToCSSVars } from \"./tokens\";\n\nconst ThemeContext = createContext<ThemeTokens>({});\n\nexport function useFootprintTheme(): ThemeTokens {\n return useContext(ThemeContext);\n}\n\ninterface FootprintThemeProps {\n tokens?: ThemeTokens;\n children: React.ReactNode;\n}\n\n/**\n * Optional theme provider — wraps children with CSS custom properties.\n * Consumers can also just set --fp-* CSS variables directly.\n */\nexport function FootprintTheme({ tokens = {}, children }: FootprintThemeProps) {\n const cssVars = tokensToCSSVars(tokens);\n\n return (\n <ThemeContext.Provider value={tokens}>\n <div style={cssVars as React.CSSProperties} className=\"fp-theme-root\">\n {children}\n </div>\n </ThemeContext.Provider>\n );\n}\n","/** Default theme tokens — consumers override via CSS variables or ThemeProvider. */\nexport interface ThemeTokens {\n colors?: {\n primary?: string;\n success?: string;\n error?: string;\n warning?: string;\n bgPrimary?: string;\n bgSecondary?: string;\n bgTertiary?: string;\n textPrimary?: string;\n textSecondary?: string;\n textMuted?: string;\n border?: string;\n };\n radius?: string;\n fontFamily?: {\n sans?: string;\n mono?: string;\n };\n}\n\n/** Maps ThemeTokens to CSS custom property assignments. */\nexport function tokensToCSSVars(tokens: ThemeTokens): Record<string, string> {\n const vars: Record<string, string> = {};\n if (tokens.colors) {\n const c = tokens.colors;\n if (c.primary) vars[\"--fp-color-primary\"] = c.primary;\n if (c.success) vars[\"--fp-color-success\"] = c.success;\n if (c.error) vars[\"--fp-color-error\"] = c.error;\n if (c.warning) vars[\"--fp-color-warning\"] = c.warning;\n if (c.bgPrimary) vars[\"--fp-bg-primary\"] = c.bgPrimary;\n if (c.bgSecondary) vars[\"--fp-bg-secondary\"] = c.bgSecondary;\n if (c.bgTertiary) vars[\"--fp-bg-tertiary\"] = c.bgTertiary;\n if (c.textPrimary) vars[\"--fp-text-primary\"] = c.textPrimary;\n if (c.textSecondary) vars[\"--fp-text-secondary\"] = c.textSecondary;\n if (c.textMuted) vars[\"--fp-text-muted\"] = c.textMuted;\n if (c.border) vars[\"--fp-border\"] = c.border;\n }\n if (tokens.radius) vars[\"--fp-radius\"] = tokens.radius;\n if (tokens.fontFamily?.sans) vars[\"--fp-font-sans\"] = tokens.fontFamily.sans;\n if (tokens.fontFamily?.mono) vars[\"--fp-font-mono\"] = tokens.fontFamily.mono;\n return vars;\n}\n\n/** Default dark theme values (used as CSS variable fallbacks). */\nexport const defaultTokens: Required<{\n [K in keyof ThemeTokens]-?: Required<ThemeTokens[K]>;\n}> = {\n colors: {\n primary: \"#6366f1\",\n success: \"#22c55e\",\n error: \"#ef4444\",\n warning: \"#f59e0b\",\n bgPrimary: \"#0f172a\",\n bgSecondary: \"#1e293b\",\n bgTertiary: \"#334155\",\n textPrimary: \"#f8fafc\",\n textSecondary: \"#94a3b8\",\n textMuted: \"#64748b\",\n border: \"#334155\",\n },\n radius: \"8px\",\n fontFamily: {\n sans: \"Inter, system-ui, -apple-system, sans-serif\",\n mono: \"'JetBrains Mono', 'Fira Code', monospace\",\n },\n};\n","import type { Size } from \"../types\";\n\n/**\n * Helper to resolve a CSS variable with a fallback.\n * Usage: v(\"--fp-color-primary\", \"#6366f1\")\n */\nexport function v(varName: string, fallback: string): string {\n return `var(${varName}, ${fallback})`;\n}\n\n/** Shorthand for common theme variables */\nexport const theme = {\n primary: v(\"--fp-color-primary\", \"#6366f1\"),\n success: v(\"--fp-color-success\", \"#22c55e\"),\n error: v(\"--fp-color-error\", \"#ef4444\"),\n warning: v(\"--fp-color-warning\", \"#f59e0b\"),\n bgPrimary: v(\"--fp-bg-primary\", \"#0f172a\"),\n bgSecondary: v(\"--fp-bg-secondary\", \"#1e293b\"),\n bgTertiary: v(\"--fp-bg-tertiary\", \"#334155\"),\n textPrimary: v(\"--fp-text-primary\", \"#f8fafc\"),\n textSecondary: v(\"--fp-text-secondary\", \"#94a3b8\"),\n textMuted: v(\"--fp-text-muted\", \"#64748b\"),\n border: v(\"--fp-border\", \"#334155\"),\n radius: v(\"--fp-radius\", \"8px\"),\n fontSans: v(\"--fp-font-sans\", \"Inter, system-ui, -apple-system, sans-serif\"),\n fontMono: v(\"--fp-font-mono\", \"'JetBrains Mono', 'Fira Code', monospace\"),\n} as const;\n\n/** Font sizes per size variant */\nexport const fontSize: Record<Size, { label: number; body: number; small: number }> = {\n compact: { label: 10, body: 11, small: 9 },\n default: { label: 11, body: 12, small: 10 },\n detailed: { label: 12, body: 13, small: 11 },\n};\n\n/** Padding per size variant */\nexport const padding: Record<Size, number> = {\n compact: 8,\n default: 12,\n detailed: 16,\n};\n","import type { ThemeTokens } from \"./tokens\";\n\n/** Cool dark theme (the library default) */\nexport const coolDark: ThemeTokens = {\n colors: {\n primary: \"#6366f1\",\n success: \"#22c55e\",\n error: \"#ef4444\",\n warning: \"#f59e0b\",\n bgPrimary: \"#0f172a\",\n bgSecondary: \"#1e293b\",\n bgTertiary: \"#334155\",\n textPrimary: \"#f8fafc\",\n textSecondary: \"#94a3b8\",\n textMuted: \"#64748b\",\n border: \"#334155\",\n },\n radius: \"8px\",\n fontFamily: {\n sans: \"Inter, system-ui, -apple-system, sans-serif\",\n mono: \"'JetBrains Mono', 'Fira Code', monospace\",\n },\n};\n\n/** Warm dark theme — charcoal-purple palette */\nexport const warmDark: ThemeTokens = {\n colors: {\n primary: \"#7c6cf0\",\n success: \"#3dd68c\",\n error: \"#f06292\",\n warning: \"#ffb74d\",\n bgPrimary: \"#1e1a2e\",\n bgSecondary: \"#2a2540\",\n bgTertiary: \"#3a3455\",\n textPrimary: \"#f0e6d6\",\n textSecondary: \"#a89eb4\",\n textMuted: \"#6e6480\",\n border: \"#3a3455\",\n },\n radius: \"8px\",\n fontFamily: {\n sans: \"Inter, system-ui, -apple-system, sans-serif\",\n mono: \"'JetBrains Mono', 'Fira Code', monospace\",\n },\n};\n\n/** Warm light theme — cream/peach palette */\nexport const warmLight: ThemeTokens = {\n colors: {\n primary: \"#7c6cf0\",\n success: \"#22a860\",\n error: \"#d94452\",\n warning: \"#e09030\",\n bgPrimary: \"#faf5ef\",\n bgSecondary: \"#f0e6d6\",\n bgTertiary: \"#e4d5c3\",\n textPrimary: \"#2e2938\",\n textSecondary: \"#5c5468\",\n textMuted: \"#8a7e96\",\n border: \"#d6c8b4\",\n },\n radius: \"8px\",\n fontFamily: {\n sans: \"Inter, system-ui, -apple-system, sans-serif\",\n mono: \"'JetBrains Mono', 'Fira Code', monospace\",\n },\n};\n\n/** All built-in theme presets */\nexport const themePresets = {\n coolDark,\n warmDark,\n warmLight,\n} as const;\n\nexport type ThemePresetName = keyof typeof themePresets;\n","import { useMemo } from \"react\";\nimport type { StageSnapshot, BaseComponentProps } from \"../../types\";\nimport { theme, fontSize, padding } from \"../../theme\";\n\nexport interface MemoryInspectorProps extends BaseComponentProps {\n /** Single memory object or snapshots (will accumulate up to selectedIndex) */\n data?: Record<string, unknown>;\n /** When using snapshots mode, pass these instead of data */\n snapshots?: StageSnapshot[];\n /** Index to accumulate up to (for time-travel) */\n selectedIndex?: number;\n /** Show data types alongside values */\n showTypes?: boolean;\n /** Highlight keys that are new at this step */\n highlightNew?: boolean;\n}\n\n/**\n * Displays pipeline memory state as formatted JSON.\n * Supports both static (data prop) and time-travel (snapshots + selectedIndex) modes.\n */\nexport function MemoryInspector({\n data,\n snapshots,\n selectedIndex = 0,\n showTypes = false,\n highlightNew = true,\n size = \"default\",\n unstyled = false,\n className,\n style,\n}: MemoryInspectorProps) {\n // Compute accumulated memory from snapshots\n const { memory, newKeys } = useMemo(() => {\n if (data) {\n return { memory: data, newKeys: new Set<string>() };\n }\n if (!snapshots || snapshots.length === 0) {\n return { memory: {}, newKeys: new Set<string>() };\n }\n\n const merged: Record<string, unknown> = {};\n for (let i = 0; i <= Math.min(selectedIndex, snapshots.length - 1); i++) {\n Object.assign(merged, snapshots[i]?.memory);\n }\n\n const nk = new Set<string>();\n if (highlightNew && selectedIndex > 0) {\n const prev: Record<string, unknown> = {};\n for (let i = 0; i < selectedIndex; i++) {\n Object.assign(prev, snapshots[i]?.memory);\n }\n const current = snapshots[selectedIndex]?.memory ?? {};\n for (const k of Object.keys(current)) {\n if (!(k in prev)) nk.add(k);\n }\n } else if (highlightNew && selectedIndex === 0 && snapshots[0]) {\n for (const k of Object.keys(snapshots[0].memory)) nk.add(k);\n }\n\n return { memory: merged, newKeys: nk };\n }, [data, snapshots, selectedIndex, highlightNew]);\n\n const entries = Object.entries(memory);\n const fs = fontSize[size];\n const pad = padding[size];\n\n if (unstyled) {\n return (\n <div className={className} style={style} data-fp=\"memory-inspector\">\n <div data-fp=\"memory-label\">Memory State</div>\n <pre data-fp=\"memory-json\">\n {JSON.stringify(memory, null, 2)}\n </pre>\n </div>\n );\n }\n\n return (\n <div\n className={className}\n style={{\n padding: pad,\n fontFamily: theme.fontSans,\n ...style,\n }}\n data-fp=\"memory-inspector\"\n >\n <span\n style={{\n fontSize: fs.label,\n fontWeight: 600,\n color: theme.textMuted,\n textTransform: \"uppercase\",\n letterSpacing: \"0.08em\",\n }}\n >\n Memory State\n </span>\n <div\n style={{\n marginTop: 8,\n background: theme.bgSecondary,\n border: `1px solid ${theme.border}`,\n borderRadius: theme.radius,\n padding: `${pad}px ${pad + 4}px`,\n fontFamily: theme.fontMono,\n fontSize: fs.body,\n lineHeight: 1.8,\n }}\n >\n <span style={{ color: theme.textMuted }}>{\"{\"}</span>\n {entries.length === 0 && (\n <div\n style={{\n paddingLeft: 16,\n color: theme.textMuted,\n fontStyle: \"italic\",\n }}\n >\n {\"// empty\"}\n </div>\n )}\n {entries.map(([key, value], i) => {\n const isNew = newKeys.has(key);\n const isLast = i === entries.length - 1;\n return (\n <div\n key={key}\n style={{\n paddingLeft: 16,\n background: isNew\n ? `color-mix(in srgb, ${theme.success} 10%, transparent)`\n : \"transparent\",\n borderRadius: 4,\n marginLeft: -4,\n marginRight: -4,\n paddingRight: 4,\n }}\n >\n <span style={{ color: theme.primary }}>&quot;{key}&quot;</span>\n <span style={{ color: theme.textMuted }}>: </span>\n <span style={{ color: theme.success }}>\n {formatValue(value)}\n </span>\n {showTypes && (\n <span\n style={{\n color: theme.textMuted,\n fontSize: fs.small,\n marginLeft: 8,\n opacity: 0.6,\n }}\n >\n ({typeof value})\n </span>\n )}\n {!isLast && <span style={{ color: theme.textMuted }}>,</span>}\n </div>\n );\n })}\n <span style={{ color: theme.textMuted }}>{\"}\"}</span>\n </div>\n </div>\n );\n}\n\nfunction formatValue(value: unknown): string {\n if (typeof value === \"string\") return `\"${value}\"`;\n if (typeof value === \"object\" && value !== null) return JSON.stringify(value);\n return String(value);\n}\n","import { useMemo } from \"react\";\nimport type { StageSnapshot, BaseComponentProps } from \"../../types\";\nimport { theme, fontSize, padding } from \"../../theme\";\n\nexport interface NarrativeLogProps extends BaseComponentProps {\n /** Snapshots to display narratives from */\n snapshots: StageSnapshot[];\n /** Show narratives up to this index (for time-travel sync) */\n selectedIndex?: number;\n /** Show a single narrative string (simple mode) */\n narrative?: string;\n}\n\n/**\n * Timeline-style execution log showing what happened at each stage.\n * Supports both full snapshots mode and single-narrative mode.\n */\nexport function NarrativeLog({\n snapshots,\n selectedIndex,\n narrative,\n size = \"default\",\n unstyled = false,\n className,\n style,\n}: NarrativeLogProps) {\n const entries = useMemo(() => {\n if (narrative) {\n return [{ label: \"Output\", text: narrative, isCurrent: true }];\n }\n const idx = selectedIndex ?? snapshots.length - 1;\n return snapshots.slice(0, idx + 1).map((s, i) => ({\n label: s.stageLabel,\n text: s.narrative,\n isCurrent: i === idx,\n }));\n }, [snapshots, selectedIndex, narrative]);\n\n const fs = fontSize[size];\n const pad = padding[size];\n\n if (unstyled) {\n return (\n <div className={className} style={style} data-fp=\"narrative-log\">\n {entries.map((entry, i) => (\n <div key={i} data-fp=\"narrative-entry\" data-current={entry.isCurrent}>\n <strong>{entry.label}</strong>\n <p>{entry.text}</p>\n </div>\n ))}\n </div>\n );\n }\n\n return (\n <div\n className={className}\n style={{ padding: pad, fontFamily: theme.fontSans, ...style }}\n data-fp=\"narrative-log\"\n >\n <span\n style={{\n fontSize: fs.label,\n fontWeight: 600,\n color: theme.textMuted,\n textTransform: \"uppercase\",\n letterSpacing: \"0.08em\",\n }}\n >\n Execution Log\n </span>\n <div style={{ marginTop: 8, display: \"flex\", flexDirection: \"column\" }}>\n {entries.map((entry, i) => (\n <div\n key={i}\n style={{\n display: \"flex\",\n gap: 10,\n padding: `${pad}px 0`,\n borderBottom:\n i < entries.length - 1 ? `1px solid ${theme.border}` : \"none\",\n }}\n >\n {/* Timeline dot + line */}\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n width: 12,\n flexShrink: 0,\n paddingTop: 5,\n }}\n >\n <div\n style={{\n width: 8,\n height: 8,\n borderRadius: \"50%\",\n background: entry.isCurrent ? theme.primary : theme.success,\n flexShrink: 0,\n }}\n />\n {i < entries.length - 1 && (\n <div\n style={{\n width: 1,\n flex: 1,\n background: theme.border,\n marginTop: 4,\n }}\n />\n )}\n </div>\n\n {/* Content */}\n <div style={{ flex: 1, minWidth: 0 }}>\n <span\n style={{\n fontSize: fs.label,\n fontWeight: 600,\n color: entry.isCurrent ? theme.primary : theme.textMuted,\n }}\n >\n {entry.label}\n </span>\n <div\n style={{\n fontSize: fs.body,\n lineHeight: 1.5,\n color: entry.isCurrent ? theme.textPrimary : theme.textSecondary,\n marginTop: 2,\n }}\n >\n {entry.text}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n}\n","import { useState, useCallback, useMemo, useEffect, useRef } from \"react\";\nimport type { BaseComponentProps } from \"../../types\";\nimport { theme, fontSize, padding } from \"../../theme\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ninterface NarrativeGroup {\n header: string;\n headerIdx: number;\n steps: { text: string; idx: number }[];\n}\n\nexport interface NarrativeTraceProps extends BaseComponentProps {\n /** All narrative lines (full trace) */\n narrative: string[];\n /** Number of lines currently revealed (for progressive reveal). Defaults to all. */\n revealedCount?: number;\n /** Start with all groups collapsed */\n defaultCollapsed?: boolean;\n /** Called when user clicks a stage header */\n onStageClick?: (headerIndex: number) => void;\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction parseGroups(lines: string[]): NarrativeGroup[] {\n const groups: NarrativeGroup[] = [];\n let current: NarrativeGroup | null = null;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n const trimmed = line.trimStart();\n const isStep = trimmed.startsWith(\"Step \") || /^\\s/.test(line);\n\n if (!isStep || !current) {\n current = { header: line, headerIdx: i, steps: [] };\n groups.push(current);\n } else {\n current.steps.push({ text: trimmed, idx: i });\n }\n }\n\n return groups;\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport function NarrativeTrace({\n narrative,\n revealedCount,\n defaultCollapsed = false,\n onStageClick,\n size = \"default\",\n unstyled = false,\n className,\n style,\n}: NarrativeTraceProps) {\n const revealed = revealedCount != null ? narrative.slice(0, revealedCount) : narrative;\n const future = revealedCount != null ? narrative.slice(revealedCount) : [];\n\n const revealedGroups = useMemo(() => parseGroups(revealed), [revealed]);\n const futureGroups = useMemo(() => parseGroups(future), [future]);\n\n const [collapsedSet, setCollapsedSet] = useState<Set<number>>(() => {\n if (!defaultCollapsed) return new Set();\n return new Set(parseGroups(narrative).map((g) => g.headerIdx));\n });\n\n const latestRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n latestRef.current?.scrollIntoView({ behavior: \"smooth\", block: \"nearest\" });\n }, [revealedGroups.length]);\n\n const toggle = useCallback((idx: number) => {\n setCollapsedSet((prev) => {\n const next = new Set(prev);\n if (next.has(idx)) next.delete(idx);\n else next.add(idx);\n return next;\n });\n }, []);\n\n const lastIdx = revealedGroups.length - 1;\n const fs = fontSize[size];\n const pad = padding[size];\n\n // ── Unstyled mode ──\n if (unstyled) {\n return (\n <div className={className} style={style} data-fp=\"narrative-trace\">\n {revealedGroups.map((group, gi) => (\n <div key={group.headerIdx} data-fp=\"narrative-group\" data-latest={gi === lastIdx}>\n <div\n data-fp=\"narrative-header\"\n data-collapsible={group.steps.length > 0}\n data-collapsed={collapsedSet.has(group.headerIdx)}\n onClick={() => {\n if (group.steps.length > 0) toggle(group.headerIdx);\n onStageClick?.(group.headerIdx);\n }}\n >\n {group.header}\n </div>\n {!collapsedSet.has(group.headerIdx) &&\n group.steps.map((step) => (\n <div key={step.idx} data-fp=\"narrative-step\">\n {step.text}\n </div>\n ))}\n </div>\n ))}\n {futureGroups.map((group) => (\n <div key={`f-${group.headerIdx}`} data-fp=\"narrative-group\" data-future>\n <div data-fp=\"narrative-header\">{group.header}</div>\n {group.steps.map((step) => (\n <div key={`f-${step.idx}`} data-fp=\"narrative-step\">\n {step.text}\n </div>\n ))}\n </div>\n ))}\n </div>\n );\n }\n\n // ── Styled mode ──\n return (\n <div\n className={className}\n style={{\n flex: 1,\n overflow: \"auto\",\n padding: pad,\n fontFamily: theme.fontMono,\n ...style,\n }}\n data-fp=\"narrative-trace\"\n >\n {revealedGroups.map((group, gi) => {\n const isLatest = gi === lastIdx;\n const isCollapsed = collapsedSet.has(group.headerIdx);\n const hasSteps = group.steps.length > 0;\n\n return (\n <div\n key={group.headerIdx}\n ref={isLatest ? latestRef : undefined}\n style={{ marginBottom: 2 }}\n data-fp=\"narrative-group\"\n >\n {/* Stage header */}\n <div\n onClick={() => {\n if (hasSteps) toggle(group.headerIdx);\n onStageClick?.(group.headerIdx);\n }}\n style={{\n fontSize: fs.body,\n lineHeight: 1.7,\n color: isLatest ? theme.textPrimary : theme.textSecondary,\n padding: `4px ${pad - 4}px`,\n borderRadius: 4,\n background: isLatest ? theme.bgTertiary : \"transparent\",\n borderLeft: isLatest\n ? `3px solid ${theme.primary}`\n : `3px solid ${theme.success}`,\n cursor: hasSteps ? \"pointer\" : \"default\",\n fontWeight: 600,\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n userSelect: \"none\",\n transition: \"all 0.15s ease\",\n }}\n >\n {hasSteps && (\n <span\n style={{\n fontSize: fs.small - 1,\n color: theme.textMuted,\n transition: \"transform 0.15s ease\",\n transform: isCollapsed ? \"rotate(-90deg)\" : \"rotate(0deg)\",\n display: \"inline-block\",\n width: 10,\n flexShrink: 0,\n }}\n >\n &#9660;\n </span>\n )}\n {!hasSteps && <span style={{ width: 10, flexShrink: 0 }} />}\n <span>{group.header}</span>\n </div>\n\n {/* Step lines */}\n {!isCollapsed &&\n group.steps.map((step) => (\n <div\n key={step.idx}\n style={{\n fontSize: fs.small,\n lineHeight: 1.6,\n color: isLatest ? theme.textSecondary : theme.textMuted,\n padding: `2px ${pad - 4}px 2px ${pad + 20}px`,\n opacity: isLatest ? 0.9 : 0.7,\n transition: \"all 0.15s ease\",\n }}\n data-fp=\"narrative-step\"\n >\n {step.text}\n </div>\n ))}\n </div>\n );\n })}\n\n {/* Dimmed future groups */}\n {futureGroups.length > 0 && (\n <div style={{ opacity: 0.2 }}>\n {futureGroups.map((group) => (\n <div key={`f-${group.headerIdx}`} style={{ marginBottom: 2 }}>\n <div\n style={{\n fontSize: fs.body,\n lineHeight: 1.7,\n color: theme.textMuted,\n padding: `4px ${pad - 4}px`,\n borderLeft: `3px solid ${theme.border}`,\n fontWeight: 600,\n paddingLeft: pad + 12,\n }}\n >\n {group.header}\n </div>\n {group.steps.map((step) => (\n <div\n key={`f-${step.idx}`}\n style={{\n fontSize: fs.small,\n lineHeight: 1.6,\n color: theme.textMuted,\n padding: `2px ${pad - 4}px 2px ${pad + 20}px`,\n }}\n >\n {step.text}\n </div>\n ))}\n </div>\n ))}\n </div>\n )}\n </div>\n );\n}\n","import { useMemo } from \"react\";\nimport type { StageSnapshot, BaseComponentProps } from \"../../types\";\nimport { theme, fontSize, padding } from \"../../theme\";\n\nexport interface GanttTimelineProps extends BaseComponentProps {\n /** Stage snapshots with timing info */\n snapshots: StageSnapshot[];\n /** Currently selected stage index */\n selectedIndex?: number;\n /** Callback when a stage bar is clicked */\n onSelect?: (index: number) => void;\n}\n\n/**\n * Horizontal Gantt-style timeline showing stage durations and overlap.\n * Great for performance analysis of pipeline execution.\n */\nexport function GanttTimeline({\n snapshots,\n selectedIndex = 0,\n onSelect,\n size = \"default\",\n unstyled = false,\n className,\n style,\n}: GanttTimelineProps) {\n const totalWallTime = useMemo(\n () => Math.max(...snapshots.map((s) => s.startMs + s.durationMs), 1),\n [snapshots]\n );\n\n const fs = fontSize[size];\n const pad = padding[size];\n const labelWidth = size === \"compact\" ? 50 : size === \"detailed\" ? 100 : 80;\n const msWidth = size === \"compact\" ? 28 : 36;\n\n if (unstyled) {\n return (\n <div className={className} style={style} data-fp=\"gantt-timeline\">\n {snapshots.map((snap, idx) => (\n <div\n key={snap.stageName}\n data-fp=\"gantt-bar\"\n data-selected={idx === selectedIndex}\n data-visible={idx <= selectedIndex}\n onClick={() => onSelect?.(idx)}\n >\n <span data-fp=\"gantt-label\">{snap.stageLabel}</span>\n <span data-fp=\"gantt-duration\">{snap.durationMs}ms</span>\n </div>\n ))}\n </div>\n );\n }\n\n return (\n <div\n className={className}\n style={{ padding: pad, fontFamily: theme.fontSans, ...style }}\n data-fp=\"gantt-timeline\"\n >\n <span\n style={{\n fontSize: fs.label,\n fontWeight: 600,\n color: theme.textMuted,\n textTransform: \"uppercase\",\n letterSpacing: \"0.08em\",\n }}\n >\n {size === \"compact\" ? \"Timeline\" : \"Execution Timeline\"}\n </span>\n <div\n style={{\n marginTop: 8,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n }}\n >\n {snapshots.map((snap, idx) => {\n const leftPct = (snap.startMs / totalWallTime) * 100;\n const widthPct = Math.max((snap.durationMs / totalWallTime) * 100, 1);\n const isSelected = idx === selectedIndex;\n const isVisible = idx <= selectedIndex;\n\n return (\n <div\n key={snap.stageName}\n onClick={() => onSelect?.(idx)}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: size === \"compact\" ? 4 : 8,\n cursor: onSelect ? \"pointer\" : \"default\",\n opacity: isVisible ? 1 : 0.3,\n transition: \"opacity 0.3s ease\",\n }}\n >\n <span\n style={{\n width: labelWidth,\n fontSize: fs.small,\n color: isSelected ? theme.primary : theme.textMuted,\n fontWeight: isSelected ? 600 : 400,\n textAlign: \"right\",\n flexShrink: 0,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {snap.stageLabel}\n </span>\n <div\n style={{\n flex: 1,\n height: size === \"compact\" ? 6 : 8,\n position: \"relative\",\n background: theme.bgTertiary,\n borderRadius: 3,\n }}\n >\n {isVisible && (\n <div\n style={{\n position: \"absolute\",\n left: `${leftPct}%`,\n top: 0,\n width: `${widthPct}%`,\n height: \"100%\",\n borderRadius: 3,\n background: isSelected ? theme.primary : theme.success,\n transition: \"width 0.3s ease\",\n }}\n />\n )}\n </div>\n <span\n style={{\n fontSize: fs.small,\n color: theme.textMuted,\n fontFamily: theme.fontMono,\n width: msWidth,\n flexShrink: 0,\n }}\n >\n {snap.durationMs}ms\n </span>\n </div>\n );\n })}\n </div>\n\n {/* Time axis */}\n <div\n style={{\n marginTop: 4,\n marginLeft: labelWidth + (size === \"compact\" ? 4 : 8),\n marginRight: msWidth + (size === \"compact\" ? 4 : 8),\n display: \"flex\",\n justifyContent: \"space-between\",\n fontSize: fs.small - 1,\n color: theme.textMuted,\n fontFamily: theme.fontMono,\n }}\n >\n <span>0ms</span>\n {size !== \"compact\" && (\n <span>{(totalWallTime / 2).toFixed(1)}ms</span>\n )}\n <span>{totalWallTime.toFixed(1)}ms</span>\n </div>\n </div>\n );\n}\n","import { useState } from \"react\";\nimport type { StageSnapshot, BaseComponentProps } from \"../../types\";\nimport { theme, fontSize, padding } from \"../../theme\";\nimport { MemoryInspector } from \"../MemoryInspector\";\nimport { NarrativeLog } from \"../NarrativeLog\";\nimport { GanttTimeline } from \"../GanttTimeline\";\n\nexport interface SnapshotPanelProps extends BaseComponentProps {\n /** Stage snapshots from pipeline execution */\n snapshots: StageSnapshot[];\n /** Show the Gantt timeline */\n showGantt?: boolean;\n /** Show the time-travel scrubber */\n showScrubber?: boolean;\n /** Title override */\n title?: string;\n}\n\n/**\n * All-in-one panel: time-travel scrubber + memory inspector + narrative log + gantt.\n * Drop this into any page to make a pipeline run inspectable.\n */\nexport function SnapshotPanel({\n snapshots,\n showGantt = true,\n showScrubber = true,\n title = \"Pipeline Inspector\",\n size = \"default\",\n unstyled = false,\n className,\n style,\n}: SnapshotPanelProps) {\n const [selectedIndex, setSelectedIndex] = useState(0);\n const fs = fontSize[size];\n const pad = padding[size];\n\n if (snapshots.length === 0) {\n return (\n <div\n className={className}\n style={{\n padding: pad * 2,\n textAlign: \"center\",\n color: unstyled ? undefined : theme.textMuted,\n fontSize: fs.body,\n ...style,\n }}\n data-fp=\"snapshot-panel\"\n >\n No snapshots to display\n </div>\n );\n }\n\n if (unstyled) {\n return (\n <div className={className} style={style} data-fp=\"snapshot-panel\">\n <h3>{title}</h3>\n {showScrubber && (\n <input\n type=\"range\"\n min={0}\n max={snapshots.length - 1}\n value={selectedIndex}\n onChange={(e) => setSelectedIndex(parseInt(e.target.value))}\n />\n )}\n <MemoryInspector\n snapshots={snapshots}\n selectedIndex={selectedIndex}\n unstyled\n />\n <NarrativeLog\n snapshots={snapshots}\n selectedIndex={selectedIndex}\n unstyled\n />\n {showGantt && (\n <GanttTimeline\n snapshots={snapshots}\n selectedIndex={selectedIndex}\n onSelect={setSelectedIndex}\n unstyled\n />\n )}\n </div>\n );\n }\n\n return (\n <div\n className={className}\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n height: \"100%\",\n background: theme.bgPrimary,\n fontFamily: theme.fontSans,\n overflow: \"hidden\",\n ...style,\n }}\n data-fp=\"snapshot-panel\"\n >\n {/* Header with title + scrubber */}\n <div\n style={{\n padding: `${pad}px ${pad + 4}px`,\n borderBottom: `1px solid ${theme.border}`,\n background: theme.bgSecondary,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n marginBottom: showScrubber ? 8 : 0,\n }}\n >\n <span\n style={{\n fontSize: fs.body + 2,\n fontWeight: 600,\n color: theme.textPrimary,\n }}\n >\n {title}\n </span>\n <span\n style={{\n fontSize: fs.small,\n color: theme.textMuted,\n fontFamily: theme.fontMono,\n }}\n >\n {selectedIndex + 1}/{snapshots.length}\n </span>\n </div>\n\n {showScrubber && (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 8 }}>\n <ScrubButton\n label=\"\\u25C0\"\n disabled={selectedIndex === 0}\n onClick={() => setSelectedIndex((i) => Math.max(0, i - 1))}\n />\n <input\n type=\"range\"\n min={0}\n max={snapshots.length - 1}\n value={selectedIndex}\n onChange={(e) => setSelectedIndex(parseInt(e.target.value))}\n style={{\n flex: 1,\n height: 4,\n accentColor: theme.primary,\n cursor: \"pointer\",\n }}\n />\n <ScrubButton\n label=\"\\u25B6\"\n disabled={selectedIndex === snapshots.length - 1}\n onClick={() =>\n setSelectedIndex((i) => Math.min(snapshots.length - 1, i + 1))\n }\n />\n </div>\n )}\n </div>\n\n {/* Content */}\n <div style={{ flex: 1, overflow: \"auto\" }}>\n <MemoryInspector\n snapshots={snapshots}\n selectedIndex={selectedIndex}\n size={size}\n />\n <div\n style={{\n height: 1,\n background: theme.border,\n margin: `0 ${pad}px`,\n }}\n />\n <NarrativeLog\n snapshots={snapshots}\n selectedIndex={selectedIndex}\n size={size}\n />\n </div>\n\n {/* Gantt footer */}\n {showGantt && (\n <div\n style={{\n borderTop: `1px solid ${theme.border}`,\n background: theme.bgSecondary,\n flexShrink: 0,\n }}\n >\n <GanttTimeline\n snapshots={snapshots}\n selectedIndex={selectedIndex}\n onSelect={setSelectedIndex}\n size={size}\n />\n </div>\n )}\n </div>\n );\n}\n\nfunction ScrubButton({\n label,\n disabled,\n onClick,\n}: {\n label: string;\n disabled: boolean;\n onClick: () => void;\n}) {\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n style={{\n background: theme.bgTertiary,\n border: `1px solid ${theme.border}`,\n color: disabled ? theme.textMuted : theme.textPrimary,\n borderRadius: 6,\n width: 28,\n height: 28,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: disabled ? \"not-allowed\" : \"pointer\",\n opacity: disabled ? 0.5 : 1,\n fontSize: 12,\n flexShrink: 0,\n }}\n >\n {label}\n </button>\n );\n}\n","import { useMemo } from \"react\";\nimport type { BaseComponentProps } from \"../../types\";\nimport { theme, fontSize, padding } from \"../../theme\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface DiffEntry {\n key: string;\n type: \"added\" | \"removed\" | \"changed\" | \"unchanged\";\n oldValue?: unknown;\n newValue?: unknown;\n}\n\nexport interface ScopeDiffProps extends BaseComponentProps {\n /** Memory state before the current stage */\n previous: Record<string, unknown> | null;\n /** Memory state after the current stage */\n current: Record<string, unknown>;\n /** Hide unchanged keys (default: false) */\n hideUnchanged?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction computeDiff(\n prev: Record<string, unknown> | null,\n curr: Record<string, unknown>\n): DiffEntry[] {\n const entries: DiffEntry[] = [];\n const allKeys = new Set([...Object.keys(prev ?? {}), ...Object.keys(curr)]);\n\n for (const key of allKeys) {\n const inPrev = prev != null && key in prev;\n const inCurr = key in curr;\n const oldVal = prev?.[key];\n const newVal = curr[key];\n\n if (!inPrev && inCurr) {\n entries.push({ key, type: \"added\", newValue: newVal });\n } else if (inPrev && !inCurr) {\n entries.push({ key, type: \"removed\", oldValue: oldVal });\n } else if (JSON.stringify(oldVal) !== JSON.stringify(newVal)) {\n entries.push({ key, type: \"changed\", oldValue: oldVal, newValue: newVal });\n } else {\n entries.push({ key, type: \"unchanged\", newValue: newVal });\n }\n }\n\n const order = { added: 0, changed: 1, removed: 2, unchanged: 3 };\n entries.sort((a, b) => order[a.type] - order[b.type]);\n return entries;\n}\n\nfunction fmt(v: unknown): string {\n if (typeof v === \"string\") return `\"${v}\"`;\n if (typeof v === \"object\" && v !== null) return JSON.stringify(v, null, 2);\n return String(v);\n}\n\nconst diffColors: Record<DiffEntry[\"type\"], { bg: string; fg: string; icon: string }> = {\n added: { bg: \"rgba(34,197,94,0.10)\", fg: \"#22c55e\", icon: \"+\" },\n removed: { bg: \"rgba(239,68,68,0.10)\", fg: \"#ef4444\", icon: \"-\" },\n changed: { bg: \"rgba(245,158,11,0.10)\", fg: \"#f59e0b\", icon: \"~\" },\n unchanged: { bg: \"transparent\", fg: \"\", icon: \" \" },\n};\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport function ScopeDiff({\n previous,\n current,\n hideUnchanged = false,\n size = \"default\",\n unstyled = false,\n className,\n style,\n}: ScopeDiffProps) {\n const entries = useMemo(() => computeDiff(previous, current), [previous, current]);\n const visible = hideUnchanged ? entries.filter((e) => e.type !== \"unchanged\") : entries;\n\n const fs = fontSize[size];\n const pad = padding[size];\n\n if (unstyled) {\n return (\n <div className={className} style={style} data-fp=\"scope-diff\">\n {visible.map((e) => (\n <div key={e.key} data-fp=\"diff-entry\" data-type={e.type}>\n <span data-fp=\"diff-key\">{e.key}</span>\n {e.type === \"changed\" && (\n <>\n <span data-fp=\"diff-old\">{fmt(e.oldValue)}</span>\n <span data-fp=\"diff-new\">{fmt(e.newValue)}</span>\n </>\n )}\n {(e.type === \"added\" || e.type === \"unchanged\") && (\n <span data-fp=\"diff-value\">{fmt(e.newValue)}</span>\n )}\n {e.type === \"removed\" && (\n <span data-fp=\"diff-value\">{fmt(e.oldValue)}</span>\n )}\n </div>\n ))}\n </div>\n );\n }\n\n return (\n <div\n className={className}\n style={{ padding: pad, fontFamily: theme.fontMono, ...style }}\n data-fp=\"scope-diff\"\n >\n {visible.length === 0 && (\n <div style={{ fontSize: fs.body, color: theme.textMuted, fontStyle: \"italic\" }}>\n No changes\n </div>\n )}\n {visible.map((entry) => {\n const dc = diffColors[entry.type];\n return (\n <div\n key={entry.key}\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n gap: 8,\n padding: `4px ${pad - 4}px`,\n marginBottom: 2,\n borderRadius: 4,\n background: dc.bg,\n fontSize: fs.body,\n lineHeight: 1.5,\n }}\n data-fp=\"diff-entry\"\n >\n <span\n style={{\n width: 16,\n flexShrink: 0,\n fontWeight: 700,\n color: dc.fg || theme.textMuted,\n textAlign: \"center\",\n }}\n >\n {dc.icon}\n </span>\n <span style={{ color: theme.primary, fontWeight: 600, flexShrink: 0 }}>\n {entry.key}\n </span>\n <span style={{ color: theme.textMuted }}>=</span>\n {entry.type === \"changed\" ? (\n <span>\n <span\n style={{\n color: theme.error,\n textDecoration: \"line-through\",\n opacity: 0.7,\n }}\n >\n {fmt(entry.oldValue)}\n </span>\n <span style={{ color: theme.textMuted, margin: \"0 4px\" }}>&rarr;</span>\n <span style={{ color: theme.success }}>{fmt(entry.newValue)}</span>\n </span>\n ) : (\n <span\n style={{\n color:\n entry.type === \"added\"\n ? theme.success\n : entry.type === \"removed\"\n ? theme.error\n : theme.textPrimary,\n }}\n >\n {fmt(entry.type === \"removed\" ? entry.oldValue : entry.newValue)}\n </span>\n )}\n </div>\n );\n })}\n </div>\n );\n}\n","import type { BaseComponentProps } from \"../../types\";\nimport { theme, fontSize, padding } from \"../../theme\";\n\nexport interface ResultPanelProps extends BaseComponentProps {\n /** Final pipeline output / shared state */\n data: Record<string, unknown> | null;\n /** Optional console log lines */\n logs?: string[];\n /** Hide console section (default: false) */\n hideConsole?: boolean;\n}\n\nexport function ResultPanel({\n data,\n logs = [],\n hideConsole = false,\n size = \"default\",\n unstyled = false,\n className,\n style,\n}: ResultPanelProps) {\n const fs = fontSize[size];\n const pad = padding[size];\n\n if (unstyled) {\n return (\n <div className={className} style={style} data-fp=\"result-panel\">\n <div data-fp=\"result-data\">\n <pre>{data ? JSON.stringify(data, null, 2) : \"No data\"}</pre>\n </div>\n {!hideConsole && (\n <div data-fp=\"result-console\">\n {logs.map((line, i) => (\n <div key={i} data-fp=\"console-line\" data-error={line.startsWith(\"ERROR\")}>\n {line}\n </div>\n ))}\n </div>\n )}\n </div>\n );\n }\n\n return (\n <div\n className={className}\n style={{\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n ...style,\n }}\n data-fp=\"result-panel\"\n >\n {data && (\n <div style={{ flex: 1, overflow: \"auto\", padding: pad }}>\n <div\n style={{\n fontSize: fs.label,\n fontWeight: 600,\n color: theme.textMuted,\n textTransform: \"uppercase\",\n letterSpacing: \"0.08em\",\n marginBottom: 8,\n }}\n >\n {size === \"compact\" ? \"Result\" : \"Business Result (Scope)\"}\n </div>\n <pre\n style={{\n fontSize: fs.body,\n fontFamily: theme.fontMono,\n color: theme.textPrimary,\n background: theme.bgSecondary,\n padding: pad,\n borderRadius: theme.radius,\n overflow: \"auto\",\n margin: 0,\n }}\n >\n {JSON.stringify(data, null, 2)}\n </pre>\n </div>\n )}\n\n {!hideConsole && (\n <div\n style={{\n borderTop: `1px solid ${theme.border}`,\n padding: pad,\n overflow: \"auto\",\n maxHeight: \"40%\",\n flexShrink: 0,\n }}\n >\n <div\n style={{\n fontSize: fs.label,\n fontWeight: 600,\n color: theme.textMuted,\n textTransform: \"uppercase\",\n letterSpacing: \"0.08em\",\n marginBottom: 8,\n }}\n >\n Console\n </div>\n {logs.length === 0 && (\n <div style={{ fontSize: fs.body, color: theme.textMuted, fontStyle: \"italic\" }}>\n No console output\n </div>\n )}\n {logs.map((line, i) => (\n <div\n key={i}\n style={{\n fontSize: fs.body,\n fontFamily: theme.fontMono,\n color: line.startsWith(\"ERROR\") ? theme.error : theme.textPrimary,\n padding: \"2px 0\",\n borderBottom: `1px solid ${theme.bgSecondary}`,\n whiteSpace: \"pre-wrap\",\n wordBreak: \"break-word\",\n }}\n >\n {line}\n </div>\n ))}\n </div>\n )}\n </div>\n );\n}\n","import { useState, useEffect, useRef, useCallback } from \"react\";\nimport type { StageSnapshot, BaseComponentProps } from \"../../types\";\nimport { theme, fontSize } from \"../../theme\";\n\nexport interface TimeTravelControlsProps extends BaseComponentProps {\n /** Stage snapshots */\n snapshots: StageSnapshot[];\n /** Currently selected stage index */\n selectedIndex: number;\n /** Callback when selected index changes */\n onIndexChange: (index: number) => void;\n /** Enable auto-play with Gantt-proportional timing */\n autoPlayable?: boolean;\n}\n\nexport function TimeTravelControls({\n snapshots,\n selectedIndex,\n onIndexChange,\n autoPlayable = true,\n size = \"default\",\n unstyled = false,\n className,\n style,\n}: TimeTravelControlsProps) {\n const [playing, setPlaying] = useState(false);\n const playRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const total = snapshots.length;\n const canPrev = selectedIndex > 0;\n const canNext = selectedIndex < total - 1;\n\n // Auto-advance with proportional timing\n useEffect(() => {\n if (!playing || !autoPlayable) return;\n if (selectedIndex >= total - 1) {\n setPlaying(false);\n return;\n }\n const stageDur = snapshots[selectedIndex]?.durationMs ?? 1;\n const totalDur = snapshots.reduce((s, snap) => s + snap.durationMs, 0) || 1;\n const fraction = stageDur / totalDur;\n const baseMs = 3000;\n const delay = Math.max(200, Math.min(fraction * baseMs, 2000));\n\n playRef.current = setTimeout(() => {\n onIndexChange(selectedIndex + 1);\n }, delay);\n\n return () => {\n if (playRef.current) clearTimeout(playRef.current);\n };\n }, [playing, selectedIndex, snapshots, total, onIndexChange, autoPlayable]);\n\n const togglePlay = useCallback(() => {\n if (playing) {\n setPlaying(false);\n } else {\n if (selectedIndex >= total - 1) onIndexChange(0);\n setPlaying(true);\n }\n }, [playing, selectedIndex, total, onIndexChange]);\n\n const fs = fontSize[size];\n\n if (unstyled) {\n return (\n <div className={className} style={style} data-fp=\"time-travel-controls\">\n <button\n data-fp=\"tt-prev\"\n disabled={!canPrev || playing}\n onClick={() => { setPlaying(false); onIndexChange(selectedIndex - 1); }}\n >\n Prev\n </button>\n {autoPlayable && (\n <button data-fp=\"tt-play\" onClick={togglePlay}>\n {playing ? \"Pause\" : \"Play\"}\n </button>\n )}\n <button\n data-fp=\"tt-next\"\n disabled={!canNext || playing}\n onClick={() => { setPlaying(false); onIndexChange(selectedIndex + 1); }}\n >\n Next\n </button>\n <div data-fp=\"tt-ticks\">\n {snapshots.map((snap, i) => (\n <button\n key={i}\n data-fp=\"tt-tick\"\n data-active={i === selectedIndex}\n data-done={i < selectedIndex}\n onClick={() => { setPlaying(false); onIndexChange(i); }}\n title={snap.stageLabel}\n />\n ))}\n </div>\n </div>\n );\n }\n\n const btnStyle = (disabled: boolean): React.CSSProperties => ({\n background: theme.bgTertiary,\n border: `1px solid ${theme.border}`,\n color: disabled ? theme.textMuted : theme.textPrimary,\n borderRadius: \"6px\",\n padding: \"4px 12px\",\n fontSize: fs.body,\n fontWeight: 600,\n cursor: disabled ? \"not-allowed\" : \"pointer\",\n opacity: disabled ? 0.5 : 1,\n flexShrink: 0,\n });\n\n return (\n <div\n className={className}\n style={{\n padding: \"6px 12px\",\n background: theme.bgSecondary,\n borderBottom: `1px solid ${theme.border}`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n flexShrink: 0,\n ...style,\n }}\n data-fp=\"time-travel-controls\"\n >\n <button\n style={btnStyle(!canPrev || playing)}\n disabled={!canPrev || playing}\n onClick={() => { setPlaying(false); onIndexChange(selectedIndex - 1); }}\n >\n &#9664;\n </button>\n\n {autoPlayable && (\n <button\n onClick={togglePlay}\n style={{\n background: playing ? theme.primary : theme.bgTertiary,\n border: `1px solid ${theme.border}`,\n color: playing ? \"white\" : theme.textPrimary,\n borderRadius: \"6px\",\n width: 28,\n height: 28,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n fontSize: 14,\n flexShrink: 0,\n }}\n title={playing ? \"Pause\" : \"Play\"}\n >\n {playing ? \"\\u23F8\" : \"\\u25B6\"}\n </button>\n )}\n\n <button\n style={btnStyle(!canNext || playing)}\n disabled={!canNext || playing}\n onClick={() => { setPlaying(false); onIndexChange(selectedIndex + 1); }}\n >\n &#9654;\n </button>\n\n {/* Tick-mark timeline */}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n gap: 2,\n padding: \"0 4px\",\n }}\n >\n {snapshots.map((snap, i) => {\n const isActive = i === selectedIndex;\n const isDone = i < selectedIndex;\n return (\n <button\n key={i}\n onClick={() => { setPlaying(false); onIndexChange(i); }}\n title={snap.stageLabel}\n style={{\n flex: 1,\n height: isActive ? 14 : 8,\n borderRadius: 3,\n border: \"none\",\n cursor: \"pointer\",\n background: isActive\n ? theme.primary\n : isDone\n ? theme.success\n : theme.bgTertiary,\n opacity: isDone || isActive ? 1 : 0.4,\n transition: \"all 0.15s ease\",\n }}\n />\n );\n })}\n </div>\n </div>\n );\n}\n","import { useState, useCallback, useMemo } from \"react\";\nimport type { StageSnapshot, BaseComponentProps } from \"../../types\";\nimport { theme, fontSize, padding } from \"../../theme\";\nimport { ResultPanel } from \"../ResultPanel\";\nimport { GanttTimeline } from \"../GanttTimeline\";\nimport { MemoryInspector } from \"../MemoryInspector\";\nimport { NarrativeTrace } from \"../NarrativeTrace\";\nimport { ScopeDiff } from \"../ScopeDiff\";\nimport { TimeTravelControls } from \"../TimeTravelControls\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type ShellTab = \"result\" | \"explainable\" | \"ai-compatible\";\n\nexport interface ExplainableShellProps extends BaseComponentProps {\n /** Stage snapshots for time-travel visualization */\n snapshots: StageSnapshot[];\n /** Final pipeline result data */\n resultData?: Record<string, unknown> | null;\n /** Console log lines */\n logs?: string[];\n /** Combined narrative lines */\n narrative?: string[];\n /** Which tabs to show (default: all three) */\n tabs?: ShellTab[];\n /** Initially active tab */\n defaultTab?: ShellTab;\n /** Hide console in result tab */\n hideConsole?: boolean;\n /** Custom content to render in each tab slot */\n renderFlowchart?: (props: {\n snapshots: StageSnapshot[];\n selectedIndex: number;\n onNodeClick?: (index: number) => void;\n }) => React.ReactNode;\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport function ExplainableShell({\n snapshots,\n resultData,\n logs = [],\n narrative = [],\n tabs = [\"result\", \"explainable\", \"ai-compatible\"],\n defaultTab,\n hideConsole = false,\n renderFlowchart,\n size = \"default\",\n unstyled = false,\n className,\n style,\n}: ExplainableShellProps) {\n const [activeTab, setActiveTab] = useState<ShellTab>(defaultTab ?? tabs[0]);\n const [snapshotIdx, setSnapshotIdx] = useState(0);\n\n const fs = fontSize[size];\n const pad = padding[size];\n\n const handleSnapshotChange = useCallback((idx: number) => {\n setSnapshotIdx(Math.max(0, Math.min(idx, snapshots.length - 1)));\n }, [snapshots.length]);\n\n // Progressive narrative reveal\n const revealedCount = useMemo(() => {\n if (snapshots.length === 0 || narrative.length === 0) return narrative.length;\n\n const boundaries: number[] = [];\n for (let i = 0; i < narrative.length; i++) {\n const trimmed = narrative[i].trimStart();\n if (\n (trimmed.startsWith(\"Stage \") && !trimmed.match(/^Stage\\s+\\d+:\\s*Step\\s/)) ||\n trimmed.startsWith(\"[\")\n ) {\n boundaries.push(i);\n }\n }\n\n if (boundaries.length === 0) {\n const ratio = (snapshotIdx + 1) / snapshots.length;\n return Math.max(1, Math.ceil(narrative.length * ratio));\n }\n\n const groupsToShow = Math.max(\n 1,\n Math.min(\n Math.floor(((snapshotIdx + 1) / snapshots.length) * boundaries.length) || 1,\n boundaries.length\n )\n );\n\n const endIdx =\n groupsToShow < boundaries.length ? boundaries[groupsToShow] : narrative.length;\n\n return Math.max(1, endIdx);\n }, [snapshots.length, snapshotIdx, narrative]);\n\n // Scope diff data\n const prevMemory = snapshotIdx > 0 ? snapshots[snapshotIdx - 1]?.memory : null;\n const currMemory = snapshots[snapshotIdx]?.memory ?? {};\n\n const tabLabels: Record<ShellTab, string> = {\n result: \"Result\",\n explainable: \"Explainable\",\n \"ai-compatible\": \"AI-Compatible\",\n };\n\n if (unstyled) {\n return (\n <div className={className} style={style} data-fp=\"explainable-shell\">\n <div data-fp=\"shell-tabs\">\n {tabs.map((tab) => (\n <button\n key={tab}\n data-fp=\"shell-tab\"\n data-active={tab === activeTab}\n onClick={() => setActiveTab(tab)}\n >\n {tabLabels[tab]}\n </button>\n ))}\n </div>\n <div data-fp=\"shell-content\" data-tab={activeTab}>\n {activeTab === \"result\" && (\n <ResultPanel\n data={resultData ?? null}\n logs={logs}\n hideConsole={hideConsole}\n unstyled\n />\n )}\n {activeTab === \"explainable\" && (\n <>\n <TimeTravelControls\n snapshots={snapshots}\n selectedIndex={snapshotIdx}\n onIndexChange={handleSnapshotChange}\n unstyled\n />\n {renderFlowchart?.({ snapshots, selectedIndex: snapshotIdx, onNodeClick: handleSnapshotChange })}\n <MemoryInspector snapshots={snapshots} selectedIndex={snapshotIdx} unstyled />\n <ScopeDiff previous={prevMemory} current={currMemory} unstyled />\n <GanttTimeline\n snapshots={snapshots}\n selectedIndex={snapshotIdx}\n onSelect={handleSnapshotChange}\n unstyled\n />\n </>\n )}\n {activeTab === \"ai-compatible\" && (\n <>\n <TimeTravelControls\n snapshots={snapshots}\n selectedIndex={snapshotIdx}\n onIndexChange={handleSnapshotChange}\n unstyled\n />\n {renderFlowchart?.({ snapshots, selectedIndex: snapshotIdx, onNodeClick: handleSnapshotChange })}\n <NarrativeTrace\n narrative={narrative}\n revealedCount={revealedCount}\n unstyled\n />\n </>\n )}\n </div>\n </div>\n );\n }\n\n // ── Styled mode ──\n return (\n <div\n className={className}\n style={{\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n background: theme.bgPrimary,\n color: theme.textPrimary,\n fontFamily: theme.fontSans,\n ...style,\n }}\n data-fp=\"explainable-shell\"\n >\n {/* Tab bar */}\n <div\n style={{\n display: \"flex\",\n gap: 0,\n borderBottom: `1px solid ${theme.border}`,\n background: theme.bgSecondary,\n flexShrink: 0,\n }}\n >\n {tabs.map((tab) => {\n const active = tab === activeTab;\n return (\n <button\n key={tab}\n onClick={() => setActiveTab(tab)}\n style={{\n padding: `${pad - 4}px ${pad}px`,\n fontSize: fs.label,\n fontWeight: active ? 700 : 500,\n textTransform: \"uppercase\",\n letterSpacing: \"0.08em\",\n color: active ? theme.primary : theme.textMuted,\n background: \"transparent\",\n border: \"none\",\n borderBottom: active ? `2px solid ${theme.primary}` : \"2px solid transparent\",\n cursor: \"pointer\",\n transition: \"all 0.15s ease\",\n }}\n >\n {tabLabels[tab]}\n </button>\n );\n })}\n </div>\n\n {/* Tab content */}\n <div style={{ flex: 1, overflow: \"hidden\", display: \"flex\", flexDirection: \"column\" }}>\n {activeTab === \"result\" && (\n <ResultPanel\n data={resultData ?? null}\n logs={logs}\n hideConsole={hideConsole}\n size={size}\n />\n )}\n\n {activeTab === \"explainable\" && (\n <>\n <TimeTravelControls\n snapshots={snapshots}\n selectedIndex={snapshotIdx}\n onIndexChange={handleSnapshotChange}\n size={size}\n />\n <div style={{ flex: 1, display: \"flex\", overflow: \"hidden\" }}>\n {renderFlowchart && (\n <div style={{ flex: 1, overflow: \"hidden\", borderRight: `1px solid ${theme.border}` }}>\n {renderFlowchart({ snapshots, selectedIndex: snapshotIdx, onNodeClick: handleSnapshotChange })}\n </div>\n )}\n <div\n style={{\n width: renderFlowchart ? \"40%\" : \"100%\",\n minWidth: 280,\n overflow: \"auto\",\n display: \"flex\",\n flexDirection: \"column\",\n }}\n >\n <MemoryInspector\n snapshots={snapshots}\n selectedIndex={snapshotIdx}\n size={size}\n />\n <div style={{ borderTop: `1px solid ${theme.border}` }}>\n <ScopeDiff\n previous={prevMemory}\n current={currMemory}\n hideUnchanged\n size={size}\n />\n </div>\n </div>\n </div>\n <div style={{ borderTop: `1px solid ${theme.border}`, flexShrink: 0 }}>\n <GanttTimeline\n snapshots={snapshots}\n selectedIndex={snapshotIdx}\n onSelect={handleSnapshotChange}\n size={size}\n />\n </div>\n </>\n )}\n\n {activeTab === \"ai-compatible\" && (\n <>\n <TimeTravelControls\n snapshots={snapshots}\n selectedIndex={snapshotIdx}\n onIndexChange={handleSnapshotChange}\n size={size}\n />\n <div style={{ flex: 1, display: \"flex\", overflow: \"hidden\" }}>\n {renderFlowchart && (\n <div style={{ flex: 1, overflow: \"hidden\", borderRight: `1px solid ${theme.border}` }}>\n {renderFlowchart({ snapshots, selectedIndex: snapshotIdx, onNodeClick: handleSnapshotChange })}\n </div>\n )}\n <NarrativeTrace\n narrative={narrative}\n revealedCount={revealedCount}\n size={size}\n style={{\n width: renderFlowchart ? \"40%\" : \"100%\",\n minWidth: 280,\n }}\n />\n </div>\n </>\n )}\n </div>\n </div>\n );\n}\n","import type { StageSnapshot } from \"../types\";\n\n/**\n * Shape of FootPrint's RuntimeSnapshot (from FlowChartExecutor.getSnapshot()).\n * We define it here instead of importing to avoid a hard dependency on footprintjs.\n */\ninterface RuntimeStageSnapshot {\n id: string;\n name?: string;\n isDecider?: boolean;\n isFork?: boolean;\n logs: Record<string, unknown>;\n errors: Record<string, unknown>;\n metrics: Record<string, unknown>;\n evals: Record<string, unknown>;\n flowMessages?: unknown[];\n next?: RuntimeStageSnapshot;\n children?: RuntimeStageSnapshot[];\n}\n\ninterface RuntimeSnapshot {\n sharedState: Record<string, unknown>;\n executionTree: RuntimeStageSnapshot;\n commitLog: unknown[];\n}\n\n/**\n * Converts a FootPrint RuntimeSnapshot into a flat array of StageSnapshots\n * suitable for visualization components.\n *\n * Usage:\n * ```ts\n * const executor = new FlowChartExecutor(chart);\n * await executor.run();\n * const snapshots = toVisualizationSnapshots(executor.getSnapshot());\n * ```\n */\nexport function toVisualizationSnapshots(\n runtime: RuntimeSnapshot\n): StageSnapshot[] {\n const snapshots: StageSnapshot[] = [];\n flattenTree(runtime.executionTree, snapshots, runtime.sharedState);\n return snapshots;\n}\n\nfunction flattenTree(\n node: RuntimeStageSnapshot,\n out: StageSnapshot[],\n sharedState: Record<string, unknown>,\n accumulatedMs: number = 0\n): number {\n // Estimate duration from metrics if available\n const durationMs =\n typeof node.metrics?.durationMs === \"number\"\n ? node.metrics.durationMs\n : 1;\n\n const startMs = accumulatedMs;\n\n // Build narrative from logs\n const narrative = buildNarrative(node);\n\n // Build memory from logs (key-value pairs written during this stage)\n const memory: Record<string, unknown> = {};\n if (node.logs) {\n Object.assign(memory, node.logs);\n }\n\n out.push({\n stageName: node.id,\n stageLabel: node.name || node.id,\n memory,\n narrative,\n startMs,\n durationMs,\n status: \"done\",\n });\n\n let nextMs = startMs + durationMs;\n\n // Handle parallel children (fork)\n if (node.children && node.children.length > 0) {\n let maxChildEnd = nextMs;\n for (const child of node.children) {\n const childEnd = flattenTree(child, out, sharedState, nextMs);\n maxChildEnd = Math.max(maxChildEnd, childEnd);\n }\n nextMs = maxChildEnd;\n }\n\n // Handle linear continuation\n if (node.next) {\n nextMs = flattenTree(node.next, out, sharedState, nextMs);\n }\n\n return nextMs;\n}\n\nfunction buildNarrative(node: RuntimeStageSnapshot): string {\n const parts: string[] = [];\n\n if (node.name) {\n parts.push(`Stage \"${node.name}\" executed.`);\n }\n\n if (node.logs && Object.keys(node.logs).length > 0) {\n const keys = Object.keys(node.logs);\n parts.push(`Wrote ${keys.length} key(s): ${keys.join(\", \")}.`);\n }\n\n if (node.errors && Object.keys(node.errors).length > 0) {\n parts.push(`Errors: ${JSON.stringify(node.errors)}`);\n }\n\n if (node.isFork) {\n parts.push(\n `Forked into ${node.children?.length ?? 0} parallel branch(es).`\n );\n }\n\n return parts.join(\" \") || `Stage ${node.id} completed.`;\n}\n\n/**\n * Creates StageSnapshots from simple arrays (when you don't have a RuntimeSnapshot).\n * Useful for testing or custom data sources.\n */\nexport function createSnapshots(\n stages: Array<{\n name: string;\n label?: string;\n memory?: Record<string, unknown>;\n narrative?: string;\n durationMs?: number;\n }>\n): StageSnapshot[] {\n let accMs = 0;\n return stages.map((s) => {\n const duration = s.durationMs ?? 1;\n const snap: StageSnapshot = {\n stageName: s.name,\n stageLabel: s.label ?? s.name,\n memory: s.memory ?? {},\n narrative: s.narrative ?? `${s.label ?? s.name} completed.`,\n startMs: accMs,\n durationMs: duration,\n status: \"done\",\n };\n accMs += duration;\n return snap;\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA0C;;;ACuBnC,SAAS,gBAAgB,QAA6C;AAC3E,QAAM,OAA+B,CAAC;AACtC,MAAI,OAAO,QAAQ;AACjB,UAAM,IAAI,OAAO;AACjB,QAAI,EAAE,QAAS,MAAK,oBAAoB,IAAI,EAAE;AAC9C,QAAI,EAAE,QAAS,MAAK,oBAAoB,IAAI,EAAE;AAC9C,QAAI,EAAE,MAAO,MAAK,kBAAkB,IAAI,EAAE;AAC1C,QAAI,EAAE,QAAS,MAAK,oBAAoB,IAAI,EAAE;AAC9C,QAAI,EAAE,UAAW,MAAK,iBAAiB,IAAI,EAAE;AAC7C,QAAI,EAAE,YAAa,MAAK,mBAAmB,IAAI,EAAE;AACjD,QAAI,EAAE,WAAY,MAAK,kBAAkB,IAAI,EAAE;AAC/C,QAAI,EAAE,YAAa,MAAK,mBAAmB,IAAI,EAAE;AACjD,QAAI,EAAE,cAAe,MAAK,qBAAqB,IAAI,EAAE;AACrD,QAAI,EAAE,UAAW,MAAK,iBAAiB,IAAI,EAAE;AAC7C,QAAI,EAAE,OAAQ,MAAK,aAAa,IAAI,EAAE;AAAA,EACxC;AACA,MAAI,OAAO,OAAQ,MAAK,aAAa,IAAI,OAAO;AAChD,MAAI,OAAO,YAAY,KAAM,MAAK,gBAAgB,IAAI,OAAO,WAAW;AACxE,MAAI,OA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AU,UAAU,CAAC;AAAA,IAC3C;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,GAAG,KAAK,SAAS,KAAK,EAAE;AAC5C;AAMO,SAAS,gBACd,QAOiB;AACjB,MAAI,QAAQ;AACZ,SAAO,OAAO,IAAI,CAAC,MAAM;AACvB,UAAM,WAAW,EAAE,cAAc;AACjC,UAAM,OAAsB;AAAA,MAC1B,WAAW,EAAE;AAAA,MACb,YAAY,EAAE,SAAS,EAAE;AAAA,MACzB,QAAQ,EAAE,UAAU,CAAC;AAAA,MACrB,WAAW,EAAE,aAAa,GAAG,EAAE,SAAS,EAAE,IAAI;AAAA,MAC9C,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,QAAQ;AAAA,IACV;AACA,aAAS;AACT,WAAO;AAAA,EACT,CAAC;AACH;","names":["import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","v","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime"]}
@@ -0,0 +1,270 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ /** Snapshot of a single pipeline stage — the core data shape for all components. */
4
+ interface StageSnapshot {
5
+ /** Internal stage identifier */
6
+ stageName: string;
7
+ /** Human-readable label */
8
+ stageLabel: string;
9
+ /** Accumulated memory state after this stage ran */
10
+ memory: Record<string, unknown>;
11
+ /** Narrative text describing what happened */
12
+ narrative: string;
13
+ /** When this stage started (ms from pipeline start) */
14
+ startMs: number;
15
+ /** How long this stage took (ms) */
16
+ durationMs: number;
17
+ /** Execution status */
18
+ status?: "pending" | "active" | "done" | "error";
19
+ }
20
+ /** Component size variants */
21
+ type Size = "compact" | "default" | "detailed";
22
+ /** Common props shared by all visualization components */
23
+ interface BaseComponentProps {
24
+ /** Size variant */
25
+ size?: Size;
26
+ /** Strip all built-in styles — bring your own */
27
+ unstyled?: boolean;
28
+ /** Additional CSS class name */
29
+ className?: string;
30
+ /** Inline style overrides */
31
+ style?: React.CSSProperties;
32
+ }
33
+
34
+ /** Default theme tokens — consumers override via CSS variables or ThemeProvider. */
35
+ interface ThemeTokens {
36
+ colors?: {
37
+ primary?: string;
38
+ success?: string;
39
+ error?: string;
40
+ warning?: string;
41
+ bgPrimary?: string;
42
+ bgSecondary?: string;
43
+ bgTertiary?: string;
44
+ textPrimary?: string;
45
+ textSecondary?: string;
46
+ textMuted?: string;
47
+ border?: string;
48
+ };
49
+ radius?: string;
50
+ fontFamily?: {
51
+ sans?: string;
52
+ mono?: string;
53
+ };
54
+ }
55
+ /** Maps ThemeTokens to CSS custom property assignments. */
56
+ declare function tokensToCSSVars(tokens: ThemeTokens): Record<string, string>;
57
+ /** Default dark theme values (used as CSS variable fallbacks). */
58
+ declare const defaultTokens: Required<{
59
+ [K in keyof ThemeTokens]-?: Required<ThemeTokens[K]>;
60
+ }>;
61
+
62
+ declare function useFootprintTheme(): ThemeTokens;
63
+ interface FootprintThemeProps {
64
+ tokens?: ThemeTokens;
65
+ children: React.ReactNode;
66
+ }
67
+ /**
68
+ * Optional theme provider — wraps children with CSS custom properties.
69
+ * Consumers can also just set --fp-* CSS variables directly.
70
+ */
71
+ declare function FootprintTheme({ tokens, children }: FootprintThemeProps): react_jsx_runtime.JSX.Element;
72
+
73
+ /** Cool dark theme (the library default) */
74
+ declare const coolDark: ThemeTokens;
75
+ /** Warm dark theme — charcoal-purple palette */
76
+ declare const warmDark: ThemeTokens;
77
+ /** Warm light theme — cream/peach palette */
78
+ declare const warmLight: ThemeTokens;
79
+ /** All built-in theme presets */
80
+ declare const themePresets: {
81
+ readonly coolDark: ThemeTokens;
82
+ readonly warmDark: ThemeTokens;
83
+ readonly warmLight: ThemeTokens;
84
+ };
85
+ type ThemePresetName = keyof typeof themePresets;
86
+
87
+ interface MemoryInspectorProps extends BaseComponentProps {
88
+ /** Single memory object or snapshots (will accumulate up to selectedIndex) */
89
+ data?: Record<string, unknown>;
90
+ /** When using snapshots mode, pass these instead of data */
91
+ snapshots?: StageSnapshot[];
92
+ /** Index to accumulate up to (for time-travel) */
93
+ selectedIndex?: number;
94
+ /** Show data types alongside values */
95
+ showTypes?: boolean;
96
+ /** Highlight keys that are new at this step */
97
+ highlightNew?: boolean;
98
+ }
99
+ /**
100
+ * Displays pipeline memory state as formatted JSON.
101
+ * Supports both static (data prop) and time-travel (snapshots + selectedIndex) modes.
102
+ */
103
+ declare function MemoryInspector({ data, snapshots, selectedIndex, showTypes, highlightNew, size, unstyled, className, style, }: MemoryInspectorProps): react_jsx_runtime.JSX.Element;
104
+
105
+ interface NarrativeLogProps extends BaseComponentProps {
106
+ /** Snapshots to display narratives from */
107
+ snapshots: StageSnapshot[];
108
+ /** Show narratives up to this index (for time-travel sync) */
109
+ selectedIndex?: number;
110
+ /** Show a single narrative string (simple mode) */
111
+ narrative?: string;
112
+ }
113
+ /**
114
+ * Timeline-style execution log showing what happened at each stage.
115
+ * Supports both full snapshots mode and single-narrative mode.
116
+ */
117
+ declare function NarrativeLog({ snapshots, selectedIndex, narrative, size, unstyled, className, style, }: NarrativeLogProps): react_jsx_runtime.JSX.Element;
118
+
119
+ interface NarrativeTraceProps extends BaseComponentProps {
120
+ /** All narrative lines (full trace) */
121
+ narrative: string[];
122
+ /** Number of lines currently revealed (for progressive reveal). Defaults to all. */
123
+ revealedCount?: number;
124
+ /** Start with all groups collapsed */
125
+ defaultCollapsed?: boolean;
126
+ /** Called when user clicks a stage header */
127
+ onStageClick?: (headerIndex: number) => void;
128
+ }
129
+ declare function NarrativeTrace({ narrative, revealedCount, defaultCollapsed, onStageClick, size, unstyled, className, style, }: NarrativeTraceProps): react_jsx_runtime.JSX.Element;
130
+
131
+ interface GanttTimelineProps extends BaseComponentProps {
132
+ /** Stage snapshots with timing info */
133
+ snapshots: StageSnapshot[];
134
+ /** Currently selected stage index */
135
+ selectedIndex?: number;
136
+ /** Callback when a stage bar is clicked */
137
+ onSelect?: (index: number) => void;
138
+ }
139
+ /**
140
+ * Horizontal Gantt-style timeline showing stage durations and overlap.
141
+ * Great for performance analysis of pipeline execution.
142
+ */
143
+ declare function GanttTimeline({ snapshots, selectedIndex, onSelect, size, unstyled, className, style, }: GanttTimelineProps): react_jsx_runtime.JSX.Element;
144
+
145
+ interface SnapshotPanelProps extends BaseComponentProps {
146
+ /** Stage snapshots from pipeline execution */
147
+ snapshots: StageSnapshot[];
148
+ /** Show the Gantt timeline */
149
+ showGantt?: boolean;
150
+ /** Show the time-travel scrubber */
151
+ showScrubber?: boolean;
152
+ /** Title override */
153
+ title?: string;
154
+ }
155
+ /**
156
+ * All-in-one panel: time-travel scrubber + memory inspector + narrative log + gantt.
157
+ * Drop this into any page to make a pipeline run inspectable.
158
+ */
159
+ declare function SnapshotPanel({ snapshots, showGantt, showScrubber, title, size, unstyled, className, style, }: SnapshotPanelProps): react_jsx_runtime.JSX.Element;
160
+
161
+ interface DiffEntry {
162
+ key: string;
163
+ type: "added" | "removed" | "changed" | "unchanged";
164
+ oldValue?: unknown;
165
+ newValue?: unknown;
166
+ }
167
+ interface ScopeDiffProps extends BaseComponentProps {
168
+ /** Memory state before the current stage */
169
+ previous: Record<string, unknown> | null;
170
+ /** Memory state after the current stage */
171
+ current: Record<string, unknown>;
172
+ /** Hide unchanged keys (default: false) */
173
+ hideUnchanged?: boolean;
174
+ }
175
+ declare function ScopeDiff({ previous, current, hideUnchanged, size, unstyled, className, style, }: ScopeDiffProps): react_jsx_runtime.JSX.Element;
176
+
177
+ interface ResultPanelProps extends BaseComponentProps {
178
+ /** Final pipeline output / shared state */
179
+ data: Record<string, unknown> | null;
180
+ /** Optional console log lines */
181
+ logs?: string[];
182
+ /** Hide console section (default: false) */
183
+ hideConsole?: boolean;
184
+ }
185
+ declare function ResultPanel({ data, logs, hideConsole, size, unstyled, className, style, }: ResultPanelProps): react_jsx_runtime.JSX.Element;
186
+
187
+ interface TimeTravelControlsProps extends BaseComponentProps {
188
+ /** Stage snapshots */
189
+ snapshots: StageSnapshot[];
190
+ /** Currently selected stage index */
191
+ selectedIndex: number;
192
+ /** Callback when selected index changes */
193
+ onIndexChange: (index: number) => void;
194
+ /** Enable auto-play with Gantt-proportional timing */
195
+ autoPlayable?: boolean;
196
+ }
197
+ declare function TimeTravelControls({ snapshots, selectedIndex, onIndexChange, autoPlayable, size, unstyled, className, style, }: TimeTravelControlsProps): react_jsx_runtime.JSX.Element;
198
+
199
+ type ShellTab = "result" | "explainable" | "ai-compatible";
200
+ interface ExplainableShellProps extends BaseComponentProps {
201
+ /** Stage snapshots for time-travel visualization */
202
+ snapshots: StageSnapshot[];
203
+ /** Final pipeline result data */
204
+ resultData?: Record<string, unknown> | null;
205
+ /** Console log lines */
206
+ logs?: string[];
207
+ /** Combined narrative lines */
208
+ narrative?: string[];
209
+ /** Which tabs to show (default: all three) */
210
+ tabs?: ShellTab[];
211
+ /** Initially active tab */
212
+ defaultTab?: ShellTab;
213
+ /** Hide console in result tab */
214
+ hideConsole?: boolean;
215
+ /** Custom content to render in each tab slot */
216
+ renderFlowchart?: (props: {
217
+ snapshots: StageSnapshot[];
218
+ selectedIndex: number;
219
+ onNodeClick?: (index: number) => void;
220
+ }) => React.ReactNode;
221
+ }
222
+ declare function ExplainableShell({ snapshots, resultData, logs, narrative, tabs, defaultTab, hideConsole, renderFlowchart, size, unstyled, className, style, }: ExplainableShellProps): react_jsx_runtime.JSX.Element;
223
+
224
+ /**
225
+ * Shape of FootPrint's RuntimeSnapshot (from FlowChartExecutor.getSnapshot()).
226
+ * We define it here instead of importing to avoid a hard dependency on footprintjs.
227
+ */
228
+ interface RuntimeStageSnapshot {
229
+ id: string;
230
+ name?: string;
231
+ isDecider?: boolean;
232
+ isFork?: boolean;
233
+ logs: Record<string, unknown>;
234
+ errors: Record<string, unknown>;
235
+ metrics: Record<string, unknown>;
236
+ evals: Record<string, unknown>;
237
+ flowMessages?: unknown[];
238
+ next?: RuntimeStageSnapshot;
239
+ children?: RuntimeStageSnapshot[];
240
+ }
241
+ interface RuntimeSnapshot {
242
+ sharedState: Record<string, unknown>;
243
+ executionTree: RuntimeStageSnapshot;
244
+ commitLog: unknown[];
245
+ }
246
+ /**
247
+ * Converts a FootPrint RuntimeSnapshot into a flat array of StageSnapshots
248
+ * suitable for visualization components.
249
+ *
250
+ * Usage:
251
+ * ```ts
252
+ * const executor = new FlowChartExecutor(chart);
253
+ * await executor.run();
254
+ * const snapshots = toVisualizationSnapshots(executor.getSnapshot());
255
+ * ```
256
+ */
257
+ declare function toVisualizationSnapshots(runtime: RuntimeSnapshot): StageSnapshot[];
258
+ /**
259
+ * Creates StageSnapshots from simple arrays (when you don't have a RuntimeSnapshot).
260
+ * Useful for testing or custom data sources.
261
+ */
262
+ declare function createSnapshots(stages: Array<{
263
+ name: string;
264
+ label?: string;
265
+ memory?: Record<string, unknown>;
266
+ narrative?: string;
267
+ durationMs?: number;
268
+ }>): StageSnapshot[];
269
+
270
+ export { type BaseComponentProps, type DiffEntry, ExplainableShell, type ExplainableShellProps, FootprintTheme, GanttTimeline, type GanttTimelineProps, MemoryInspector, type MemoryInspectorProps, NarrativeLog, type NarrativeLogProps, NarrativeTrace, type NarrativeTraceProps, ResultPanel, type ResultPanelProps, ScopeDiff, type ScopeDiffProps, type ShellTab, type Size, SnapshotPanel, type SnapshotPanelProps, type StageSnapshot, type ThemePresetName, type ThemeTokens, TimeTravelControls, type TimeTravelControlsProps, coolDark, createSnapshots, defaultTokens, themePresets, toVisualizationSnapshots, tokensToCSSVars, useFootprintTheme, warmDark, warmLight };