@llblab/pi-actors 0.46.0 → 0.46.1

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.
Files changed (50) hide show
  1. package/BACKLOG.md +582 -0
  2. package/CHANGELOG.md +9 -0
  3. package/README.md +1 -1
  4. package/dist/lib/async-runs.d.ts +1 -0
  5. package/dist/lib/async-runs.js +4 -1
  6. package/dist/lib/execution.d.ts +1 -0
  7. package/dist/lib/execution.js +1 -0
  8. package/dist/lib/extension-runtime.js +25 -9
  9. package/dist/lib/inspector.js +1 -0
  10. package/dist/lib/prompts.d.ts +1 -1
  11. package/dist/lib/prompts.js +2 -2
  12. package/dist/lib/recipes-context.d.ts +12 -3
  13. package/dist/lib/recipes-context.js +28 -4
  14. package/dist/lib/recipes-discovery.d.ts +18 -0
  15. package/dist/lib/recipes-discovery.js +95 -22
  16. package/dist/lib/recipes-references.d.ts +18 -0
  17. package/dist/lib/recipes-references.js +120 -33
  18. package/dist/lib/registry.d.ts +14 -1
  19. package/dist/lib/registry.js +110 -87
  20. package/dist/lib/runtime.d.ts +30 -3
  21. package/dist/lib/runtime.js +73 -9
  22. package/dist/lib/tools-inspect.d.ts +3 -0
  23. package/dist/lib/tools-inspect.js +40 -20
  24. package/dist/lib/tools-local.d.ts +2 -2
  25. package/dist/lib/tools-local.js +5 -2
  26. package/dist/lib/tools-response.js +2 -0
  27. package/dist/lib/tools-spawn.d.ts +2 -2
  28. package/dist/lib/tools-spawn.js +1 -1
  29. package/dist/lib/tools.d.ts +4 -1
  30. package/dist/lib/tools.js +2 -0
  31. package/dist/skills/actors/SKILL.md +3 -3
  32. package/docs/template-recipes.md +3 -1
  33. package/docs/tool-registry.md +9 -3
  34. package/lib/async-runs.ts +5 -1
  35. package/lib/execution.ts +2 -0
  36. package/lib/extension-runtime.ts +33 -14
  37. package/lib/inspector.ts +1 -0
  38. package/lib/prompts.ts +2 -2
  39. package/lib/recipes-context.ts +49 -4
  40. package/lib/recipes-discovery.ts +164 -24
  41. package/lib/recipes-references.ts +163 -39
  42. package/lib/registry.ts +185 -94
  43. package/lib/runtime.ts +108 -12
  44. package/lib/tools-inspect.ts +57 -23
  45. package/lib/tools-local.ts +9 -3
  46. package/lib/tools-response.ts +2 -0
  47. package/lib/tools-spawn.ts +3 -2
  48. package/lib/tools.ts +4 -1
  49. package/package.json +1 -1
  50. package/skills/actors/SKILL.md +3 -3
package/BACKLOG.md CHANGED
@@ -1,3 +1,585 @@
1
1
  # Project Backlog
2
2
 
3
+ ## 0.46.1 — Registration Truth
4
+
5
+ **Base:** `0.46.0` at `4abe9b26525a57883446b1d897e9e1ddf6cacde5`
6
+ **Release type:** patch / contract repair
7
+ **Primary evidence:** `tests/registration-truth.test.ts`, distilled from `PI_ACTORS_RECIPE_UX_SESSION_REPORT.md`
8
+ **Release sentence:** every live pi-actors surface resolves user Recipes against the same session Skill context, registration validates the effective delegated contract before persistence, activation is truthfully observable, and unrelated invalid Skill components can no longer poison valid capability discovery.
9
+
10
+ ## Mission
11
+
12
+ Repair the runtime seams exposed by the first real `0.46.0` Skill-Recipe authoring session before redesigning agent guidance.
13
+
14
+ The intended operation was:
15
+
16
+ ```text
17
+ maintained Skill Recipe
18
+ media/player
19
+ ↓ specialize
20
+ persistent user tool
21
+ music_player
22
+ ↓ activate
23
+ call in the same session
24
+ ```
25
+
26
+ The session instead observed:
27
+
28
+ ```text
29
+ spawn resolves media/player
30
+ standalone QA resolves media/player
31
+ register_tool cannot resolve media/player
32
+ live registry rejects the wrapper
33
+ one unrelated invalid Skill Recipe empties the catalog
34
+ runtime-owned placeholders leak into the tool schema
35
+ registry persistence is reported as registration success
36
+ spawn is mistakenly used as proof of tool invocation
37
+ ```
38
+
39
+ `0.46.1` owns the mechanical truth required for `0.47.0` agent-native UX.
40
+
41
+ Do **not** solve these failures with more prose, compatibility aliases, copied Recipe contracts, helper paths, shell wrappers, or new orchestration concepts.
42
+
43
+ The target transaction is:
44
+
45
+ ```text
46
+ current session
47
+ ↓
48
+ one RecipeResolutionContext
49
+ ↓
50
+ resolve candidate
51
+ ↓
52
+ derive effective Recipe/tool contract
53
+ ↓
54
+ validate candidate
55
+ ↓
56
+ persist
57
+ ↓
58
+ registry admission
59
+ ↓
60
+ host registration + active-tool reconciliation
61
+ ↓
62
+ verify activation
63
+ ↓
64
+ return truthful state
65
+ ```
66
+
67
+ ---
68
+
69
+ # 1. Retained Canon
70
+
71
+ The `0.46.0` capability model remains authoritative:
72
+
73
+ ```text
74
+ Recipe --spawn--> Run
75
+ Run = Recipe + Trace + Control
76
+ ```
77
+
78
+ Public Run verbs remain:
79
+
80
+ ```text
81
+ spawn
82
+ message
83
+ inspect
84
+ ```
85
+
86
+ Persistent capability mutation remains:
87
+
88
+ ```text
89
+ register_tool
90
+ ```
91
+
92
+ Run views remain:
93
+
94
+ ```text
95
+ recipe
96
+ trace
97
+ control
98
+ ```
99
+
100
+ Recipe references remain exactly:
101
+
102
+ ```text
103
+ <skill>/<recipe>
104
+ explicit/path.json
105
+ explicit/path.md
106
+ ```
107
+
108
+ Skill Recipe identity remains:
109
+
110
+ ```text
111
+ <active Skill identity>/<direct Recipe filename stem>
112
+ ```
113
+
114
+ Retain:
115
+
116
+ - six bundled Skill-owned capability packs;
117
+ - flat Skill `recipes/` directories;
118
+ - no root packaged Recipe library;
119
+ - no `std:` or `skill:` prefixes;
120
+ - no top-level file-backed Recipe `name`;
121
+ - session-scoped active Skill identity;
122
+ - runtime-owned `{recipe_dir}` and `{skill_dir}`;
123
+ - bounded Trace and Control;
124
+ - owner/generation/process fencing;
125
+ - automatic review transactions;
126
+ - secure npm publication;
127
+ - project-local Domain DAG Skill outside CI/release.
128
+
129
+ ---
130
+
131
+ # 2. Contract
132
+
133
+ ## 2.1 One live resolution environment
134
+
135
+ Every operation that decides whether a Recipe can be used in the live session must consume the same immutable session resolution environment.
136
+
137
+ Conceptually:
138
+
139
+ ```ts
140
+ interface RecipeResolutionContext {
141
+ session_id: string;
142
+ cwd: string;
143
+ active_skills: ActiveSkillRecipeContext;
144
+ generation: string;
145
+ }
146
+ ```
147
+
148
+ The exact internal type may be smaller, but there must be one explicit owner and one semantic contract.
149
+
150
+ The following must not invent independent active-Skill contexts:
151
+
152
+ ```text
153
+ spawn
154
+ register_tool candidate validation
155
+ user Recipe registry admission
156
+ user Recipe registry reload
157
+ tool schema derivation
158
+ inspect recipes
159
+ inspect tool
160
+ automatic review when resolving user wrappers
161
+ live Recipe validation used by registration
162
+ ```
163
+
164
+ Standalone package QA may still construct an offline package context, but it must be labeled as offline/package QA and may not be represented as proof of live registry admission.
165
+
166
+ ## 2.2 One user Recipe admission path
167
+
168
+ A user Recipe under:
169
+
170
+ ```text
171
+ ~/.pi/agent/recipes/<name>.json
172
+ ```
173
+
174
+ is an active agent tool only if one authoritative admission function can:
175
+
176
+ 1. parse the authored Recipe;
177
+ 2. resolve its delegation/import graph with the live `RecipeResolutionContext`;
178
+ 3. derive runtime-owned origins;
179
+ 4. derive the effective argument/type/default contract;
180
+ 5. classify async behavior;
181
+ 6. validate Control/artifacts;
182
+ 7. produce one `RegisteredTool` projection;
183
+ 8. produce bounded diagnostics on failure.
184
+
185
+ `register_tool`, startup/reload discovery, and live revalidation must use this same admission contract.
186
+
187
+ Do not maintain one path that creates a `RegisteredTool` directly from `register_tool` input and another path that later interprets the persisted Recipe differently.
188
+
189
+ ## 2.3 Registration is a state transition
190
+
191
+ A successful registration response must distinguish at least:
192
+
193
+ ```text
194
+ resolved
195
+ validated
196
+ persisted
197
+ registry_active
198
+ host_registered
199
+ active_tool
200
+ callable_now
201
+ ```
202
+
203
+ These states may all become `true` in the healthy path, but they are not synonyms.
204
+
205
+ Never return text that implies current-session invocation if the system cannot prove it.
206
+
207
+ ## 2.4 Effective contract before mutation
208
+
209
+ A Recipe-backed tool must be validated from the **resolved effective contract**, not the shallow wrapper shape.
210
+
211
+ For:
212
+
213
+ ```json
214
+ {
215
+ "description": "Play local music.",
216
+ "defaults": {
217
+ "source": "~/Music/1MIX"
218
+ },
219
+ "template": "media/player"
220
+ }
221
+ ```
222
+
223
+ the effective tool contract inherits from `media/player`:
224
+
225
+ ```text
226
+ async
227
+ args
228
+ arg types
229
+ defaults
230
+ artifacts
231
+ Control
232
+ runtime-owned origins
233
+ ```
234
+
235
+ without copying those fields into the authored wrapper.
236
+
237
+ The tool schema must contain only caller-owned inputs.
238
+
239
+ ## 2.5 Partial catalog, exact resolver
240
+
241
+ The active Skill component catalog is diagnostic/discovery state.
242
+
243
+ It must never be required for exact resolution of an unrelated valid component.
244
+
245
+ An invalid:
246
+
247
+ ```text
248
+ some-skill/bad-recipe
249
+ ```
250
+
251
+ must not make:
252
+
253
+ ```text
254
+ media/player
255
+ ```
256
+
257
+ unresolvable merely because a catalog listing failed.
258
+
259
+ ---
260
+
261
+ # 3. Runtime-Owned Inputs
262
+
263
+ The following are runtime-owned and must never leak into caller-facing tool schemas merely because they occur in an effective Recipe template:
264
+
265
+ ```text
266
+ recipe_dir
267
+ skill_dir
268
+ state_dir
269
+ trace_file
270
+ run_instance_id
271
+ owner/session identity
272
+ runtime state root
273
+ ```
274
+
275
+ `run_id` remains an intentional caller-visible optional override for async tool invocation if the existing public contract retains it.
276
+
277
+ The executor must inventory every runtime-injected placeholder and centralize ownership rather than maintaining ad hoc exclusion lists in unrelated schema code.
278
+
279
+ Declared user args retain their actual types:
280
+
281
+ ```text
282
+ string
283
+ path
284
+ bool
285
+ int
286
+ number
287
+ enum
288
+ array
289
+ ```
290
+
291
+ A delegated Recipe may not degrade them all to strings.
292
+
293
+ ---
294
+
295
+ # 4. Activation Truth
296
+
297
+ `pi-actors` must determine what the Pi host can actually guarantee after dynamic `registerTool`.
298
+
299
+ Preferred contract:
300
+
301
+ ```text
302
+ register_tool returns callable_now=true
303
+ → host definition exists
304
+ → tool is in the current active tool set
305
+ → the next model step in the same session can call it
306
+ ```
307
+
308
+ If the Pi host cannot guarantee that:
309
+
310
+ ```text
311
+ register_tool returns callable_now=false
312
+ activation=<exact boundary>
313
+ ```
314
+
315
+ and all prompts/docs must say so.
316
+
317
+ Do not infer model visibility from persistence or an extension-local map.
318
+
319
+ The implementation must test the real Pi integration path, not only mocked registration callbacks.
320
+
321
+ ---
322
+
323
+ # 5. Registration Atomicity
324
+
325
+ For a new registration:
326
+
327
+ ```text
328
+ candidate
329
+ → resolve/validate without mutation
330
+ → durable write
331
+ → authoritative registry admission
332
+ → host registration/activation
333
+ → verification
334
+ ```
335
+
336
+ If failure occurs before persistence, no user Recipe file appears.
337
+
338
+ If persistence succeeds but authoritative admission fails unexpectedly:
339
+
340
+ - restore/delete the just-written candidate under the canonical mutation lock;
341
+ - restore prior in-memory registry state;
342
+ - report the exact failed phase;
343
+ - do not leave an invalid file while returning generic success.
344
+
345
+ For updates:
346
+
347
+ - preserve the prior file bytes until replacement is known valid;
348
+ - do not destroy a working tool because the replacement cannot resolve;
349
+ - retain existing CAS/path/symlink/mutation safety.
350
+
351
+ Host APIs that cannot unregister stale dynamic definitions must be explicitly accounted for. Validate as much as possible before host mutation.
352
+
353
+ ---
354
+
355
+ # 6. Registry and Component Observability
356
+
357
+ Existing:
358
+
359
+ ```text
360
+ inspect target=recipes view=status
361
+ inspect target=recipes view=summary
362
+ inspect target=recipes view=doctor
363
+ inspect target=tool:<name> view=status
364
+ inspect target=tool:<name> view=schema
365
+ ```
366
+
367
+ remain the public surfaces.
368
+
369
+ Do not add a new `recipe:` target in this patch.
370
+
371
+ Recipe registry inspection must expose bounded current state such as:
372
+
373
+ ```text
374
+ registry_generation
375
+ scanned_at
376
+ resolution_generation
377
+ watch_status
378
+ user_recipe_count
379
+ active_tool_count
380
+ skill_component_count
381
+ rejected_skill_component_count
382
+ catalog_partial
383
+ ```
384
+
385
+ Rejected Skill components must be reported individually with:
386
+
387
+ ```text
388
+ skill
389
+ stem if derivable
390
+ portable file location
391
+ reason
392
+ ```
393
+
394
+ Use portable paths such as:
395
+
396
+ ```text
397
+ ~/.pi/agent/skills/...
398
+ <pi-actors>/skills/...
399
+ ```
400
+
401
+ rather than raw home-directory leakage.
402
+
403
+ `inspect tool:<name> view=status` must expose activation state where it can be proven.
404
+
405
+ ---
406
+
407
+ # 7. Fail-Soft Skill Component Discovery
408
+
409
+ Refactor active Skill component listing so it returns valid entries and failures together.
410
+
411
+ Conceptually:
412
+
413
+ ```ts
414
+ interface SkillComponentInventory {
415
+ components: ActiveSkillRecipeComponent[];
416
+ rejected: SkillComponentDiagnostic[];
417
+ partial: boolean;
418
+ }
419
+ ```
420
+
421
+ Rules:
422
+
423
+ - invalid top-level `Recipe.name` rejects that component;
424
+ - nested Recipe files reject those files/that namespace as appropriate;
425
+ - JSON/Markdown same-stem collision rejects that stem;
426
+ - one duplicate active Skill identity may invalidate that Skill namespace;
427
+ - unrelated Skill namespaces continue;
428
+ - every rejection is bounded and diagnosable;
429
+ - exact resolver remains independent and may resolve a valid exact component while catalog inventory is partial.
430
+
431
+ Do not silently omit bad components.
432
+
433
+ ---
434
+
435
+ # 8. Launch-Kind Truth
436
+
437
+ Keep existing usage distinctions:
438
+
439
+ ```text
440
+ tool
441
+ spawn
442
+ direct Recipe/foreground execution where applicable
443
+ ```
444
+
445
+ At minimum:
446
+
447
+ - `spawn` result/details expose `launch_kind: "spawn"`;
448
+ - registered tool invocation evidence exposes `launch_kind: "tool"`;
449
+ - `inspect tool` usage summary distinguishes tool calls from Recipe spawn calls;
450
+ - no product copy describes `spawn recipe=<user-wrapper>` as invoking the registered tool.
451
+
452
+ Do not add a second generic invocation mechanism just for testing.
453
+
454
+ ---
455
+
456
+ # 9. Work Items
457
+
458
+ ## RGT-12 — Publish `0.46.1`
459
+
460
+ **Goal:** ship the prepared registration-truth release before agent UX redesign.
461
+
462
+ **State:** gated on explicit release intent and repository `ADMIN` authority.
463
+
464
+ **Remaining:**
465
+
466
+ - Run the existing guarded GitHub release flow for prepared version `0.46.1`.
467
+ - Verify npm package identity/provenance and GitHub Release convergence.
468
+ - After successful publication, reset this backlog to:
469
+
470
+ ```text
471
+ # Project Backlog
472
+
3
473
  No open items.
474
+ ```
475
+
476
+ **Unblocker:** the operator explicitly authorizes the `0.46.1` release and confirms `ADMIN` permission for this repository.
477
+
478
+ **Dependencies:** none.
479
+
480
+ ---
481
+
482
+ # 10. Dependency Graph
483
+
484
+ ```text
485
+ RGT-12
486
+ ```
487
+
488
+ Integration hotspots:
489
+
490
+ ```text
491
+ lib/extension-runtime.ts
492
+ lib/recipes-references.ts
493
+ lib/recipes-discovery.ts
494
+ lib/runtime.ts
495
+ lib/registry.ts
496
+ lib/tools-register.ts
497
+ lib/tools-local.ts
498
+ lib/tools-inspect.ts
499
+ lib/schema.ts
500
+ lib/recipes-usage.ts
501
+ ```
502
+
503
+ Use one integration owner for resolution/admission semantics.
504
+
505
+ ---
506
+
507
+ # 11. Required Test Matrix
508
+
509
+ | Boundary | Required evidence |
510
+ | ---------------------- | ----------------------------------------------------------------- |
511
+ | Live context | spawn/register/registry/inspect share exact session Skill context |
512
+ | Session isolation | no context bleed across sessions/replacements |
513
+ | Startup | Skill-dependent user tools reconcile after active Skills known |
514
+ | Watcher | reload uses current context/generation, stale callback fenced |
515
+ | Delegation | compact wrapper inherits effective Recipe contract |
516
+ | Invalid wrapper | rejected before persistence with precise diagnostic |
517
+ | Schema ownership | runtime-owned values absent |
518
+ | Schema types | enum/bool/int/path/array retained |
519
+ | Defaults | wrapper overrides validated against effective types |
520
+ | Catalog | unrelated bad component yields partial inventory |
521
+ | Exact resolution | valid component resolves despite unrelated rejection |
522
+ | Registry observability | generation/time/watch/current counts available |
523
+ | Registration | persisted/active/host/callable states separated |
524
+ | Rollback | failed update preserves previous working tool |
525
+ | Pi host | same-session injection proven or truthful limitation returned |
526
+ | Launch kind | tool vs spawn explicit in result/usage |
527
+ | Source/dist | same behavior in repository and packed install |
528
+ | Security | path/CAS/redaction/generation/review safety retained |
529
+
530
+ ---
531
+
532
+ # 12. Explicitly Deferred to `0.47.0`
533
+
534
+ Only the **agent interface/guidance layer** is deferred:
535
+
536
+ ```text
537
+ register_tool from=<skill>/<recipe>
538
+ register_tool defaults={...}
539
+ system prompt redesign as Skill-loading meta-protocol
540
+ actors Skill redesign as root agent operating protocol
541
+ capability Skill description/entrypoint redesign
542
+ agent-facing delegation-vs-import decision guidance
543
+ focused resolution explanation UX
544
+ fresh-agent journey dogfood
545
+ human-doc vs agent-Skill separation cleanup
546
+ ```
547
+
548
+ Do not defer any known runtime inconsistency from the report.
549
+
550
+ ---
551
+
552
+ # 13. Negative Scope
553
+
554
+ Do not add:
555
+
556
+ ```text
557
+ new Run nouns
558
+ new Run views
559
+ new generic invocation tool
560
+ new recipe target namespace
561
+ task graph runtime
562
+ actor chat
563
+ rooms/peers/mailboxes
564
+ remote Recipe registry
565
+ compatibility std:/skill: aliases
566
+ copied packaged Recipe wrappers
567
+ shell fallbacks
568
+ new capability-authoring Skill
569
+ large system-prompt rewrite
570
+ ```
571
+
572
+ ---
573
+
574
+ # 14. Stop Conditions
575
+
576
+ Stop and preserve evidence if:
577
+
578
+ - Pi cannot dynamically expose a newly registered tool in the same session and the product cannot observe the activation boundary;
579
+ - one authoritative user Recipe admission path cannot serve registry and `register_tool`;
580
+ - session-scoped Skill-dependent tools require global mutable state;
581
+ - rollback would overwrite concurrent user edits;
582
+ - schema ownership cannot distinguish runtime and caller values without changing Recipe semantics;
583
+ - fixing a failure appears to require copying a Skill Recipe contract into the user wrapper.
584
+
585
+ Resolve blockers at the owning boundary rather than hiding them with agent guidance.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.46.1: Registration Truth
4
+
5
+ - `Live Resolution`: Spawn, registration, registry admission/reload, schema derivation, and Inspect now consume one immutable session Recipe context. Skill-dependent user wrappers reconcile only after Pi supplies active Skills, watcher reloads retain the current generation, and stale session consumers fail closed.
6
+ - `Effective Admission`: One user-Recipe admission path resolves direct delegation before persistence, inheriting async behavior, typed arguments/defaults, artifacts, Control, and runtime origins without copying maintained contracts. Malformed or mistyped wrappers fail before mutation, and failed updates roll back prior bytes, registry state, host definitions, and active tools.
7
+ - `Schema Ownership`: Caller schemas preserve enum, bool, integer, number, path, and array types while centrally excluding runtime-owned inputs such as `recipe_dir`, `skill_dir`, `state_dir`, Trace/run identity, and runtime state roots. The intentional async `run_id` override remains public.
8
+ - `Fail-Soft Catalog`: Active-Skill inventory returns valid components alongside bounded per-component rejections and an explicit partial state. Invalid unrelated Recipes and duplicate namespaces remain diagnosable without poisoning exact resolution of valid components.
9
+ - `Activation and Observability`: Registration reports resolved, validated, persisted, registry, host, active-tool, and callable states from Pi host evidence. Recipe inspection adds generation, scan, watcher, portable-root, and partial-catalog state; tool status reports current activation and separate spawn/tool usage.
10
+ - `Launch Truth and Dogfood`: Spawn and registered-tool launches expose distinct `launch_kind` evidence. Source and packed-package regressions activate `media/player`, quarantine an unrelated stale component, register and invoke a compact `music_player` in the same session, preserve inherited Control/schema, exercise repair reloads and negative cases, and reject shell/copy workarounds.
11
+
3
12
  ## 0.46.0: Skill-Owned Capability Packs
4
13
 
5
14
  - `Breaking Recipe Grammar`: File-backed identity now comes only from the filename; top-level Recipe `name`, nested Skill identities, JSON/Markdown stem collisions, bare references, and the old `std:` / `skill:` prefixes fail with migration guidance. Composition accepts exact `<active-skill>/<stem>` references or explicit `.json` / `.md` paths, with entry paths based at invocation cwd and relative imports based at their owning Recipe.
package/README.md CHANGED
@@ -81,7 +81,7 @@ A Run exposes exactly `recipe`, `trace`, and `control` views.
81
81
 
82
82
  ### `register_tool`
83
83
 
84
- Persist a trusted command template or Recipe-backed capability under `~/.pi/agent/recipes`. Registration remains separate from running Control.
84
+ Persist a trusted command template or Recipe-backed capability under `~/.pi/agent/recipes`. Registration remains separate from running Control. Treat it as callable in the current session only when the result reports `callable_now: true`; persistence, Recipe spawning, and registered-tool invocation are distinct states.
85
85
 
86
86
  ## Recipe
87
87
 
@@ -68,6 +68,7 @@ export interface AsyncRunMeta {
68
68
  argv: string[];
69
69
  createdAt: string;
70
70
  cwd: string;
71
+ launch_kind?: AsyncRunLaunchSource;
71
72
  launch_source?: AsyncRunLaunchSource;
72
73
  launch_correlation?: {
73
74
  correlation_id?: string;
@@ -326,7 +326,10 @@ export function startRun(params, cwd, options = {}) {
326
326
  createdAt: new Date().toISOString(),
327
327
  cwd,
328
328
  ...(startParams.launch_source
329
- ? { launch_source: startParams.launch_source }
329
+ ? {
330
+ launch_kind: startParams.launch_source,
331
+ launch_source: startParams.launch_source,
332
+ }
330
333
  : {}),
331
334
  ...(startParams.launch_correlation
332
335
  ? { launch_correlation: startParams.launch_correlation } : {}),
@@ -72,6 +72,7 @@ export interface RegisteredToolExecutionResult {
72
72
  command: string;
73
73
  fullOutputPath?: string;
74
74
  killed: boolean;
75
+ launch_kind: "tool";
75
76
  stderrBytes?: number;
76
77
  stderrCapturedBytes?: number;
77
78
  stderrFile?: string;
@@ -709,6 +709,7 @@ export async function executeRegisteredTool(cfg, params, exec, cwd, signal) {
709
709
  command,
710
710
  fullOutputPath: result.stdoutFile ?? formatted.fullOutputPath,
711
711
  killed: result.killed,
712
+ launch_kind: "tool",
712
713
  ...getCaptureDetails(result),
713
714
  ...(executed.branches.length > 0 ? { branches: executed.branches } : {}),
714
715
  ...(executed.failures.length > 0