Skip to content

Plan

ui.Plan is a component that shows an AI agent’s plan as a checklist: each step is pending (an empty circle), in progress (a dot, or a spinner with running=True) or done (a green check, with its text dimmed), and the header counts done/total. Clicking the header folds and unfolds the steps. steps are dicts with step (the text) and status: "pending", "in_progress" or "done".

ui.Plan · Category: AI agents · Full reference →

PlanPlan
  • Above an agent’s chat, while it works through a task of several steps.
  • For any list of steps that updates as the work goes on, such as an install or a migration.
import pyzed as pz
from pyzed import ui
class Agent(pz.App):
def __init__(self):
self.steps = [{"step": "Add the form", "status": "done"},
{"step": "Wire the events", "status": "in_progress"}]
self.working = True
def view(self):
return ui.Plan(steps=self.steps, running=self.working)

Without running the step in progress shows a dot; folded is drawn as after a click on the header.

Plan: running=TruePlan: running=True
running=True
Code
pz.container(ui.Plan(steps=[{"step": "Add the form", "status": "done"},
{"step": "Wire the events", "status": "in_progress"},
{"step": "Run the tests", "status": "pending"}],
running=True), width=300)
Plan: running=FalsePlan: running=False
running=False
Code
pz.container(ui.Plan(steps=[{"step": "Add the form", "status": "done"},
{"step": "Wire the events", "status": "in_progress"},
{"step": "Run the tests", "status": "pending"}]), width=300)
Plan: All pendingPlan: All pending
All pending
Code
pz.container(ui.Plan(steps=[{"step": "Add the form", "status": "pending"},
{"step": "Run the tests", "status": "pending"}]), width=300)
Plan: All donePlan: All done
All done
Code
pz.container(ui.Plan(steps=[{"step": "Add the form", "status": "done"},
{"step": "Run the tests", "status": "done"}]), width=300)
Plan: FoldedPlan: Folded
Folded
Code
pz.container(ui.Plan(steps=[{"step": "Add the form", "status": "done"},
{"step": "Run the tests", "status": "pending"}]), width=300)

Plan has no events of its own: it shows what you give it. Like every widget it also has the 18 common events (click, double_click, right_click, mouse_enter, drag, key_down, resize…), attached with .on(...): see Events and Events of every component.

It is a pz.Component, so it also raises on_mount and on_unmount, and its handlers get a pz.Event whose value holds the data.

class Plan

A component for an agent’s plan: a checklist with done/total in its header, which folds it.

Property Default Description
steps None {"step": text, "status": "pending" | "in_progress" | "done"} dicts.
running False Spins the step in progress.
theme None Theme.

Full reference →