pi-roundtable-coding 0.42.0 → 0.44.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 +20 -0
- package/README.md +6 -6
- package/package.json +3 -3
- package/src/coding-desk.ts +94 -407
- package/src/coding-options.ts +21 -4
- package/src/coding-plugin.ts +63 -54
- package/src/desk-modes.ts +107 -0
- package/src/desk-run.ts +279 -0
- package/src/desk-types.ts +5 -0
- package/src/git-run.ts +120 -0
- package/src/index.ts +1 -0
- package/src/pi-coding-worker.ts +26 -3
- package/src/repo-gate.ts +77 -0
- package/src/repo-metadata.ts +72 -0
- package/src/repo-report.ts +16 -0
- package/src/repo-shelf.ts +55 -438
- package/src/repo-types.ts +75 -0
- package/src/task-control.ts +31 -0
- package/src/task-tools.ts +7 -25
- package/src/tool-text.ts +54 -0
- package/src/worker-entry.ts +49 -3
- package/src/worktrees.ts +248 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.44.0] - 2026-11-09
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Two coding workers that start at once on one repository no longer fail now and then with `fatal: failed to read .git/worktrees/1/commondir`, which ended one of the tasks before its worker ran. Git lists every linked worktree while it adds, removes or prunes one and fails on a folder another such call is still writing, so the desk now makes, removes and prunes the worktrees of one clone one at a time.
|
|
10
|
+
|
|
11
|
+
## [0.43.0] - 2026-11-09
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `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.
|
|
16
|
+
- `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.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- 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.
|
|
21
|
+
- 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.
|
|
22
|
+
- 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.
|
|
23
|
+
- 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.
|
|
24
|
+
|
|
5
25
|
## [0.42.0] - 2026-11-08
|
|
6
26
|
|
|
7
27
|
### Added
|
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.
|
|
10
|
+
- pi-roundtable `>=0.44.0 <0.45.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.
|
|
@@ -130,7 +130,7 @@ Cancelling frees the slot, so the next queued task starts; an unknown or finishe
|
|
|
130
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
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
132
|
|
|
133
|
-
On host stop queued tasks are dropped and each gets a report saying it never ran
|
|
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.
|
|
134
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.
|
|
135
135
|
Failures and timeouts also report the final Git state when it can be read.
|
|
136
136
|
By default reports are sent to the caller's surface; `onResult(result)` can instead enqueue a background conversation turn through your host integration.
|
|
@@ -184,8 +184,8 @@ A worker failure carries its exit category and numeric code; git and gh stderr a
|
|
|
184
184
|
Card expiration is determined by the host's surface implementation, not this package.
|
|
185
185
|
|
|
186
186
|
The worker runs in a fresh Bun child process with an unsaved Pi session and uses the public `runWorkerTask` helper.
|
|
187
|
-
|
|
188
|
-
The service advertises running jobs through `busy()` so the host can drain them before shutdown
|
|
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.
|
|
189
189
|
`CodingDesk.busy()` lists running and queued jobs, marking each queued one with its position, and `queuedChannels()` names the channels of queued tasks.
|
|
190
190
|
Jobs are in memory; they do not resume after a crash.
|
|
191
191
|
The injectable `worker` runner must observe aborts and settle its run; this is a trusted test/integration seam.
|
|
@@ -225,8 +225,8 @@ The `CODING` service exposes `shelf: RepoShelf` and `desk: CodingDesk` for trust
|
|
|
225
225
|
| `adoptClones` | `[]` | Startup `{ from, repo }` moves of standalone clones; existing shelf destinations are never replaced. |
|
|
226
226
|
| `resolveRun` | configured model/thinking, caller channel | Per-caller model, thinking, report channel and optional thread origin. |
|
|
227
227
|
| `postChangeReport` | caller surface reply | Post the record using the calling identity and channel. |
|
|
228
|
-
| `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 })`). |
|
|
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. |
|
|
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. |
|
|
230
230
|
| `threads` | none | Public `DispatchThreads`-compatible progress and approval thread port. |
|
|
231
231
|
| `threadText` | English package text | Thread introduction, held-action notice, approval title and final report. |
|
|
232
232
|
| `interimText` | `"on"` | `"off"` keeps the worker's progress out of its thread; pass the host config's `interimText` to follow it. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-roundtable-coding",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.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.
|
|
41
|
+
"pi-roundtable": ">=0.44.0 <0.45.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.
|
|
47
|
+
"pi-roundtable": "0.44.0",
|
|
48
48
|
"typescript": "7.0.2"
|
|
49
49
|
}
|
|
50
50
|
}
|