@kitman-sh/cli 0.10.89 → 0.10.91

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 (26) hide show
  1. package/dist/{chunk-w9j2yb0n.js → chunk-25q7mg6g.js} +1 -1
  2. package/dist/{chunk-4b1nj0zw.js → chunk-2wsyg2g7.js} +41 -33
  3. package/dist/{chunk-73fw4pgr.js → chunk-5fxxg02f.js} +255 -49
  4. package/dist/{chunk-dmwqvnmb.js → chunk-5tqy48a3.js} +7 -7
  5. package/dist/{chunk-qqzr8ym6.js → chunk-6h0rz0zk.js} +4 -4
  6. package/dist/{chunk-99ad4j9s.js → chunk-947btdv6.js} +3 -3
  7. package/dist/{chunk-vne4rsj0.js → chunk-9m9cv82t.js} +2 -2
  8. package/dist/{chunk-maj4dn1b.js → chunk-c3k32vw4.js} +1 -1
  9. package/dist/{chunk-5dwyvg1z.js → chunk-cmtvcbxr.js} +5 -5
  10. package/dist/{chunk-daycfvkq.js → chunk-d82t42vr.js} +15 -15
  11. package/dist/{chunk-d8tabep6.js → chunk-d9wjvvbc.js} +5 -5
  12. package/dist/{chunk-caqesagt.js → chunk-dstm8aen.js} +2 -1
  13. package/dist/{chunk-phcerzkf.js → chunk-fgnfx5mw.js} +22 -215
  14. package/dist/{chunk-vzq3q5zr.js → chunk-gncygm43.js} +6 -6
  15. package/dist/{chunk-1hqy9g9w.js → chunk-gykt7zjx.js} +7 -7
  16. package/dist/{chunk-aj4ev9v2.js → chunk-hsf2sj69.js} +2 -2
  17. package/dist/{chunk-1mcwey0c.js → chunk-k4fvnphp.js} +1 -1
  18. package/dist/{chunk-p74pmd81.js → chunk-mbqeakm1.js} +1 -1
  19. package/dist/{chunk-yhh9yeqf.js → chunk-r6d67qqa.js} +255 -26
  20. package/dist/{chunk-cw2ghw7n.js → chunk-rmsm8vnc.js} +4 -4
  21. package/dist/{chunk-1whmkfzv.js → chunk-sb8c2sgy.js} +14 -14
  22. package/dist/{chunk-5w8trr75.js → chunk-tmbhak7y.js} +8 -8
  23. package/dist/{chunk-ybp1mwv9.js → chunk-w0sehmpd.js} +2 -2
  24. package/dist/{chunk-5dydsgwg.js → chunk-y1tnxz9f.js} +9 -9
  25. package/dist/index.js +4 -4
  26. package/package.json +1 -1
@@ -199,7 +199,7 @@ import {
199
199
  String4,
200
200
  toCodecStringTree,
201
201
  encodeUnknownJsonStringSync
202
- } from "./chunk-caqesagt.js";
202
+ } from "./chunk-dstm8aen.js";
203
203
 
204
204
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Iterable.js
205
205
  var headUnsafe = (self) => {
@@ -85,19 +85,11 @@ import {
85
85
  decodeJsonString,
86
86
  encodeJsonStringSync,
87
87
  encodePrettyJsonString
88
- } from "./chunk-caqesagt.js";
88
+ } from "./chunk-dstm8aen.js";
89
89
  import {
90
- tap,
91
- mapError,
92
- decodeText,
93
- run,
94
- mkString,
95
- FileSystem,
96
- Path,
97
- withDefault,
98
- option,
99
- String2
100
- } from "./chunk-w9j2yb0n.js";
90
+ ChildProcessSpawner,
91
+ make2
92
+ } from "./chunk-w0sehmpd.js";
101
93
  import {
102
94
  currentTimeMillis,
103
95
  SecureRandom,
@@ -197,10 +189,10 @@ import {
197
189
  harnessNames,
198
190
  herdrRunnerCapabilities2,
199
191
  declaredChecks
200
- } from "./chunk-73fw4pgr.js";
192
+ } from "./chunk-5fxxg02f.js";
201
193
  import {
202
194
  Id
203
- } from "./chunk-p74pmd81.js";
195
+ } from "./chunk-mbqeakm1.js";
204
196
  import {
205
197
  toJsonValue,
206
198
  isOneOf,
@@ -210,11 +202,19 @@ import {
210
202
  isObject,
211
203
  isJsonObject,
212
204
  isString
213
- } from "./chunk-1mcwey0c.js";
205
+ } from "./chunk-k4fvnphp.js";
214
206
  import {
215
- ChildProcessSpawner,
216
- make2
217
- } from "./chunk-ybp1mwv9.js";
207
+ tap,
208
+ mapError,
209
+ decodeText,
210
+ run,
211
+ mkString,
212
+ FileSystem,
213
+ Path,
214
+ withDefault,
215
+ option,
216
+ String2
217
+ } from "./chunk-25q7mg6g.js";
218
218
 
219
219
  // apps/cli/src/cli-error.ts
220
220
  function cliErrorCode(error, status) {
@@ -504,10 +504,10 @@ var checkDockerImageSetting = pinnedImage;
504
504
  var checkRegistryImageSetting = pinnedImage;
505
505
  var herdrCoreSession = (runnerId, personal) => personal ? undefined : `kitman-${sha2562(runnerId).slice(0, 16)}`;
506
506
  var OpenHerdrCore = Reference("kitman/cli/OpenHerdrCore", {
507
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-qqzr8ym6.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
507
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-6h0rz0zk.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
508
508
  });
509
509
  var UpdateHerdrCore = Reference("kitman/cli/UpdateHerdrCore", {
510
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-qqzr8ym6.js")), (module) => module.updateHerdrCore(options))
510
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-6h0rz0zk.js")), (module) => module.updateHerdrCore(options))
511
511
  });
512
512
  var herdrCoreMissing = (error) => {
513
513
  if (isTagged(error, "HerdrCoreMissing"))
@@ -733,7 +733,7 @@ var syncTargets = (harness) => gen(function* () {
733
733
  });
734
734
  var syncKits = (input) => gen(function* () {
735
735
  const fs = yield* FileSystem;
736
- const { syncKitSetup } = yield* promise(() => import("./chunk-5w8trr75.js"));
736
+ const { syncKitSetup } = yield* promise(() => import("./chunk-tmbhak7y.js"));
737
737
  const harnesses = yield* syncTargets(input.harness);
738
738
  const chain = yield* input.client.getKitChain(input.workspaceId);
739
739
  for (const { name, problem } of chain.skipped)
@@ -1651,7 +1651,7 @@ var package_default = {
1651
1651
  };
1652
1652
 
1653
1653
  // apps/cli/src/scaffold.ts
1654
- var cliVersion = "0.10.89";
1654
+ var cliVersion = "0.10.91";
1655
1655
  var packageJson = (name, scaffold) => `${JSON.stringify({
1656
1656
  name,
1657
1657
  private: true,
@@ -1901,7 +1901,7 @@ var Usage = [
1901
1901
  "Every run, loop, agent, verify, constraint, secret, claim, deploy, dev and kit command takes --json."
1902
1902
  ].join(`
1903
1903
  `);
1904
- var agentRuntime = promise(() => import("./chunk-yhh9yeqf.js"));
1904
+ var agentRuntime = promise(() => import("./chunk-r6d67qqa.js"));
1905
1905
  var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
1906
1906
  defaultValue: () => gen(function* () {
1907
1907
  const tui = yield* tryPromise({
@@ -2777,7 +2777,7 @@ var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
2777
2777
  });
2778
2778
  var OpenRunnerRpc = Reference("kitman/cli/OpenRunnerRpc", {
2779
2779
  defaultValue: () => (options) => gen(function* () {
2780
- const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-1hqy9g9w.js"));
2780
+ const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-gykt7zjx.js"));
2781
2781
  return yield* makeRunnerRpcClient({
2782
2782
  runnerId: options.runnerId,
2783
2783
  bearer: options.bearer,
@@ -2845,6 +2845,11 @@ function startCanonicalHerdrRunnerCommand(input) {
2845
2845
  probeSandboxHost,
2846
2846
  programProcessExecutor,
2847
2847
  removeRunnerTerminals,
2848
+ makeStepProcesses,
2849
+ StepProcesses,
2850
+ stepProcessesUncontained,
2851
+ systemProcessTable,
2852
+ systemdScopes,
2848
2853
  rpcKnownEvidence,
2849
2854
  rpcStepCheckpoints,
2850
2855
  runCheckouts,
@@ -2880,7 +2885,10 @@ function startCanonicalHerdrRunnerCommand(input) {
2880
2885
  const core = yield* (yield* OpenHerdrCore)(session === undefined ? {} : { session });
2881
2886
  if (!personal)
2882
2887
  yield* addFinalizer2(() => core.stopServer.pipe(timeout("10 seconds"), ignore));
2883
- const unready = yield* startupStep("connect to herdr-core", "30 seconds", core.connect.pipe(flatMap3((connection) => removeRunnerTerminals(connection, input.runnerId)), scoped, as(undefined), catchTags({
2888
+ const stepProcesses = makeStepProcesses(yield* systemProcessTable, { scopes: yield* systemdScopes });
2889
+ const uncontained = stepProcessesUncontained({ sandbox, scoped: stepProcesses.scoped });
2890
+ const startupProblems = uncontained === undefined ? coreProblems : [...coreProblems, uncontained];
2891
+ const unready = yield* startupStep("connect to herdr-core", "30 seconds", core.connect.pipe(flatMap3((connection) => removeRunnerTerminals(connection, input.runnerId)), scoped, andThen2(stepProcesses.reapRunner(input.runnerId)), as(undefined), catchTags({
2884
2892
  HerdrCoreMissing: (error) => succeed6(herdrCoreMissing(error)),
2885
2893
  HerdrCoreIncompatible: (error) => succeed6(herdrCoreMissing(error))
2886
2894
  })));
@@ -2936,7 +2944,7 @@ function startCanonicalHerdrRunnerCommand(input) {
2936
2944
  sandboxBackends: host.backends,
2937
2945
  ...inSrt === undefined ? undefined : { srtBinaries: inSrt.binaries },
2938
2946
  ...docker === undefined ? undefined : { docker: { ...docker, runnerId: input.runnerId } }
2939
- }).pipe(provide2(succeed5(HerdrCore, core)), provide2(layer3));
2947
+ }).pipe(provide2(succeed5(HerdrCore, core)), provide2(succeed5(StepProcesses, stepProcesses)), provide2(layer3));
2940
2948
  const activeSlots = new Set;
2941
2949
  let claimsInFlight = 0;
2942
2950
  const updater = runnerUpdater({
@@ -2950,7 +2958,7 @@ function startCanonicalHerdrRunnerCommand(input) {
2950
2958
  const spawner = yield* ChildProcessSpawner;
2951
2959
  yield* startupStep("heartbeat", "30 seconds", stopOnRefusal(controlPlane.client.heartbeatRunner(input.runnerId, {
2952
2960
  ...reported,
2953
- problems: coreProblems,
2961
+ problems: startupProblems,
2954
2962
  capabilities,
2955
2963
  labels: runner.labels
2956
2964
  }).pipe(andThen2(controlPlane.client.heartbeatRunnerReplica(input.runnerId, replica.id, {
@@ -3096,12 +3104,12 @@ function startCanonicalHerdrRunnerCommand(input) {
3096
3104
  })), ensuring2(sync2(() => claimsInFlight -= 1)));
3097
3105
  }),
3098
3106
  finished: () => sync2(() => activeSlots.delete(capacitySlot)),
3099
- heartbeatReplica: () => controlPlane.client.heartbeatRunner(input.runnerId, {
3107
+ heartbeatReplica: () => flatMap3(stepProcesses.problems, (unreaped) => controlPlane.client.heartbeatRunner(input.runnerId, {
3100
3108
  ...reported,
3101
- problems: [...coreProblems, ...updater.problems()],
3109
+ problems: [...startupProblems, ...updater.problems(), ...unreaped],
3102
3110
  capabilities,
3103
3111
  labels: runner.labels
3104
- }).pipe(flatMap3(() => controlPlane.client.heartbeatRunnerReplica(input.runnerId, replica.id, {
3112
+ })).pipe(flatMap3(() => controlPlane.client.heartbeatRunnerReplica(input.runnerId, replica.id, {
3105
3113
  healthStatus: "healthy",
3106
3114
  drainState: updater.claiming() ? "accepting" : "draining",
3107
3115
  capacity: { maxConcurrentRuns: concurrency },
@@ -3161,7 +3169,7 @@ function mcpCommand(args) {
3161
3169
  if (command.action === "run") {
3162
3170
  if (command.args.length > 0)
3163
3171
  return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
3164
- const { runMcpServerCommand } = yield* promise(() => import("./chunk-5dydsgwg.js"));
3172
+ const { runMcpServerCommand } = yield* promise(() => import("./chunk-y1tnxz9f.js"));
3165
3173
  return yield* runMcpServerCommand({ flags: command.flags });
3166
3174
  }
3167
3175
  if (command.action !== "setup")
@@ -4372,9 +4380,9 @@ function claimCommand(args) {
4372
4380
  }
4373
4381
  });
4374
4382
  }
4375
- var KitWriter = map8(promise(() => import("./chunk-daycfvkq.js")), (build) => build.writeKit);
4383
+ var KitWriter = map8(promise(() => import("./chunk-d82t42vr.js")), (build) => build.writeKit);
4376
4384
  var KitBuilder = Reference("kitman/cli/KitBuilder", {
4377
- defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-daycfvkq.js")), (build) => build.buildKit(directory))
4385
+ defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-d82t42vr.js")), (build) => build.buildKit(directory))
4378
4386
  });
4379
4387
  var uploadKit = (client, workspaceId, built) => gen(function* () {
4380
4388
  yield* client.uploadKitBundle(workspaceId, built.digest, { bundle: encode2(built.bundle) });
@@ -245,6 +245,7 @@ import {
245
245
  Class2,
246
246
  Error3,
247
247
  TaggedError2,
248
+ toEquivalence,
248
249
  toCodecJson,
249
250
  Json,
250
251
  JsonObject,
@@ -252,7 +253,45 @@ import {
252
253
  decodeJsonStringOption,
253
254
  encodeJsonStringSync,
254
255
  encodePrettyJsonString
255
- } from "./chunk-caqesagt.js";
256
+ } from "./chunk-dstm8aen.js";
257
+ import {
258
+ ExitCode,
259
+ ProcessId,
260
+ makeHandle,
261
+ make,
262
+ ChildProcessSpawner,
263
+ display,
264
+ make2,
265
+ parseFdName,
266
+ fdName
267
+ } from "./chunk-w0sehmpd.js";
268
+ import {
269
+ isDateTime,
270
+ Numeric,
271
+ isWholeNumber,
272
+ guard,
273
+ Id,
274
+ Timestamp,
275
+ ActorType,
276
+ SecretName,
277
+ SecretScope,
278
+ SecretHosts,
279
+ isSecretReference
280
+ } from "./chunk-mbqeakm1.js";
281
+ import {
282
+ toJsonValue,
283
+ isOneOf,
284
+ isBigInt,
285
+ isBoolean,
286
+ isFunction,
287
+ isNumber,
288
+ isObject,
289
+ isJsonObject,
290
+ isString,
291
+ isSymbol,
292
+ isUndefined,
293
+ kindOf
294
+ } from "./chunk-k4fvnphp.js";
256
295
  import {
257
296
  map,
258
297
  makeEquivalence,
@@ -319,45 +358,7 @@ import {
319
358
  String2,
320
359
  optionalEnv,
321
360
  harnessesUnsupportedInSrt2
322
- } from "./chunk-w9j2yb0n.js";
323
- import {
324
- isDateTime,
325
- Numeric,
326
- isWholeNumber,
327
- guard,
328
- Id,
329
- Timestamp,
330
- ActorType,
331
- SecretName,
332
- SecretScope,
333
- SecretHosts,
334
- isSecretReference
335
- } from "./chunk-p74pmd81.js";
336
- import {
337
- toJsonValue,
338
- isOneOf,
339
- isBigInt,
340
- isBoolean,
341
- isFunction,
342
- isNumber,
343
- isObject,
344
- isJsonObject,
345
- isString,
346
- isSymbol,
347
- isUndefined,
348
- kindOf
349
- } from "./chunk-1mcwey0c.js";
350
- import {
351
- ExitCode,
352
- ProcessId,
353
- makeHandle,
354
- make,
355
- ChildProcessSpawner,
356
- display,
357
- make2,
358
- parseFdName,
359
- fdName
360
- } from "./chunk-ybp1mwv9.js";
361
+ } from "./chunk-25q7mg6g.js";
361
362
 
362
363
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Tuple.js
363
364
  var makeEquivalence3 = Tuple;
@@ -6932,7 +6933,9 @@ var RunnerProblemCodes = [
6932
6933
  "runner_removed",
6933
6934
  "sandbox_missing",
6934
6935
  "herdr_core_missing",
6935
- "update_failed"
6936
+ "update_failed",
6937
+ "processes_unreaped",
6938
+ "processes_uncontained"
6936
6939
  ];
6937
6940
  var RunnerProblemText = String4.check(isMinLength(1), isMaxLength(500));
6938
6941
  var RunnerProblemReport = Struct({
@@ -9314,6 +9317,85 @@ function sha256Hasher() {
9314
9317
  digest: (encoding) => hash.digest(encoding)
9315
9318
  };
9316
9319
  }
9320
+ // packages/core/src/schedule.ts
9321
+ var ScheduleFrequency = ["daily", "weekly"];
9322
+ var ScheduleMisfirePolicies = ["skip", "fire_once", "catch_up"];
9323
+ var ScheduleOverlapPolicies = ["allow", "skip", "coalesce"];
9324
+ var ScheduleVersionStatuses = ["draft", "published", "disabled", "archived"];
9325
+ var ScheduleCalendarRule = Struct({
9326
+ frequency: Literals(ScheduleFrequency),
9327
+ hour: Int.check(isGreaterThanOrEqualTo(0), isLessThanOrEqualTo(23)),
9328
+ minute: Int.check(isGreaterThanOrEqualTo(0), isLessThanOrEqualTo(59)),
9329
+ second: optionalKey(Int.check(isGreaterThanOrEqualTo(0), isLessThanOrEqualTo(59))),
9330
+ daysOfWeek: optionalKey(ArraySchema(Int.check(isGreaterThanOrEqualTo(0), isLessThanOrEqualTo(6))).check(isMinLength(1), isMaxLength(7)))
9331
+ });
9332
+ var ScheduleCronRule = Struct({
9333
+ cron: String4.check(isMinLength(9), isMaxLength(200), isPattern(new RegExp("^[0-9*,/-]+( [0-9*,/-]+){4}$", "u")))
9334
+ });
9335
+ var ScheduleRule = Union([ScheduleCalendarRule, ScheduleCronRule]);
9336
+ var cronBounds = [
9337
+ [0, 59],
9338
+ [0, 23],
9339
+ [1, 31],
9340
+ [1, 12],
9341
+ [0, 7]
9342
+ ];
9343
+ function cronField(field, [min, max]) {
9344
+ const values = new Set;
9345
+ for (const part of field.split(",")) {
9346
+ const match = /^(\*|(\d+)(?:-(\d+))?)(?:\/(\d+))?$/.exec(part);
9347
+ if (match === null)
9348
+ return;
9349
+ const from = match[1] === "*" ? min : Number(match[2]);
9350
+ const to = match[1] === "*" ? max : match[3] === undefined ? match[4] === undefined ? from : max : Number(match[3]);
9351
+ const step = match[4] === undefined ? 1 : Number(match[4]);
9352
+ if (from < min || to > max || from > to || step < 1)
9353
+ return;
9354
+ for (let value = from;value <= to; value += step)
9355
+ values.add(value);
9356
+ }
9357
+ return values;
9358
+ }
9359
+ function parseCron(cron) {
9360
+ const fields = cron.split(" ");
9361
+ const [minutes, hours, days, months, weekdays] = fields.map((field, index) => cronField(field, cronBounds[index] ?? [0, 0]));
9362
+ if (fields.length !== 5 || !minutes || !hours || !days || !months || !weekdays)
9363
+ return;
9364
+ return {
9365
+ minutes,
9366
+ hours,
9367
+ days,
9368
+ months,
9369
+ weekdays: new Set([...weekdays].map((value) => value % 7)),
9370
+ dayRestricted: !(fields[2] ?? "").startsWith("*"),
9371
+ weekdayRestricted: !(fields[4] ?? "").startsWith("*")
9372
+ };
9373
+ }
9374
+ function isScheduleRule(value) {
9375
+ return guard(ScheduleRule)(value) && (!("cron" in value) || parseCron(value.cron) !== undefined);
9376
+ }
9377
+ var ScheduleVersion = Struct({
9378
+ contractVersion: Literal("schedule.v1"),
9379
+ id: String4.check(isMinLength(1)),
9380
+ scheduleId: String4.check(isMinLength(1)),
9381
+ workspaceId: String4.check(isMinLength(1)),
9382
+ teamId: optionalKey(String4.check(isMinLength(1))),
9383
+ loopId: optionalKey(String4.check(isMinLength(1))),
9384
+ name: optionalKey(String4.check(isMinLength(1), isMaxLength(200))),
9385
+ version: Int.check(isGreaterThanOrEqualTo(1)),
9386
+ status: Literals(ScheduleVersionStatuses),
9387
+ timezone: String4.check(isMinLength(1), isMaxLength(80)),
9388
+ rule: ScheduleRule,
9389
+ misfirePolicy: Literals(ScheduleMisfirePolicies),
9390
+ overlapPolicy: Literals(ScheduleOverlapPolicies),
9391
+ maxCatchUp: Int.check(isGreaterThanOrEqualTo(0), isLessThanOrEqualTo(200)),
9392
+ misfireGraceSeconds: optionalKey(Int.check(isGreaterThanOrEqualTo(0), isLessThanOrEqualTo(604800))),
9393
+ inputSchemaRef: optionalKey(LoopDataSchemaRef),
9394
+ input: optionalKey(SafeJson),
9395
+ createdAt: String4.check(isMinLength(1))
9396
+ });
9397
+ var zones = new Map;
9398
+ var resolvedLocalDateTimes = new Map;
9317
9399
  // packages/core/src/transcript.ts
9318
9400
  var Text = String4.check(isMaxLength(200000));
9319
9401
  var AgentEvent = Union([
@@ -11237,6 +11319,120 @@ var DeployBindingCreate = Struct({
11237
11319
  });
11238
11320
  var DeployBindingList = Struct({ items: ArraySchema(DeployBinding) });
11239
11321
  var defaultKitName = "@kitman-sh/software-engineering";
11322
+
11323
+ // packages/core/src/kit-declarations.ts
11324
+ var LoopCapabilities = [
11325
+ "agent_work",
11326
+ "ask",
11327
+ "call",
11328
+ "verify",
11329
+ "change_request",
11330
+ "write_back",
11331
+ "post_comment",
11332
+ "create_tasks",
11333
+ "merge_change_request",
11334
+ "approve_change_request",
11335
+ "publish_release",
11336
+ "read_transcripts",
11337
+ "read_change_request",
11338
+ "measure",
11339
+ "claim",
11340
+ "propose",
11341
+ "read_project",
11342
+ "draft_update"
11343
+ ];
11344
+ var JsonObject2 = Record(String4, Json);
11345
+ var SecretName2 = String4.check(isPattern(/^[A-Za-z_][A-Za-z0-9_]{0,127}$/));
11346
+ var EventFilterValue = Union([String4, Finite, Boolean2, Null]);
11347
+ var LoopManifest = Struct({
11348
+ id: String4,
11349
+ title: String4,
11350
+ version: optionalKey(LoopVersion),
11351
+ input: JsonObject2,
11352
+ output: JsonObject2,
11353
+ outcome: optionalKey(Literals(["feature", "bug", "refactor", "investigation", "docs", "migration", "performance"])),
11354
+ agents: Record(String4, String4),
11355
+ checkout: Literals(["none", "read", "write"]),
11356
+ when: ArraySchema(Struct({
11357
+ event: String4,
11358
+ filter: optionalKey(Record(String4, Union([EventFilterValue, ArraySchema(EventFilterValue)]))),
11359
+ input: Record(String4, String4),
11360
+ values: optionalKey(JsonObject2)
11361
+ })),
11362
+ offers: ArraySchema(Struct({
11363
+ id: String4,
11364
+ title: String4,
11365
+ loop: String4,
11366
+ from: optionalKey(String4)
11367
+ })),
11368
+ capabilities: ArraySchema(Literals(LoopCapabilities)),
11369
+ ownCapabilities: optionalKey(ArraySchema(Literals(LoopCapabilities))),
11370
+ secrets: optionalKey(ArraySchema(SecretName2)),
11371
+ network: optionalKey(AgentSandboxNetwork),
11372
+ schedule: optionalKey(Struct({ rule: ScheduleRule, timezone: String4 }))
11373
+ });
11374
+ var LoopDetail = Struct({
11375
+ id: String4,
11376
+ resolved: optionalKey(Struct({
11377
+ ...ProgramLoop.fields,
11378
+ agents: LoopManifest.fields.agents,
11379
+ when: LoopManifest.fields.when,
11380
+ schedule: optionalKey(Struct({
11381
+ rule: ScheduleRule,
11382
+ timezone: String4,
11383
+ on: Boolean2,
11384
+ nextRunAt: optionalKey(String4)
11385
+ }))
11386
+ }))
11387
+ });
11388
+ var AgentDeclaration = Struct({
11389
+ extends: optionalKey(String4),
11390
+ instructions: optionalKey(String4),
11391
+ harness: optionalKey(String4),
11392
+ model: optionalKey(String4),
11393
+ effort: optionalKey(Literals(AgentEfforts)),
11394
+ fallbacks: optionalKey(ArraySchema(AgentFallback)),
11395
+ tools: optionalKey(ArraySchema(Literals(AgentCapabilities))),
11396
+ skills: optionalKey(ArraySchema(String4.check(isMinLength(1)))),
11397
+ network: optionalKey(Union([Struct({ hosts: ArraySchema(String4) }), Literal("open")])),
11398
+ sandbox: optionalKey(Literal("docker"))
11399
+ });
11400
+ var scheduleFields = {
11401
+ name: String4.check(isMinLength(1)),
11402
+ loop: String4,
11403
+ team: optionalKey(String4),
11404
+ input: optionalKey(JsonObject2),
11405
+ timezone: String4,
11406
+ misfire: optionalKey(Literals(ScheduleMisfirePolicies)),
11407
+ overlap: optionalKey(Literals(ScheduleOverlapPolicies))
11408
+ };
11409
+ var ScheduleDeclaration = Union([
11410
+ Struct({
11411
+ ...scheduleFields,
11412
+ cron: String4.check(makeFilter((cron) => isScheduleRule({ cron }) || "five cron fields, each within its range"))
11413
+ }),
11414
+ Struct({
11415
+ ...scheduleFields,
11416
+ rule: declare((value) => isScheduleRule(value), {
11417
+ expected: "a Schedule rule: frequency daily or weekly, hour, minute, and optionally second and daysOfWeek"
11418
+ })
11419
+ })
11420
+ ]);
11421
+ var CarriedKit = Struct({
11422
+ name: KitName,
11423
+ version: String4.check(isMinLength(1)),
11424
+ setup: KitDigest,
11425
+ loops: ArraySchema(String4),
11426
+ agents: ArraySchema(String4)
11427
+ });
11428
+ var KitDeclarations = Struct({
11429
+ loops: ArraySchema(LoopManifest),
11430
+ agents: Record(String4, AgentDeclaration),
11431
+ schedules: optionalKey(Record(String4, ScheduleDeclaration)),
11432
+ carried: optionalKey(ArraySchema(CarriedKit))
11433
+ });
11434
+ var sameLoop = toEquivalence(LoopManifest);
11435
+ var sameAgent = toEquivalence(AgentDeclaration);
11240
11436
  // packages/core/src/kit-setup.ts
11241
11437
  var KitSetup = Struct({
11242
11438
  ...AgentEnvironmentFragment.fields,
@@ -13894,7 +14090,7 @@ class RunnerAuthentication extends Service()("RunnerAuthentication", {
13894
14090
  error: RunnerRpcError
13895
14091
  }) {
13896
14092
  }
13897
- var EventFilterValue = Union([String4, Finite, Boolean2, Null]);
14093
+ var EventFilterValue2 = Union([String4, Finite, Boolean2, Null]);
13898
14094
  var WorkAvailable = TaggedStruct("WorkAvailable", {});
13899
14095
  var LeaseRevoked = TaggedStruct("LeaseRevoked", { workUnitId: String4 });
13900
14096
  var Settled = TaggedStruct("Settled", { workUnitId: String4 });
@@ -14107,12 +14303,12 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14107
14303
  step: String4,
14108
14304
  deferredName: String4,
14109
14305
  event: String4,
14110
- filter: optional(Record(String4, Union([EventFilterValue, ArraySchema(EventFilterValue)]))),
14306
+ filter: optional(Record(String4, Union([EventFilterValue2, ArraySchema(EventFilterValue2)]))),
14111
14307
  timeoutMillis: Int,
14112
14308
  since: optionalKey(String4),
14113
14309
  or: optionalKey(ArraySchema(Struct({
14114
14310
  event: String4,
14115
- filter: optionalKey(Record(String4, Union([EventFilterValue, ArraySchema(EventFilterValue)]))),
14311
+ filter: optionalKey(Record(String4, Union([EventFilterValue2, ArraySchema(EventFilterValue2)]))),
14116
14312
  since: optionalKey(String4)
14117
14313
  })))
14118
14314
  },
@@ -14204,7 +14400,7 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14204
14400
  }),
14205
14401
  error: RunnerRpcError
14206
14402
  }), make5("ReadTranscripts", {
14207
- payload: { lease: ProgramLease, step: String4, days: Int },
14403
+ payload: { lease: ProgramLease, step: String4, days: Int, teamId: optionalKey(String4) },
14208
14404
  success: Struct({
14209
14405
  runs: ArraySchema(Struct({
14210
14406
  runId: String4,
@@ -14218,8 +14414,17 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14218
14414
  sequence: Int,
14219
14415
  kind: String4,
14220
14416
  text: String4
14221
- }))
14222
- }))
14417
+ })),
14418
+ rootRunId: optionalKey(String4),
14419
+ omitted: optionalKey(Int)
14420
+ })),
14421
+ artifactId: optionalKey(String4),
14422
+ findings: optionalKey(ArraySchema(Struct({
14423
+ key: String4,
14424
+ title: String4,
14425
+ taskId: optionalKey(String4),
14426
+ taskKey: optionalKey(String4)
14427
+ })))
14223
14428
  }),
14224
14429
  error: RunnerRpcError
14225
14430
  }), make5("PipelineStatus", {
@@ -14320,7 +14525,8 @@ class RunnerCapabilityRpcs extends make6(make5("PutQuestion", {
14320
14525
  success: Struct({
14321
14526
  kind: Literals(["memory", "task"]),
14322
14527
  id: String4,
14323
- matched: optionalKey(Boolean2)
14528
+ matched: optionalKey(Boolean2),
14529
+ task: optionalKey(Struct({ id: String4, active: Boolean2 }))
14324
14530
  }),
14325
14531
  error: RunnerRpcError
14326
14532
  }), make5("ReadProject", {
@@ -15706,4 +15912,4 @@ function checkServices(declaration) {
15706
15912
  return isSome(decoded) ? [...new Set(decoded.value.services)] : undefined;
15707
15913
  }
15708
15914
 
15709
- 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, AgentHarnessIds, AgentSkillRequirement, AgentMcpServerRequirement, AgentEnvironmentFragment, findForbiddenAgentEnvironmentSecretPath, RepoBindingProviders, RepoBindingCredentialProviderTypes, findForbiddenRepoBindingSecretPath, AgentSandboxNetwork, runnerAgentSandboxPolicy, agentNetworkAllowlist, verificationNetworkAllowlist, programNetworkHosts, ContextPackModes, DefaultContextPackMode, ProposalStatuses, ProposalTargetTypes, canonicalJson, canonicalSha256, AgentEfforts, AgentCapabilities, LoopDataSchemaRef, RunDisplayStates, LoopVersion, ProgramLoop, AgentFallback, RunWaitUntils, isTestReportName, checkTests, ProgramWorkUnit, MeasureSample, MeasureEvidence, catchUpPathLimit, CatchUp, RunnerOwnership, defaultRunnerCapabilities, 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, 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 };
15915
+ 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, AgentHarnessIds, AgentSkillRequirement, AgentMcpServerRequirement, AgentEnvironmentFragment, findForbiddenAgentEnvironmentSecretPath, RepoBindingProviders, RepoBindingCredentialProviderTypes, findForbiddenRepoBindingSecretPath, runnerAgentSandboxPolicy, agentNetworkAllowlist, verificationNetworkAllowlist, programNetworkHosts, ContextPackModes, DefaultContextPackMode, ProposalStatuses, ProposalTargetTypes, canonicalJson, canonicalSha256, RunDisplayStates, RunWaitUntils, isTestReportName, checkTests, ProgramWorkUnit, MeasureSample, MeasureEvidence, catchUpPathLimit, CatchUp, RunnerOwnership, defaultRunnerCapabilities, 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, KitDigest, defaultKitName, LoopCapabilities, LoopManifest, AgentDeclaration, KitDeclarations, KitSetup, SetupArchive, kitMcpSecretNames, kitmanMcpServer, KitmanClientError, KitmanEffectClient, CliError, DefaultApiUrl, resolveConfig, apiUrlFromEnv, stepCredentialFromEnv, stepWorkspaceFromEnv, stepSkillsDirFromEnv, stepFittingSkillsFromEnv, stepOutputOnlyFromEnv, mcpCredentialNameFromEnv, userConfigPath, userAuthPath, userHarnessSyncPath, kitSetupCacheDir, bundleCacheDir, 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 };
@@ -22,21 +22,21 @@ import {
22
22
  NullOr,
23
23
  Finite,
24
24
  encodeUnknownJsonStringSync
25
- } from "./chunk-caqesagt.js";
25
+ } from "./chunk-dstm8aen.js";
26
26
  import {
27
27
  isNumber,
28
28
  isJsonObject,
29
29
  isString
30
- } from "./chunk-1mcwey0c.js";
30
+ } from "./chunk-k4fvnphp.js";
31
+ import {
32
+ ChildProcessSpawner,
33
+ make2
34
+ } from "./chunk-w0sehmpd.js";
31
35
  import {
32
36
  make10,
33
37
  runForEach,
34
38
  compiled2
35
- } from "./chunk-w9j2yb0n.js";
36
- import {
37
- ChildProcessSpawner,
38
- make2
39
- } from "./chunk-ybp1mwv9.js";
39
+ } from "./chunk-25q7mg6g.js";
40
40
 
41
41
  // packages/agent-runtime/src/opencode-store.ts
42
42
  import { lstatSync, readFileSync, realpathSync } from "fs";
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-ybp1mwv9.js";
2
+ import"./chunk-w0sehmpd.js";
3
3
  import {
4
4
  HERDR_CORE_GENERATION2,
5
5
  HERDR_CORE_INSTALL_COMMAND2,
@@ -12,9 +12,9 @@ import {
12
12
  herdrCoreLayer2,
13
13
  herdrCoreTransportLayer2,
14
14
  updateHerdrCore2
15
- } from "./chunk-73fw4pgr.js";
16
- import"./chunk-w9j2yb0n.js";
17
- import"./chunk-caqesagt.js";
15
+ } from "./chunk-5fxxg02f.js";
16
+ import"./chunk-25q7mg6g.js";
17
+ import"./chunk-dstm8aen.js";
18
18
  export {
19
19
  HERDR_CORE_GENERATION2 as HERDR_CORE_GENERATION,
20
20
  HERDR_CORE_INSTALL_COMMAND2 as HERDR_CORE_INSTALL_COMMAND,
@@ -24,11 +24,11 @@ import {
24
24
  Record,
25
25
  Int,
26
26
  fromJsonString
27
- } from "./chunk-caqesagt.js";
27
+ } from "./chunk-dstm8aen.js";
28
28
  import {
29
29
  withDefault,
30
30
  String2
31
- } from "./chunk-w9j2yb0n.js";
31
+ } from "./chunk-25q7mg6g.js";
32
32
  import {
33
33
  digestSha256,
34
34
  digestSha512,
@@ -38,7 +38,7 @@ import {
38
38
  get2,
39
39
  layer4,
40
40
  KitDigest
41
- } from "./chunk-73fw4pgr.js";
41
+ } from "./chunk-5fxxg02f.js";
42
42
 
43
43
  // packages/core/src/npm-registry.ts
44
44
  var KitManifest = Struct({
@@ -14,8 +14,8 @@ import {
14
14
  writeSrtSettings2,
15
15
  srtStepArgv2,
16
16
  srtArgv2
17
- } from "./chunk-w9j2yb0n.js";
18
- import"./chunk-caqesagt.js";
17
+ } from "./chunk-25q7mg6g.js";
18
+ import"./chunk-dstm8aen.js";
19
19
  export {
20
20
  compiled2 as compiled,
21
21
  harnessesUnsupportedInSrt2 as harnessesUnsupportedInSrt,