Skip to content

refactor(pocket-pi)!: full unmodified pi is the sole default; remove trimmed path - #7

Merged
doodlewind merged 2 commits into
mainfrom
feat/full-pi-only
Jul 22, 2026
Merged

refactor(pocket-pi)!: full unmodified pi is the sole default; remove trimmed path#7
doodlewind merged 2 commits into
mainfrom
feat/full-pi-only

Conversation

@doodlewind

Copy link
Copy Markdown
Contributor

Pocket Pi now is the full, unmodified pi-coding-agent. The trimmed "agent loop + stubbed pi-ai + native streamFns" path — a pre-Path-B artifact from before real pi ran on QuickJS — is gone. There is one path.

What changed

  • Full pi embedded by default. The gzip'd bundle (~1.8 MB) is include_bytes!'d unconditionally (no more embed-full-pi feature) and committed, so cargo build — including from cat's vendored submodule — works with only Rust, no Node. PiRuntime::new() decompresses + evaluates it, then a host harness.
  • Host harness preserves the API. js/src/pi-full/host.ts reimplements PocketPi.boot/prompt on createAgentSession: the boot config's tools become a pi extension whose execute calls native Rust via host.tool (that's how cat's look_at_screen reaches the agent); pi's session events map to the host vocabulary (start/text/tool_start/end/error) via host.emit. So register_tool + boot + prompt + on_event are unchanged — cat keeps working, now on real pi.
  • Removed: agent.bundle.js + js/src/trimmed/**, the trimmed build step, load_full_pi/load_plugin_ts, the plugin example.

Verification

  • 22 tests pass, clippy -D warnings clean.
  • live_openai_turn now validates the harness end-to-end: boot/prompt → real gpt-5.6 turn → "pong".
  • Offline pi tests (extension binds to a session, persistence) are un-ignored — they run in the default suite now that the bundle is embedded.

Breaking

PiRuntime::new() always loads the full pi; the trimmed/scripted path and load_full_pi/load_plugin_ts are removed. cat migrates in its own repo (its register_tool/boot/prompt/on_event usage is unchanged).

🤖 Generated with Claude Code

doodlewind and others added 2 commits July 22, 2026 15:00
…trimmed path

Pocket Pi now IS the full, unmodified pi-coding-agent. The trimmed "agent loop +
stubbed pi-ai + native streamFns" path — a pre-Path-B artifact from before the
real pi ran on QuickJS — is gone. Every `PiRuntime::new()` embeds and loads the
whole pi bundle (globalThis.PiFull) plus a host harness; there is one path.

- **Embedded by default.** The gzip'd full bundle (~1.8 MB) is `include_bytes!`'d
  unconditionally (no more `embed-full-pi` feature; flate2 is a normal dep) and
  COMMITTED, so `cargo build` — including from cat's vendored submodule — works
  with only Rust, no Node. `new()` decompresses + evaluates it, then the harness.
- **Host harness (js/src/pi-full/host.ts → PocketPi global).** Reimplements
  `PocketPi.boot/prompt` on `createAgentSession`: the boot config's `tools` become
  a pi extension whose `execute` calls back to native Rust via `host.tool`, and
  pi's session events map to the host's compact vocabulary (start/text/tool_start/
  end/error) via `host.emit`. So the `register_tool` + `boot` + `prompt` +
  `on_event` API is unchanged — hosts (cat) keep working, now on real pi.
- Removed: `agent.bundle.js` + `js/src/trimmed/**`, the trimmed bundle build step,
  `load_full_pi`/`load_plugin_ts`, the `plugin` example. `self_contained` example
  simplified (embedding is the default now).
- Tests reworked: dropped the scripted/trimmed tests; the full-pi bundle tests no
  longer need `run_module` (embedded) and the offline ones are un-ignored;
  `new_embeds_and_loads_full_pi` covers the default. `live_openai_turn` now
  validates the harness end-to-end (boot/prompt → real gpt-5.6 turn → "pong").

22 tests pass, clippy `-D warnings` clean.

BREAKING CHANGE: the trimmed/scripted path and `load_full_pi`/`load_plugin_ts`
are removed; `PiRuntime::new()` always loads the full pi.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…bundle)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@doodlewind
doodlewind merged commit 4c5bdd2 into main Jul 22, 2026
1 check passed
@doodlewind
doodlewind deleted the feat/full-pi-only branch July 22, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant