agentfootprint-lens 0.58.0 → 0.58.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.
@@ -83,7 +83,7 @@ function ContextView(props) {
83
83
  Math.min(ownStep, Math.max(0, (ownPositions?.length ?? 1) - 1)),
84
84
  setOwnStep
85
85
  ));
86
- const mover = props.cursor === void 0 && cursor.total > 0;
86
+ const mover = props.cursor === void 0 && cursor.total > 0 && cursor.at.step >= 0;
87
87
  const [mode, setMode] = useState(props.initialMode ?? "keys");
88
88
  const context = useMemo(
89
89
  () => contextAt(snapshot, servedCursorOf(cursor), {
@@ -337,4 +337,4 @@ export {
337
337
  MILESTONE_AXIS,
338
338
  ContextView
339
339
  };
340
- //# sourceMappingURL=chunk-RFKLLHIE.js.map
340
+ //# sourceMappingURL=chunk-CJFH4W2Y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react/components/ContextView.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.\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 { 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 <WhyBand context={context} />\n </div>\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBA,SAAgB,SAAS,gBAAgB;AAmKjC,SA+GE,UA/GF,KACA,YADA;AAnJD,IAAM,SAAS,OAAO,OAAO;AAAA,EAClC,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM;AAAA,EACN,cAAc;AAAA,EACd,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,WAAW;AAAA,EACX,aAAa;AAAA,EACb,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,WAAW;AACb,CAAC;AAGM,IAAM,iBAAoC,OAAO,OAAO;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAsCD,SAAS,YAAY,UAA8C;AACjE,SAAO,iBAAiB,UAAU,gBAAgB,CAAC,CAAC,KAAK,CAAC;AAC5D;AAEA,SAAS,eAAe,QAAkC;AACxD,SAAO;AAAA,IACL,gBAAgB,OAAO,GAAG;AAAA,IAC1B,WAAW,OAAO,GAAG;AAAA,EACvB;AACF;AAEA,SAAS,WACP,QACA,WAC0B;AAC1B,MAAI,OAAO,GAAG,QAAQ,EAAG,QAAO;AAChC,QAAM,IAAI,YAAY,OAAO,GAAG,OAAO,CAAC;AACxC,SAAO,MAAM,SAAY,EAAE,gBAAgB,EAAE,gBAAgB,WAAW,EAAE,UAAU,IAAI;AAC1F;AAEO,SAAS,YAAY,OAA6C;AACv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UAAU;","names":[]}
package/dist/context.cjs CHANGED
@@ -3563,7 +3563,7 @@ function ContextView(props) {
3563
3563
  Math.min(ownStep, Math.max(0, (ownPositions?.length ?? 1) - 1)),
3564
3564
  setOwnStep
3565
3565
  ));
3566
- const mover = props.cursor === void 0 && cursor.total > 0;
3566
+ const mover = props.cursor === void 0 && cursor.total > 0 && cursor.at.step >= 0;
3567
3567
  const [mode, setMode] = (0, import_react3.useState)(props.initialMode ?? "keys");
3568
3568
  const context = (0, import_react3.useMemo)(
3569
3569
  () => contextAt(snapshot, servedCursorOf(cursor), {