@justjoshn/pi-pstack 0.15.36-pi.7 → 0.15.36-pi.9

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
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.15.36-pi.9] - 2026-11-03
4
+
5
+ - Follow the repository Vitest rules in the test suite. No runtime change.
6
+ - Correct stale documentation against the current code, including versions, counts, paths and host requirements.
7
+
8
+ ## [0.15.36-pi.8] - 2026-11-02
9
+
10
+ - Declare `cost.totalFromProvider` on the exported `Usage` type so the package typechecks again, completing the provider-reported cost provenance aggregation shipped in 0.15.36-pi.7.
11
+
3
12
  ## [0.15.36-pi.7] - 2026-11-02
4
13
 
5
14
  - Update the host compatibility documentation for Pi 1.5.0. Retain the four native gaps for RPC process control, skill-block formatting, named-ID fork truncation, and workspace folder naming.
package/README.md CHANGED
@@ -13,7 +13,7 @@ pi-pstack is pstack 0.15.36 for Pi 1.5.0: rigorous agent workflows (`/poteto-mod
13
13
  pi install ./extensions/pi-pstack
14
14
  ```
15
15
 
16
- Pi does not install dependencies for a local package, so `bun install` (or `npm install` in `extensions/pi-pstack`) fetches the one runtime dependency, `@anthropic-ai/sandbox-runtime`, which the read-only shell loads (readonly subagents and `/plan`). Without it everything else works, and a read-only shell command fails instead of running unsandboxed. To try it for one session without installing, run `pi -e ./extensions/pi-pstack`. To install the published package instead, run `pi install npm:@justjoshn/pi-pstack`.
16
+ Pi does not install dependencies for a local package, so `bun install` (or `npm install` in `extensions/pi-pstack`) fetches the one runtime dependency, `@anthropic-ai/sandbox-runtime`, which the read-only shell loads (readonly subagents and `/plan`). Without it everything else works, and a read-only shell command fails instead of running unsandboxed. On Linux the sandbox also needs `bubblewrap`, `socat`, and `ripgrep` (`sudo apt install bubblewrap socat ripgrep`), and Ubuntu 24.04 and later need the user-namespace change under Limits. macOS uses the built-in `sandbox-exec`. pi-pstack needs Node 22.19 or newer. To try it for one session without installing, run `pi -e ./extensions/pi-pstack`. To install the published package instead, run `pi install npm:@justjoshn/pi-pstack`.
17
17
  Installing loads pi-pstack's tools and system-prompt sections at once, but no skill runs until you invoke it. 61 workflow skills stay out of the model's automatic skill list. Setup, create-skill, and the team-kit shipping and review skills (`deslop`, `control-cli`, `control-ui`, CI and PR helpers, and the rest of that set) can load from your words alone.
18
18
  2. Run `/setup-pstack`. It lists the models the `Task` tool can use, asks for a reasoning budget, maps a model to each role, and writes the model rule. A new rule applies from the next request.
19
19
  3. Start real work with `/poteto-mode`, a goal, and a check that can pass or fail.
@@ -45,7 +45,7 @@ Remove the package with `pi remove ./extensions/pi-pstack`. Its state lives in `
45
45
  | `fork` | Starts a new agent whose transcript begins as a copy of an idle agent's transcript, in that agent's directory (its worktree for an isolated worker), so it sees the built checkout and uncommitted changes. Type, model, and readonly default from the source; readonly can be added, never lifted. `fork_turns: N` (only with `fork`) copies just the first N user turns. `fork` excludes `resume`, `environment`, and `cloud_base_branch`. Pi's own `/fork` command branches the chat session instead. |
46
46
  | `stop_agent` | `agent_id`. Stops a running subagent. One this Pi process owns gets an RPC abort, then a kill after a grace period. One another of your Pi processes owns gets a signal to the live pid in its run lock. An idle or finished agent is left alone, and the result says so. |
47
47
  | `agent_status` | Reads a subagent's state (`running` while its run lock names a live pid, `idle`, or `missing`), type, model, directory, branch, times, and last reply, without waking it. It also shows whether the agent is readonly, the agent it was forked from, its pid while running, and its transcript. Without `agent_id` it lists the workspace's 20 newest agents. In the root chat that includes every descendant, isolated workers too. |
48
- | Subagent types | `generalPurpose` (default), `poteto-agent` (a background delegate that reads poteto-mode first), and `comment-sicko`, read from `agents/*.md`. Unknown types fail with the list. |
48
+ | Subagent types | `generalPurpose` (default), `poteto-agent` (a background delegate that reads poteto-mode first), `ci-watcher` (a background PR check watcher), `comment-sicko`, and `thermo-nuclear-code-quality-review`, the last four read from `agents/*.md`. Unknown types fail with the list. |
49
49
  | Models | A Pi model spec such as `claude-opus-5-5:xhigh` or `xai/grok-4.7:high`, model parameters such as `claude-opus-5-5[effort=high]` or `grok-4.7[fast=true]` (picks a listed `-fast` id of that model), or `inherit`, `inherit-parent`, `auto`, or nothing for the parent model. A model Pi does not list, or a thinking level the model does not support, fails with the allowed list. A bare model id that several providers offer resolves to the parent chat's provider when it offers that id, and otherwise fails with the choices. Older rules that wrote `claude-opus-5-5-xhigh` still resolve. The system prompt's `pstack_subagents` section lists the types, the parent model, and the models with their levels. |
50
50
  | Isolated workers (`environment: "cloud"`) | The subagent runs in a new git worktree at `<pstack dir>/workspaces/<workspace folder>/worktrees/<agent id>` on branch `pstack/<agent id>`, from `cloud_base_branch` (a local ref, else `origin/<branch>`) or your HEAD commit, so uncommitted changes do not reach it. The result and the card name the branch to merge, and `resume` and `fork` run in the same worktree. It fails clearly outside a git repository, in a repository with no commits, or when the base does not resolve. The worker shares the root chat's workspace state, so it sees the same projects, stores, and subagent transcripts. It also shares this machine's ports, processes, writable caches, simulators, and credentials. Assign separate ports, output directories, and writable caches to concurrent runtime lanes. `swarm` and `orchestrate` spawn worktree workers by default. |
51
51
  | `readonly: true` | The child gets `read`, `grep`, `find`, `ls`, `TodoWrite`, and a read-only `bash`, and no MCP. That shell runs each command in an OS sandbox ([`@anthropic-ai/sandbox-runtime`](https://github.com/anthropics/sandbox-runtime): `sandbox-exec` on macOS, bubblewrap on Linux) that blocks every file write and all network access, so `git log` works and `touch` or `curl` fail. Where no sandbox can start, the command fails rather than running unsandboxed. |
@@ -13,7 +13,7 @@ bun install
13
13
  pi install ./extensions/pi-pstack
14
14
  ```
15
15
 
16
- `pi install <path-to-pi-pstack>` loads the package in place, so keep the checkout where it is. To install the published package instead, run `pi install npm:@justjoshn/pi-pstack`. Start Pi, and the pstack commands appear in the `/` menu.
16
+ `pi install <path-to-pi-pstack>` loads the package in place, so keep the checkout where it is. To install the published package instead, run `pi install npm:@justjoshn/pi-pstack`. On Linux, the read-only shell also needs `bubblewrap`, `socat`, and `ripgrep`, as the package README explains. Start Pi, and the pstack commands appear in the `/` menu.
17
17
 
18
18
  ## Pick your models
19
19
 
@@ -23,7 +23,7 @@ Run:
23
23
  /setup-pstack
24
24
  ```
25
25
 
26
- [`/setup-pstack`](../../skills/setup-pstack/SKILL.md) detects the models you have access to, asks for a reasoning budget, shows you each role (code delegates, judgment, the review panels), and asks what you want. Answer the questions. It writes `~/.pi/agent/pstack/pstack-models.md`, the model rule. pi-pstack adds it to every request, so every pstack skill reads it.
26
+ [`/setup-pstack`](../../skills/setup-pstack/SKILL.md) detects the models you have access to, asks for a reasoning budget, shows you each role (code delegates, judgment, the review panels), and asks what you want. Answer the questions. It writes `~/.pi/agent/pstack/pstack-models.md` (`$PI_CODING_AGENT_DIR/pstack/pstack-models.md` when that variable is set), the model rule. pi-pstack adds it to every request, so every pstack skill reads it.
27
27
 
28
28
  The defaults run at `xhigh` reasoning, the same as the `large` budget. `unlimited` lifts each model to its highest tier, up to `max`. Opus goes to `max`. Grok tops out at `xhigh`, so it stays there. `medium` and `small` lower the reasoning and spend fewer tokens.
29
29
 
@@ -17,7 +17,7 @@ as search hints from the 1.4.0 audit, not as 1.5.0 line references. This is a co
17
17
 
18
18
  - **Spawn shape.** `start()` runs `spawn("node", [cliPath, ...args], { cwd, env, stdio })` (`:42`) with no spawn
19
19
  options and a single script path. pi-pstack starts `[process.execPath, script]`, `[process.execPath]`, or `pi` from
20
- `PATH` (`src/task/tool.ts:105-109`), and `RpcClientOptions` accepts none of those.
20
+ `PATH` (`src/pi-command.ts:9-11`), and `RpcClientOptions` accepts none of those.
21
21
  - **Process-group kill.** The runner spawns with `detached: true` (`src/task/runner.ts:253`) and signals `-pid`
22
22
  (`signalGroup`, `:202-210`), so abort and session shutdown stop the child and everything it started. `stop()` signals
23
23
  the direct child pid only, SIGTERM then SIGKILL after 1 s (`rpc-client.js:94`), and there is no `detached` option.
@@ -49,7 +49,7 @@ one skill block. **When this goes away.** Pi exports the block formatter and `mo
49
49
 
50
50
  ## 3. The `fork_turns` truncation
51
51
 
52
- `keepFirstTurns` (`src/task/records.ts:110-121`) rewrites the forked transcript file by hand.
52
+ `keepFirstTurns` (`src/task/records.ts:110-116`) rewrites the forked transcript file by hand.
53
53
  `SessionManager.createBranchedSession(leafId)` (`dist/core/session-manager.d.ts:365`) always mints a new session ID and
54
54
  file name (`dist/core/session-manager.js:1205-1264`), so it cannot produce the `<timestamp>_<agentId>.jsonl` that
55
55
  `SessionManager.forkFrom(..., { id: agentId })` just created. No export truncates an existing session file at an entry.
@@ -57,7 +57,7 @@ file name (`dist/core/session-manager.js:1205-1264`), so it cannot produce the `
57
57
 
58
58
  ## 4. The workspace folder name
59
59
 
60
- `workspaceSlug` (`src/paths.ts:26-35`) repeats Pi's session-folder rule (`getDefaultSessionDirPath`,
60
+ `workspaceSlug` (`src/paths.ts:44-48`) repeats Pi's session-folder rule (`getDefaultSessionDirPath`,
61
61
  `dist/core/session-manager.js:290-295`). The only public accessor is `ctx.sessionManager.getSessionDir()`
62
62
  (`ReadonlySessionManager`, `dist/core/session-manager.d.ts:178`), and it is not a substitute:
63
63
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justjoshn/pi-pstack",
3
- "version": "0.15.36-pi.7",
3
+ "version": "0.15.36-pi.9",
4
4
  "description": "pstack 0.15.36 for Pi with its soft-dependency team-kit skills vendored in: rigorous agent workflows and principles as Pi skills, with the host features they use: subagents, todos, modes, plan mode, the model rule, /loop, subscriptions and routines, AskQuestion, and visualize",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -4,7 +4,7 @@ import { homedir } from 'node:os';
4
4
  import { isAbsolute, join, resolve } from 'node:path';
5
5
  import { StringDecoder } from 'node:string_decoder';
6
6
 
7
- import type { ImageContent, Usage } from '@earendil-works/pi-ai';
7
+ import type { ImageContent, Usage as ProviderUsage } from '@earendil-works/pi-ai';
8
8
  import { detectSupportedImageMimeTypeFromFile } from '@earendil-works/pi-coding-agent';
9
9
  import { PACKAGE_ROOT } from '../paths.ts';
10
10
  import type { ModelSpec } from './models.ts';
@@ -17,6 +17,11 @@ export const KILL_GRACE_MS = 3_000;
17
17
  // Dialogs block a run until answered. A subagent has nobody to ask, so its owner dismisses them.
18
18
  const DIALOG_METHODS = new Set(['select', 'confirm', 'input', 'editor']);
19
19
 
20
+ /** Provider usage, plus whether `cost.total` was reported by the provider rather than priced locally. */
21
+ export interface Usage extends ProviderUsage {
22
+ cost: ProviderUsage['cost'] & { totalFromProvider?: boolean | undefined };
23
+ }
24
+
20
25
  export interface ChildArgsOptions {
21
26
  sessionDir: string;
22
27
  agentId: string;