pi-plus 0.1.42 → 0.1.43

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.
package/CHANGELOG.md CHANGED
@@ -4,7 +4,8 @@
4
4
 
5
5
  ### Added
6
6
 
7
- - Auto-fold history in the interactive TUI (`src/coding-agent/ui/auto-fold-history.ts`, installed via a side-effect import in the `main.ts` wrapper): the transcript folds on a rolling basis — when the agent starts a new assistant message mid-run (`handleEvent` prototype patch on `message_start`), that step's thinking and finished tool rows collapse (thinking to the "Thinking..." label, tools to their standard per-tool preview), and when a new user message enters the chat (`addMessageToChat` prototype patch) all previous turns fold. The live step is excluded by identity (streaming assistant component + in-flight `pendingTools`), so only completed content folds while output is still streaming; resume and compaction replays flow through the same `addMessageToChat` chokepoint, so everything before the last user turn is folded at first paint. `toolOutputExpanded` is synced to the folded state (one ctrl+o re-expands everything, no dead first press, until the next fold); `hideThinkingBlock` is left alone so the current step's thinking stays visible — ctrl+t shows thinking everywhere and the next fold refolds. Clicking a folded block re-opens just that one. Opt out with `PI_AUTO_FOLD_HISTORY=0`; verbose startup never folds. CLI-only: `pi-plus-sdk` hosts do their own content folding.
7
+ - The session change report extension (`pi-plus-changes`, `src/extensions/changes/`): `/changes` prints the cumulative content diff of every file the agent changed this session — including files `git diff` cannot show, since brand-new (untracked) files render as all-added diffs and deletions as all-removed. A `tool_call` handler snapshots each edited/overwritten file's original content at the agent's first touch (insertion-ordered ledger, 200-path and 256 KB-per-file caps; failures are swallowed so a bad path never blocks the tool, and the file simply goes untracked with a note entry). On demand the baselines are diffed against the current files on disk (`generateDiffString`), edits reverted to their baseline drop out, diff bodies cap at 400 lines with a muted tail note, and the report appends as a custom transcript entry rendered with the fancy-diff pipeline (per-file header with `+N −M` stats and language badge over the `changes — N files +X −Y` summary; custom entries never enter LLM context and persist in the session file, so restored sessions re-render past reports with the current theme). An optional argument filters tracked paths by case-insensitive substring (`/changes src/foo`). Changes made through the `bash` tool are not tracked; TUI mode only.
8
+ - Auto-fold history in the interactive TUI (`src/coding-agent/ui/auto-fold-history.ts`, installed via a side-effect import in the `main.ts` wrapper): the transcript folds on a rolling basis — when the agent starts a new assistant message mid-run (`handleEvent` prototype patch on `message_start`), that step's thinking and finished tool rows collapse (thinking to a "Thinking... (ctrl+o to expand)" hint label, tools to their standard per-tool preview), and when a new user message enters the chat (`addMessageToChat` prototype patch) all previous turns fold. The live step is excluded by identity (streaming assistant component + in-flight `pendingTools`), so only completed content folds while output is still streaming; resume and compaction replays flow through the same `addMessageToChat` chokepoint, so everything before the last user turn is folded at first paint. thinking folds and unfolds exactly like tool output (one shared state model): the fold syncs both flags — `toolOutputExpanded` to false and `hideThinkingBlock` to true — so neither ctrl+o nor ctrl+t ever burns a dead press, and new components inherit them, meaning after a fold a freshly created tool row starts collapsed and a freshly created assistant message starts with hidden thinking (mid-run included; ctrl+o, ctrl+t or a click reveals it). A `setToolsExpanded` prototype patch makes ctrl+o the whole-transcript toggle for both kinds — the thinking sweep covers every assistant component including the streaming one, mirroring upstream's no-exclusion tool sweep — expanding restores the plain "Thinking..." label, collapsing re-folds with the hint and drives `hideThinkingBlock` in lockstep. Clicking a folded block re-opens just that one. Opt out with `PI_AUTO_FOLD_HISTORY=0` (ctrl+o then behaves exactly like upstream, tool output only); verbose startup never folds. CLI-only: `pi-plus-sdk` hosts do their own content folding.
8
9
  - The fancy content-change diff extension (`pi-plus-fancy-diff`): the TUI rendering of `edit` and `write` is taken over via `registerToolRenderer` — diff bodies are syntax-highlighted (upstream's cli-highlight pipeline, by file extension), markers are colored `+`/`-` over a dim line-number gutter, the header carries `+N −M` change stats and a language badge, 1:1 modified lines get bold word-level emphasis, and elided context shows a `⋮` separator. A `write` that overwrites an existing file now renders an old-vs-new diff: the pre-image is captured by a `tool_call` handler before execution (LRU-bounded, 256 KB per-file cap); new files keep the streaming content preview. Errors, restored sessions without a pre-image, and all other tools fall back to upstream rendering. No background fills anywhere, consistent with plain tool blocks.
9
10
  - The web search extension (`pi-plus-web-search`, shared core `packages/plus/src/extensions/web-search/`) is registered in the `pipi` CLI: `WebSearch` searches the web through the provider chain selected by `WEB_SEARCH_PROVIDER`/`*_API_KEY` env vars (keyless DuckDuckGo fallback last) and `WebFetch` reads a URL as text, both returning citation-ready results.
10
11
  - The `/init` command (shared core, `packages/plus/src/extensions/init/`): analyzes the codebase and creates `AGENTS.md` at the cwd root, or suggests improvements when it already exists; pi loads `AGENTS.md` automatically.
package/README.md CHANGED
@@ -24,7 +24,8 @@ The context-detection/compaction/reasoning overrides and the eleven non-TUI exte
24
24
  7. **Tab title + busy spinner** (`src/extensions/tab-title/`) — the terminal window/tab title brands as `pi+ - [sessionName -] cwdBasename` with a braille spinner while the agent or compaction is working. TUI mode only.
25
25
  8. **Plain tool blocks** (`src/extensions/plain-tools/`) — strips background fills from tool result blocks so tool status reads as text (words, never colored blocks).
26
26
  9. **Fancy content-change diffs** (`src/extensions/fancy-diff/`) — takes over the TUI rendering of `edit` and `write`: syntax-highlighted diff bodies, colored +/- markers, a dim line-number gutter, `+N −M` change stats with a language badge, bold word-level emphasis on modified lines, and a ⋮ separator for elided context. A `write` that overwrites an existing file renders as an old-vs-new diff (the pre-image is captured in a `tool_call` handler before execution; new files keep the streaming content preview). No background fills, consistent with plain tool blocks.
27
- 10. **Auto-fold history** (`src/coding-agent/ui/auto-fold-history.ts`) — rolling fold of the transcript: as the agent starts each new assistant message mid-run, the previous step's thinking and finished tool rows collapse (thinking to the "Thinking..." label, tools back to their standard preview), and a new user message folds all previous turns. The live step (streaming assistant message + in-flight tools) is always excluded, so output stays open while it's still relevant; resume and compaction replays fold everything before the last user turn. ctrl+o still re-expands everything (the fold keeps the global expand flag in sync with what's visible, so no dead press) and ctrl+t shows thinking everywhere until the next fold; clicks re-open a single folded block. Disable with `PI_AUTO_FOLD_HISTORY=0`; verbose startup never folds. CLI-only — `pi-plus-sdk` hosts (e.g. the desktop app) do their own folding.
27
+ 10. **Session change report** (`src/extensions/changes/`) — `/changes` prints the cumulative content diff of every file the agent changed this session, including files git cannot show: brand-new (untracked) files render as all-added diffs and deletions as all-removed. A `tool_call` handler snapshots each file's original content at the agent's first touch; the command diffs those baselines against the current files on disk and appends the report as a custom transcript entry (never in LLM context, re-rendered with the fancy-diff styling, persists across session restore). Optional argument filters paths by substring (`/changes src/foo`). Changes made through the `bash` tool are not tracked. TUI only.
28
+ 11. **Auto-fold history** (`src/coding-agent/ui/auto-fold-history.ts`) — rolling fold of the transcript: as the agent starts each new assistant message mid-run, the previous step's thinking and finished tool rows collapse (thinking to the "Thinking... (ctrl+o to expand)" hint label, tools back to their standard preview), and a new user message folds all previous turns. The live step (streaming assistant message + in-flight tools) is always excluded, so output stays open while it's still relevant; resume and compaction replays fold everything before the last user turn. thinking folds and unfolds **exactly like tool output**: the fold syncs both flags (`toolOutputExpanded` false, `hideThinkingBlock` true — so neither ctrl+o nor ctrl+t ever dead-presses), new components inherit them (after a fold a fresh tool row starts collapsed **and** a fresh assistant message starts with hidden thinking, mid-run included — reveal via ctrl+o, ctrl+t or a click), and ctrl+o sweeps the whole transcript for both kinds, streaming component included, like upstream's tool sweep; clicking re-opens a single folded block. With `PI_AUTO_FOLD_HISTORY=0` the whole feature is off and ctrl+o behaves exactly like upstream (tool output only); verbose startup never folds. CLI-only — `pi-plus-sdk` hosts (e.g. the desktop app) do their own folding.
28
29
 
29
30
  The CLI identifies as **`pipi`** (pi-plus) in CLI text via the shared config wrapper's
30
31
  `APP_NAME` shadow; the terminal tab title brands as **`pi+`** via `APP_TITLE`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-plus",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "description": "pi coding agent with the pi-plus override layer (pipi CLI)",
5
5
  "type": "module",
6
6
  "piConfig": {