pi extension providing agent personas: /mainagent command to switch between Markdown-defined personas (model, thinking level, tool filters), with persisted selection across sessions.
@earendil-works/pi-coding-agent (ExtensionAPI, ExtensionContext), pi-tui dialogs, pi-ai model catalogpeerDependenciesextensions/pi-mainagent.ts (entry point: export default function piMainagentExtension)~/.pi/agent/agents/*.md (persona definitions) + ~/.pi/agent/agent-state.json (active persona name)registerCommand("mainagent") → picker dialog → applySelection() mutates session (model, thinking, tool policy, appended prompt) and updates the main-agent-status widgetsession_start (re-apply persisted selection), before_agent_start (persona prompt), session_shutdownpi -e D:/source/pi-mainagentshowSelectDialog, theme-aware)/mainagent off must restore previous session settings exactly (saved in memory, not re-derived)MAX_PROMPT_FILE_BYTES) are rejectedextensions/ ships to npm ("files" in package.json); docs and drafts stay outpeerDependencies only)~/.pi/agent/ (agents dir, state file, prompt files referenced by definitions)extensions/pi-mainagent.tspi -e D:/source/pi-mainagent → run /mainagent in the TUIpackage.json, npm publishSelf-maintenance rule:
When you modify code, update the relevant file in
specs/