@kitman-sh/sdk 0.10.58 → 0.10.59

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.
@@ -4,7 +4,7 @@ import {
4
4
  KitDigest,
5
5
  AgentDeclaration,
6
6
  KitDeclarations
7
- } from "../chunk-r33ndzyg.js";
7
+ } from "../chunk-dnmb9dw9.js";
8
8
  import {
9
9
  digestSha256,
10
10
  digestSha512,
@@ -13,7 +13,7 @@ import {
13
13
  RunnerRpcProtocolVersion,
14
14
  describeFlag2,
15
15
  Described2
16
- } from "../chunk-9r9dqxwk.js";
16
+ } from "../chunk-x37rn3aw.js";
17
17
 
18
18
  // packages/core/src/json.ts
19
19
  import * as Schema from "effect/Schema";
@@ -2071,7 +2071,7 @@ var StepOutputSubmissionResult = Schema12.Union([
2071
2071
  }),
2072
2072
  Schema12.Struct({ status: Schema12.Literal("failed"), message: Schema12.String })
2073
2073
  ]);
2074
- var HarnessHoldReasons = ["out_of_quota", "failed_to_start"];
2074
+ var HarnessHoldReasons = ["out_of_quota", "rate_limited", "login_refused", "failed_to_start"];
2075
2075
  var SkippedChoiceReasons = ["not_on_runner", ...HarnessHoldReasons];
2076
2076
  var SkippedChoice = Schema12.Struct({
2077
2077
  harness: Schema12.optionalKey(Schema12.String),
@@ -2979,12 +2979,15 @@ var ask2 = (name, question) => takeStep2(name, "ask", "ask", Effect3.gen(functio
2979
2979
  const fallback = question.default === undefined ? recommendedDefault(recommended) : question.default ?? undefined;
2980
2980
  if (fallback !== undefined && options !== undefined && !options.includes(fallback))
2981
2981
  return yield* new QuestionRefused2({ step: name, answer: fallback, options });
2982
+ if (question.auto !== undefined && options !== undefined && !options.includes(question.auto))
2983
+ return yield* new QuestionRefused2({ step: name, answer: question.auto, options });
2982
2984
  yield* launch2(deferred, (host, token) => host.putQuestion({
2983
2985
  step: name,
2984
2986
  prompt: question.prompt,
2985
2987
  ...options === undefined ? undefined : { options },
2986
2988
  ...advice,
2987
2989
  ...fallback === undefined ? undefined : { default: fallback },
2990
+ ...question.auto === undefined ? undefined : { auto: question.auto },
2988
2991
  ...question.timeout === undefined ? undefined : { timeoutMillis: Duration.toMillis(Duration.fromInputUnsafe(question.timeout)) },
2989
2992
  token
2990
2993
  }));
@@ -4138,7 +4141,7 @@ var scriptedHost = (script, engine, agentLaunches, childLaunches, waits) => {
4138
4141
  ...launch.mergeTarget === undefined ? undefined : { mergeTarget: launch.mergeTarget }
4139
4142
  })), resolve(agentDeferredNamed2(launch.deferredName), launch.token, scriptedExit(script.outputs?.[launch.step], (reason) => new StepFailed2({ step: launch.step, reason })))),
4140
4143
  putQuestion: (launch) => {
4141
- const answer = script.answers?.[launch.step] ?? launch.default;
4144
+ const answer = script.answers?.[launch.step] ?? (script.fullAuto === true ? launch.auto : undefined) ?? launch.default;
4142
4145
  return resolve(answerDeferred2(launch.step), launch.token, answer === undefined ? Exit3.fail(new StepFailed2({ step: launch.step, reason: "no answer was scripted" })) : Exit3.succeed(answer));
4143
4146
  },
4144
4147
  admitChild: (launch) => Effect8.andThen(Effect8.sync(() => childLaunches.push({ step: launch.step, loop: launch.loop, input: launch.input })), resolve(childDeferred2(launch.step), launch.token, scriptedExit(script.children?.[launch.step], (reason) => new ChildFailed2({ step: launch.step, loop: launch.loop, reason })))),
@@ -33,7 +33,7 @@ import {
33
33
  executeLoop2,
34
34
  LoopCheckError2,
35
35
  checkLoop2
36
- } from "./chunk-r33ndzyg.js";
36
+ } from "./chunk-dnmb9dw9.js";
37
37
  // packages/core/src/agent-environment.ts
38
38
  import * as Schema from "effect/Schema";
39
39
  var AgentEnvironmentPolicy = Schema.Union([Schema.Literal("recommended"), Schema.Literal("required")]);
@@ -879,6 +879,7 @@ class RunnerCapabilityRpcs extends RpcGroup.make(Rpc.make("PutQuestion", {
879
879
  informationOnly: Schema7.optional(Schema7.Boolean),
880
880
  verification: Schema7.optional(SuggestedVerification),
881
881
  default: Schema7.optional(Schema7.String),
882
+ auto: Schema7.optional(Schema7.String),
882
883
  timeoutMillis: Schema7.optional(Schema7.Finite),
883
884
  deferredName: Schema7.String
884
885
  },
@@ -1392,6 +1393,7 @@ var runnerHost = (capabilities) => ({
1392
1393
  ...launch.options === undefined ? undefined : { options: launch.options },
1393
1394
  ...launch.verification === undefined ? undefined : { verification: launch.verification },
1394
1395
  ...launch.default === undefined ? undefined : { default: launch.default },
1396
+ ...launch.auto === undefined ? undefined : { auto: launch.auto },
1395
1397
  ...launch.timeoutMillis === undefined ? undefined : { timeoutMillis: launch.timeoutMillis }
1396
1398
  })).pipe(Effect2.asVoid),
1397
1399
  startVerification: (launch) => requested2(launch.step, capabilities.startVerification({
@@ -1613,6 +1615,7 @@ var rpcProgramPorts2 = (rpc, work) => {
1613
1615
  ...question.options === undefined ? undefined : { options: [...question.options] },
1614
1616
  ...question.verification === undefined ? undefined : { verification: question.verification },
1615
1617
  ...question.default === undefined ? undefined : { default: question.default },
1618
+ ...question.auto === undefined ? undefined : { auto: question.auto },
1616
1619
  ...question.timeoutMillis === undefined ? undefined : { timeoutMillis: question.timeoutMillis }
1617
1620
  }),
1618
1621
  startVerification: (verification) => rpc.startVerification({
@@ -173,7 +173,7 @@ import {
173
173
  syncBase2,
174
174
  Continuing2,
175
175
  continuingBrief2
176
- } from "../chunk-r33ndzyg.js";
176
+ } from "../chunk-dnmb9dw9.js";
177
177
  export {
178
178
  AlertTaskActivity2 as AlertTaskActivity,
179
179
  AlertTaskRequest2 as AlertTaskRequest,
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"../chunk-r33ndzyg.js";
2
+ import"../chunk-dnmb9dw9.js";
3
3
  import {
4
4
  JournalWriteFailed2,
5
5
  refusedStep2,
@@ -17,7 +17,7 @@ import {
17
17
  networkGuard2,
18
18
  carriedKits2,
19
19
  runKit2
20
- } from "../chunk-9r9dqxwk.js";
20
+ } from "../chunk-x37rn3aw.js";
21
21
  export {
22
22
  Described2 as Described,
23
23
  JournalWriteFailed2 as JournalWriteFailed,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitman-sh/sdk",
3
- "version": "0.10.58",
3
+ "version": "0.10.59",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "exports": {
@@ -1554,16 +1554,16 @@ export declare const StepOutputSubmissionResult: Schema.Union<readonly [Schema.S
1554
1554
  readonly message: Schema.String;
1555
1555
  }>]>;
1556
1556
  export type StepOutputSubmissionResult = (typeof StepOutputSubmissionResult)['Type'];
1557
- /** Why a Runner holds a Harness: it reported the Harness out of quota, or it failed to start. */
1558
- export declare const HarnessHoldReasons: readonly ['out_of_quota', 'failed_to_start'];
1557
+ /** Why a Runner holds a Harness: its provider would not serve it, or it failed to start. */
1558
+ export declare const HarnessHoldReasons: readonly ['out_of_quota', 'rate_limited', 'login_refused', 'failed_to_start'];
1559
1559
  export type HarnessHoldReason = (typeof HarnessHoldReasons)[number];
1560
- export declare const SkippedChoiceReasons: readonly ["not_on_runner", "out_of_quota", "failed_to_start"];
1560
+ export declare const SkippedChoiceReasons: readonly ["not_on_runner", "out_of_quota", "rate_limited", "login_refused", "failed_to_start"];
1561
1561
  /** A choice the attempt passed over, and why; a choice that names no Harness needed the Runner's default. */
1562
1562
  export declare const SkippedChoice: Schema.Struct<{
1563
1563
  readonly harness: Schema.optionalKey<Schema.String>;
1564
1564
  readonly model: Schema.optionalKey<Schema.String>;
1565
1565
  readonly effort: Schema.optionalKey<Schema.Literals<readonly ["low", "medium", "high", "xhigh"]>>;
1566
- readonly reason: Schema.Literals<readonly ["not_on_runner", "out_of_quota", "failed_to_start"]>;
1566
+ readonly reason: Schema.Literals<readonly ["not_on_runner", "out_of_quota", "rate_limited", "login_refused", "failed_to_start"]>;
1567
1567
  /** When the choice can be tried again. */
1568
1568
  readonly until: Schema.optionalKey<Schema.String>;
1569
1569
  }>;
@@ -1712,7 +1712,7 @@ export declare const StepAttempt: Schema.Struct<{
1712
1712
  readonly harness: Schema.optionalKey<Schema.String>;
1713
1713
  readonly model: Schema.optionalKey<Schema.String>;
1714
1714
  readonly effort: Schema.optionalKey<Schema.Literals<readonly ["low", "medium", "high", "xhigh"]>>;
1715
- readonly reason: Schema.Literals<readonly ["not_on_runner", "out_of_quota", "failed_to_start"]>;
1715
+ readonly reason: Schema.Literals<readonly ["not_on_runner", "out_of_quota", "rate_limited", "login_refused", "failed_to_start"]>;
1716
1716
  /** When the choice can be tried again. */
1717
1717
  readonly until: Schema.optionalKey<Schema.String>;
1718
1718
  }>>>;
@@ -1877,7 +1877,7 @@ export declare const StepAttemptList: Schema.Struct<{
1877
1877
  readonly harness: Schema.optionalKey<Schema.String>;
1878
1878
  readonly model: Schema.optionalKey<Schema.String>;
1879
1879
  readonly effort: Schema.optionalKey<Schema.Literals<readonly ["low", "medium", "high", "xhigh"]>>;
1880
- readonly reason: Schema.Literals<readonly ["not_on_runner", "out_of_quota", "failed_to_start"]>;
1880
+ readonly reason: Schema.Literals<readonly ["not_on_runner", "out_of_quota", "rate_limited", "login_refused", "failed_to_start"]>;
1881
1881
  /** When the choice can be tried again. */
1882
1882
  readonly until: Schema.optionalKey<Schema.String>;
1883
1883
  }>>>;
@@ -1071,7 +1071,7 @@ export declare const RunnerStepAttempt: Schema.Struct<{
1071
1071
  readonly harness: Schema.optionalKey<Schema.String>;
1072
1072
  readonly model: Schema.optionalKey<Schema.String>;
1073
1073
  readonly effort: Schema.optionalKey<Schema.Literals<readonly ["low", "medium", "high", "xhigh"]>>;
1074
- readonly reason: Schema.Literals<readonly ["not_on_runner", "out_of_quota", "failed_to_start"]>;
1074
+ readonly reason: Schema.Literals<readonly ["not_on_runner", "out_of_quota", "rate_limited", "login_refused", "failed_to_start"]>;
1075
1075
  readonly until: Schema.optionalKey<Schema.String>;
1076
1076
  }>>>;
1077
1077
  readonly lease: Schema.optionalKey<Schema.Struct<{
@@ -344,7 +344,7 @@ export declare const TaskDetailAggregate: Schema.Struct<{
344
344
  readonly harness: Schema.optionalKey<Schema.String>;
345
345
  readonly model: Schema.optionalKey<Schema.String>;
346
346
  readonly effort: Schema.optionalKey<Schema.Literals<readonly ["low", "medium", "high", "xhigh"]>>;
347
- readonly reason: Schema.Literals<readonly ["not_on_runner", "out_of_quota", "failed_to_start"]>;
347
+ readonly reason: Schema.Literals<readonly ["not_on_runner", "out_of_quota", "rate_limited", "login_refused", "failed_to_start"]>;
348
348
  readonly until: Schema.optionalKey<Schema.String>;
349
349
  }>>>;
350
350
  readonly lease: Schema.optionalKey<Schema.Struct<{
@@ -1,9 +1,17 @@
1
1
  import * as Schema from 'effect/Schema';
2
+ /**
3
+ * How the Team's changes ship. `gated`: a person decides each merge and release. `auto`: Kitman takes a Loop's
4
+ * full-auto answer at once, so a passing, non-blocking Review of the head carries a change through merge, tag and
5
+ * deploy with nobody asked.
6
+ */
7
+ export declare const DeliveryMode: Schema.Literals<readonly ["gated", "auto"]>;
8
+ export type DeliveryMode = (typeof DeliveryMode)['Type'];
2
9
  export declare const TeamDeliverySettings: Schema.Struct<{
3
10
  readonly defaultRepoBindingId: Schema.optionalKey<Schema.String>;
4
11
  readonly standardBranchTemplate: Schema.String;
5
12
  readonly epicBranchTemplate: Schema.String;
6
13
  readonly isolatedChildBranchTemplate: Schema.String;
14
+ readonly delivery: Schema.Literals<readonly ["gated", "auto"]>;
7
15
  readonly revision: Schema.Int;
8
16
  }>;
9
17
  export declare const TeamDeliverySettingsUpdate: Schema.Struct<{
@@ -11,6 +19,8 @@ export declare const TeamDeliverySettingsUpdate: Schema.Struct<{
11
19
  readonly standardBranchTemplate: Schema.optionalKey<Schema.String>;
12
20
  readonly epicBranchTemplate: Schema.optionalKey<Schema.String>;
13
21
  readonly isolatedChildBranchTemplate: Schema.optionalKey<Schema.String>;
22
+ /** Only a Workspace owner or admin, signed in as themselves, may change it. */
23
+ readonly delivery: Schema.optionalKey<Schema.Literals<readonly ["gated", "auto"]>>;
14
24
  readonly expectedRevision: Schema.Int;
15
25
  }>;
16
26
  /** A Team as agents and repository choices name it. */
@@ -848,7 +848,7 @@ export declare const CatchUp: Schema.Struct<{
848
848
  export type CatchUp = (typeof CatchUp)['Type'];
849
849
  /** An agent Step's Harness cannot run on this Runner: Kitman holds it and starts the Step again on the next choice. */
850
850
  export declare const HarnessHold: Schema.Struct<{
851
- readonly reason: Schema.Literals<readonly ["out_of_quota", "failed_to_start"]>;
851
+ readonly reason: Schema.Literals<readonly ["out_of_quota", "rate_limited", "login_refused", "failed_to_start"]>;
852
852
  /** When the Harness can run again, as it reported; Kitman holds it for a while when this is missing or implausible. */
853
853
  readonly until: Schema.optionalKey<Schema.String>;
854
854
  /** The cause is this Step's own, such as a missing login Secret: only this Step passes the choice over, on any Runner. */
@@ -949,7 +949,7 @@ export declare const WorkUnitOutcome: Schema.Struct<{
949
949
  readonly truncated: Schema.Boolean;
950
950
  }>>;
951
951
  readonly harnessHold: Schema.optionalKey<Schema.Struct<{
952
- readonly reason: Schema.Literals<readonly ["out_of_quota", "failed_to_start"]>;
952
+ readonly reason: Schema.Literals<readonly ["out_of_quota", "rate_limited", "login_refused", "failed_to_start"]>;
953
953
  /** When the Harness can run again, as it reported; Kitman holds it for a while when this is missing or implausible. */
954
954
  readonly until: Schema.optionalKey<Schema.String>;
955
955
  /** The cause is this Step's own, such as a missing login Secret: only this Step passes the choice over, on any Runner. */
@@ -1060,7 +1060,7 @@ export declare const WorkUnitCompletion: Schema.Struct<{
1060
1060
  readonly truncated: Schema.Boolean;
1061
1061
  }>>;
1062
1062
  readonly harnessHold: Schema.optionalKey<Schema.Struct<{
1063
- readonly reason: Schema.Literals<readonly ["out_of_quota", "failed_to_start"]>;
1063
+ readonly reason: Schema.Literals<readonly ["out_of_quota", "rate_limited", "login_refused", "failed_to_start"]>;
1064
1064
  /** When the Harness can run again, as it reported; Kitman holds it for a while when this is missing or implausible. */
1065
1065
  readonly until: Schema.optionalKey<Schema.String>;
1066
1066
  /** The cause is this Step's own, such as a missing login Secret: only this Step passes the choice over, on any Runner. */
@@ -495,7 +495,7 @@ export declare const makeRunnerRpcClient: (options: ConnectionOptions) => Effect
495
495
  readonly truncated: boolean;
496
496
  };
497
497
  readonly harnessHold?: {
498
- readonly reason: "failed_to_start" | "out_of_quota";
498
+ readonly reason: "failed_to_start" | "login_refused" | "out_of_quota" | "rate_limited";
499
499
  readonly until?: string;
500
500
  readonly scope?: "step";
501
501
  };
@@ -1139,6 +1139,7 @@ export declare const makeProgramRpcClient: (options: ConnectionOptions) => Effec
1139
1139
  readonly workingDirectory?: string | undefined;
1140
1140
  } | undefined;
1141
1141
  readonly default?: string | undefined;
1142
+ readonly auto?: string | undefined;
1142
1143
  readonly timeoutMillis?: number | undefined;
1143
1144
  readonly deferredName: string;
1144
1145
  }, options?: {