From bf2fa9176dad1aa8354d0fce55052eaa397352b4 Mon Sep 17 00:00:00 2001 From: "xeph-agent[bot]" <327559478+xeph-agent[bot]@users.noreply.github.com> Date: Sat, 24 Oct 2026 23:39:42 +0900 Subject: [PATCH] docs: require Pi 1.2.0 and drop pre-1.2 notes --- README.md | 6 ++---- index.ts | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 20c798b..38a58ca 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,14 @@ Pressing **Ctrl+O** expands the row to inspect the full syntax-highlighted scrip - **Space-Saving**: Replaces 10–20 rows of `codemode` output with a clean 1-line summary, from the first streamed argument to the final result. Before its first nested call, a running script shows the tools it references; a script without nested tool calls is named by its first code line. - **Width-Aware**: Fits the actual rendering area, including shell padding, terminal resizing, and HTML exports. Narrow rows drop the `codemode` title and keep the status. - **Key Metrics at a Glance**: Tools used, output line and image counts, execution time, and LLM cost (`$cost`). -- **Live Timing**: Updates elapsed time in the running summary every second, in whole seconds. Final results prefer Pi’s recorded duration, falling back to the script header for older sessions and Pi versions. +- **Live Timing**: Updates elapsed time in the running summary every second, in whole seconds. Final results prefer Pi’s recorded duration, falling back to the script header for HTML exports and sessions recorded before Pi 1.1. - **Fully Expandable**: Press **Ctrl+O** anytime to inspect the full script source and raw output. --- ## Requirements -- **Pi Coding Agent**: `>= 1.0.1` (`1.2.0` or later recommended). +- **Pi Coding Agent**: `>= 1.2.0`. --- @@ -64,8 +64,6 @@ Live timers stop on completion, errors, aborted runs, session changes, and reloa ## Known Limitations -- **Early Progress on Older Pi**: Live timing refreshes after the first partial result. Pi 1.2.0 emits one before the first nested call; older supported versions may wait until a nested tool call begins, and the call row stays in place until then. - - **Static Analysis Approximation**: The call line preview uses a lightweight scanner that skips strings, comments, and regex literals but keeps `${...}` interpolations. Dynamic property accesses (`tools[fn]`) and aliases (`const { read } = tools`) are omitted, and rare regex-versus-division ambiguities may hide or add a name. The result line always displays the authoritative runtime execution history once finished. - **HTML Exports Keep Two Rows**: The exporter draws the call row before the result exists, so exported sessions still show the call summary above the titled result. diff --git a/index.ts b/index.ts index f69d224..958f16b 100644 --- a/index.ts +++ b/index.ts @@ -14,7 +14,7 @@ * * Expanding (Ctrl+O) reveals syntax-highlighted code, per-call timings, models cost, errors, and full output. * - * Wiring: We register a renderer resolver (pi.registerToolRenderer, pi >= 1.0.1) that attaches the compact + * Wiring: We register a renderer resolver (pi.registerToolRenderer) that attaches the compact * renderers to the `codemode` tool by name. The built-in extension's definition (execution, store * persistence, models API, namespaces) stays untouched, so nothing is re-registered: no replacement * warning, no mid-session tool redefinition, and the renderers apply no matter which extension or SDK @@ -581,7 +581,7 @@ export function renderResult( ): Text { const calls = result.details?.calls ?? []; const { body, wallTime: headerSeconds } = splitScriptOutput(result.content ?? []); - // Compatibility for old sessions and HTML exports; remove `?? headerSeconds` to drop the fallback. + // HTML exports and sessions recorded before Pi 1.1 carry no durationMs; the script header still has the time. const durationSeconds = recordedDurationSeconds(context.durationMs) ?? headerSeconds; const images = result.content?.filter((item) => item.type === "image").length ?? 0; const clock = executionClock(context); @@ -643,8 +643,6 @@ export default function codemodeCompact(pi: ExtensionAPI): void { if (!options.isPartial || context.isError) { clocks.delete(clock); } else if (clock.endedAt === undefined && !clock.interval) { - // ponytail: Pi < 1.2 can delay the first partial result until a nested call; - // upgrading Pi enables immediate ticks without replacing tool execution. clock.interval = setInterval(() => context.invalidate(), 1000); clock.interval.unref(); clocks.add(clock);