Skip to content

feat(pi-harness): standalone headless agent server#84

Merged
arjun-zosma merged 5 commits into
zosmaai:mainfrom
arjun-zosma:main
Apr 26, 2026
Merged

feat(pi-harness): standalone headless agent server#84
arjun-zosma merged 5 commits into
zosmaai:mainfrom
arjun-zosma:main

Conversation

@arjun-zosma
Copy link
Copy Markdown
Member

Summary

Add @openzosma/pi-harness — a lightweight, deployable HTTP/SSE server that wraps pi-coding-agent in headless SDK mode. No TUI, no database, no auth complexity. One Node.js process serves multiple sessions with inference in the cloud.

What's Included

New Package: packages/pi-harness/

  • CLI with subcommands: start, stop, status, setup, tui, logs, --help, --version
  • First-run auto-detection: runs interactive setup wizard if ~/.pi-harness/.env missing
  • Native daemon mode: --daemon flag spawns background process with PID tracking
  • Real-time SSE streaming: all agent events stream to clients via Server-Sent Events
  • Per-session workspace isolation: configurable max sessions, idle cleanup, health monitoring
  • esbuild bundling: workspace code inlined for standalone npm install -g distribution
  • Dynamic imports: lightweight CLI commands (help, status, stop) don't load heavy deps
  • TUI client: built-in terminal client connecting to the HTTP/SSE API
  • Install + setup scripts: curl | bash installer and interactive setup wizard

Root README Updates

Pi-harness is now discoverable in 5 places:

  1. Standalone harness callout section right before "Get Started"
  2. Architecture table callout pointing to pi-harness as local-mode standalone
  3. Project structure listing
  4. Roadmap as a completed deliverable
  5. Documentation table

Design Philosophy

Pi-harness is intentionally humble — it gives full credit to Mario Zechner's pi-coding-agent as the real hero. It's a deployment layer, not a replacement. Companies configure their own models, tools, prompts, and extensions. The harness fits into their workflow, not the other way around.

Usage

npm install -g @openzosma/pi-harness
pi-harness        # First run → setup wizard → start server
pi-harness tui    # Connect with interactive client

Testing

  • pnpm check passes (TypeScript strict)
  • pnpm build produces clean bundles
  • CLI help/version/status work without loading heavy deps
  • Server tested with OpenCode Go provider

Closes: standalone deployment use case for pi-coding-agent.

- Inventory of GIFs, screenshots, and videos needed for blog posts
- Tracks pending assets: audit trail screenshot, data source GIF,
  multi-agent delegation GIF, WhatsApp interaction GIF
- Blog backlog: architecture deep dive, SDK tutorial, deployment guide
- Links to existing setup demo GIF and voice AI blog content
Add @openzosma/pi-harness — a lightweight, deployable HTTP/SSE server
that wraps pi-coding-agent in headless SDK mode. No TUI, no database,
no auth complexity. One Node.js process serves multiple sessions.

Features:
- Full CLI with subcommands: start, stop, status, setup, tui, logs
- First-run auto-detection with interactive setup wizard
- Native daemon mode (--daemon) with PID tracking
- Real-time SSE streaming of agent events
- Per-session workspace isolation with configurable limits
- Idle session cleanup and health monitoring
- esbuild bundling for standalone npm install (-g)
- Dynamic imports split heavy deps from lightweight CLI commands

Also update root README with pi-harness references in 5 places:
- Standalone harness callout section
- Architecture table callout
- Project structure listing
- Roadmap entry
- Documentation table

Closes standalone deployment use case for pi-coding-agent.
Resolve pnpm-lock.yaml conflict by taking upstream version
and regenerating with pnpm install.
Extend the release workflow to also bump version and publish
@openzosma/pi-harness alongside create-openzosma when a v* tag
is pushed.
- Fix biome formatting in package.json (files field)
- Sort imports across cli.ts, commands.ts, server.ts, tui.ts
- Fix noUnusedTemplateLiteral in cli.ts
- Fix useTemplate in build-bundle.mjs
- Add fsevents and *.node to esbuild externals (upstream dep change)
- Add .npmignore to exclude source maps from published package
- Remove stale .pi-lens cache files
@arjun-zosma arjun-zosma merged commit 93c8117 into zosmaai:main Apr 26, 2026
4 checks passed
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