pi-squire 0.5.0 → 0.6.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 +27 -1
- package/README.md +7 -3
- package/package.json +1 -1
- package/src/index.ts +4 -2
- package/src/tracking.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,30 @@ follows [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.6.0] - 2026-10-15
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Every delegate now starts with `PI_UNATTENDED=1` in its environment, a
|
|
14
|
+
general signal that no human is watching the session. Delegates run as a
|
|
15
|
+
full TUI, so extensions that open a dialog, such as a handoff gate or an
|
|
16
|
+
approval prompt, waited on nobody and stalled the delegate; they can read
|
|
17
|
+
this variable to skip the dialog instead. The test that pins the child's
|
|
18
|
+
exact environment now includes it.
|
|
19
|
+
|
|
20
|
+
## [0.5.1] - 2026-10-14
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- The `delegate` tool's description now tells the parent to keep working or
|
|
25
|
+
end its turn while a delegate runs, since the result starts its next turn
|
|
26
|
+
on its own; the launch message says the same in place of pointing at
|
|
27
|
+
`delegation_status`. GPT parents asked their own delegates for the result
|
|
28
|
+
with `session_mail_ask`, so each report arrived twice.
|
|
29
|
+
- The `delegation_status` description now says to call it to check on a
|
|
30
|
+
delegation that seems stuck or to find its files, not to wait for a result,
|
|
31
|
+
which arrives as a message on its own.
|
|
32
|
+
|
|
9
33
|
## [0.5.0] - 2026-10-13
|
|
10
34
|
|
|
11
35
|
### Changed
|
|
@@ -215,7 +239,9 @@ author's dotfiles; the changes below are against that copy.
|
|
|
215
239
|
|
|
216
240
|
- The published file list includes `child.ts`, which `index.ts` imports.
|
|
217
241
|
|
|
218
|
-
[Unreleased]: https://github.com/gvanderclay/pi-squire/compare/v0.
|
|
242
|
+
[Unreleased]: https://github.com/gvanderclay/pi-squire/compare/v0.6.0...HEAD
|
|
243
|
+
[0.6.0]: https://github.com/gvanderclay/pi-squire/compare/v0.5.1...v0.6.0
|
|
244
|
+
[0.5.1]: https://github.com/gvanderclay/pi-squire/compare/v0.5.0...v0.5.1
|
|
219
245
|
[0.5.0]: https://github.com/gvanderclay/pi-squire/compare/v0.4.0...v0.5.0
|
|
220
246
|
[0.4.0]: https://github.com/gvanderclay/pi-squire/compare/v0.3.2...v0.4.0
|
|
221
247
|
[0.3.2]: https://github.com/gvanderclay/pi-squire/compare/v0.3.1...v0.3.2
|
package/README.md
CHANGED
|
@@ -178,7 +178,11 @@ variable of its own. `PI_DELEGATE_PARENT` and `PI_DELEGATE_AUTO_EXIT` are set
|
|
|
178
178
|
for the child, never read as configuration by the parent. The window starts
|
|
179
179
|
with the tmux server's environment plus only these from the parent:
|
|
180
180
|
`PI_CODING_AGENT_DIR`, `PI_CODING_AGENT_SESSION_DIR` (when the parent has it
|
|
181
|
-
set), `PI_DELEGATE_PARENT` and `PI_DELEGATE_AUTO_EXIT
|
|
181
|
+
set), `PI_DELEGATE_PARENT` and `PI_DELEGATE_AUTO_EXIT`, and it always gets `PI_UNATTENDED=1`.
|
|
182
|
+
`PI_UNATTENDED=1` is a general signal, not specific to pi-squire: no human is
|
|
183
|
+
watching this session, even though it runs in a TUI. Other extensions may read
|
|
184
|
+
it to skip a dialog or confirmation instead of waiting on one, and any other
|
|
185
|
+
runner that starts Pi unattended can set it too. Anything else the
|
|
182
186
|
parent process has, such as a `CLAUDE_CONFIG_DIR` set by a shell alias,
|
|
183
187
|
reaches the child only through a `session:launch` contributor. `--model` and
|
|
184
188
|
`--thinking` override the agent's defaults for one call, and an unknown value
|
|
@@ -557,8 +561,8 @@ Other extensions may rely on:
|
|
|
557
561
|
- the `[delegate]` result text and the closed-without-a-result text;
|
|
558
562
|
- `AGENT.md`'s frontmatter keys and its location,
|
|
559
563
|
`<agent dir>/agents/<name>/AGENT.md`;
|
|
560
|
-
- the child environment variables `PI_DELEGATE_PARENT
|
|
561
|
-
`PI_DELEGATE_AUTO_EXIT`.
|
|
564
|
+
- the child environment variables `PI_DELEGATE_PARENT`,
|
|
565
|
+
`PI_DELEGATE_AUTO_EXIT` and `PI_UNATTENDED=1`.
|
|
562
566
|
|
|
563
567
|
A `message:*` provider must:
|
|
564
568
|
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -312,7 +312,7 @@ function thinkingProblem(value: string): string | undefined {
|
|
|
312
312
|
/** The `delegate` tool's description: what delegation does, and the roster as it stands. */
|
|
313
313
|
function toolDescription(agents: readonly Agent[]): string {
|
|
314
314
|
const intro =
|
|
315
|
-
"Hand a self-contained task to a delegate Pi session in a background tmux window, so it works while you do not. Each call starts the delegation at once; the delegate runs in this session's working directory and agent root and reports back later as one message. Use it when the work is self-contained and you would rather keep your own context for it.";
|
|
315
|
+
"Hand a self-contained task to a delegate Pi session in a background tmux window, so it works while you do not. Each call starts the delegation at once; the delegate runs in this session's working directory and agent root and reports back later as one message. While it runs, keep working or end your turn: its result starts your next turn on its own, so there is no need to ask the delegate for it or poll delegation_status. Use it when the work is self-contained and you would rather keep your own context for it.";
|
|
316
316
|
if (agents.length === 0) {
|
|
317
317
|
return `${intro}\n\nNo agents are defined yet. Add ${join(
|
|
318
318
|
getAgentDir(),
|
|
@@ -469,6 +469,8 @@ export default function delegate(
|
|
|
469
469
|
PI_CODING_AGENT_DIR: getAgentDir(),
|
|
470
470
|
[PARENT_ENV]: parent,
|
|
471
471
|
[AUTO_EXIT_ENV]: start.autoExit ? "1" : "0",
|
|
472
|
+
// A general signal for any extension: no human watches this session, so don't wait on a dialog.
|
|
473
|
+
PI_UNATTENDED: "1",
|
|
472
474
|
};
|
|
473
475
|
if (start.rest.length > 0) env[FALLBACK_ENV] = start.rest.join(",");
|
|
474
476
|
const sessionDir = process.env[SESSION_DIR_ENV];
|
|
@@ -581,7 +583,7 @@ export default function delegate(
|
|
|
581
583
|
const launched = await launch(start, ctx);
|
|
582
584
|
ctx.ui.notify(started(launched, start), "info");
|
|
583
585
|
return toolResult(
|
|
584
|
-
`Started delegation ${launched.id}: ${start.agent.name} (${start.model}, thinking ${start.thinking}) in window ${launched.windowName}. It runs in the background and its result arrives as a message
|
|
586
|
+
`Started delegation ${launched.id}: ${start.agent.name} (${start.model}, thinking ${start.thinking}) in window ${launched.windowName}. It runs in the background, and its result arrives as a message that starts your next turn on its own; delegation_close ends it.${start.skipped.length > 0 ? ` ${fallbackNote(start)}` : ""}${start.notices.map((line) => ` ${line}`).join("")}`,
|
|
585
587
|
{
|
|
586
588
|
outcome: "started",
|
|
587
589
|
id: launched.id,
|
package/src/tracking.ts
CHANGED
|
@@ -263,7 +263,7 @@ function statusTool(results: Results, tmux: TmuxClient, readingErrors: () => Rea
|
|
|
263
263
|
name: "delegation_status",
|
|
264
264
|
label: "Delegation status",
|
|
265
265
|
description:
|
|
266
|
-
"The delegations this session started, each reported as running (the window is open and no result has arrived yet), done (with the result envelope's status) or closed (closed with delegation_close, or its window is gone). A delegation whose window went with no reply is reported closed without a result until a late reply makes it done. Names the delegation id, agent, session name, model, thinking, window, delegate session path and result envelope path. A running delegation also shows when its session file was last written; a long gap may mean it is stuck but does not prove it. A delegate's window being open means it is connected, not that its task is unfinished or finished; only a result means done.",
|
|
266
|
+
"The delegations this session started, each reported as running (the window is open and no result has arrived yet), done (with the result envelope's status) or closed (closed with delegation_close, or its window is gone). A delegation whose window went with no reply is reported closed without a result until a late reply makes it done. Call it to check on a delegation that seems stuck or to find its files; a result arrives as a message on its own, so there is no need to call it to wait for one. Names the delegation id, agent, session name, model, thinking, window, delegate session path and result envelope path. A running delegation also shows when its session file was last written; a long gap may mean it is stuck but does not prove it. A delegate's window being open means it is connected, not that its task is unfinished or finished; only a result means done.",
|
|
267
267
|
parameters: Type.Object({
|
|
268
268
|
id: Type.Optional(Type.String({ description: "One delegation id; omit to report every delegation." })),
|
|
269
269
|
}),
|