/**
* PlanView renders the agent's current execution plan (ACP "plan" updates)
* as a compact checklist, like the plan block of Zed's agent panel.
*
* @example
*
*/
import type { AcpPlanEntry } from "../protocol";
import { InlineText } from "./InlineText";
const statusMarks: Record = {
pending: "○",
in_progress: "◐",
completed: "●",
};
export function PlanView({ entries }: { entries: AcpPlanEntry[] }) {
if (entries.length === 0) {
return null;
}
return (
Plan ({entries.filter((e) => e.status === "completed").length}/
{entries.length})
{entries.map((entry, index) => (
// biome-ignore lint/suspicious/noArrayIndexKey: ACP plan entries carry no id and the list is replaced wholesale on every update.
-
{statusMarks[entry.status] ?? "○"}{" "}
))}
);
}