@kitman-sh/cli 0.13.14 → 0.13.16

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 (27) hide show
  1. package/dist/{chunk-hmt2egsx.js → chunk-49gbakce.js} +6 -6
  2. package/dist/{chunk-d4kmyv5h.js → chunk-4zh7qxck.js} +4 -4
  3. package/dist/{chunk-dwxqp8ez.js → chunk-5cevjkrb.js} +16 -16
  4. package/dist/{chunk-vmww6hnk.js → chunk-5w6r4mw6.js} +30 -30
  5. package/dist/{chunk-5ba08a9e.js → chunk-at5dh2te.js} +18 -18
  6. package/dist/{chunk-5mxvqg32.js → chunk-bt22cd13.js} +15 -10
  7. package/dist/{chunk-fk5238tn.js → chunk-c9rvst3x.js} +4 -4
  8. package/dist/{chunk-hw9fcfs0.js → chunk-cbzqfz1k.js} +9 -9
  9. package/dist/{chunk-vjsqg4a5.js → chunk-d9z9cyzt.js} +32 -32
  10. package/dist/{chunk-aa30tt6t.js → chunk-fc2bhh5v.js} +2 -2
  11. package/dist/{chunk-24h0y27w.js → chunk-gq7y5v3e.js} +1 -1
  12. package/dist/{chunk-4142qeg3.js → chunk-mbqb40ev.js} +16 -16
  13. package/dist/{chunk-hgfphycc.js → chunk-nf9gdnsf.js} +17 -26
  14. package/dist/{chunk-pxvd8w2v.js → chunk-q5w3v4k1.js} +1 -1
  15. package/dist/{chunk-mmd7mjv0.js → chunk-s88vcvtd.js} +3 -3
  16. package/dist/{chunk-6agcvxbj.js → chunk-sjdze64n.js} +10 -10
  17. package/dist/{chunk-06dwvzv0.js → chunk-t4xwk14b.js} +152 -107
  18. package/dist/{chunk-89rpg6j9.js → chunk-tntbdpmy.js} +86 -86
  19. package/dist/{chunk-st8ggqv1.js → chunk-ttk3d0z2.js} +154 -142
  20. package/dist/{chunk-zencwg2t.js → chunk-v1e4g2re.js} +1 -1
  21. package/dist/{chunk-8xpdkxr7.js → chunk-vsrjg9nm.js} +68 -22
  22. package/dist/{chunk-ggmwpwhf.js → chunk-x7acexnm.js} +5 -5
  23. package/dist/{chunk-ef3nzqng.js → chunk-y7p4d14b.js} +3 -3
  24. package/dist/{chunk-3vbs995s.js → chunk-zd6y6ka8.js} +167 -123
  25. package/dist/{chunk-zgraq2y3.js → chunk-zw3gf6r5.js} +28 -70
  26. package/dist/index.js +4 -4
  27. package/package.json +1 -1
@@ -1,4 +1,17 @@
1
1
  // @bun
2
+ import {
3
+ isDateTime,
4
+ Numeric,
5
+ isWholeNumber,
6
+ guard,
7
+ Id,
8
+ Timestamp,
9
+ ActorType,
10
+ SecretName,
11
+ SecretScope,
12
+ SecretHosts,
13
+ isSecretReference
14
+ } from "./chunk-q5w3v4k1.js";
2
15
  import {
3
16
  pipeArguments,
4
17
  dual,
@@ -38,7 +51,7 @@ import {
38
51
  assignProperty,
39
52
  PipeInspectableProto,
40
53
  withFiber,
41
- make13,
54
+ make14,
42
55
  strictEqual,
43
56
  Tuple,
44
57
  Number2,
@@ -58,7 +71,7 @@ import {
58
71
  Service2,
59
72
  makeUnsafe4,
60
73
  empty3,
61
- make14,
74
+ make15,
62
75
  add,
63
76
  getOrUndefined2,
64
77
  getOrUndefinedUnsafe,
@@ -91,7 +104,7 @@ import {
91
104
  fail4,
92
105
  isSuccess2,
93
106
  makeUnsafe5,
94
- make15,
107
+ make16,
95
108
  _await,
96
109
  fail5,
97
110
  isDone,
@@ -194,13 +207,11 @@ import {
194
207
  logError,
195
208
  effectify,
196
209
  decode,
197
- isRedacted,
198
- make16,
199
- value,
200
210
  defaultParseOptions,
201
211
  omit,
202
212
  map9,
203
213
  declare,
214
+ is,
204
215
  decodeUnknownEffect2,
205
216
  decodeEffect,
206
217
  decodeUnknownOption,
@@ -264,18 +275,17 @@ import {
264
275
  decodeJsonStringOption,
265
276
  encodeJsonStringSync,
266
277
  encodePrettyJsonString
267
- } from "./chunk-zgraq2y3.js";
278
+ } from "./chunk-zw3gf6r5.js";
268
279
  import {
269
280
  map,
270
281
  makeEquivalence,
271
- toNumber,
272
282
  bytes,
273
283
  BadArgument,
274
284
  systemError,
275
285
  badArgument,
276
286
  makeUnsafe2,
277
- make7,
278
287
  make8,
288
+ make9,
279
289
  sliding,
280
290
  unbounded2,
281
291
  offer,
@@ -291,13 +301,13 @@ import {
291
301
  isSink,
292
302
  fromChannel,
293
303
  drain,
294
- make9,
304
+ make10,
295
305
  get3,
296
306
  isStream,
297
307
  fromChannel2,
298
308
  callback,
299
309
  empty2,
300
- make10,
310
+ make11,
301
311
  suspend,
302
312
  fail2,
303
313
  fromQueue,
@@ -323,40 +333,31 @@ import {
323
333
  mkArrayBuffer,
324
334
  toReadableStreamEffect,
325
335
  FileSystem,
326
- make11,
336
+ make12,
327
337
  FileTypeId,
328
338
  WatchBackend,
329
339
  Path,
330
- make12,
340
+ make13,
331
341
  option,
332
342
  String2,
333
343
  optionalEnv,
334
344
  harnessesUnsupportedInSrt2
335
- } from "./chunk-hgfphycc.js";
336
- import {
337
- isDateTime,
338
- Numeric,
339
- isWholeNumber,
340
- guard,
341
- Id,
342
- Timestamp,
343
- ActorType,
344
- SecretName,
345
- SecretScope,
346
- SecretHosts,
347
- isSecretReference
348
- } from "./chunk-pxvd8w2v.js";
345
+ } from "./chunk-nf9gdnsf.js";
349
346
  import {
347
+ isRedacted,
348
+ make,
349
+ value,
350
350
  ExitCode,
351
351
  ProcessId,
352
352
  makeHandle,
353
- make,
353
+ make2,
354
354
  ChildProcessSpawner,
355
355
  display,
356
- make2,
356
+ make3,
357
357
  parseFdName,
358
358
  fdName
359
- } from "./chunk-8xpdkxr7.js";
359
+ } from "./chunk-vsrjg9nm.js";
360
+
360
361
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Tuple.js
361
362
  var makeEquivalence3 = Tuple;
362
363
 
@@ -518,7 +519,7 @@ var makeUnsafe6 = (input) => {
518
519
  var hasZone = (input) => /Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(input) || /z$|gmt$/i.test(input);
519
520
  var minEpochMillis = -8640000000000000 + 12 * 60 * 60 * 1000;
520
521
  var maxEpochMillis = 8640000000000000 - 14 * 60 * 60 * 1000;
521
- var make3 = /* @__PURE__ */ liftThrowable(makeUnsafe6);
522
+ var make4 = /* @__PURE__ */ liftThrowable(makeUnsafe6);
522
523
  var now = /* @__PURE__ */ map7(currentTimeMillis, makeUtc);
523
524
  var nowUnsafe = () => makeUtc(Date.now());
524
525
  var toDateUtc = (self) => new Date(self.epochMilliseconds);
@@ -897,9 +898,18 @@ var runMain2 = /* @__PURE__ */ makeRunMain(({
897
898
  // node_modules/.bun/@effect+platform-bun@4.1.2+edf248c88a527e3e/node_modules/@effect/platform-bun/dist/BunRuntime.js
898
899
  var runMain = runMain2;
899
900
 
901
+ // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/BigInt.js
902
+ var BigInt2 = globalThis.BigInt;
903
+ var toNumber = (b) => {
904
+ if (b > BigInt2(Number.MAX_SAFE_INTEGER) || b < BigInt2(Number.MIN_SAFE_INTEGER)) {
905
+ return none();
906
+ }
907
+ return some(Number(b));
908
+ };
909
+
900
910
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/DateTime.js
901
911
  var makeUnsafe = makeUnsafe6;
902
- var make18 = make3;
912
+ var make18 = make4;
903
913
  var now2 = now;
904
914
  var nowUnsafe2 = nowUnsafe;
905
915
  var toDateUtc2 = toDateUtc;
@@ -1114,7 +1124,7 @@ var readableToPullUnsafe = (options) => {
1114
1124
  const readable = options.readable;
1115
1125
  const chunkSize = options.chunkSize ?? 4096;
1116
1126
  const closeOnDone = options.closeOnDone ?? true;
1117
- const exit = options.exit ?? make7(undefined);
1127
+ const exit = options.exit ?? make8(undefined);
1118
1128
  const latch = options.latch ?? makeUnsafe2(false);
1119
1129
  function onReadable() {
1120
1130
  latch.openUnsafe();
@@ -1678,7 +1688,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
1678
1688
  const sourceStream = unwrap(succeed6(getSourceStream(handles[handles.length - 1], options.from)));
1679
1689
  const toOption = options.to ?? "stdin";
1680
1690
  if (toOption === "stdin") {
1681
- handles.push(yield* spawnCommand(make2(command.command, command.args, {
1691
+ handles.push(yield* spawnCommand(make3(command.command, command.args, {
1682
1692
  ...command.options,
1683
1693
  stdin: {
1684
1694
  ...stdinConfig,
@@ -1698,7 +1708,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
1698
1708
  type: "input",
1699
1709
  stream: sourceStream
1700
1710
  };
1701
- handles.push(yield* spawnCommand(make2(command.command, command.args, {
1711
+ handles.push(yield* spawnCommand(make3(command.command, command.args, {
1702
1712
  ...command.options,
1703
1713
  additionalFds: {
1704
1714
  ...existingFds,
@@ -1706,7 +1716,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
1706
1716
  }
1707
1717
  })));
1708
1718
  } else {
1709
- handles.push(yield* spawnCommand(make2(command.command, command.args, {
1719
+ handles.push(yield* spawnCommand(make3(command.command, command.args, {
1710
1720
  ...command.options,
1711
1721
  stdin: {
1712
1722
  ...stdinConfig,
@@ -1745,7 +1755,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
1745
1755
  }
1746
1756
  }
1747
1757
  });
1748
- return make(spawnCommand);
1758
+ return make2(spawnCommand);
1749
1759
  });
1750
1760
  var layer5 = /* @__PURE__ */ effect(ChildProcessSpawner, make19);
1751
1761
  var flattenCommand = (command) => {
@@ -2231,7 +2241,7 @@ var writeFile2 = (path, data, options) => callback3((resume, signal) => {
2231
2241
  resume(fail7(handleBadArgument("writeFile")(err)));
2232
2242
  }
2233
2243
  });
2234
- var makeFileSystem = /* @__PURE__ */ map8(/* @__PURE__ */ serviceOption(WatchBackend), (backend) => make11({
2244
+ var makeFileSystem = /* @__PURE__ */ map8(/* @__PURE__ */ serviceOption(WatchBackend), (backend) => make12({
2235
2245
  access: access2,
2236
2246
  chmod: chmod2,
2237
2247
  chown: chown2,
@@ -2291,15 +2301,15 @@ var fileUrlOps = (windows) => ({
2291
2301
  })
2292
2302
  })
2293
2303
  });
2294
- var layerPosix = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */ make12({
2304
+ var layerPosix = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */ make13({
2295
2305
  ...NodePath.posix,
2296
2306
  .../* @__PURE__ */ fileUrlOps(false)
2297
2307
  }));
2298
- var layerWin32 = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */ make12({
2308
+ var layerWin32 = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */ make13({
2299
2309
  ...NodePath.win32,
2300
2310
  .../* @__PURE__ */ fileUrlOps(true)
2301
2311
  }));
2302
- var layer7 = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */ make12({
2312
+ var layer7 = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */ make13({
2303
2313
  ...NodePath,
2304
2314
  .../* @__PURE__ */ fileUrlOps(undefined)
2305
2315
  }));
@@ -2821,12 +2831,12 @@ var redact2 = /* @__PURE__ */ dual(2, (self, key) => {
2821
2831
  if (typeof key === "string") {
2822
2832
  const k = key.toLowerCase();
2823
2833
  if (k in self) {
2824
- out[k] = make16(self[k]);
2834
+ out[k] = make(self[k]);
2825
2835
  }
2826
2836
  } else {
2827
2837
  for (const name in self) {
2828
2838
  if (name.search(key) !== -1) {
2829
- out[name] = make16(self[name]);
2839
+ out[name] = make(self[name]);
2830
2840
  }
2831
2841
  }
2832
2842
  }
@@ -2933,7 +2943,7 @@ var fromInputNested = (input) => {
2933
2943
  return out;
2934
2944
  };
2935
2945
  var coerce = (value) => isRedacted(value) ? value : String(value);
2936
- var Equivalence3 = /* @__PURE__ */ make13((a, b) => arrayEquivalence(a.params, b.params));
2946
+ var Equivalence3 = /* @__PURE__ */ make14((a, b) => arrayEquivalence(a.params, b.params));
2937
2947
  var arrayEquivalence = /* @__PURE__ */ makeEquivalence2(/* @__PURE__ */ makeEquivalence3([/* @__PURE__ */ strictEqual(), /* @__PURE__ */ asEquivalence()]));
2938
2948
  var empty4 = /* @__PURE__ */ make23([]);
2939
2949
  var setAll2 = /* @__PURE__ */ dual(2, (self, input) => {
@@ -2952,7 +2962,7 @@ var setAll2 = /* @__PURE__ */ dual(2, (self, input) => {
2952
2962
  var toString = (input) => new URLSearchParams(fromInput2(input).params.map(([key, value]) => [key, unwrap3(value)])).toString();
2953
2963
  var redact3 = /* @__PURE__ */ dual(2, (self, key) => {
2954
2964
  const patterns = Array.isArray(key) ? key : [key];
2955
- return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName2(name, patterns) ? make16(value) : value]);
2965
+ return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName2(name, patterns) ? make(value) : value]);
2956
2966
  });
2957
2967
  var isRedactedName2 = isRedactedName;
2958
2968
  var redactUrl = (url, redactedNames = currentRedactedNames()) => {
@@ -3028,7 +3038,7 @@ import * as readline from "readline";
3028
3038
  var make25 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
3029
3039
  const stdin = process.stdin;
3030
3040
  const stdout = process.stdout;
3031
- const lines = yield* make8();
3041
+ const lines = yield* make9();
3032
3042
  let inputEnded = stdin.readableEnded;
3033
3043
  let readlineActive = false;
3034
3044
  const onStdinEnd = () => {
@@ -3039,7 +3049,7 @@ var make25 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQui
3039
3049
  };
3040
3050
  stdin.once("end", onStdinEnd);
3041
3051
  yield* addFinalizer2(() => sync2(() => stdin.off("end", onStdinEnd)));
3042
- const rlRef = yield* make9({
3052
+ const rlRef = yield* make10({
3043
3053
  acquire: acquireRelease(sync2(() => {
3044
3054
  const rl = readline.createInterface({
3045
3055
  input: stdin,
@@ -3078,7 +3088,7 @@ var make25 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQui
3078
3088
  if (stdin.isTTY)
3079
3089
  stdin.setRawMode(enabled);
3080
3090
  });
3081
- const rawModeRef = yield* make9({
3091
+ const rawModeRef = yield* make10({
3082
3092
  acquire: acquireRelease(setRawMode(true), () => setRawMode(false)),
3083
3093
  idleTimeToLive: "10 millis"
3084
3094
  });
@@ -3099,7 +3109,7 @@ var make25 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQui
3099
3109
  return queue;
3100
3110
  });
3101
3111
  const readInput = gen(function* () {
3102
- const queue = yield* make8();
3112
+ const queue = yield* make9();
3103
3113
  const handleKeypress = (s, k) => {
3104
3114
  const userInput = {
3105
3115
  input: fromUndefinedOr(s),
@@ -3813,6 +3823,9 @@ function redactResponseValue(value, key, depth) {
3813
3823
  function redactCredentials(output) {
3814
3824
  return CREDENTIAL_RULES.reduce(redactedBy, output);
3815
3825
  }
3826
+ function redactCredentialText(text) {
3827
+ return RESPONSE_RULES.reduce(redactedBy, text);
3828
+ }
3816
3829
  function redactedOutputTail(output, maxChars = 4000) {
3817
3830
  const redacted = redactCredentials(output);
3818
3831
  return redacted.length <= maxChars ? redacted : redacted.slice(-maxChars);
@@ -5621,6 +5634,9 @@ var sum = (usages) => usages.length === 0 ? undefined : usages.reduce((total, us
5621
5634
  cached: total.cached + usage.cached
5622
5635
  }));
5623
5636
  var tokensSpent = (attempts) => sum(attempts.filter((tokens) => tokens !== undefined && tokens !== "none"));
5637
+ var TokenTotalCount = String4.check(isPattern(/^(?:0|[1-9][0-9]*)$/));
5638
+ var TokenTotal = Struct({ input: TokenTotalCount, output: TokenTotalCount, cached: TokenTotalCount });
5639
+ var tokenCountWords = (count) => BigInt(count).toLocaleString("en-US");
5624
5640
 
5625
5641
  // packages/core/src/loop.ts
5626
5642
  var LoopStatuses = ["draft", "active", "disabled", "archived"];
@@ -5847,6 +5863,7 @@ var LoopSafeReferenceString = String4.check(isMinLength(1), isMaxLength(240), is
5847
5863
  var LoopSafeInternalReferenceString = String4.check(isMinLength(1), isMaxLength(240), isPattern(new RegExp(LoopSafeInternalReferencePattern, "u")));
5848
5864
  var loopSafeTextMaxLength = 4000;
5849
5865
  var LoopSafeText = String4.check(isMaxLength(loopSafeTextMaxLength), isPattern(new RegExp(`^(?![\\s\\S]*(?:${LoopCredentialContentPattern}|[A-Za-z][A-Za-z0-9+.-]*://(?:[^\\s/?#]*@|[^\\s?#]*\\?)))[\\s\\S]*$`, "u")));
5866
+ var reportedModelName = (named) => /^[A-Za-z0-9][\w.:/@+[\]-]{0,199}$/u.test(named) && is(LoopSafeText)(named) && redactCredentialText(named) === named ? named : undefined;
5850
5867
  var QuestionText = String4;
5851
5868
  var LoopSafeOutputDataString = String4.check(isMaxLength(4000), isPattern(new RegExp(LoopSafeInternalReferencePattern, "u")));
5852
5869
  var LoopSafePackageName = String4.check(isMinLength(1), isMaxLength(200), isPattern(new RegExp(LoopSafeReferencePattern, "u")));
@@ -6383,6 +6400,12 @@ var SkippedChoice = Struct({
6383
6400
  reason: Literals(SkippedChoiceReasons),
6384
6401
  until: optionalKey(Timestamp)
6385
6402
  });
6403
+ var StepFallback = Struct({
6404
+ harness: String4,
6405
+ model: optionalKey(String4),
6406
+ effort: optionalKey(Literals(AgentEfforts)),
6407
+ firstChoice: SkippedChoice
6408
+ });
6386
6409
  var StepAttempt = Struct({
6387
6410
  id: Id,
6388
6411
  workspaceId: Id,
@@ -6523,7 +6546,8 @@ var RunStepSummary = Struct({
6523
6546
  model: optionalKey(String4),
6524
6547
  tokens: optionalKey(AttemptTokens)
6525
6548
  })),
6526
- tokens: optionalKey(TokenUsage)
6549
+ tokens: optionalKey(TokenUsage),
6550
+ fallback: optionalKey(StepFallback)
6527
6551
  });
6528
6552
  var RunSteerDeliveries = ["queued", "delivered", "failed"];
6529
6553
  var RunSteer = Struct({
@@ -6586,6 +6610,7 @@ var RunGraphNode = Struct({
6586
6610
  model: optionalKey(String4),
6587
6611
  runner: optionalKey(Struct({ id: Id, name: String4 }))
6588
6612
  })),
6613
+ fallback: optionalKey(StepFallback),
6589
6614
  child: optionalKey(Struct({
6590
6615
  runId: Id,
6591
6616
  loopTitle: String4,
@@ -6618,6 +6643,7 @@ var RunShow = Struct({
6618
6643
  steps: ArraySchema(RunStepSummary),
6619
6644
  questions: ArraySchema(Question),
6620
6645
  questionsBelow: optionalKey(ArraySchema(QuestionBelow)),
6646
+ runsBelow: optionalKey(ArraySchema(Struct({ runId: Id, parentRunId: Id }))),
6621
6647
  children: ArraySchema(Struct({
6622
6648
  runId: Id,
6623
6649
  name: String4,
@@ -6638,7 +6664,8 @@ var RunShow = Struct({
6638
6664
  steers: ArraySchema(RunSteer),
6639
6665
  waiting: ArraySchema(RunWaiting),
6640
6666
  closures: ArraySchema(RunClosure),
6641
- tokens: optionalKey(TokenUsage)
6667
+ tokens: optionalKey(TokenUsage),
6668
+ tokensWithChildRuns: optionalKey(TokenTotal)
6642
6669
  });
6643
6670
  var RunStartPreview = Struct({
6644
6671
  loop: Struct({ id: String4, title: String4, outcome: optionalKey(String4) }),
@@ -7100,6 +7127,7 @@ var WorkUnitHeartbeatInput = Struct({
7100
7127
  workUnitId: Id,
7101
7128
  lease: WorkUnitLeaseInput,
7102
7129
  leaseDurationSeconds: optionalKey(Int.check(isGreaterThanOrEqualTo(1), isLessThanOrEqualTo(3600))),
7130
+ harnessStarted: optionalKey(Literal(true)),
7103
7131
  secrets: optionalKey(ArraySchema(Struct({ name: SecretName, version: String4.check(isMinLength(1), isMaxLength(128)) })).check(isMaxLength(256)))
7104
7132
  });
7105
7133
  var WorkUnitHeartbeatResult = Struct({
@@ -7113,7 +7141,8 @@ var WorkUnitReleaseInput = Struct({
7113
7141
  workUnitId: Id,
7114
7142
  lease: WorkUnitLeaseInput,
7115
7143
  crashed: optionalKey(Struct({ reason: String4.check(isMinLength(1), isMaxLength(500)) })),
7116
- tokens: optionalKey(AttemptTokens)
7144
+ tokens: optionalKey(AttemptTokens),
7145
+ ranModel: optionalKey(String4.check(isMinLength(1), isMaxLength(200)))
7117
7146
  });
7118
7147
  var CheckEvidence = Struct({
7119
7148
  name: String4.check(isMinLength(1), isMaxLength(120)),
@@ -7184,6 +7213,7 @@ var WorkUnitOutcome = Struct({
7184
7213
  harnessHold: optionalKey(HarnessHold),
7185
7214
  restart: optionalKey(StepRestart),
7186
7215
  tokens: optionalKey(AttemptTokens),
7216
+ ranModel: optionalKey(String4.check(isMinLength(1), isMaxLength(200))),
7187
7217
  failureSummary: optionalKey(String4.check(isMinLength(1), isMaxLength(4000)))
7188
7218
  });
7189
7219
  var WorkUnitCompletion = Struct({
@@ -10074,14 +10104,14 @@ function makeWith(method, url, urlParams, hash, headers, body) {
10074
10104
  return self;
10075
10105
  }
10076
10106
  var empty6 = /* @__PURE__ */ makeWith("GET", "", empty4, /* @__PURE__ */ none(), empty, empty5);
10077
- var make4 = (method) => (url, options) => modify(empty6, {
10107
+ var make5 = (method) => (url, options) => modify(empty6, {
10078
10108
  method,
10079
10109
  url,
10080
10110
  ...options ?? undefined
10081
10111
  });
10082
- var get = /* @__PURE__ */ make4("GET");
10083
- var post = /* @__PURE__ */ make4("POST");
10084
- var put = /* @__PURE__ */ make4("PUT");
10112
+ var get = /* @__PURE__ */ make5("GET");
10113
+ var post = /* @__PURE__ */ make5("POST");
10114
+ var put = /* @__PURE__ */ make5("PUT");
10085
10115
  var modify = /* @__PURE__ */ dual(2, (self, options) => {
10086
10116
  let result = self;
10087
10117
  if (options.method) {
@@ -10382,7 +10412,7 @@ var Proto7 = {
10382
10412
  };
10383
10413
  },
10384
10414
  .../* @__PURE__ */ Object.fromEntries(/* @__PURE__ */ allShort.map(([fullMethod, method]) => [method, function(url, options) {
10385
- return this.execute(make4(fullMethod)(url, options));
10415
+ return this.execute(make5(fullMethod)(url, options));
10386
10416
  }]))
10387
10417
  };
10388
10418
  var make27 = (f) => makeWith2((effect) => flatMap3(effect, (request) => withFiber2((fiber) => {
@@ -11471,6 +11501,20 @@ var listedSummary = (summary) => {
11471
11501
  const line = summary.replace(/\s+/g, " ").trim();
11472
11502
  return line.length <= summaryLimit ? line : `${Array.from(line).slice(0, summaryLimit).join("").trimEnd()}\u2026`;
11473
11503
  };
11504
+ // packages/core/src/step-fallback.ts
11505
+ var skippedReasonWords = {
11506
+ not_on_runner: "not on this Runner",
11507
+ out_of_quota: "out of quota",
11508
+ rate_limited: "rate limited",
11509
+ login_refused: "login refused",
11510
+ failed_to_start: "failed to start"
11511
+ };
11512
+ var choiceWords = (choice, unnamedModel) => [
11513
+ choice.harness ?? "the Runner\u2019s default Harness",
11514
+ choice.model ?? unnamedModel,
11515
+ ...choice.effort === undefined ? [] : [`${choice.effort} effort`]
11516
+ ].join(" \xB7 ");
11517
+ var stepFallbackWords = (fallback) => `Fallback: ${choiceWords(fallback, "model not reported")}. First choice ${choiceWords(fallback.firstChoice, "its Harness\u2019s default model")}: ${skippedReasonWords[fallback.firstChoice.reason]}`;
11474
11518
  // packages/core/src/kit.ts
11475
11519
  var KitName = String4.check(isMinLength(1), isMaxLength(214), isPattern(new RegExp("^(@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$", "u")));
11476
11520
  var KitDigest = String4.check(isPattern(new RegExp("^[a-f0-9]{64}$", "u")));
@@ -14092,7 +14136,7 @@ var makeProto = (options) => {
14092
14136
  Rpc.key = `effect/rpc/Rpc/${options._tag}`;
14093
14137
  return Rpc;
14094
14138
  };
14095
- var make5 = (tag, options) => {
14139
+ var make6 = (tag, options) => {
14096
14140
  const successSchema = options?.success ?? Void;
14097
14141
  const errorSchema = options?.error ?? Never;
14098
14142
  const defectSchema = options?.defect ?? Defect();
@@ -14303,7 +14347,7 @@ var RpcGroupProto = {
14303
14347
  });
14304
14348
  },
14305
14349
  annotateRpcs(service, value) {
14306
- return this.annotateRpcsMerge(make14(service, value));
14350
+ return this.annotateRpcsMerge(make15(service, value));
14307
14351
  },
14308
14352
  annotateMerge(context) {
14309
14353
  return makeProto2({
@@ -14326,7 +14370,7 @@ var makeProto2 = (options) => Object.assign(function() {}, RpcGroupProto, {
14326
14370
  requests: options.requests,
14327
14371
  annotations: options.annotations
14328
14372
  });
14329
- var make6 = (...rpcs) => makeProto2({
14373
+ var make7 = (...rpcs) => makeProto2({
14330
14374
  requests: new Map(rpcs.map((rpc) => [rpc._tag, rpc])),
14331
14375
  annotations: empty3()
14332
14376
  });
@@ -14432,96 +14476,96 @@ var ProgramOutcome = Union([
14432
14476
  Struct({ status: Literal("failed"), failureSummary: String4 })
14433
14477
  ]);
14434
14478
 
14435
- class RunnerReplicaRpcs extends make6(make5("Claim", {
14479
+ class RunnerReplicaRpcs extends make7(make6("Claim", {
14436
14480
  payload: WorkUnitClaimInput,
14437
14481
  success: WorkUnitClaimResult,
14438
14482
  error: RunnerRpcError
14439
- }), make5("Heartbeat", {
14483
+ }), make6("Heartbeat", {
14440
14484
  payload: WorkUnitHeartbeatInput,
14441
14485
  success: WorkUnitHeartbeatResult,
14442
14486
  error: RunnerRpcError
14443
- }), make5("Complete", {
14487
+ }), make6("Complete", {
14444
14488
  payload: WorkUnitCompletion,
14445
14489
  error: RunnerRpcError
14446
- }), make5("Release", {
14490
+ }), make6("Release", {
14447
14491
  payload: WorkUnitReleaseInput,
14448
14492
  error: RunnerRpcError
14449
- }), make5("Signals", {
14493
+ }), make6("Signals", {
14450
14494
  payload: { runnerReplicaId: String4 },
14451
14495
  success: RunnerSignal,
14452
14496
  error: RunnerRpcError,
14453
14497
  stream: true
14454
- }), make5("ReportSteer", {
14498
+ }), make6("ReportSteer", {
14455
14499
  payload: { workUnitId: String4, messageId: String4, delivered: Boolean2 },
14456
14500
  success: Void,
14457
14501
  error: RunnerRpcError
14458
- }), make5("AppendTranscript", {
14502
+ }), make6("AppendTranscript", {
14459
14503
  payload: { workUnitId: String4, entries: ArraySchema(TranscriptAppendEntry).check(isMaxLength(100)) },
14460
14504
  success: Void,
14461
14505
  error: RunnerRpcError
14462
- }), make5("CreateCheckpointFile", {
14506
+ }), make6("CreateCheckpointFile", {
14463
14507
  payload: { lease: ProgramLease, byteSize: Int, sha256: String4 },
14464
14508
  success: Struct({ file: RunFileRecord, upload: optional(RunFileUpload) }),
14465
14509
  error: Union([RunnerRpcError, RunFileRefused])
14466
- }), make5("CheckpointFileParts", {
14510
+ }), make6("CheckpointFileParts", {
14467
14511
  payload: { lease: ProgramLease, fileId: String4, partNumbers: ArraySchema(Int) },
14468
14512
  success: Struct({ parts: ArraySchema(RunFilePartUrl) }),
14469
14513
  error: RunnerRpcError
14470
- }), make5("CompleteCheckpointFile", {
14514
+ }), make6("CompleteCheckpointFile", {
14471
14515
  payload: { lease: ProgramLease, fileId: String4, parts: optional(ArraySchema(UploadedRunFilePart)) },
14472
14516
  success: RunFileRecord,
14473
14517
  error: RunnerRpcError
14474
- }), make5("SaveCheckpoint", {
14518
+ }), make6("SaveCheckpoint", {
14475
14519
  payload: { lease: ProgramLease, checkpoint: StepCheckpoint },
14476
14520
  success: Void,
14477
14521
  error: RunnerRpcError
14478
- }), make5("ResumeCheckpoint", {
14522
+ }), make6("ResumeCheckpoint", {
14479
14523
  payload: { lease: ProgramLease },
14480
14524
  success: UndefinedOr(ResumedCheckpoint),
14481
14525
  error: RunnerRpcError
14482
- }), make5("SettledCheckpoints", {
14526
+ }), make6("SettledCheckpoints", {
14483
14527
  success: ArraySchema(Struct({
14484
14528
  stepAttemptId: String4,
14485
14529
  ref: optionalKey(String4),
14486
14530
  repoBinding: optionalKey(WorkUnitRepoBinding)
14487
14531
  })),
14488
14532
  error: RunnerRpcError
14489
- }), make5("ForgetCheckpoints", {
14533
+ }), make6("ForgetCheckpoints", {
14490
14534
  payload: { stepAttemptIds: ArraySchema(String4) },
14491
14535
  success: Void,
14492
14536
  error: RunnerRpcError
14493
- }), make5("GitCredential", {
14537
+ }), make6("GitCredential", {
14494
14538
  payload: { repoBindingId: String4 },
14495
14539
  success: UndefinedOr(Struct({ username: String4, password: String4 })),
14496
14540
  error: RunnerRpcError
14497
- }), make5("Bundle", {
14541
+ }), make6("Bundle", {
14498
14542
  payload: { digest: String4 },
14499
14543
  success: Struct({ bundle: String4 }),
14500
14544
  error: RunnerRpcError
14501
- }), make5("SettledRuns", {
14545
+ }), make6("SettledRuns", {
14502
14546
  payload: { runIds: ArraySchema(String4) },
14503
14547
  success: ArraySchema(String4),
14504
14548
  error: RunnerRpcError
14505
- }), make5("KnownEvidence", {
14549
+ }), make6("KnownEvidence", {
14506
14550
  payload: { lease: ProgramLease, trees: ArraySchema(String4) },
14507
14551
  success: ArraySchema(Struct({ tree: String4, name: String4, command: String4 })),
14508
14552
  error: RunnerRpcError
14509
14553
  })).middleware(RunnerAuthentication) {
14510
14554
  }
14511
14555
 
14512
- class RunnerJournalRpcs extends make6(make5("RecordActivity", {
14556
+ class RunnerJournalRpcs extends make7(make6("RecordActivity", {
14513
14557
  payload: { lease: ProgramLease, name: String4, attempt: Int, exit: Json },
14514
14558
  error: RunnerRpcError
14515
- }), make5("DeferredDone", {
14559
+ }), make6("DeferredDone", {
14516
14560
  payload: { lease: ProgramLease, name: String4, exit: Json },
14517
14561
  error: RunnerRpcError
14518
- }), make5("ScheduleClock", {
14562
+ }), make6("ScheduleClock", {
14519
14563
  payload: { lease: ProgramLease, name: String4, deferredName: String4, durationMillis: Int },
14520
14564
  error: RunnerRpcError
14521
- }), make5("Suspend", { payload: { lease: ProgramLease }, error: RunnerRpcError }), make5("FinishProgram", { payload: { lease: ProgramLease, outcome: ProgramOutcome }, error: RunnerRpcError })).middleware(RunnerAuthentication) {
14565
+ }), make6("Suspend", { payload: { lease: ProgramLease }, error: RunnerRpcError }), make6("FinishProgram", { payload: { lease: ProgramLease, outcome: ProgramOutcome }, error: RunnerRpcError })).middleware(RunnerAuthentication) {
14522
14566
  }
14523
14567
 
14524
- class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14568
+ class RunnerCapabilityRpcs extends make7(make6("PutQuestion", {
14525
14569
  payload: {
14526
14570
  lease: ProgramLease,
14527
14571
  step: String4,
@@ -14541,7 +14585,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14541
14585
  },
14542
14586
  success: Struct({ questionId: String4 }),
14543
14587
  error: RunnerRpcError
14544
- }), make5("StartAgentStep", {
14588
+ }), make6("StartAgentStep", {
14545
14589
  payload: {
14546
14590
  lease: ProgramLease,
14547
14591
  step: String4,
@@ -14557,7 +14601,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14557
14601
  },
14558
14602
  success: Struct({ stepAttemptId: String4 }),
14559
14603
  error: RunnerRpcError
14560
- }), make5("StartVerification", {
14604
+ }), make6("StartVerification", {
14561
14605
  payload: {
14562
14606
  lease: ProgramLease,
14563
14607
  step: String4,
@@ -14578,7 +14622,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14578
14622
  },
14579
14623
  success: Struct({ verificationId: String4 }),
14580
14624
  error: RunnerRpcError
14581
- }), make5("AwaitEvent", {
14625
+ }), make6("AwaitEvent", {
14582
14626
  payload: {
14583
14627
  lease: ProgramLease,
14584
14628
  step: String4,
@@ -14594,7 +14638,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14594
14638
  })))
14595
14639
  },
14596
14640
  error: RunnerRpcError
14597
- }), make5("ClaimResource", {
14641
+ }), make6("ClaimResource", {
14598
14642
  payload: {
14599
14643
  lease: ProgramLease,
14600
14644
  step: String4,
@@ -14603,7 +14647,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14603
14647
  action: Literals(["claim", "take_over", "let_go"])
14604
14648
  },
14605
14649
  error: RunnerRpcError
14606
- }), make5("AdmitChild", {
14650
+ }), make6("AdmitChild", {
14607
14651
  payload: {
14608
14652
  lease: ProgramLease,
14609
14653
  step: String4,
@@ -14614,7 +14658,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14614
14658
  },
14615
14659
  success: Struct({ runId: String4 }),
14616
14660
  error: RunnerRpcError
14617
- }), make5("StoreArtifact", {
14661
+ }), make6("StoreArtifact", {
14618
14662
  payload: {
14619
14663
  lease: ProgramLease,
14620
14664
  step: String4,
@@ -14626,7 +14670,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14626
14670
  },
14627
14671
  success: Struct({ artifactId: String4 }),
14628
14672
  error: RunnerRpcError
14629
- }), make5("RecordNote", {
14673
+ }), make6("RecordNote", {
14630
14674
  payload: {
14631
14675
  lease: ProgramLease,
14632
14676
  step: String4,
@@ -14635,7 +14679,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14635
14679
  kind: optional(Literals(["note", "blocker"]))
14636
14680
  },
14637
14681
  error: RunnerRpcError
14638
- }), make5("PerformHostEffect", {
14682
+ }), make6("PerformHostEffect", {
14639
14683
  payload: {
14640
14684
  lease: ProgramLease,
14641
14685
  step: String4,
@@ -14664,7 +14708,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14664
14708
  },
14665
14709
  success: UndefinedOr(Struct({ id: String4, number: String4, url: String4 })),
14666
14710
  error: RunnerRpcError
14667
- }), make5("AlertTask", {
14711
+ }), make6("AlertTask", {
14668
14712
  payload: {
14669
14713
  lease: ProgramLease,
14670
14714
  step: String4,
@@ -14681,7 +14725,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14681
14725
  joined: optionalKey(Struct({ kind: Literals(["run", "recent"]), runId: String4 }))
14682
14726
  }),
14683
14727
  error: RunnerRpcError
14684
- }), make5("ReadTranscripts", {
14728
+ }), make6("ReadTranscripts", {
14685
14729
  payload: {
14686
14730
  lease: ProgramLease,
14687
14731
  step: String4,
@@ -14716,7 +14760,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14716
14760
  })))
14717
14761
  }),
14718
14762
  error: RunnerRpcError
14719
- }), make5("PipelineStatus", {
14763
+ }), make6("PipelineStatus", {
14720
14764
  payload: { lease: ProgramLease, step: String4, changeRequestId: String4 },
14721
14765
  success: Struct({
14722
14766
  head: String4,
@@ -14750,11 +14794,11 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14750
14794
  }))
14751
14795
  }),
14752
14796
  error: RunnerRpcError
14753
- }), make5("ReportPipeline", {
14797
+ }), make6("ReportPipeline", {
14754
14798
  payload: { lease: ProgramLease, step: String4, changeRequestId: String4, verification: String4 },
14755
14799
  success: Struct({ head: String4, status: Literals(["success", "failed"]) }),
14756
14800
  error: RunnerRpcError
14757
- }), make5("ReviewThreads", {
14801
+ }), make6("ReviewThreads", {
14758
14802
  payload: { lease: ProgramLease, step: String4, changeRequestId: String4 },
14759
14803
  success: Struct({
14760
14804
  threads: ArraySchema(Struct({
@@ -14766,7 +14810,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14766
14810
  }))
14767
14811
  }),
14768
14812
  error: RunnerRpcError
14769
- }), make5("OpenChangeRequests", {
14813
+ }), make6("OpenChangeRequests", {
14770
14814
  payload: { lease: ProgramLease, step: String4, authors: NonEmptyArray(String4) },
14771
14815
  success: Struct({
14772
14816
  changeRequests: ArraySchema(Struct({
@@ -14780,7 +14824,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14780
14824
  }))
14781
14825
  }),
14782
14826
  error: RunnerRpcError
14783
- }), make5("OwnChangeRequests", {
14827
+ }), make6("OwnChangeRequests", {
14784
14828
  payload: { lease: ProgramLease, step: String4 },
14785
14829
  success: Struct({
14786
14830
  changeRequests: ArraySchema(Struct({
@@ -14793,7 +14837,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14793
14837
  }))
14794
14838
  }),
14795
14839
  error: RunnerRpcError
14796
- }), make5("Propose", {
14840
+ }), make6("Propose", {
14797
14841
  payload: {
14798
14842
  lease: ProgramLease,
14799
14843
  step: String4,
@@ -14822,7 +14866,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14822
14866
  task: optionalKey(Struct({ id: String4, active: Boolean2 }))
14823
14867
  }),
14824
14868
  error: RunnerRpcError
14825
- }), make5("ReadProject", {
14869
+ }), make6("ReadProject", {
14826
14870
  payload: { lease: ProgramLease, step: String4, projectId: String4 },
14827
14871
  success: Struct({
14828
14872
  project: Struct({ id: String4, name: String4 }),
@@ -14845,7 +14889,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14845
14889
  taskChanges: ArraySchema(Struct({ taskKey: String4, title: String4, change: String4, at: String4 }))
14846
14890
  }),
14847
14891
  error: RunnerRpcError
14848
- }), make5("DraftUpdate", {
14892
+ }), make6("DraftUpdate", {
14849
14893
  payload: {
14850
14894
  lease: ProgramLease,
14851
14895
  step: String4,
@@ -14860,7 +14904,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14860
14904
  },
14861
14905
  success: Struct({ id: String4 }),
14862
14906
  error: RunnerRpcError
14863
- }), make5("CreatePlanTasks", {
14907
+ }), make6("CreatePlanTasks", {
14864
14908
  payload: {
14865
14909
  lease: ProgramLease,
14866
14910
  projectId: optionalKey(String4),
@@ -14881,15 +14925,15 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14881
14925
  },
14882
14926
  success: ArraySchema(Struct({ key: String4, taskId: String4 })),
14883
14927
  error: RunnerRpcError
14884
- }), make5("IntegrationBranch", {
14928
+ }), make6("IntegrationBranch", {
14885
14929
  payload: { lease: ProgramLease, repoBindingId: optionalKey(String4) },
14886
14930
  success: Struct({ repoBindingId: String4, branch: String4, revision: String4 }),
14887
14931
  error: RunnerRpcError
14888
- }), make5("DeliveryBase", {
14932
+ }), make6("DeliveryBase", {
14889
14933
  payload: { lease: ProgramLease },
14890
14934
  success: Struct({ repoBindingId: String4, branch: String4, revision: String4 }),
14891
14935
  error: RunnerRpcError
14892
- }), make5("MergeChangeRequest", {
14936
+ }), make6("MergeChangeRequest", {
14893
14937
  payload: {
14894
14938
  lease: ProgramLease,
14895
14939
  step: String4,
@@ -14907,7 +14951,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14907
14951
  Struct({ status: Literal("moved"), head: String4 })
14908
14952
  ]),
14909
14953
  error: RunnerRpcError
14910
- }), make5("ApproveChangeRequest", {
14954
+ }), make6("ApproveChangeRequest", {
14911
14955
  payload: {
14912
14956
  lease: ProgramLease,
14913
14957
  step: String4,
@@ -14923,7 +14967,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14923
14967
  Struct({ approved: Literal(false), reason: String4 })
14924
14968
  ]),
14925
14969
  error: RunnerRpcError
14926
- }), make5("CloseChangeRequest", {
14970
+ }), make6("CloseChangeRequest", {
14927
14971
  payload: {
14928
14972
  lease: ProgramLease,
14929
14973
  step: String4,
@@ -14933,7 +14977,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14933
14977
  },
14934
14978
  success: Struct({ closed: Boolean2, head: optionalKey(String4) }),
14935
14979
  error: RunnerRpcError
14936
- }), make5("RerunPipeline", {
14980
+ }), make6("RerunPipeline", {
14937
14981
  payload: {
14938
14982
  lease: ProgramLease,
14939
14983
  step: String4,
@@ -14943,7 +14987,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14943
14987
  },
14944
14988
  success: Struct({ head: String4, pipelines: Int }),
14945
14989
  error: RunnerRpcError
14946
- }), make5("PublishRelease", {
14990
+ }), make6("PublishRelease", {
14947
14991
  payload: {
14948
14992
  lease: ProgramLease,
14949
14993
  step: String4,
@@ -14955,14 +14999,14 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14955
14999
  },
14956
15000
  success: Struct({ tag: String4, revision: String4, url: String4 }),
14957
15001
  error: RunnerRpcError
14958
- }), make5("ProgramSecrets", {
15002
+ }), make6("ProgramSecrets", {
14959
15003
  payload: { lease: ProgramLease },
14960
15004
  success: Record(String4, String4),
14961
15005
  error: RunnerRpcError
14962
15006
  })).middleware(RunnerAuthentication) {
14963
15007
  }
14964
15008
 
14965
- class RunnerRunFileRpcs extends make6(make5("CreateRunFile", {
15009
+ class RunnerRunFileRpcs extends make7(make6("CreateRunFile", {
14966
15010
  payload: {
14967
15011
  lease: ProgramLease,
14968
15012
  step: String4,
@@ -14974,11 +15018,11 @@ class RunnerRunFileRpcs extends make6(make5("CreateRunFile", {
14974
15018
  },
14975
15019
  success: Struct({ file: RunFileRecord, upload: optional(RunFileUpload) }),
14976
15020
  error: Union([RunnerRpcError, RunFileRefused])
14977
- }), make5("RunFileParts", {
15021
+ }), make6("RunFileParts", {
14978
15022
  payload: { lease: ProgramLease, fileId: String4, partNumbers: ArraySchema(Int) },
14979
15023
  success: Struct({ parts: ArraySchema(RunFilePartUrl) }),
14980
15024
  error: RunnerRpcError
14981
- }), make5("CompleteRunFile", {
15025
+ }), make6("CompleteRunFile", {
14982
15026
  payload: { lease: ProgramLease, fileId: String4, parts: optional(ArraySchema(UploadedRunFilePart)) },
14983
15027
  success: RunFileRecord,
14984
15028
  error: RunnerRpcError
@@ -15067,7 +15111,7 @@ function toStoredSession(token, existingRefreshToken) {
15067
15111
  }
15068
15112
  function startLoopbackServer(input) {
15069
15113
  return gen(function* () {
15070
- const code = yield* make15();
15114
+ const code = yield* make16();
15071
15115
  const context2 = yield* context();
15072
15116
  const runSyncExit = runSyncExitWith(context2);
15073
15117
  const server = yield* acquireRelease(sync2(() => Bun.serve({
@@ -15615,7 +15659,7 @@ var openConnection = (transport) => gen(function* () {
15615
15659
  let lastId = 0;
15616
15660
  let lost = false;
15617
15661
  const notifications = yield* unbounded2();
15618
- const ended = yield* make15();
15662
+ const ended = yield* make16();
15619
15663
  const settle = (line) => match(flatMap(decodeJsonStringOption(line), decodeUnknownOption(Response2)), {
15620
15664
  onNone: () => match(flatMap(decodeJsonStringOption(line), decodeUnknownOption(Notification)), {
15621
15665
  onNone: () => void_3,
@@ -15642,7 +15686,7 @@ var openConnection = (transport) => gen(function* () {
15642
15686
  if (lost)
15643
15687
  return yield* new HerdrCoreConnectionLost2({ method });
15644
15688
  const id = ++lastId;
15645
- const deferred = yield* make15();
15689
+ const deferred = yield* make16();
15646
15690
  pending.set(id, { method, deferred });
15647
15691
  yield* pipe.write(encodeJsonStringSync({ jsonrpc: "2.0", id, method, params }));
15648
15692
  return yield* _await(deferred);
@@ -15716,14 +15760,14 @@ var herdrCoreOver = (transport) => ({
15716
15760
  return { type: "event", terminal: event.value.terminal, kind: event.value.type, data: event.value.data };
15717
15761
  };
15718
15762
  const snapshot = { type: "snapshot", terminals: subscribed.terminals };
15719
- return concat(make10(snapshot), fromQueue(notifications).pipe(map2(toEvent), filter((event) => event !== undefined)));
15763
+ return concat(make11(snapshot), fromQueue(notifications).pipe(map2(toEvent), filter((event) => event !== undefined)));
15720
15764
  }))
15721
15765
  });
15722
15766
  var spawnedTransport = (env) => gen(function* () {
15723
15767
  const spawner = yield* ChildProcessSpawner;
15724
15768
  const input = yield* unbounded2();
15725
15769
  const encoder = new TextEncoder;
15726
- const handle = yield* spawner.spawn(make2("herdr-core", ["connect"], {
15770
+ const handle = yield* spawner.spawn(make3("herdr-core", ["connect"], {
15727
15771
  extendEnv: false,
15728
15772
  env,
15729
15773
  stdin: fromQueue(input),
@@ -15754,7 +15798,7 @@ var updateHerdrCore2 = (options) => gen(function* () {
15754
15798
  const spawner = yield* ChildProcessSpawner;
15755
15799
  const env = coreEnv(options);
15756
15800
  const run = (args) => gen(function* () {
15757
- const handle = yield* spawner.spawn(make2("herdr-core", args, { extendEnv: false, env, stdin: "ignore" }));
15801
+ const handle = yield* spawner.spawn(make3("herdr-core", args, { extendEnv: false, env, stdin: "ignore" }));
15758
15802
  const [stdout, stderr, exitCode] = yield* all3([
15759
15803
  mkString(decodeText(handle.stdout)),
15760
15804
  mkString(decodeText(handle.stderr)),
@@ -15780,7 +15824,7 @@ class CommandFailed2 extends TaggedError("CommandFailed") {
15780
15824
  }
15781
15825
  var runCommand2 = (command, args, options = {}) => gen(function* () {
15782
15826
  const spawner = yield* ChildProcessSpawner;
15783
- const handle = yield* spawner.spawn(make2(command, args, {
15827
+ const handle = yield* spawner.spawn(make3(command, args, {
15784
15828
  stdin: "ignore",
15785
15829
  ...options.cwd === undefined ? undefined : { cwd: options.cwd },
15786
15830
  ...options.env === undefined ? undefined : { extendEnv: true, env: options.env }
@@ -15806,8 +15850,8 @@ var shellOutputTailChars2 = 64 * 1024;
15806
15850
  var runProcess2 = (argv, options) => gen(function* () {
15807
15851
  const spawner = yield* ChildProcessSpawner;
15808
15852
  const [command, ...args] = argv;
15809
- const handle = yield* spawner.spawn(make2(command, args, {
15810
- stdin: options.stdin === undefined ? "ignore" : make10(new TextEncoder().encode(options.stdin)),
15853
+ const handle = yield* spawner.spawn(make3(command, args, {
15854
+ stdin: options.stdin === undefined ? "ignore" : make11(new TextEncoder().encode(options.stdin)),
15811
15855
  ...options.cwd === undefined ? undefined : { cwd: options.cwd },
15812
15856
  env: options.extendEnv === false ? { ...options.env } : { ...withoutPreloads2(), ...options.env }
15813
15857
  }));
@@ -16239,4 +16283,4 @@ function checkServices(declaration) {
16239
16283
  return isSome(decoded) ? [...new Set(decoded.value.services)] : undefined;
16240
16284
  }
16241
16285
 
16242
- export { Clock, currentTimeMillis, WebCrypto, SecureRandom, layerWebCrypto, makeUnsafe, formatIso, empty, fromInput, merge, runMain, layer, layer2, Stdio, Terminal, layer3, error, log, toDate, parseDate, toIso, currentDate, wallClockMillis, waitingOnWords, queueWords, scanDurableSurface, redactResponseSurface, redactCredentials, redactedOutputTail, SafeJson, ReleaseChannels, DefaultReleaseChannel, newerKitmanVersion, releaseChannelOffers, AgentHarnessIds, AgentSkillRequirement, AgentMcpServerRequirement, AgentEnvironmentFragment, findForbiddenAgentEnvironmentSecretPath, NetworkHost, RepoBindingProviders, RepoBindingCredentialProviderTypes, findForbiddenRepoBindingSecretPath, AgentSandboxNetwork, runnerAgentSandboxPolicy, agentNetworkAllowlist, verificationNetworkAllowlist, programNetworkHosts, ContextPackModes, DefaultContextPackMode, ProposalStatuses, ProposalTargetTypes, canonicalJson, canonicalSha256, AgentEfforts, AgentCapabilities, tokensSpent, LoopDataSchemaRef, RunDisplayStates, LoopVersion, ProgramLoop, AgentFallback, RunWaitUntils, isTestReportName, failedTestOfLine, checkTests, ProgramWorkUnit, MeasureSample, MeasureEvidence, catchUpPathLimit, CatchUp, RunnerOwnership, RunnerExecutionBackend, MaxRunnerConcurrency, PinnedImage, RunnerSettingNames, RunnerSettingsUpdate, defaultRunnerSettings, shownRunnerSetting, defaultRunnerCapabilities, deliveryProviderActions, MemoryStatuses, MemoryScopes, MaxMemoryListLimit, DecisionStatuses, Session, SessionEnd, SessionUpdate, SessionUpdateCreate, FixFlowRecoveryActions, KitmanAgentCapabilityNames, sha2562, isRunFileRefusalReason, runFileRefusalWords, RunFileRefused, runFileContentType, repositoryKey, createId, digestSha256, digestSha512, digestWith, sha256Hasher, AgentEvent, raw, make4, get, post, put, setHeaders, acceptJson, bodyUint8Array, bodyJsonUnsafe, bodyUrlParams, schemaBodyJson, filterStatusOk, HttpClient, execute, get2, Fetch, layer4, Socket, SocketReadError, SocketError, WebSocketConstructor, layerWebSocketConstructorGlobal, layerWebSocket, runDisplayLabels, listedSummary, KitName, KitDigest, defaultKitName, KitSetup, SetupArchive, kitMcpSecretNames, kitmanMcpServer, KitmanClientError, KitmanEffectClient, CliError, DefaultApiUrl, resolveConfig, apiUrlFromEnv, stepCredentialFromEnv, stepWorkspaceFromEnv, stepSkillsDirFromEnv, stepFittingSkillsFromEnv, stepOutputOnlyFromEnv, mcpCredentialNameFromEnv, userConfigPath, userAuthPath, userHarnessSyncPath, kitSetupCacheDir, bundleCacheDir, runnerReleaseChannelPath, localConfigPath, readUserConfig, writeUserConfig, sessionForApi, readAuthStore, storeSession, removeSession, removeAllSessions, agentCredentialForApi, storeAgentCredential, removeAgentCredential, normalizeApiUrl, isStoredAgentCredential, isStreamSchema, getStreamSchemas, make5, exitSchema, ParseOptions, RpcClientDefect, RpcClientError, make6, Service, RunnerHeaders, RunnerRpcProtocolVersion, RunnerRpcError, RunSettled, UpdateAvailable, RunnerReplicaRpcs, RunnerRunFileRpcs, ProgramRpcs, parseCallbackUrl, revokeToken, toStoredSession, browserLogin, openBrowser, shouldRefresh, createSdkClient, refreshSession, AgentAuthClientError, executeAgentCapability, createAgentAuthBearerToken, McpPlatformLive, runMcpEffect, createAgentAuthSignedFetch, setupMcpAgentCredential, generateAgentKeyPair, HERDR_CORE_GENERATION2, HERDR_CORE_INSTALL_COMMAND2, HerdrCoreMissing2, HerdrCoreIncompatible2, HerdrCoreConnectionLost2, HerdrCoreRpcError2, HerdrCoreUpdateFailed2, HerdrCore2, herdrCoreLayer2, herdrCoreTransportLayer2, updateHerdrCore2, CommandFailed2, runCommand2, withoutPreloads2, shellOutputTailChars2, runProcess2, CommandRunner2, runShell2, detectHarnesses2, kitHarnesses, isKitHarness, instructionsStart, instructionsEnd, harnessNames, renderMcpServer, materializeKitSetup, tomlInline, herdrExecutionExtension2, herdrNativeExtensionIds2, herdrRunnerCapabilitiesForRepoBinding2, herdrRunnerCapabilities2, assertHerdrRunnerCapability2, declaredChecks, installCommand, checkServicesFile, checkServices };
16286
+ export { Clock, currentTimeMillis, WebCrypto, SecureRandom, layerWebCrypto, makeUnsafe, formatIso, empty, fromInput, merge, runMain, layer, layer2, Stdio, Terminal, layer3, error, log, toDate, parseDate, toIso, currentDate, wallClockMillis, waitingOnWords, queueWords, scanDurableSurface, redactResponseSurface, redactCredentials, redactedOutputTail, SafeJson, ReleaseChannels, DefaultReleaseChannel, newerKitmanVersion, releaseChannelOffers, AgentHarnessIds, AgentSkillRequirement, AgentMcpServerRequirement, AgentEnvironmentFragment, findForbiddenAgentEnvironmentSecretPath, NetworkHost, RepoBindingProviders, RepoBindingCredentialProviderTypes, findForbiddenRepoBindingSecretPath, AgentSandboxNetwork, runnerAgentSandboxPolicy, agentNetworkAllowlist, verificationNetworkAllowlist, programNetworkHosts, ContextPackModes, DefaultContextPackMode, ProposalStatuses, ProposalTargetTypes, canonicalJson, canonicalSha256, AgentEfforts, AgentCapabilities, tokensSpent, tokenCountWords, reportedModelName, LoopDataSchemaRef, RunDisplayStates, LoopVersion, ProgramLoop, AgentFallback, RunWaitUntils, isTestReportName, failedTestOfLine, checkTests, ProgramWorkUnit, MeasureSample, MeasureEvidence, catchUpPathLimit, CatchUp, RunnerOwnership, RunnerExecutionBackend, MaxRunnerConcurrency, PinnedImage, RunnerSettingNames, RunnerSettingsUpdate, defaultRunnerSettings, shownRunnerSetting, defaultRunnerCapabilities, deliveryProviderActions, MemoryStatuses, MemoryScopes, MaxMemoryListLimit, DecisionStatuses, Session, SessionEnd, SessionUpdate, SessionUpdateCreate, FixFlowRecoveryActions, KitmanAgentCapabilityNames, sha2562, isRunFileRefusalReason, runFileRefusalWords, RunFileRefused, runFileContentType, repositoryKey, createId, digestSha256, digestSha512, digestWith, sha256Hasher, AgentEvent, raw, make5, get, post, put, setHeaders, acceptJson, bodyUint8Array, bodyJsonUnsafe, bodyUrlParams, schemaBodyJson, filterStatusOk, HttpClient, execute, get2, Fetch, layer4, Socket, SocketReadError, SocketError, WebSocketConstructor, layerWebSocketConstructorGlobal, layerWebSocket, runDisplayLabels, listedSummary, stepFallbackWords, KitName, KitDigest, defaultKitName, KitSetup, SetupArchive, kitMcpSecretNames, kitmanMcpServer, KitmanClientError, KitmanEffectClient, CliError, DefaultApiUrl, resolveConfig, apiUrlFromEnv, stepCredentialFromEnv, stepWorkspaceFromEnv, stepSkillsDirFromEnv, stepFittingSkillsFromEnv, stepOutputOnlyFromEnv, mcpCredentialNameFromEnv, userConfigPath, userAuthPath, userHarnessSyncPath, kitSetupCacheDir, bundleCacheDir, runnerReleaseChannelPath, localConfigPath, readUserConfig, writeUserConfig, sessionForApi, readAuthStore, storeSession, removeSession, removeAllSessions, agentCredentialForApi, storeAgentCredential, removeAgentCredential, normalizeApiUrl, isStoredAgentCredential, isStreamSchema, getStreamSchemas, make6, exitSchema, ParseOptions, RpcClientDefect, RpcClientError, make7, Service, RunnerHeaders, RunnerRpcProtocolVersion, RunnerRpcError, RunSettled, UpdateAvailable, RunnerReplicaRpcs, RunnerRunFileRpcs, ProgramRpcs, parseCallbackUrl, revokeToken, toStoredSession, browserLogin, openBrowser, shouldRefresh, createSdkClient, refreshSession, AgentAuthClientError, executeAgentCapability, createAgentAuthBearerToken, McpPlatformLive, runMcpEffect, createAgentAuthSignedFetch, setupMcpAgentCredential, generateAgentKeyPair, HERDR_CORE_GENERATION2, HERDR_CORE_INSTALL_COMMAND2, HerdrCoreMissing2, HerdrCoreIncompatible2, HerdrCoreConnectionLost2, HerdrCoreRpcError2, HerdrCoreUpdateFailed2, HerdrCore2, herdrCoreLayer2, herdrCoreTransportLayer2, updateHerdrCore2, CommandFailed2, runCommand2, withoutPreloads2, shellOutputTailChars2, runProcess2, CommandRunner2, runShell2, detectHarnesses2, kitHarnesses, isKitHarness, instructionsStart, instructionsEnd, harnessNames, renderMcpServer, materializeKitSetup, tomlInline, herdrExecutionExtension2, herdrNativeExtensionIds2, herdrRunnerCapabilitiesForRepoBinding2, herdrRunnerCapabilities2, assertHerdrRunnerCapability2, declaredChecks, installCommand, checkServicesFile, checkServices };