/** * orchestrate.ts — Claude Code-style /goal and /loop for pi. * * /goal set a completion condition; pi keeps working across * turns until a small model confirms the condition is * met, then clears the goal automatically. * /goal show status (condition, duration, turns, last reason). * /goal clear remove the active goal (stop|off|reset|none|cancel ok). * Stop means stop: also stops a running /loop and aborts * the in-flight turn, since a runaway "goal" report is * usually a loop the user can't see from /goal. * * /loop [interval] re-run a prompt while the session stays open. * /loop 5m check if the deploy finished * /loop check if the deploy finished (self-paced: next turn after each agent_end) * /loop (uses .pi-loop.md or a default maintenance prompt) * /loop show status. * /loop stop stop the loop. * * One goal per session. One loop per session. State persists to * /.pi-goal/state.json so it survives --resume — but it is stamped with * the owning session file and is ONLY re-adopted by that exact session. * Other instances in the same cwd ignore it (a cwd-keyed file with no owner * check used to leak goals into every concurrent session). Ephemeral * sessions keep goal/loop state in memory only. The evaluator reads the * transcript tail and calls no tools (cheap, fast — Claude Code semantics). */ import { type ExtensionAPI } from '@earendil-works/pi-coding-agent'; export default function (pi: ExtensionAPI): void;