pi-roundtable-coding 0.40.0 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,32 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.43.0] - 2026-11-09
6
+
7
+ ### Added
8
+
9
+ - `pi-roundtable-coding` exports `DEFAULT_TOOL_TEXT`, the shipped description and argument text of every repository tool, so a host sets `toolText` for only the wording that differs and sees what an upgrade changed. The `presentation` hooks `list`, `changeReport`, `taskStarted` and `taskQueued` now receive the package's own text as a last argument, so a host can append to it instead of replacing it.
10
+ - `pi-roundtable-drawing` takes a `toolText` option, the same for its five tools, and exports `DEFAULT_DRAWING_TOOL_TEXT`; unset text keeps the package wording, and a tool or argument the plugin does not have stops the start.
11
+
12
+ ### Fixed
13
+
14
+ - A deploy no longer cuts a coding worker short without a word. The shutdown drain (`drainSeconds`, now up to 14,400) waits for the desk's running workers and for reports still being delivered. A service can now tell the drain began (`Service.beginDrain()`): the coding desk then starts no queued task, reports each as "not started: host restarting, dispatch again after restart", and refuses `repo_task` with the same message. At the limit the drain calls the new `Service.abort()` before `stop()`, and the desk stops each worker with SIGTERM (the worker saves its tracked changes in a `wip:` commit, `stopGraceMs` of 5 seconds before SIGKILL), keeps its branch and worktree unmerged, and reports where they are.
15
+ - A coding worker that is cancelled or runs out of time is killed at once and its branch is never merged into the clone, even when its worktree is clean; the report names the kept branch and worktree. Only a host shutdown saves a `wip:` commit. `CodingDesk.stop()` stops workers the same way and waits at most `stopWaitMs` (15 seconds) for reports.
16
+ - New `QueuePort.finishing(task)` (absent on an older host): a queue task started inside it, and what it awaits, is admitted although the host is shutting down, until the drain ends. The coding plugin delivers every report through it, so the report of a worker that ends during the drain is no longer refused with "the host is shutting down". After the abort grace the host tells the turns still running in the queue to stop once more, so a report turn begun during the grace cannot run past the drain.
17
+ - A coding worker that gets SIGTERM from outside the desk (a `systemctl kill`, a cgroup-wide stop, a manual `kill`) still saves its `wip:` commit but now reports a `stopped` failure; the desk refuses to merge that run, keeps its branch and worktree, and says so in the report. A run that already timed out is reported as timed out even when `interrupt()` or `stop()` lands afterwards.
18
+
19
+ ## [0.42.0] - 2026-11-08
20
+
21
+ ### Added
22
+
23
+ - A coding worker's yolo mode never approves a call whose class ends in `.yolo-never` (`YOLO_NEVER_CLASS`), even when `autonomy.yolo.allow` names it, matching the core yolo approver.
24
+
25
+ ## [0.41.0] - 2026-11-08
26
+
27
+ ### Added
28
+
29
+ - A coding task can be cancelled. `repo_task_cancel { repo, id, reason? }` drops a queued task before it runs, or stops a running worker the way a timeout does, closing the held actions it waited on; the stopped worker's commits stay on its branch and worktree, not merged into the clone, and its report says "cancelled by <name>" and names both. `repo_task_list { repo? }` lists running and queued tasks. An agent sees and cancels its own tasks, an owner any. The Settings page "Coding workers" lists the tasks with an owner-only Cancel action. `CodingDesk.cancel(id, by)` answers a `CancelResult` and `CodingDesk.tasks()` lists the tasks; `REPO_TOOLS` and `RepoToolName` gain the two names, and the `repo_task` result mentions `repo_task_cancel`.
30
+
5
31
  ## [0.40.0] - 2026-11-08
6
32
 
7
33
  - Release in lockstep with pi-roundtable 0.40.0 (interactive blocks answered in the app, and chats that cannot show them say so); no package-specific behavior changes.
package/README.md CHANGED
@@ -7,7 +7,7 @@ This package is a reference for the plugin guide's [Helpers for a Pi session of
7
7
  ## Requirements
8
8
 
9
9
  - Bun 1.4.4 or newer on a POSIX host (Linux or macOS).
10
- - pi-roundtable `>=0.40.0 <0.41.0` as a peer dependency; this package uses only its public main, kit and testing entries.
10
+ - pi-roundtable `>=0.43.0 <0.44.0` as a peer dependency; this package uses only its public main, kit and testing entries.
11
11
  - Pi `>=1.0.0 <2`, shared with the host's core dependencies.
12
12
  A core-only host still pinned to Pi 0.99.x must update its Pi dependencies before adding coding, so cross-package extension and session types resolve to one Pi version.
13
13
  - Git, plus GitHub CLI (`gh`) for the default clone implementation.
@@ -79,10 +79,12 @@ System report turns cannot call `repo_task`; do the work in the turn or hand it
79
79
  | `repo_add` | `repo` | Clone `owner/repo` into `shelfDir/owner/repo`; refuse invalid names and existing clones. |
80
80
  | `repo_list` | `fetch?` | List paths, branches, upstream ahead/behind counts, dirty files, last commits, prose summaries, CI hints and linked skills. |
81
81
  | `repo_task` | `repo`, `task`, `skills?` | Start a background worker in its own worktree, or queue it when every worker slot is taken, returning its job number (and queue position) immediately. The host's own turns, such as a report's, may not. |
82
+ | `repo_task_list` | `repo?` | List running and queued tasks with id, repository, who started each, when it started or was queued, and the first line of its task. |
83
+ | `repo_task_cancel` | `repo`, `id`, `reason?` | Cancel a task: a queued one is dropped and never runs; a running worker is stopped and its commits stay on its branch, unmerged. |
82
84
  | `repo_change_report` | `repo` | Fetch and post the commits and diffstat ahead of the default branch; return its full SHA. |
83
85
  | `repo_push` | `repo`, `sha` | Push the exact reported SHA to the reported default branch, without force, after the hold gate permits it. |
84
86
 
85
- All five tools have `minTier: "owner"` and are contributed through `defineTool` for agent and owner session selections.
87
+ All seven tools have `minTier: "owner"` and are contributed through `defineTool` for agent and owner session selections.
86
88
  The operator remains responsible for any tool-tier overrides.
87
89
  A custom owner claim with a restricted `ToolSelection` must include the exported `REPO_TOOLS` names; include `skill_list` separately when the host skills addon is enabled.
88
90
  The host's skills addon resolves explicit skills, or the calling agent's carried skills when omitted; an owner call carries none unless it names them.
@@ -115,7 +117,20 @@ Hosts call `desk.setMaxWorkers(n)` for the same change in code, and `desk.worker
115
117
  The page has built-in zh-TW wording for a zh-TW host; `presentation.messages`, keyed by the English text, words it otherwise.
116
118
  Past that a task waits in a first-in, first-out queue of at most `maxQueued` tasks (default 16), and `repo_task` answers at once with its queue position; one more is refused.
117
119
  A queued task starts when a worker slot frees.
118
- On host stop queued tasks are dropped and each gets a report saying it never ran; the shutdown drain waits only for running workers.
120
+ ### Cancelling a task
121
+
122
+ `repo_task_cancel` cancels one task, and `repo_task_list` shows which there are.
123
+ An agent sees and cancels the tasks its own turns started; a turn an owner speaks sees and cancels any; outside an agent's turn a person sees the tasks they started.
124
+ The host's own turns, such as a report's, count as the agent they run for.
125
+ A queued task leaves the queue and never starts; its report says it was cancelled before it ran.
126
+ A running worker is aborted the way a timeout aborts it, and held actions it was waiting on are closed.
127
+ Its commits are kept on its branch and worktree and are not rebased into the clone; the report says "cancelled by <name>" and names the branch, the worktree path and the commits, to inspect, merge or delete.
128
+ The tool waits up to 30 seconds for the worker to settle and answers with the branch and the number of commits kept.
129
+ Cancelling frees the slot, so the next queued task starts; an unknown or finished id is refused.
130
+ The Settings page `coding-workers` lists the running and queued tasks, each with a Cancel action that asks first; only an owner may use it.
131
+ `desk.cancel(id, by)` does the same in code and answers a `CancelResult`: `dropped`, `stopped` (with `branch`, `dir`, `commits` and whether the worker `settled`), or `refused` with a reason; `desk.tasks()` lists the tasks.
132
+
133
+ On host stop queued tasks are dropped and each gets a report saying it never ran. When the shutdown drain begins, the desk starts no queued task: each is reported at once as "not started: host restarting, dispatch again after restart", and `repo_task` is refused with that message until the restart. The drain waits for the running workers and for reports still being delivered; at the drain limit the desk stops each worker gently (SIGTERM, a `wip:` commit of its tracked changes, `stopGraceMs` before SIGKILL), keeps its branch and worktree unmerged, and reports where they are; untracked files are not committed and are listed under Uncommitted. Only a host shutdown saves a `wip:` commit: a cancelled or timed-out worker is killed at once, and its branch is likewise kept, never merged. Reports go out through the host queue's `finishing` lane, so they get through while the host is stopping. `desk.stop()` waits at most `stopWaitMs` (15 seconds by default) for workers and reports, so a report turn still running then does not hold up the shutdown.
119
134
  The worker's report includes its final answer, declined or unanswered actions, calls approved by yolo mode, what became of its branch, branch, HEAD, new commits and uncommitted files.
120
135
  Failures and timeouts also report the final Git state when it can be read.
121
136
  By default reports are sent to the caller's surface; `onResult(result)` can instead enqueue a background conversation turn through your host integration.
@@ -169,8 +184,8 @@ A worker failure carries its exit category and numeric code; git and gh stderr a
169
184
  Card expiration is determined by the host's surface implementation, not this package.
170
185
 
171
186
  The worker runs in a fresh Bun child process with an unsaved Pi session and uses the public `runWorkerTask` helper.
172
- Timeout and shutdown kill its POSIX process group and wait for exit; normal completion also removes shell descendants left in that group.
173
- The service advertises running jobs through `busy()` so the host can drain them before shutdown; queued tasks are not among them.
187
+ A timeout or cancel kills its POSIX process group; a host shutdown sends SIGTERM first, then `stopGraceMs` (5 seconds) before SIGKILL; both wait for exit; normal completion also removes shell descendants left in that group.
188
+ The service advertises running jobs and unsent reports through `busy()` so the host can drain them before shutdown, stops queued tasks from starting through `beginDrain()`, and stops running workers through `abort()` at the drain limit.
174
189
  `CodingDesk.busy()` lists running and queued jobs, marking each queued one with its position, and `queuedChannels()` names the channels of queued tasks.
175
190
  Jobs are in memory; they do not resume after a crash.
176
191
  The injectable `worker` runner must observe aborts and settle its run; this is a trusted test/integration seam.
@@ -210,8 +225,8 @@ The `CODING` service exposes `shelf: RepoShelf` and `desk: CodingDesk` for trust
210
225
  | `adoptClones` | `[]` | Startup `{ from, repo }` moves of standalone clones; existing shelf destinations are never replaced. |
211
226
  | `resolveRun` | configured model/thinking, caller channel | Per-caller model, thinking, report channel and optional thread origin. |
212
227
  | `postChangeReport` | caller surface reply | Post the record using the calling identity and channel. |
213
- | `presentation` | English package text | Separate change-report post/result text, task-start/omitted-skill wording, queued-task wording (`taskQueued(job, position, skipped)`), and the `repo_list` result (`list(repos, { shelfDir, fetched })`). |
214
- | `toolText` | package wording | Trusted description and argument descriptions for each repository tool, as `{ repo_task: { description, parameters: { task: "…" } } }`; it never changes a tool's arguments or approval rules. |
228
+ | `presentation` | English package text | Separate change-report post/result text, task-start/omitted-skill wording, queued-task wording (`taskQueued(job, position, skipped, defaultText)`), and the `repo_list` result (`list(repos, { shelfDir, fetched }, defaultText)`). Each hook is also given the package's own text (`taskStarted(job, skipped, defaultText)`, `changeReport(report, direct, { post, result })`), so a host can append to it, such as the clause that `repo_task_cancel` cancels the task, instead of copying it. |
229
+ | `toolText` | package wording | Trusted description and argument descriptions for each repository tool, as `{ repo_task: { description, parameters: { task: "…" } } }`; it never changes a tool's arguments or approval rules. A host words only what differs: `DEFAULT_TOOL_TEXT`, exported by the package, holds the shipped wording of every tool, to compose on (`{ ...DEFAULT_TOOL_TEXT.repo_task, description: \`${DEFAULT_TOOL_TEXT.repo_task.description} …\` }`) or to compare against after an upgrade. Unset text follows the package. |
215
230
  | `threads` | none | Public `DispatchThreads`-compatible progress and approval thread port. |
216
231
  | `threadText` | English package text | Thread introduction, held-action notice, approval title and final report. |
217
232
  | `interimText` | `"on"` | `"off"` keeps the worker's progress out of its thread; pass the host config's `interimText` to follow it. |
@@ -237,7 +252,7 @@ The `CODING` service exposes `shelf: RepoShelf` and `desk: CodingDesk` for trust
237
252
  | `worker` | `PiCodingWorker` | Trusted worker runner replacement. |
238
253
  | `onResult` | surface reply | Report delivery integration. |
239
254
 
240
- `RepoShelf`, `CodingDesk`, `PiCodingWorker`, `CodingWorkerFailure`, `REPO_TOOLS`, `codingReport`, `integrationText`, `reportPost`, `WORKTREES_DIR` and their option/result types are exported for testing and host integrations.
255
+ `RepoShelf`, `CodingDesk`, `PiCodingWorker`, `CodingWorkerFailure`, `REPO_TOOLS`, `codingReport`, `integrationText`, `reportPost`, `WORKTREES_DIR` and their option/result types, `CancelResult` and `CodingTask` among them, are exported for testing and host integrations.
241
256
  `CodingResult.integration` tells what became of the worker's branch (`merged`, `nothing`, `conflict` with its files, or `refused` with the reason) and `CodingResult.autoApproved` the calls yolo mode approved; `CodingJob.starter` names the conversation and speaker whose modes the worker follows, and `CodingJob.branch` its branch.
242
257
  `resolveRun(turn)` receives the public `ToolTurn`, including the calling agent scope and channel.
243
258
  It returns `{ model, thinking, channel, origin? }`; skill selection still follows the caller, not the resolved report destination.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-roundtable-coding",
3
- "version": "0.40.0",
3
+ "version": "0.43.0",
4
4
  "description": "Repository shelves and owner-approved Pi coding workers for pi-roundtable",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -38,13 +38,13 @@
38
38
  "typebox": "1.3.37"
39
39
  },
40
40
  "peerDependencies": {
41
- "pi-roundtable": ">=0.40.0 <0.41.0"
41
+ "pi-roundtable": ">=0.43.0 <0.44.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@earendil-works/pi-ai": ">=1.0.0 <2",
45
45
  "@biomejs/biome": "2.5.15",
46
46
  "@types/bun": "1.4.3",
47
- "pi-roundtable": "0.40.0",
47
+ "pi-roundtable": "0.43.0",
48
48
  "typescript": "7.0.2"
49
49
  }
50
50
  }