openpencil/src
Danila Poyarkov 19d01f0835
fix(harness): start Pi sessions with MCP tools under Node (#897)
* fix(harness): start Pi sessions with MCP tools under Node

The desktop app always gives Pi OpenPencil's MCP server, and the
published companion failed every such session:

- @ai-sdk/harness-pi imports pi-mcp-adapter, which publishes only
  TypeScript sources, and Node refuses to strip types under
  node_modules. A module load hook now strips them for TypeScript
  dependencies only; Bun runs them as is. (vercel/ai#22040)
- pi-mcp-adapter imports @earendil-works/pi-tui but declares it as an
  optional peer, so npm leaves it out. The companion depends on it at
  the version pi-coding-agent uses, and a test keeps the two in step.
  (nicobailon/pi-mcp-adapter#805)
- Pi reports live-process resume, yet the service handed it state
  saved by an earlier session, and the just-bash sandbox cannot resume,
  so every later session with that ID failed. Live-process backends now
  start fresh and drop saved state.

Pi also installs the packages from a person's Pi settings with npm on
every session, writing npm's output to the companion's stdout. The
companion now keeps the real stdout for protocol messages, sends other
writes to stderr, and quiets npm on success. The app logs companion
stderr as diagnostics, since failures arrive as protocol errors.

* fix(harness): reject another backend's state before dropping it

loadResumeState removed saved state for a live-process backend before
createSession checked which backend owned it, so state saved by another
backend was lost instead of rejected. Ownership is checked first, and
only state that belongs to the live-process backend is dropped.
2026-10-05 17:21:50 +00:00
..
app fix(harness): start Pi sessions with MCP tools under Node (#897) 2026-10-05 17:21:50 +00:00
assets
components chore: prefer es-toolkit helpers and lint the mechanical cases (#898) 2026-10-05 09:34:00 +00:00
theme feat: create, fill, and edit slots (#862) 2026-10-04 17:02:28 +00:00
views feat: open documents dropped onto the window (#906) 2026-10-05 14:24:43 +00:00
AGENTS.md docs: route contributors through per-domain guides and ship npm license text (#785) 2026-09-29 01:02:06 +04:00
app.css feat: create, fill, and edit slots (#862) 2026-10-04 17:02:28 +00:00
App.vue feat(updater): show download progress while installing an update 2026-09-25 23:15:14 +04:00
boot.ts feat(app): record runtime errors in diagnostics and make events readable (#874) 2026-10-05 07:59:44 +00:00
constants.ts Release v0.15.0 2026-09-16 17:57:35 +03:00
env.d.ts fix(mcp): isolate Portless development routes 2026-08-21 08:14:04 +03:00
global.d.ts feat: open documents dropped onto the window (#906) 2026-10-05 14:24:43 +00:00
main.ts fix: explain unsupported browsers instead of a blank window (#745) 2026-09-22 14:40:59 +04:00
markdown.d.ts
router.d.ts
router.ts refactor(app): polish files workspace and New tabs 2026-08-20 17:20:33 +03:00