Skip to content

feat(examples): add pi-agent-harness#662

Merged
zahlekhan merged 2 commits into
mainfrom
feat/pi-agent-harness
Jun 18, 2026
Merged

feat(examples): add pi-agent-harness#662
zahlekhan merged 2 commits into
mainfrom
feat/pi-agent-harness

Conversation

@vishxrad

Copy link
Copy Markdown
Contributor

Summary

Adds a new example: a web frontend that chats with the pi coding agent and renders its answers as generative UI with OpenUI. It also introduces a harnesses/ parent folder under examples/ for coding-agent harness integrations, with a matching "Harnesses" group in the docs.

What is included

  • examples/harnesses/pi-agent-harness/: a single Next.js app. The /api/chat route bridges the pi SDK (@earendil-works/pi-coding-agent) to the OpenUI frontend over an OpenAI-compatible NDJSON stream. Each chat thread maps to a persistent pi AgentSession, and the agent's reasoning and tool executions are surfaced as cards in the "behind the scenes" panel.
  • Docs: a new example page under "OpenUI Lang > Harnesses", plus a demo video.

Notes

  • The pi SDK is ESM-only and Node-only, so it is loaded as a webpack external and the example runs with next dev --webpack.
  • The agent runs with the full read/bash/edit/write toolset and the route is unauthenticated, which is fine for local use. The README and docs explain how to lock it down for networked use (PI_WEB_TOOLS=read-only, auth, loopback binding, sandboxing).
  • The agent operates on a workspace directory passed at launch (pnpm dev -- /path).

Testing

Developed and verified as a standalone app against the npm-published pi SDK: token streaming, multi-turn context, and the tool and thinking cards all work, and the docs page renders locally with the new Harnesses nav. It has not been run through a full pnpm install and build inside this monorepo yet.

vishxrad added 2 commits June 17, 2026 02:14
A Next.js app that chats with the pi coding agent and renders its answers as generative UI with OpenUI. The /api/chat route bridges the pi SDK (@earendil-works/pi-coding-agent) to the frontend over an OpenAI-compatible NDJSON stream; each chat thread maps to a persistent pi AgentSession, and the agent's reasoning and tool runs are forwarded as cards. Adds a harnesses/ parent folder for harness examples.
New OpenUI Lang example page under a Harnesses group, with a demo video.
@zahlekhan zahlekhan merged commit 942fbf6 into main Jun 18, 2026
1 check passed
@zahlekhan zahlekhan deleted the feat/pi-agent-harness branch June 18, 2026 06:05
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.

2 participants