@llblab/pi-actors 0.24.1 → 0.24.2
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/BACKLOG.md +21 -2
- package/CHANGELOG.md +4 -0
- package/dist/index.js +1 -1
- package/dist/lib/actor-inspector-tui.js +18 -9
- package/dist/skills/actors/SKILL.md +1 -1
- package/dist/skills/swarm/SKILL.md +1 -1
- package/index.ts +11 -10
- package/lib/actor-inspector-tui.ts +18 -9
- package/package.json +1 -1
- package/skills/actors/SKILL.md +1 -1
- package/skills/swarm/SKILL.md +1 -1
package/BACKLOG.md
CHANGED
|
@@ -208,6 +208,25 @@ The backlog is intentionally pruned to the 20% of work most likely to deliver 80
|
|
|
208
208
|
- Installed-package tests cover every script shim that imports compiled domain logic.
|
|
209
209
|
- Pack dry assertions cover `dist/scripts`, `dist/recipes`, `dist/fixtures`, and `dist/skills`.
|
|
210
210
|
|
|
211
|
+
### M-11 Actor Termination Semantics
|
|
212
|
+
|
|
213
|
+
- Priority: Medium.
|
|
214
|
+
- Status: Open.
|
|
215
|
+
- Goal: Make `control.kill` the canonical parent-to-actor termination action while keeping `control.stop` and `control.cancel` as actor-domain messages whose meaning depends on the actor protocol.
|
|
216
|
+
- Why now: Mailbox workers need a clearer lifecycle boundary before v2 patterns harden. Treating `stop`, `cancel`, and `kill` as equivalent stop messages blurs actor termination with domain-specific task or playback control.
|
|
217
|
+
- Direction:
|
|
218
|
+
- Document `control.kill` as the universal lifecycle action for a parent/supervisor terminating an actor or run.
|
|
219
|
+
- Reframe `control.stop` as actor-defined domain control, such as stopping music playback or ending an actor-specific loop when that actor declares it.
|
|
220
|
+
- Reframe `control.cancel` as actor-defined domain control, such as cancelling the current subagent task while keeping the worker actor alive for later assignments.
|
|
221
|
+
- Split mailbox-loop helper semantics so lifecycle termination detection is distinct from general control-message detection.
|
|
222
|
+
- While the package is pre-1.0, allow a small intentional minor-version contract break: remove legacy treatment that aliases `control.stop` or `control.cancel` to actor termination.
|
|
223
|
+
- Do not preserve compatibility shims for the old stop/cancel-as-termination behavior before the first 1.0 major release unless a concrete safety issue appears during implementation.
|
|
224
|
+
- Acceptance:
|
|
225
|
+
- Docs and actors skill advertise `control.kill` as canonical parent-to-actor termination.
|
|
226
|
+
- Mailbox-loop helpers/tests distinguish actor termination from actor-domain `stop`/`cancel` handling.
|
|
227
|
+
- Packaged recipes declare `stop`/`cancel` only when the actor-specific behavior is meaningful.
|
|
228
|
+
- Tests assert that generic mailbox-loop termination is not triggered by `control.stop` or `control.cancel`.
|
|
229
|
+
|
|
211
230
|
## Explicitly Deferred
|
|
212
231
|
|
|
213
232
|
These are valid ideas but not current focus. Reintroduce only with concrete evidence from real actor workflows.
|
|
@@ -226,6 +245,6 @@ These are valid ideas but not current focus. Reintroduce only with concrete evid
|
|
|
226
245
|
0.25 — Operator remediation and worker maturity:
|
|
227
246
|
M-08, M-09
|
|
228
247
|
|
|
229
|
-
0.26 — Package contract hardening:
|
|
230
|
-
M-10
|
|
248
|
+
0.26 — Package contract hardening and lifecycle semantics:
|
|
249
|
+
M-10, M-11
|
|
231
250
|
```
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.24.2: Actor Inspector Item View Hotfix
|
|
6
|
+
|
|
7
|
+
- `[Inspector]` Removed the roster panel from selected actor-message item inspection, kept the compact route header styling, added the same left/right gutter used by inspector rows, and renamed the selected-item `body_preview` label to `body`.
|
|
8
|
+
|
|
5
9
|
## 0.24.1: Build Script Package Hygiene Hotfix
|
|
6
10
|
|
|
7
11
|
- `[Backlog]` Added the next focused backlog set for recipe doctor remediation UX, actor worker v2, and dist package contract hardening.
|
package/dist/index.js
CHANGED
|
@@ -94,7 +94,7 @@ export default function toolRegistryExtension(pi) {
|
|
|
94
94
|
? ActorInspectorTui.renderInspectorItemView(previews, width, style, { sequence: selectedInspectorSequence })
|
|
95
95
|
: ActorInspectorTui.renderInspectorWidget(previews, width, style)) ?? [];
|
|
96
96
|
const run = previews[0]?.run;
|
|
97
|
-
const roster = run
|
|
97
|
+
const roster = selectedInspectorSequence === undefined && run
|
|
98
98
|
? ActorInspectorTui.renderInspectorRosterPanel(ActorInspectorTui.readActorInspectorRoster(RUN_STATE_ROOT, run), width, style)
|
|
99
99
|
: undefined;
|
|
100
100
|
return roster ? [...roster, ...rows] : rows;
|
|
@@ -318,6 +318,11 @@ function propertyValue(value) {
|
|
|
318
318
|
return String(value);
|
|
319
319
|
return JSON.stringify(value);
|
|
320
320
|
}
|
|
321
|
+
function itemViewKeyLabel(key) {
|
|
322
|
+
if (key === "body_preview")
|
|
323
|
+
return "body";
|
|
324
|
+
return key;
|
|
325
|
+
}
|
|
321
326
|
function displayWidth(value) {
|
|
322
327
|
return visibleWidth(value);
|
|
323
328
|
}
|
|
@@ -499,6 +504,9 @@ export function renderInspectorItemView(previews, width = 80, styles = {}, optio
|
|
|
499
504
|
if (!preview)
|
|
500
505
|
return undefined;
|
|
501
506
|
const safeWidth = Math.max(1, width);
|
|
507
|
+
const prefix = " ";
|
|
508
|
+
const suffix = " ";
|
|
509
|
+
const contentWidth = Math.max(8, safeWidth - prefix.length - suffix.length);
|
|
502
510
|
const orderedKeys = [
|
|
503
511
|
"channel",
|
|
504
512
|
"run",
|
|
@@ -522,20 +530,21 @@ export function renderInspectorItemView(previews, width = 80, styles = {}, optio
|
|
|
522
530
|
const sequencePadding = " ".repeat(Math.max(0, keyWidth - displayWidth(sequenceText)));
|
|
523
531
|
const headerSeparator = " ";
|
|
524
532
|
const route = routeText(preview);
|
|
525
|
-
const visibleRoute = boundedLine(route, Math.max(0,
|
|
533
|
+
const visibleRoute = boundedLine(route, Math.max(0, contentWidth - keyWidth - headerSeparator.length));
|
|
526
534
|
const headerPlain = `${sequenceText}${sequencePadding}${headerSeparator}${visibleRoute}`;
|
|
527
535
|
const header = `${style(styles.muted, sequenceText)}${sequencePadding}${headerSeparator}${style(styles.target, visibleRoute)}`;
|
|
528
|
-
const headerPadding = Math.max(0,
|
|
529
|
-
const lines = [`${header}${" ".repeat(headerPadding)}`, ""];
|
|
536
|
+
const headerPadding = Math.max(0, contentWidth - visibleWidth(headerPlain));
|
|
537
|
+
const lines = [`${prefix}${header}${" ".repeat(headerPadding)}${suffix}`, ""];
|
|
530
538
|
for (const [key, value] of entries) {
|
|
531
|
-
const
|
|
539
|
+
const label = itemViewKeyLabel(key);
|
|
540
|
+
const keyPadding = " ".repeat(Math.max(0, keyWidth - displayWidth(label)));
|
|
532
541
|
const separator = " ";
|
|
533
|
-
const valueWidth = Math.max(0,
|
|
542
|
+
const valueWidth = Math.max(0, contentWidth - keyWidth - separator.length);
|
|
534
543
|
const visibleValue = boundedLine(value, valueWidth);
|
|
535
|
-
const plain = `${
|
|
536
|
-
const rendered = `${style(styles.muted,
|
|
537
|
-
const padding = Math.max(0,
|
|
538
|
-
lines.push(`${rendered}${" ".repeat(padding)}`);
|
|
544
|
+
const plain = `${label}${keyPadding}${separator}${visibleValue}`;
|
|
545
|
+
const rendered = `${style(styles.muted, label)}${keyPadding}${separator}${style(styles.preview, visibleValue)}`;
|
|
546
|
+
const padding = Math.max(0, contentWidth - visibleWidth(plain));
|
|
547
|
+
lines.push(`${prefix}${rendered}${" ".repeat(padding)}${suffix}`);
|
|
539
548
|
}
|
|
540
549
|
return lines;
|
|
541
550
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: actors
|
|
3
3
|
description: Highest-density practical guide for pi-actors. Read this skill whenever prompt and tools are not enough for spawn, message, inspect, actor runs, tools, recipes, command templates, async lifecycle, mailboxes, artifacts, and local orchestration mechanics.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.24.
|
|
5
|
+
version: 0.24.2
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Actors (pi-actors)
|
package/index.ts
CHANGED
|
@@ -129,16 +129,17 @@ export default function toolRegistryExtension(pi: ExtensionAPI) {
|
|
|
129
129
|
style,
|
|
130
130
|
)) ?? [];
|
|
131
131
|
const run = previews[0]?.run;
|
|
132
|
-
const roster =
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
132
|
+
const roster =
|
|
133
|
+
selectedInspectorSequence === undefined && run
|
|
134
|
+
? ActorInspectorTui.renderInspectorRosterPanel(
|
|
135
|
+
ActorInspectorTui.readActorInspectorRoster(
|
|
136
|
+
RUN_STATE_ROOT,
|
|
137
|
+
run,
|
|
138
|
+
),
|
|
139
|
+
width,
|
|
140
|
+
style,
|
|
141
|
+
)
|
|
142
|
+
: undefined;
|
|
142
143
|
return roster ? [...roster, ...rows] : rows;
|
|
143
144
|
},
|
|
144
145
|
};
|
|
@@ -478,6 +478,11 @@ function propertyValue(value: unknown): string {
|
|
|
478
478
|
return JSON.stringify(value);
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
+
function itemViewKeyLabel(key: string): string {
|
|
482
|
+
if (key === "body_preview") return "body";
|
|
483
|
+
return key;
|
|
484
|
+
}
|
|
485
|
+
|
|
481
486
|
function displayWidth(value: string): number {
|
|
482
487
|
return visibleWidth(value);
|
|
483
488
|
}
|
|
@@ -727,6 +732,9 @@ export function renderInspectorItemView(
|
|
|
727
732
|
const preview = previews.find((item) => item.sequence === options.sequence);
|
|
728
733
|
if (!preview) return undefined;
|
|
729
734
|
const safeWidth = Math.max(1, width);
|
|
735
|
+
const prefix = " ";
|
|
736
|
+
const suffix = " ";
|
|
737
|
+
const contentWidth = Math.max(8, safeWidth - prefix.length - suffix.length);
|
|
730
738
|
const orderedKeys = [
|
|
731
739
|
"channel",
|
|
732
740
|
"run",
|
|
@@ -754,21 +762,22 @@ export function renderInspectorItemView(
|
|
|
754
762
|
const route = routeText(preview);
|
|
755
763
|
const visibleRoute = boundedLine(
|
|
756
764
|
route,
|
|
757
|
-
Math.max(0,
|
|
765
|
+
Math.max(0, contentWidth - keyWidth - headerSeparator.length),
|
|
758
766
|
);
|
|
759
767
|
const headerPlain = `${sequenceText}${sequencePadding}${headerSeparator}${visibleRoute}`;
|
|
760
768
|
const header = `${style(styles.muted, sequenceText)}${sequencePadding}${headerSeparator}${style(styles.target, visibleRoute)}`;
|
|
761
|
-
const headerPadding = Math.max(0,
|
|
762
|
-
const lines = [`${header}${" ".repeat(headerPadding)}`, ""];
|
|
769
|
+
const headerPadding = Math.max(0, contentWidth - visibleWidth(headerPlain));
|
|
770
|
+
const lines = [`${prefix}${header}${" ".repeat(headerPadding)}${suffix}`, ""];
|
|
763
771
|
for (const [key, value] of entries) {
|
|
764
|
-
const
|
|
772
|
+
const label = itemViewKeyLabel(key);
|
|
773
|
+
const keyPadding = " ".repeat(Math.max(0, keyWidth - displayWidth(label)));
|
|
765
774
|
const separator = " ";
|
|
766
|
-
const valueWidth = Math.max(0,
|
|
775
|
+
const valueWidth = Math.max(0, contentWidth - keyWidth - separator.length);
|
|
767
776
|
const visibleValue = boundedLine(value, valueWidth);
|
|
768
|
-
const plain = `${
|
|
769
|
-
const rendered = `${style(styles.muted,
|
|
770
|
-
const padding = Math.max(0,
|
|
771
|
-
lines.push(`${rendered}${" ".repeat(padding)}`);
|
|
777
|
+
const plain = `${label}${keyPadding}${separator}${visibleValue}`;
|
|
778
|
+
const rendered = `${style(styles.muted, label)}${keyPadding}${separator}${style(styles.preview, visibleValue)}`;
|
|
779
|
+
const padding = Math.max(0, contentWidth - visibleWidth(plain));
|
|
780
|
+
lines.push(`${prefix}${rendered}${" ".repeat(padding)}${suffix}`);
|
|
772
781
|
}
|
|
773
782
|
return lines;
|
|
774
783
|
}
|
package/package.json
CHANGED
package/skills/actors/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: actors
|
|
3
3
|
description: Highest-density practical guide for pi-actors. Read this skill whenever prompt and tools are not enough for spawn, message, inspect, actor runs, tools, recipes, command templates, async lifecycle, mailboxes, artifacts, and local orchestration mechanics.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.24.
|
|
5
|
+
version: 0.24.2
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Actors (pi-actors)
|
package/skills/swarm/SKILL.md
CHANGED