agentfootprint-lens 0.63.0 → 0.63.1

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.
@@ -903,6 +903,7 @@ function ReasoningLens(props) {
903
903
  llmLatestToolCalls: keyValue(context, "llmLatestToolCalls")
904
904
  });
905
905
  }, [context, rows]);
906
+ const mover = props.cursor === void 0 && shared !== void 0 && cursor.total > 0 && cursor.at.step >= 0;
906
907
  if (exchange === void 0) return null;
907
908
  const fold = exchange.reasoning;
908
909
  return /* @__PURE__ */ jsxs3(
@@ -924,6 +925,16 @@ function ReasoningLens(props) {
924
925
  ] }),
925
926
  /* @__PURE__ */ jsx3(ViewToggle, { view, onView: setView })
926
927
  ] }),
928
+ mover && /* @__PURE__ */ jsx3("div", { "data-testid": "reasoning-transport", children: /* @__PURE__ */ jsx3(
929
+ TimeTravel,
930
+ {
931
+ total: cursor.total,
932
+ focusSeq: Math.max(0, cursor.at.step),
933
+ onFocusChange: (n) => cursor.moveTo(n),
934
+ isLive: false,
935
+ compact: true
936
+ }
937
+ ) }),
927
938
  view === "cards" && /* @__PURE__ */ jsxs3("div", { style: column, "data-testid": "reasoning-cards", children: [
928
939
  fold.cards.map((card) => /* @__PURE__ */ jsx3(Card, { card }, card.toolCallId)),
929
940
  fold.answer !== void 0 && /* @__PURE__ */ jsx3(Answer, { answer: fold.answer })
@@ -1348,4 +1359,4 @@ export {
1348
1359
  foldExchange,
1349
1360
  ReasoningLens
1350
1361
  };
1351
- //# sourceMappingURL=chunk-Y5ZHXZRE.js.map
1362
+ //# sourceMappingURL=chunk-LXQNLCPV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react/components/ContextView.tsx","../src/react/components/FindingsBand.tsx","../src/react/components/ReasoningLens.tsx"],"sourcesContent":["/**\n * <ContextView> — the context object at the cursor, key by key: who wrote\n * each, what moved since the previous stop, what was served beside it.\n *\n * Standalone, like the Skill Graph: mount it anywhere with a recording and it\n * walks its own milestone axis; or hand it the ONE cursor (`cursor` from\n * `<Lens>`'s detail slot, or `lensCursorFrom`) and it never makes a second.\n *\n * <ContextView runner={recording} /> // its own cursor\n * <ContextView runner={recording} cursor={p.cursor} /> // the Lens's\n *\n * Two layers on the ONE cursor (0.54.0). On top, what the model HAD at this\n * stop: the served document of the stop's epoch — system pieces, messages,\n * tools, each checked against the receipt, and what changed since the\n * previous model call — rendered by `<ServedTab>`, the one owner of that\n * rendering (the Why Lens's Served tab is the same component). Beneath, what\n * it was BUILT from: the record's keys at the stop, who wrote each, what moved\n * since the previous stop; a long value opens in place. Under the record,\n * when the fold at the stop holds `findingsLedger` (an armed run,\n * agentfootprint 9.101.0), the Findings band (0.61.0): the model's own\n * ledger folded for reading by `<FindingsBand>` — its rows and the state's\n * `toolResults` are read off `contextAt(...).keys`, so the band stands on\n * the same fold as the key table and moves with the ONE cursor.\n *\n * Everything printed is the record: key paths, values, stage ids, commit\n * indices, event names, the Served row's pieces and verdicts. `LABELS` is\n * every string this view owns — names for things on the screen, never a\n * sentence about the run (test/served/no-own-claims.test.ts walks this file).\n */\nimport React, { useMemo, useState } from 'react';\n\nimport { contextAt, type ContextAt, type ContextKey } from '../../core/context/contextAt.js';\nimport type { LensCursor } from '../../core/cursor/lensCursor.js';\nimport { lensCursorFrom } from '../../core/cursor/lensCursor.js';\nimport type { CursorPosition } from '../../core/group/cursorPositionsAtDrill.js';\nimport { scrubAxisFor } from '../../core/group/scrubAxisFor.js';\nimport type { LensRecorder } from '../../core/LensRecorder.js';\nimport type { ServedCursor } from '../../core/served/types.js';\nimport { tagAxisPositions } from '../../core/tags/tagAxis.js';\nimport type { EventLogEntry } from '../../core/types.js';\nimport { snapshotLogKey, snapshotOfRunner } from '../../core/utils/snapshotOfRunner.js';\nimport { TimeTravel } from '../TimeTravel.js';\nimport type { SharedCursor } from '../useSharedCursor.js';\nimport { FindingsBand } from './FindingsBand.js';\nimport { ServedTab } from './ServedTab.js';\n\nexport const LABELS = Object.freeze({\n view: 'Context',\n keys: 'keys',\n wroteBy: 'wrote by',\n at: 'at',\n entered: 'entered',\n changed: 'changed',\n unchanged: 'unchanged',\n left: 'left',\n unattributed: 'unattributed',\n rows: 'rows',\n served: 'served',\n why: 'why',\n epoch: 'epoch',\n system: 'system',\n tools: 'tools',\n redacted: 'redacted',\n skipped: 'skipped',\n foldError: 'fold error',\n servedError: 'served error',\n json: 'JSON',\n empty: '{ }',\n more: 'more',\n less: 'less',\n builtFrom: 'built from',\n});\n\n/** The milestone kinds a standalone view walks — the library's own tag vocabulary. */\nexport const MILESTONE_AXIS: readonly string[] = Object.freeze([\n 'milestone:iteration',\n 'milestone:slot',\n 'milestone:llm-turn',\n 'milestone:tool-call',\n 'milestone:decision',\n]);\n\nexport interface ContextViewProps {\n /** The recording or a runner with `getLastSnapshot()` — the same input the Served tab takes. */\n readonly runner: unknown;\n /** THE cursor, when a host holds it. Absent: the view walks its own milestone axis. */\n readonly cursor?: LensCursor;\n /**\n * The previous stop on the HOST's axis, when it hands `cursor` (0.53.3) —\n * what `since` (entered / changed / unchanged) and `left` are measured\n * against. A standalone view knows its own previous stop; a slotted one\n * cannot, and without this it claims no direction.\n */\n readonly previous?: ServedCursor;\n /**\n * The HOST's one cursor across every lens it mounts (0.58.0) — the owner\n * `useSharedCursor(recorder)` hands back. The view reads the shared\n * ADDRESS over its axis and its transport moves that address. With\n * `recorder` the axis is the run's GROUPED axis — the same list a Why Lens\n * at `granularity=\"group\"` scrubs, so the two stand on the same stop;\n * without one it is the view's own milestone axis (`MILESTONE_AXIS`, read\n * off the snapshot). `previous` is then the stop before, on that axis.\n * `cursor` wins when supplied.\n *\n * ```tsx\n * const shared = useSharedCursor(recorder);\n * <ContextView runner={recording} recorder={recorder} shared={shared} />\n * ```\n */\n readonly shared?: SharedCursor;\n /** The recorder whose grouped axis a `shared` view reads — omit to read the milestone axis off the snapshot. */\n readonly recorder?: LensRecorder;\n /** The recording's event stream, for the `why` band (a replay's `getEntries()`). */\n readonly events?: readonly EventLogEntry[];\n /** Show the fold as JSON instead of the key table. */\n readonly initialMode?: 'keys' | 'json';\n}\n\nfunction positionsOf(snapshot: unknown): readonly CursorPosition[] {\n return tagAxisPositions(snapshot, MILESTONE_AXIS, []) ?? [];\n}\n\nfunction servedCursorOf(cursor: LensCursor): ServedCursor {\n return {\n runtimeStageId: cursor.at.runtimeStageId,\n commitIdx: cursor.at.commitIdx,\n };\n}\n\nfunction previousOf(\n cursor: LensCursor,\n positions: readonly CursorPosition[] | undefined,\n): ServedCursor | undefined {\n if (cursor.at.step <= 0) return undefined;\n const p = positions?.[cursor.at.step - 1];\n return p !== undefined ? { runtimeStageId: p.runtimeStageId, commitIdx: p.commitIdx } : undefined;\n}\n\nexport function ContextView(props: ContextViewProps): React.ReactElement {\n const { runner, events, shared, recorder } = props;\n const fresh = snapshotOfRunner(runner);\n const logKey = snapshotLogKey(fresh);\n const snapshot = useMemo(() => fresh, [runner, logKey]);\n // The axis this view reads when it is not handed a per-axis cursor: the\n // recorder's grouped axis (parity with a Why Lens) when a recorder is\n // given, else the milestone axis read off the snapshot. Rebuilt when the\n // snapshot's log moves.\n const ownPositions = useMemo(\n () =>\n props.cursor !== undefined\n ? undefined\n : recorder !== undefined\n ? scrubAxisFor(recorder, 'group')\n : positionsOf(snapshot),\n // eslint-disable-next-line react-hooks/exhaustive-deps -- the recorder's axis moves with the log key\n [snapshot, props.cursor, recorder, logKey],\n );\n const [ownStep, setOwnStep] = useState(0);\n // ONE cursor: the host's per-axis reading, else the shared address read\n // over this view's axis, else the view's own — never two.\n const cursor: LensCursor =\n props.cursor ??\n (shared !== undefined\n ? shared.over(ownPositions ?? [])\n : lensCursorFrom(\n ownPositions ?? [],\n Math.min(ownStep, Math.max(0, (ownPositions?.length ?? 1) - 1)),\n setOwnStep,\n ));\n // A mover belongs here when the cursor is this view's own or the shared\n // address — a per-axis `cursor` from a slot brings the host's mover — and\n // only while the cursor STANDS on this axis: an address this axis cannot\n // hold reads as no position, and a transport lit at stop 0 would claim one.\n const mover = props.cursor === undefined && cursor.total > 0 && cursor.at.step >= 0;\n const [mode, setMode] = useState<'keys' | 'json'>(props.initialMode ?? 'keys');\n\n const context = useMemo(\n () =>\n contextAt(snapshot, servedCursorOf(cursor), {\n previous: props.previous ?? previousOf(cursor, ownPositions),\n events,\n }),\n [snapshot, cursor.at.runtimeStageId, cursor.at.commitIdx, cursor.at.step, ownPositions, events],\n );\n\n return (\n <div\n style={panel}\n data-testid=\"context-view\"\n data-step={cursor.at.step}\n data-commit={cursor.at.commitIdx}\n >\n <div style={header}>\n <span style={title}>{LABELS.view}</span>\n <span style={dim}>\n {cursor.at.label} · {cursor.at.step + 1}/{cursor.total}\n </span>\n <span style={{ marginLeft: 'auto', display: 'flex', gap: 6 }}>\n <button\n type=\"button\"\n style={btn}\n aria-pressed={mode === 'keys'}\n onClick={() => setMode('keys')}\n data-testid=\"context-mode-keys\"\n >\n {LABELS.keys}\n </button>\n <button\n type=\"button\"\n style={btn}\n aria-pressed={mode === 'json'}\n onClick={() => setMode('json')}\n data-testid=\"context-mode-json\"\n >\n {LABELS.json}\n </button>\n </span>\n </div>\n {mover && (\n <div data-testid=\"context-transport\">\n {/* THE transport — the same component the Lens and the Skill Graph\n mount, moving the same cursor through the same funnel. */}\n <TimeTravel\n total={cursor.total}\n focusSeq={Math.max(0, cursor.at.step)}\n onFocusChange={(n) => cursor.moveTo(n)}\n isLive={false}\n compact\n />\n </div>\n )}\n <Facts context={context} />\n <ServedLayer context={context} runner={runner} cursor={cursor} />\n <div style={dim} data-testid=\"context-built-from\">\n {LABELS.builtFrom} · {context.keys.length} {LABELS.keys}\n </div>\n {mode === 'json' ? <JsonPane context={context} /> : <KeyTable context={context} />}\n <FindingsLayer context={context} />\n <WhyBand context={context} />\n </div>\n );\n}\n\n/** The Findings band, under the record: ONLY when the fold at the stop holds\n * `findingsLedger` — an armed run, after its first declaration. The rows and\n * the batch (`toolResults`) are the same keys the table above lists, read\n * off the one `contextAt` — no second fold, no second cursor. */\nfunction FindingsLayer({ context }: { readonly context: ContextAt }): React.ReactElement | null {\n const ledger = context.keys.find((k) => k.path === 'findingsLedger');\n if (ledger === undefined || !Array.isArray(ledger.value)) return null;\n const results = context.keys.find((k) => k.path === 'toolResults')?.value;\n return (\n <FindingsBand\n rows={ledger.value}\n {...(Array.isArray(results) ? { toolResults: results } : {})}\n {...(ledger.since !== undefined ? { since: ledger.since } : {})}\n />\n );\n}\n\nfunction Facts({ context }: { readonly context: ContextAt }): React.ReactElement | null {\n const facts: string[] = [];\n if (context.redacted) facts.push(LABELS.redacted);\n if (context.skipped !== undefined) facts.push(`${LABELS.skipped} ${context.skipped.join(',')}`);\n if (context.foldError !== undefined) facts.push(`${LABELS.foldError}: ${context.foldError}`);\n if (context.servedError !== undefined) facts.push(`${LABELS.servedError}: ${context.servedError}`);\n if (facts.length === 0) return null;\n return (\n <div style={dim} data-testid=\"context-facts\">\n {facts.join(' · ')}\n </div>\n );\n}\n\nfunction KeyTable({ context }: { readonly context: ContextAt }): React.ReactElement {\n if (context.keys.length === 0 && context.left.length === 0) {\n return (\n <div style={mono} data-testid=\"context-empty\">\n {LABELS.empty}\n </div>\n );\n }\n return (\n <table style={table} data-testid=\"context-keys\">\n <colgroup>\n <col style={{ width: '28%' }} />\n <col style={{ width: '34%' }} />\n <col />\n </colgroup>\n <tbody>\n {context.keys.map((k) => (\n <KeyRow key={k.path} k={k} />\n ))}\n {context.left.map((path) => (\n <tr key={`left:${path}`} data-testid=\"context-key\" data-since=\"left\" style={{ opacity: 0.6 }}>\n <td style={cell}>\n <code>{path}</code>\n </td>\n <td style={cell}>{LABELS.left}</td>\n <td style={cell} />\n </tr>\n ))}\n </tbody>\n </table>\n );\n}\n\nfunction KeyRow({ k }: { readonly k: ContextKey }): React.ReactElement {\n const since = k.since === undefined ? undefined : LABELS[k.since];\n return (\n <tr\n data-testid=\"context-key\"\n data-path={k.path}\n data-since={k.since ?? ''}\n style={k.since === 'unchanged' ? { opacity: 0.6 } : undefined}\n >\n <td style={cell}>\n <code>{k.path}</code>\n {since !== undefined && <span style={pill}>{since}</span>}\n </td>\n <td style={cell} data-testid=\"context-wrote-by\">\n {k.wroteBy !== undefined ? (\n <>\n <span style={dim}>{LABELS.wroteBy} </span>\n <code>{k.wroteBy}</code>\n <span style={dim}>\n {' '}\n {LABELS.at} #{k.wroteAt} · {k.verb}\n </span>\n </>\n ) : (\n <span style={dim}>{LABELS.unattributed}</span>\n )}\n </td>\n <td style={{ ...cell, ...mono }}>\n <ValueCell value={k.value} />\n </td>\n </tr>\n );\n}\n\n/** A value, shortened past 160 characters — and opened in place on a click,\n * so a system prompt or a tool schema is readable where it sits. */\nfunction ValueCell({ value }: { readonly value: unknown }): React.ReactElement {\n const [open, setOpen] = useState(false);\n const text = JSON.stringify(value) ?? '';\n const long = text.length > 160;\n if (!long) return <span>{text}</span>;\n return (\n <span data-testid=\"context-value\" data-open={open}>\n {open ? (\n <pre style={{ ...mono, ...pre }} data-testid=\"context-value-full\">\n {text}\n </pre>\n ) : (\n <span>{`${text.slice(0, 157)}…`}</span>\n )}{' '}\n <button type=\"button\" style={btn} onClick={() => setOpen(!open)} data-testid=\"context-value-toggle\">\n {open ? LABELS.less : LABELS.more}\n </button>\n </span>\n );\n}\n\nfunction JsonPane({ context }: { readonly context: ContextAt }): React.ReactElement {\n const object: Record<string, unknown> = {};\n for (const k of context.keys) object[k.path] = k.value;\n return (\n <pre style={{ ...mono, ...pre }} data-testid=\"context-json\">\n {JSON.stringify(object, null, 2)}\n </pre>\n );\n}\n\n/** What the model HAD at this stop — the served document of the stop's\n * epoch, rendered by the one owner of that rendering. Absent when no model\n * call is at or before the stop: nothing is served, nothing is claimed. */\nfunction ServedLayer({\n context,\n runner,\n cursor,\n}: {\n readonly context: ContextAt;\n readonly runner: unknown;\n readonly cursor: LensCursor;\n}): React.ReactElement | null {\n const served = context.served;\n if (served === undefined) return null;\n return (\n <div style={band} data-testid=\"context-served\" data-epoch={served.row.view.epoch}>\n <span style={dim}>\n {LABELS.served} · {LABELS.epoch} {served.row.view.epoch}\n </span>\n <ServedTab\n runner={runner}\n cursor={cursor}\n // The tab's own jump (to a call's stop) moves THE cursor — a standalone\n // view's own, a slotted view's host's — and a miss never moves it.\n onJumpTo={(runtimeStageId) => {\n const to = cursor.resolve(runtimeStageId);\n if (to.ok && to.step !== undefined) cursor.moveTo(to.step);\n }}\n />\n </div>\n );\n}\n\nfunction WhyBand({ context }: { readonly context: ContextAt }): React.ReactElement | null {\n if (context.why.length === 0) return null;\n return (\n <div style={band} data-testid=\"context-why\">\n <span style={dim}>{LABELS.why}</span>\n <ul style={list}>\n {context.why.map((w) => (\n <li key={w.seq} style={mono}>\n <code>{w.name}</code> <span style={dim}>#{w.seq}</span>\n </li>\n ))}\n </ul>\n </div>\n );\n}\n\nconst panel: React.CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 8,\n padding: 10,\n fontSize: 13,\n};\nconst header: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 10,\n};\nconst title: React.CSSProperties = { fontWeight: 600 };\nconst dim: React.CSSProperties = { opacity: 0.7 };\nconst mono: React.CSSProperties = {\n fontFamily: 'monospace',\n fontSize: 12,\n};\nconst pre: React.CSSProperties = {\n margin: 0,\n whiteSpace: 'pre-wrap',\n wordBreak: 'break-word',\n};\nconst table: React.CSSProperties = {\n borderCollapse: 'collapse',\n width: '100%',\n tableLayout: 'fixed',\n};\nconst cell: React.CSSProperties = {\n wordBreak: 'break-all',\n overflowWrap: 'anywhere',\n padding: '4px 6px',\n verticalAlign: 'top',\n borderTop: '1px solid',\n borderTopColor: 'currentColor',\n};\nconst pill: React.CSSProperties = {\n marginLeft: 6,\n padding: '0 6px',\n borderRadius: 8,\n fontSize: 11,\n border: '1px solid',\n borderColor: 'currentColor',\n};\nconst band: React.CSSProperties = {\n paddingTop: 6,\n borderTop: '1px solid',\n borderTopColor: 'currentColor',\n};\nconst list: React.CSSProperties = { margin: '4px 0 0', paddingLeft: 18 };\nconst btn: React.CSSProperties = { fontSize: 12, padding: '2px 8px' };\n","/**\n * <FindingsBand> — the model's own findings ledger at the cursor, folded for\n * reading (agentfootprint 9.101.0, `AgentState.findingsLedger`).\n *\n * WHY. The ledger is append-only: a basis row before each tool call, a\n * standing row on each result the model later named, a conflict row where two\n * stood-on readings disagreed. Read raw, the current picture at a stop is\n * spread across every row that ever landed. This band takes the STANDINGS\n * the way the library's own reader does (`findings/ledger.ts · foldLedger`:\n * the LAST standing row per `toolCallId` is the current one) and groups them,\n * so a reader sees at once what the model stands on, what it keeps open, what\n * it ruled out, what it called noise — and which results it never named at\n * all. CONFLICTS are the one group that is NOT a current set: the library\n * writes a `ConflictRow` ONCE per key, at the write whose stood-on readings\n * first disagreed, and a later `ruled-out` retires a witness in ITS fold\n * (`foldLedger(...).conflicts` = `conflictsOf(asserted)`, recomputed) without\n * touching the row. That recomputation is contextfootprint's value algebra,\n * which this lens does not own and will not re-derive; so the band prints the\n * rows as what they are — the history of when each conflict was FIRST SEEN\n * (`LABELS.conflicts` says so) — and beside every witness the standing the\n * same fold holds for it NOW (`fact` · `ruled-out` · …, the record's own\n * word). A retired witness reads `ruled-out` on the conflict row and sits in\n * the ruled-out group; nothing here decides whether the conflict still holds.\n *\n * THE LAWS THIS FILE KEEPS:\n *\n * 1. NEVER INFER. A result with no standing row is UNDECLARED: it is listed\n * under that word by the state's own `toolResults`, never as `open` and\n * never as \"no findings\". A standing outside the four the library names\n * is neither shown nor guessed at.\n * 2. NO VERDICT. A conflict is printed from its `ConflictRow` — the shared\n * key and every witness's identity, each with the standing the fold\n * holds for that witness now — and nothing here says which reading\n * holds, nor whether the conflict is still current.\n * 3. OMIT, NEVER DENY. An empty group is not rendered; the band itself\n * renders only when the fold at the stop holds the key (`<ContextView>`\n * · `FindingsLayer` decides that).\n * 4. NO SENTENCE OF ITS OWN. Every printed string is a value off the record\n * — an id, a subject, a predicate, a value, a `settles`, a `line` — or a\n * `LABELS` entry; `test/served/no-own-claims.test.ts` walks this file.\n * 5. A SHAPE THE LENS DOES NOT OWN. The rows came off a recording as JSON,\n * so every row is narrowed by its shape here (`standingOf`, `conflictOf`,\n * `assertionOf`) and a row that does not fit is passed over, the way\n * `ServedTab.tsx · collapsedTicketOf` reads a ticket.\n *\n * Pure over its props: `rows` is the ledger as the fold holds it at the stop,\n * `toolResults` the state's batch at the same stop. Handed both by\n * `<ContextView>` from `contextAt(...).keys`, so the band moves with the ONE\n * cursor and never folds a second time.\n */\nimport React, { useMemo } from 'react';\n\n/** Every string this band owns — names for groups and fields, never a sentence. */\nexport const LABELS = Object.freeze({\n band: 'findings',\n rows: 'rows',\n facts: 'facts',\n /** The conflict ROWS — the history of when each was first seen, not the current set (see the header). */\n conflicts: 'conflicts first seen',\n open: 'open',\n ruledOut: 'ruled out',\n noise: 'noise',\n undeclared: 'undeclared',\n settles: 'settles',\n line: 'line',\n});\n\n// ─── The row shapes this band reads (narrowed, never trusted whole) ──────\n\ninterface SubjectShape {\n readonly kind: string;\n readonly id: string;\n}\n\n/** One assertion as the ledger carries it; `provenance` is the record's own `tool:<id>`. */\nexport interface AssertionShape {\n readonly subject: SubjectShape;\n readonly predicate: string;\n readonly value: unknown;\n readonly provenance?: string;\n}\n\n/** Where a standing was declared: on a later tool call (its id) or on the answer. */\nexport type DeclaredOnShape = { readonly toolCallId: string } | 'answer';\n\n/** A standing row, as read: the result judged, its standing, what it carries. */\nexport interface StandingShape {\n readonly toolCallId: string;\n readonly toolName?: string;\n readonly standing: string;\n readonly assertions: readonly AssertionShape[];\n readonly settles?: string;\n readonly line?: string;\n /** The placement ticket's ref when the judged result was placed (0.62.0). */\n readonly ref?: string;\n /** The model's own flag that this result was the one it was after (0.62.0). */\n readonly sought?: true;\n /** Where the row was declared, as the record spells it (0.62.0). */\n readonly declaredOn?: DeclaredOnShape;\n /** The declaring iteration (0.62.0). */\n readonly iteration?: number;\n /** Set by the library when the id named no result in the previous batch (0.62.0). */\n readonly unknownId?: true;\n}\n\nexport interface WitnessShape {\n readonly toolCallId: string;\n readonly subject: SubjectShape;\n readonly predicate: string;\n}\n\n/** A conflict row, as read: the shared key and the witnesses' identities. */\nexport interface ConflictShape {\n readonly key: string;\n readonly witnesses: readonly WitnessShape[];\n}\n\n/**\n * A witness as the band prints it: the row's identity plus `standing` — the\n * CURRENT standing of that result off the same fold (the last standing row\n * per `toolCallId`), the record's own word. Absent when no standing row\n * names the id; never inferred.\n */\nexport interface WitnessItem extends WitnessShape {\n readonly standing?: string;\n}\n\n/** One conflict row as the band prints it: the row's key, its witnesses stamped with where each stands now. */\nexport interface ConflictItem {\n readonly key: string;\n readonly witnesses: readonly WitnessItem[];\n}\n\nconst isRecord = (v: unknown): v is Record<string, unknown> => typeof v === 'object' && v !== null;\n\nfunction subjectOf(v: unknown): SubjectShape | undefined {\n if (!isRecord(v) || typeof v.kind !== 'string' || typeof v.id !== 'string') return undefined;\n return { kind: v.kind, id: v.id };\n}\n\nfunction assertionOf(v: unknown): AssertionShape | undefined {\n if (!isRecord(v) || typeof v.predicate !== 'string') return undefined;\n const subject = subjectOf(v.subject);\n if (subject === undefined) return undefined;\n return {\n subject,\n predicate: v.predicate,\n value: v.value,\n ...(typeof v.provenance === 'string' ? { provenance: v.provenance } : {}),\n };\n}\n\nfunction standingOf(row: unknown): StandingShape | undefined {\n if (!isRecord(row) || row.kind !== 'standing') return undefined;\n if (typeof row.toolCallId !== 'string' || typeof row.standing !== 'string') return undefined;\n const declaredOn = declaredOnOf(row.declaredOn);\n const assertions = Array.isArray(row.assertions)\n ? row.assertions.flatMap((a) => {\n const shaped = assertionOf(a);\n return shaped !== undefined ? [shaped] : [];\n })\n : [];\n return {\n toolCallId: row.toolCallId,\n standing: row.standing,\n assertions,\n ...(typeof row.toolName === 'string' ? { toolName: row.toolName } : {}),\n ...(typeof row.settles === 'string' ? { settles: row.settles } : {}),\n ...(typeof row.line === 'string' ? { line: row.line } : {}),\n ...(typeof row.ref === 'string' ? { ref: row.ref } : {}),\n ...(row.sought === true ? { sought: true } : {}),\n ...(declaredOn !== undefined ? { declaredOn } : {}),\n ...(typeof row.iteration === 'number' ? { iteration: row.iteration } : {}),\n ...(row.unknownId === true ? { unknownId: true } : {}),\n };\n}\n\n/** `declaredOn` as the record spells it: `'answer'` or `{ toolCallId }`; anything else is absent. */\nfunction declaredOnOf(v: unknown): DeclaredOnShape | undefined {\n if (v === 'answer') return 'answer';\n if (isRecord(v) && typeof v.toolCallId === 'string') return { toolCallId: v.toolCallId };\n return undefined;\n}\n\nfunction witnessOf(v: unknown): WitnessShape | undefined {\n if (!isRecord(v) || typeof v.toolCallId !== 'string' || typeof v.predicate !== 'string') return undefined;\n const subject = subjectOf(v.subject);\n if (subject === undefined) return undefined;\n return { toolCallId: v.toolCallId, subject, predicate: v.predicate };\n}\n\nfunction conflictOf(row: unknown): ConflictShape | undefined {\n if (!isRecord(row) || row.kind !== 'conflict' || typeof row.key !== 'string') return undefined;\n if (!Array.isArray(row.witnesses)) return undefined;\n const witnesses = row.witnesses.flatMap((w) => {\n const shaped = witnessOf(w);\n return shaped !== undefined ? [shaped] : [];\n });\n return { key: row.key, witnesses };\n}\n\n/** The `toolCallId` of one `toolResults` entry, when the entry carries one. */\nfunction resultIdOf(entry: unknown): string | undefined {\n return isRecord(entry) && typeof entry.toolCallId === 'string' ? entry.toolCallId : undefined;\n}\n\n// ─── The fold ─────────────────────────────────────────────────────────────\n\n/** One stood-on assertion with the result it was declared about. */\nexport interface FactItem {\n readonly toolCallId: string;\n readonly assertion: AssertionShape;\n}\n\nexport interface FindingsFold {\n /** How many rows the ledger holds at the stop — every kind, as committed. */\n readonly rows: number;\n /** The assertions of the CURRENT `fact` rows, in first-declared order. */\n readonly facts: readonly FactItem[];\n /**\n * Every `conflict` row on the record — the HISTORY of when each was first\n * seen, NOT the library's current set (`foldLedger(...).conflicts` is\n * recomputed from the current fact values; this fold does not re-derive\n * that algebra). Each witness carries the standing this fold holds for it\n * now, so a retired witness reads `ruled-out` here and in `ruledOut`.\n */\n readonly conflicts: readonly ConflictItem[];\n /** The current `open` rows. */\n readonly open: readonly StandingShape[];\n /** The current `ruled-out` rows. */\n readonly ruledOut: readonly StandingShape[];\n /** The ids of the results currently standing as `noise`. */\n readonly noise: readonly string[];\n /** The ids in `toolResults` with NO standing row — undeclared, never `open`. */\n readonly undeclared: readonly string[];\n /**\n * The CURRENT standing row per `toolCallId` — the last one written — in\n * first-declared order (0.62.0). The groups above are views of this map;\n * a reader that walks the calls one by one (`<ReasoningLens>`) asks it.\n */\n readonly standings: ReadonlyMap<string, StandingShape>;\n}\n\n/**\n * Fold the ledger's rows for reading. The LAST standing row per `toolCallId`\n * is the current one (the library's own rule); the conflict rows are kept AS\n * WRITTEN — the history of when each was first seen — with every witness\n * stamped with the standing this same fold holds for it now; a result in\n * `toolResults` no standing row names is undeclared. Pure; a row that does\n * not fit its kind's shape is passed over.\n */\nexport function foldFindings(rows: readonly unknown[], toolResults?: readonly unknown[]): FindingsFold {\n const standing = new Map<string, StandingShape>();\n const conflictRows: ConflictShape[] = [];\n for (const row of rows) {\n const s = standingOf(row);\n if (s !== undefined) {\n standing.set(s.toolCallId, s);\n continue;\n }\n const c = conflictOf(row);\n if (c !== undefined) conflictRows.push(c);\n }\n // Stamped AFTER the whole ledger is read: a witness's standing is the LAST\n // row about it, which may land after the conflict row that names it.\n const conflicts: ConflictItem[] = conflictRows.map((c) =>\n Object.freeze({\n key: c.key,\n witnesses: Object.freeze(\n c.witnesses.map((w) => {\n const now = standing.get(w.toolCallId)?.standing;\n return Object.freeze({ ...w, ...(now !== undefined ? { standing: now } : {}) });\n }),\n ),\n }),\n );\n const facts: FactItem[] = [];\n const open: StandingShape[] = [];\n const ruledOut: StandingShape[] = [];\n const noise: string[] = [];\n for (const s of standing.values()) {\n if (s.standing === 'fact') for (const assertion of s.assertions) facts.push({ toolCallId: s.toolCallId, assertion });\n else if (s.standing === 'open') open.push(s);\n else if (s.standing === 'ruled-out') ruledOut.push(s);\n else if (s.standing === 'noise') noise.push(s.toolCallId);\n }\n const undeclared: string[] = [];\n for (const entry of toolResults ?? []) {\n const id = resultIdOf(entry);\n if (id !== undefined && !standing.has(id)) undeclared.push(id);\n }\n return Object.freeze({\n rows: rows.length,\n facts: Object.freeze(facts),\n conflicts: Object.freeze(conflicts),\n open: Object.freeze(open),\n ruledOut: Object.freeze(ruledOut),\n noise: Object.freeze(noise),\n undeclared: Object.freeze(undeclared),\n standings: standing,\n });\n}\n\n// ─── The band ─────────────────────────────────────────────────────────────\n\nexport interface FindingsBandProps {\n /** The ledger as the fold holds it at the stop (`findingsLedger`). */\n readonly rows: readonly unknown[];\n /** The state's `toolResults` at the same stop — the batch whose undeclared results are listed. */\n readonly toolResults?: readonly unknown[];\n /** How the ledger key moved since the previous stop, when the host measured it. */\n readonly since?: 'entered' | 'changed' | 'unchanged';\n}\n\n/** A value as the record spells it: a string bare, anything else as JSON. */\nfunction valueText(value: unknown): string {\n if (typeof value === 'string') return value;\n return JSON.stringify(value) ?? String(value);\n}\n\nexport function FindingsBand(props: FindingsBandProps): React.ReactElement {\n const { rows, toolResults, since } = props;\n const fold = useMemo(() => foldFindings(rows, toolResults), [rows, toolResults]);\n return (\n <div style={band} data-testid=\"context-findings\" data-rows={fold.rows} data-since={since ?? ''}>\n <span style={dim}>\n {LABELS.band} · {fold.rows} {LABELS.rows}\n </span>\n {fold.facts.length > 0 && (\n <Group id=\"facts\" label={LABELS.facts} count={fold.facts.length}>\n {fold.facts.map((f, i) => (\n <li key={i} style={mono} data-testid=\"context-findings-fact\" data-tool-call-id={f.toolCallId}>\n <AssertionLine assertion={f.assertion} />\n {' ← '}\n <code>{f.assertion.provenance ?? f.toolCallId}</code>\n </li>\n ))}\n </Group>\n )}\n {fold.conflicts.length > 0 && (\n <Group id=\"conflicts\" label={LABELS.conflicts} count={fold.conflicts.length}>\n {fold.conflicts.map((c, i) => (\n <li key={i} style={mono} data-testid=\"context-findings-conflict\" data-key={c.key}>\n {c.witnesses.map((w, j) => (\n <div\n key={j}\n data-testid=\"context-findings-witness\"\n data-tool-call-id={w.toolCallId}\n data-standing={w.standing ?? ''}\n >\n <code>\n {w.subject.kind}/{w.subject.id}\n </code>\n {' · '}\n <code>{w.predicate}</code>\n {' ← '}\n <code>{w.toolCallId}</code>\n {w.standing !== undefined && (\n <>\n {' · '}\n <code>{w.standing}</code>\n </>\n )}\n </div>\n ))}\n </li>\n ))}\n </Group>\n )}\n {fold.open.length > 0 && (\n <Group id=\"open\" label={LABELS.open} count={fold.open.length}>\n {fold.open.map((s) => (\n <li key={s.toolCallId} style={mono} data-testid=\"context-findings-open-row\" data-tool-call-id={s.toolCallId}>\n <StandingHead standing={s} />\n {s.assertions.map((a, i) => (\n <div key={i}>\n <AssertionLine assertion={a} />\n </div>\n ))}\n {s.settles !== undefined && (\n <div>\n <span style={dim}>{LABELS.settles}</span>\n {' · '}\n {s.settles}\n </div>\n )}\n </li>\n ))}\n </Group>\n )}\n {fold.ruledOut.length > 0 && (\n <Group id=\"ruled-out\" label={LABELS.ruledOut} count={fold.ruledOut.length}>\n {fold.ruledOut.map((s) => (\n <li key={s.toolCallId} style={mono} data-testid=\"context-findings-ruled-out-row\" data-tool-call-id={s.toolCallId}>\n <StandingHead standing={s} />\n {s.line !== undefined && (\n <div>\n <span style={dim}>{LABELS.line}</span>\n {' · '}\n {s.line}\n </div>\n )}\n </li>\n ))}\n </Group>\n )}\n {fold.noise.length > 0 && (\n <Group id=\"noise\" label={LABELS.noise} count={fold.noise.length}>\n <li style={mono}>\n <IdList ids={fold.noise} testId=\"context-findings-noise-id\" />\n </li>\n </Group>\n )}\n {fold.undeclared.length > 0 && (\n <Group id=\"undeclared\" label={LABELS.undeclared} count={fold.undeclared.length}>\n <li style={mono}>\n <IdList ids={fold.undeclared} testId=\"context-findings-undeclared-id\" />\n </li>\n </Group>\n )}\n </div>\n );\n}\n\n/** One group: its label and count, then the items. Rendered only with items. */\nfunction Group({\n id,\n label,\n count,\n children,\n}: {\n readonly id: string;\n readonly label: string;\n readonly count: number;\n readonly children: React.ReactNode;\n}): React.ReactElement {\n return (\n <div data-testid={`context-findings-${id}`} data-count={count}>\n <span style={dim}>\n {label} · {count}\n </span>\n <ul style={list}>{children}</ul>\n </div>\n );\n}\n\n/** `kind/id · predicate = value` — the assertion's own parts. */\nfunction AssertionLine({ assertion }: { readonly assertion: AssertionShape }): React.ReactElement {\n return (\n <span data-testid=\"context-findings-assertion\">\n <code>\n {assertion.subject.kind}/{assertion.subject.id}\n </code>\n {' · '}\n <code>{assertion.predicate}</code>\n {' = '}\n <code>{valueText(assertion.value)}</code>\n </span>\n );\n}\n\n/** The result a standing is about: its id, and the tool name when the row carries it. */\nfunction StandingHead({ standing }: { readonly standing: StandingShape }): React.ReactElement {\n return (\n <div>\n <code>{standing.toolCallId}</code>\n {standing.toolName !== undefined && (\n <>\n {' · '}\n <code>{standing.toolName}</code>\n </>\n )}\n </div>\n );\n}\n\nfunction IdList({ ids, testId }: { readonly ids: readonly string[]; readonly testId: string }): React.ReactElement {\n return (\n <>\n {ids.map((id, i) => (\n <React.Fragment key={id}>\n {i > 0 && ' · '}\n <code data-testid={testId}>{id}</code>\n </React.Fragment>\n ))}\n </>\n );\n}\n\n// One-word CSS literals only: the own-claims walker reads every string.\nconst band: React.CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 4,\n paddingTop: 6,\n borderTop: '1px solid',\n borderTopColor: 'currentColor',\n};\nconst dim: React.CSSProperties = { opacity: 0.7 };\nconst mono: React.CSSProperties = {\n fontFamily: 'monospace',\n fontSize: 12,\n wordBreak: 'break-word',\n};\nconst list: React.CSSProperties = { margin: '2px 0 0', paddingLeft: 18 };\n","/**\n * <ReasoningLens> — the model's declared reasoning, before and after each\n * tool call, at the cursor (agentfootprint 9.103.0, `AgentState.findingsLedger`).\n *\n * WHY. The Findings band groups the ledger by STANDING — what the model\n * stands on, keeps open, ruled out. This lens reads the same fold the other\n * way round, BY CALL: one card per tool call in call order, each carrying\n * what the model declared before the call ran (its `basis` row: direct or\n * exploratory, what it expected, and — on a record that carries them — the\n * proposition it was testing and what it predicted), what the result was\n * (a placement ticket's ref and bytes, or the result's size in chars; and\n * whether the wire at the stop's epoch carried it collapsed to a ticket),\n * and what the model declared about the result afterwards (its CURRENT\n * standing — the last standing row per `toolCallId`, `FindingsBand.tsx ·\n * foldFindings`, reused not re-derived — with the assertions, the `settles`,\n * the `line`, and where the declaration landed). A trailing card for the\n * answer turn, once a standing was declared on the answer, counts the fold's\n * buckets under the served piece's own field names.\n *\n * THE LAWS THIS FILE KEEPS:\n *\n * 1. OMIT, NEVER DENY. The lens renders nothing at all when the fold at the\n * stop holds no `findingsLedger` (an unarmed run, or a stop before the\n * first declaration); a card prints no field the row does not carry; a\n * result no standing row names is UNDECLARED — that word, never `open`.\n * 2. NO SENTENCE OF ITS OWN. Every printed string is a value off the record\n * — a basis, a proposition, an assertion, a `settles`, a `line`, an id —\n * or a `LABELS` entry; `test/served/no-own-claims.test.ts` walks this file.\n * 3. ONE CURSOR. The view reads the fold at the stop it is handed — the\n * host's `cursor`, or the `shared` address read over this view's axis —\n * and holds no cursor of its own: with neither it reads the run's end,\n * stateless, and mounts no mover. Calls after the cursor are not drawn,\n * because the fold at the stop does not hold them yet.\n * 4. A SHAPE THE LENS DOES NOT OWN. Every row is narrowed by its shape\n * (`basisOf`, `standingOf` through `foldFindings`, `placedTicketOf`,\n * `collapsedTicketOf`) and a row that does not fit is passed over.\n *\n * `foldReasoning(...)` is the pure fold the lens renders — exported for a\n * consumer with its own UI. The card's `details` disclosure is a native\n * `<details>` element: the open/closed bit is the browser's, not a second\n * cursor.\n *\n * THE EXCHANGE VIEW (0.63.0). A second view of the SAME beats, laid out as\n * the exchange between the two parties — the model on the left, the tools on\n * the right — showing only what crossed the wire, as the JSON it was: per\n * tool call the model's emission with its `_findings` declaration (the\n * assistant message in `history` whose `toolCalls[]` carries the id — verbatim\n * by the record's law, never rebuilt from the ledger; when `history` no longer\n * carries it the ledger's basis row stands in, labelled `from ledger`), the\n * tool's result as the tool message holds it (a placement ticket drawn as the\n * ticket; the collapsed ticket the wire at the stop's epoch served instead,\n * when it did), the standing the next call declared for it (the cards'\n * AFTER, reused); then, at the answer epoch, what was served for the answer\n * turn (the served view's `source: 'findings'` piece, its `text` verbatim)\n * and the answer the model gave (`history`'s closing assistant message, else\n * `finalContent`, else `llmLatestContent` once `llmLatestToolCalls` is empty\n * — the record's own field named on the beat). The view toggle is React\n * state — it is not the cursor. `foldExchange(...)` is its pure fold.\n */\nimport React, { useMemo, useState } from 'react';\n\nimport { contextAt, type ContextAt } from '../../core/context/contextAt.js';\nimport type { LensCursor } from '../../core/cursor/lensCursor.js';\nimport { lensCursorFrom } from '../../core/cursor/lensCursor.js';\nimport type { CursorPosition } from '../../core/group/cursorPositionsAtDrill.js';\nimport { scrubAxisFor } from '../../core/group/scrubAxisFor.js';\nimport type { LensRecorder } from '../../core/LensRecorder.js';\nimport { tagAxisPositions } from '../../core/tags/tagAxis.js';\nimport type { EventLogEntry } from '../../core/types.js';\nimport { snapshotLogKey, snapshotOfRunner } from '../../core/utils/snapshotOfRunner.js';\nimport { T } from '../theme/index.js';\nimport { TimeTravel } from '../TimeTravel.js';\nimport type { SharedCursor } from '../useSharedCursor.js';\nimport { MILESTONE_AXIS } from './ContextView.js';\nimport { foldFindings, type AssertionShape, type FindingsFold, type StandingShape } from './FindingsBand.js';\nimport { collapsedTicketOf } from './ServedTab.js';\n\n/** Every string this lens owns — names for fields and chips, never a sentence. */\nexport const LABELS = Object.freeze({\n lens: 'Reasoning',\n calls: 'calls',\n iteration: 'iteration',\n basis: 'basis',\n expect: 'expect',\n malformed: 'malformed',\n /** The `proposition` field — what the model said it was testing. */\n tested: 'tested',\n predicts: 'predicts',\n result: 'result',\n chars: 'chars',\n bytes: 'bytes',\n ref: 'ref',\n placed: 'placed',\n collapsed: 'collapsed',\n standing: 'standing',\n undeclared: 'undeclared',\n sought: 'sought',\n settles: 'settles',\n line: 'line',\n declaredOn: 'declared on',\n unknownId: 'unknown id',\n conflict: 'conflict',\n details: 'details',\n assertions: 'assertions',\n ticket: 'ticket',\n answer: 'answer',\n facts: 'facts',\n limitations: 'limitations',\n evidenceRefs: 'evidenceRefs',\n nextSteps: 'nextSteps',\n noise: 'noise',\n serve: 'serve',\n answerAsk: 'answer ask',\n /** The exchange view (0.63.0). */\n view: 'view',\n cards: 'cards',\n exchange: 'exchange',\n model: 'model',\n tool: 'tool',\n call: 'call',\n served: 'served',\n args: 'args',\n findings: '_findings',\n fromLedger: 'from ledger',\n lines: 'lines',\n});\n\n// ─── The row shapes this lens reads beyond the band's ────────────────────\n\nconst isRecord = (v: unknown): v is Record<string, unknown> => typeof v === 'object' && v !== null;\n\n/** A basis row, as read: what the model declared BEFORE the call ran. */\nexport interface BasisShape {\n readonly toolCallId: string;\n readonly toolName?: string;\n readonly iteration?: number;\n readonly basis: string;\n readonly expect?: string;\n readonly malformed?: number;\n /** What the model said it was testing (a record that carries it). */\n readonly proposition?: string;\n /** What the model said the result would show (a record that carries it). */\n readonly predicts?: string;\n}\n\nfunction basisOf(row: unknown): BasisShape | undefined {\n if (!isRecord(row) || row.kind !== 'basis') return undefined;\n if (typeof row.toolCallId !== 'string' || typeof row.basis !== 'string') return undefined;\n return {\n toolCallId: row.toolCallId,\n basis: row.basis,\n ...(typeof row.toolName === 'string' ? { toolName: row.toolName } : {}),\n ...(typeof row.iteration === 'number' ? { iteration: row.iteration } : {}),\n ...(typeof row.expect === 'string' ? { expect: row.expect } : {}),\n ...(typeof row.malformed === 'number' ? { malformed: row.malformed } : {}),\n ...(typeof row.proposition === 'string' ? { proposition: row.proposition } : {}),\n ...(typeof row.predicts === 'string' ? { predicts: row.predicts } : {}),\n };\n}\n\n/** A placement ticket (`PlacedToolResult`): the ref and the stored size, read by shape. */\nexport interface PlacedShape {\n readonly ref: string;\n readonly bytes?: number;\n readonly kind?: string;\n}\n\nfunction placedTicketOf(value: unknown): PlacedShape | undefined {\n let v: unknown = value;\n if (typeof v === 'string' && v.startsWith('{')) {\n try {\n v = JSON.parse(v);\n } catch {\n return undefined;\n }\n }\n if (!isRecord(v) || v.placed !== true || typeof v.ref !== 'string') return undefined;\n return {\n ref: v.ref,\n ...(typeof v.bytes === 'number' ? { bytes: v.bytes } : {}),\n ...(typeof v.kind === 'string' ? { kind: v.kind } : {}),\n };\n}\n\n/** The result as the lens can size it: a ticket, or the chars the record holds. */\nexport type ResultShape = { readonly placed: PlacedShape } | { readonly chars: number };\n\nfunction resultShapeOf(value: unknown): ResultShape {\n const placed = placedTicketOf(value);\n if (placed !== undefined) return { placed };\n const text = typeof value === 'string' ? value : (JSON.stringify(value) ?? '');\n return { chars: text.length };\n}\n\n/** The tool results on the record by id: `history`'s `role: 'tool'` messages, then the batch. */\nfunction resultsById(history: readonly unknown[] | undefined, toolResults: readonly unknown[] | undefined): ReadonlyMap<string, unknown> {\n const out = new Map<string, unknown>();\n for (const m of history ?? []) {\n if (isRecord(m) && m.role === 'tool' && typeof m.toolCallId === 'string' && !out.has(m.toolCallId)) out.set(m.toolCallId, m.content);\n }\n for (const r of toolResults ?? []) {\n if (isRecord(r) && typeof r.toolCallId === 'string' && !out.has(r.toolCallId)) out.set(r.toolCallId, r.result);\n }\n return out;\n}\n\n/** A collapsed ticket as the wire carried it: the standing, and the content string itself. */\nexport interface CollapsedShape {\n readonly standing: string;\n readonly content: string;\n}\n\n/** The collapsed tickets on the wire at the epoch, by the result's id. */\nfunction collapsedById(asSent: readonly unknown[] | undefined): ReadonlyMap<string, CollapsedShape> {\n const out = new Map<string, CollapsedShape>();\n for (const m of asSent ?? []) {\n if (!isRecord(m) || m.role !== 'tool' || typeof m.content !== 'string') continue;\n const t = collapsedTicketOf(m.content);\n if (t !== undefined) out.set(t.toolCallId, { standing: t.standing, content: m.content });\n }\n return out;\n}\n\n// ─── The fold ─────────────────────────────────────────────────────────────\n\n/** One tool call as the lens draws it: before, result, after. */\nexport interface ReasoningCard {\n readonly toolCallId: string;\n readonly before: BasisShape;\n /** The result as the record holds it; absent when no result names the id. */\n readonly result?: ResultShape;\n /** The standing the wire at the epoch collapsed this result under; absent when served verbatim. */\n readonly collapsed?: string;\n /** The CURRENT standing row about this result; absent = undeclared. */\n readonly after?: StandingShape;\n /** The keys of the conflict rows naming this result as a witness. */\n readonly conflicts: readonly string[];\n}\n\n/** The answer turn's card: the fold's buckets under the served piece's field names. */\nexport interface AnswerCard {\n readonly facts: number;\n readonly limitations: number;\n readonly evidenceRefs: number;\n readonly nextSteps: number;\n readonly noise: number;\n readonly undeclared: number;\n /** The run constant `findingsServe`, when the record carries it. */\n readonly serve?: string;\n /** The run constant `findingsAnswerAsk`, when the record carries it. */\n readonly answerAsk?: unknown;\n}\n\nexport interface ReasoningFold {\n readonly cards: readonly ReasoningCard[];\n /** Present once a standing row was declared on the answer. */\n readonly answer?: AnswerCard;\n /** The band's own fold, which this one stands on. */\n readonly findings: FindingsFold;\n}\n\nexport interface ReasoningInput {\n /** The ledger as the fold holds it at the stop (`findingsLedger`). */\n readonly rows: readonly unknown[];\n /** The state's `toolResults` at the same stop. */\n readonly toolResults?: readonly unknown[];\n /** The state's `history` at the same stop — the tool messages hold every result. */\n readonly history?: readonly unknown[];\n /** The served wire at the stop's epoch (`messages.asSent`), for the collapsed tickets. */\n readonly asSent?: readonly unknown[];\n readonly findingsServe?: unknown;\n readonly findingsAnswerAsk?: unknown;\n /** The served view's `system.pieces` at the stop's epoch (0.63.0, the exchange's served beat). */\n readonly pieces?: readonly unknown[];\n /** The state's `finalContent` at the stop (0.63.0, the answer beat). */\n readonly finalContent?: unknown;\n /** The state's `llmLatestContent` / `llmLatestToolCalls` at the stop (0.63.0, the answer beat). */\n readonly llmLatestContent?: unknown;\n readonly llmLatestToolCalls?: unknown;\n}\n\n/**\n * Fold the ledger BY CALL. The basis rows give the calls in call order (the\n * ledger is append-only, a basis row lands before its call runs); the\n * standings come from `foldFindings` — the LAST standing row per result is\n * the current one — and every other fact is looked up by the result's id.\n * Pure; a row that does not fit its kind's shape is passed over.\n */\nexport function foldReasoning(input: ReasoningInput): ReasoningFold {\n const findings = foldFindings(input.rows, input.toolResults);\n const results = resultsById(input.history, input.toolResults);\n const collapsed = collapsedById(input.asSent);\n const witnessed = new Map<string, string[]>();\n for (const c of findings.conflicts) {\n for (const w of c.witnesses) {\n const keys = witnessed.get(w.toolCallId) ?? [];\n keys.push(c.key);\n witnessed.set(w.toolCallId, keys);\n }\n }\n const seen = new Set<string>();\n const cards: ReasoningCard[] = [];\n for (const row of input.rows) {\n const before = basisOf(row);\n if (before === undefined || seen.has(before.toolCallId)) continue;\n seen.add(before.toolCallId);\n const id = before.toolCallId;\n const after = findings.standings.get(id);\n const onWire = collapsed.get(id);\n cards.push(\n Object.freeze({\n toolCallId: id,\n before,\n ...(results.has(id) ? { result: resultShapeOf(results.get(id)) } : {}),\n ...(onWire !== undefined ? { collapsed: onWire.standing } : {}),\n ...(after !== undefined ? { after } : {}),\n conflicts: Object.freeze(witnessed.get(id) ?? []),\n }),\n );\n }\n const answered = Array.from(findings.standings.values()).some((s) => s.declaredOn === 'answer');\n const answer: AnswerCard | undefined = answered\n ? Object.freeze({\n facts: findings.facts.length,\n limitations: findings.ruledOut.length,\n evidenceRefs: findings.open.length,\n nextSteps: findings.open.filter((s) => s.settles !== undefined).length,\n noise: findings.noise.length,\n undeclared: findings.undeclared.length,\n ...(typeof input.findingsServe === 'string' ? { serve: input.findingsServe } : {}),\n ...(input.findingsAnswerAsk !== undefined ? { answerAsk: input.findingsAnswerAsk } : {}),\n })\n : undefined;\n return Object.freeze({\n cards: Object.freeze(cards),\n ...(answer !== undefined ? { answer } : {}),\n findings,\n });\n}\n\n// ─── The exchange fold (0.63.0) ───────────────────────────────────────────\n\n/** The emission as the assistant message in `history` carries it: `toolCalls[i]`. */\nexport interface EmittedCallShape {\n readonly id: string;\n readonly name?: string;\n readonly args?: Record<string, unknown>;\n}\n\n/** The tool calls the record's assistant messages emitted, by id, first message wins. */\nfunction emittedById(history: readonly unknown[] | undefined): ReadonlyMap<string, EmittedCallShape> {\n const out = new Map<string, EmittedCallShape>();\n for (const m of history ?? []) {\n if (!isRecord(m) || m.role !== 'assistant' || !Array.isArray(m.toolCalls)) continue;\n for (const c of m.toolCalls) {\n if (!isRecord(c) || typeof c.id !== 'string' || out.has(c.id)) continue;\n out.set(c.id, {\n id: c.id,\n ...(typeof c.name === 'string' ? { name: c.name } : {}),\n ...(isRecord(c.args) ? { args: c.args } : {}),\n });\n }\n }\n return out;\n}\n\n/** The model's beat for one call: the emission, split into its `_findings` block and the rest. */\nexport interface CallBeat {\n readonly kind: 'call';\n readonly side: 'model';\n readonly toolCallId: string;\n readonly toolName?: string;\n /** `args._findings` as emitted — or, `fromLedger`, the basis row's own declaration. */\n readonly findings?: unknown;\n /** The remaining args as emitted; absent when the emission is not on the record. */\n readonly args?: Record<string, unknown>;\n /** `history` no longer carries the emission; the ledger's basis row stands in. */\n readonly fromLedger: boolean;\n}\n\n/** The tool's beat for one call: the result as the tool message holds it, and what the wire served instead. */\nexport interface ResultBeat {\n readonly kind: 'result';\n readonly side: 'tool';\n readonly toolCallId: string;\n readonly toolName?: string;\n /** The content as the record holds it (a string, or the batch's value). */\n readonly content: unknown;\n /** The placement ticket, when the content is one. */\n readonly placed?: PlacedShape;\n /** The ticket the wire at the stop's epoch carried in place of this result. */\n readonly collapsed?: CollapsedShape;\n /** The standing a later call (or the answer) declared for it — the cards' AFTER. */\n readonly after?: StandingShape;\n}\n\n/** What was served for the answer turn: the `source: 'findings'` piece, its text verbatim. */\nexport interface ServedBeat {\n readonly kind: 'served';\n readonly side: 'model';\n readonly source: string;\n readonly text: string;\n}\n\n/** The answer the model gave, and which field of the record holds it. */\nexport interface AnswerBeat {\n readonly kind: 'answer';\n readonly side: 'model';\n readonly text: string;\n readonly from: 'history' | 'finalContent' | 'llmLatestContent';\n}\n\nexport type ExchangeBeat = CallBeat | ResultBeat | ServedBeat | AnswerBeat;\n\nexport interface ExchangeFold {\n readonly beats: readonly ExchangeBeat[];\n /** The cards' fold, which this one stands on. */\n readonly reasoning: ReasoningFold;\n}\n\n/** The basis row's declaration as the ledger spells it, for a call `history` no longer carries. */\nfunction ledgerFindings(before: BasisShape): Record<string, unknown> {\n return {\n basis: before.basis,\n ...(before.expect !== undefined ? { expect: before.expect } : {}),\n ...(before.proposition !== undefined ? { proposition: before.proposition } : {}),\n ...(before.predicts !== undefined ? { predicts: before.predicts } : {}),\n };\n}\n\nfunction callBeatOf(card: ReasoningCard, emitted: ReadonlyMap<string, EmittedCallShape>): CallBeat {\n const id = card.toolCallId;\n const e = emitted.get(id);\n const toolName = e?.name ?? card.before.toolName;\n if (e === undefined) {\n return Object.freeze({\n kind: 'call',\n side: 'model',\n toolCallId: id,\n ...(toolName !== undefined ? { toolName } : {}),\n findings: ledgerFindings(card.before),\n fromLedger: true,\n });\n }\n const { _findings, ...rest } = e.args ?? {};\n return Object.freeze({\n kind: 'call',\n side: 'model',\n toolCallId: id,\n ...(toolName !== undefined ? { toolName } : {}),\n ...(_findings !== undefined ? { findings: _findings } : {}),\n ...(e.args !== undefined ? { args: Object.freeze(rest) } : {}),\n fromLedger: false,\n });\n}\n\nfunction resultBeatOf(card: ReasoningCard, content: unknown, collapsed: CollapsedShape | undefined, toolName: string | undefined): ResultBeat {\n const placed = placedTicketOf(content);\n return Object.freeze({\n kind: 'result',\n side: 'tool',\n toolCallId: card.toolCallId,\n ...(toolName !== undefined ? { toolName } : {}),\n content,\n ...(placed !== undefined ? { placed } : {}),\n ...(collapsed !== undefined ? { collapsed } : {}),\n ...(card.after !== undefined ? { after: card.after } : {}),\n });\n}\n\n/** The served view's first `source: 'findings'` piece, read by shape. */\nfunction findingsPieceOf(pieces: readonly unknown[] | undefined): ServedBeat | undefined {\n for (const p of pieces ?? []) {\n if (!isRecord(p) || p.source !== 'findings' || typeof p.text !== 'string') continue;\n return Object.freeze({ kind: 'served', side: 'model', source: p.source, text: p.text });\n }\n return undefined;\n}\n\nconst nonEmpty = (v: unknown): v is string => typeof v === 'string' && v.length > 0;\n\n/**\n * The answer as the record holds it: `history`'s closing assistant message\n * (content, no tool calls, after the last tool message), else `finalContent`,\n * else `llmLatestContent` once `llmLatestToolCalls` carries no call. Absent\n * when none of the three holds one — the run has not answered at the stop.\n */\nfunction answerOf(input: ReasoningInput): AnswerBeat | undefined {\n const history = input.history ?? [];\n const last = history[history.length - 1];\n if (isRecord(last) && last.role === 'assistant' && nonEmpty(last.content) && (!Array.isArray(last.toolCalls) || last.toolCalls.length === 0)) {\n return Object.freeze({ kind: 'answer', side: 'model', text: last.content, from: 'history' });\n }\n if (nonEmpty(input.finalContent)) return Object.freeze({ kind: 'answer', side: 'model', text: input.finalContent, from: 'finalContent' });\n const calls = input.llmLatestToolCalls;\n if (nonEmpty(input.llmLatestContent) && (!Array.isArray(calls) || calls.length === 0)) {\n return Object.freeze({ kind: 'answer', side: 'model', text: input.llmLatestContent, from: 'llmLatestContent' });\n }\n return undefined;\n}\n\n/**\n * Fold the exchange, in wire order per call: the model's emission, the tool's\n * result; then what was served for the answer turn and the answer. Stands on\n * `foldReasoning` (the calls, the standings, the wire's tickets) and looks the\n * emission up in `history` by id. Pure; a beat prints only what its row holds.\n */\nexport function foldExchange(input: ReasoningInput): ExchangeFold {\n const reasoning = foldReasoning(input);\n const emitted = emittedById(input.history);\n const results = resultsById(input.history, input.toolResults);\n const collapsed = collapsedById(input.asSent);\n const beats: ExchangeBeat[] = [];\n for (const card of reasoning.cards) {\n const call = callBeatOf(card, emitted);\n beats.push(call);\n if (results.has(card.toolCallId)) beats.push(resultBeatOf(card, results.get(card.toolCallId), collapsed.get(card.toolCallId), call.toolName));\n }\n const served = findingsPieceOf(input.pieces);\n if (served !== undefined) beats.push(served);\n const answer = answerOf(input);\n if (answer !== undefined) beats.push(answer);\n return Object.freeze({ beats: Object.freeze(beats), reasoning });\n}\n\n// ─── The lens ─────────────────────────────────────────────────────────────\n\nexport interface ReasoningLensProps {\n /** The recording or a runner with `getLastSnapshot()` — the same input the Context view takes. */\n readonly runner: unknown;\n /** THE cursor, when a host holds it per axis. */\n readonly cursor?: LensCursor;\n /**\n * The HOST's one cursor across every lens it mounts (`useSharedCursor`).\n * Read over the recorder's grouped axis when `recorder` is given, else\n * over the milestone axis read off the snapshot. `cursor` wins when supplied.\n * With neither, the lens reads the run's END — stateless, no mover.\n */\n readonly shared?: SharedCursor;\n /** The recorder whose grouped axis a `shared` view reads. */\n readonly recorder?: LensRecorder;\n /** The recording's event stream, handed to `contextAt` (a replay's `getEntries()`). */\n readonly events?: readonly EventLogEntry[];\n /** The view the lens opens on (0.63.0); the toggle is React state, not the cursor. */\n readonly defaultView?: ReasoningView;\n}\n\n/** The two views of the same beats: the cards, or the exchange between model and tools. */\nexport type ReasoningView = 'cards' | 'exchange';\n\nfunction positionsOf(snapshot: unknown): readonly CursorPosition[] {\n return tagAxisPositions(snapshot, MILESTONE_AXIS, []) ?? [];\n}\n\nconst noMove = (): void => undefined;\n\n/** The value of one top-level key of the fold at the stop, when it holds one. */\nfunction keyValue(context: ContextAt, path: string): unknown {\n return context.keys.find((k) => k.path === path)?.value;\n}\n\nfunction arrayValue(context: ContextAt, path: string): readonly unknown[] | undefined {\n const v = keyValue(context, path);\n return Array.isArray(v) ? v : undefined;\n}\n\nexport function ReasoningLens(props: ReasoningLensProps): React.ReactElement | null {\n const { runner, events, shared, recorder } = props;\n const [view, setView] = useState<ReasoningView>(props.defaultView ?? 'cards');\n const fresh = snapshotOfRunner(runner);\n const logKey = snapshotLogKey(fresh);\n const snapshot = useMemo(() => fresh, [runner, logKey]);\n const ownPositions = useMemo(\n () =>\n props.cursor !== undefined\n ? undefined\n : recorder !== undefined\n ? scrubAxisFor(recorder, 'group')\n : positionsOf(snapshot),\n // eslint-disable-next-line react-hooks/exhaustive-deps -- the recorder's axis moves with the log key\n [snapshot, props.cursor, recorder, logKey],\n );\n // ONE cursor: the host's per-axis reading, else the shared address read\n // over this view's axis, else the run's END — a reading, never a state.\n const positions = ownPositions ?? [];\n const cursor: LensCursor =\n props.cursor ??\n (shared !== undefined ? shared.over(positions) : lensCursorFrom(positions, Math.max(0, positions.length - 1), noMove));\n\n const context = useMemo(\n () => contextAt(snapshot, { runtimeStageId: cursor.at.runtimeStageId, commitIdx: cursor.at.commitIdx }, { events }),\n [snapshot, cursor.at.runtimeStageId, cursor.at.commitIdx, events],\n );\n const rows = arrayValue(context, 'findingsLedger');\n const exchange = useMemo(() => {\n if (rows === undefined) return undefined;\n const toolResults = arrayValue(context, 'toolResults');\n const history = arrayValue(context, 'history');\n const wire = context.served?.row.view.messages.asSent;\n const pieces = context.served?.row.view.system.pieces;\n return foldExchange({\n rows,\n ...(toolResults !== undefined ? { toolResults } : {}),\n ...(history !== undefined ? { history } : {}),\n ...(Array.isArray(wire) ? { asSent: wire } : {}),\n ...(Array.isArray(pieces) ? { pieces } : {}),\n findingsServe: keyValue(context, 'findingsServe'),\n findingsAnswerAsk: keyValue(context, 'findingsAnswerAsk'),\n finalContent: keyValue(context, 'finalContent'),\n llmLatestContent: keyValue(context, 'llmLatestContent'),\n llmLatestToolCalls: keyValue(context, 'llmLatestToolCalls'),\n });\n }, [context, rows]);\n\n // THE transport (0.63.1): the same component the Lens, the Skill Graph and\n // the Context view mount, moving the same address through the same funnel.\n // It belongs here when the cursor is the shared address — a per-axis\n // `cursor` from a slot brings the host's mover — and only while the address\n // stands on this axis (a transport lit at stop 0 would claim a position).\n // A run with no ledger yet at the end draws nothing, transport included.\n const mover = props.cursor === undefined && shared !== undefined && cursor.total > 0 && cursor.at.step >= 0;\n\n // Omit, never deny: no ledger at the stop, nothing drawn.\n if (exchange === undefined) return null;\n const fold = exchange.reasoning;\n return (\n <div\n style={panel}\n data-testid=\"reasoning-lens\"\n data-step={cursor.at.step}\n data-commit={cursor.at.commitIdx}\n data-calls={fold.cards.length}\n data-view={view}\n >\n <div style={header}>\n <span style={title}>{LABELS.lens}</span>\n <span style={dim}>\n {fold.cards.length} {LABELS.calls}\n </span>\n <ViewToggle view={view} onView={setView} />\n </div>\n {mover && (\n <div data-testid=\"reasoning-transport\">\n <TimeTravel\n total={cursor.total}\n focusSeq={Math.max(0, cursor.at.step)}\n onFocusChange={(n) => cursor.moveTo(n)}\n isLive={false}\n compact\n />\n </div>\n )}\n {view === 'cards' && (\n <div style={column} data-testid=\"reasoning-cards\">\n {fold.cards.map((card) => (\n <Card key={card.toolCallId} card={card} />\n ))}\n {fold.answer !== undefined && <Answer answer={fold.answer} />}\n </div>\n )}\n {view === 'exchange' && <Exchange beats={exchange.beats} />}\n </div>\n );\n}\n\n/**\n * The cards ⇄ exchange toggle: two real buttons in a `tablist`, so the\n * keyboard reaches them and the focus ring is the platform's own (the\n * Served tab's list ⇄ graph toggle, the same shape).\n */\nfunction ViewToggle({ view, onView }: { readonly view: ReasoningView; readonly onView: (view: ReasoningView) => void }): React.ReactElement {\n const button = (value: ReasoningView, label: string) => (\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={view === value}\n data-testid={`reasoning-view-${value}`}\n style={toggleButton(view === value)}\n onClick={() => onView(value)}\n >\n {label}\n </button>\n );\n return (\n <span role=\"tablist\" aria-label={LABELS.view} style={toggleRow} data-testid=\"reasoning-view-toggle\">\n {button('cards', LABELS.cards)}\n {button('exchange', LABELS.exchange)}\n </span>\n );\n}\n\n// ─── One card ─────────────────────────────────────────────────────────────\n\nconst SHORT_ID = 12;\n\nfunction Card({ card }: { readonly card: ReasoningCard }): React.ReactElement {\n const { before, after } = card;\n const id = card.toolCallId;\n const standing = after?.standing;\n return (\n <div\n style={cardStyle}\n data-testid=\"reasoning-card\"\n data-tool-call-id={id}\n data-basis={before.basis}\n data-standing={standing ?? LABELS.undeclared}\n >\n <div style={row}>\n {before.toolName !== undefined && <code style={strong}>{before.toolName}</code>}\n <code title={id} style={mono} data-testid=\"reasoning-card-id\">\n {id.length > SHORT_ID ? `${id.slice(0, SHORT_ID)}…` : id}\n </code>\n {before.iteration !== undefined && (\n <span style={dim}>\n {LABELS.iteration} {before.iteration}\n </span>\n )}\n <Chip testId=\"reasoning-basis\" color={T.primary}>\n {before.basis}\n </Chip>\n {before.expect !== undefined && (\n <Chip testId=\"reasoning-expect\" color={T.textMuted}>\n {LABELS.expect} {before.expect}\n </Chip>\n )}\n {before.malformed !== undefined && (\n <Chip testId=\"reasoning-malformed\" color={T.warning}>\n {LABELS.malformed} {before.malformed}\n </Chip>\n )}\n {card.conflicts.map((key) => (\n <Chip key={key} testId=\"reasoning-conflict\" color={T.error} title={key}>\n {LABELS.conflict}\n </Chip>\n ))}\n </div>\n <Before before={before} />\n <div style={row} data-testid=\"reasoning-after\">\n <span style={dim}>{LABELS.standing}</span>\n <Chip testId=\"reasoning-standing\" color={standing !== undefined ? standingColor(standing) : T.textMuted}>\n {standing ?? LABELS.undeclared}\n </Chip>\n {after?.sought === true && (\n <Chip testId=\"reasoning-sought\" color={T.textMuted}>\n {LABELS.sought}\n </Chip>\n )}\n {after?.unknownId === true && (\n <Chip testId=\"reasoning-unknown-id\" color={T.warning}>\n {LABELS.unknownId}\n </Chip>\n )}\n {card.collapsed !== undefined && (\n <Chip testId=\"reasoning-collapsed\" color={T.textMuted} title={card.collapsed}>\n {LABELS.collapsed}\n </Chip>\n )}\n {after?.declaredOn !== undefined && (\n <span style={dim} data-testid=\"reasoning-declared-on\">\n {LABELS.declaredOn} <code style={mono}>{after.declaredOn === 'answer' ? after.declaredOn : after.declaredOn.toolCallId}</code>\n </span>\n )}\n </div>\n {after !== undefined && <QuotedLine after={after} />}\n <details style={detailsStyle} data-testid=\"reasoning-details\">\n <summary style={summaryStyle}>{LABELS.details}</summary>\n <Details card={card} />\n </details>\n </div>\n );\n}\n\n/** What the model declared BEFORE the call, when the row carries it — else nothing. */\nfunction Before({ before }: { readonly before: BasisShape }): React.ReactElement | null {\n if (before.proposition === undefined && before.predicts === undefined) return null;\n return (\n <div style={mono} data-testid=\"reasoning-before\">\n {before.proposition !== undefined && (\n <div data-testid=\"reasoning-proposition\">\n <span style={dim}>{LABELS.tested}</span> <q>{before.proposition}</q>\n </div>\n )}\n {before.predicts !== undefined && (\n <div data-testid=\"reasoning-predicts\">\n <span style={dim}>{LABELS.predicts}</span> <q>{before.predicts}</q>\n </div>\n )}\n </div>\n );\n}\n\n/** The ONE line the simple view quotes: the first assertion, the `settles`, or the `line`. */\nfunction QuotedLine({ after }: { readonly after: StandingShape }): React.ReactElement | null {\n const first = after.assertions[0];\n if (after.standing === 'fact' && first !== undefined) {\n return (\n <div style={mono} data-testid=\"reasoning-line\">\n <AssertionText assertion={first} />\n </div>\n );\n }\n if (after.settles !== undefined) {\n return (\n <div style={mono} data-testid=\"reasoning-line\">\n <span style={dim}>{LABELS.settles}</span> <q>{after.settles}</q>\n </div>\n );\n }\n if (after.line !== undefined) {\n return (\n <div style={mono} data-testid=\"reasoning-line\">\n <span style={dim}>{LABELS.line}</span> <q>{after.line}</q>\n </div>\n );\n }\n return null;\n}\n\n/** The disclosure: every assertion, the full ids, the result's size, the ticket on the wire. */\nfunction Details({ card }: { readonly card: ReasoningCard }): React.ReactElement {\n const { after } = card;\n return (\n <div style={{ ...mono, ...detailsBody }}>\n <div>\n <code>{card.toolCallId}</code>\n </div>\n {card.result !== undefined && <ResultLine result={card.result} />}\n {after?.ref !== undefined && (\n <div>\n <span style={dim}>{LABELS.ref}</span> <code>{after.ref}</code>\n </div>\n )}\n {card.collapsed !== undefined && (\n <div data-testid=\"reasoning-ticket\">\n <span style={dim}>{LABELS.ticket}</span> <code>{card.collapsed}</code>\n </div>\n )}\n {after !== undefined && after.assertions.length > 0 && (\n <div>\n <span style={dim}>\n {LABELS.assertions} · {after.assertions.length}\n </span>\n <ul style={list}>\n {after.assertions.map((a, i) => (\n <li key={i} data-testid=\"reasoning-assertion\">\n <AssertionText assertion={a} />\n </li>\n ))}\n </ul>\n </div>\n )}\n {after?.settles !== undefined && (\n <div>\n <span style={dim}>{LABELS.settles}</span> <q>{after.settles}</q>\n </div>\n )}\n {after?.line !== undefined && (\n <div>\n <span style={dim}>{LABELS.line}</span> <q>{after.line}</q>\n </div>\n )}\n </div>\n );\n}\n\n/** The result as the record sizes it: the ticket's ref and bytes, or the chars held. */\nfunction ResultLine({ result }: { readonly result: ResultShape }): React.ReactElement {\n if ('placed' in result) {\n return (\n <div data-testid=\"reasoning-result\" data-placed=\"true\">\n <span style={dim}>{LABELS.placed}</span> <code>{result.placed.ref}</code>\n {result.placed.bytes !== undefined && (\n <span style={dim}>\n {' '}\n · {result.placed.bytes} {LABELS.bytes}\n </span>\n )}\n </div>\n );\n }\n return (\n <div data-testid=\"reasoning-result\" data-chars={result.chars}>\n <span style={dim}>{LABELS.result}</span> {result.chars} {LABELS.chars}\n </div>\n );\n}\n\n/** `kind/id · predicate = value` — the assertion's own parts. */\nfunction AssertionText({ assertion }: { readonly assertion: AssertionShape }): React.ReactElement {\n return (\n <span>\n <code>\n {assertion.subject.kind}/{assertion.subject.id}\n </code>\n {' · '}\n <code>{assertion.predicate}</code>\n {' = '}\n <code>{valueText(assertion.value)}</code>\n </span>\n );\n}\n\n/** A value as the record spells it: a string bare, anything else as JSON. */\nfunction valueText(value: unknown): string {\n if (typeof value === 'string') return value;\n return JSON.stringify(value) ?? String(value);\n}\n\n// ─── The answer card ──────────────────────────────────────────────────────\n\nfunction Answer({ answer }: { readonly answer: AnswerCard }): React.ReactElement {\n const counts: readonly (readonly [string, number])[] = [\n [LABELS.facts, answer.facts],\n [LABELS.limitations, answer.limitations],\n [LABELS.evidenceRefs, answer.evidenceRefs],\n [LABELS.nextSteps, answer.nextSteps],\n [LABELS.noise, answer.noise],\n [LABELS.undeclared, answer.undeclared],\n ];\n return (\n <div style={cardStyle} data-testid=\"reasoning-answer\" data-answer-ask={answer.answerAsk === undefined ? '' : String(answer.answerAsk)}>\n <div style={row}>\n <span style={strong}>{LABELS.answer}</span>\n {answer.serve !== undefined && (\n <Chip testId=\"reasoning-serve\" color={T.textMuted}>\n {LABELS.serve} {answer.serve}\n </Chip>\n )}\n {answer.answerAsk !== undefined && (\n <Chip testId=\"reasoning-answer-ask\" color={T.textMuted}>\n {LABELS.answerAsk} {valueText(answer.answerAsk)}\n </Chip>\n )}\n </div>\n <div style={{ ...row, ...mono }}>\n {counts.map(([label, n]) => (\n <span key={label} data-testid=\"reasoning-count\" data-bucket={label} data-count={n}>\n <span style={dim}>{label}</span> {n}\n </span>\n ))}\n </div>\n </div>\n );\n}\n\n// ─── The exchange view (0.63.0) ───────────────────────────────────────────\n\n/** The beats in wire order, the model's on the left and the tools' on the right. */\nfunction Exchange({ beats }: { readonly beats: readonly ExchangeBeat[] }): React.ReactElement {\n return (\n <div style={exchangeStyle} data-testid=\"reasoning-exchange\" data-beats={beats.length}>\n {beats.map((beat, i) => (\n <Beat key={i} beat={beat} />\n ))}\n </div>\n );\n}\n\nfunction Beat({ beat }: { readonly beat: ExchangeBeat }): React.ReactElement {\n const side = beat.side === 'model' ? modelBeat : toolBeat;\n const id = beat.kind === 'call' || beat.kind === 'result' ? beat.toolCallId : undefined;\n return (\n <div\n style={{ ...cardStyle, ...side }}\n data-testid=\"reasoning-beat\"\n data-side={beat.side}\n data-kind={beat.kind}\n {...(id !== undefined ? { 'data-tool-call-id': id } : {})}\n >\n {beat.kind === 'call' && <CallBody beat={beat} />}\n {beat.kind === 'result' && <ResultBody beat={beat} />}\n {beat.kind === 'served' && <ServedBody beat={beat} />}\n {beat.kind === 'answer' && <AnswerBody beat={beat} />}\n </div>\n );\n}\n\n/** The emission: tool name, id, the `_findings` block first, then the remaining args. */\nfunction CallBody({ beat }: { readonly beat: CallBeat }): React.ReactElement {\n return (\n <>\n <div style={row}>\n <span style={dim}>{LABELS.model}</span>\n <span style={strong}>{LABELS.call}</span>\n {beat.toolName !== undefined && <code style={strong}>{beat.toolName}</code>}\n <code style={mono}>{beat.toolCallId}</code>\n {beat.fromLedger && (\n <Chip testId=\"reasoning-from-ledger\" color={T.warning}>\n {LABELS.fromLedger}\n </Chip>\n )}\n </div>\n {beat.findings !== undefined && (\n <div data-testid=\"reasoning-beat-findings\">\n <span style={dim}>{LABELS.findings}</span>\n <Clipped text={pretty(beat.findings)} />\n </div>\n )}\n {beat.args !== undefined && (\n <div data-testid=\"reasoning-beat-args\">\n <span style={dim}>{LABELS.args}</span>\n <Clipped text={pretty(beat.args)} />\n </div>\n )}\n </>\n );\n}\n\n/** The result as the tool returned it, the ticket the wire served instead, and the standing declared for it. */\nfunction ResultBody({ beat }: { readonly beat: ResultBeat }): React.ReactElement {\n const standing = beat.after?.standing;\n return (\n <>\n <div style={row}>\n <span style={dim}>{LABELS.tool}</span>\n <span style={strong}>{LABELS.result}</span>\n {beat.toolName !== undefined && <code style={strong}>{beat.toolName}</code>}\n <code style={mono}>{beat.toolCallId}</code>\n {beat.collapsed !== undefined && (\n <Chip testId=\"reasoning-collapsed\" color={T.textMuted} title={beat.collapsed.standing}>\n {LABELS.collapsed} {beat.collapsed.standing}\n </Chip>\n )}\n </div>\n {beat.placed !== undefined ? <ResultLine result={{ placed: beat.placed }} /> : <Clipped text={prettyContent(beat.content)} testId=\"reasoning-beat-content\" />}\n {beat.collapsed !== undefined && (\n <div data-testid=\"reasoning-beat-ticket\">\n <span style={dim}>{LABELS.ticket}</span>\n <Clipped text={prettyContent(beat.collapsed.content)} />\n </div>\n )}\n <div style={row} data-testid=\"reasoning-after\">\n <span style={dim}>{LABELS.standing}</span>\n <Chip testId=\"reasoning-standing\" color={standing !== undefined ? standingColor(standing) : T.textMuted}>\n {standing ?? LABELS.undeclared}\n </Chip>\n {beat.after?.declaredOn !== undefined && (\n <span style={dim} data-testid=\"reasoning-declared-on\">\n {LABELS.declaredOn}{' '}\n <code style={mono}>{beat.after.declaredOn === 'answer' ? beat.after.declaredOn : beat.after.declaredOn.toolCallId}</code>\n </span>\n )}\n </div>\n {beat.after !== undefined && <QuotedLine after={beat.after} />}\n </>\n );\n}\n\n/** The findings piece as served for the answer turn, under its own source name. */\nfunction ServedBody({ beat }: { readonly beat: ServedBeat }): React.ReactElement {\n return (\n <>\n <div style={row}>\n <span style={dim}>{LABELS.model}</span>\n <span style={strong}>{LABELS.served}</span>\n <code style={mono}>{beat.source}</code>\n </div>\n <Clipped text={beat.text} testId=\"reasoning-beat-content\" />\n </>\n );\n}\n\n/** The answer as the record holds it, and the field it was read from. */\nfunction AnswerBody({ beat }: { readonly beat: AnswerBeat }): React.ReactElement {\n return (\n <>\n <div style={row}>\n <span style={dim}>{LABELS.model}</span>\n <span style={strong}>{LABELS.answer}</span>\n <code style={mono} data-testid=\"reasoning-answer-from\">\n {beat.from}\n </code>\n </div>\n <Clipped text={beat.text} testId=\"reasoning-beat-content\" />\n </>\n );\n}\n\nconst CLIP_LINES = 12;\n\n/** A `<pre>` of the first lines; the rest behind a native `<details>` (the browser's bit, not a cursor). */\nfunction Clipped({ text, testId }: { readonly text: string; readonly testId?: string }): React.ReactElement {\n const lines = text.split('\\n');\n const head = lines.slice(0, CLIP_LINES).join('\\n');\n const tail = lines.slice(CLIP_LINES);\n return (\n <div data-testid={testId ?? 'reasoning-clipped'} data-lines={lines.length}>\n <pre style={pre} data-testid=\"reasoning-pre\">\n {head}\n </pre>\n {tail.length > 0 && (\n <details style={detailsStyle} data-testid=\"reasoning-more\">\n <summary style={summaryStyle}>\n {tail.length} {LABELS.lines}\n </summary>\n <pre style={pre} data-testid=\"reasoning-pre\">\n {tail.join('\\n')}\n </pre>\n </details>\n )}\n </div>\n );\n}\n\n/** A value as JSON, two-space indented. */\nfunction pretty(value: unknown): string {\n return JSON.stringify(value, null, 2) ?? String(value);\n}\n\n/** A content string pretty-printed when it parses as JSON, else verbatim; a non-string as JSON. */\nfunction prettyContent(content: unknown): string {\n if (typeof content !== 'string') return pretty(content);\n try {\n return pretty(JSON.parse(content));\n } catch {\n return content;\n }\n}\n\n// ─── Chips and styles ─────────────────────────────────────────────────────\n\nfunction standingColor(standing: string): string {\n if (standing === 'fact') return T.success;\n if (standing === 'ruled-out') return T.error;\n if (standing === 'open') return T.warning;\n return T.textMuted;\n}\n\nfunction Chip({\n children,\n color,\n testId,\n title,\n}: {\n readonly children: React.ReactNode;\n readonly color: string;\n readonly testId: string;\n readonly title?: string;\n}): React.ReactElement {\n return (\n <span style={{ ...chip, borderColor: color, color }} data-testid={testId} {...(title !== undefined ? { title } : {})}>\n {children}\n </span>\n );\n}\n\n// One-word CSS literals only: the own-claims walker reads every string.\nconst panel: React.CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 8,\n padding: 10,\n fontSize: 13,\n fontFamily: T.fontSans,\n color: T.textPrimary,\n};\nconst header: React.CSSProperties = { display: 'flex', alignItems: 'center', gap: 10 };\nconst title: React.CSSProperties = { fontWeight: 600 };\nconst strong: React.CSSProperties = { fontWeight: 600 };\nconst dim: React.CSSProperties = { color: T.textMuted };\nconst mono: React.CSSProperties = { fontFamily: T.fontMono, fontSize: 12, wordBreak: 'break-word' };\nconst row: React.CSSProperties = { display: 'flex', alignItems: 'center', flexWrap: 'wrap', gap: 6 };\nconst cardStyle: React.CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 4,\n padding: '6px 8px',\n border: '1px solid',\n borderColor: T.border,\n borderRadius: 6,\n background: T.bgSecondary,\n};\nconst chip: React.CSSProperties = {\n padding: '0 6px',\n borderRadius: 8,\n fontSize: 11,\n border: '1px solid',\n whiteSpace: 'nowrap',\n};\nconst detailsStyle: React.CSSProperties = { fontSize: 12 };\n// The exchange: a column of beats, each at most half the width on a wide\n// panel and the whole width on a narrow one — `max(50%,min(100%,320px))`\n// — the model's on the left, the tools' on the right.\nconst column: React.CSSProperties = { display: 'flex', flexDirection: 'column', gap: 8 };\nconst exchangeStyle: React.CSSProperties = column;\nconst modelBeat: React.CSSProperties = { alignSelf: 'flex-start', width: 'max(50%,min(100%,320px))', borderColor: T.primary };\nconst toolBeat: React.CSSProperties = { alignSelf: 'flex-end', width: 'max(50%,min(100%,320px))', borderColor: T.border };\nconst pre: React.CSSProperties = { ...mono, margin: '2px 0 0', whiteSpace: 'pre-wrap', maxWidth: '100%' };\nconst toggleRow: React.CSSProperties = { display: 'inline-flex', gap: 4, marginLeft: 'auto' };\nfunction toggleButton(on: boolean): React.CSSProperties {\n return {\n fontSize: 10.5,\n padding: '1px 6px',\n borderRadius: 6,\n border: '1px solid',\n borderColor: on ? T.primary : T.border,\n background: on ? T.bgTertiary : T.bgElevated,\n color: on ? T.textPrimary : T.textSecondary,\n cursor: 'pointer',\n };\n}\nconst summaryStyle: React.CSSProperties = { cursor: 'pointer', color: T.textMuted };\nconst detailsBody: React.CSSProperties = { display: 'flex', flexDirection: 'column', gap: 2, paddingTop: 4 };\nconst list: React.CSSProperties = { margin: '2px 0 0', paddingLeft: 18 };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAgB,WAAAA,UAAS,gBAAgB;;;ACqBzC,OAAO,SAAS,eAAe;AAmRzB,SAiCc,UA1BN,KAPR;AAhRC,IAAM,SAAS,OAAO,OAAO;AAAA,EAClC,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA;AAAA,EAEP,WAAW;AAAA,EACX,MAAM;AAAA,EACN,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,MAAM;AACR,CAAC;AAoED,IAAM,WAAW,CAAC,MAA6C,OAAO,MAAM,YAAY,MAAM;AAE9F,SAAS,UAAU,GAAsC;AACvD,MAAI,CAAC,SAAS,CAAC,KAAK,OAAO,EAAE,SAAS,YAAY,OAAO,EAAE,OAAO,SAAU,QAAO;AACnF,SAAO,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE,GAAG;AAClC;AAEA,SAAS,YAAY,GAAwC;AAC3D,MAAI,CAAC,SAAS,CAAC,KAAK,OAAO,EAAE,cAAc,SAAU,QAAO;AAC5D,QAAM,UAAU,UAAU,EAAE,OAAO;AACnC,MAAI,YAAY,OAAW,QAAO;AAClC,SAAO;AAAA,IACL;AAAA,IACA,WAAW,EAAE;AAAA,IACb,OAAO,EAAE;AAAA,IACT,GAAI,OAAO,EAAE,eAAe,WAAW,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5F,SAAS,aAAa,IAAkC;AACtD,SAAO;AAAA,IACL,UAAU;AAAA,IACV,SAAS;AAAA,IACT,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,aAAa,KAAK,EAAE,UAAU,EAAE;AAAA,IAChC,YAAY,KAAK,EAAE,aAAa,EAAE;AAAA,IAClC,OAAO,KAAK,EAAE,cAAc,EAAE;AAAA,IAC9B,QAAQ;AAAA,EACV;AACF;AACA,IAAM,eAAoC,EAAE,QAAQ,WAAW,OAAO,EAAE,UAAU;AAClF,IAAM,cAAmC,EAAE,SAAS,QAAQ,eAAe,UAAU,KAAK,GAAG,YAAY,EAAE;AAC3G,IAAMC,QAA4B,EAAE,QAAQ,WAAW,aAAa,GAAG;","names":["useMemo","row","Fragment","jsx","jsxs","LABELS","useMemo","dim","mono","band","list","useMemo","useState","Fragment","jsx","jsxs","LABELS","isRecord","row","positionsOf","useState","useMemo","panel","header","title","dim","mono","list","valueText","pre"]}
package/dist/context.cjs CHANGED
@@ -4548,6 +4548,7 @@ function ReasoningLens(props) {
4548
4548
  llmLatestToolCalls: keyValue(context, "llmLatestToolCalls")
4549
4549
  });
4550
4550
  }, [context, rows]);
4551
+ const mover = props.cursor === void 0 && shared !== void 0 && cursor.total > 0 && cursor.at.step >= 0;
4551
4552
  if (exchange === void 0) return null;
4552
4553
  const fold = exchange.reasoning;
4553
4554
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
@@ -4569,6 +4570,16 @@ function ReasoningLens(props) {
4569
4570
  ] }),
4570
4571
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ViewToggle2, { view, onView: setView })
4571
4572
  ] }),
4573
+ mover && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { "data-testid": "reasoning-transport", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4574
+ TimeTravel,
4575
+ {
4576
+ total: cursor.total,
4577
+ focusSeq: Math.max(0, cursor.at.step),
4578
+ onFocusChange: (n) => cursor.moveTo(n),
4579
+ isLive: false,
4580
+ compact: true
4581
+ }
4582
+ ) }),
4572
4583
  view === "cards" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: column, "data-testid": "reasoning-cards", children: [
4573
4584
  fold.cards.map((card) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Card, { card }, card.toolCallId)),
4574
4585
  fold.answer !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Answer, { answer: fold.answer })