@kitman-sh/cli 0.11.0-rc.5 → 0.11.0

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.
@@ -38,7 +38,7 @@ import {
38
38
  get2,
39
39
  layer4,
40
40
  KitDigest
41
- } from "./chunk-rtqdqr0v.js";
41
+ } from "./chunk-9z371t6k.js";
42
42
 
43
43
  // packages/core/src/npm-registry.ts
44
44
  var KitManifest = Struct({
@@ -37,10 +37,10 @@ import {
37
37
  AgentHarnessIds,
38
38
  sha2562,
39
39
  runCommand2
40
- } from "./chunk-rtqdqr0v.js";
40
+ } from "./chunk-9z371t6k.js";
41
41
  import {
42
42
  NpmRegistry
43
- } from "./chunk-9a2r12ye.js";
43
+ } from "./chunk-0ca9dqh5.js";
44
44
 
45
45
  // packages/agent-runtime/src/config-convergence.ts
46
46
  var writeAgentEnvironmentConfigFile2 = fnUntraced(function* (file, content, keep = {}) {
@@ -123,7 +123,7 @@ import {
123
123
  ParseOptions,
124
124
  RpcClientDefect,
125
125
  RpcClientError
126
- } from "./chunk-rtqdqr0v.js";
126
+ } from "./chunk-9z371t6k.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")) {
@@ -26,15 +26,15 @@ import {
26
26
  tomlKeyPath2,
27
27
  kitmanSkillEntry,
28
28
  isPathWithin2
29
- } from "./chunk-5hx3j5x8.js";
29
+ } from "./chunk-3y7j2s7v.js";
30
30
  import {
31
31
  instructionsStart,
32
32
  instructionsEnd,
33
33
  renderMcpServer,
34
34
  materializeKitSetup,
35
35
  tomlInline
36
- } from "./chunk-rtqdqr0v.js";
37
- import"./chunk-9a2r12ye.js";
36
+ } from "./chunk-9z371t6k.js";
37
+ import"./chunk-0ca9dqh5.js";
38
38
  import"./chunk-sk6ceghr.js";
39
39
 
40
40
  // packages/agent-runtime/src/kit-setup-sync.ts
@@ -105,7 +105,7 @@ import {
105
105
  KitDigest,
106
106
  KitSetup,
107
107
  RunnerRpcError
108
- } from "./chunk-rtqdqr0v.js";
108
+ } from "./chunk-9z371t6k.js";
109
109
  import {
110
110
  runForEach,
111
111
  FileSystem
@@ -239,6 +239,14 @@ var LoopCapabilities = [
239
239
  var JsonObject = Record(String4, Json);
240
240
  var SecretName = String4.check(isPattern(/^[A-Za-z_][A-Za-z0-9_]{0,127}$/));
241
241
  var EventFilterValue = Union([String4, Finite, Boolean2, Null]);
242
+ var WhenClause = Struct({
243
+ event: String4,
244
+ filter: optionalKey(Record(String4, Union([EventFilterValue, ArraySchema(EventFilterValue)]))),
245
+ input: Record(String4, String4),
246
+ values: optionalKey(JsonObject),
247
+ optIn: optionalKey(Boolean2),
248
+ description: optionalKey(String4)
249
+ });
242
250
  var LoopManifest = Struct({
243
251
  id: String4,
244
252
  title: String4,
@@ -248,12 +256,7 @@ var LoopManifest = Struct({
248
256
  outcome: optionalKey(Literals(["feature", "bug", "refactor", "investigation", "docs", "migration", "performance"])),
249
257
  agents: Record(String4, String4),
250
258
  checkout: Literals(["none", "read", "write"]),
251
- when: ArraySchema(Struct({
252
- event: String4,
253
- filter: optionalKey(Record(String4, Union([EventFilterValue, ArraySchema(EventFilterValue)]))),
254
- input: Record(String4, String4),
255
- values: optionalKey(JsonObject)
256
- })),
259
+ when: ArraySchema(WhenClause),
257
260
  offers: ArraySchema(Struct({
258
261
  id: String4,
259
262
  title: String4,
@@ -271,7 +274,7 @@ var LoopDetail = Struct({
271
274
  resolved: optionalKey(Struct({
272
275
  ...ProgramLoop.fields,
273
276
  agents: LoopManifest.fields.agents,
274
- when: LoopManifest.fields.when,
277
+ when: ArraySchema(Struct({ ...WhenClause.fields, on: optionalKey(Boolean2) })),
275
278
  schedule: optionalKey(Struct({
276
279
  rule: ScheduleRule,
277
280
  timezone: String4,
@@ -509,7 +512,8 @@ var VerifyResult = Struct({
509
512
  // packages/sdk/src/loop/steps.ts
510
513
  class StepFailed extends TaggedError2()("StepFailed", {
511
514
  step: String4,
512
- reason: String4
515
+ reason: String4,
516
+ code: optional(String4)
513
517
  }) {
514
518
  get message() {
515
519
  return `Step "${this.step}" failed: ${this.reason}`;
@@ -679,7 +683,10 @@ var AlertTaskResult = Struct({
679
683
  resolved: optionalKey(Boolean2),
680
684
  joined: optionalKey(Struct({ kind: Literals(["run", "recent"]), runId: String4 }))
681
685
  });
682
- var IntegrationBranchRequest = Struct({ repoBindingId: optional(String4) });
686
+ var IntegrationBranchRequest = Struct({
687
+ repoBindingId: optional(String4),
688
+ base: optional(Boolean2)
689
+ });
683
690
  var IntegrationBranch = Struct({
684
691
  repoBindingId: String4,
685
692
  branch: String4,
@@ -760,6 +767,7 @@ var PipelineStatus = Struct({
760
767
  jobs: ArraySchema(PipelineJob),
761
768
  readAt: optionalKey(String4),
762
769
  runnerChecks: optionalKey(ArraySchema(String4)),
770
+ targetChecks: optionalKey(ArraySchema(String4)),
763
771
  approved: optionalKey(String4),
764
772
  repository: optionalKey(String4),
765
773
  sourceBranch: optionalKey(String4),
@@ -46,6 +46,7 @@ import {
46
46
  as,
47
47
  asSome2,
48
48
  asVoid,
49
+ zipWith,
49
50
  catch_,
50
51
  catchTag,
51
52
  catchTags,
@@ -139,6 +140,7 @@ import {
139
140
  defaultRunnerSettings,
140
141
  shownRunnerSetting,
141
142
  defaultRunnerCapabilities,
143
+ deliveryProviderActions,
142
144
  MemoryStatuses,
143
145
  MemoryScopes,
144
146
  MaxMemoryListLimit,
@@ -215,7 +217,7 @@ import {
215
217
  harnessNames,
216
218
  herdrRunnerCapabilities2,
217
219
  declaredChecks
218
- } from "./chunk-rtqdqr0v.js";
220
+ } from "./chunk-9z371t6k.js";
219
221
  import {
220
222
  Id
221
223
  } from "./chunk-0qz10ek8.js";
@@ -527,10 +529,10 @@ var sandboxMissing = (sandbox, missing) => ({
527
529
  var personalCheckBackend = (agentSandbox, dockerAvailable) => agentSandbox === "srt" || agentSandbox === "docker" && dockerAvailable ? agentSandbox : undefined;
528
530
  var herdrCoreSession = (runnerId, personal) => personal ? undefined : `kitman-${sha2562(runnerId).slice(0, 16)}`;
529
531
  var OpenHerdrCore = Reference("kitman/cli/OpenHerdrCore", {
530
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-x7b9bwk6.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
532
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-ryed23pv.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
531
533
  });
532
534
  var UpdateHerdrCore = Reference("kitman/cli/UpdateHerdrCore", {
533
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-x7b9bwk6.js")), (module) => module.updateHerdrCore(options))
535
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-ryed23pv.js")), (module) => module.updateHerdrCore(options))
534
536
  });
535
537
  var herdrCoreMissing = (error) => {
536
538
  if (isTagged(error, "HerdrCoreMissing"))
@@ -932,7 +934,7 @@ var syncTargets = (harness) => gen(function* () {
932
934
  });
933
935
  var syncKits = (input) => gen(function* () {
934
936
  const fs = yield* FileSystem;
935
- const { syncKitSetup } = yield* promise(() => import("./chunk-7fbpsnt7.js"));
937
+ const { syncKitSetup } = yield* promise(() => import("./chunk-5tp7y1kc.js"));
936
938
  const harnesses = yield* syncTargets(input.harness);
937
939
  const chain = yield* input.client.getKitChain(input.workspaceId);
938
940
  for (const { name, problem } of chain.skipped)
@@ -1850,7 +1852,7 @@ var package_default = {
1850
1852
  };
1851
1853
 
1852
1854
  // apps/cli/src/scaffold.ts
1853
- var cliVersion = "0.11.0-rc.5";
1855
+ var cliVersion = "0.11.0";
1854
1856
  var packageJson = (name, scaffold) => `${JSON.stringify({
1855
1857
  name,
1856
1858
  private: true,
@@ -2047,6 +2049,7 @@ var Usage = [
2047
2049
  " kitman loop list",
2048
2050
  " kitman loop show <loop>",
2049
2051
  " kitman loop starts [--limit <n>] (what Events started, or why they started nothing)",
2052
+ " kitman loop when <loop> <event> on|off (turn an automatic start on or off for the Team)",
2050
2053
  " kitman agent list",
2051
2054
  "",
2052
2055
  "Kits of your own, to deploy with kitman deploy:",
@@ -2055,7 +2058,7 @@ var Usage = [
2055
2058
  "",
2056
2059
  "Approved verifications of the current repository:",
2057
2060
  " kitman verify list",
2058
- ' kitman verify add <name> "<command>" [--cwd <directory>] [--pipeline]',
2061
+ ' kitman verify add <name> "<command>" [--cwd <directory>] [--pipeline] [--reads-target]',
2059
2062
  " kitman verify remove <name>",
2060
2063
  " kitman constraint list",
2061
2064
  ' kitman constraint add "<constraint>"',
@@ -2087,6 +2090,11 @@ var Usage = [
2087
2090
  " kitman release team <team> [merge|milestone|project|inherit]",
2088
2091
  " kitman release project <project> [merge|milestone|project|inherit]",
2089
2092
  "",
2093
+ "Where delivery lands: on the default branch, or a sub-task on its epic's branch and the epic on the default branch once every sub-task is done. A Project inherits its Team's, a Team the Workspace's:",
2094
+ " kitman land workspace [default|epic] (setting it needs an owner or admin)",
2095
+ " kitman land team <team> [default|epic|inherit]",
2096
+ " kitman land project <project> [default|epic|inherit]",
2097
+ "",
2090
2098
  "Repositories, Memory and Decisions belong to the Workspace or one Team:",
2091
2099
  " kitman repo list",
2092
2100
  " kitman repo add [--from-current-repo] [--team <team>]",
@@ -2110,7 +2118,7 @@ var Usage = [
2110
2118
  "Every run, loop, agent, verify, constraint, secret, claim, deploy, dev and kit command takes --json."
2111
2119
  ].join(`
2112
2120
  `);
2113
- var agentRuntime = promise(() => import("./chunk-cnzz61ta.js"));
2121
+ var agentRuntime = promise(() => import("./chunk-vpee5tme.js"));
2114
2122
  var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
2115
2123
  defaultValue: () => gen(function* () {
2116
2124
  const tui = yield* tryPromise({
@@ -2207,6 +2215,8 @@ function runEffect(args) {
2207
2215
  return yield* deliveryCommand(args);
2208
2216
  if (command === "release")
2209
2217
  return yield* releaseTriggerCommand(args);
2218
+ if (command === "land")
2219
+ return yield* deliveryTargetCommand(args);
2210
2220
  if (command === "lifecycle")
2211
2221
  return yield* lifecycleCommand(args);
2212
2222
  if (command === "sync")
@@ -2283,6 +2293,8 @@ function parseCommand(args) {
2283
2293
  flags.follow = true;
2284
2294
  else if (arg === "--pipeline")
2285
2295
  flags.pipeline = true;
2296
+ else if (arg === "--reads-target")
2297
+ flags.readsTarget = true;
2286
2298
  else if (arg === "--constraint" || arg === "--add-constraint" || arg === "--remove-constraint") {
2287
2299
  const value = args[++index];
2288
2300
  if (!value)
@@ -2796,6 +2808,46 @@ function releaseTriggerCommand(args) {
2796
2808
  return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
2797
2809
  });
2798
2810
  }
2811
+ var deliveryTargetWords = {
2812
+ default_branch: "on the default branch",
2813
+ epic_branch: "on its epic's branch, and the epic on the default branch once every sub-task is done"
2814
+ };
2815
+ var deliveryTargetLine = (subject, setting) => {
2816
+ const resolved = setting.resolved;
2817
+ return setting.target === null && resolved !== undefined ? `${subject} inherits: each Task lands ${deliveryTargetWords[resolved.target]}, from ${releaseLayerWords[resolved.layer]}` : setting.target === null ? `${subject} inherits its Team's delivery target` : `${subject} lands each Task ${deliveryTargetWords[setting.target]}`;
2818
+ };
2819
+ var deliveryChoices = { default: "default_branch", epic: "epic_branch", inherit: null };
2820
+ var isDeliveryChoice = (given) => Object.hasOwn(deliveryChoices, given);
2821
+ function deliveryTargetCommand(args) {
2822
+ return gen(function* () {
2823
+ const command = parseCommand(args);
2824
+ const apiUrl = yield* resolveApiUrl(command.flags.apiUrl);
2825
+ const client = yield* clientFor(apiUrl, yield* requiredSessionForApi(apiUrl));
2826
+ const workspaceId = yield* activeWorkspaceId(command.flags);
2827
+ const named = command.action === "workspace" ? undefined : requiredArg(command, command.action);
2828
+ const given = command.action === "workspace" ? command.args[0] : command.args[1];
2829
+ if (given !== undefined && !isDeliveryChoice(given))
2830
+ return yield* new CliError({ message: `land ${command.action} takes default, epic or inherit` });
2831
+ if (given === "inherit" && command.action === "workspace")
2832
+ return yield* new CliError({ message: "The Workspace has nothing to inherit from; give default or epic" });
2833
+ const update = given === undefined ? undefined : { target: deliveryChoices[given] };
2834
+ const report = (subject, setting) => command.flags.json ? printJson(setting) : log(deliveryTargetLine(subject, setting));
2835
+ if (command.action === "workspace")
2836
+ return yield* report("The Workspace", update === undefined ? yield* client.getWorkspaceDeliveryTarget(workspaceId) : yield* client.setWorkspaceDeliveryTarget(workspaceId, update));
2837
+ if (command.action === "team") {
2838
+ const team = yield* teamNamed(client, workspaceId, named ?? "");
2839
+ return yield* report(team.key, update === undefined ? yield* client.getTeamDeliveryTarget(team.id) : yield* client.setTeamDeliveryTarget(team.id, update));
2840
+ }
2841
+ if (command.action === "project") {
2842
+ const ref = (named ?? "").trim();
2843
+ const project = (yield* client.listProjects(workspaceId)).items.find((candidate) => candidate.id === ref || candidate.name.toLowerCase() === ref.toLowerCase());
2844
+ if (project === undefined)
2845
+ return yield* new CliError({ message: `No Project named ${ref}` });
2846
+ return yield* report(project.name, update === undefined ? yield* client.getProjectDeliveryTarget(workspaceId, project.id) : yield* client.setProjectDeliveryTarget(workspaceId, project.id, update));
2847
+ }
2848
+ return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
2849
+ });
2850
+ }
2799
2851
  var teamNamed = (client, workspaceId, ref) => flatMap3(client.listTeams(workspaceId), (teams) => teamIn(teams.items, ref));
2800
2852
  var ownerTo = (client, workspaceId, command) => gen(function* () {
2801
2853
  const to = command.flags.to;
@@ -3035,6 +3087,8 @@ function runnerCommand(args) {
3035
3087
  }
3036
3088
  if (command.action === "doctor") {
3037
3089
  const runners = yield* client.listRunners(workspaceId);
3090
+ const askedTeamId = command.flags.team === undefined ? undefined : (yield* teamNamed(client, workspaceId, command.flags.team)).id;
3091
+ const runnerDoctorRowHere = (runner) => zipWith(runnerDoctorRowOnThisMachine(runner), runnerDelivery(client, runner, askedTeamId), (row, delivery) => ({ ...row, ...delivery }));
3038
3092
  if (command.flags.runnerId === undefined && command.args.length === 0 && command.flags.backend === undefined)
3039
3093
  return yield* runners.items.length === 0 ? printRows([{ status: "no_runners", workspaceId, message: "No Runner registered for workspace." }], command.flags.json) : printRows(yield* forEach(runners.items, runnerDoctorRowHere), command.flags.json);
3040
3094
  const runner = command.flags.runnerId === undefined && command.args.length === 0 ? runners.items.find((item) => item.status === "active") ?? runners.items[0] : resolveRunnerRef(runners.items, command.flags.runnerId ?? command.args.join(" "));
@@ -3046,7 +3100,7 @@ function runnerCommand(args) {
3046
3100
  if (command.flags.backend !== "herdr")
3047
3101
  return yield* new CliError({ message: `Unsupported runner backend: ${command.flags.backend}` });
3048
3102
  const readiness = yield* checkHerdrRunnerReadiness(runner);
3049
- return yield* printRows([readiness], command.flags.json);
3103
+ return yield* printRows([{ ...readiness, ...yield* runnerDelivery(client, runner, askedTeamId) }], command.flags.json);
3050
3104
  }
3051
3105
  return yield* printRows([yield* runnerDoctorRowHere(runner)], command.flags.json);
3052
3106
  }
@@ -3061,7 +3115,7 @@ var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
3061
3115
  });
3062
3116
  var OpenRunnerRpc = Reference("kitman/cli/OpenRunnerRpc", {
3063
3117
  defaultValue: () => (options) => gen(function* () {
3064
- const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-vkgqtwqm.js"));
3118
+ const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-gjt5m6xc.js"));
3065
3119
  return yield* makeRunnerRpcClient({
3066
3120
  runnerId: options.runnerId,
3067
3121
  bearer: options.bearer,
@@ -3487,6 +3541,7 @@ function startCanonicalHerdrRunnerCommand(input) {
3487
3541
  runFiles: { client: rpc, storage },
3488
3542
  postgres: dockerCheckPostgres(input.runnerId, replica.id),
3489
3543
  ...checkDocker === undefined ? undefined : { docker: checkDocker },
3544
+ runsDeployScripts: personal,
3490
3545
  ...sandbox === undefined ? undefined : { sandbox: { ...sandbox, apiUrl: input.apiUrl, hosts: live.settings.checkHosts } }
3491
3546
  })(work);
3492
3547
  };
@@ -3584,7 +3639,7 @@ function mcpCommand(args) {
3584
3639
  if (command.action === "run") {
3585
3640
  if (command.args.length > 0)
3586
3641
  return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
3587
- const { runMcpServerCommand } = yield* promise(() => import("./chunk-bs81bt3q.js"));
3642
+ const { runMcpServerCommand } = yield* promise(() => import("./chunk-hvr790k3.js"));
3588
3643
  return yield* runMcpServerCommand({ flags: command.flags });
3589
3644
  }
3590
3645
  if (command.action !== "setup")
@@ -4035,6 +4090,11 @@ function contextCommand(args) {
4035
4090
  var programLoopLines = (loop) => [
4036
4091
  `${loop.id}${loop.version === undefined ? "" : ` ${loop.version}`} ${loop.layer} kit ${loop.kit} ${loop.digest}`
4037
4092
  ];
4093
+ var whenClauseLines = (loop) => loop.when.map((clause) => {
4094
+ const filter = Object.entries(clause.filter ?? {}).map(([path, value]) => `${path} ${Array.isArray(value) ? value.join("|") : String(value)}`).join(", ");
4095
+ return ` when ${clause.event}${filter === "" ? "" : ` (${filter})`}${clause.optIn === true ? ", opt-in" : ""}${clause.on === undefined ? "" : `: ${clause.on ? "on" : "off"}`}${clause.description === undefined ? "" : `
4096
+ ${clause.description}`}`;
4097
+ });
4038
4098
  function programLoopCommand(command) {
4039
4099
  return gen(function* () {
4040
4100
  const client = yield* loopClientFor(yield* resolveApiUrl(command.flags.apiUrl));
@@ -4052,7 +4112,17 @@ function programLoopCommand(command) {
4052
4112
  const loop = requiredArg(command, "a Loop");
4053
4113
  const teamId = yield* optionalActiveTeamId(command.flags);
4054
4114
  const shown = yield* client.showProgramLoop(yield* activeWorkspaceId(command.flags), loop, teamId === undefined ? {} : { teamId });
4055
- return yield* print(shown, (value) => value.resolved === undefined ? [`${loop} resolves to nothing here`] : programLoopLines(value.resolved));
4115
+ return yield* print(shown, (value) => value.resolved === undefined ? [`${loop} resolves to nothing here`] : [...programLoopLines(value.resolved), ...whenClauseLines(value.resolved)]);
4116
+ }
4117
+ if (command.action === "when") {
4118
+ const [loop, event, state] = command.args;
4119
+ if (loop === undefined || event === undefined || state !== "on" && state !== "off")
4120
+ return yield* new CliError({ message: "Use kitman loop when <loop> <event> on or off" });
4121
+ const switched = yield* client.setLoopWhenClause(yield* activeTeamId(command.flags), loop, {
4122
+ event,
4123
+ on: state === "on"
4124
+ });
4125
+ return yield* print(switched, (value) => value.resolved === undefined ? [`${loop} resolves to nothing here`] : [...programLoopLines(value.resolved), ...whenClauseLines(value.resolved)]);
4056
4126
  }
4057
4127
  return yield* new CliError({ message: `Unknown loop command: ${command.action}` });
4058
4128
  });
@@ -4103,7 +4173,7 @@ function agentCommand(args) {
4103
4173
  }
4104
4174
  function loopCommand(args) {
4105
4175
  const command = parseCommand(args);
4106
- if (["list", "starts", "show"].includes(command.action))
4176
+ if (["list", "starts", "show", "when"].includes(command.action))
4107
4177
  return programLoopCommand(command);
4108
4178
  if (["catalog", "validate", "test"].includes(command.action))
4109
4179
  return loopCatalogCommand(args);
@@ -4685,7 +4755,7 @@ function verifyCommand(args) {
4685
4755
  const print = (value, lines) => command.flags.json ? printJson(value) : forEach(lines(value), (line) => log(line), { discard: true });
4686
4756
  switch (command.action) {
4687
4757
  case "list":
4688
- return yield* print(yield* client.listApprovedVerifications(workspaceId, binding.id), (listed) => listed.items.length === 0 ? [`No approved verifications for ${binding.owner}/${binding.name}`] : listed.items.map((check) => `${check.name}: ${check.command}${check.workingDirectory === undefined ? "" : ` (in ${check.workingDirectory})`}${check.pipeline === true ? " (pipeline)" : ""}`));
4758
+ return yield* print(yield* client.listApprovedVerifications(workspaceId, binding.id), (listed) => listed.items.length === 0 ? [`No approved verifications for ${binding.owner}/${binding.name}`] : listed.items.map((check) => `${check.name}: ${check.command}${check.workingDirectory === undefined ? "" : ` (in ${check.workingDirectory})`}${check.pipeline === true ? " (pipeline)" : ""}${check.readsTarget === true ? " (reads the target)" : ""}`));
4689
4759
  case "add": {
4690
4760
  const [name, ...words] = command.args;
4691
4761
  if (name === undefined || words.length === 0)
@@ -4694,7 +4764,8 @@ function verifyCommand(args) {
4694
4764
  name,
4695
4765
  command: words.join(" "),
4696
4766
  ...command.flags.workingDirectory === undefined ? undefined : { workingDirectory: command.flags.workingDirectory },
4697
- pipeline: command.flags.pipeline === true
4767
+ pipeline: command.flags.pipeline === true,
4768
+ readsTarget: command.flags.readsTarget === true
4698
4769
  }), (check) => [`Approved ${check.name}${check.pipeline === true ? " as the pipeline" : ""}: ${check.command}`]);
4699
4770
  }
4700
4771
  case "remove":
@@ -4838,9 +4909,9 @@ function changeRequestCommand(args) {
4838
4909
  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}`);
4839
4910
  });
4840
4911
  }
4841
- var KitWriter = map8(promise(() => import("./chunk-b6m9rfzj.js")), (build) => build.writeKit);
4912
+ var KitWriter = map8(promise(() => import("./chunk-vxv1v337.js")), (build) => build.writeKit);
4842
4913
  var KitBuilder = Reference("kitman/cli/KitBuilder", {
4843
- defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-b6m9rfzj.js")), (build) => build.buildKit(directory))
4914
+ defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-vxv1v337.js")), (build) => build.buildKit(directory))
4844
4915
  });
4845
4916
  var uploadKit = (client, workspaceId, built) => gen(function* () {
4846
4917
  yield* client.uploadKitBundle(workspaceId, built.digest, { bundle: encode2(built.bundle) });
@@ -5519,7 +5590,23 @@ function runnerDoctorRow(runner) {
5519
5590
  maxConcurrentRuns: runner.capabilities.resourceLimits?.maxConcurrentRuns
5520
5591
  };
5521
5592
  }
5522
- var runnerDoctorRowHere = (runner) => map8(runnerServiceState(runnerServiceName(runner.id)), (service) => ({
5593
+ var runnerDelivery = (client, runner, askedTeamId) => {
5594
+ const teamId = runner.ownership.kind === "team" ? runner.ownership.teamId : askedTeamId;
5595
+ const reported = runner.capabilities.runs?.providerActions;
5596
+ const row = (delivery, deliveryUnknownBecause) => {
5597
+ const postures = reported === undefined ? undefined : delivery === "gated" || delivery === "auto" ? deliveryProviderActions(reported, delivery) : Object.fromEntries(Object.entries(deliveryProviderActions(reported, "gated")).map(([action, posture]) => [
5598
+ action,
5599
+ posture === "gated" ? delivery : posture
5600
+ ]));
5601
+ return {
5602
+ delivery,
5603
+ ...deliveryUnknownBecause === undefined ? undefined : { deliveryUnknownBecause },
5604
+ providerActions: postures === undefined ? "" : Object.entries(postures).map(([action, posture]) => `${action}=${posture}`).join(",")
5605
+ };
5606
+ };
5607
+ return teamId === undefined ? succeed6(row("per_team")) : client.getTeamDeliverySettings(teamId).pipe(map8((settings) => row(settings.delivery)), catchTag("KitmanClientError", (error) => succeed6(row("unknown", error.message))));
5608
+ };
5609
+ var runnerDoctorRowOnThisMachine = (runner) => map8(runnerServiceState(runnerServiceName(runner.id)), (service) => ({
5523
5610
  ...runnerDoctorRow(runner),
5524
5611
  ...service === undefined ? undefined : { service }
5525
5612
  }));