@llblab/pi-actors 0.42.3 → 0.43.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/AGENTS.md +121 -175
- package/CHANGELOG.md +12 -0
- package/README.md +113 -276
- package/dist/fixtures/protocol/control-endpoint.json +6 -0
- package/dist/fixtures/protocol/control-record.json +9 -0
- package/dist/fixtures/protocol/recipe-summary.json +4 -12
- package/dist/fixtures/protocol/trace-event.json +9 -0
- package/dist/lib/async-runs.d.ts +14 -38
- package/dist/lib/async-runs.js +158 -108
- package/dist/lib/control.d.ts +12 -0
- package/dist/lib/control.js +84 -0
- package/dist/lib/execution-sessions.d.ts +17 -0
- package/dist/lib/execution-sessions.js +85 -0
- package/dist/lib/file-state.d.ts +1 -0
- package/dist/lib/file-state.js +17 -5
- package/dist/lib/inspector-actions.d.ts +2 -2
- package/dist/lib/inspector-actions.js +2 -2
- package/dist/lib/inspector-command.js +3 -3
- package/dist/lib/inspector-overlay.d.ts +52 -70
- package/dist/lib/inspector-overlay.js +532 -905
- package/dist/lib/inspector.d.ts +3 -71
- package/dist/lib/inspector.js +19 -665
- package/dist/lib/limits.d.ts +4 -2
- package/dist/lib/limits.js +4 -2
- package/dist/lib/observability.d.ts +16 -16
- package/dist/lib/observability.js +43 -82
- package/dist/lib/prompts.d.ts +1 -1
- package/dist/lib/prompts.js +2 -2
- package/dist/lib/recipe-control.d.ts +7 -0
- package/dist/lib/recipe-control.js +39 -0
- package/dist/lib/recipes-discovery.js +2 -0
- package/dist/lib/recipes-references.d.ts +1 -14
- package/dist/lib/recipes-references.js +6 -21
- package/dist/lib/review-projection.js +1 -5
- package/dist/lib/run-ui-runtime.js +2 -2
- package/dist/lib/runs-control-delivery.d.ts +21 -0
- package/dist/lib/runs-control-delivery.js +127 -0
- package/dist/lib/runs-controls.d.ts +35 -0
- package/dist/lib/runs-controls.js +144 -0
- package/dist/lib/runs-retention.d.ts +7 -0
- package/dist/lib/runs-retention.js +27 -3
- package/dist/lib/runs-start.js +4 -2
- package/dist/lib/runs-status.js +11 -6
- package/dist/lib/runs-trace.d.ts +24 -0
- package/dist/lib/runs-trace.js +98 -0
- package/dist/lib/runtime-notifier.d.ts +1 -1
- package/dist/lib/runtime-notifier.js +1 -1
- package/dist/lib/tools-inspect.d.ts +3 -3
- package/dist/lib/tools-inspect.js +203 -708
- package/dist/lib/tools-local.js +2 -10
- package/dist/lib/tools-message.d.ts +7 -7
- package/dist/lib/tools-message.js +95 -396
- package/dist/lib/tools-response.d.ts +1 -4
- package/dist/lib/tools-response.js +5 -39
- package/dist/lib/tools-spawn.js +16 -28
- package/dist/lib/tools.js +1 -2
- package/dist/lib/trace-projection.d.ts +22 -0
- package/dist/lib/trace-projection.js +165 -0
- package/dist/recipes/draft-review.json +0 -10
- package/dist/recipes/lens-swarm.json +0 -14
- package/dist/recipes/music-player.json +10 -19
- package/dist/recipes/pipeline-architect-coordinator.json +0 -11
- package/dist/recipes/pipeline-artifact-bundle.json +1 -22
- package/dist/recipes/pipeline-artifact-report.json +1 -18
- package/dist/recipes/pipeline-artifact-write.json +1 -18
- package/dist/recipes/pipeline-async-run-ops.json +0 -12
- package/dist/recipes/pipeline-checkpoint-continuation.json +0 -14
- package/dist/recipes/pipeline-development-tasking.json +0 -12
- package/dist/recipes/pipeline-docs-maintenance.json +0 -12
- package/dist/recipes/pipeline-media-library.json +0 -12
- package/dist/recipes/pipeline-quorum-review.json +0 -12
- package/dist/recipes/pipeline-release-readiness.json +0 -12
- package/dist/recipes/pipeline-release-summary.json +0 -12
- package/dist/recipes/pipeline-repo-health.json +0 -12
- package/dist/recipes/pipeline-research-synthesis.json +0 -11
- package/dist/recipes/pipeline-review-readiness.json +0 -12
- package/dist/recipes/resource-locker.json +27 -0
- package/dist/recipes/subagent-artifact.json +0 -9
- package/dist/recipes/subagent-checkpoint.json +0 -10
- package/dist/recipes/subagent-conflict-report.json +0 -11
- package/dist/recipes/subagent-contradiction-map.json +0 -11
- package/dist/recipes/subagent-critic.json +0 -11
- package/dist/recipes/subagent-evidence-map.json +0 -11
- package/dist/recipes/subagent-followup.json +0 -10
- package/dist/recipes/subagent-judge.json +0 -11
- package/dist/recipes/subagent-merge.json +0 -11
- package/dist/recipes/subagent-normalize.json +0 -11
- package/dist/recipes/subagent-plan.json +0 -11
- package/dist/recipes/subagent-preflight.json +0 -11
- package/dist/recipes/subagent-prompt.json +0 -10
- package/dist/recipes/subagent-quorum.json +0 -10
- package/dist/recipes/subagent-review-coordinator.json +0 -14
- package/dist/recipes/subagent-review.json +0 -11
- package/dist/recipes/subagent-task-card.json +0 -11
- package/dist/recipes/subagent-tools.json +0 -10
- package/dist/recipes/subagent-verify.json +0 -11
- package/dist/recipes/subagents-prompts.json +0 -10
- package/dist/recipes/tool-review.json +0 -10
- package/dist/scripts/async-runner.mjs +25 -25
- package/dist/scripts/conformance.mjs +4 -2
- package/dist/scripts/locker.mjs +200 -66
- package/dist/scripts/music-player.mjs +159 -150
- package/dist/scripts/recipe-utils.mjs +6 -96
- package/dist/scripts/release-gates.mjs +60 -0
- package/dist/scripts/validate-recipe.mjs +3 -53
- package/dist/skills/actors/SKILL.md +53 -266
- package/dist/skills/swarm/SKILL.md +11 -33
- package/docs/0.43-baseline.md +44 -0
- package/docs/README.md +3 -3
- package/docs/actor-inspector.md +26 -64
- package/docs/actors-deep-reference.md +92 -50
- package/docs/async-runs.md +81 -328
- package/docs/command-templates.md +2 -2
- package/docs/component-recipes.md +30 -133
- package/docs/recipe-library.md +57 -182
- package/docs/task-first-recipes.md +10 -12
- package/docs/template-recipes.md +76 -289
- package/docs/tool-registry.md +41 -161
- package/fixtures/protocol/control-endpoint.json +6 -0
- package/fixtures/protocol/control-record.json +9 -0
- package/fixtures/protocol/recipe-summary.json +4 -12
- package/fixtures/protocol/trace-event.json +9 -0
- package/lib/async-runs.ts +202 -201
- package/lib/control.ts +102 -0
- package/lib/execution-sessions.ts +111 -0
- package/lib/file-state.ts +17 -4
- package/lib/inspector-actions.ts +2 -2
- package/lib/inspector-command.ts +3 -3
- package/lib/inspector-overlay.ts +577 -1121
- package/lib/inspector.ts +46 -979
- package/lib/limits.ts +4 -2
- package/lib/observability.ts +60 -101
- package/lib/prompts.ts +2 -2
- package/lib/recipe-control.ts +45 -0
- package/lib/recipes-discovery.ts +2 -0
- package/lib/recipes-references.ts +9 -45
- package/lib/review-projection.ts +1 -5
- package/lib/run-ui-runtime.ts +2 -2
- package/lib/runs-control-delivery.ts +181 -0
- package/lib/runs-controls.ts +204 -0
- package/lib/runs-retention.ts +38 -3
- package/lib/runs-start.ts +4 -2
- package/lib/runs-status.ts +11 -6
- package/lib/runs-trace.ts +132 -0
- package/lib/runtime-notifier.ts +1 -1
- package/lib/tools-inspect.ts +240 -901
- package/lib/tools-local.ts +2 -12
- package/lib/tools-message.ts +112 -519
- package/lib/tools-response.ts +5 -52
- package/lib/tools-spawn.ts +16 -32
- package/lib/tools.ts +1 -2
- package/lib/trace-projection.ts +221 -0
- package/package.json +2 -1
- package/recipes/draft-review.json +0 -10
- package/recipes/lens-swarm.json +0 -14
- package/recipes/music-player.json +10 -19
- package/recipes/pipeline-architect-coordinator.json +0 -11
- package/recipes/pipeline-artifact-bundle.json +1 -22
- package/recipes/pipeline-artifact-report.json +1 -18
- package/recipes/pipeline-artifact-write.json +1 -18
- package/recipes/pipeline-async-run-ops.json +0 -12
- package/recipes/pipeline-checkpoint-continuation.json +0 -14
- package/recipes/pipeline-development-tasking.json +0 -12
- package/recipes/pipeline-docs-maintenance.json +0 -12
- package/recipes/pipeline-media-library.json +0 -12
- package/recipes/pipeline-quorum-review.json +0 -12
- package/recipes/pipeline-release-readiness.json +0 -12
- package/recipes/pipeline-release-summary.json +0 -12
- package/recipes/pipeline-repo-health.json +0 -12
- package/recipes/pipeline-research-synthesis.json +0 -11
- package/recipes/pipeline-review-readiness.json +0 -12
- package/recipes/resource-locker.json +27 -0
- package/recipes/subagent-artifact.json +0 -9
- package/recipes/subagent-checkpoint.json +0 -10
- package/recipes/subagent-conflict-report.json +0 -11
- package/recipes/subagent-contradiction-map.json +0 -11
- package/recipes/subagent-critic.json +0 -11
- package/recipes/subagent-evidence-map.json +0 -11
- package/recipes/subagent-followup.json +0 -10
- package/recipes/subagent-judge.json +0 -11
- package/recipes/subagent-merge.json +0 -11
- package/recipes/subagent-normalize.json +0 -11
- package/recipes/subagent-plan.json +0 -11
- package/recipes/subagent-preflight.json +0 -11
- package/recipes/subagent-prompt.json +0 -10
- package/recipes/subagent-quorum.json +0 -10
- package/recipes/subagent-review-coordinator.json +0 -14
- package/recipes/subagent-review.json +0 -11
- package/recipes/subagent-task-card.json +0 -11
- package/recipes/subagent-tools.json +0 -10
- package/recipes/subagent-verify.json +0 -11
- package/recipes/subagents-prompts.json +0 -10
- package/recipes/tool-review.json +0 -10
- package/scripts/async-runner.mjs +25 -25
- package/scripts/conformance.mjs +4 -2
- package/scripts/locker.mjs +200 -66
- package/scripts/music-player.mjs +159 -150
- package/scripts/recipe-utils.mjs +6 -96
- package/scripts/release-gates.mjs +60 -0
- package/scripts/validate-recipe.mjs +3 -53
- package/skills/actors/SKILL.md +53 -266
- package/skills/swarm/SKILL.md +11 -33
- package/dist/fixtures/protocol/actor-message-branch.json +0 -13
- package/dist/fixtures/protocol/mailbox-contract.json +0 -15
- package/dist/fixtures/protocol/room-message.json +0 -11
- package/dist/fixtures/protocol/room-roster.json +0 -11
- package/dist/fixtures/protocol/run-inbox-message.json +0 -9
- package/dist/fixtures/protocol/run-outbox-event.json +0 -9
- package/dist/lib/mailbox-loop.d.ts +0 -41
- package/dist/lib/mailbox-loop.js +0 -60
- package/dist/lib/messages.d.ts +0 -25
- package/dist/lib/messages.js +0 -122
- package/dist/lib/rooms.d.ts +0 -104
- package/dist/lib/rooms.js +0 -647
- package/dist/lib/runs-mailbox.d.ts +0 -25
- package/dist/lib/runs-mailbox.js +0 -146
- package/dist/lib/runs-messages.d.ts +0 -15
- package/dist/lib/runs-messages.js +0 -179
- package/dist/lib/runs-outbox.d.ts +0 -41
- package/dist/lib/runs-outbox.js +0 -87
- package/dist/lib/tools-mailbox.d.ts +0 -8
- package/dist/lib/tools-mailbox.js +0 -48
- package/dist/recipes/actor-worker.json +0 -39
- package/dist/recipes/coordinator-locker.json +0 -45
- package/dist/recipes/locker.json +0 -45
- package/dist/recipes/pipeline-room-swarm.json +0 -50
- package/dist/recipes/subagent-message.json +0 -32
- package/dist/recipes/utility-actor-message.json +0 -23
- package/dist/scripts/actor-worker.mjs +0 -214
- package/dist/scripts/coordinator.mjs +0 -799
- package/docs/actor-messages.md +0 -225
- package/fixtures/protocol/actor-message-branch.json +0 -13
- package/fixtures/protocol/mailbox-contract.json +0 -15
- package/fixtures/protocol/room-message.json +0 -11
- package/fixtures/protocol/room-roster.json +0 -11
- package/fixtures/protocol/run-inbox-message.json +0 -9
- package/fixtures/protocol/run-outbox-event.json +0 -9
- package/lib/mailbox-loop.ts +0 -144
- package/lib/messages.ts +0 -151
- package/lib/rooms.ts +0 -939
- package/lib/runs-mailbox.ts +0 -208
- package/lib/runs-messages.ts +0 -252
- package/lib/runs-outbox.ts +0 -144
- package/lib/tools-mailbox.ts +0 -56
- package/recipes/actor-worker.json +0 -39
- package/recipes/coordinator-locker.json +0 -45
- package/recipes/locker.json +0 -45
- package/recipes/pipeline-room-swarm.json +0 -50
- package/recipes/subagent-message.json +0 -32
- package/recipes/utility-actor-message.json +0 -23
- package/scripts/actor-worker.mjs +0 -214
- package/scripts/coordinator.mjs +0 -799
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Actor Inspector
|
|
2
|
+
* Actor Inspector actions for concrete Run instances.
|
|
3
3
|
* Owns: exact-session run-action authorization, canonical kill routing, and bounded operator feedback.
|
|
4
4
|
*/
|
|
5
5
|
import { join } from "node:path";
|
|
@@ -11,7 +11,7 @@ function bounded(value) {
|
|
|
11
11
|
? text
|
|
12
12
|
: `${text.slice(0, FEEDBACK_LIMIT - 1)}…`;
|
|
13
13
|
}
|
|
14
|
-
export function
|
|
14
|
+
export function killOwnedRunFromInspector(ownerId, run, stateRoot, expectedRunInstanceId, deps) {
|
|
15
15
|
let stateDir;
|
|
16
16
|
try {
|
|
17
17
|
stateDir = join(stateRoot, safeRunId(run));
|
|
@@ -8,13 +8,13 @@ import * as InspectorActions from "./inspector-actions.js";
|
|
|
8
8
|
import * as InspectorOverlay from "./inspector-overlay.js";
|
|
9
9
|
import * as Paths from "./paths.js";
|
|
10
10
|
export function registerActorInspectorCommand(pi, getRunOwnerId) {
|
|
11
|
-
pi.registerCommand("
|
|
12
|
-
description: "Open the keyboard-driven
|
|
11
|
+
pi.registerCommand("actor-inspector", {
|
|
12
|
+
description: "Open the keyboard-driven Actor Inspector",
|
|
13
13
|
handler: async (_args, ctx) => {
|
|
14
14
|
ctx.ui.setWidget("zz-pi-actors-comms", undefined);
|
|
15
15
|
await ctx.ui.custom((tui, theme, _keybindings, done) => new InspectorOverlay.ActorInspectorOverlay({
|
|
16
16
|
done,
|
|
17
|
-
killRun: (run, runInstanceId) => InspectorActions.
|
|
17
|
+
killRun: (run, runInstanceId) => InspectorActions.killOwnedRunFromInspector(getRunOwnerId(ctx), run, Paths.EXTENSION_RUNTIME_PATHS.runStateRoot, runInstanceId, {
|
|
18
18
|
getRunStatus: AsyncRuns.getRunStatus,
|
|
19
19
|
killRun: AsyncRuns.killRun,
|
|
20
20
|
}),
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Keyboard-driven
|
|
3
|
-
* Zones:
|
|
4
|
-
* Owns
|
|
2
|
+
* Keyboard-driven Actor Inspector overlay for concrete Run instances.
|
|
3
|
+
* Zones: owned actor selection, Recipe/Trace/Control tabs, safe Run Kill confirmation
|
|
4
|
+
* Owns manual kernel navigation; evidence parsing and lifecycle mutation stay in ports.
|
|
5
5
|
*/
|
|
6
6
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
7
7
|
import { type TUI } from "@earendil-works/pi-tui";
|
|
8
|
-
import * as
|
|
9
|
-
|
|
10
|
-
export
|
|
8
|
+
import * as ActorInspector from "./inspector.ts";
|
|
9
|
+
import * as TraceProjection from "./trace-projection.ts";
|
|
10
|
+
export type ActorInspectorTab = "recipe" | "trace" | "control";
|
|
11
|
+
export interface ActorInspectorActionResult {
|
|
11
12
|
ok: boolean;
|
|
12
13
|
message: string;
|
|
13
14
|
}
|
|
14
15
|
export interface ActorInspectorOverlayOptions {
|
|
15
16
|
done: () => void;
|
|
16
|
-
killRun?: (run: string, runInstanceId: string) =>
|
|
17
|
+
killRun?: (run: string, runInstanceId: string) => ActorInspectorActionResult;
|
|
17
18
|
ownerId: string;
|
|
18
|
-
|
|
19
|
+
readRuns?: typeof ActorInspector.readActorInspectorRuns;
|
|
20
|
+
readTrace?: typeof TraceProjection.projectRunTrace;
|
|
19
21
|
stateRoot: string;
|
|
20
22
|
theme: Theme;
|
|
21
23
|
tui: TUI;
|
|
@@ -24,93 +26,73 @@ export declare class ActorInspectorOverlay {
|
|
|
24
26
|
private readonly done;
|
|
25
27
|
private readonly killRun?;
|
|
26
28
|
private readonly ownerId;
|
|
27
|
-
private readonly
|
|
29
|
+
private readonly readRuns;
|
|
30
|
+
private readonly readTrace;
|
|
28
31
|
private readonly stateRoot;
|
|
29
32
|
private readonly theme;
|
|
30
33
|
private readonly tui;
|
|
31
34
|
private readonly refreshTimer;
|
|
32
|
-
private runIndex;
|
|
33
|
-
private communicationChannel;
|
|
34
|
-
private communicationFrom;
|
|
35
|
-
private communicationUnread;
|
|
36
35
|
private contentStripeIndices;
|
|
37
|
-
private
|
|
38
|
-
private detailOpen;
|
|
36
|
+
private documentScroll;
|
|
39
37
|
private detailScroll;
|
|
40
|
-
private detailTurn?;
|
|
41
38
|
private feedback?;
|
|
39
|
+
private focus;
|
|
42
40
|
private killConfirmation?;
|
|
43
41
|
private killDialogChoice;
|
|
44
|
-
private readonly readKeys;
|
|
45
|
-
private focus;
|
|
46
|
-
private filterControlIndex;
|
|
47
|
-
private menuLevel;
|
|
48
|
-
private selectorIndex;
|
|
49
|
-
private recipeScroll;
|
|
50
42
|
private rowIndex;
|
|
51
|
-
private
|
|
52
|
-
private
|
|
53
|
-
private
|
|
54
|
-
private
|
|
43
|
+
private runCache?;
|
|
44
|
+
private runIndex;
|
|
45
|
+
private selectorIndex;
|
|
46
|
+
private selectorMode?;
|
|
47
|
+
private tabIndex;
|
|
48
|
+
private traceCache?;
|
|
49
|
+
private traceDetail?;
|
|
50
|
+
private traceSourceIndex;
|
|
55
51
|
constructor(options: ActorInspectorOverlayOptions);
|
|
52
|
+
dispose(): void;
|
|
53
|
+
invalidate(): void;
|
|
56
54
|
handleInput(data: string): void;
|
|
57
55
|
render(width: number): string[];
|
|
58
|
-
|
|
59
|
-
dispose(): void;
|
|
56
|
+
private get tab();
|
|
60
57
|
private runs;
|
|
61
|
-
private ensureSelectedRun;
|
|
62
58
|
private contentViewportRows;
|
|
63
|
-
private
|
|
59
|
+
private resetContentPosition;
|
|
64
60
|
private cycleRun;
|
|
61
|
+
private handleScrollableInput;
|
|
62
|
+
private handleSelectorInput;
|
|
63
|
+
private openSourceSelector;
|
|
64
|
+
private cycleTraceSource;
|
|
65
65
|
private requestKill;
|
|
66
|
-
private
|
|
66
|
+
private handleKillInput;
|
|
67
67
|
private confirmKill;
|
|
68
68
|
private renderKillDialog;
|
|
69
|
-
private listItemCount;
|
|
70
|
-
private selectorAnchor;
|
|
71
|
-
private renderKeyHints;
|
|
72
69
|
private renderRunControl;
|
|
73
|
-
private activeMessageFilters;
|
|
74
70
|
private renderTabs;
|
|
75
|
-
private
|
|
76
|
-
private
|
|
77
|
-
private renderRecipe;
|
|
78
|
-
private communicationPreviews;
|
|
79
|
-
private communicationActorLabel;
|
|
80
|
-
private communicationFromOptions;
|
|
81
|
-
private communicationRows;
|
|
82
|
-
private renderDetail;
|
|
83
|
-
private wrapDetailLines;
|
|
84
|
-
private wrapPreferred;
|
|
85
|
-
private detailSection;
|
|
86
|
-
private readableValueLines;
|
|
87
|
-
private turnEvidenceLines;
|
|
88
|
-
private readablePromptText;
|
|
89
|
-
private allTurnItems;
|
|
90
|
-
private turnItems;
|
|
91
|
-
private turnRows;
|
|
92
|
-
private subagents;
|
|
93
|
-
private valueOptions;
|
|
94
|
-
private filterOptions;
|
|
95
|
-
private menuOptions;
|
|
96
|
-
private backMenu;
|
|
97
|
-
private openRunMenu;
|
|
98
|
-
private openFilterMenu;
|
|
99
|
-
private applyMenuOption;
|
|
100
|
-
private filterValue;
|
|
101
|
-
private currentFilterValue;
|
|
71
|
+
private renderContent;
|
|
72
|
+
private renderSelector;
|
|
102
73
|
private renderMenuBox;
|
|
103
|
-
private
|
|
104
|
-
private
|
|
105
|
-
private
|
|
106
|
-
private
|
|
74
|
+
private renderTraceList;
|
|
75
|
+
private renderTraceDetail;
|
|
76
|
+
private controlDocument;
|
|
77
|
+
private allTraceItems;
|
|
78
|
+
private traceSources;
|
|
79
|
+
private traceSource;
|
|
80
|
+
private traceItems;
|
|
81
|
+
private readRunMeta;
|
|
82
|
+
private documentProjection;
|
|
83
|
+
private inlineDocumentValue;
|
|
84
|
+
private labeledScalarLines;
|
|
85
|
+
private document;
|
|
86
|
+
private wrapDocument;
|
|
87
|
+
private styleDocumentLine;
|
|
88
|
+
private visiblePrefix;
|
|
89
|
+
private renderKeyHints;
|
|
90
|
+
private statusColor;
|
|
107
91
|
private footerBorder;
|
|
108
|
-
private border;
|
|
109
92
|
private stripeBackground;
|
|
110
93
|
private stripedRow;
|
|
111
94
|
private row;
|
|
112
|
-
private
|
|
113
|
-
private dropVisiblePrefix;
|
|
114
|
-
private center;
|
|
95
|
+
private border;
|
|
115
96
|
private fit;
|
|
97
|
+
private center;
|
|
116
98
|
}
|