@kitman-sh/cli 0.14.2 → 0.14.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.
Files changed (28) hide show
  1. package/LICENSE.md +10 -0
  2. package/dist/{chunk-scdr623z.js → chunk-0kreahhj.js} +1 -1
  3. package/dist/{chunk-v86jpzpr.js → chunk-4yvafzhp.js} +7 -7
  4. package/dist/{chunk-vfw3xn1e.js → chunk-5c4tn29r.js} +3 -3
  5. package/dist/{chunk-gwz39037.js → chunk-6zwwrpve.js} +1 -1
  6. package/dist/{chunk-hza25m2e.js → chunk-af3m4nhz.js} +36 -22
  7. package/dist/{chunk-q4ch3t9q.js → chunk-c6fanp7r.js} +6 -6
  8. package/dist/{chunk-ge9qjp6s.js → chunk-dz7qcbpp.js} +4 -4
  9. package/dist/{chunk-1jabs81x.js → chunk-ec01eq70.js} +184 -82
  10. package/dist/{chunk-3csj1ve1.js → chunk-kg32dz1w.js} +4 -4
  11. package/dist/{chunk-qqmxhk9w.js → chunk-me1zn085.js} +60 -14
  12. package/dist/{chunk-jzfy127y.js → chunk-nmw831xh.js} +4 -4
  13. package/dist/{chunk-e024f8af.js → chunk-p9wzycsm.js} +2 -2
  14. package/dist/{chunk-4xez238w.js → chunk-pcyscxe1.js} +2 -2
  15. package/dist/{chunk-ffq8vvvx.js → chunk-pvv8y59t.js} +7 -7
  16. package/dist/{chunk-t9chwen8.js → chunk-q1y9qjjp.js} +6 -4
  17. package/dist/{chunk-ryxff0xk.js → chunk-qd9bkybz.js} +109 -118
  18. package/dist/{chunk-0r9tp5pz.js → chunk-qnb3a82t.js} +4 -4
  19. package/dist/{chunk-m9x7feh0.js → chunk-ra22g5nv.js} +7 -7
  20. package/dist/{chunk-yfag1eey.js → chunk-rx2cg7rn.js} +5 -5
  21. package/dist/{chunk-avhqm9p0.js → chunk-tnrmd4hz.js} +31 -165
  22. package/dist/{chunk-z7c2ndfg.js → chunk-v26jmjr0.js} +11 -11
  23. package/dist/{chunk-80vwvv5x.js → chunk-wvhm5fgh.js} +25 -25
  24. package/dist/{chunk-39pdxhcv.js → chunk-x2jjnfff.js} +3 -3
  25. package/dist/{chunk-h6kd80nr.js → chunk-yv2mq2e9.js} +1 -1
  26. package/dist/{chunk-24j1cmsm.js → chunk-zv1sshtj.js} +22 -22
  27. package/dist/index.js +4 -4
  28. package/package.json +4 -3
package/LICENSE.md ADDED
@@ -0,0 +1,10 @@
1
+ # O'Saasy License Agreement
2
+
3
+ Copyright © 2026, Mads Kronborg Nordahl.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ 1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+ 2. No licensee or downstream recipient may use the Software (including any modified or derivative versions) to directly compete with the original Licensor by offering it to third parties as a hosted, managed, or Software-as-a-Service (SaaS) product or cloud service where the primary value of the service is the functionality of the Software itself.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -3,7 +3,7 @@ import {
3
3
  Random,
4
4
  succeed6,
5
5
  withFiber2
6
- } from "./chunk-1jabs81x.js";
6
+ } from "./chunk-ec01eq70.js";
7
7
 
8
8
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Random.js
9
9
  var Random2 = Random;
@@ -6,10 +6,10 @@ import {
6
6
  gen,
7
7
  flatMap3,
8
8
  provideContext2
9
- } from "./chunk-1jabs81x.js";
9
+ } from "./chunk-ec01eq70.js";
10
10
  import {
11
11
  runForEach
12
- } from "./chunk-avhqm9p0.js";
12
+ } from "./chunk-tnrmd4hz.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-ryxff0xk.js";
22
+ } from "./chunk-qd9bkybz.js";
23
23
  import {
24
24
  layerJson,
25
- make3,
25
+ make4,
26
26
  withHeaders,
27
27
  layerProtocolSocket
28
- } from "./chunk-yfag1eey.js";
28
+ } from "./chunk-rx2cg7rn.js";
29
29
 
30
30
  // packages/live/src/rpc/runner-client.ts
31
31
  var proxiedWebSocket = (proxy) => succeed5(WebSocketConstructor)((target) => {
@@ -46,7 +46,7 @@ var authorizer = (options) => (call) => flatMap3(options.bearer, (token) => with
46
46
  var RunnerProcessRpcs = RunnerReplicaRpcs.merge(RunnerRunFileRpcs);
47
47
  var makeRunnerRpcClient2 = (options) => gen(function* () {
48
48
  const protocol = yield* build(options.protocol);
49
- const client = yield* make3(RunnerProcessRpcs).pipe(provideContext2(protocol));
49
+ const client = yield* make4(RunnerProcessRpcs).pipe(provideContext2(protocol));
50
50
  const authorized = authorizer(options);
51
51
  return {
52
52
  claim: (input) => authorized(client.Claim(input)),
@@ -74,7 +74,7 @@ var makeRunnerRpcClient2 = (options) => gen(function* () {
74
74
  });
75
75
  var makeProgramRpcClient2 = (options) => gen(function* () {
76
76
  const protocol = yield* build(options.protocol);
77
- const client = yield* make3(ProgramRpcs).pipe(provideContext2(protocol));
77
+ const client = yield* make4(ProgramRpcs).pipe(provideContext2(protocol));
78
78
  const authorized = authorizer(options);
79
79
  return {
80
80
  recordActivity: (input) => authorized(client.RecordActivity(input)),
@@ -4,9 +4,9 @@ import {
4
4
  opaqueTunnelRefusal2,
5
5
  isOpaqueConnectReason2,
6
6
  runSrtStep2
7
- } from "./chunk-e024f8af.js";
8
- import"./chunk-h6kd80nr.js";
9
- import"./chunk-1jabs81x.js";
7
+ } from "./chunk-p9wzycsm.js";
8
+ import"./chunk-yv2mq2e9.js";
9
+ import"./chunk-ec01eq70.js";
10
10
  export {
11
11
  isOpaqueConnectReason2 as isOpaqueConnectReason,
12
12
  opaqueTunnelRefusal2 as opaqueTunnelRefusal,
@@ -4,7 +4,7 @@ import {
4
4
  searchDocs2,
5
5
  readDoc2,
6
6
  pinnedLink2
7
- } from "./chunk-t9chwen8.js";
7
+ } from "./chunk-q1y9qjjp.js";
8
8
  export {
9
9
  DefaultDocsSearchLimit2 as DefaultDocsSearchLimit,
10
10
  pinnedLink2 as pinnedLink,
@@ -12,7 +12,7 @@ import {
12
12
  succeed,
13
13
  isSuccess,
14
14
  TaggedError,
15
- make15,
15
+ make16,
16
16
  _await,
17
17
  fail5,
18
18
  succeed5,
@@ -104,7 +104,7 @@ import {
104
104
  decodeJsonString,
105
105
  encodeJsonStringSync,
106
106
  encodePrettyJsonString
107
- } from "./chunk-1jabs81x.js";
107
+ } from "./chunk-ec01eq70.js";
108
108
  import {
109
109
  tap,
110
110
  mapError,
@@ -116,7 +116,7 @@ import {
116
116
  withDefault,
117
117
  option,
118
118
  String2
119
- } from "./chunk-avhqm9p0.js";
119
+ } from "./chunk-tnrmd4hz.js";
120
120
  import {
121
121
  currentTimeMillis,
122
122
  SecureRandom,
@@ -168,7 +168,7 @@ import {
168
168
  digestSha256,
169
169
  sha256Hasher,
170
170
  raw,
171
- make4,
171
+ make5,
172
172
  get,
173
173
  put,
174
174
  HttpClient,
@@ -232,14 +232,14 @@ import {
232
232
  harnessNames,
233
233
  herdrRunnerCapabilities2,
234
234
  declaredChecks
235
- } from "./chunk-ryxff0xk.js";
235
+ } from "./chunk-qd9bkybz.js";
236
236
  import {
237
237
  Id
238
- } from "./chunk-h6kd80nr.js";
238
+ } from "./chunk-yv2mq2e9.js";
239
239
  import {
240
240
  ChildProcessSpawner,
241
- make2
242
- } from "./chunk-qqmxhk9w.js";
241
+ make3
242
+ } from "./chunk-me1zn085.js";
243
243
 
244
244
  // apps/cli/src/cli-error.ts
245
245
  function cliErrorCode(error, status) {
@@ -1020,10 +1020,10 @@ var sandboxMissing = (sandbox, missing) => ({
1020
1020
  var personalCheckBackend = (agentSandbox, dockerAvailable) => agentSandbox === "srt" || agentSandbox === "docker" && dockerAvailable ? agentSandbox : undefined;
1021
1021
  var herdrCoreSession = (runnerId, personal) => personal ? undefined : `kitman-${sha2562(runnerId).slice(0, 16)}`;
1022
1022
  var OpenHerdrCore = Reference("kitman/cli/OpenHerdrCore", {
1023
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-3csj1ve1.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
1023
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-kg32dz1w.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
1024
1024
  });
1025
1025
  var UpdateHerdrCore = Reference("kitman/cli/UpdateHerdrCore", {
1026
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-3csj1ve1.js")), (module) => module.updateHerdrCore(options))
1026
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-kg32dz1w.js")), (module) => module.updateHerdrCore(options))
1027
1027
  });
1028
1028
  var herdrCoreMissing = (error) => {
1029
1029
  if (isTagged(error, "HerdrCoreMissing"))
@@ -1198,7 +1198,7 @@ var settingChangeRows = (history) => history.items.map((change) => ({
1198
1198
 
1199
1199
  // apps/cli/src/managed-install.ts
1200
1200
  var RunnerReleaseManifest = Struct({
1201
- version: String4.check(isPattern(/^[\w.+-]+$/u)),
1201
+ version: String4.check(isPattern(/^(?!\.+$)[\w.+-]+$/u)),
1202
1202
  platforms: ArraySchema(Struct({ os: String4, architecture: String4, sha256: String4, url: String4 }))
1203
1203
  });
1204
1204
  var versionsDirectory = (platform) => gen(function* () {
@@ -1277,10 +1277,24 @@ var linkManagedKitman = (kitman) => gen(function* () {
1277
1277
  const path = yield* Path;
1278
1278
  const link = yield* managedKitmanPath;
1279
1279
  const nextLink = `${link}.next`;
1280
+ const previous = yield* fs.readLink(link).pipe(map8((target) => path.resolve(path.dirname(link), target)), orElseSucceed(() => {
1281
+ return;
1282
+ }));
1280
1283
  yield* fs.makeDirectory(path.dirname(link), { recursive: true });
1281
1284
  yield* ignore(fs.remove(nextLink));
1282
1285
  yield* fs.symlink(kitman, nextLink);
1283
1286
  yield* fs.rename(nextLink, link);
1287
+ const versions = path.dirname(path.dirname(kitman));
1288
+ if (previous === kitman || path.basename(versions) !== "versions")
1289
+ return;
1290
+ const kept = new Set([kitman, ...previous === undefined ? [] : [previous]].map((kept) => path.dirname(kept)));
1291
+ const installed = yield* fs.readDirectory(versions).pipe(orElseSucceed(() => []));
1292
+ for (const version of installed) {
1293
+ const directory = path.join(versions, version);
1294
+ const managed = yield* fs.exists(path.join(directory, "kitman")).pipe(orElseSucceed(() => false));
1295
+ if (managed && !version.startsWith(".") && !kept.has(directory))
1296
+ yield* ignore(fs.remove(directory, { recursive: true }));
1297
+ }
1284
1298
  });
1285
1299
  var installManagedKitman = (apiUrl, platform) => gen(function* () {
1286
1300
  const downloaded = yield* downloadManagedKitman(apiUrl, platform);
@@ -1449,7 +1463,7 @@ var syncTargets = (harness) => gen(function* () {
1449
1463
  });
1450
1464
  var syncKits = (input) => gen(function* () {
1451
1465
  const fs = yield* FileSystem;
1452
- const { syncKitSetup } = yield* promise(() => import("./chunk-m9x7feh0.js"));
1466
+ const { syncKitSetup } = yield* promise(() => import("./chunk-ra22g5nv.js"));
1453
1467
  const harnesses = yield* syncTargets(input.harness);
1454
1468
  const chain = yield* input.client.getKitChain(input.workspaceId);
1455
1469
  for (const { name, problem } of chain.skipped)
@@ -1966,7 +1980,7 @@ var ServiceManager = Reference("kitman/cli/ServiceManager", {
1966
1980
  run: (command, args) => runCommand2(command, args),
1967
1981
  attach: (command, args) => gen(function* () {
1968
1982
  const spawner = yield* ChildProcessSpawner;
1969
- const handle = yield* spawner.spawn(make2(command, args, { stdin: "inherit", stdout: "inherit", stderr: "inherit" }));
1983
+ const handle = yield* spawner.spawn(make3(command, args, { stdin: "inherit", stdout: "inherit", stderr: "inherit" }));
1970
1984
  const exitCode = yield* handle.exitCode;
1971
1985
  if (exitCode !== 0)
1972
1986
  return yield* new CommandFailed2({ command, reason: `exit code ${exitCode}` });
@@ -2368,7 +2382,7 @@ var package_default = {
2368
2382
  };
2369
2383
 
2370
2384
  // apps/cli/src/scaffold.ts
2371
- var cliVersion = "0.14.2";
2385
+ var cliVersion = "0.14.4";
2372
2386
  var packageJson = (name, scaffold) => `${JSON.stringify({
2373
2387
  name,
2374
2388
  private: true,
@@ -2520,7 +2534,7 @@ var scaffoldKit = (directory, scaffold = {}) => gen(function* () {
2520
2534
 
2521
2535
  // apps/cli/src/commands.ts
2522
2536
  var ClientId = "kitman-cli";
2523
- var agentRuntime = promise(() => import("./chunk-24j1cmsm.js"));
2537
+ var agentRuntime = promise(() => import("./chunk-zv1sshtj.js"));
2524
2538
  var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
2525
2539
  defaultValue: () => gen(function* () {
2526
2540
  const tui = yield* tryPromise({
@@ -3556,7 +3570,7 @@ var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
3556
3570
  });
3557
3571
  var OpenRunnerRpc = Reference("kitman/cli/OpenRunnerRpc", {
3558
3572
  defaultValue: () => (options) => gen(function* () {
3559
- const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-q4ch3t9q.js"));
3573
+ const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-c6fanp7r.js"));
3560
3574
  return yield* makeRunnerRpcClient({
3561
3575
  runnerId: options.runnerId,
3562
3576
  bearer: options.bearer,
@@ -3868,7 +3882,7 @@ function startCanonicalHerdrRunnerCommand(input) {
3868
3882
  yield* controlPlane.client.listRepoBindings(runner.workspaceId).pipe(flatMap3(({ items }) => forEach(items.filter((binding) => binding.status === "active" && (teamId === undefined || binding.teamId === teamId)), (repoBinding) => map8(checkouts.reaches(repoBinding), (reachable) => ({ repoBinding, reachable })), { concurrency: 4 })), tap2((probed) => sync2(() => reached = probed)), catch_((error) => logWarning("runner_repository_probe_failed", error.message)), flatMap3(() => sleep(reached.some((probe) => !probe.reachable) ? repositoryRetryInterval : repositoryProbeInterval)), forever, forkScoped);
3869
3883
  yield* suspend3(() => sleep(ownerLogin.expired() ? ownerLoginRetryInterval : ownerLoginInterval)).pipe(andThen2(checkOwnerLogin), forever, forkScoped);
3870
3884
  const platform = yield* context();
3871
- const updated = yield* make15();
3885
+ const updated = yield* make16();
3872
3886
  const scope = yield* scope2;
3873
3887
  const startUpdate = (update) => update.pipe(catch_((error) => andThen2(restartOntoUpdate(input.runnerId), fail5(updated, error))), provideContext2(platform), forkIn(scope), asVoid);
3874
3888
  const refusedForProtocol = container ? updater.stopWhenDrained(new RunnerStopped({ problem: updateRequired })).pipe(catch_((stopped) => fail5(updated, stopped)), forkIn(scope), asVoid) : startUpdate(updater.updateRequired);
@@ -4123,7 +4137,7 @@ function mcpCommand(args) {
4123
4137
  if (command.action === "run") {
4124
4138
  if (command.args.length > 0)
4125
4139
  return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
4126
- const { runMcpServerCommand } = yield* promise(() => import("./chunk-80vwvv5x.js"));
4140
+ const { runMcpServerCommand } = yield* promise(() => import("./chunk-wvhm5fgh.js"));
4127
4141
  return yield* runMcpServerCommand({ flags: command.flags });
4128
4142
  }
4129
4143
  if (command.action !== "setup")
@@ -4611,7 +4625,7 @@ function programLoopCommand(command) {
4611
4625
  return yield* new CliError({ message: `Unknown loop command: ${command.action}` });
4612
4626
  });
4613
4627
  }
4614
- var docsModule = promise(() => import("./chunk-gwz39037.js"));
4628
+ var docsModule = promise(() => import("./chunk-6zwwrpve.js"));
4615
4629
  function docsCommand(args) {
4616
4630
  return gen(function* () {
4617
4631
  const command = parseCommand(args);
@@ -5453,9 +5467,9 @@ function changeRequestCommand(args) {
5453
5467
  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}`);
5454
5468
  });
5455
5469
  }
5456
- var KitWriter = map8(promise(() => import("./chunk-z7c2ndfg.js")), (build) => build.writeKit);
5470
+ var KitWriter = map8(promise(() => import("./chunk-v26jmjr0.js")), (build) => build.writeKit);
5457
5471
  var KitBuilder = Reference("kitman/cli/KitBuilder", {
5458
- defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-z7c2ndfg.js")), (build) => build.buildKit(directory))
5472
+ defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-v26jmjr0.js")), (build) => build.buildKit(directory))
5459
5473
  });
5460
5474
  var uploadKit = (client, workspaceId, built) => gen(function* () {
5461
5475
  yield* client.uploadKitBundle(workspaceId, built.digest, { bundle: encode2(built.bundle) });
@@ -6232,7 +6246,7 @@ function downloadPresignedAsset(download, outputPath) {
6232
6246
  return gen(function* () {
6233
6247
  const fs = yield* FileSystem;
6234
6248
  const failed = (cause) => new CliError({ message: `Asset download failed: ${String(cause)}` });
6235
- const response = yield* send(make4(download.method)(download.url), failed);
6249
+ const response = yield* send(make5(download.method)(download.url), failed);
6236
6250
  if (response.status < 200 || response.status >= 300)
6237
6251
  return yield* new CliError({ message: `Asset download failed with ${response.status}` });
6238
6252
  const body = yield* response.arrayBuffer.pipe(mapError2((error) => failed(error.message)));
@@ -4,12 +4,12 @@ import {
4
4
  runnerRpcUrl2,
5
5
  makeRunnerRpcClient2,
6
6
  makeProgramRpcClient2
7
- } from "./chunk-v86jpzpr.js";
8
- import"./chunk-yfag1eey.js";
9
- import"./chunk-ryxff0xk.js";
10
- import"./chunk-h6kd80nr.js";
11
- import"./chunk-avhqm9p0.js";
12
- import"./chunk-1jabs81x.js";
7
+ } from "./chunk-4yvafzhp.js";
8
+ import"./chunk-rx2cg7rn.js";
9
+ import"./chunk-qd9bkybz.js";
10
+ import"./chunk-yv2mq2e9.js";
11
+ import"./chunk-tnrmd4hz.js";
12
+ import"./chunk-ec01eq70.js";
13
13
  export {
14
14
  makeProgramRpcClient2 as makeProgramRpcClient,
15
15
  makeRunnerRpcClient2 as makeRunnerRpcClient,
@@ -75,10 +75,10 @@ import {
75
75
  toEquivalence,
76
76
  toCodecJson,
77
77
  Json
78
- } from "./chunk-1jabs81x.js";
78
+ } from "./chunk-ec01eq70.js";
79
79
  import {
80
80
  guard
81
- } from "./chunk-h6kd80nr.js";
81
+ } from "./chunk-yv2mq2e9.js";
82
82
  import {
83
83
  currentTimeMillis,
84
84
  WebCrypto,
@@ -105,11 +105,11 @@ import {
105
105
  KitDigest,
106
106
  KitSetup,
107
107
  RunnerRpcError
108
- } from "./chunk-ryxff0xk.js";
108
+ } from "./chunk-qd9bkybz.js";
109
109
  import {
110
110
  runForEach,
111
111
  FileSystem
112
- } from "./chunk-avhqm9p0.js";
112
+ } from "./chunk-tnrmd4hz.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");