@kitman-sh/cli 0.13.8 → 0.13.9

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-q5w3v4k1.js → chunk-0tjg9eya.js} +1 -1
  2. package/dist/{chunk-zz589n7a.js → chunk-0wj65j5e.js} +12 -12
  3. package/dist/{chunk-7bytsxkf.js → chunk-1ht6jwzm.js} +13 -12
  4. package/dist/{chunk-5zth85pj.js → chunk-53qp6kcp.js} +2 -2
  5. package/dist/{chunk-gj1padza.js → chunk-69fcvx7d.js} +39 -39
  6. package/dist/{chunk-eg1n8wvf.js → chunk-6jtjcvnc.js} +44 -44
  7. package/dist/{chunk-vm2qy986.js → chunk-9gg1w4aa.js} +283 -375
  8. package/dist/{chunk-96svx416.js → chunk-a44ebqzx.js} +6 -6
  9. package/dist/{chunk-0h49y8gf.js → chunk-aezq3fyy.js} +74 -214
  10. package/dist/{chunk-gq7y5v3e.js → chunk-cw61zyh5.js} +1 -1
  11. package/dist/{chunk-5zhh41gb.js → chunk-ezv4p0zr.js} +4 -4
  12. package/dist/{chunk-gy9rf14f.js → chunk-fh58za51.js} +3 -3
  13. package/dist/{chunk-byeasm6x.js → chunk-hezxa6q5.js} +7 -7
  14. package/dist/{chunk-mtkstrh3.js → chunk-kq88aaa3.js} +4 -4
  15. package/dist/{chunk-cq2h8q9e.js → chunk-ksgt1tdc.js} +4 -4
  16. package/dist/{chunk-c4ccpwjy.js → chunk-pj3mer60.js} +4 -4
  17. package/dist/{chunk-zw3gf6r5.js → chunk-qjqa338f.js} +333 -94
  18. package/dist/{chunk-h1rmw7yk.js → chunk-qkjfx2ts.js} +14 -14
  19. package/dist/{chunk-08dyrk6y.js → chunk-rz18qefg.js} +10 -10
  20. package/dist/{chunk-gr17n0z3.js → chunk-s63fjc69.js} +25 -25
  21. package/dist/{chunk-cbpb2rww.js → chunk-tspf987k.js} +8 -8
  22. package/dist/{chunk-ff1r9vcq.js → chunk-v190zzc5.js} +1 -1
  23. package/dist/{chunk-a24jc5rx.js → chunk-wzr1n3zy.js} +7 -3
  24. package/dist/{chunk-z68rzf0f.js → chunk-x8sewxzm.js} +145 -145
  25. package/dist/{chunk-y1krmnbv.js → chunk-z5f7g1w1.js} +2 -2
  26. package/dist/index.js +4 -4
  27. package/package.json +1 -1
@@ -40,14 +40,14 @@ import {
40
40
  isSuccess2,
41
41
  isFailure2,
42
42
  hasInterrupts,
43
- makeUnsafe5,
44
- make16,
43
+ makeUnsafe4,
44
+ make15,
45
45
  _await,
46
46
  fail5,
47
47
  isDoneUnsafe,
48
48
  succeed4,
49
49
  doneUnsafe,
50
- makeUnsafe6,
50
+ makeUnsafe5,
51
51
  provide,
52
52
  succeed5,
53
53
  effect,
@@ -55,6 +55,7 @@ import {
55
55
  die2,
56
56
  findErrorOption,
57
57
  pretty,
58
+ currentTimeMillis,
58
59
  exponential,
59
60
  jittered,
60
61
  spaced,
@@ -82,7 +83,7 @@ import {
82
83
  result,
83
84
  option2,
84
85
  exit,
85
- map8,
86
+ map7,
86
87
  as,
87
88
  asSome2,
88
89
  asVoid,
@@ -168,14 +169,54 @@ import {
168
169
  decodeJsonStringSync,
169
170
  encodeUnknownJsonStringSync,
170
171
  storable
171
- } from "./chunk-zw3gf6r5.js";
172
+ } from "./chunk-qjqa338f.js";
173
+ import {
174
+ join,
175
+ interrupt,
176
+ unbounded,
177
+ publishUnsafe,
178
+ unbounded2,
179
+ offer,
180
+ makeUnsafe2,
181
+ make10,
182
+ fromQueue,
183
+ fromPubSub,
184
+ map2,
185
+ filter,
186
+ decodeText,
187
+ encodeText,
188
+ splitLines,
189
+ run,
190
+ runHead,
191
+ runForEach,
192
+ FileSystem,
193
+ Path,
194
+ embeddedFile,
195
+ extractEmbeddedFile,
196
+ optionalEnv,
197
+ operatorConfigHome,
198
+ tempDirectoryScoped,
199
+ harnessesUnsupportedInSrt2,
200
+ compiled2,
201
+ pinnedSrtCommand2,
202
+ pinnedSrtStepCommand2,
203
+ runSrtCli2,
204
+ kitmanCacheDirectory2,
205
+ srtSettings2,
206
+ srtCacheEnvironment2,
207
+ srtInheritedEnv2,
208
+ inheritedEnvironment2,
209
+ withOnlyEnvironment2,
210
+ writeSrtSettings2,
211
+ srtStepArgv2,
212
+ srtArgv2
213
+ } from "./chunk-aezq3fyy.js";
172
214
  import {
173
215
  Id,
174
216
  secretReference,
175
217
  secretPlaceholder
176
- } from "./chunk-q5w3v4k1.js";
218
+ } from "./chunk-0tjg9eya.js";
177
219
  import {
178
- currentTimeMillis,
179
220
  SecureRandom,
180
221
  layerWebCrypto,
181
222
  layer,
@@ -247,48 +288,7 @@ import {
247
288
  installCommand,
248
289
  checkServicesFile,
249
290
  checkServices
250
- } from "./chunk-vm2qy986.js";
251
- import {
252
- join,
253
- interrupt,
254
- unbounded,
255
- publishUnsafe,
256
- unbounded2,
257
- offer,
258
- makeUnsafe3,
259
- make11,
260
- fromQueue,
261
- fromPubSub,
262
- map2,
263
- filter,
264
- decodeText,
265
- encodeText,
266
- splitLines,
267
- run,
268
- runHead,
269
- runForEach,
270
- FileSystem,
271
- Path,
272
- embeddedFile,
273
- extractEmbeddedFile,
274
- optionalEnv,
275
- operatorConfigHome,
276
- tempDirectoryScoped,
277
- harnessesUnsupportedInSrt2,
278
- compiled2,
279
- pinnedSrtCommand2,
280
- pinnedSrtStepCommand2,
281
- runSrtCli2,
282
- kitmanCacheDirectory2,
283
- srtSettings2,
284
- srtCacheEnvironment2,
285
- srtInheritedEnv2,
286
- inheritedEnvironment2,
287
- withOnlyEnvironment2,
288
- writeSrtSettings2,
289
- srtStepArgv2,
290
- srtArgv2
291
- } from "./chunk-0h49y8gf.js";
291
+ } from "./chunk-9gg1w4aa.js";
292
292
  import {
293
293
  writeAgentEnvironmentConfigFile2,
294
294
  readManifestSkillPaths2,
@@ -304,8 +304,8 @@ import {
304
304
  applyAgentEnvironmentMaterialization2,
305
305
  isPathWithin2,
306
306
  skillIdentity2
307
- } from "./chunk-zz589n7a.js";
308
- import"./chunk-byeasm6x.js";
307
+ } from "./chunk-0wj65j5e.js";
308
+ import"./chunk-hezxa6q5.js";
309
309
  import {
310
310
  egressAllowed,
311
311
  writeSecretRegistry,
@@ -315,7 +315,7 @@ import {
315
315
  secretFilter2,
316
316
  opaqueTunnelRefusal2,
317
317
  isOpaqueConnectReason2
318
- } from "./chunk-y1krmnbv.js";
318
+ } from "./chunk-z5f7g1w1.js";
319
319
  import {
320
320
  sliceBytes2,
321
321
  maxLineBytes2,
@@ -323,23 +323,23 @@ import {
323
323
  decodedOption2,
324
324
  decoded2,
325
325
  readOpencode2
326
- } from "./chunk-cbpb2rww.js";
326
+ } from "./chunk-tspf987k.js";
327
327
  import {
328
328
  uploadRunFile,
329
329
  programLease,
330
330
  rpcRunFiles,
331
331
  programHostsEnv,
332
332
  undeclaredHostsEnv
333
- } from "./chunk-7bytsxkf.js";
334
- import"./chunk-cq2h8q9e.js";
333
+ } from "./chunk-1ht6jwzm.js";
334
+ import"./chunk-ksgt1tdc.js";
335
335
  import {
336
336
  nextInt
337
- } from "./chunk-gq7y5v3e.js";
337
+ } from "./chunk-cw61zyh5.js";
338
338
  import {
339
339
  ChildProcessSpawner,
340
340
  make3
341
- } from "./chunk-mtkstrh3.js";
342
- import"./chunk-h1rmw7yk.js";
341
+ } from "./chunk-kq88aaa3.js";
342
+ import"./chunk-qkjfx2ts.js";
343
343
 
344
344
  // packages/core/src/sync-kit.ts
345
345
  import { createHash } from "crypto";
@@ -905,7 +905,7 @@ var resolvePackagePlugins = (input, plan) => gen(function* () {
905
905
  const source = packageSource(plugin);
906
906
  if (source === undefined || source.version !== undefined && input.versions !== "latest")
907
907
  return succeed6([plugin]);
908
- return resolver.npmLatest(source.packageName).pipe(map8((version) => [
908
+ return resolver.npmLatest(source.packageName).pipe(map7((version) => [
909
909
  {
910
910
  ...plugin,
911
911
  item: {
@@ -2291,7 +2291,7 @@ var openCodeStore = (source) => gen(function* () {
2291
2291
  var runOpenCode = (binary, store, args) => runCommand2(binary, [...args, "--standalone"], { env: store.env, timeout: "30 seconds" });
2292
2292
  var readOpenCodeLogin = (binary, source) => gen(function* () {
2293
2293
  const store = yield* openCodeStore(source);
2294
- const exported = store === undefined ? none() : yield* runOpenCode(binary, store, ["auth", "export"]).pipe(map8(decodeExport), orElseSucceed(() => none()));
2294
+ const exported = store === undefined ? none() : yield* runOpenCode(binary, store, ["auth", "export"]).pipe(map7(decodeExport), orElseSucceed(() => none()));
2295
2295
  if (isNone(exported)) {
2296
2296
  const credentials = yield* fileCredentials(source);
2297
2297
  return credentials === undefined ? undefined : { credentials };
@@ -2338,17 +2338,17 @@ var renewers = {
2338
2338
  grant_type: "refresh_token",
2339
2339
  refresh_token: login.refresh,
2340
2340
  client_id: "9d1c250a-e61b-44d9-88ed-5944d1962f5e"
2341
- }))).pipe(map8(refreshed(now))),
2341
+ }))).pipe(map7(refreshed(now))),
2342
2342
  openai: (login, now) => answer("openai", TokenAnswer, post("https://auth.openai.com/oauth/token").pipe(bodyUrlParams({
2343
2343
  grant_type: "refresh_token",
2344
2344
  refresh_token: login.refresh,
2345
2345
  client_id: "app_EMoamEEZ73f0CkXaXp7hrann"
2346
- }))).pipe(map8(refreshed(now))),
2346
+ }))).pipe(map7(refreshed(now))),
2347
2347
  xai: (login, now) => answer("xai", XaiAnswer, post("https://auth.x.ai/oauth2/token").pipe(acceptJson, bodyUrlParams({
2348
2348
  grant_type: "refresh_token",
2349
2349
  refresh_token: login.refresh,
2350
2350
  client_id: "b1a00492-073a-47ea-816f-4c329264a828"
2351
- }))).pipe(map8((answered) => ({
2351
+ }))).pipe(map7((answered) => ({
2352
2352
  access: answered.access_token,
2353
2353
  ...answered.refresh_token === undefined ? undefined : { refresh: answered.refresh_token },
2354
2354
  expires: xaiExpiry(answered, now)
@@ -2357,8 +2357,8 @@ var renewers = {
2357
2357
  grant_type: "refresh_token",
2358
2358
  refresh_token: login.refresh,
2359
2359
  client_id: "opencode-cli"
2360
- }))).pipe(map8(refreshed(now))),
2361
- "github-copilot": (login) => answer("github-copilot", CopilotAnswer, get("https://api.github.com/copilot_internal/v2/token").pipe(setHeaders({ authorization: `Bearer ${login.refresh}`, accept: "application/json" }))).pipe(map8((answered) => ({ access: answered.token, expires: answered.expires_at * 1000 })))
2360
+ }))).pipe(map7(refreshed(now))),
2361
+ "github-copilot": (login) => answer("github-copilot", CopilotAnswer, get("https://api.github.com/copilot_internal/v2/token").pipe(setHeaders({ authorization: `Bearer ${login.refresh}`, accept: "application/json" }))).pipe(map7((answered) => ({ access: answered.token, expires: answered.expires_at * 1000 })))
2362
2362
  };
2363
2363
  var renewerFor = (provider) => isKeyOf(renewers, provider) ? renewers[provider] : undefined;
2364
2364
  var renewableLogin = (provider, credential) => getOrUndefined(filter2(decodeRenewable(credential), (login) => renewerFor(provider) !== undefined && (provider !== "github-copilot" || login.access !== login.refresh)));
@@ -2389,7 +2389,7 @@ var replaceInFile = (source, provider, credential) => gen(function* () {
2389
2389
  });
2390
2390
  var renewalPermits = new Map;
2391
2391
  var oneRenewalAt = (source) => (effect) => {
2392
- const permit = renewalPermits.get(source) ?? makeUnsafe3(1);
2392
+ const permit = renewalPermits.get(source) ?? makeUnsafe2(1);
2393
2393
  renewalPermits.set(source, permit);
2394
2394
  return permit.withPermits(1)(effect);
2395
2395
  };
@@ -2423,7 +2423,7 @@ var filesUnder = (root) => gen(function* () {
2423
2423
  if (skipped.has(entry))
2424
2424
  continue;
2425
2425
  const path = relative === "" ? entry : `${relative}/${entry}`;
2426
- const type = yield* fs.stat(`${root}/${path}`).pipe(map8((info) => info.type), orElseSucceed(() => {
2426
+ const type = yield* fs.stat(`${root}/${path}`).pipe(map7((info) => info.type), orElseSucceed(() => {
2427
2427
  return;
2428
2428
  }));
2429
2429
  if (type === "Directory")
@@ -2439,7 +2439,7 @@ var dependenciesOf = (root, files) => gen(function* () {
2439
2439
  const fs = yield* FileSystem;
2440
2440
  const names = new Set;
2441
2441
  for (const file of files.filter((path) => path === "package.json" || path.endsWith("/package.json"))) {
2442
- const manifest = yield* fs.readFileString(`${root}/${file}`).pipe(map8((text) => decodeJsonStringSync(text)), orElseSucceed(() => {
2442
+ const manifest = yield* fs.readFileString(`${root}/${file}`).pipe(map7((text) => decodeJsonStringSync(text)), orElseSucceed(() => {
2443
2443
  return;
2444
2444
  }));
2445
2445
  if (!isJsonObject(manifest))
@@ -2611,7 +2611,7 @@ var credentialsIn = (source) => gen(function* () {
2611
2611
  const credentials = getOrUndefined(decodeJsonStringOption(text));
2612
2612
  return isJsonObject(credentials) ? credentials : undefined;
2613
2613
  });
2614
- var loginCredentials = (login) => login.format === "opencode" ? map8(readOpenCodeLogin(login.binary, login.source), (read) => read?.credentials) : credentialsIn(login.source);
2614
+ var loginCredentials = (login) => login.format === "opencode" ? map7(readOpenCodeLogin(login.binary, login.source), (read) => read?.credentials) : credentialsIn(login.source);
2615
2615
  var neverExpires = 253402300799000;
2616
2616
  var isOAuth = (credential) => isJsonObject(credential) && credential.type === "oauth";
2617
2617
  var claudeOAuth = "claudeAiOauth";
@@ -2779,7 +2779,7 @@ var refreshOperatorLogin = (login, expired, http) => gen(function* () {
2779
2779
  }
2780
2780
  }
2781
2781
  });
2782
- var stepLogin = (login, reference) => map8(loginCredentials(login), (credentials) => {
2782
+ var stepLogin = (login, reference) => map7(loginCredentials(login), (credentials) => {
2783
2783
  if (credentials === undefined)
2784
2784
  return;
2785
2785
  const format = loginFormats[login.format];
@@ -2798,8 +2798,8 @@ var renewableStepLogin = (login, referenced, http) => gen(function* () {
2798
2798
  const expired = new Map;
2799
2799
  let published;
2800
2800
  let heldTokens;
2801
- const writing = makeUnsafe3(1);
2802
- const refreshing = makeUnsafe3(1);
2801
+ const writing = makeUnsafe2(1);
2802
+ const refreshing = makeUnsafe2(1);
2803
2803
  const copy = gen(function* () {
2804
2804
  const copied = yield* stepLogin(login, referenced?.reference);
2805
2805
  if (copied === undefined)
@@ -2858,7 +2858,7 @@ var loginHostsWithProviders = (operatorFiles) => gen(function* () {
2858
2858
  };
2859
2859
  return { ...login, hosts };
2860
2860
  });
2861
- var carriedLoginHosts = (launch) => launch.renewedLogin?.format === "opencode" ? map8(loginCredentials(launch.renewedLogin), openCodeConsoleHosts) : succeed6([]);
2861
+ var carriedLoginHosts = (launch) => launch.renewedLogin?.format === "opencode" ? map7(loginCredentials(launch.renewedLogin), openCodeConsoleHosts) : succeed6([]);
2862
2862
  var carriedProviderHosts = (launch) => gen(function* () {
2863
2863
  const providers = launch.operatorFiles?.providers;
2864
2864
  if (providers === undefined)
@@ -2999,7 +2999,7 @@ var writeHarnessFiles = (input) => gen(function* () {
2999
2999
  yield* every(loginRenewalMillis, true);
3000
3000
  if (renewed.format !== "opencode")
3001
3001
  yield* every(loginCopyMillis, false);
3002
- const watching = makeUnsafe5();
3002
+ const watching = makeUnsafe4();
3003
3003
  yield* forkScoped(fs.watch(path.dirname(renewed.source), { onReady: () => doneUnsafe(watching, void_3) }).pipe(filter((event) => path.basename(event.path) === path.basename(renewed.source)), runForEach(() => login.publish(false)), catch_((error) => logWarning("harness_login_not_watched", error)), ensuring2(succeed4(watching, undefined))));
3004
3004
  yield* _await(watching);
3005
3005
  });
@@ -3008,7 +3008,7 @@ var decodeSetupArchive = decodeEffect(fromJsonString(SetupArchive));
3008
3008
  var runsOnHost = (command) => gen(function* () {
3009
3009
  const fs = yield* FileSystem;
3010
3010
  const path = yield* Path;
3011
- const executable = (file) => fs.stat(file).pipe(map8((info) => info.type === "File" && (info.mode & 73) !== 0), orElseSucceed(() => false));
3011
+ const executable = (file) => fs.stat(file).pipe(map7((info) => info.type === "File" && (info.mode & 73) !== 0), orElseSucceed(() => false));
3012
3012
  if (command.includes("/"))
3013
3013
  return yield* executable(command);
3014
3014
  for (const directory of ((yield* optionalEnv("PATH")) ?? "").split(":"))
@@ -3036,7 +3036,7 @@ var stepKitSetup = (agent, harness) => gen(function* () {
3036
3036
  const fetch = agent.setupArchive;
3037
3037
  if (fetch === undefined)
3038
3038
  return unavailable("this Runner fetches no setup archives");
3039
- const setups = yield* forEach(kits, (kit) => fetch(kit.setupDigest).pipe(flatMap3(decodeSetupArchive), map8((archive) => ({ name: kit.name, version: kit.version, archive })))).pipe(result);
3039
+ const setups = yield* forEach(kits, (kit) => fetch(kit.setupDigest).pipe(flatMap3(decodeSetupArchive), map7((archive) => ({ name: kit.name, version: kit.version, archive })))).pipe(result);
3040
3040
  if (isFailure(setups))
3041
3041
  return unavailable(setups.failure.message);
3042
3042
  const setup = materializeKitSetup(harness, [...setups.success, kitmanSkillEntry], agent.brief.listedSkills ?? []);
@@ -3066,11 +3066,11 @@ var Proto = {
3066
3066
  };
3067
3067
  }
3068
3068
  };
3069
- var make = (value) => map8(unbounded({
3069
+ var make = (value) => map7(unbounded({
3070
3070
  replay: 1
3071
3071
  }), (pubsub) => {
3072
3072
  const self = Object.create(Proto);
3073
- self.semaphore = makeUnsafe3(1);
3073
+ self.semaphore = makeUnsafe2(1);
3074
3074
  self.value = value;
3075
3075
  self.pubsub = pubsub;
3076
3076
  publishUnsafe(self.pubsub, value);
@@ -3100,7 +3100,7 @@ var configLockPolls = 2 * configLockStaleMs / configLockPollMs;
3100
3100
  var recordAttempts = 3;
3101
3101
  var writePermits = new Map;
3102
3102
  var trustClaudeWorkspace = (home, workspace) => {
3103
- const permit = writePermits.get(home) ?? makeUnsafe3(1);
3103
+ const permit = writePermits.get(home) ?? makeUnsafe2(1);
3104
3104
  writePermits.set(home, permit);
3105
3105
  return permit.withPermits(1)(trust(home, workspace));
3106
3106
  };
@@ -3135,7 +3135,7 @@ var projectOf = (config, workspace) => {
3135
3135
  const project = isJsonObject(projects[workspace]) ? projects[workspace] : {};
3136
3136
  return { projects, project };
3137
3137
  };
3138
- var isTrusted = (file, workspace) => map8(readConfig(file), (config) => isSome(config) ? projectOf(config.value, workspace).project.hasTrustDialogAccepted === true : false);
3138
+ var isTrusted = (file, workspace) => map7(readConfig(file), (config) => isSome(config) ? projectOf(config.value, workspace).project.hasTrustDialogAccepted === true : false);
3139
3139
  var holdConfigLock = (file) => gen(function* () {
3140
3140
  const fs = yield* FileSystem;
3141
3141
  const lock = `${file}.lock`;
@@ -3334,7 +3334,7 @@ class ContainerError extends TaggedError("ContainerError") {
3334
3334
  class SecretProxyUnreachable extends TaggedError("SecretProxyUnreachable") {
3335
3335
  }
3336
3336
  var imagePull = { timeout: "30 minutes" };
3337
- var dockerContainerRunner = map8(ChildProcessSpawner, (spawner) => {
3337
+ var dockerContainerRunner = map7(ChildProcessSpawner, (spawner) => {
3338
3338
  const docker = (args, options = {}) => runCommand2("docker", args, options).pipe(mapError2((error) => new ContainerError({ message: error.message })), provideService(ChildProcessSpawner, spawner));
3339
3339
  const labelArgs = (labels) => labels.flatMap(([key, value]) => ["--label", `${key}=${value}`]);
3340
3340
  const ids = (output) => output.split(`
@@ -3608,19 +3608,19 @@ var openSession = (file) => gen(function* () {
3608
3608
  }
3609
3609
  return { handle, size: Number(opened.size) };
3610
3610
  });
3611
- var readAt = (handle, position, length) => map8(tryPromise(() => handle.read(new Uint8Array(length), 0, length, position)), ({ buffer, bytesRead }) => buffer.subarray(0, bytesRead));
3611
+ var readAt = (handle, position, length) => map7(tryPromise(() => handle.read(new Uint8Array(length), 0, length, position)), ({ buffer, bytesRead }) => buffer.subarray(0, bytesRead));
3612
3612
  var readSessionRange = (file, position, length) => gen(function* () {
3613
3613
  const { handle, size } = yield* openSession(file);
3614
3614
  return yield* readAt(handle, position, Math.max(0, Math.min(length, size - position)));
3615
3615
  }).pipe(scoped);
3616
- var sessionFileSize = (file) => map8(openSession(file), ({ size }) => size).pipe(scoped);
3616
+ var sessionFileSize = (file) => map7(openSession(file), ({ size }) => size).pipe(scoped);
3617
3617
  var maxSubagentFiles = 1024;
3618
3618
  var subagentFiles = (file) => gen(function* () {
3619
3619
  const fs = yield* FileSystem;
3620
3620
  if (file.subagents === undefined)
3621
3621
  return [];
3622
3622
  const found = yield* sessionFiles(file.subagents, 0, file.confinedTo);
3623
- return yield* forEach(found.slice(0, maxSubagentFiles), (path) => fs.stat(path).pipe(map8((info) => {
3623
+ return yield* forEach(found.slice(0, maxSubagentFiles), (path) => fs.stat(path).pipe(map7((info) => {
3624
3624
  const modifiedAt = getOrUndefined(info.mtime)?.getTime();
3625
3625
  return { path, size: Number(info.size), ...modifiedAt === undefined ? undefined : { modifiedAt } };
3626
3626
  }), orElseSucceed(() => ({ path, size: 0 }))));
@@ -3654,7 +3654,7 @@ var packConfined = (file, root) => gen(function* () {
3654
3654
  }
3655
3655
  return packed;
3656
3656
  }).pipe(scoped);
3657
- var packSession = (file) => file.confinedTo === undefined ? flatMap3(FileSystem, (fs) => fs.readFile(file.path)).pipe(flatMap3((content) => tryPromise(() => gzipped(content))), map8((content) => new Uint8Array(content))) : packConfined(file, file.confinedTo);
3657
+ var packSession = (file) => file.confinedTo === undefined ? flatMap3(FileSystem, (fs) => fs.readFile(file.path)).pipe(flatMap3((content) => tryPromise(() => gzipped(content))), map7((content) => new Uint8Array(content))) : packConfined(file, file.confinedTo);
3658
3658
  var restoreSession = (adapter, place) => gen(function* () {
3659
3659
  const fs = yield* FileSystem;
3660
3660
  const location = adapter.session?.location;
@@ -3773,16 +3773,16 @@ var stepProcessEnvironment = (runnerId, attemptId, outer = process.env) => ({
3773
3773
  var lists = (value, id) => value.split(listSeparator).includes(id);
3774
3774
  var signalProcess = (pid, signal) => ignore(try_2(() => process.kill(pid, signal)));
3775
3775
  var signalled = (pid) => try_2(() => process.kill(pid, 0)).pipe(as(true), catch_((error) => succeed6(hasProperty(error.cause, "code") && error.cause.code === "EPERM")));
3776
- var procCommand = (fs, pid) => map8(fs.readFile(`/proc/${pid}/cmdline`).pipe(orElseSucceed(() => new Uint8Array)), commandLine);
3777
- var procProcessTable = map8(FileSystem, (fs) => ({
3776
+ var procCommand = (fs, pid) => map7(fs.readFile(`/proc/${pid}/cmdline`).pipe(orElseSucceed(() => new Uint8Array)), commandLine);
3777
+ var procProcessTable = map7(FileSystem, (fs) => ({
3778
3778
  marked: ({ name, value }) => gen(function* () {
3779
3779
  const prefix = `${name}=`;
3780
3780
  const pids = (yield* fs.readDirectory("/proc").pipe(orElseSucceed(() => []))).filter((pid) => /^\d+$/.test(pid));
3781
- const found = yield* forEach(pids, (pid) => fs.readFile(`/proc/${pid}/environ`).pipe(flatMap3((environ) => environEntries(environ).some((entry) => entry.startsWith(prefix) && lists(entry.slice(prefix.length), value)) ? map8(procCommand(fs, Number(pid)), (command) => [{ pid: Number(pid), command }]) : succeed6([])), orElseSucceed(() => [])), { concurrency: 16 });
3781
+ const found = yield* forEach(pids, (pid) => fs.readFile(`/proc/${pid}/environ`).pipe(flatMap3((environ) => environEntries(environ).some((entry) => entry.startsWith(prefix) && lists(entry.slice(prefix.length), value)) ? map7(procCommand(fs, Number(pid)), (command) => [{ pid: Number(pid), command }]) : succeed6([])), orElseSucceed(() => [])), { concurrency: 16 });
3782
3782
  return found.flat();
3783
3783
  }),
3784
3784
  signal: signalProcess,
3785
- alive: (pid) => fs.readFileString(`/proc/${pid}/stat`).pipe(map8((stat) => !/^[ZX]/.test(stat.slice(stat.lastIndexOf(")") + 2))), orElseSucceed(() => false))
3785
+ alive: (pid) => fs.readFileString(`/proc/${pid}/stat`).pipe(map7((stat) => !/^[ZX]/.test(stat.slice(stat.lastIndexOf(")") + 2))), orElseSucceed(() => false))
3786
3786
  }));
3787
3787
  var environEntries = (environ) => new TextDecoder().decode(environ).split("\x00");
3788
3788
  var commandLine = (cmdline) => new TextDecoder().decode(cmdline).split("\x00").filter((part) => part !== "").join(" ");
@@ -3791,10 +3791,10 @@ var psRows = (listed) => listed.split(`
3791
3791
  const matched = /^\s*(\d+)\s+(.*)$/.exec(line);
3792
3792
  return matched === null ? [] : [{ pid: Number(matched[1]), text: matched[2] ?? "" }];
3793
3793
  });
3794
- var psProcessTable = map8(ChildProcessSpawner, (spawner) => {
3794
+ var psProcessTable = map7(ChildProcessSpawner, (spawner) => {
3795
3795
  const ps = (args) => runCommand2("ps", [...args, "-ww", "-U", String(process.getuid?.() ?? ""), "-o", "pid=,command="], {
3796
3796
  timeout: "30 seconds"
3797
- }).pipe(provideService(ChildProcessSpawner, spawner), map8(psRows));
3797
+ }).pipe(provideService(ChildProcessSpawner, spawner), map7(psRows));
3798
3798
  return {
3799
3799
  marked: ({ name, value }) => gen(function* () {
3800
3800
  const entry = ` ${name}=`;
@@ -3820,7 +3820,7 @@ var psProcessTable = map8(ChildProcessSpawner, (spawner) => {
3820
3820
  var systemProcessTable = process.platform === "linux" ? procProcessTable : psProcessTable;
3821
3821
  var unitPart = (id) => id.replaceAll(/[^A-Za-z0-9-]/g, (char) => `_${char.charCodeAt(0).toString(16)}`);
3822
3822
  var unitPrefix = (runnerId, attemptId) => `kitman-step-${unitPart(runnerId)}.${attemptId === undefined ? "" : `${unitPart(attemptId)}.`}`;
3823
- var unitSuffix = SecureRandom.pipe(flatMap3((random) => random.uuidV4()), map8((uuid) => uuid.slice(0, 8)), provide3(layerWebCrypto));
3823
+ var unitSuffix = SecureRandom.pipe(flatMap3((random) => random.uuidV4()), map7((uuid) => uuid.slice(0, 8)), provide3(layerWebCrypto));
3824
3824
  var busVariables = ["XDG_RUNTIME_DIR", "DBUS_SESSION_BUS_ADDRESS"];
3825
3825
  var systemdScopes = gen(function* () {
3826
3826
  if (process.platform !== "linux")
@@ -3840,7 +3840,7 @@ var systemdScopes = gen(function* () {
3840
3840
  `).filter((pid) => /^\d+$/.test(pid))).map(Number);
3841
3841
  });
3842
3842
  return {
3843
- contain: (runnerId, attemptId, argv) => map8(unitSuffix, (suffix) => {
3843
+ contain: (runnerId, attemptId, argv) => map7(unitSuffix, (suffix) => {
3844
3844
  const unit = `${unitPrefix(runnerId, attemptId)}${suffix}.scope`;
3845
3845
  const scoped = [
3846
3846
  "systemd-run",
@@ -3867,7 +3867,7 @@ var systemdScopes = gen(function* () {
3867
3867
  ])).split(`
3868
3868
  `).flatMap((line) => line.trim().split(/\s+/)[0] ?? []).filter((unit) => unit.endsWith(".scope"));
3869
3869
  const pids = yield* forEach(units, (unit) => flatMap3(systemd("systemctl", ["--user", "show", "--property=ControlGroup", "--value", unit]), (cgroup) => cgroup.trim() === "" ? succeed6([]) : cgroupProcesses(cgroup.trim())));
3870
- return yield* forEach([...new Set(pids.flat())], (pid) => map8(procCommand(fs, pid), (command) => ({ pid, command })));
3870
+ return yield* forEach([...new Set(pids.flat())], (pid) => map7(procCommand(fs, pid), (command) => ({ pid, command })));
3871
3871
  }).pipe(orElseSucceed(() => []))
3872
3872
  };
3873
3873
  });
@@ -3877,7 +3877,7 @@ var makeStepProcesses = (table, options = {}) => {
3877
3877
  const { scopes } = options;
3878
3878
  const unreaped = new Map;
3879
3879
  const pollMs = options.pollMs ?? 50;
3880
- const finding = (marker, scoped) => map8(all3([table.marked(marker), scoped]), ([marked, inScopes]) => {
3880
+ const finding = (marker, scoped) => map7(all3([table.marked(marker), scoped]), ([marked, inScopes]) => {
3881
3881
  const found = new Map([...marked, ...inScopes].map((candidate) => [candidate.pid, candidate]));
3882
3882
  found.delete(process.pid);
3883
3883
  return [...found.values()];
@@ -3965,7 +3965,7 @@ var stepProcessesUncontained = (input) => {
3965
3965
 
3966
3966
  class StepProcesses extends Service2()("StepProcesses") {
3967
3967
  }
3968
- var stepProcessesLayer = effect(StepProcesses, map8(systemProcessTable, (table) => makeStepProcesses(table)));
3968
+ var stepProcessesLayer = effect(StepProcesses, map7(systemProcessTable, (table) => makeStepProcesses(table)));
3969
3969
  var systemStepProcessesLayer = effect(StepProcesses, gen(function* () {
3970
3970
  const table = yield* systemProcessTable;
3971
3971
  return makeStepProcesses(table, { scopes: yield* systemdScopes });
@@ -4075,9 +4075,9 @@ var lastingStop = (input) => gen(function* () {
4075
4075
  const watch = gen(function* () {
4076
4076
  while (true) {
4077
4077
  const stopped = yield* raceAllFirst([
4078
- map8(until(input.seen, (last) => last.end !== undefined || last.turn > input.promptTurn && !["blocked", "working", "error"].includes(last.status ?? "")), (seen) => signalled2(seen.end === undefined ? "turn_ended" : "terminal_ended")(seen)),
4079
- map8(lastingStatus(input.seen, "blocked", input.blockedGraceMs), signalled2("blocked")),
4080
- map8(lastingStatus(input.seen, "error", input.idleGraceMs), signalled2("error"))
4078
+ map7(until(input.seen, (last) => last.end !== undefined || last.turn > input.promptTurn && !["blocked", "working", "error"].includes(last.status ?? "")), (seen) => signalled2(seen.end === undefined ? "turn_ended" : "terminal_ended")(seen)),
4079
+ map7(lastingStatus(input.seen, "blocked", input.blockedGraceMs), signalled2("blocked")),
4080
+ map7(lastingStatus(input.seen, "error", input.idleGraceMs), signalled2("error"))
4081
4081
  ]);
4082
4082
  if (stopped.signal !== "turn_ended" || (yield* input.outputSubmitted))
4083
4083
  return stopped;
@@ -4281,7 +4281,7 @@ var runAttempt = (request, options) => gen(function* () {
4281
4281
  env: {},
4282
4282
  command: ["sh", "-c", 'p=$(command -v -- "$1") && [ -f "$p" ] && [ -x "$p" ]', "sh", command],
4283
4283
  timeout: "30 seconds"
4284
- }).pipe(map8((result) => result.exitCode === 0), mapError2(() => unavailable)));
4284
+ }).pipe(map7((result) => result.exitCode === 0), mapError2(() => unavailable)));
4285
4285
  const env = { ...policy.environment, ...marker };
4286
4286
  return { argv: dockerExecArgv({ container, workspace, env, argv: harnessArgv }), env, registry };
4287
4287
  }
@@ -4342,7 +4342,7 @@ var runAttempt = (request, options) => gen(function* () {
4342
4342
  });
4343
4343
  let accepted = false;
4344
4344
  const outputSubmitted = suspend3(() => accepted ? succeed6(true) : request.settled.pipe(orElseSucceed(() => false), tap2((settled) => sync2(() => accepted ||= settled))));
4345
- const readScreen = map8(option2(call((connection) => connection.read(address))), (screen) => isSome(screen) ? redactCredentials(screen.value).trim() : "");
4345
+ const readScreen = map7(option2(call((connection) => connection.read(address))), (screen) => isSome(screen) ? redactCredentials(screen.value).trim() : "");
4346
4346
  const judge = (last) => gen(function* () {
4347
4347
  if (yield* outputSubmitted)
4348
4348
  return { status: "settled" };
@@ -4384,7 +4384,7 @@ var runAttempt = (request, options) => gen(function* () {
4384
4384
  const brief = firstMessage(request.launch, workspace, launch.systemBrief === true);
4385
4385
  const readyTurn = ready.value.turn;
4386
4386
  const deliver = (tries) => gen(function* () {
4387
- const sent = yield* result(call((connection) => map8(connection.send(address, brief), (reply) => ({ turn: reply.turn, lost: false })), () => succeed6({ turn: readyTurn, lost: true })));
4387
+ const sent = yield* result(call((connection) => map7(connection.send(address, brief), (reply) => ({ turn: reply.turn, lost: false })), () => succeed6({ turn: readyTurn, lost: true })));
4388
4388
  if (isFailure(sent) || sent.success.lost || tries <= 1)
4389
4389
  return sent;
4390
4390
  const taken = yield* until(seen, stirredSince(sent.success.turn)).pipe(timeoutOption(options.briefAckMs));
@@ -4474,7 +4474,7 @@ var herdrCoreAgentBackendLayer = (options) => effect(AgentBackend, gen(function*
4474
4474
  });
4475
4475
  }));
4476
4476
  // packages/agent-runtime/src/sandbox-host.ts
4477
- var installed = (probe, command, label) => map8(probe("sh", ["-c", `command -v ${command}`]), (found) => found ? [] : [`${label} is not installed`]);
4477
+ var installed = (probe, command, label) => map7(probe("sh", ["-c", `command -v ${command}`]), (found) => found ? [] : [`${label} is not installed`]);
4478
4478
  var srtMissing = (probe, platform) => gen(function* () {
4479
4479
  if (platform === "darwin")
4480
4480
  return [
@@ -4496,7 +4496,7 @@ var srtMissing = (probe, platform) => gen(function* () {
4496
4496
  "unprivileged user namespaces are not allowed (on Ubuntu: sysctl kernel.apparmor_restrict_unprivileged_userns=0)"
4497
4497
  ];
4498
4498
  });
4499
- var dockerMissing = (probe, image) => map8(probe("docker", ["info"]), (reachable) => [
4499
+ var dockerMissing = (probe, image) => map7(probe("docker", ["info"]), (reachable) => [
4500
4500
  ...reachable ? [] : ["the docker daemon is not reachable"],
4501
4501
  ...image === undefined ? ["its settings name no Docker image"] : /@sha256:[a-f0-9]{64}$/.test(image) ? [] : ["its Docker image is not pinned by digest (image@sha256:...)"]
4502
4502
  ]);
@@ -4515,7 +4515,7 @@ var probeSandboxHost = (probe, platform = process.platform, options = {}) => gen
4515
4515
  ]
4516
4516
  };
4517
4517
  });
4518
- var commandHostProbe = map8(ChildProcessSpawner, (spawner) => (command, args) => runCommand2(command, args, { timeout: "10 seconds" }).pipe(as(true), orElseSucceed(() => false), provideService(ChildProcessSpawner, spawner)));
4518
+ var commandHostProbe = map7(ChildProcessSpawner, (spawner) => (command, args) => runCommand2(command, args, { timeout: "10 seconds" }).pipe(as(true), orElseSucceed(() => false), provideService(ChildProcessSpawner, spawner)));
4519
4519
  // packages/oversight/src/domain/intent.ts
4520
4520
  var ConstraintKind = Literals(["rule", "semantic"]);
4521
4521
  var ConstraintSeverity = Literals(["block", "warn"]);
@@ -4693,14 +4693,14 @@ var diffFlags = ["--no-color", "--no-ext-diff", "--no-textconv", "--no-renames",
4693
4693
  var catchUpReport = (worktree, input) => gen(function* () {
4694
4694
  const git = (...args) => runCommand2("git", ["-C", worktree, ...args]);
4695
4695
  const target = `origin/${input.target}`;
4696
- const names = (from, to) => map8(git("diff", "--name-only", "-z", "--no-renames", from, to), (out) => out.split("\x00").filter(Boolean));
4697
- const ownDiff = (base, head, path) => map8(git("diff", ...diffFlags, base, head, "--", `:(literal,top)${path}`), normalizedDiff);
4696
+ const names = (from, to) => map7(git("diff", "--name-only", "-z", "--no-renames", from, to), (out) => out.split("\x00").filter(Boolean));
4697
+ const ownDiff = (base, head, path) => map7(git("diff", ...diffFlags, base, head, "--", `:(literal,top)${path}`), normalizedDiff);
4698
4698
  const before = (yield* git("merge-base", input.from, target)).trim();
4699
4699
  const after = (yield* git("merge-base", input.head, target)).trim();
4700
4700
  const settled = input.automerged === undefined ? [] : (yield* names(input.automerged, input.merged)).filter((path) => !input.conflicted.includes(path));
4701
4701
  const rewritten = [...new Set([...settled, ...yield* names(input.merged, input.head)])].sort();
4702
4702
  const paths = [...new Set([...yield* names(before, input.from), ...yield* names(after, input.head)])].sort();
4703
- const changed = yield* filter3(paths.slice(0, catchUpPathLimit), (path) => map8(all3([ownDiff(before, input.from, path), ownDiff(after, input.head, path)]), ([was, is]) => was !== is), { concurrency: 8 });
4703
+ const changed = yield* filter3(paths.slice(0, catchUpPathLimit), (path) => map7(all3([ownDiff(before, input.from, path), ownDiff(after, input.head, path)]), ([was, is]) => was !== is), { concurrency: 8 });
4704
4704
  const lists = [input.conflicted, rewritten, paths];
4705
4705
  return {
4706
4706
  from: input.from,
@@ -4869,7 +4869,7 @@ var failedWhenUnrun = (label) => (execution) => {
4869
4869
  };
4870
4870
  var makeReplicaSignals = sync2(() => {
4871
4871
  let generation = 0;
4872
- let nextWork = makeUnsafe5();
4872
+ let nextWork = makeUnsafe4();
4873
4873
  const stops = new Map;
4874
4874
  const mailboxes = new Map;
4875
4875
  const mailboxFor = (workUnitId) => {
@@ -4879,8 +4879,8 @@ var makeReplicaSignals = sync2(() => {
4879
4879
  const created = {
4880
4880
  notes: [],
4881
4881
  seen: new Set,
4882
- arrived: makeUnsafe5(),
4883
- updated: makeUnsafe5()
4882
+ arrived: makeUnsafe4(),
4883
+ updated: makeUnsafe4()
4884
4884
  };
4885
4885
  mailboxes.set(workUnitId, created);
4886
4886
  return created;
@@ -4891,14 +4891,14 @@ var makeReplicaSignals = sync2(() => {
4891
4891
  if (note !== undefined)
4892
4892
  return succeed6(note);
4893
4893
  if (isDoneUnsafe(mailbox.arrived))
4894
- mailbox.arrived = makeUnsafe5();
4894
+ mailbox.arrived = makeUnsafe4();
4895
4895
  return andThen2(_await(mailbox.arrived), nextSteer(workUnitId));
4896
4896
  });
4897
4897
  const stopFor = (workUnitId) => {
4898
4898
  const existing = stops.get(workUnitId);
4899
4899
  if (existing !== undefined)
4900
4900
  return existing;
4901
- const created = makeUnsafe5();
4901
+ const created = makeUnsafe4();
4902
4902
  stops.set(workUnitId, created);
4903
4903
  return created;
4904
4904
  };
@@ -4910,7 +4910,7 @@ var makeReplicaSignals = sync2(() => {
4910
4910
  WorkAvailable: () => {
4911
4911
  generation += 1;
4912
4912
  const signalled = nextWork;
4913
- nextWork = makeUnsafe5();
4913
+ nextWork = makeUnsafe4();
4914
4914
  doneUnsafe(signalled, void_2);
4915
4915
  },
4916
4916
  LeaseRevoked: ({ workUnitId }) => stop(workUnitId, "lost"),
@@ -4943,7 +4943,7 @@ var makeReplicaSignals = sync2(() => {
4943
4943
  sessionUpdated: (workUnitId) => suspend3(() => {
4944
4944
  const mailbox = mailboxFor(workUnitId);
4945
4945
  return andThen2(_await(mailbox.updated), sync2(() => {
4946
- mailbox.updated = makeUnsafe5();
4946
+ mailbox.updated = makeUnsafe4();
4947
4947
  }));
4948
4948
  }),
4949
4949
  forget: (workUnitId) => sync2(() => {
@@ -5019,7 +5019,7 @@ var IdleRecheck = seconds(60);
5019
5019
  var idleBackoff = (idleIterations) => millis(Math.min(1000 * 2 ** idleIterations, 30000));
5020
5020
  function superviseReplica(input) {
5021
5021
  const { signals } = input;
5022
- const claimTurn = makeUnsafe3(1);
5022
+ const claimTurn = makeUnsafe2(1);
5023
5023
  let emptyAt = -1;
5024
5024
  const wokenControl = (control, signals) => ({
5025
5025
  ...control,
@@ -5617,7 +5617,7 @@ var transcriptRelay = (input) => {
5617
5617
  passOver(last);
5618
5618
  batchLimit = batchSize;
5619
5619
  };
5620
- const givesUp = (error, lastChance) => map8(currentTimeMillis, (now) => {
5620
+ const givesUp = (error, lastChance) => map7(currentTimeMillis, (now) => {
5621
5621
  if (lastChance || sendRefusal(error) === "refused")
5622
5622
  return true;
5623
5623
  failingSince ??= now;
@@ -5788,7 +5788,7 @@ var transcriptRelay = (input) => {
5788
5788
  });
5789
5789
  return {
5790
5790
  record,
5791
- stalledFor: (millis) => map8(currentTimeMillis, (now) => asking.size === 0 && progressAt !== undefined && now - progressAt >= millis),
5791
+ stalledFor: (millis) => map7(currentTimeMillis, (now) => asking.size === 0 && progressAt !== undefined && now - progressAt >= millis),
5792
5792
  asking: sync2(() => asking.size > 0),
5793
5793
  loginLost: sync2(() => loginLost),
5794
5794
  refusal: sync2(() => refusal),
@@ -5881,7 +5881,7 @@ var gitRemote = (repoBinding, credential) => {
5881
5881
  };
5882
5882
  var clonePermits = new Map;
5883
5883
  var inClone = (directory) => (effect) => {
5884
- const permit = clonePermits.get(directory) ?? makeUnsafe3(1);
5884
+ const permit = clonePermits.get(directory) ?? makeUnsafe2(1);
5885
5885
  clonePermits.set(directory, permit);
5886
5886
  return permit.withPermits(1)(effect);
5887
5887
  };
@@ -5889,7 +5889,7 @@ var repositoryClone = (rootDir, repoBindingId) => `${rootDir}/repos/${repoBindin
5889
5889
  var runCheckouts = (rootDir, credentials) => {
5890
5890
  const runsDir = `${rootDir}/runs`;
5891
5891
  const reposDir = `${rootDir}/repos`;
5892
- const remote = (repoBinding) => map8(credentials === undefined ? undefined_ : credentials(repoBinding.id).pipe(catch_((error) => as(logWarning("runner_git_credential_unavailable", error.message), undefined))), (credential) => gitRemote(repoBinding, credential));
5892
+ const remote = (repoBinding) => map7(credentials === undefined ? undefined_ : credentials(repoBinding.id).pipe(catch_((error) => as(logWarning("runner_git_credential_unavailable", error.message), undefined))), (credential) => gitRemote(repoBinding, credential));
5893
5893
  const cloned = (repoBinding) => gen(function* () {
5894
5894
  const fs = yield* FileSystem;
5895
5895
  const forbidden = findForbiddenRepoBindingSecretPath(repoBinding);
@@ -5916,9 +5916,9 @@ var runCheckouts = (rootDir, credentials) => {
5916
5916
  });
5917
5917
  const fetch = (directory, env) => runCommand2("git", ["-C", directory, ...stallLimit, "fetch", "--prune", "origin"], { ...transfer, env });
5918
5918
  const inCloneOf = (repoBinding) => inClone(repositoryClone(rootDir, repoBinding.id));
5919
- const clone = (repoBinding) => inCloneOf(repoBinding)(map8(cloned(repoBinding), ({ directory }) => directory));
5920
- const transferEnv = (repoBinding) => repoBinding === undefined ? succeed6({}) : map8(remote(repoBinding), ({ env }) => env);
5921
- const holds = (directory, revision) => revision === undefined || !/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/.test(revision) ? succeed6(false) : map8(exit(runCommand2("git", ["-C", directory, "cat-file", "-e", `${revision}^{commit}`])), isSuccess2);
5919
+ const clone = (repoBinding) => inCloneOf(repoBinding)(map7(cloned(repoBinding), ({ directory }) => directory));
5920
+ const transferEnv = (repoBinding) => repoBinding === undefined ? succeed6({}) : map7(remote(repoBinding), ({ env }) => env);
5921
+ const holds = (directory, revision) => revision === undefined || !/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/.test(revision) ? succeed6(false) : map7(exit(runCommand2("git", ["-C", directory, "cat-file", "-e", `${revision}^{commit}`])), isSuccess2);
5922
5922
  const checkout = (work, repoBinding, checkpoint) => gen(function* () {
5923
5923
  const fs = yield* FileSystem;
5924
5924
  const path = yield* Path;
@@ -5961,7 +5961,7 @@ var runCheckouts = (rootDir, credentials) => {
5961
5961
  const directory = `${rootDir}/scratch/${work.id}`;
5962
5962
  return yield* acquireRelease(as(fs.makeDirectory(directory, { recursive: true }), directory), () => ignore(fs.remove(directory, { recursive: true, force: true })));
5963
5963
  });
5964
- const reaches = (repoBinding) => flatMap3(remote(repoBinding), ({ url, env }) => map8(exit(runCommand2("git", [...stallLimit, "ls-remote", url, "HEAD"], { timeout: "1 minute", env })), isSuccess2));
5964
+ const reaches = (repoBinding) => flatMap3(remote(repoBinding), ({ url, env }) => map7(exit(runCommand2("git", [...stallLimit, "ls-remote", url, "HEAD"], { timeout: "1 minute", env })), isSuccess2));
5965
5965
  return {
5966
5966
  clone,
5967
5967
  transferEnv,
@@ -5990,7 +5990,7 @@ var clearSettledCheckpoints = (rpc, checkouts) => gen(function* () {
5990
5990
  var deleteRef = (checkouts, repoBinding, ref) => gen(function* () {
5991
5991
  const repository = yield* checkouts.clone(repoBinding);
5992
5992
  const env = yield* checkouts.transferEnv(repoBinding);
5993
- const onOrigin = map8(runCommand2("git", ["-C", repository, "ls-remote", "origin", ref], { env }), (listed) => listed.trim() !== "");
5993
+ const onOrigin = map7(runCommand2("git", ["-C", repository, "ls-remote", "origin", ref], { env }), (listed) => listed.trim() !== "");
5994
5994
  if (yield* onOrigin)
5995
5995
  yield* runCommand2("git", ["-C", repository, ...stallLimit, "push", "origin", "--delete", ref], {
5996
5996
  ...transfer,
@@ -6029,7 +6029,7 @@ var runChange = (worktree, runBase) => gen(function* () {
6029
6029
  const git = (...args) => runCommand2("git", ["-C", worktree, ...args]);
6030
6030
  const base = (yield* git("merge-base", "HEAD", runBase)).trim();
6031
6031
  const changedPaths = (yield* git("diff", "--name-only", "-z", "--no-renames", base, "HEAD")).split("\x00").filter((path) => path !== "");
6032
- const files = yield* forEach(changedPaths.slice(0, EvidenceLimits.files).filter((path) => !looksSecret(path)), (path) => map8(git("diff", "--no-color", "--no-renames", base, "HEAD", "--", `:(literal)${path}`), (diff) => ({
6032
+ const files = yield* forEach(changedPaths.slice(0, EvidenceLimits.files).filter((path) => !looksSecret(path)), (path) => map7(git("diff", "--no-color", "--no-renames", base, "HEAD", "--", `:(literal)${path}`), (diff) => ({
6033
6033
  path,
6034
6034
  diff
6035
6035
  })));
@@ -6048,7 +6048,7 @@ var keepSession = (rpc, lease, content) => gen(function* () {
6048
6048
  yield* fs.writeFile(path, content);
6049
6049
  const files = {
6050
6050
  createRunFile: ({ byteSize, sha256 }) => rpc.createCheckpointFile({ lease, byteSize, sha256 }),
6051
- runFileParts: (request) => map8(rpc.checkpointFileParts({ lease, ...request, partNumbers: [...request.partNumbers] }), ({ parts }) => parts),
6051
+ runFileParts: (request) => map7(rpc.checkpointFileParts({ lease, ...request, partNumbers: [...request.partNumbers] }), ({ parts }) => parts),
6052
6052
  completeRunFile: ({ parts, ...request }) => rpc.completeCheckpointFile({ lease, ...request, ...parts === undefined ? undefined : { parts: [...parts] } })
6053
6053
  };
6054
6054
  const kept = yield* uploadRunFile(files, { step: "", name: "session.gz", path });
@@ -6096,7 +6096,7 @@ var stageAll = (worktree, git) => gen(function* () {
6096
6096
  yield* git("add", "--all", "--", ".", ...leftovers.map((name) => `:(exclude,top)${name}`));
6097
6097
  });
6098
6098
  var conflictMarker = "^(<<<<<<<|>>>>>>>)( |$)";
6099
- var markedPaths = (git, paths, ...from) => git("grep", ...from, "-l", "-z", "-E", conflictMarker, "--", ...paths.map((path) => `:(literal,top)${path}`)).pipe(catchIf((error) => error.reason === "exit code 1", () => succeed6("")), map8((out) => out.split("\x00").filter(Boolean)));
6099
+ var markedPaths = (git, paths, ...from) => git("grep", ...from, "-l", "-z", "-E", conflictMarker, "--", ...paths.map((path) => `:(literal,top)${path}`)).pipe(catchIf((error) => error.reason === "exit code 1", () => succeed6("")), map7((out) => out.split("\x00").filter(Boolean)));
6100
6100
  var list = (paths) => paths.join(", ");
6101
6101
  var unmarkedConflicts = (worktree, conflicted, marked) => gen(function* () {
6102
6102
  const stages = new Map;
@@ -6133,7 +6133,7 @@ var automergedTree = (worktree, conflicted) => gen(function* () {
6133
6133
  const scratchIndex = `${index}.kitman-automerged`;
6134
6134
  const git = (...args) => runCommand2("git", ["-C", worktree, ...args], { env: { GIT_INDEX_FILE: scratchIndex } });
6135
6135
  yield* fs.copyFile(index, scratchIndex);
6136
- return yield* ensuring2(andThen2(git("update-index", "--force-remove", "--", ...conflicted), map8(git("write-tree"), (tree) => tree.trim())), ignore(fs.remove(scratchIndex)));
6136
+ return yield* ensuring2(andThen2(git("update-index", "--force-remove", "--", ...conflicted), map7(git("write-tree"), (tree) => tree.trim())), ignore(fs.remove(scratchIndex)));
6137
6137
  });
6138
6138
  var mergeTarget = (worktree, target) => gen(function* () {
6139
6139
  const git = (...args) => runCommand2("git", ["-C", worktree, ...gitIdentity, ...args]);
@@ -6274,7 +6274,7 @@ var stepAttempt = (input, resending) => (work) => gen(function* () {
6274
6274
  };
6275
6275
  const sessionId = transcript !== undefined || adapter?.session?.start !== undefined ? session.id : undefined;
6276
6276
  let last = saved?.ref === checkpointRef(work) ? saved : {};
6277
- const checkpointTurn = makeUnsafe3(1);
6277
+ const checkpointTurn = makeUnsafe2(1);
6278
6278
  const takeCheckpoint = gen(function* () {
6279
6279
  if (input.checkpoints === undefined)
6280
6280
  return;
@@ -6366,7 +6366,7 @@ var stepAttempt = (input, resending) => (work) => gen(function* () {
6366
6366
  ...refusal.until === undefined ? undefined : { until: refusal.until },
6367
6367
  ...backend === "docker" ? { scope: "step" } : undefined
6368
6368
  });
6369
- const outputSubmitted = input.heartbeat(work).pipe(option2, map8((state) => isSome(state) && state.value.outputSubmitted === true));
6369
+ const outputSubmitted = input.heartbeat(work).pipe(option2, map7((state) => isSome(state) && state.value.outputSubmitted === true));
6370
6370
  const providerRefused = relay === undefined ? never : gen(function* () {
6371
6371
  for (;; ) {
6372
6372
  yield* sleep("1 second");
@@ -6418,7 +6418,7 @@ var stepAttempt = (input, resending) => (work) => gen(function* () {
6418
6418
  tokens = spentNow;
6419
6419
  input.spending?.set(work.id, spentNow);
6420
6420
  yield* andThen2(relay.record([{ kind: "lifecycle", state }]), relay.lastFlush).pipe(timeout("5 seconds"), ignore);
6421
- const sending = yield* forkIn(relay.sendRest, input.runnerScope ?? makeUnsafe6());
6421
+ const sending = yield* forkIn(relay.sendRest, input.runnerScope ?? makeUnsafe5());
6422
6422
  resending.set(work.id, sending);
6423
6423
  if (state !== "parked")
6424
6424
  sending.addObserver(() => resending.delete(work.id));
@@ -7060,7 +7060,7 @@ var codexAppServer = (binary = "codex") => (env) => gen(function* () {
7060
7060
  return {
7061
7061
  request: (method, params) => gen(function* () {
7062
7062
  const id = ++lastId;
7063
- const deferred = yield* make16();
7063
+ const deferred = yield* make15();
7064
7064
  pending.set(id, deferred);
7065
7065
  yield* send({ id, method, params });
7066
7066
  return yield* _await(deferred).pipe(mapError2((error) => new CodexAppServerFailed({ reason: `${method}: ${error.message}` })));
@@ -7161,7 +7161,7 @@ function composeAgentEnvironmentSyncPlan(targets) {
7161
7161
  }
7162
7162
  var updateHarness = (argv) => gen(function* () {
7163
7163
  const run = yield* CommandRunner2;
7164
- const failure = yield* run(argv).pipe(map8((result) => result.exitCode === 0 ? undefined : result.output.trim().split(`
7164
+ const failure = yield* run(argv).pipe(map7((result) => result.exitCode === 0 ? undefined : result.output.trim().split(`
7165
7165
  `).at(-1) ?? `exit code ${result.exitCode}`), catch_((error) => succeed6(error.message)));
7166
7166
  return failure === undefined ? [] : [`Kitman could not update ${argv[0]} with \`${argv.join(" ")}\`: ${failure}`];
7167
7167
  });
@@ -7174,10 +7174,10 @@ var applyAgentEnvironmentPlans = fnUntraced(function* (plan) {
7174
7174
  const updateWarnings = yield* forEach(plan.targets, (target) => target.harnessUpdater === undefined ? succeed6([]) : updateHarness(target.harnessUpdater));
7175
7175
  for (const target of plan.targets)
7176
7176
  yield* applyAgentEnvironmentConfigSync(target.harnessConfig).pipe(mapError2((cause) => new AgentEnvironmentPlanApplyError({ phase: "harness_config", cause })));
7177
- const targets = yield* forEach(plan.targets, (target, index) => map8(target.skills.codexHookTrust === undefined ? succeed6([]) : trustCodexPluginHooks({
7177
+ const targets = yield* forEach(plan.targets, (target, index) => map7(target.skills.codexHookTrust === undefined ? succeed6([]) : trustCodexPluginHooks({
7178
7178
  ...target.skills.codexHookTrust,
7179
7179
  plugins: target.skills.materializedPlugins.map((plugin) => plugin.name)
7180
- }), (trustWarnings) => [...updateWarnings[index] ?? [], ...trustWarnings]).pipe(map8((warnings) => ({
7180
+ }), (trustWarnings) => [...updateWarnings[index] ?? [], ...trustWarnings]).pipe(map7((warnings) => ({
7181
7181
  ...target,
7182
7182
  skills: { ...target.skills, warnings: [...target.skills.warnings, ...warnings.map((message) => ({ message }))] },
7183
7183
  warnings: [...target.warnings, ...warnings]
@@ -7203,7 +7203,7 @@ var kitmanMcpPreflight = (mcp) => gen(function* () {
7203
7203
  const server = yield* spawner.spawn(make3(mcp.command, [...mcp.args], {
7204
7204
  extendEnv: true,
7205
7205
  env: mcp.env,
7206
- stdin: { stream: make11(new TextEncoder().encode(handshake)), endOnDone: false },
7206
+ stdin: { stream: make10(new TextEncoder().encode(handshake)), endOnDone: false },
7207
7207
  stderr: "ignore"
7208
7208
  }));
7209
7209
  const reply = yield* server.stdout.pipe(decodeText, splitLines, map2((line) => getOrUndefined(decodeJsonStringOption(line))), filter((message) => isJsonObject(message) && message.id === 2), runHead);
@@ -7265,7 +7265,7 @@ var programProcessExecutor = (input) => (work) => gen(function* () {
7265
7265
  storageOrigin: work.storageOrigin,
7266
7266
  network: work.network
7267
7267
  });
7268
- const inherited = (yield* forEach(inheritedEnv, (name) => map8(optionalEnv(name), (value) => value === undefined ? [] : [[name, value]]))).flat();
7268
+ const inherited = (yield* forEach(inheritedEnv, (name) => map7(optionalEnv(name), (value) => value === undefined ? [] : [[name, value]]))).flat();
7269
7269
  const programEnv = {
7270
7270
  BUN_BE_BUN: "1",
7271
7271
  KITMAN_LOOP_ID: program.loopId,
@@ -7277,7 +7277,7 @@ var programProcessExecutor = (input) => (work) => gen(function* () {
7277
7277
  const exitCode = sandbox === undefined ? yield* gen(function* () {
7278
7278
  const spawner = yield* ChildProcessSpawner;
7279
7279
  const handle = yield* spawner.spawn(make3(input.bun ?? process.execPath, [file], {
7280
- stdin: make11(new TextEncoder().encode(stdin)),
7280
+ stdin: make10(new TextEncoder().encode(stdin)),
7281
7281
  stdout: "inherit",
7282
7282
  stderr: "inherit",
7283
7283
  extendEnv: false,
@@ -7356,9 +7356,9 @@ var statusOfExit = (exitCode, output) => {
7356
7356
  return "failed";
7357
7357
  }
7358
7358
  };
7359
- var executableAt = (checkout, revision) => map8(runCommand2("git", ["-C", checkout, "ls-tree", "--end-of-options", revision, "--", deployScript]), (listed) => listed.startsWith("100755 "));
7359
+ var executableAt = (checkout, revision) => map7(runCommand2("git", ["-C", checkout, "ls-tree", "--end-of-options", revision, "--", deployScript]), (listed) => listed.startsWith("100755 "));
7360
7360
  var tagCommit = (checkout, tagRef) => exit(runCommand2("git", ["-C", checkout, "rev-parse", "--verify", "--quiet", "--end-of-options", `${tagRef}^{commit}`]));
7361
- var headOf = (checkout) => map8(all3([
7361
+ var headOf = (checkout) => map7(all3([
7362
7362
  runCommand2("git", ["-C", checkout, "rev-parse", "HEAD"]),
7363
7363
  runCommand2("git", ["-C", checkout, "rev-parse", "HEAD^{tree}"])
7364
7364
  ]), ([revision, tree]) => ({ revision: revision.trim(), tree: tree.trim(), checks: [] }));
@@ -7629,7 +7629,7 @@ var redactedCopy = (from, to) => gen(function* () {
7629
7629
  var checkFileKeeper = (work, runFiles, storage) => {
7630
7630
  const files = rpcRunFiles(runFiles, programLease(work));
7631
7631
  let left = checkFilesPerVerification;
7632
- const keep = (name, path) => uploadRunFile(files, { step: work.stepKey, name, path }).pipe(provideService(HttpClient, storage), map8((file) => file.status === "available" ? [file.id] : []), catch_((error) => as(logWarning("check_run_file_not_kept", `${name}: ${error.message}`), [])));
7632
+ const keep = (name, path) => uploadRunFile(files, { step: work.stepKey, name, path }).pipe(provideService(HttpClient, storage), map7((file) => file.status === "available" ? [file.id] : []), catch_((error) => as(logWarning("check_run_file_not_kept", `${name}: ${error.message}`), [])));
7633
7633
  return (input) => gen(function* () {
7634
7634
  const path = yield* Path;
7635
7635
  const log = `${input.output}.log`;
@@ -7644,7 +7644,7 @@ var reportedTests = (filesDir) => gen(function* () {
7644
7644
  const fs = yield* FileSystem;
7645
7645
  const path = yield* Path;
7646
7646
  const names = (yield* regularFiles(filesDir)).filter(isTestReportName);
7647
- const reports = yield* forEach(names, (name) => fs.readFileString(path.join(filesDir, name)).pipe(map8((text) => [text]), orElseSucceed(() => [])));
7647
+ const reports = yield* forEach(names, (name) => fs.readFileString(path.join(filesDir, name)).pipe(map7((text) => [text]), orElseSucceed(() => [])));
7648
7648
  return checkTests(reports.flat());
7649
7649
  }).pipe(orElseSucceed(() => checkTests([])));
7650
7650
 
@@ -7787,7 +7787,7 @@ var unresolvedDependencies = (worktree) => gen(function* () {
7787
7787
  }).pipe(orElseSucceed(() => {
7788
7788
  return;
7789
7789
  }));
7790
- const manifestAt = (dir) => fs.readFileString(path.join(dir, "package.json")).pipe(map8((text) => getOrUndefined(decodeJsonStringOption(text))), orElseSucceed(() => {
7790
+ const manifestAt = (dir) => fs.readFileString(path.join(dir, "package.json")).pipe(map7((text) => getOrUndefined(decodeJsonStringOption(text))), orElseSucceed(() => {
7791
7791
  return;
7792
7792
  }));
7793
7793
  const unresolved = [];
@@ -8014,7 +8014,7 @@ var resolveRevisions = (work, revisions, checkouts) => gen(function* () {
8014
8014
  };
8015
8015
  return resolved;
8016
8016
  });
8017
- var treeOf = (worktree) => map8(runCommand2("git", ["-C", worktree, "rev-parse", "HEAD^{tree}"]), (tree) => tree.trim());
8017
+ var treeOf = (worktree) => map7(runCommand2("git", ["-C", worktree, "rev-parse", "HEAD^{tree}"]), (tree) => tree.trim());
8018
8018
  var verificationExecutor = (input) => (work) => gen(function* () {
8019
8019
  if (input.sandbox !== undefined && input.sandbox.backend === undefined)
8020
8020
  return {