@zachwill/pi-orchestrate 0.6.0 → 0.7.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/README.md +2 -2
- package/extension/contract.ts +2 -2
- package/extension/tools.ts +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Pi Orchestrate adds exactly five tools:
|
|
|
17
17
|
| Tool | Call | Purpose |
|
|
18
18
|
| --- | --- | --- |
|
|
19
19
|
| `orchestrate` | `orchestrate({ worker, title, instructions })` | Start one worker task |
|
|
20
|
-
| `
|
|
20
|
+
| `worker_status` | `worker_status({})` | Inspect the aggregate worker-system diagnostics and recovery snapshot |
|
|
21
21
|
| `interactive_send` | `interactive_send({ worker_id, instructions })` | Send a follow-up to a ready interactive worker |
|
|
22
22
|
| `worker_abort` | `worker_abort({ worker_ids })` or `worker_abort({ all: true })` | Stop active owned work |
|
|
23
23
|
| `interactive_close` | `interactive_close({ worker_id })` | Close a ready interactive worker |
|
|
@@ -47,7 +47,7 @@ Asynchronous worker results enter the transcript individually. An ungrouped resu
|
|
|
47
47
|
|
|
48
48
|
All state and delivery are owner-scoped. If an owning session is busy or inactive, completed results queue until that exact session is active and idle again. They are never delivered to another session.
|
|
49
49
|
|
|
50
|
-
`
|
|
50
|
+
`worker_status` is the aggregate worker-system diagnostics and recovery snapshot, containing the trusted catalog, diagnostics, runs, and worker states. It is not for completion polling and exposes bounded owner-scoped state without full task instructions or worker prompts.
|
|
51
51
|
|
|
52
52
|
The bottom widget shows active work only. Completed, failed, aborted, and interactive ready workers disappear immediately. Inline work shows its current response in the live tool output while it blocks.
|
|
53
53
|
|
package/extension/contract.ts
CHANGED
|
@@ -41,11 +41,11 @@ You are the parent orchestrator and own the task end to end.
|
|
|
41
41
|
- Input, catalog, and model preflight is atomic per call before that worker starts. Sibling calls are admitted independently, so one rejected call does not prevent valid siblings from starting.
|
|
42
42
|
- Pi Orchestrate treats a successfully admitted sole \`orchestrate\` call or pure sibling group as async. Pi executes native sibling tools concurrently. A pure group yields the parent turn, delivers each result as it settles, and starts synthesis only after the whole group settles. Mixing \`orchestrate\` with another tool makes it inline and blocking. \`interactive_send\` is asynchronous only as the sole tool call in its assistant message.
|
|
43
43
|
- Exact worker instructions remain visible in the tool call and can be expanded; titles are labels, not substitutes for complete messages.
|
|
44
|
-
- After the full current wave has been dispatched, yield the parent turn once its admissions have resolved; a rejected sibling does not block yielding. Worker responses arrive individually as each worker settles, and the final response starts parent synthesis. Do not poll \`
|
|
44
|
+
- After the full current wave has been dispatched, yield the parent turn once its admissions have resolved; a rejected sibling does not block yielding. Worker responses arrive individually as each worker settles, and the final response starts parent synthesis. Do not poll \`worker_status\` or use it as a normal completion mechanism.
|
|
45
45
|
- As results expose more useful independent scopes or materially distinct perspectives, enumerate and dispatch another full parallel wave before yielding. Continue adaptive full waves until the whole task is complete.
|
|
46
46
|
- The parent synthesizes worker results, reviews their evidence and changes, resolves conflicts, integrates the final result, and runs the relevant verification before declaring completion.
|
|
47
47
|
- Prefer one-shot workers. Use \`interactive_send\` only for follow-up work on an owned lifecycle interactive worker whose status is ready, and \`interactive_close\` only when that ready interactive worker is finished. Never use either tool for one-shot or completed workers because one-shot sessions terminate automatically. Use \`worker_abort\` only when active work must stop.
|
|
48
|
-
- The public tools are \`orchestrate\`, \`
|
|
48
|
+
- The public tools are \`orchestrate\`, \`worker_status\`, \`interactive_send\`, \`worker_abort\`, and \`interactive_close\`.
|
|
49
49
|
|
|
50
50
|
### Trusted worker catalog
|
|
51
51
|
|
package/extension/tools.ts
CHANGED
|
@@ -175,17 +175,17 @@ export function registerOrchestrationTools(
|
|
|
175
175
|
});
|
|
176
176
|
|
|
177
177
|
pi.registerTool({
|
|
178
|
-
name: "
|
|
179
|
-
label: "
|
|
178
|
+
name: "worker_status",
|
|
179
|
+
label: "Worker Status",
|
|
180
180
|
description:
|
|
181
181
|
"Diagnostics and recovery only: inspect trusted catalog entries, catalog diagnostics, and this session's runtime state. Never poll for completion.",
|
|
182
|
-
promptSnippet: "Inspect owned
|
|
182
|
+
promptSnippet: "Inspect owned worker state for diagnostics or recovery",
|
|
183
183
|
promptGuidelines: [
|
|
184
|
-
"Use
|
|
184
|
+
"Use worker_status only for diagnostics or recovery; never poll it for completion.",
|
|
185
185
|
],
|
|
186
186
|
parameters: statusSchema,
|
|
187
187
|
renderCall(_args, theme) {
|
|
188
|
-
return new Text(theme.fg("toolTitle", theme.bold("
|
|
188
|
+
return new Text(theme.fg("toolTitle", theme.bold("worker_status")), 0, 0);
|
|
189
189
|
},
|
|
190
190
|
renderResult(result, { isPartial }, theme) {
|
|
191
191
|
return renderDiagnosticsResult(result, isPartial, theme);
|
|
@@ -204,7 +204,7 @@ export function registerOrchestrationTools(
|
|
|
204
204
|
content: [
|
|
205
205
|
{
|
|
206
206
|
type: "text",
|
|
207
|
-
text: readableDetails("
|
|
207
|
+
text: readableDetails("Worker diagnostics and recovery snapshot.", readable),
|
|
208
208
|
},
|
|
209
209
|
],
|
|
210
210
|
details: readable,
|
|
@@ -837,7 +837,7 @@ function formatElapsed(milliseconds: number): string {
|
|
|
837
837
|
}
|
|
838
838
|
|
|
839
839
|
function renderDiagnosticsResult(result: AgentToolResult<unknown>, isPartial: boolean, theme: Theme): Text {
|
|
840
|
-
if (isPartial) return new Text(theme.fg("muted", "Reading
|
|
840
|
+
if (isPartial) return new Text(theme.fg("muted", "Reading worker diagnostics…"), 0, 0);
|
|
841
841
|
const details = result.details;
|
|
842
842
|
if (isRecord(details) && isRecord(details.state) && Array.isArray(details.state.workers)) {
|
|
843
843
|
const workers = details.state.workers.filter(isRecord);
|