@kitman-sh/cli 0.12.0-rc.4 → 0.12.0-rc.5

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/dist/{chunk-t2mr6z38.js → chunk-26mj3vr6.js} +37 -37
  2. package/dist/{chunk-b50dvx41.js → chunk-2s4x5t92.js} +5 -5
  3. package/dist/{chunk-74txrt4s.js → chunk-31hk2bjb.js} +4 -4
  4. package/dist/{chunk-k81ay8y5.js → chunk-3530xts6.js} +10 -10
  5. package/dist/{chunk-zmcghp8w.js → chunk-5zzfsv07.js} +43 -183
  6. package/dist/{chunk-ezf2myj0.js → chunk-6x9e1etb.js} +3 -3
  7. package/dist/{chunk-r1z41qx6.js → chunk-77k89h98.js} +329 -181
  8. package/dist/{chunk-ydydx55z.js → chunk-bbadvwds.js} +1 -1
  9. package/dist/{chunk-bq55md8p.js → chunk-bj73db3f.js} +1 -1
  10. package/dist/{chunk-6b0k02x4.js → chunk-bv9e34qz.js} +1 -1
  11. package/dist/{chunk-xavcp9se.js → chunk-cegdw7gw.js} +2 -2
  12. package/dist/{chunk-nzsrse8d.js → chunk-dd8hae73.js} +61 -60
  13. package/dist/{chunk-kybp1mkk.js → chunk-e838cw9z.js} +11 -11
  14. package/dist/{chunk-w0aj9mkz.js → chunk-gr816kwr.js} +10 -10
  15. package/dist/{chunk-ckkpqcfv.js → chunk-hrds2xy2.js} +7 -7
  16. package/dist/{chunk-e7q2frvs.js → chunk-k9jd2dm0.js} +7 -7
  17. package/dist/{chunk-w6cm939j.js → chunk-kvm7j3ed.js} +19 -19
  18. package/dist/{chunk-7kjsvwzv.js → chunk-nc1rxeav.js} +8 -8
  19. package/dist/{chunk-pw10mq9e.js → chunk-rjdptgqf.js} +4 -4
  20. package/dist/{chunk-aafxvmj1.js → chunk-s1pjsak4.js} +7 -7
  21. package/dist/{chunk-xy5f2nv9.js → chunk-s661f8p0.js} +2 -2
  22. package/dist/{chunk-79gx7ek9.js → chunk-txyp31q5.js} +59 -101
  23. package/dist/{chunk-qjd6w9sw.js → chunk-x70r99jg.js} +2 -2
  24. package/dist/{chunk-c9007k48.js → chunk-xmq9zpr1.js} +1 -1
  25. package/dist/{chunk-jntxtx9j.js → chunk-y2mkzww9.js} +60 -14
  26. package/dist/{chunk-rjasmnav.js → chunk-yafg281p.js} +39 -26
  27. package/dist/index.js +4 -4
  28. package/package.json +1 -1
@@ -96,7 +96,7 @@ import {
96
96
  decodeJsonString,
97
97
  encodeJsonStringSync,
98
98
  encodePrettyJsonString
99
- } from "./chunk-79gx7ek9.js";
99
+ } from "./chunk-txyp31q5.js";
100
100
  import {
101
101
  tap,
102
102
  mapError,
@@ -108,7 +108,7 @@ import {
108
108
  withDefault,
109
109
  option,
110
110
  String2
111
- } from "./chunk-zmcghp8w.js";
111
+ } from "./chunk-5zzfsv07.js";
112
112
  import {
113
113
  currentTimeMillis,
114
114
  SecureRandom,
@@ -156,7 +156,7 @@ import {
156
156
  digestSha256,
157
157
  sha256Hasher,
158
158
  raw,
159
- make4,
159
+ make5,
160
160
  get,
161
161
  put,
162
162
  HttpClient,
@@ -218,10 +218,10 @@ import {
218
218
  harnessNames,
219
219
  herdrRunnerCapabilities2,
220
220
  declaredChecks
221
- } from "./chunk-r1z41qx6.js";
221
+ } from "./chunk-77k89h98.js";
222
222
  import {
223
223
  Id
224
- } from "./chunk-6b0k02x4.js";
224
+ } from "./chunk-bv9e34qz.js";
225
225
  import {
226
226
  toJsonValue,
227
227
  isOneOf,
@@ -231,11 +231,11 @@ import {
231
231
  isObject,
232
232
  isJsonObject,
233
233
  isString
234
- } from "./chunk-c9007k48.js";
234
+ } from "./chunk-xmq9zpr1.js";
235
235
  import {
236
236
  ChildProcessSpawner,
237
- make2
238
- } from "./chunk-jntxtx9j.js";
237
+ make3
238
+ } from "./chunk-y2mkzww9.js";
239
239
 
240
240
  // apps/cli/src/cli-error.ts
241
241
  function cliErrorCode(error, status) {
@@ -452,7 +452,7 @@ var Usage = [
452
452
  " kitman loop show <loop>",
453
453
  " kitman loop starts [--limit <n>] (what Events started, or why they started nothing)",
454
454
  " kitman loop when <loop> <event> on|off (turn an automatic start on or off for the Team)",
455
- " kitman agent list",
455
+ " kitman agent list [--team <team>] (each Agent as the Team's Runs resolve it, or the Workspace's without a Team)",
456
456
  "",
457
457
  "Kits of your own, to deploy with kitman deploy:",
458
458
  " kitman init --kit [dir] (a new Kit with an example Loop and a GitLab pipeline)",
@@ -693,7 +693,7 @@ var examples = [
693
693
  "kitman loop fork build ./kits/my-build",
694
694
  "kitman loop catalog",
695
695
  `kitman loop validate build --input '{"task":"KIT-42"}'`,
696
- "kitman agent list",
696
+ "kitman agent list --team KIT",
697
697
  "kitman verify list",
698
698
  'kitman verify add unit-tests "bun run test" --cwd apps/cli',
699
699
  "kitman verify remove unit-tests",
@@ -987,10 +987,10 @@ var sandboxMissing = (sandbox, missing) => ({
987
987
  var personalCheckBackend = (agentSandbox, dockerAvailable) => agentSandbox === "srt" || agentSandbox === "docker" && dockerAvailable ? agentSandbox : undefined;
988
988
  var herdrCoreSession = (runnerId, personal) => personal ? undefined : `kitman-${sha2562(runnerId).slice(0, 16)}`;
989
989
  var OpenHerdrCore = Reference("kitman/cli/OpenHerdrCore", {
990
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-74txrt4s.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
990
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-31hk2bjb.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
991
991
  });
992
992
  var UpdateHerdrCore = Reference("kitman/cli/UpdateHerdrCore", {
993
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-74txrt4s.js")), (module) => module.updateHerdrCore(options))
993
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-31hk2bjb.js")), (module) => module.updateHerdrCore(options))
994
994
  });
995
995
  var herdrCoreMissing = (error) => {
996
996
  if (isTagged(error, "HerdrCoreMissing"))
@@ -1410,7 +1410,7 @@ var syncTargets = (harness) => gen(function* () {
1410
1410
  });
1411
1411
  var syncKits = (input) => gen(function* () {
1412
1412
  const fs = yield* FileSystem;
1413
- const { syncKitSetup } = yield* promise(() => import("./chunk-kybp1mkk.js"));
1413
+ const { syncKitSetup } = yield* promise(() => import("./chunk-e838cw9z.js"));
1414
1414
  const harnesses = yield* syncTargets(input.harness);
1415
1415
  const chain = yield* input.client.getKitChain(input.workspaceId);
1416
1416
  for (const { name, problem } of chain.skipped)
@@ -1926,7 +1926,7 @@ var ServiceManager = Reference("kitman/cli/ServiceManager", {
1926
1926
  run: (command, args) => runCommand2(command, args),
1927
1927
  attach: (command, args) => gen(function* () {
1928
1928
  const spawner = yield* ChildProcessSpawner;
1929
- const handle = yield* spawner.spawn(make2(command, args, { stdin: "inherit", stdout: "inherit", stderr: "inherit" }));
1929
+ const handle = yield* spawner.spawn(make3(command, args, { stdin: "inherit", stdout: "inherit", stderr: "inherit" }));
1930
1930
  const exitCode = yield* handle.exitCode;
1931
1931
  if (exitCode !== 0)
1932
1932
  return yield* new CommandFailed2({ command, reason: `exit code ${exitCode}` });
@@ -2328,7 +2328,7 @@ var package_default = {
2328
2328
  };
2329
2329
 
2330
2330
  // apps/cli/src/scaffold.ts
2331
- var cliVersion = "0.12.0-rc.4";
2331
+ var cliVersion = "0.12.0-rc.5";
2332
2332
  var packageJson = (name, scaffold) => `${JSON.stringify({
2333
2333
  name,
2334
2334
  private: true,
@@ -2480,7 +2480,7 @@ var scaffoldKit = (directory, scaffold = {}) => gen(function* () {
2480
2480
 
2481
2481
  // apps/cli/src/commands.ts
2482
2482
  var ClientId = "kitman-cli";
2483
- var agentRuntime = promise(() => import("./chunk-nzsrse8d.js"));
2483
+ var agentRuntime = promise(() => import("./chunk-dd8hae73.js"));
2484
2484
  var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
2485
2485
  defaultValue: () => gen(function* () {
2486
2486
  const tui = yield* tryPromise({
@@ -3482,7 +3482,7 @@ var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
3482
3482
  });
3483
3483
  var OpenRunnerRpc = Reference("kitman/cli/OpenRunnerRpc", {
3484
3484
  defaultValue: () => (options) => gen(function* () {
3485
- const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-aafxvmj1.js"));
3485
+ const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-s1pjsak4.js"));
3486
3486
  return yield* makeRunnerRpcClient({
3487
3487
  runnerId: options.runnerId,
3488
3488
  bearer: options.bearer,
@@ -4014,7 +4014,7 @@ function mcpCommand(args) {
4014
4014
  if (command.action === "run") {
4015
4015
  if (command.args.length > 0)
4016
4016
  return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
4017
- const { runMcpServerCommand } = yield* promise(() => import("./chunk-t2mr6z38.js"));
4017
+ const { runMcpServerCommand } = yield* promise(() => import("./chunk-26mj3vr6.js"));
4018
4018
  return yield* runMcpServerCommand({ flags: command.flags });
4019
4019
  }
4020
4020
  if (command.action !== "setup")
@@ -4502,7 +4502,7 @@ function programLoopCommand(command) {
4502
4502
  return yield* new CliError({ message: `Unknown loop command: ${command.action}` });
4503
4503
  });
4504
4504
  }
4505
- var docsModule = promise(() => import("./chunk-ydydx55z.js"));
4505
+ var docsModule = promise(() => import("./chunk-bbadvwds.js"));
4506
4506
  function docsCommand(args) {
4507
4507
  return gen(function* () {
4508
4508
  const command = parseCommand(args);
@@ -4536,11 +4536,11 @@ function docsCommand(args) {
4536
4536
  `));
4537
4537
  });
4538
4538
  }
4539
+ var agentListOptions = new Set(["--team", "--json", "--api-url", "--workspace"]);
4539
4540
  function agentCommand(args) {
4540
4541
  return gen(function* () {
4541
4542
  const command = parseCommand(args);
4542
4543
  const client = yield* loopClientFor(yield* resolveApiUrl(command.flags.apiUrl));
4543
- const print = (value, lines) => command.flags.json ? printJson(value) : forEach(lines(value), (line) => log(line), { discard: true });
4544
4544
  const resolvedField = (agent, field) => {
4545
4545
  const value = agent[field];
4546
4546
  const layer = agent.fieldLayers?.[field];
@@ -4573,9 +4573,22 @@ function agentCommand(args) {
4573
4573
  listField(agent, "skills")
4574
4574
  ].filter((field) => field !== "").join(" ");
4575
4575
  if (command.action === "list") {
4576
- const teamId = yield* optionalActiveTeamId(command.flags);
4577
- const listed = yield* client.listProgramAgents(yield* activeWorkspaceId(command.flags), teamId === undefined ? {} : { teamId });
4578
- return yield* print(listed, (value) => value.items.map(agentLine));
4576
+ const takes = "it takes --team <team> and --json";
4577
+ const refusedOption = args.slice(2).find((arg) => arg.startsWith("-") && !agentListOptions.has(arg));
4578
+ if (refusedOption !== undefined)
4579
+ return yield* new CliError({ message: `kitman agent list does not take ${refusedOption}; ${takes}` });
4580
+ if (command.args.length > 0)
4581
+ return yield* new CliError({ message: `kitman agent list takes no arguments; ${takes}` });
4582
+ const workspaceId = yield* activeWorkspaceId(command.flags);
4583
+ const teamRef = command.flags.team ?? (yield* optionalActiveTeamId(command.flags));
4584
+ const listed = yield* client.listProgramAgents(workspaceId, teamRef === undefined ? {} : { teamId: teamRef }).pipe(catchIf((error) => teamRef !== undefined && error.status === 404, () => fail7(new CliError({ message: `No Team ${teamRef} in the Workspace` }))));
4585
+ if (command.flags.json)
4586
+ return yield* printJson(listed);
4587
+ const team = teamRef === undefined ? undefined : yield* teamNamed(client, workspaceId, teamRef);
4588
+ const heading = team === undefined ? "Agents as the Workspace resolves them, the workspace layer only; --team <team> adds a Team's layer:" : `Agents as ${command.flags.team === undefined ? "the active " : ""}Team ${team.key}'s Runs resolve them, each field with the layer it came from:`;
4589
+ return yield* forEach([heading, ...listed.items.map(agentLine)], (line) => log(line), {
4590
+ discard: true
4591
+ });
4579
4592
  }
4580
4593
  return yield* new CliError({ message: `Unknown agent command: ${command.action}. Use kitman agent list.` });
4581
4594
  });
@@ -5322,9 +5335,9 @@ function changeRequestCommand(args) {
5322
5335
  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}`);
5323
5336
  });
5324
5337
  }
5325
- var KitWriter = map8(promise(() => import("./chunk-w6cm939j.js")), (build) => build.writeKit);
5338
+ var KitWriter = map8(promise(() => import("./chunk-kvm7j3ed.js")), (build) => build.writeKit);
5326
5339
  var KitBuilder = Reference("kitman/cli/KitBuilder", {
5327
- defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-w6cm939j.js")), (build) => build.buildKit(directory))
5340
+ defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-kvm7j3ed.js")), (build) => build.buildKit(directory))
5328
5341
  });
5329
5342
  var uploadKit = (client, workspaceId, built) => gen(function* () {
5330
5343
  yield* client.uploadKitBundle(workspaceId, built.digest, { bundle: encode2(built.bundle) });
@@ -6100,7 +6113,7 @@ function downloadPresignedAsset(download, outputPath) {
6100
6113
  return gen(function* () {
6101
6114
  const fs = yield* FileSystem;
6102
6115
  const failed = (cause) => new CliError({ message: `Asset download failed: ${String(cause)}` });
6103
- const response = yield* send(make4(download.method)(download.url), failed);
6116
+ const response = yield* send(make5(download.method)(download.url), failed);
6104
6117
  if (response.status < 200 || response.status >= 300)
6105
6118
  return yield* new CliError({ message: `Asset download failed with ${response.status}` });
6106
6119
  const body = yield* response.arrayBuffer.pipe(mapError2((error) => failed(error.message)));
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-xy5f2nv9.js");
8
+ const { runSrtCli } = await import("./chunk-s661f8p0.js");
9
9
  await runSrtCli();
10
10
  } else if (args[0] === "srt-step") {
11
- const { runSrtStep } = await import("./chunk-pw10mq9e.js");
11
+ const { runSrtStep } = await import("./chunk-rjdptgqf.js");
12
12
  await runSrtStep(args.slice(1));
13
13
  } else if (args[0] === "opencode-read") {
14
- const { runOpencodeReader } = await import("./chunk-b50dvx41.js");
14
+ const { runOpencodeReader } = await import("./chunk-2s4x5t92.js");
15
15
  runOpencodeReader();
16
16
  } else {
17
- const { runCli } = await import("./chunk-rjasmnav.js");
17
+ const { runCli } = await import("./chunk-yafg281p.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.12.0-rc.4",
3
+ "version": "0.12.0-rc.5",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {