@linnlabs/linnkit 0.35.1 → 0.36.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cli.cjs +13 -3
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +13 -3
  5. package/dist/cli.js.map +1 -1
  6. package/dist/contracts/agentSpec.d.cts +30 -30
  7. package/dist/contracts/agentSpec.d.ts +30 -30
  8. package/dist/contracts/audit.d.cts +32 -32
  9. package/dist/contracts/audit.d.ts +32 -32
  10. package/dist/contracts/contextPolicy.d.cts +36 -36
  11. package/dist/contracts/contextPolicy.d.ts +36 -36
  12. package/dist/contracts/events.d.cts +1114 -1114
  13. package/dist/contracts/events.d.ts +1114 -1114
  14. package/dist/contracts/execution.d.cts +8 -8
  15. package/dist/contracts/execution.d.ts +8 -8
  16. package/dist/contracts/messages.d.cts +1178 -1178
  17. package/dist/contracts/messages.d.ts +1178 -1178
  18. package/dist/contracts/provider-continuation.d.cts +28 -28
  19. package/dist/contracts/provider-continuation.d.ts +28 -28
  20. package/dist/contracts/sse.d.cts +899 -899
  21. package/dist/contracts/sse.d.ts +899 -899
  22. package/dist/contracts/sub-run-trace-payload.d.cts +26 -26
  23. package/dist/contracts/sub-run-trace-payload.d.ts +26 -26
  24. package/dist/contracts/token-accounting.d.cts +46 -46
  25. package/dist/contracts/token-accounting.d.ts +46 -46
  26. package/dist/index.cjs +13 -3
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.js +13 -3
  29. package/dist/index.js.map +1 -1
  30. package/dist/quickstart.cjs +13 -3
  31. package/dist/quickstart.cjs.map +1 -1
  32. package/dist/quickstart.js +13 -3
  33. package/dist/quickstart.js.map +1 -1
  34. package/dist/runtime-kernel/events/agentEvents.d.cts +172 -172
  35. package/dist/runtime-kernel/events/agentEvents.d.ts +172 -172
  36. package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.cts +3 -1
  37. package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.ts +3 -1
  38. package/dist/runtime-kernel/run-supervisor/runSupervisor.d.cts +2 -2
  39. package/dist/runtime-kernel/run-supervisor/runSupervisor.d.ts +2 -2
  40. package/dist/runtime-kernel.cjs +13 -3
  41. package/dist/runtime-kernel.cjs.map +1 -1
  42. package/dist/runtime-kernel.js +13 -3
  43. package/dist/runtime-kernel.js.map +1 -1
  44. package/dist/testkit.cjs +13 -3
  45. package/dist/testkit.cjs.map +1 -1
  46. package/dist/testkit.js +13 -3
  47. package/dist/testkit.js.map +1 -1
  48. package/docs/integration/run-supervisor.md +2 -0
  49. package/package.json +2 -2
@@ -56,18 +56,18 @@ declare const ContextTokenComponent: z.ZodObject<{
56
56
  profileId: z.ZodOptional<z.ZodString>;
57
57
  estimatorVersion: z.ZodOptional<z.ZodString>;
58
58
  }, "strip", z.ZodTypeAny, {
59
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
60
59
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
60
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
61
61
  confidence: "estimate" | "provider-estimate" | "actual";
62
62
  componentId: string;
63
63
  tokens: number;
64
- role?: string | undefined;
65
64
  resourceId?: string | undefined;
66
65
  width?: number | undefined;
67
66
  height?: number | undefined;
68
67
  label?: string | undefined;
69
- profileId?: string | undefined;
70
68
  action?: string | undefined;
69
+ role?: string | undefined;
70
+ profileId?: string | undefined;
71
71
  messageId?: string | undefined;
72
72
  kept?: boolean | undefined;
73
73
  truncatedAtExecution?: boolean | undefined;
@@ -78,18 +78,18 @@ declare const ContextTokenComponent: z.ZodObject<{
78
78
  attachmentIndex?: number | undefined;
79
79
  estimatorVersion?: string | undefined;
80
80
  }, {
81
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
82
81
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
82
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
83
83
  confidence: "estimate" | "provider-estimate" | "actual";
84
84
  componentId: string;
85
85
  tokens: number;
86
- role?: string | undefined;
87
86
  resourceId?: string | undefined;
88
87
  width?: number | undefined;
89
88
  height?: number | undefined;
90
89
  label?: string | undefined;
91
- profileId?: string | undefined;
92
90
  action?: string | undefined;
91
+ role?: string | undefined;
92
+ profileId?: string | undefined;
93
93
  messageId?: string | undefined;
94
94
  kept?: boolean | undefined;
95
95
  truncatedAtExecution?: boolean | undefined;
@@ -205,12 +205,11 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
205
205
  totalTokens?: number | undefined;
206
206
  rawUsage?: unknown;
207
207
  };
208
- conversationId?: string | undefined;
209
208
  runId?: string | undefined;
210
209
  parentRunId?: string | undefined;
210
+ conversationId?: string | undefined;
211
211
  turnId?: string | undefined;
212
212
  modelId?: string | undefined;
213
- stepId?: string | undefined;
214
213
  route?: {
215
214
  modelId: string;
216
215
  capabilityId: string;
@@ -223,6 +222,7 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
223
222
  baseURL?: string | undefined;
224
223
  endpointModelId?: string | undefined;
225
224
  } | undefined;
225
+ stepId?: string | undefined;
226
226
  createdAt?: number | undefined;
227
227
  }, {
228
228
  id: string;
@@ -239,12 +239,11 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
239
239
  totalTokens?: number | undefined;
240
240
  rawUsage?: unknown;
241
241
  };
242
- conversationId?: string | undefined;
243
242
  runId?: string | undefined;
244
243
  parentRunId?: string | undefined;
244
+ conversationId?: string | undefined;
245
245
  turnId?: string | undefined;
246
246
  modelId?: string | undefined;
247
- stepId?: string | undefined;
248
247
  route?: {
249
248
  modelId: string;
250
249
  capabilityId: string;
@@ -257,6 +256,7 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
257
256
  baseURL?: string | undefined;
258
257
  endpointModelId?: string | undefined;
259
258
  } | undefined;
259
+ stepId?: string | undefined;
260
260
  createdAt?: number | undefined;
261
261
  }>;
262
262
  type LlmUsageTokenLedgerEntry = z.infer<typeof LlmUsageTokenLedgerEntry>;
@@ -337,18 +337,18 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
337
337
  profileId: z.ZodOptional<z.ZodString>;
338
338
  estimatorVersion: z.ZodOptional<z.ZodString>;
339
339
  }, "strip", z.ZodTypeAny, {
340
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
341
340
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
341
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
342
342
  confidence: "estimate" | "provider-estimate" | "actual";
343
343
  componentId: string;
344
344
  tokens: number;
345
- role?: string | undefined;
346
345
  resourceId?: string | undefined;
347
346
  width?: number | undefined;
348
347
  height?: number | undefined;
349
348
  label?: string | undefined;
350
- profileId?: string | undefined;
351
349
  action?: string | undefined;
350
+ role?: string | undefined;
351
+ profileId?: string | undefined;
352
352
  messageId?: string | undefined;
353
353
  kept?: boolean | undefined;
354
354
  truncatedAtExecution?: boolean | undefined;
@@ -359,18 +359,18 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
359
359
  attachmentIndex?: number | undefined;
360
360
  estimatorVersion?: string | undefined;
361
361
  }, {
362
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
363
362
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
363
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
364
364
  confidence: "estimate" | "provider-estimate" | "actual";
365
365
  componentId: string;
366
366
  tokens: number;
367
- role?: string | undefined;
368
367
  resourceId?: string | undefined;
369
368
  width?: number | undefined;
370
369
  height?: number | undefined;
371
370
  label?: string | undefined;
372
- profileId?: string | undefined;
373
371
  action?: string | undefined;
372
+ role?: string | undefined;
373
+ profileId?: string | undefined;
374
374
  messageId?: string | undefined;
375
375
  kept?: boolean | undefined;
376
376
  truncatedAtExecution?: boolean | undefined;
@@ -386,18 +386,18 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
386
386
  id: string;
387
387
  kind: "context-component";
388
388
  components: {
389
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
390
389
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
390
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
391
391
  confidence: "estimate" | "provider-estimate" | "actual";
392
392
  componentId: string;
393
393
  tokens: number;
394
- role?: string | undefined;
395
394
  resourceId?: string | undefined;
396
395
  width?: number | undefined;
397
396
  height?: number | undefined;
398
397
  label?: string | undefined;
399
- profileId?: string | undefined;
400
398
  action?: string | undefined;
399
+ role?: string | undefined;
400
+ profileId?: string | undefined;
401
401
  messageId?: string | undefined;
402
402
  kept?: boolean | undefined;
403
403
  truncatedAtExecution?: boolean | undefined;
@@ -409,11 +409,10 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
409
409
  estimatorVersion?: string | undefined;
410
410
  }[];
411
411
  totalTokens: number;
412
- conversationId?: string | undefined;
413
412
  runId?: string | undefined;
414
413
  parentRunId?: string | undefined;
414
+ conversationId?: string | undefined;
415
415
  turnId?: string | undefined;
416
- stepId?: string | undefined;
417
416
  route?: {
418
417
  modelId: string;
419
418
  capabilityId: string;
@@ -426,23 +425,24 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
426
425
  baseURL?: string | undefined;
427
426
  endpointModelId?: string | undefined;
428
427
  } | undefined;
428
+ stepId?: string | undefined;
429
429
  createdAt?: number | undefined;
430
430
  }, {
431
431
  id: string;
432
432
  kind: "context-component";
433
433
  components: {
434
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
435
434
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
435
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
436
436
  confidence: "estimate" | "provider-estimate" | "actual";
437
437
  componentId: string;
438
438
  tokens: number;
439
- role?: string | undefined;
440
439
  resourceId?: string | undefined;
441
440
  width?: number | undefined;
442
441
  height?: number | undefined;
443
442
  label?: string | undefined;
444
- profileId?: string | undefined;
445
443
  action?: string | undefined;
444
+ role?: string | undefined;
445
+ profileId?: string | undefined;
446
446
  messageId?: string | undefined;
447
447
  kept?: boolean | undefined;
448
448
  truncatedAtExecution?: boolean | undefined;
@@ -454,11 +454,10 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
454
454
  estimatorVersion?: string | undefined;
455
455
  }[];
456
456
  totalTokens: number;
457
- conversationId?: string | undefined;
458
457
  runId?: string | undefined;
459
458
  parentRunId?: string | undefined;
459
+ conversationId?: string | undefined;
460
460
  turnId?: string | undefined;
461
- stepId?: string | undefined;
462
461
  route?: {
463
462
  modelId: string;
464
463
  capabilityId: string;
@@ -471,6 +470,7 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
471
470
  baseURL?: string | undefined;
472
471
  endpointModelId?: string | undefined;
473
472
  } | undefined;
473
+ stepId?: string | undefined;
474
474
  createdAt?: number | undefined;
475
475
  }>;
476
476
  type ContextComponentTokenLedgerEntry = z.infer<typeof ContextComponentTokenLedgerEntry>;
@@ -578,12 +578,11 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
578
578
  totalTokens?: number | undefined;
579
579
  rawUsage?: unknown;
580
580
  };
581
- conversationId?: string | undefined;
582
581
  runId?: string | undefined;
583
582
  parentRunId?: string | undefined;
583
+ conversationId?: string | undefined;
584
584
  turnId?: string | undefined;
585
585
  modelId?: string | undefined;
586
- stepId?: string | undefined;
587
586
  route?: {
588
587
  modelId: string;
589
588
  capabilityId: string;
@@ -596,6 +595,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
596
595
  baseURL?: string | undefined;
597
596
  endpointModelId?: string | undefined;
598
597
  } | undefined;
598
+ stepId?: string | undefined;
599
599
  createdAt?: number | undefined;
600
600
  }, {
601
601
  id: string;
@@ -612,12 +612,11 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
612
612
  totalTokens?: number | undefined;
613
613
  rawUsage?: unknown;
614
614
  };
615
- conversationId?: string | undefined;
616
615
  runId?: string | undefined;
617
616
  parentRunId?: string | undefined;
617
+ conversationId?: string | undefined;
618
618
  turnId?: string | undefined;
619
619
  modelId?: string | undefined;
620
- stepId?: string | undefined;
621
620
  route?: {
622
621
  modelId: string;
623
622
  capabilityId: string;
@@ -630,6 +629,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
630
629
  baseURL?: string | undefined;
631
630
  endpointModelId?: string | undefined;
632
631
  } | undefined;
632
+ stepId?: string | undefined;
633
633
  createdAt?: number | undefined;
634
634
  }>, z.ZodObject<{
635
635
  id: z.ZodString;
@@ -708,18 +708,18 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
708
708
  profileId: z.ZodOptional<z.ZodString>;
709
709
  estimatorVersion: z.ZodOptional<z.ZodString>;
710
710
  }, "strip", z.ZodTypeAny, {
711
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
712
711
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
712
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
713
713
  confidence: "estimate" | "provider-estimate" | "actual";
714
714
  componentId: string;
715
715
  tokens: number;
716
- role?: string | undefined;
717
716
  resourceId?: string | undefined;
718
717
  width?: number | undefined;
719
718
  height?: number | undefined;
720
719
  label?: string | undefined;
721
- profileId?: string | undefined;
722
720
  action?: string | undefined;
721
+ role?: string | undefined;
722
+ profileId?: string | undefined;
723
723
  messageId?: string | undefined;
724
724
  kept?: boolean | undefined;
725
725
  truncatedAtExecution?: boolean | undefined;
@@ -730,18 +730,18 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
730
730
  attachmentIndex?: number | undefined;
731
731
  estimatorVersion?: string | undefined;
732
732
  }, {
733
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
734
733
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
734
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
735
735
  confidence: "estimate" | "provider-estimate" | "actual";
736
736
  componentId: string;
737
737
  tokens: number;
738
- role?: string | undefined;
739
738
  resourceId?: string | undefined;
740
739
  width?: number | undefined;
741
740
  height?: number | undefined;
742
741
  label?: string | undefined;
743
- profileId?: string | undefined;
744
742
  action?: string | undefined;
743
+ role?: string | undefined;
744
+ profileId?: string | undefined;
745
745
  messageId?: string | undefined;
746
746
  kept?: boolean | undefined;
747
747
  truncatedAtExecution?: boolean | undefined;
@@ -757,18 +757,18 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
757
757
  id: string;
758
758
  kind: "context-component";
759
759
  components: {
760
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
761
760
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
761
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
762
762
  confidence: "estimate" | "provider-estimate" | "actual";
763
763
  componentId: string;
764
764
  tokens: number;
765
- role?: string | undefined;
766
765
  resourceId?: string | undefined;
767
766
  width?: number | undefined;
768
767
  height?: number | undefined;
769
768
  label?: string | undefined;
770
- profileId?: string | undefined;
771
769
  action?: string | undefined;
770
+ role?: string | undefined;
771
+ profileId?: string | undefined;
772
772
  messageId?: string | undefined;
773
773
  kept?: boolean | undefined;
774
774
  truncatedAtExecution?: boolean | undefined;
@@ -780,11 +780,10 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
780
780
  estimatorVersion?: string | undefined;
781
781
  }[];
782
782
  totalTokens: number;
783
- conversationId?: string | undefined;
784
783
  runId?: string | undefined;
785
784
  parentRunId?: string | undefined;
785
+ conversationId?: string | undefined;
786
786
  turnId?: string | undefined;
787
- stepId?: string | undefined;
788
787
  route?: {
789
788
  modelId: string;
790
789
  capabilityId: string;
@@ -797,23 +796,24 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
797
796
  baseURL?: string | undefined;
798
797
  endpointModelId?: string | undefined;
799
798
  } | undefined;
799
+ stepId?: string | undefined;
800
800
  createdAt?: number | undefined;
801
801
  }, {
802
802
  id: string;
803
803
  kind: "context-component";
804
804
  components: {
805
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
806
805
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
806
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
807
807
  confidence: "estimate" | "provider-estimate" | "actual";
808
808
  componentId: string;
809
809
  tokens: number;
810
- role?: string | undefined;
811
810
  resourceId?: string | undefined;
812
811
  width?: number | undefined;
813
812
  height?: number | undefined;
814
813
  label?: string | undefined;
815
- profileId?: string | undefined;
816
814
  action?: string | undefined;
815
+ role?: string | undefined;
816
+ profileId?: string | undefined;
817
817
  messageId?: string | undefined;
818
818
  kept?: boolean | undefined;
819
819
  truncatedAtExecution?: boolean | undefined;
@@ -825,11 +825,10 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
825
825
  estimatorVersion?: string | undefined;
826
826
  }[];
827
827
  totalTokens: number;
828
- conversationId?: string | undefined;
829
828
  runId?: string | undefined;
830
829
  parentRunId?: string | undefined;
830
+ conversationId?: string | undefined;
831
831
  turnId?: string | undefined;
832
- stepId?: string | undefined;
833
832
  route?: {
834
833
  modelId: string;
835
834
  capabilityId: string;
@@ -842,6 +841,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
842
841
  baseURL?: string | undefined;
843
842
  endpointModelId?: string | undefined;
844
843
  } | undefined;
844
+ stepId?: string | undefined;
845
845
  createdAt?: number | undefined;
846
846
  }>]>;
847
847
  type TokenLedgerEntry = z.infer<typeof TokenLedgerEntry>;
package/dist/index.cjs CHANGED
@@ -14314,7 +14314,7 @@ function createAwaitingUserWatcher(options) {
14314
14314
  const onClose = () => {
14315
14315
  dispose();
14316
14316
  };
14317
- eventBus.on("event", onEvent);
14317
+ if (options.stateOwner !== "host") eventBus.on("event", onEvent);
14318
14318
  eventBus.on("close", onClose);
14319
14319
  return dispose;
14320
14320
  }
@@ -14790,6 +14790,7 @@ var DefaultRunSupervisor = class {
14790
14790
  this.runSlotLimiter = createRunSlotLimiter({ maxActiveRuns: options.maxActiveRuns });
14791
14791
  this.runConcurrencyKeys = createRunConcurrencyKeyRegistry();
14792
14792
  this.awaitingUserWatcher = createAwaitingUserWatcher({
14793
+ stateOwner: options.awaitingUserStateOwner,
14793
14794
  markAwaitingUser: (runId, patch) => this.getHandle(runId).markAwaitingUser(patch),
14794
14795
  onDisposed: (runId) => {
14795
14796
  this.eventWatchDisposers.delete(runId);
@@ -14986,8 +14987,17 @@ var DefaultRunSupervisor = class {
14986
14987
  canRestoreRun: this.canRestoreRun
14987
14988
  });
14988
14989
  }
14989
- async pause(runId, reason) {
14990
- await this.withRunControlLock(runId, () => this.getHandle(runId).pause(reason));
14990
+ async pause(runId, reason, expectedExecutionId) {
14991
+ await this.withRunControlLock(runId, async () => {
14992
+ const handle = this.getHandle(runId);
14993
+ if (expectedExecutionId !== void 0) {
14994
+ const record = await this.registryStore.load(runId);
14995
+ if (record?.metadata?.executionId !== expectedExecutionId) {
14996
+ throw new RunInteractionConflictError(runId, "pause execution ownership has changed");
14997
+ }
14998
+ }
14999
+ await handle.pause(reason);
15000
+ });
14991
15001
  }
14992
15002
  async resumePausedRun(input) {
14993
15003
  return this.withRunControlLock(input.runId, async () => {