@kitman-sh/cli 0.11.2 → 0.11.4

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.
@@ -248,6 +248,15 @@ var makeEquivalence = (equivalence) => {
248
248
  return (self, that) => is(self, that) && is(that, self);
249
249
  };
250
250
 
251
+ // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/BigInt.js
252
+ var BigInt2 = globalThis.BigInt;
253
+ var toNumber = (b) => {
254
+ if (b > BigInt2(Number.MAX_SAFE_INTEGER) || b < BigInt2(Number.MIN_SAFE_INTEGER)) {
255
+ return none();
256
+ }
257
+ return some(Number(b));
258
+ };
259
+
251
260
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/ByteSize.js
252
261
  var bigint0 = /* @__PURE__ */ BigInt(0);
253
262
  var bigint1 = /* @__PURE__ */ BigInt(1);
@@ -3552,4 +3561,4 @@ var srtArgv2 = (srtCommand, settingsFile, argv) => [
3552
3561
  ...argv
3553
3562
  ];
3554
3563
 
3555
- export { map, makeEquivalence, bytes, join, interrupt, getCurrent, BadArgument, systemError, badArgument, makeUnsafe2, make8, unbounded, publishUnsafe, make9, bounded, sliding, unbounded2, offer, offerUnsafe, offerAll, fail, failCause, failCauseUnsafe, end, endUnsafe, shutdownUnsafe, take, poll, makeUnsafe3, fromTransform, mapDone, isSink, fromChannel, drain, make10, get3, isStream, fromChannel2, callback, empty2, make11, suspend, fail2, fromQueue, fromPubSub, fromReadableStream, unwrap, map2, tap, drainFork, concat, merge2, filter, catchCause, tapError, mapError, transduce, decodeText, encodeText, splitLines, interruptWhen, ensuring, provideContext, run, runCollect, runFold, runHead, runForEach, runDrain, mkString, mkArrayBuffer, toReadableStreamEffect, FileSystem, make12, FileTypeId, WatchBackend, Path, make13, embeddedFile, extractEmbeddedFile, map3, all, withDefault, option, String2, optionalEnv, operatorConfigHome, harnessesUnsupportedInSrt2, compiled2, pinnedSrtCommand2, pinnedSrtStepCommand2, runSrtCli2, kitmanCacheDirectory2, srtSettings2, srtCacheEnvironment2, srtInheritedEnv2, inheritedEnvironment2, withOnlyEnvironment2, writeSrtSettings2, srtStepArgv2, srtArgv2 };
3564
+ export { map, makeEquivalence, toNumber, bytes, join, interrupt, getCurrent, BadArgument, systemError, badArgument, makeUnsafe2, make8, unbounded, publishUnsafe, make9, bounded, sliding, unbounded2, offer, offerUnsafe, offerAll, fail, failCause, failCauseUnsafe, end, endUnsafe, shutdownUnsafe, take, poll, makeUnsafe3, fromTransform, mapDone, isSink, fromChannel, drain, make10, get3, isStream, fromChannel2, callback, empty2, make11, suspend, fail2, fromQueue, fromPubSub, fromReadableStream, unwrap, map2, tap, drainFork, concat, merge2, filter, catchCause, tapError, mapError, transduce, decodeText, encodeText, splitLines, interruptWhen, ensuring, provideContext, run, runCollect, runFold, runHead, runForEach, runDrain, mkString, mkArrayBuffer, toReadableStreamEffect, FileSystem, make12, FileTypeId, WatchBackend, Path, make13, embeddedFile, extractEmbeddedFile, map3, all, withDefault, option, String2, optionalEnv, operatorConfigHome, harnessesUnsupportedInSrt2, compiled2, pinnedSrtCommand2, pinnedSrtStepCommand2, runSrtCli2, kitmanCacheDirectory2, srtSettings2, srtCacheEnvironment2, srtInheritedEnv2, inheritedEnvironment2, withOnlyEnvironment2, writeSrtSettings2, srtStepArgv2, srtArgv2 };
@@ -31,7 +31,7 @@ import {
31
31
  runCollect,
32
32
  runDrain,
33
33
  mkString
34
- } from "./chunk-3d4d52e5.js";
34
+ } from "./chunk-0b93nv6j.js";
35
35
 
36
36
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/redacted.js
37
37
  var redactedRegistry = /* @__PURE__ */ new WeakMap;
@@ -108,7 +108,7 @@ import {
108
108
  shutdownUnsafe,
109
109
  fromQueue,
110
110
  unwrap
111
- } from "./chunk-3d4d52e5.js";
111
+ } from "./chunk-0b93nv6j.js";
112
112
  import {
113
113
  Clock,
114
114
  empty,
@@ -123,7 +123,7 @@ import {
123
123
  ParseOptions,
124
124
  RpcClientDefect,
125
125
  RpcClientError
126
- } from "./chunk-9z371t6k.js";
126
+ } from "./chunk-qh5pwxdk.js";
127
127
 
128
128
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/workers/Transferable.js
129
129
  class Collector extends (/* @__PURE__ */ Service2()("effect/workers/Transferable/Collector")) {
@@ -7,10 +7,10 @@ import {
7
7
  decoded2,
8
8
  readOpencode2,
9
9
  runOpencodeReader2
10
- } from "./chunk-vmv7gwwr.js";
11
- import"./chunk-sk6ceghr.js";
10
+ } from "./chunk-kpfrhex3.js";
11
+ import"./chunk-2qarscbj.js";
12
12
  import"./chunk-c6rbt85q.js";
13
- import"./chunk-3d4d52e5.js";
13
+ import"./chunk-0b93nv6j.js";
14
14
  import"./chunk-vtfwjhzh.js";
15
15
  export {
16
16
  decoded2 as decoded,
@@ -108,7 +108,7 @@ import {
108
108
  withDefault,
109
109
  option,
110
110
  String2
111
- } from "./chunk-3d4d52e5.js";
111
+ } from "./chunk-0b93nv6j.js";
112
112
  import {
113
113
  currentTimeMillis,
114
114
  SecureRandom,
@@ -141,6 +141,7 @@ import {
141
141
  shownRunnerSetting,
142
142
  defaultRunnerCapabilities,
143
143
  deliveryProviderActions,
144
+ newerKitmanVersion,
144
145
  MemoryStatuses,
145
146
  MemoryScopes,
146
147
  MaxMemoryListLimit,
@@ -217,7 +218,7 @@ import {
217
218
  harnessNames,
218
219
  herdrRunnerCapabilities2,
219
220
  declaredChecks
220
- } from "./chunk-9z371t6k.js";
221
+ } from "./chunk-qh5pwxdk.js";
221
222
  import {
222
223
  Id
223
224
  } from "./chunk-0qz10ek8.js";
@@ -234,7 +235,7 @@ import {
234
235
  import {
235
236
  ChildProcessSpawner,
236
237
  make3
237
- } from "./chunk-sk6ceghr.js";
238
+ } from "./chunk-2qarscbj.js";
238
239
 
239
240
  // apps/cli/src/cli-error.ts
240
241
  function cliErrorCode(error, status) {
@@ -529,10 +530,10 @@ var sandboxMissing = (sandbox, missing) => ({
529
530
  var personalCheckBackend = (agentSandbox, dockerAvailable) => agentSandbox === "srt" || agentSandbox === "docker" && dockerAvailable ? agentSandbox : undefined;
530
531
  var herdrCoreSession = (runnerId, personal) => personal ? undefined : `kitman-${sha2562(runnerId).slice(0, 16)}`;
531
532
  var OpenHerdrCore = Reference("kitman/cli/OpenHerdrCore", {
532
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-ryed23pv.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
533
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-n9qm4ypc.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
533
534
  });
534
535
  var UpdateHerdrCore = Reference("kitman/cli/UpdateHerdrCore", {
535
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-ryed23pv.js")), (module) => module.updateHerdrCore(options))
536
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-n9qm4ypc.js")), (module) => module.updateHerdrCore(options))
536
537
  });
537
538
  var herdrCoreMissing = (error) => {
538
539
  if (isTagged(error, "HerdrCoreMissing"))
@@ -809,40 +810,35 @@ class RunnerUpdated extends TaggedError("RunnerUpdated") {
809
810
  class UpdateStepFailed extends TaggedError("UpdateStepFailed") {
810
811
  }
811
812
  var step = (name) => (effect) => mapError2(effect, (error) => new UpdateStepFailed({ step: name, reason: error.message }));
813
+
814
+ class NothingNewer extends TaggedError("NothingNewer") {
815
+ }
812
816
  var DrainLimit = "30 minutes";
813
817
  var RequiredRetryAfter = minutes(10);
814
- var releaseNumbers = (version) => /^v?(\d+)\.(\d+)\.(\d+)/u.exec(version)?.slice(1).map(Number);
815
- var newerThan = (candidate, running) => {
816
- const [a, b] = [releaseNumbers(candidate), releaseNumbers(running)];
817
- if (a === undefined || b === undefined)
818
- return true;
819
- const differing = a.findIndex((part, index) => part !== b[index]);
820
- return differing !== -1 && (a[differing] ?? 0) > (b[differing] ?? 0);
821
- };
818
+ var OfferedRetryAfter = minutes(2);
822
819
  var runnerUpdater = (input) => {
823
820
  let claiming = true;
824
821
  let updating = false;
825
822
  let problems = [];
826
823
  const failed = new Set;
827
824
  let requiredFailedAt;
828
- const drain = (onLimit) => suspend3(() => {
825
+ const drain = suspend3(() => {
829
826
  claiming = false;
830
827
  return gen(function* () {
831
828
  while ((yield* input.inFlight) > 0)
832
829
  yield* sleep("1 second");
833
- }).pipe(timeoutOrElse({ duration: DrainLimit, orElse: () => onLimit }));
830
+ }).pipe(timeoutOrElse({ duration: DrainLimit, orElse: () => void_3 }));
834
831
  });
835
- const attempt = (required) => gen(function* () {
832
+ const attempt = gen(function* () {
836
833
  const downloaded = yield* downloadManagedKitman(input.apiUrl, input.platform).pipe(filterOrFail((found) => found !== undefined, () => new UpdateStepFailed({ step: "download", reason: `${input.apiUrl} serves no kitman` })), step("download"));
837
- if (required && input.version !== undefined && !newerThan(downloaded.version, input.version))
838
- return yield* new UpdateStepFailed({
839
- step: "download",
834
+ if (input.version !== undefined && !newerKitmanVersion(downloaded.version, input.version))
835
+ return yield* new NothingNewer({
840
836
  reason: `${input.apiUrl} serves kitman ${downloaded.version}, not newer than this Runner's ${input.version}`
841
837
  });
842
838
  const reported = (yield* runCommand2(downloaded.kitman, ["--version"], { timeout: "30 seconds" }).pipe(step("start"))).trim();
843
839
  if (reported !== downloaded.version)
844
840
  return yield* new UpdateStepFailed({ step: "start", reason: `it reported version ${reported || "none"}` });
845
- yield* drain(required ? void_3 : fail7(new UpdateStepFailed({ step: "drain", reason: "its work in flight did not finish in 30 minutes" })));
841
+ yield* drain;
846
842
  yield* linkManagedKitman(downloaded.kitman).pipe(step("switch"));
847
843
  return yield* new RunnerUpdated({ version: downloaded.version });
848
844
  });
@@ -850,30 +846,43 @@ var runnerUpdater = (input) => {
850
846
  if (updating || failed.has(version))
851
847
  return void_3;
852
848
  updating = true;
853
- return attempt(false).pipe(catchTag("UpdateStepFailed", ({ step: failedStep, reason }) => sync2(() => {
854
- failed.add(version);
855
- claiming = true;
856
- problems = [
857
- {
858
- code: "update_failed",
859
- message: `Updating kitman to ${version} failed at the ${failedStep} step: ${reason}`.slice(0, 500),
860
- fix: `It keeps running its current version. Check that this machine reaches ${input.apiUrl}, then run \`kitman runner restart ${input.runnerId}\` here to try again.`.slice(0, 500)
861
- }
862
- ];
863
- })), ensuring2(sync2(() => updating = false)));
849
+ const untilNewer = gen(function* () {
850
+ for (;; ) {
851
+ const reason = yield* attempt.pipe(catchTag("NothingNewer", ({ reason }) => succeed6(reason)));
852
+ yield* error(`Not updating kitman to ${version} yet: ${reason}. Checking again in ${toMinutes(OfferedRetryAfter)} minutes.`);
853
+ yield* sleep(OfferedRetryAfter);
854
+ }
855
+ });
856
+ return untilNewer.pipe(catchTags({
857
+ UpdateStepFailed: ({ step: failedStep, reason }) => sync2(() => {
858
+ failed.add(version);
859
+ claiming = true;
860
+ problems = [
861
+ {
862
+ code: "update_failed",
863
+ message: `Updating kitman to ${version} failed at the ${failedStep} step: ${reason}`.slice(0, 500),
864
+ fix: `It keeps running its current version. Check that this machine reaches ${input.apiUrl}, then run \`kitman runner restart ${input.runnerId}\` here to try again.`.slice(0, 500)
865
+ }
866
+ ];
867
+ })
868
+ }), ensuring2(sync2(() => updating = false)));
864
869
  });
865
870
  const updateRequired = gen(function* () {
866
871
  const now = yield* currentTimeMillis;
867
872
  if (updating || requiredFailedAt !== undefined && now - requiredFailedAt < toMillis(RequiredRetryAfter))
868
873
  return;
869
874
  updating = true;
870
- return yield* attempt(true).pipe(catchTag("UpdateStepFailed", ({ step: failedStep, reason }) => gen(function* () {
875
+ const retryLater = (failedStep, reason) => gen(function* () {
871
876
  requiredFailedAt = yield* currentTimeMillis;
872
877
  claiming = true;
873
878
  yield* error(`Kitman refuses this Runner's client protocol, and updating kitman failed at the ${failedStep} step: ${reason}. Trying again in ${toMinutes(RequiredRetryAfter)} minutes.`);
874
- })), ensuring2(sync2(() => updating = false)));
879
+ });
880
+ return yield* attempt.pipe(catchTags({
881
+ NothingNewer: ({ reason }) => retryLater("download", reason),
882
+ UpdateStepFailed: ({ step: failedStep, reason }) => retryLater(failedStep, reason)
883
+ }), ensuring2(sync2(() => updating = false)));
875
884
  });
876
- const servesNewer = (served) => input.version === undefined || served === undefined || newerThan(served.version, input.version);
885
+ const servesNewer = (served) => input.version === undefined || served === undefined || newerKitmanVersion(served.version, input.version);
877
886
  const stopWhenDrained = (stop) => gen(function* () {
878
887
  const now = yield* currentTimeMillis;
879
888
  if (updating || requiredFailedAt !== undefined && now - requiredFailedAt < toMillis(RequiredRetryAfter))
@@ -881,16 +890,26 @@ var runnerUpdater = (input) => {
881
890
  updating = true;
882
891
  const served = input.version === undefined ? succeed(undefined) : yield* result(servedKitmanRelease(input.apiUrl));
883
892
  if (isSuccess(served) && servesNewer(served.success))
884
- return yield* andThen2(drain(void_3), fail7(stop));
893
+ return yield* andThen2(drain, fail7(stop));
885
894
  requiredFailedAt = now;
886
895
  updating = false;
887
896
  const reason = isSuccess(served) ? `serves kitman ${served.success?.version}, not newer than this Runner's ${input.version}` : `its release could not be read: ${served.failure.message}`;
888
897
  yield* error(`Kitman refuses this Runner's client protocol, but ${reason}. Checking again in ${toMinutes(RequiredRetryAfter)} minutes.`);
889
898
  });
899
+ const cannotUpdate = (version) => sync2(() => {
900
+ problems = [
901
+ {
902
+ code: "update_required",
903
+ message: `This Runner cannot update itself here, and its control plane serves kitman ${version}, newer than the one it runs.`,
904
+ fix: `Run it from an image with kitman ${version}, then start it again.`
905
+ }
906
+ ];
907
+ });
890
908
  return {
891
909
  claiming: () => claiming,
892
910
  problems: () => problems,
893
911
  update,
912
+ cannotUpdate,
894
913
  updateRequired,
895
914
  stopWhenDrained
896
915
  };
@@ -934,7 +953,7 @@ var syncTargets = (harness) => gen(function* () {
934
953
  });
935
954
  var syncKits = (input) => gen(function* () {
936
955
  const fs = yield* FileSystem;
937
- const { syncKitSetup } = yield* promise(() => import("./chunk-5tp7y1kc.js"));
956
+ const { syncKitSetup } = yield* promise(() => import("./chunk-8y6shv5e.js"));
938
957
  const harnesses = yield* syncTargets(input.harness);
939
958
  const chain = yield* input.client.getKitChain(input.workspaceId);
940
959
  for (const { name, problem } of chain.skipped)
@@ -1852,7 +1871,7 @@ var package_default = {
1852
1871
  };
1853
1872
 
1854
1873
  // apps/cli/src/scaffold.ts
1855
- var cliVersion = "0.11.2";
1874
+ var cliVersion = "0.11.4";
1856
1875
  var packageJson = (name, scaffold) => `${JSON.stringify({
1857
1876
  name,
1858
1877
  private: true,
@@ -2118,7 +2137,7 @@ var Usage = [
2118
2137
  "Every run, loop, agent, verify, constraint, secret, claim, deploy, dev and kit command takes --json."
2119
2138
  ].join(`
2120
2139
  `);
2121
- var agentRuntime = promise(() => import("./chunk-rfn4jgah.js"));
2140
+ var agentRuntime = promise(() => import("./chunk-cfda9gtd.js"));
2122
2141
  var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
2123
2142
  defaultValue: () => gen(function* () {
2124
2143
  const tui = yield* tryPromise({
@@ -3115,7 +3134,7 @@ var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
3115
3134
  });
3116
3135
  var OpenRunnerRpc = Reference("kitman/cli/OpenRunnerRpc", {
3117
3136
  defaultValue: () => (options) => gen(function* () {
3118
- const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-gjt5m6xc.js"));
3137
+ const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-brpngwz8.js"));
3119
3138
  return yield* makeRunnerRpcClient({
3120
3139
  runnerId: options.runnerId,
3121
3140
  bearer: options.bearer,
@@ -3406,7 +3425,7 @@ function startCanonicalHerdrRunnerCommand(input) {
3406
3425
  signals,
3407
3426
  checkouts,
3408
3427
  reconnectAfter: "2 seconds",
3409
- update: (version) => container ? void_3 : startUpdate(updater.update(version))
3428
+ update: (version) => container ? updater.cannotUpdate(version) : startUpdate(updater.update(version))
3410
3429
  }).pipe(forkScoped);
3411
3430
  const sharedSandbox = personal ? undefined : {
3412
3431
  runner: runnerState,
@@ -3639,7 +3658,7 @@ function mcpCommand(args) {
3639
3658
  if (command.action === "run") {
3640
3659
  if (command.args.length > 0)
3641
3660
  return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
3642
- const { runMcpServerCommand } = yield* promise(() => import("./chunk-hvr790k3.js"));
3661
+ const { runMcpServerCommand } = yield* promise(() => import("./chunk-gp3ad3ne.js"));
3643
3662
  return yield* runMcpServerCommand({ flags: command.flags });
3644
3663
  }
3645
3664
  if (command.action !== "setup")
@@ -4909,9 +4928,9 @@ function changeRequestCommand(args) {
4909
4928
  yield* log(command.action === "approve" ? `Approved ${short} of ${changeRequest.title}. A Run waiting on approval of ${short} resumes; one waiting on another head does not.` : `Requested changes to ${short} of ${changeRequest.title}`);
4910
4929
  });
4911
4930
  }
4912
- var KitWriter = map8(promise(() => import("./chunk-956h42xv.js")), (build) => build.writeKit);
4931
+ var KitWriter = map8(promise(() => import("./chunk-wpbc3w4f.js")), (build) => build.writeKit);
4913
4932
  var KitBuilder = Reference("kitman/cli/KitBuilder", {
4914
- defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-956h42xv.js")), (build) => build.buildKit(directory))
4933
+ defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-wpbc3w4f.js")), (build) => build.buildKit(directory))
4915
4934
  });
4916
4935
  var uploadKit = (client, workspaceId, built) => gen(function* () {
4917
4936
  yield* client.uploadKitBundle(workspaceId, built.digest, { bundle: encode2(built.bundle) });
@@ -1,4 +1,8 @@
1
1
  // @bun
2
+ import {
3
+ FileSystem,
4
+ Path
5
+ } from "./chunk-0b93nv6j.js";
2
6
  import {
3
7
  isObject2,
4
8
  isUint8Array,
@@ -17,25 +21,21 @@ import"./chunk-0qz10ek8.js";
17
21
  import {
18
22
  isJsonObject
19
23
  } from "./chunk-c6rbt85q.js";
20
- import {
21
- FileSystem,
22
- Path
23
- } from "./chunk-3d4d52e5.js";
24
24
  import {
25
25
  tomlTableHeader2,
26
26
  tomlKeyPath2,
27
27
  kitmanSkillEntry,
28
28
  isPathWithin2
29
- } from "./chunk-3y7j2s7v.js";
29
+ } from "./chunk-kg99fa2c.js";
30
30
  import {
31
31
  instructionsStart,
32
32
  instructionsEnd,
33
33
  renderMcpServer,
34
34
  materializeKitSetup,
35
35
  tomlInline
36
- } from "./chunk-9z371t6k.js";
37
- import"./chunk-0ca9dqh5.js";
38
- import"./chunk-sk6ceghr.js";
36
+ } from "./chunk-qh5pwxdk.js";
37
+ import"./chunk-rdx91nvh.js";
38
+ import"./chunk-2qarscbj.js";
39
39
 
40
40
  // packages/agent-runtime/src/kit-setup-sync.ts
41
41
  class KitSyncError extends TaggedError("KitSyncError") {
@@ -14,7 +14,7 @@ import {
14
14
  writeSrtSettings2,
15
15
  srtStepArgv2,
16
16
  srtArgv2
17
- } from "./chunk-3d4d52e5.js";
17
+ } from "./chunk-0b93nv6j.js";
18
18
  import"./chunk-vtfwjhzh.js";
19
19
  export {
20
20
  compiled2 as compiled,
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-vtfwjhzh.js";
10
10
  import {
11
11
  runForEach
12
- } from "./chunk-3d4d52e5.js";
12
+ } from "./chunk-0b93nv6j.js";
13
13
  import {
14
14
  WebSocketConstructor,
15
15
  layerWebSocketConstructorGlobal,
@@ -19,13 +19,13 @@ import {
19
19
  RunnerReplicaRpcs,
20
20
  RunnerRunFileRpcs,
21
21
  ProgramRpcs
22
- } from "./chunk-9z371t6k.js";
22
+ } from "./chunk-qh5pwxdk.js";
23
23
  import {
24
24
  layerJson,
25
25
  make4,
26
26
  withHeaders,
27
27
  layerProtocolSocket
28
- } from "./chunk-5326a9ks.js";
28
+ } from "./chunk-4e0c4zw0.js";
29
29
 
30
30
  // packages/live/src/rpc/runner-client.ts
31
31
  var proxiedWebSocket = (proxy) => succeed5(WebSocketConstructor)((target) => {
@@ -4,12 +4,12 @@ import {
4
4
  runnerRpcUrl2,
5
5
  makeRunnerRpcClient2,
6
6
  makeProgramRpcClient2
7
- } from "./chunk-bm7hjnrx.js";
8
- import"./chunk-5326a9ks.js";
9
- import"./chunk-9z371t6k.js";
7
+ } from "./chunk-av04xyxt.js";
8
+ import"./chunk-4e0c4zw0.js";
9
+ import"./chunk-qh5pwxdk.js";
10
10
  import"./chunk-0qz10ek8.js";
11
11
  import"./chunk-c6rbt85q.js";
12
- import"./chunk-3d4d52e5.js";
12
+ import"./chunk-0b93nv6j.js";
13
13
  import"./chunk-vtfwjhzh.js";
14
14
  export {
15
15
  makeProgramRpcClient2 as makeProgramRpcClient,
@@ -7,6 +7,46 @@ import {
7
7
  isJsonObject,
8
8
  isString
9
9
  } from "./chunk-c6rbt85q.js";
10
+ import {
11
+ join,
12
+ interrupt,
13
+ unbounded,
14
+ publishUnsafe,
15
+ unbounded2,
16
+ offer,
17
+ makeUnsafe3,
18
+ make11,
19
+ fromQueue,
20
+ fromPubSub,
21
+ map2,
22
+ filter,
23
+ decodeText,
24
+ encodeText,
25
+ splitLines,
26
+ run,
27
+ runHead,
28
+ runForEach,
29
+ FileSystem,
30
+ Path,
31
+ embeddedFile,
32
+ extractEmbeddedFile,
33
+ optionalEnv,
34
+ operatorConfigHome,
35
+ harnessesUnsupportedInSrt2,
36
+ compiled2,
37
+ pinnedSrtCommand2,
38
+ pinnedSrtStepCommand2,
39
+ runSrtCli2,
40
+ kitmanCacheDirectory2,
41
+ srtSettings2,
42
+ srtCacheEnvironment2,
43
+ srtInheritedEnv2,
44
+ inheritedEnvironment2,
45
+ withOnlyEnvironment2,
46
+ writeSrtSettings2,
47
+ srtStepArgv2,
48
+ srtArgv2
49
+ } from "./chunk-0b93nv6j.js";
10
50
  import {
11
51
  pipeArguments,
12
52
  dual,
@@ -246,47 +286,7 @@ import {
246
286
  installCommand,
247
287
  checkServicesFile,
248
288
  checkServices
249
- } from "./chunk-9z371t6k.js";
250
- import {
251
- join,
252
- interrupt,
253
- unbounded,
254
- publishUnsafe,
255
- unbounded2,
256
- offer,
257
- makeUnsafe3,
258
- make11,
259
- fromQueue,
260
- fromPubSub,
261
- map2,
262
- filter,
263
- decodeText,
264
- encodeText,
265
- splitLines,
266
- run,
267
- runHead,
268
- runForEach,
269
- FileSystem,
270
- Path,
271
- embeddedFile,
272
- extractEmbeddedFile,
273
- optionalEnv,
274
- operatorConfigHome,
275
- harnessesUnsupportedInSrt2,
276
- compiled2,
277
- pinnedSrtCommand2,
278
- pinnedSrtStepCommand2,
279
- runSrtCli2,
280
- kitmanCacheDirectory2,
281
- srtSettings2,
282
- srtCacheEnvironment2,
283
- srtInheritedEnv2,
284
- inheritedEnvironment2,
285
- withOnlyEnvironment2,
286
- writeSrtSettings2,
287
- srtStepArgv2,
288
- srtArgv2
289
- } from "./chunk-3d4d52e5.js";
289
+ } from "./chunk-qh5pwxdk.js";
290
290
  import {
291
291
  writeAgentEnvironmentConfigFile2,
292
292
  readManifestSkillPaths2,
@@ -302,8 +302,8 @@ import {
302
302
  applyAgentEnvironmentMaterialization2,
303
303
  isPathWithin2,
304
304
  skillIdentity2
305
- } from "./chunk-3y7j2s7v.js";
306
- import"./chunk-0ca9dqh5.js";
305
+ } from "./chunk-kg99fa2c.js";
306
+ import"./chunk-rdx91nvh.js";
307
307
  import {
308
308
  egressAllowed,
309
309
  writeSecretRegistry,
@@ -321,23 +321,23 @@ import {
321
321
  decodedOption2,
322
322
  decoded2,
323
323
  readOpencode2
324
- } from "./chunk-vmv7gwwr.js";
324
+ } from "./chunk-kpfrhex3.js";
325
325
  import {
326
326
  uploadRunFile,
327
327
  programLease,
328
328
  rpcRunFiles,
329
329
  programHostsEnv,
330
330
  undeclaredHostsEnv
331
- } from "./chunk-mtpjpa2p.js";
332
- import"./chunk-bm7hjnrx.js";
331
+ } from "./chunk-myxv5kpp.js";
332
+ import"./chunk-av04xyxt.js";
333
333
  import {
334
334
  nextInt
335
335
  } from "./chunk-nzjb36ad.js";
336
336
  import {
337
337
  ChildProcessSpawner,
338
338
  make3
339
- } from "./chunk-sk6ceghr.js";
340
- import"./chunk-5326a9ks.js";
339
+ } from "./chunk-2qarscbj.js";
340
+ import"./chunk-4e0c4zw0.js";
341
341
 
342
342
  // packages/core/src/sync-kit.ts
343
343
  import { createHash } from "crypto";
@@ -3084,7 +3084,13 @@ var update = /* @__PURE__ */ dual(2, (self, update) => self.semaphore.withPermit
3084
3084
 
3085
3085
  // packages/agent-runtime/src/claude-workspace-trust.ts
3086
3086
  var withEntry = (object, key, value) => Object.fromEntries([...Object.entries(object), [key, value]]);
3087
- var trustClaudeWorkspace = (home, workspace) => gen(function* () {
3087
+ var writePermits = new Map;
3088
+ var trustClaudeWorkspace = (home, workspace) => {
3089
+ const permit = writePermits.get(home) ?? makeUnsafe3(1);
3090
+ writePermits.set(home, permit);
3091
+ return permit.withPermits(1)(trust(home, workspace));
3092
+ };
3093
+ var trust = (home, workspace) => gen(function* () {
3088
3094
  const fs = yield* FileSystem;
3089
3095
  const file = `${home}/.claude.json`;
3090
3096
  const text = yield* fs.readFileString(file).pipe(catchReason("PlatformError", "NotFound", () => succeed6("{}")));
@@ -4238,8 +4244,10 @@ var runAttempt = (request, options) => gen(function* () {
4238
4244
  }
4239
4245
  });
4240
4246
  const terminal = yield* result(call(run, (connection) => flatMap3(connection.list({ labels: { "kitman.attempt": attempt.id }, all: true }), ([started]) => started === undefined ? run(connection) : succeed6(started))));
4241
- if (isFailure(terminal))
4247
+ if (isFailure(terminal)) {
4248
+ yield* logWarning("agent_launch_failed", { attempt: attempt.id, error: terminal.failure.message });
4242
4249
  return isTagged(terminal.failure, "HerdrCoreRpcError") ? failed("harness_launch_failed", `herdr-core refused to start the Harness: ${terminal.failure.message}`) : { status: "unreported", reason: "herdr_unavailable" };
4250
+ }
4243
4251
  const { address } = terminal.success;
4244
4252
  const seen = yield* make({ status: null, turn: 0, end: undefined });
4245
4253
  yield* forkScoped(follow(options.core, attempt.id, address, seen));
@@ -4249,6 +4257,7 @@ var runAttempt = (request, options) => gen(function* () {
4249
4257
  yield* stopTerminal(call, address, options.teardownDelayMs);
4250
4258
  });
4251
4259
  const outputSubmitted = request.settled.pipe(orElseSucceed(() => false));
4260
+ const readScreen = map8(option2(call((connection) => connection.read(address))), (screen) => isSome(screen) ? redactCredentials(screen.value).trim() : "");
4252
4261
  const judge = (last) => gen(function* () {
4253
4262
  if (yield* outputSubmitted)
4254
4263
  return { status: "settled" };
@@ -4262,8 +4271,7 @@ var runAttempt = (request, options) => gen(function* () {
4262
4271
  case undefined: {
4263
4272
  if (last.status !== "blocked" && last.status !== "error")
4264
4273
  return failed("output_missing", "The agent finished without submitting its Output.");
4265
- const screen = yield* option2(call((connection) => connection.read(address)));
4266
- const shown = isSome(screen) ? redactCredentials(screen.value).trim() : "";
4274
+ const shown = yield* readScreen;
4267
4275
  if (last.status === "error") {
4268
4276
  yield* logWarning("agent_errored", { attempt: attempt.id, address, screen: shown });
4269
4277
  return failed("harness_error", `The Harness stopped in its error state before it submitted its Output.${shown === "" ? "" : ` Its screen ended: ${shown.slice(-blockedScreenChars)}`}`);
@@ -4280,8 +4288,11 @@ var runAttempt = (request, options) => gen(function* () {
4280
4288
  });
4281
4289
  const drive = gen(function* () {
4282
4290
  const ready = yield* until(seen, (last) => last.end !== undefined || last.status !== null && last.status !== "working").pipe(timeoutOption(launchTimeout));
4283
- if (isNone(ready))
4284
- return failed("harness_launch_timeout", "The Harness reported no status within 120 s of its launch.");
4291
+ if (isNone(ready)) {
4292
+ const shown = yield* readScreen;
4293
+ yield* logWarning("agent_launch_timeout", { attempt: attempt.id, address, screen: shown });
4294
+ return failed("harness_launch_timeout", `The Harness reported no status within 120 s of its launch.${shown === "" ? " Its screen was empty." : ` Its screen ended: ${shown.slice(-blockedScreenChars)}`}`);
4295
+ }
4285
4296
  if (ready.value.end !== undefined)
4286
4297
  return yield* judge(ready.value);
4287
4298
  const brief = firstMessage(request.launch, workspace, launch.systemBrief === true);
@@ -159,7 +159,21 @@ import {
159
159
  runMcpEffect,
160
160
  createAgentAuthSignedFetch,
161
161
  setupMcpAgentCredential
162
- } from "./chunk-9z371t6k.js";
162
+ } from "./chunk-qh5pwxdk.js";
163
+ import {
164
+ join,
165
+ interrupt,
166
+ runForEach,
167
+ FileSystem,
168
+ Path,
169
+ embeddedFile,
170
+ extractEmbeddedFile,
171
+ map3,
172
+ all,
173
+ withDefault,
174
+ option,
175
+ String2
176
+ } from "./chunk-0b93nv6j.js";
163
177
  import {
164
178
  guard,
165
179
  Id,
@@ -179,20 +193,6 @@ import {
179
193
  isString,
180
194
  kindOf
181
195
  } from "./chunk-c6rbt85q.js";
182
- import {
183
- join,
184
- interrupt,
185
- runForEach,
186
- FileSystem,
187
- Path,
188
- embeddedFile,
189
- extractEmbeddedFile,
190
- map3,
191
- all,
192
- withDefault,
193
- option,
194
- String2
195
- } from "./chunk-3d4d52e5.js";
196
196
  import {
197
197
  nextInt
198
198
  } from "./chunk-nzjb36ad.js";
@@ -202,7 +202,7 @@ import {
202
202
  withHeaders,
203
203
  layerProtocolSocket,
204
204
  ConnectionHooks
205
- } from "./chunk-5326a9ks.js";
205
+ } from "./chunk-4e0c4zw0.js";
206
206
 
207
207
  // apps/cli/src/mcp.ts
208
208
  import { tmpdir as tmpdir2 } from "os";
@@ -1,4 +1,9 @@
1
1
  // @bun
2
+ import {
3
+ FileSystem,
4
+ Path,
5
+ optionalEnv
6
+ } from "./chunk-0b93nv6j.js";
2
7
  import {
3
8
  Reference,
4
9
  TaggedError,
@@ -28,19 +33,14 @@ import {
28
33
  isJsonObject,
29
34
  isString
30
35
  } from "./chunk-c6rbt85q.js";
31
- import {
32
- FileSystem,
33
- Path,
34
- optionalEnv
35
- } from "./chunk-3d4d52e5.js";
36
36
  import {
37
37
  AgentHarnessIds,
38
38
  sha2562,
39
39
  runCommand2
40
- } from "./chunk-9z371t6k.js";
40
+ } from "./chunk-qh5pwxdk.js";
41
41
  import {
42
42
  NpmRegistry
43
- } from "./chunk-0ca9dqh5.js";
43
+ } from "./chunk-rdx91nvh.js";
44
44
 
45
45
  // packages/agent-runtime/src/config-convergence.ts
46
46
  var writeAgentEnvironmentConfigFile2 = fnUntraced(function* (file, content, keep = {}) {
@@ -1,4 +1,9 @@
1
1
  // @bun
2
+ import {
3
+ make11,
4
+ runForEach,
5
+ compiled2
6
+ } from "./chunk-0b93nv6j.js";
2
7
  import {
3
8
  getOrUndefined,
4
9
  liftThrowable,
@@ -28,15 +33,10 @@ import {
28
33
  isJsonObject,
29
34
  isString
30
35
  } from "./chunk-c6rbt85q.js";
31
- import {
32
- make11,
33
- runForEach,
34
- compiled2
35
- } from "./chunk-3d4d52e5.js";
36
36
  import {
37
37
  ChildProcessSpawner,
38
38
  make3
39
- } from "./chunk-sk6ceghr.js";
39
+ } from "./chunk-2qarscbj.js";
40
40
 
41
41
  // packages/agent-runtime/src/opencode-store.ts
42
42
  import { lstatSync, readFileSync, realpathSync } from "fs";
@@ -76,6 +76,10 @@ import {
76
76
  toCodecJson,
77
77
  Json
78
78
  } from "./chunk-vtfwjhzh.js";
79
+ import {
80
+ runForEach,
81
+ FileSystem
82
+ } from "./chunk-0b93nv6j.js";
79
83
  import {
80
84
  guard
81
85
  } from "./chunk-0qz10ek8.js";
@@ -105,11 +109,7 @@ import {
105
109
  KitDigest,
106
110
  KitSetup,
107
111
  RunnerRpcError
108
- } from "./chunk-9z371t6k.js";
109
- import {
110
- runForEach,
111
- FileSystem
112
- } from "./chunk-3d4d52e5.js";
112
+ } from "./chunk-qh5pwxdk.js";
113
113
 
114
114
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/crypto/internal/webCrypto.js
115
115
  var subtleUnavailable = () => new Error("crypto.subtle is unavailable; browsers expose it only in secure contexts");
@@ -811,7 +811,9 @@ var TranscriptPoint = Struct({
811
811
  });
812
812
  var TranscriptsRequest = Struct({
813
813
  days: Int.check(isGreaterThanOrEqualTo(1), isLessThanOrEqualTo(31)),
814
- teamId: optionalKey(String4)
814
+ teamId: optionalKey(String4),
815
+ projectId: optionalKey(String4),
816
+ fileIntoProjectId: optionalKey(String4)
815
817
  });
816
818
  var TranscriptsResult = Struct({
817
819
  runs: ArraySchema(Struct({
@@ -846,6 +848,7 @@ var ProposeRequest = Union([
846
848
  title: String4,
847
849
  description: String4,
848
850
  teamId: optional(String4),
851
+ projectId: optionalKey(String4),
849
852
  key: optionalKey(String4.check(isPattern(/^[a-z0-9]+(?:-[a-z0-9]+)*$/), isMaxLength(80))),
850
853
  citations: Citations
851
854
  })
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-sk6ceghr.js";
2
+ import"./chunk-2qarscbj.js";
3
3
  import {
4
4
  HERDR_CORE_GENERATION2,
5
5
  HERDR_CORE_INSTALL_COMMAND2,
@@ -12,8 +12,8 @@ import {
12
12
  herdrCoreLayer2,
13
13
  herdrCoreTransportLayer2,
14
14
  updateHerdrCore2
15
- } from "./chunk-9z371t6k.js";
16
- import"./chunk-3d4d52e5.js";
15
+ } from "./chunk-qh5pwxdk.js";
16
+ import"./chunk-0b93nv6j.js";
17
17
  import"./chunk-vtfwjhzh.js";
18
18
  export {
19
19
  HERDR_CORE_GENERATION2 as HERDR_CORE_GENERATION,
@@ -253,6 +253,7 @@ import {
253
253
  import {
254
254
  map,
255
255
  makeEquivalence,
256
+ toNumber,
256
257
  bytes,
257
258
  BadArgument,
258
259
  systemError,
@@ -316,7 +317,7 @@ import {
316
317
  String2,
317
318
  optionalEnv,
318
319
  harnessesUnsupportedInSrt2
319
- } from "./chunk-3d4d52e5.js";
320
+ } from "./chunk-0b93nv6j.js";
320
321
  import {
321
322
  isDateTime,
322
323
  Numeric,
@@ -357,7 +358,7 @@ import {
357
358
  make3,
358
359
  parseFdName,
359
360
  fdName
360
- } from "./chunk-sk6ceghr.js";
361
+ } from "./chunk-2qarscbj.js";
361
362
 
362
363
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Tuple.js
363
364
  var makeEquivalence3 = Tuple;
@@ -899,15 +900,6 @@ var runMain2 = /* @__PURE__ */ makeRunMain(({
899
900
  // node_modules/.bun/@effect+platform-bun@4.1.2+edf248c88a527e3e/node_modules/@effect/platform-bun/dist/BunRuntime.js
900
901
  var runMain = runMain2;
901
902
 
902
- // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/BigInt.js
903
- var BigInt2 = globalThis.BigInt;
904
- var toNumber = (b) => {
905
- if (b > BigInt2(Number.MAX_SAFE_INTEGER) || b < BigInt2(Number.MIN_SAFE_INTEGER)) {
906
- return none();
907
- }
908
- return some(Number(b));
909
- };
910
-
911
903
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/DateTime.js
912
904
  var makeUnsafe = makeUnsafe6;
913
905
  var make18 = make4;
@@ -8079,6 +8071,21 @@ function deliveryProviderActions(providerActions, delivery) {
8079
8071
  release: posture("release")
8080
8072
  };
8081
8073
  }
8074
+ var releaseVersion = (version) => {
8075
+ const parts = /^v?(\d+)\.(\d+)\.(\d+)(-.+)?$/u.exec(version);
8076
+ if (parts === null)
8077
+ return;
8078
+ const suffix = parts[4];
8079
+ const stage = suffix === undefined ? 1 : /^-\d+-g[0-9a-f]+$/u.test(suffix) ? 2 : 0;
8080
+ return { numbers: [...parts.slice(1, 4).map(Number), stage], stable: suffix === undefined };
8081
+ };
8082
+ var newerKitmanVersion = (candidate, running) => {
8083
+ const [a, b] = [releaseVersion(candidate), releaseVersion(running)];
8084
+ if (a === undefined || b === undefined)
8085
+ return true;
8086
+ const differing = a.numbers.findIndex((part, index) => part !== b.numbers[index]);
8087
+ return differing !== -1 && (a.numbers[differing] ?? 0) > (b.numbers[differing] ?? 0);
8088
+ };
8082
8089
  // packages/core/src/team-context.ts
8083
8090
  var BranchTemplate = String4.check(isMinLength(1), isMaxLength(160));
8084
8091
  var DeliveryMode = Literals(["gated", "auto"]);
@@ -14450,7 +14457,14 @@ class RunnerCapabilityRpcs extends make7(make6("PutQuestion", {
14450
14457
  }),
14451
14458
  error: RunnerRpcError
14452
14459
  }), make6("ReadTranscripts", {
14453
- payload: { lease: ProgramLease, step: String4, days: Int, teamId: optionalKey(String4) },
14460
+ payload: {
14461
+ lease: ProgramLease,
14462
+ step: String4,
14463
+ days: Int,
14464
+ teamId: optionalKey(String4),
14465
+ projectId: optionalKey(String4),
14466
+ fileIntoProjectId: optionalKey(String4)
14467
+ },
14454
14468
  success: Struct({
14455
14469
  runs: ArraySchema(Struct({
14456
14470
  runId: String4,
@@ -14569,6 +14583,7 @@ class RunnerCapabilityRpcs extends make7(make6("PutQuestion", {
14569
14583
  title: String4,
14570
14584
  description: String4,
14571
14585
  teamId: optionalKey(String4),
14586
+ projectId: optionalKey(String4),
14572
14587
  key: optionalKey(String4),
14573
14588
  citations: NonEmptyArray(Struct({ runId: String4, stepAttemptId: String4, sequence: Int }))
14574
14589
  })
@@ -15981,4 +15996,4 @@ function checkServices(declaration) {
15981
15996
  return isSome(decoded) ? [...new Set(decoded.value.services)] : undefined;
15982
15997
  }
15983
15998
 
15984
- 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, NetworkHost, 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, RunnerExecutionBackend, MaxRunnerConcurrency, PinnedImage, RunnerSettingNames, RunnerSettingsUpdate, defaultRunnerSettings, shownRunnerSetting, defaultRunnerCapabilities, deliveryProviderActions, MemoryStatuses, MemoryScopes, MaxMemoryListLimit, DecisionStatuses, Session, SessionEnd, SessionUpdate, SessionUpdateCreate, FixFlowRecoveryActions, KitmanAgentCapabilityNames, sha2562, isRunFileRefusalReason, runFileRefusalWords, RunFileRefused, runFileContentType, repositoryKey, createId, digestSha256, digestSha512, digestWith, sha256Hasher, AgentEvent, raw, make5, get, post, put, setHeaders, acceptJson, bodyUint8Array, bodyJsonUnsafe, bodyUrlParams, schemaBodyJson, filterStatusOk, HttpClient, execute, get2, Fetch, layer4, Socket, SocketReadError, SocketError, WebSocketConstructor, layerWebSocketConstructorGlobal, layerWebSocket, runDisplayLabels, listedSummary, 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, make6, exitSchema, ParseOptions, RpcClientDefect, RpcClientError, make7, Service, RunnerHeaders, RunnerRpcProtocolVersion, RunnerRpcError, RunSettled, UpdateAvailable, RunnerReplicaRpcs, RunnerRunFileRpcs, ProgramRpcs, parseCallbackUrl, revokeToken, toStoredSession, browserLogin, openBrowser, shouldRefresh, createSdkClient, refreshSession, AgentAuthClientError, executeAgentCapability, createAgentAuthBearerToken, McpPlatformLive, runMcpEffect, createAgentAuthSignedFetch, setupMcpAgentCredential, generateAgentKeyPair, HERDR_CORE_GENERATION2, HERDR_CORE_INSTALL_COMMAND2, HerdrCoreMissing2, HerdrCoreIncompatible2, HerdrCoreConnectionLost2, HerdrCoreRpcError2, HerdrCoreUpdateFailed2, HerdrCore2, herdrCoreLayer2, herdrCoreTransportLayer2, updateHerdrCore2, CommandFailed2, runCommand2, withoutPreloads2, shellOutputTailChars2, runProcess2, CommandRunner2, runShell2, detectHarnesses2, kitHarnesses, isKitHarness, instructionsStart, instructionsEnd, harnessNames, renderMcpServer, materializeKitSetup, tomlInline, herdrExecutionExtension2, herdrNativeExtensionIds2, herdrRunnerCapabilitiesForRepoBinding2, herdrRunnerCapabilities2, assertHerdrRunnerCapability2, declaredChecks, installCommand, checkServicesFile, checkServices };
15999
+ 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, NetworkHost, 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, RunnerExecutionBackend, MaxRunnerConcurrency, PinnedImage, RunnerSettingNames, RunnerSettingsUpdate, defaultRunnerSettings, shownRunnerSetting, defaultRunnerCapabilities, deliveryProviderActions, newerKitmanVersion, MemoryStatuses, MemoryScopes, MaxMemoryListLimit, DecisionStatuses, Session, SessionEnd, SessionUpdate, SessionUpdateCreate, FixFlowRecoveryActions, KitmanAgentCapabilityNames, sha2562, isRunFileRefusalReason, runFileRefusalWords, RunFileRefused, runFileContentType, repositoryKey, createId, digestSha256, digestSha512, digestWith, sha256Hasher, AgentEvent, raw, make5, get, post, put, setHeaders, acceptJson, bodyUint8Array, bodyJsonUnsafe, bodyUrlParams, schemaBodyJson, filterStatusOk, HttpClient, execute, get2, Fetch, layer4, Socket, SocketReadError, SocketError, WebSocketConstructor, layerWebSocketConstructorGlobal, layerWebSocket, runDisplayLabels, listedSummary, 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, make6, exitSchema, ParseOptions, RpcClientDefect, RpcClientError, make7, Service, RunnerHeaders, RunnerRpcProtocolVersion, RunnerRpcError, RunSettled, UpdateAvailable, RunnerReplicaRpcs, RunnerRunFileRpcs, ProgramRpcs, parseCallbackUrl, revokeToken, toStoredSession, browserLogin, openBrowser, shouldRefresh, createSdkClient, refreshSession, AgentAuthClientError, executeAgentCapability, createAgentAuthBearerToken, McpPlatformLive, runMcpEffect, createAgentAuthSignedFetch, setupMcpAgentCredential, generateAgentKeyPair, HERDR_CORE_GENERATION2, HERDR_CORE_INSTALL_COMMAND2, HerdrCoreMissing2, HerdrCoreIncompatible2, HerdrCoreConnectionLost2, HerdrCoreRpcError2, HerdrCoreUpdateFailed2, HerdrCore2, herdrCoreLayer2, herdrCoreTransportLayer2, updateHerdrCore2, CommandFailed2, runCommand2, withoutPreloads2, shellOutputTailChars2, runProcess2, CommandRunner2, runShell2, detectHarnesses2, kitHarnesses, isKitHarness, instructionsStart, instructionsEnd, harnessNames, renderMcpServer, materializeKitSetup, tomlInline, herdrExecutionExtension2, herdrNativeExtensionIds2, herdrRunnerCapabilitiesForRepoBinding2, herdrRunnerCapabilities2, assertHerdrRunnerCapability2, declaredChecks, installCommand, checkServicesFile, checkServices };
@@ -28,7 +28,7 @@ import {
28
28
  import {
29
29
  withDefault,
30
30
  String2
31
- } from "./chunk-3d4d52e5.js";
31
+ } from "./chunk-0b93nv6j.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-9z371t6k.js";
41
+ } from "./chunk-qh5pwxdk.js";
42
42
 
43
43
  // packages/core/src/npm-registry.ts
44
44
  var KitManifest = Struct({
@@ -1,4 +1,12 @@
1
1
  // @bun
2
+ import {
3
+ decodeText,
4
+ mkString,
5
+ FileSystem,
6
+ Path,
7
+ withDefault,
8
+ String2
9
+ } from "./chunk-0b93nv6j.js";
2
10
  import {
3
11
  isString2,
4
12
  hasProperty,
@@ -46,31 +54,23 @@ import {
46
54
  layer4,
47
55
  kitmanMcpServer,
48
56
  RunnerRpcProtocolVersion
49
- } from "./chunk-9z371t6k.js";
50
- import {
51
- decodeText,
52
- mkString,
53
- FileSystem,
54
- Path,
55
- withDefault,
56
- String2
57
- } from "./chunk-3d4d52e5.js";
57
+ } from "./chunk-qh5pwxdk.js";
58
58
  import {
59
59
  Packument,
60
60
  tarballMatches
61
- } from "./chunk-0ca9dqh5.js";
62
- import"./chunk-bm7hjnrx.js";
61
+ } from "./chunk-rdx91nvh.js";
62
+ import"./chunk-av04xyxt.js";
63
63
  import {
64
64
  AgentDeclaration,
65
65
  KitDeclarations,
66
66
  describeFlag,
67
67
  Described
68
- } from "./chunk-mtpjpa2p.js";
68
+ } from "./chunk-myxv5kpp.js";
69
69
  import {
70
70
  ChildProcessSpawner,
71
71
  make3
72
- } from "./chunk-sk6ceghr.js";
73
- import"./chunk-5326a9ks.js";
72
+ } from "./chunk-2qarscbj.js";
73
+ import"./chunk-4e0c4zw0.js";
74
74
 
75
75
  // packages/sdk/src/build/index.ts
76
76
  class DependencyInstallFailed extends TaggedError2()("DependencyInstallFailed", {
package/dist/index.js CHANGED
@@ -5,15 +5,15 @@
5
5
  var args = process.argv.slice(2);
6
6
  if (args[0] === "srt") {
7
7
  process.argv.splice(2, 1);
8
- const { runSrtCli } = await import("./chunk-japwbj9n.js");
8
+ const { runSrtCli } = await import("./chunk-ap9y5k9y.js");
9
9
  await runSrtCli();
10
10
  } else if (args[0] === "srt-step") {
11
11
  const { runSrtStep } = await import("./chunk-z450wa10.js");
12
12
  await runSrtStep(args.slice(1));
13
13
  } else if (args[0] === "opencode-read") {
14
- const { runOpencodeReader } = await import("./chunk-d9bv70qb.js");
14
+ const { runOpencodeReader } = await import("./chunk-5vzznkvb.js");
15
15
  runOpencodeReader();
16
16
  } else {
17
- const { runCli } = await import("./chunk-7wptm1tk.js");
17
+ const { runCli } = await import("./chunk-89mqzn6e.js");
18
18
  runCli(args);
19
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitman-sh/cli",
3
- "version": "0.11.2",
3
+ "version": "0.11.4",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {