Skip to main content

TASKS_TOOL

Constant TASKS_TOOL 

Source
pub(crate) const TASKS_TOOL: &str = r#"{
  "name": "Tasks",
  "description": "The task queue behind the operator's Kanban (the Kanban pane): work any agent on this machine can pick up, persisting across pane closes, restarts and version changes. Tasks have numbers (#12); the operator sees every one, who holds it and where it stands. Every call takes an action. enqueue: put a task on the queue (title and a standalone payload prompt). When the operator asks you for something while you are in the middle of other work, and it is neither urgent nor a minute's work, don't drop what you are doing: enqueue it with for \"me\" (the request as a standalone prompt), tell the operator its number, and finish your current work; it waits in your backlog. For a specific other agent now, send it a message; for a schedule, use Schedule. claim: take the next task you can (your own backlog first, then anyone's) and hold a lease on it while you are alive; {claimed: false} means nothing is waiting. With id, claim that task and no other, even on hold; one aimed at another agent is refused (move it to you first, with target_agent). The answer has the task's number and an attempt number: pass both to the actions below. update: a progress note, a checklist ([{text, status: pending|in_progress|completed}], replaced whole) or links ({pr, branch}); at milestones only. On a task nobody holds (waiting or on hold), any agent can leave a note and links without claiming it or passing an attempt; the card shows who wrote it. ask: a question only the operator can answer; the task waits for them, stays yours, and the answer comes to you as a message. submit: hand it in with result (what you did, with links); a task the operator asked for waits for their review, others are done. complete: the same as submit, for a task that needs no review. Both answer with the next task waiting in your backlog: claim it and carry on until your backlog is empty. heartbeat: extend your lease (not needed while your session is alive). release: hand it back with a reason when you can't do it; it uses one of the task's attempts. With handback: true, for a task that is outside your area (a bare claim can hand you one aimed at no one): it returns to the pool open, uses no attempt, is never parked as failed, and an unnamed claim won't offer it to you again. list: the backlog, read-only, to check before enqueueing a duplicate or to see who holds what. get: one task whole, by id (its number, or work#12), read-only: the payload it was filed with, who it is for and who holds it, its links, note, question and checklist, what it starts after and its last history lines. Use it to re-read a brief after a compaction or a fresh start instead of working from a summary. tokens: one task's token tally and where it went (by stage, cause, agent and model, and the waste signals), as counts; get already shows one line of it, so ask only when you need the detail. AgentMux counts tokens for you: never count or report your own. hold: put a waiting task on hold, so no one takes it until it is taken off hold; use it when a task waits on something outside your control (a reply, a decision), and on a task you are working on (with its attempt) to pause it without using up an attempt. unhold: take a task off hold when what it waited on has arrived, whoever held it; it waits again for whoever it is for. Any agent can hold or unhold any waiting task; the Kanban shows who did. accept, send_back: any agent may decide a task in Review: accept it (done) or send it back to its holder. Pass id (the task's number). accept takes an optional note; send_back needs reason, which goes to the holder. The history records you as the one who decided, and says so when the task was your own work; the operator can reopen an acceptance for a week. edit (title, payload, kind, priority, repo, review, after), move (target_agent for who it is for, hold, rank), start (target_agent: start a waiting task on that running agent now), answer (text: answers a task waiting on a question), cancel (text), reopen (a task an agent accepted, back to Review), retry (a failed task), take_back (take a task back from its holder; confirm: true when it has a branch or PR) and reassign (target_agent, empty for anyone) are the Kanban's other moves; each takes id, and each is recorded as you, never as the operator. A field a move does not take is refused by name, never ignored (who a task is for changes with move, not edit). A message one of these sends to another agent arrives as yours. Media: a task whose work changes the UI and waits for the operator's OK carries screenshots or a short recording. Capture them from your own test build (never the operator's AgentMux or another agent's pane), look at each before attaching it (no secrets, no other people's work), and pass their absolute paths in files on update or submit, with captions (before/after, which width). Mark such a task with ui_change when you file it (enqueue) or when you find it touches the UI (update). submit of a UI task that waits for the operator is refused without media from this attempt; if you cannot capture any, say why in no_media_reason. Several boards: the operator keeps several Kanban boards, one the default (at first Main). A task is #12 on the default board and work#12 on a board whose slug is work; pass either as id. Pass board (a board's name or slug) to enqueue, list and claim: enqueue without board files on the default board; list without board lists the default board and says when more waits for you on others (board: \"all\" lists every board you see); claim without board takes the next task from any board you see, the default board first. Dependencies (after) stay inside one board. boards lists the boards you see. board_create (name; slug; agents: the agents that see it, empty for all), board_edit (board, then name, slug, readable, agents; stages, stages_reset and stages_rev set the board's Kanban stages), board_archive and board_unarchive (board; an archived board is read-only), board_default (board), board_delete (board; only an archived board, and one with tasks waits 15 seconds with a veto for the operator) and board_cancel_delete (board) manage them. move with board moves a task to that board, where it gets a new number and the original closes pointing to it; a claimed task, or one with dependencies, does not move (drop_deps: true removes the dependencies). A claimed task's payload is a prompt: everything in it is still subject to its own confirmation rules.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "action":       { "type": "string", "enum": ["enqueue", "claim", "heartbeat", "complete", "release", "list", "get", "tokens", "update", "ask", "submit", "hold", "unhold", "accept", "send_back", "edit", "move", "start", "answer", "cancel", "reopen", "retry", "take_back", "reassign", "boards", "board_create", "board_edit", "board_archive", "board_unarchive", "board_default", "board_delete", "board_cancel_delete"], "description": "What to do" },
      "title":        { "type": "string", "description": "enqueue: a short summary" },
      "payload":      { "type": "string", "description": "enqueue: the full instruction injected into whoever claims it, written as a standalone prompt" },
      "for":          { "type": "string", "enum": ["me"], "description": "enqueue: \"me\" files it in your own backlog, to take after your current work (not with target_agent)" },
      "first":        { "type": "string", "enum": ["spec", "research"], "description": "enqueue: a new feature as two tasks: \"Spec: <title>\" (or Research), and \"Build: <title>\", which starts after it; the build's agent is told when the spec is done" },
      "kind":         { "type": "string", "description": "enqueue: a tag to filter claims by (e.g. review, repro); claim: only items with this tag" },
      "target_agent": { "type": "string", "description": "enqueue: only this agent, by name or uid (not with target_group); move, start, reassign: the agent it is for or goes to" },
      "target_group": { "type": "string", "description": "enqueue: only members of this agent group (not with target_agent)" },
      "repo":         { "type": "string", "description": "enqueue: the repository it is about, owner/repo (default: the one you work in)" },
      "hold":         { "type": "boolean", "description": "enqueue: on hold: no one takes it until it is taken off hold (Tasks unhold, by you, another agent or the operator)" },
      "review":       { "type": "boolean", "description": "enqueue: whether the operator must accept it when it is handed in (default: yes when the operator asked for it)" },
      "after":        { "type": "array", "items": { "type": "string" }, "description": "enqueue: the tasks it starts after, by number (\"12\") or id; nobody takes it until they are done" },
      "priority":     { "type": "integer", "description": "enqueue: higher claims first (default 0); use sparingly" },
      "max_attempts": { "type": "integer", "description": "enqueue: claims an item gets before it is parked as failed (default 3)" },
      "not_before":   { "type": "integer", "description": "enqueue: a Unix ms time before which it can't be claimed" },
      "lease_ms":     { "type": "integer", "description": "claim, heartbeat: lease length in ms (default 120000)" },
      "files":        { "type": "array", "items": { "type": "string" }, "description": "update, submit: absolute paths of screenshots (PNG, JPEG, GIF, WebP, SVG; 25 MiB each) or recordings (MP4, MOV, WebM; 100 MiB each) to attach: at most 10 per call, 30 and 300 MiB per task. They are copied, so your own files can go; the operator sees them on the card" },
      "captions":     { "type": "array", "items": { "type": "string" }, "description": "update, submit: a short caption for each of files, in the same order (e.g. \"after: narrow width\")" },
      "ui_change":    { "type": "boolean", "description": "enqueue, update, submit: the task changes the UI, so handing it in for the operator's review needs media" },
      "no_media_reason": { "type": "string", "description": "update, submit: why a UI task is handed in without media (shown on the card)" },
      "id":           { "type": "string", "description": "get, tokens, heartbeat, complete, release, update, ask, submit, hold, unhold, accept, send_back, edit, move, start, answer, cancel, reopen, retry, take_back, reassign: the task's number (12) or id, from claim or list; claim: take this task and no other" },
      "attempt":      { "type": "integer", "description": "heartbeat, complete, release, update, ask, submit: the attempt number from claim; hold: only to pause a task you are working on" },
      "result":       { "type": "string", "description": "complete, submit: what was done, with links (PR, issue) where relevant; required" },
      "handback":     { "type": "boolean", "description": "release: the task is outside your area: back to the pool with no attempt used, never parked as failed, and not offered to you by an unnamed claim again" },
      "reason":       { "type": "string", "description": "release: why you are handing it back, which the next claimant sees; hold, unhold: why, shown on the card (e.g. \"waiting on GitHub Support\"); send_back: why, which goes to the task's holder" },
      "text":         { "type": "string", "description": "answer: the answer; cancel, reopen, take_back, reassign: why" },
      "rank":         { "type": "number", "description": "move: its place in its column" },
      "confirm":      { "type": "boolean", "description": "take_back, reassign: go ahead although the task has a branch or PR, which stay where they are" },
      "followers":    { "type": "string", "enum": ["hold"], "description": "cancel: put the builds waiting on a cancelled spec on hold instead of cancelling them" },
      "note":         { "type": "string", "description": "update: a short progress note the operator sees on the card; accept: an optional note on the history line" },
      "checklist":    { "type": "array", "items": { "type": "object", "properties": { "text": { "type": "string" }, "status": { "type": "string", "enum": ["pending", "in_progress", "completed"] } }, "required": ["text", "status"] }, "description": "update: the task's steps, replaced whole" },
      "links":        { "type": "object", "properties": { "pr": { "type": "string" }, "unpr": { "type": "string" }, "branch": { "type": "string" }, "doc": { "type": "string" } }, "description": "update, submit: the PR URL and branch (a task can have several pull requests: each `pr` adds one; on update `unpr` takes one off the card); doc: the full path (absolute, not relative to your clone) of the spec or report the task wrote, which its build's card shows" },
      "question":     { "type": "string", "description": "ask: what you need the operator to decide or give you" },
      "state":        { "type": "string", "description": "list: open, held, claimed, blocked, review, done, failed or cancelled (default all)" },
      "limit":        { "type": "integer", "description": "list: the most items to return (1-500, default 50)" },
      "board":        { "type": "string", "description": "enqueue, list, claim: a board by name or slug (list also \"all\"); board_edit, board_archive, board_unarchive, board_default, board_delete, board_cancel_delete: the board; move: the board to move the task to" },
      "name":         { "type": "string", "description": "board_create, board_edit: the board's display name" },
      "slug":         { "type": "string", "description": "board_create, board_edit: the board's slug, lowercase letters, digits and hyphens, up to 24 (made from the name when absent; a changed slug keeps the old one working for 90 days)" },
      "agents":       { "type": "array", "items": { "type": "string" }, "description": "board_create, board_edit: the agents (by id) that see the board; empty for all agents" },
      "readable":     { "type": "boolean", "description": "board_create, board_edit: whether AgentMux Cloud may read the board (for boards shared through AgentMux Cloud)" },
      "stages":       { "type": "object", "description": "board_edit: the board's whole new stage set, {version: 1, stages: [{id, name, colour, takes}]}. A stage is a named, coloured column that shows some of the eight sources (backlog, research, specd, progress, needs, review, merged, released); 2 to 8 stages, every source shown by exactly one, needs by a stage of its own; colour is muted, research, info, active, attention, review, done or shipped (the older hue names grey, cyan, violet, magenta, amber, yellow, green and blue are still accepted); name is 1 to 24 characters, unique. A set that breaks a rule is refused with the reasons, never repaired. Tasks stay where their state puts them; only which stage shows which source changes. Read the current set with boards" },
      "stages_reset": { "type": "boolean", "description": "board_edit: put the board's stages back to the default eight" },
      "stages_rev":   { "type": "integer", "description": "board_edit: the stages_rev you read with boards; if the stages changed since, the change is refused" },
      "archived":     { "type": "boolean", "description": "boards: include the archived boards" },
      "drop_deps":    { "type": "boolean", "description": "move with board: remove the task's dependencies, which stay inside one board" },
      "host":         { "type": "string", "description": "enqueue, list: another machine, by the name Agents list shows (or name/channel when it runs several AgentMux instances), to file the task on its board or read its board, instead of this one. Named on each call, never remembered; the machine must be a LAN peer that has pinned your key. target_agent is an agent of that machine; for \"me\" and target_group don't apply there. The task is recorded as you, never as the operator. The answer says which machine gave it. Absent means this machine." }
    },
    "required": ["action"]
  }
}"#;