pi-squire 0.7.0 โ†’ 0.8.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
@@ -6,6 +6,22 @@ follows [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.8.0] - 2026-10-20
10
+
11
+ ### Added
12
+
13
+ - A delegate's footer shows that it is a delegate and whether auto-exit is
14
+ on: `๐Ÿ‘ฆ delegate ยท auto-exit on`, or
15
+ `๐Ÿ‘ฆ delegate ยท auto-exit off`. It follows the
16
+ setting as typing turns it off and `/auto-exit` turns it back on.
17
+
18
+ ### Changed
19
+
20
+ - The parent's footer reads `๐Ÿ‘จ N delegates running` instead of
21
+ `โ‡„ N running`. Each side picks its icon at random per session: ๐Ÿ‘จ or ๐Ÿ‘ฉ
22
+ for the parent, ๐Ÿ‘ฆ or ๐Ÿ‘ง for a delegate. The footer tests in
23
+ `test/delegate.test.ts` change to match.
24
+
9
25
  ## [0.7.0] - 2026-10-19
10
26
 
11
27
  ### Added
@@ -257,7 +273,8 @@ author's dotfiles; the changes below are against that copy.
257
273
 
258
274
  - The published file list includes `child.ts`, which `index.ts` imports.
259
275
 
260
- [Unreleased]: https://github.com/gvanderclay/pi-squire/compare/v0.7.0...HEAD
276
+ [Unreleased]: https://github.com/gvanderclay/pi-squire/compare/v0.8.0...HEAD
277
+ [0.8.0]: https://github.com/gvanderclay/pi-squire/compare/v0.7.0...v0.8.0
261
278
  [0.7.0]: https://github.com/gvanderclay/pi-squire/compare/v0.6.0...v0.7.0
262
279
  [0.6.0]: https://github.com/gvanderclay/pi-squire/compare/v0.5.1...v0.6.0
263
280
  [0.5.1]: https://github.com/gvanderclay/pi-squire/compare/v0.5.0...v0.5.1
package/README.md CHANGED
@@ -393,6 +393,10 @@ The parent resolves each delegation's auto-exit from the call
393
393
  notice: typed or RPC input, or a run the user stopped (Esc).
394
394
  - `/auto-exit` inside the delegate turns it on again for the next normal
395
395
  completion, whatever the launch said.
396
+ - The footer shows that this is a delegate and whether auto-exit is on:
397
+ `๐Ÿ‘ฆ delegate ยท auto-exit on`, or
398
+ `๐Ÿ‘ฆ delegate ยท auto-exit off`, with ๐Ÿ‘ฆ or ๐Ÿ‘ง
399
+ picked at random per session.
396
400
 
397
401
  There is no `subagent_done` tool: auto-exit off only means the window stays.
398
402
 
@@ -439,8 +443,9 @@ Delegate session: <session file or id>
439
443
  current tool calls, before the next model call. A follow-up would wait
440
444
  until the parent had answered, by which time it had often read the
441
445
  envelope itself, and the late result cost a second, redundant turn.
442
- - The footer counts the running delegations (`โ‡„ N running`), clears one entry
443
- per result or close and hides itself at zero.
446
+ - The footer counts the running delegations (`๐Ÿ‘จ N delegates running`, with ๐Ÿ‘จ or ๐Ÿ‘ฉ
447
+ picked at random per session), clears one entry per result or close and
448
+ hides itself at zero.
444
449
  - Each result and each close is recorded in the parent session, and the
445
450
  records are rebuilt synchronously at session start. A resume still
446
451
  recognises replies, including one that arrived while the parent was
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-squire",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Starts a delegate Pi session in a background tmux window, sends it the task over message:*, and shows the parent its result",
5
5
  "keywords": [
6
6
  "pi-package",
package/src/child.ts CHANGED
@@ -21,6 +21,7 @@
21
21
  import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
22
22
 
23
23
  import { activeMark, classify, type Response, recordLimit } from "./limits.ts";
24
+ import { STATUS_KEY } from "./results.ts";
24
25
 
25
26
  /** The launch variable that carries the parent's resolved setting. */
26
27
  export const AUTO_EXIT_ENV = "PI_DELEGATE_AUTO_EXIT";
@@ -104,6 +105,19 @@ function registerFallback(pi: ExtensionAPI): (model: string | undefined) => void
104
105
  };
105
106
  }
106
107
 
108
+ /** This delegate's footer icon, picked once per load. */
109
+ const ICON = Math.random() < 0.5 ? "๐Ÿ‘ฆ" : "๐Ÿ‘ง";
110
+
111
+ function showStatus(ctx: ExtensionContext, armed: boolean): void {
112
+ const { theme } = ctx.ui;
113
+ ctx.ui.setStatus(
114
+ STATUS_KEY,
115
+ armed
116
+ ? `${ICON} delegate ยท auto-exit ${theme.fg("success", "on")}`
117
+ : `${ICON} delegate ยท auto-exit ${theme.fg("dim", "off")}`,
118
+ );
119
+ }
120
+
107
121
  export function registerChild(pi: ExtensionAPI, parent: string): void {
108
122
  registerTakeover(pi, parent);
109
123
  const setLimited = registerFallback(pi);
@@ -112,10 +126,14 @@ export function registerChild(pi: ExtensionAPI, parent: string): void {
112
126
  /** Whether the run that just ended finished without the user stopping it. */
113
127
  let completed = false;
114
128
 
129
+ // Reload and session replacement clear extension statuses, then start again.
130
+ pi.on("session_start", async (_event, ctx) => showStatus(ctx, armed));
131
+
115
132
  function disarm(ctx: ExtensionContext): void {
116
133
  if (!armed) return;
117
134
  armed = false;
118
135
  ctx.ui.notify(OFF_NOTICE, "info");
136
+ showStatus(ctx, armed);
119
137
  }
120
138
 
121
139
  // Typed text and RPC input are the user's; a prompt an extension sends is not.
@@ -166,6 +184,7 @@ export function registerChild(pi: ExtensionAPI, parent: string): void {
166
184
  handler: async (_args, ctx) => {
167
185
  armed = true;
168
186
  ctx.ui.notify(ON_NOTICE, "info");
187
+ showStatus(ctx, armed);
169
188
  },
170
189
  });
171
190
  }
package/src/results.ts CHANGED
@@ -237,6 +237,7 @@ export function createResults(pi: ExtensionAPI): Results {
237
237
  let ctx: ExtensionContext | undefined;
238
238
  /** Whether the footer currently shows the entry, so a clear is sent only when needed. */
239
239
  let footerShown = false;
240
+ const icon = Math.random() < 0.5 ? "๐Ÿ‘จ" : "๐Ÿ‘ฉ";
240
241
 
241
242
  /** A delegation still going: no result and no recorded close. */
242
243
  const running = (): Recorded[] =>
@@ -251,7 +252,7 @@ export function createResults(pi: ExtensionAPI): Results {
251
252
  const visible = count > 0;
252
253
  if (!visible && !footerShown) return;
253
254
  footerShown = visible;
254
- ctx.ui.setStatus(STATUS_KEY, visible ? `โ‡„ ${count} running` : undefined);
255
+ ctx.ui.setStatus(STATUS_KEY, visible ? `${icon} ${count} delegate${count === 1 ? "" : "s"} running` : undefined);
255
256
  }
256
257
 
257
258
  /** Rebuild the records from the session's entries, so a resume still recognises replies. */