@llblab/pi-actors 0.50.0 → 0.51.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 +1 -1
- package/BACKLOG.md +1 -1
- package/CHANGELOG.md +7 -0
- package/README.md +4 -2
- package/dist/index.js +1 -1
- package/dist/lib/extension-runtime.d.ts +1 -1
- package/dist/lib/extension-runtime.js +1 -1
- package/dist/lib/observability.js +3 -1
- package/dist/scripts/async-runner.mjs +5 -19
- package/docs/async-runs.md +6 -3
- package/index.ts +1 -1
- package/lib/extension-runtime.ts +2 -2
- package/lib/observability.ts +2 -1
- package/package.json +3 -3
- package/scripts/async-runner.mjs +5 -19
package/AGENTS.md
CHANGED
|
@@ -84,7 +84,7 @@ Canonical event:
|
|
|
84
84
|
{"id":"…","ts":"…","kind":"…","summary":"…","data":{},"level":"info","attention":"notify"}
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
Trace is a bounded retained suffix, not an audit archive. Every first-party writer must call `appendRunTraceEvent`; under the canonical token-owned lock it appends within both fixed bounds or atomically retains the newest suffix plus one cumulative warning-only `runtime.trace_compacted` marker. The marker means older history was discarded; terminal/result/execution/artifact files remain authoritative independently. Reads are newline-safe and order equal timestamps by same-source ordinal, fixed source rank, then stable id without exposing ordering metadata. Never write `trace.jsonl` directly.
|
|
87
|
+
Trace is a bounded retained suffix, not an audit archive. Every first-party writer must call `appendRunTraceEvent`; under the canonical token-owned lock it appends within both fixed bounds or atomically retains the newest suffix plus one cumulative warning-only `runtime.trace_compacted` marker. The marker means older history was discarded; terminal/result/execution/artifact files remain authoritative independently. Reads are newline-safe and order equal timestamps by same-source ordinal, fixed source rank, then stable id without exposing ordering metadata. Never write `trace.jsonl` directly. Generic command lifecycle is Trace-only: `command.done` preserves complete bounded execution evidence but never requests or projects attention, and Recipe grammar has no command-completion delivery switch. Attention is an explicit semantic wake hint: persist durable state or an artifact first; `attention: "followup"` remains rare. Reconcile root terminal transitions before attention. One normal finite Run defaults to one automatic agent turn from its root terminal result; sequence, parallel, repeat, and import branches remain internal, while each separately launched Run owns a separate generation.
|
|
88
88
|
|
|
89
89
|
### Control
|
|
90
90
|
|
package/BACKLOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Project Backlog
|
|
2
2
|
|
|
3
|
-
- [ ] `Future minor — Linux MPRIS media integration`: Expose the active `music-player/playback` singleton as one optional generation-fenced MPRIS2 player so GNOME and compatible desktop shells can show current media and native controls without making D-Bus a second playback authority
|
|
3
|
+
- [ ] `Future minor — Linux MPRIS media integration`: Expose the active `music-player/playback` singleton as one optional generation-fenced MPRIS2 player so GNOME and compatible desktop shells can show current media and native controls without making D-Bus a second playback authority.
|
|
4
4
|
- [ ] Publish `PlaybackStatus`, track metadata, duration, read-time position, volume, and supported capabilities under one stable session-scoped bus identity; disappear cleanly when the Run stops or its generation is replaced, and fail soft when the user D-Bus session is unavailable.
|
|
5
5
|
- [ ] Map `Play`, `Pause`, `PlayPause`, `Next`, `Previous`, `Stop`, `Seek`, `SetPosition`, and `Volume` back into the existing generation-fenced music-player Control/helper contract rather than signaling the backend or editing Run state directly.
|
|
6
6
|
- [ ] Validate deterministic D-Bus contract behavior plus a live GNOME smoke showing the media surface, metadata, progress, volume, and controls while preserving backend independence and exact Actor ownership.
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
> Each release keeps at most 8 outcome records of at most 512 characters.
|
|
4
4
|
|
|
5
|
+
## 0.51.0: Monotonic Run Follow-Ups
|
|
6
|
+
|
|
7
|
+
- `Root-Owned Follow-Up`: A normal finite Run now produces one automatic agent turn from its root terminal result. Sequence, parallel, repeat, and imported branches remain internal execution topology; each separately launched Run still owns a separate generation and terminal lifecycle.
|
|
8
|
+
- `Trace-Only Command Lifecycle`: Consolidates each command completion into one complete bounded `command.done` observation with level, captures, session provenance, artifacts, and execution evidence, but no attention. Legacy `command.done` attention remains non-projectable, and the removed Recipe-level delivery grammar stays removed.
|
|
9
|
+
- `Monotonic Reconciliation`: Delivers terminal transitions before explicit semantic attention, preserves silent Runs, synchronous stop behavior, generation fencing, terminal retry evidence, and semantic checkpoints, and removes branch exit-code heuristics that could wake the coordinator from stale process-level events.
|
|
10
|
+
- `Settled Pi Baseline`: Requires Pi and Pi TUI 0.84.4 or newer and schedules automatic Recipe review on `agent_settled`, after queued follow-ups, retries, and compaction complete. Source and packed-package regressions pin the lifecycle and minimum peer contract.
|
|
11
|
+
|
|
5
12
|
## 0.50.0: Hardened Actor Baseline
|
|
6
13
|
|
|
7
14
|
- `Template Recipe Standard`: Rebuilt the Recipe authoring guide around one current-state contract: formats, identity, uniformly detailed file-level and command-node field tables, resolution precedence, imports, async/singleton lifecycle, Control, artifacts, runtime origins, provenance, authoring workflow, and validation. Removed migration history and legacy-reference narration from the normative document.
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ This topology does not require every task to become a subagent. Short work with
|
|
|
19
19
|
|
|
20
20
|
## Install
|
|
21
21
|
|
|
22
|
-
Requires Node.js 22.19.0 or newer.
|
|
22
|
+
Requires Node.js 22.19.0 or newer and Pi 0.84.4 or newer.
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
25
|
pi install npm:@llblab/pi-actors
|
|
@@ -151,7 +151,9 @@ String command-template leaves execute directly without shell interpretation. Us
|
|
|
151
151
|
|
|
152
152
|
Trace fields are exact: `id`, `ts`, `kind`, and optional `summary`, `data`, `level`, `attention`. Address, sender, recipient, reply, and routing fields fail validation. Trace is a bounded retained suffix, not an audit archive: the canonical authority appends within 2,048 events and 4 MiB or atomically keeps the newest suffix plus one warning-only `runtime.trace_compacted` marker. That marker means older history was discarded; `result.json`, `execution.json`, terminal state, and declared artifacts retain their own authority. `inspect view=trace` reports whether retained history is complete. Reads are newline-safe and deterministic; first-party scripts never write this file directly.
|
|
153
153
|
|
|
154
|
-
Attention is a live wake hint, not a durable queue: persist recovery state or an artifact first
|
|
154
|
+
Generic command lifecycle is Trace-only: runner-owned `command.done` records preserve completion and execution evidence but never request or project attention. There is no Recipe-level command-completion delivery switch. Attention is an explicit semantic opt-in and a live wake hint, not a durable queue: persist recovery state or an artifact first, use `attention: "notify"` for visible status and `attention: "followup"` only when the coordinator needs semantic follow-up context, and expect compaction to discard older hints. Store large evidence in artifacts or bounded execution captures.
|
|
155
|
+
|
|
156
|
+
By default, one normal finite Run produces one automatic agent turn from its root terminal result. Sequence, parallel, repeat, and imported branches remain internal to that Run and do not create branch-level turns; each separately launched Run owns its own generation and terminal follow-up.
|
|
155
157
|
|
|
156
158
|
## Control
|
|
157
159
|
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ export default function toolRegistryExtension(pi) {
|
|
|
9
9
|
const runtime = ExtensionRuntime.createActorExtensionRuntime(pi);
|
|
10
10
|
pi.on("resources_discover", async () => runtime.discoverResources(import.meta.url));
|
|
11
11
|
pi.on("session_start", async (_event, ctx) => runtime.onSessionStart(ctx));
|
|
12
|
-
pi.on("
|
|
12
|
+
pi.on("agent_settled", async (_event, ctx) => runtime.onAgentSettled(ctx));
|
|
13
13
|
pi.on("session_shutdown", async (event, ctx) => runtime.onSessionShutdown(event.reason, ctx));
|
|
14
14
|
pi.on("before_agent_start", async (event, ctx) => runtime.beforeAgentStart(event.systemPrompt, event.systemPromptOptions.skills ?? [], ctx));
|
|
15
15
|
InspectorCommand.registerActorInspectorCommand(pi, runtime.getRunOwnerId);
|
|
@@ -13,7 +13,7 @@ export interface ActorExtensionRuntime {
|
|
|
13
13
|
skillPaths: string[];
|
|
14
14
|
} | undefined;
|
|
15
15
|
getRunOwnerId(ctx: Pi.ExtensionContext): string;
|
|
16
|
-
|
|
16
|
+
onAgentSettled(ctx: Pi.ExtensionContext): void;
|
|
17
17
|
onSessionShutdown(reason: string, ctx: Pi.ExtensionContext): void;
|
|
18
18
|
onSessionStart(ctx: Pi.ExtensionContext): Promise<void>;
|
|
19
19
|
registerCoreTools(): void;
|
|
@@ -112,7 +112,7 @@ export function createActorExtensionRuntime(pi) {
|
|
|
112
112
|
return skillPaths.length > 0 ? { skillPaths } : undefined;
|
|
113
113
|
},
|
|
114
114
|
getRunOwnerId,
|
|
115
|
-
|
|
115
|
+
onAgentSettled(ctx) {
|
|
116
116
|
if (activeRunContext === ctx)
|
|
117
117
|
automaticReview.schedule();
|
|
118
118
|
},
|
|
@@ -75,9 +75,9 @@ export function reconcileRunTerminalNotifications(input) {
|
|
|
75
75
|
includeAttention: input.includeAttention,
|
|
76
76
|
stateRoot: input.stateRoot,
|
|
77
77
|
});
|
|
78
|
+
deliverRunTransitionNotifications(snapshot.transitions, input.sink, input.inFlight);
|
|
78
79
|
if (input.includeAttention)
|
|
79
80
|
deliverRunAttentionNotifications(snapshot.attentionEvents, input.sink);
|
|
80
|
-
deliverRunTransitionNotifications(snapshot.transitions, input.sink, input.inFlight);
|
|
81
81
|
pruneRunUiObservationState(input.state, snapshot);
|
|
82
82
|
return snapshot;
|
|
83
83
|
}
|
|
@@ -838,6 +838,8 @@ export function getRunAttentionNotificationType(event) {
|
|
|
838
838
|
return event.level;
|
|
839
839
|
}
|
|
840
840
|
export function shouldNotifyRunAttentionEvent(event) {
|
|
841
|
+
if (event.kind === "command.done")
|
|
842
|
+
return false;
|
|
841
843
|
return event.attention === "notify" || event.attention === "followup";
|
|
842
844
|
}
|
|
843
845
|
export function shouldSendRunAttentionFollowUp(event) {
|
|
@@ -284,9 +284,6 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
284
284
|
complete_allowed: missing.length === 0,
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
function getCommandDoneDelivery(result) {
|
|
288
|
-
return result.code !== 0 || activeSubagents > 0 ? "followup" : "log";
|
|
289
|
-
}
|
|
290
287
|
function progressRunning() {
|
|
291
288
|
progress("running", {
|
|
292
289
|
activeSubagents,
|
|
@@ -433,21 +430,6 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
433
430
|
...(preflightDiagnostic ? { preflight: preflightDiagnostic } : {}),
|
|
434
431
|
});
|
|
435
432
|
}
|
|
436
|
-
event("command.done", {
|
|
437
|
-
activeSubagents,
|
|
438
|
-
command_id: commandId,
|
|
439
|
-
code: result.code,
|
|
440
|
-
command: commandDetail,
|
|
441
|
-
killed: result.killed,
|
|
442
|
-
...captureDetails(result),
|
|
443
|
-
...(materialized.promptFile ? { prompt_file: materialized.promptFile } : {}),
|
|
444
|
-
...(materialized.promptBytes ? { prompt_bytes: materialized.promptBytes } : {}),
|
|
445
|
-
...(session.sessionDir ? { session_dir: relative(stateDir, session.sessionDir).replaceAll("\\", "/") } : {}),
|
|
446
|
-
...(commandSessionFiles(session.sessionDir).length > 0
|
|
447
|
-
? { session_files: commandSessionFiles(session.sessionDir) }
|
|
448
|
-
: {}),
|
|
449
|
-
...(preflightDiagnostic ? { preflight: preflightDiagnostic } : {}),
|
|
450
|
-
});
|
|
451
433
|
observation(
|
|
452
434
|
"command.done",
|
|
453
435
|
`Command ${summarizeCommandDetail(commandDetail)} completed with code ${result.code}`,
|
|
@@ -462,9 +444,13 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
462
444
|
...captureDetails(result),
|
|
463
445
|
...(materialized.promptFile ? { prompt_file: materialized.promptFile } : {}),
|
|
464
446
|
...(materialized.promptBytes ? { prompt_bytes: materialized.promptBytes } : {}),
|
|
447
|
+
...(session.sessionDir ? { session_dir: relative(stateDir, session.sessionDir).replaceAll("\\", "/") } : {}),
|
|
448
|
+
...(commandSessionFiles(session.sessionDir).length > 0
|
|
449
|
+
? { session_files: commandSessionFiles(session.sessionDir) }
|
|
450
|
+
: {}),
|
|
465
451
|
...(preflightDiagnostic ? { preflight: preflightDiagnostic } : {}),
|
|
466
452
|
},
|
|
467
|
-
|
|
453
|
+
"log",
|
|
468
454
|
result.code === 0 ? "info" : "error",
|
|
469
455
|
);
|
|
470
456
|
progressRunning();
|
package/docs/async-runs.md
CHANGED
|
@@ -52,12 +52,13 @@ diagnostics.jsonl
|
|
|
52
52
|
Trace records strict bounded events:
|
|
53
53
|
|
|
54
54
|
```json
|
|
55
|
-
{"id":"…","ts":"…","kind":"command.done","summary":"Command completed","data":{"code":0},"level":"info"
|
|
55
|
+
{"id":"…","ts":"…","kind":"command.done","summary":"Command completed","data":{"code":0},"level":"info"}
|
|
56
|
+
{"id":"…","ts":"…","kind":"checkpoint.ready","summary":"Review needs a decision","level":"info","attention":"followup"}
|
|
56
57
|
```
|
|
57
58
|
|
|
58
59
|
Required fields: `id`, `ts`, `kind`. Optional fields: `summary`, `data`, `level`, `attention`. Trace rejects addressed-envelope fields and malformed or oversized data. It retains a recent suffix within 2,048 events and 4 MiB. When either bound would be exceeded, the canonical lock atomically keeps a newest suffix near the lower targets, the new event, and one cumulative warning-only `runtime.trace_compacted` marker. The marker means older history was discarded; it reports cumulative drop evidence and never requests attention.
|
|
59
60
|
|
|
60
|
-
Runtime lifecycle, runner progress, command completion, cancellation, kill, parent teardown, and controlled-service observations use Trace. Bounded reads preserve complete UTF-8 lines and disclose omitted legacy prefixes. `inspect view=trace` reports retained-history completeness and projects events with Controls, owned Pi turns, logs, results, artifacts, and diagnostics newest-first. Equal timestamps use same-source physical order, then fixed source rank and stable id without claiming cross-source causality. Terminal state, `result.json`, `execution.json`, and artifacts remain authoritative even when old Trace has compacted.
|
|
61
|
+
Runtime lifecycle, runner progress, command completion, cancellation, kill, parent teardown, and controlled-service observations use Trace. Generic command lifecycle is Trace-only: runner-owned `command.done` records preserve level, captures, session provenance, and execution evidence but never request or project attention. No Recipe field configures command-completion delivery. Semantic checkpoints opt in explicitly with `attention: "notify"` or `attention: "followup"`; they must not infer coordinator intent from a leaf exit code. Bounded reads preserve complete UTF-8 lines and disclose omitted legacy prefixes. `inspect view=trace` reports retained-history completeness and projects events with Controls, owned Pi turns, logs, results, artifacts, and diagnostics newest-first. Equal timestamps use same-source physical order, then fixed source rank and stable id without claiming cross-source causality. Terminal state, `result.json`, `execution.json`, and artifacts remain authoritative even when old Trace has compacted.
|
|
61
62
|
|
|
62
63
|
## Control
|
|
63
64
|
|
|
@@ -106,7 +107,9 @@ Review acceptance remains a command-stage concern. General execution evidence do
|
|
|
106
107
|
|
|
107
108
|
Statuses include `running`, `done`, `failed`, `exited`, `cancelled`, and `killed`. Status resolution combines persisted metadata, result/terminal evidence, and verified process state.
|
|
108
109
|
|
|
109
|
-
Ambient observation detects terminal transitions and retained Trace attention. Canonical attention is an in-memory wake hint, not a durable queue: observers prime retained ids at startup, deliver each later retained unseen id once, and bound memory to the current retained set across compaction. Persist durable recovery state or an artifact before emitting attention; compaction may discard older hints and its marker makes that history loss explicit. Terminal follow-up delivery persists handled/failure evidence so reloads retry unhandled transitions without duplicating completed notifications.
|
|
110
|
+
Ambient observation detects root terminal transitions and explicit retained Trace attention. Terminal transitions reconcile before semantic attention. Canonical attention is an in-memory wake hint, not a durable queue: observers prime retained ids at startup, deliver each later retained unseen id once, and bound memory to the current retained set across compaction. Persist durable recovery state or an artifact before emitting attention; compaction may discard older hints and its marker makes that history loss explicit. Terminal follow-up delivery persists handled/failure evidence so reloads retry unhandled transitions without duplicating completed notifications.
|
|
111
|
+
|
|
112
|
+
By default, one normal finite Run produces exactly one automatic agent turn from its root terminal result. Sequence, parallel, repeat, and imported branches are internal execution topology and never own branch-level turns. Each separately launched Run owns its own generation and terminal lifecycle; compatible singleton reuse is not a new launch. Explicit semantic attention may intentionally add a checkpoint turn; Runs marked silent suppress automatic projection.
|
|
110
113
|
|
|
111
114
|
Large semantic results stay outside compact visible follow-up text and remain available in structured details, execution captures, or artifacts.
|
|
112
115
|
|
package/index.ts
CHANGED
|
@@ -14,7 +14,7 @@ export default function toolRegistryExtension(pi: Pi.ExtensionAPI) {
|
|
|
14
14
|
runtime.discoverResources(import.meta.url),
|
|
15
15
|
);
|
|
16
16
|
pi.on("session_start", async (_event, ctx) => runtime.onSessionStart(ctx));
|
|
17
|
-
pi.on("
|
|
17
|
+
pi.on("agent_settled", async (_event, ctx) => runtime.onAgentSettled(ctx));
|
|
18
18
|
pi.on("session_shutdown", async (event, ctx) =>
|
|
19
19
|
runtime.onSessionShutdown(event.reason, ctx),
|
|
20
20
|
);
|
package/lib/extension-runtime.ts
CHANGED
|
@@ -25,7 +25,7 @@ export interface ActorExtensionRuntime {
|
|
|
25
25
|
): { systemPrompt: string };
|
|
26
26
|
discoverResources(metaUrl: string): { skillPaths: string[] } | undefined;
|
|
27
27
|
getRunOwnerId(ctx: Pi.ExtensionContext): string;
|
|
28
|
-
|
|
28
|
+
onAgentSettled(ctx: Pi.ExtensionContext): void;
|
|
29
29
|
onSessionShutdown(reason: string, ctx: Pi.ExtensionContext): void;
|
|
30
30
|
onSessionStart(ctx: Pi.ExtensionContext): Promise<void>;
|
|
31
31
|
registerCoreTools(): void;
|
|
@@ -141,7 +141,7 @@ export function createActorExtensionRuntime(
|
|
|
141
141
|
return skillPaths.length > 0 ? { skillPaths } : undefined;
|
|
142
142
|
},
|
|
143
143
|
getRunOwnerId,
|
|
144
|
-
|
|
144
|
+
onAgentSettled(ctx) {
|
|
145
145
|
if (activeRunContext === ctx) automaticReview.schedule();
|
|
146
146
|
},
|
|
147
147
|
onSessionShutdown(reason, ctx) {
|
package/lib/observability.ts
CHANGED
|
@@ -206,9 +206,9 @@ export function reconcileRunTerminalNotifications(input: {
|
|
|
206
206
|
includeAttention: input.includeAttention,
|
|
207
207
|
stateRoot: input.stateRoot,
|
|
208
208
|
});
|
|
209
|
+
deliverRunTransitionNotifications(snapshot.transitions, input.sink, input.inFlight);
|
|
209
210
|
if (input.includeAttention)
|
|
210
211
|
deliverRunAttentionNotifications(snapshot.attentionEvents, input.sink);
|
|
211
|
-
deliverRunTransitionNotifications(snapshot.transitions, input.sink, input.inFlight);
|
|
212
212
|
pruneRunUiObservationState(input.state, snapshot);
|
|
213
213
|
return snapshot;
|
|
214
214
|
}
|
|
@@ -1193,6 +1193,7 @@ export function getRunAttentionNotificationType(
|
|
|
1193
1193
|
}
|
|
1194
1194
|
|
|
1195
1195
|
export function shouldNotifyRunAttentionEvent(event: RunAttentionEvent): boolean {
|
|
1196
|
+
if (event.kind === "command.done") return false;
|
|
1196
1197
|
return event.attention === "notify" || event.attention === "followup";
|
|
1197
1198
|
}
|
|
1198
1199
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llblab/pi-actors",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Local Actor Kernel for Pi",
|
|
6
6
|
"keywords": [
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"image": "https://raw.githubusercontent.com/llblab/pi-actors/main/banner.jpg"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@earendil-works/pi-coding-agent": "
|
|
70
|
-
"@earendil-works/pi-tui": "
|
|
69
|
+
"@earendil-works/pi-coding-agent": ">=0.84.4",
|
|
70
|
+
"@earendil-works/pi-tui": ">=0.84.4"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@types/node": "latest",
|
package/scripts/async-runner.mjs
CHANGED
|
@@ -284,9 +284,6 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
284
284
|
complete_allowed: missing.length === 0,
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
function getCommandDoneDelivery(result) {
|
|
288
|
-
return result.code !== 0 || activeSubagents > 0 ? "followup" : "log";
|
|
289
|
-
}
|
|
290
287
|
function progressRunning() {
|
|
291
288
|
progress("running", {
|
|
292
289
|
activeSubagents,
|
|
@@ -433,21 +430,6 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
433
430
|
...(preflightDiagnostic ? { preflight: preflightDiagnostic } : {}),
|
|
434
431
|
});
|
|
435
432
|
}
|
|
436
|
-
event("command.done", {
|
|
437
|
-
activeSubagents,
|
|
438
|
-
command_id: commandId,
|
|
439
|
-
code: result.code,
|
|
440
|
-
command: commandDetail,
|
|
441
|
-
killed: result.killed,
|
|
442
|
-
...captureDetails(result),
|
|
443
|
-
...(materialized.promptFile ? { prompt_file: materialized.promptFile } : {}),
|
|
444
|
-
...(materialized.promptBytes ? { prompt_bytes: materialized.promptBytes } : {}),
|
|
445
|
-
...(session.sessionDir ? { session_dir: relative(stateDir, session.sessionDir).replaceAll("\\", "/") } : {}),
|
|
446
|
-
...(commandSessionFiles(session.sessionDir).length > 0
|
|
447
|
-
? { session_files: commandSessionFiles(session.sessionDir) }
|
|
448
|
-
: {}),
|
|
449
|
-
...(preflightDiagnostic ? { preflight: preflightDiagnostic } : {}),
|
|
450
|
-
});
|
|
451
433
|
observation(
|
|
452
434
|
"command.done",
|
|
453
435
|
`Command ${summarizeCommandDetail(commandDetail)} completed with code ${result.code}`,
|
|
@@ -462,9 +444,13 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
462
444
|
...captureDetails(result),
|
|
463
445
|
...(materialized.promptFile ? { prompt_file: materialized.promptFile } : {}),
|
|
464
446
|
...(materialized.promptBytes ? { prompt_bytes: materialized.promptBytes } : {}),
|
|
447
|
+
...(session.sessionDir ? { session_dir: relative(stateDir, session.sessionDir).replaceAll("\\", "/") } : {}),
|
|
448
|
+
...(commandSessionFiles(session.sessionDir).length > 0
|
|
449
|
+
? { session_files: commandSessionFiles(session.sessionDir) }
|
|
450
|
+
: {}),
|
|
465
451
|
...(preflightDiagnostic ? { preflight: preflightDiagnostic } : {}),
|
|
466
452
|
},
|
|
467
|
-
|
|
453
|
+
"log",
|
|
468
454
|
result.code === 0 ? "info" : "error",
|
|
469
455
|
);
|
|
470
456
|
progressRunning();
|