pi: change model and agent harness as uiux for subagent extensions

This commit is contained in:
Rasyidan Akbar F. 2026-03-16 07:01:29 +07:00
commit b31929bbf3
9 changed files with 577 additions and 51 deletions

View file

@ -0,0 +1,39 @@
/**
* Clipboard Image Labels
*
* Adds [Image #N] labels to messages that include pasted images,
* matching the Claude Code / Codex visual style.
*
* Usage:
* - Paste: Ctrl+V (Alt+V on Windows)
* - Drag: drag any image file onto the terminal
*
* When images are detected, [Image #1], [Image #2], labels are
* appended to the message text so they appear in the conversation
* history and are visible to the LLM alongside the actual image data.
*
* A small notification confirms how many images were attached.
*/
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
export default function (pi: ExtensionAPI) {
pi.on("input", async (event, ctx) => {
// Nothing to do when no images are attached
if (!event.images || event.images.length === 0) {
return { action: "continue" };
}
// Build [Image #N] labels one per attached image
const labels = event.images.map((_img, i) => `[Image #${i + 1}]`).join(" ");
// Append labels after any typed text (or use them alone if no text)
const newText = event.text?.trim() ? `${event.text.trim()}\n\n${labels}` : labels;
// Brief confirmation so the user knows the paste registered
const count = event.images.length;
ctx.ui.notify(`📎 ${count} image${count > 1 ? "s" : ""} attached`, "info");
// Transform keeps the original images intact; only the text changes
return { action: "transform", text: newText };
});
}

View file

@ -4,7 +4,7 @@ Installed roles:
- `reviewer` — review changes, bugs, risks, maintainability
- `librarian` — explore and map a codebase
- `uiux-designer` — UI/UX design direction, flows, states, and implementation guidance
- `design-engineer` — frontend-aware UI/UX direction, design systems, and implementation-ready recommendations
- `executor` — implement ordered coding tasks from a defined todo list
- `planner` — interactive planning specialist that can ask clarifying questions and return an ordered executor-ready todo list
@ -16,8 +16,8 @@ Installed roles:
## Example prompts
- `Use the subagent tool with reviewer to inspect the auth refactor.`
- `Use subagent in parallel: librarian maps the settings flow, uiux-designer proposes an improved UX direction, reviewer lists product and implementation risks.`
- `Chain librarian -> uiux-designer to redesign onboarding. Use {previous} in the second task.`
- `Use subagent in parallel: librarian maps the settings flow, design-engineer proposes an improved UX direction, reviewer lists product and implementation risks.`
- `Chain librarian -> design-engineer to redesign onboarding. Use {previous} in the second task.`
- `Use executor to implement this ordered todo list exactly as written, then summarize what was completed and validated.`
- `Use planner to clarify ambiguity only when needed and output an ordered implementation todo list for executor handoff.`
@ -37,7 +37,7 @@ Installed roles:
- Parallel mode allows up to 8 tasks and runs up to 4 concurrently
- `reviewer` uses `openai-codex/gpt-5.4:xhigh`
- `librarian` uses `anthropic/claude-sonnet-4-6`
- `uiux-designer` uses `google-antigravity/gemini-3.1-pro-high`
- `design-engineer` uses `google-antigravity/gemini-3-flash`
- `executor` uses `openai-codex/gpt-5.3-codex:high`
- `planner` uses `anthropic/claude-sonnet-4-6`

View file

@ -335,7 +335,7 @@ export default function (pi: ExtensionAPI) {
description: [
"Delegate work to specialized subagents with isolated context.",
"Supports single, parallel, and chained execution.",
"Useful built-in roles: reviewer, librarian, uiux-designer, executor.",
"Useful built-in roles: reviewer, librarian, design-engineer, executor.",
'Default scope is "user" (~/.pi/agent/agents). Set agentScope to "both" or "project" to include repo-local agents.',
].join(" "),
parameters: SubagentParams,