Integration Modes
1) PI as Workflow Agent
PiAgent supports all PI CLI flags: provider/model, tools, extensions, skills, prompt templates, themes, and sessions. Text mode uses --print by default; JSON/RPC modes set --mode and omit --print.
PI sessions are first-class hijack targets. smithers hijack <runId> --target pi reopens the PI session for local steering.
2) PI Server Client
Usepi-plugin to drive Smithers server APIs from a PI extension or any Node process:
3) Hybrid: PI Extensibility + Smithers Orchestration
- Keep orchestration in Smithers (
<Sequence>,<Parallel>,<Branch>,<Loop>). - Run adaptive logic in PI tasks (extensions/skills/provider overrides).
- PI skill-driven coding task inside a Smithers
<Task>. - PI extension command that starts/resumes Smithers workflows via server API or pi-plugin.
- Smithers workflow output persisted to SQLite and consumed by later PI-assisted tasks.
Hijacking PI Sessions
PI is a native-session hijack backend.- Live run: Smithers watches PI’s event stream, waits between blocking tool calls, then hands off the session.
- Finished/cancelled run: Smithers reopens the latest persisted PI session.
- Relaunch uses the stored session ID:
pi --session <id>. - Clean exit resumes the workflow automatically.
PiAgentdefaultsnoSessiontotruefor one-shot calls.- For workflow hijack/resume/streaming, Smithers keeps session persistence enabled automatically.
- No need to set
mode: "json"manually for hijack support.
Setup
- Install PI CLI and add to
PATH. - Configure PI credentials via env/config (prefer over CLI args for API keys).
- Instantiate
PiAgentwith explicit options in workflows. - For server-driven workflows, use
pi-plugin.
Design Guidance
Use PiAgent tasks when | Use Smithers-native tasks when |
|---|---|
| You need PI capabilities inside deterministic workflows | You need strict reproducibility and narrow tool contracts |
| You want PI calls as auditable workflow steps |