@usine/core 0.4.0 → 0.5.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.
Files changed (40) hide show
  1. package/LICENSE +661 -21
  2. package/README.md +9 -7
  3. package/dist/agent/session.d.ts +28 -6
  4. package/dist/agent/session.d.ts.map +1 -1
  5. package/dist/agent/session.js +29 -7
  6. package/dist/agent/session.js.map +1 -1
  7. package/dist/attempt/attempt.d.ts +42 -2
  8. package/dist/attempt/attempt.d.ts.map +1 -1
  9. package/dist/attempt/attempt.js +44 -2
  10. package/dist/attempt/attempt.js.map +1 -1
  11. package/dist/attempt/channel.d.ts +7 -1
  12. package/dist/attempt/channel.d.ts.map +1 -1
  13. package/dist/attempt/channel.js +1 -1
  14. package/dist/attempt/channel.js.map +1 -1
  15. package/dist/attempt/salvage.d.ts +29 -2
  16. package/dist/attempt/salvage.d.ts.map +1 -1
  17. package/dist/attempt/salvage.js +29 -1
  18. package/dist/attempt/salvage.js.map +1 -1
  19. package/dist/closed-struct.d.ts +7 -0
  20. package/dist/closed-struct.d.ts.map +1 -0
  21. package/dist/closed-struct.js +12 -0
  22. package/dist/closed-struct.js.map +1 -0
  23. package/dist/cycle-budget.d.ts.map +1 -1
  24. package/dist/cycle-budget.js +7 -10
  25. package/dist/cycle-budget.js.map +1 -1
  26. package/dist/instance.d.ts +6 -0
  27. package/dist/instance.d.ts.map +1 -1
  28. package/dist/instance.js +5 -0
  29. package/dist/instance.js.map +1 -1
  30. package/dist/run/again.d.ts.map +1 -1
  31. package/dist/run/again.js +3 -2
  32. package/dist/run/again.js.map +1 -1
  33. package/dist/run/approval.d.ts.map +1 -1
  34. package/dist/run/approval.js +3 -4
  35. package/dist/run/approval.js.map +1 -1
  36. package/dist/worker.d.ts +124 -12
  37. package/dist/worker.d.ts.map +1 -1
  38. package/dist/worker.js +136 -12
  39. package/dist/worker.js.map +1 -1
  40. package/package.json +6 -6
@@ -9,6 +9,18 @@ export class SalvagePushed extends Schema.TaggedClass("AttemptSalvage/Pushed")("
9
9
  commit: CommitSha,
10
10
  }) {
11
11
  }
12
+ /**
13
+ * Unfinished work pushed to `ref` at `commit`, without files that the salvage can't push, such as
14
+ * a file over GitHub's size limit. The workspace at `path` on the Worker keeps their only copy,
15
+ * and `message` names them.
16
+ */
17
+ export class SalvagePartlyPushed extends Schema.TaggedClass("AttemptSalvage/PartlyPushed")("PartlyPushed", {
18
+ ref: SalvageRef,
19
+ commit: CommitSha,
20
+ path: Schema.NonEmptyString,
21
+ message: Schema.String,
22
+ }) {
23
+ }
12
24
  /** A failed salvage that left the workspace at `path` on the Worker. `commit` is `None` if inspection failed. */
13
25
  export class SalvageRetained extends Schema.TaggedClass("AttemptSalvage/Retained")("Retained", {
14
26
  path: Schema.NonEmptyString,
@@ -16,6 +28,22 @@ export class SalvageRetained extends Schema.TaggedClass("AttemptSalvage/Retained
16
28
  message: Schema.String,
17
29
  }) {
18
30
  }
31
+ /**
32
+ * A salvage whose push the remote refused for a reason that pushing again can't fix, such as a
33
+ * file over GitHub's size limit. It left the workspace at `path` on the Worker, and recovery
34
+ * doesn't push `commit` again.
35
+ */
36
+ export class SalvageRejected extends Schema.TaggedClass("AttemptSalvage/Rejected")("Rejected", {
37
+ path: Schema.NonEmptyString,
38
+ commit: CommitSha,
39
+ message: Schema.String,
40
+ }) {
41
+ }
19
42
  /** What the executor kept of the workspace of an unsuccessful Attempt. */
20
- export const AttemptSalvage = Schema.Union([SalvagePushed, SalvageRetained]);
43
+ export const AttemptSalvage = Schema.Union([
44
+ SalvagePushed,
45
+ SalvagePartlyPushed,
46
+ SalvageRetained,
47
+ SalvageRejected,
48
+ ]);
21
49
  //# sourceMappingURL=salvage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"salvage.js","sourceRoot":"","sources":["../../src/attempt/salvage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,WAA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(fields)` that fails with "Unexpected key" on any key `fields` doesn't
4
+ * declare, whatever `onExcessProperty` the decode site passes.
5
+ */
6
+ export declare const closedStruct: <const Fields extends Schema.Struct.Fields>(fields: Fields) => Schema.Struct<Fields>;
7
+ //# sourceMappingURL=closed-struct.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"closed-struct.d.ts","sourceRoot":"","sources":["../src/closed-struct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,UAC5D,MAAM,KACb,MAAM,CAAC,MAAM,CAAC,MAAM,CAQtB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Schema } from "effect";
2
+ /**
3
+ * Returns `Schema.Struct(fields)` that fails with "Unexpected key" on any key `fields` doesn't
4
+ * declare, whatever `onExcessProperty` the decode site passes.
5
+ */
6
+ export const closedStruct = (fields) => {
7
+ const struct = Schema.Struct(fields);
8
+ const declared = new Set(Object.keys(fields));
9
+ const undeclared = Schema.Record(Schema.String.check(Schema.makeFilter((key) => !declared.has(key))), Schema.Never.annotate({ message: "Unexpected key" }));
10
+ return struct.rebuild(Schema.StructWithRest(struct, [undeclared]).ast);
11
+ };
12
+ //# sourceMappingURL=closed-struct.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"closed-struct.js","sourceRoot":"","sources":["../src/closed-struct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,MAAc,EACS,EAAE;IACzB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAA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IAAI,UAAU,CAEhC;CACF"}
1
+ {"version":3,"file":"cycle-budget.d.ts","sourceRoot":"","sources":["../src/cycle-budget.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,wFAAwF;AACxF,eAAO,MAAM,UAAU,wCAEtB,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAEhD,kFAAkF;AAClF,eAAO,MAAM,eAAe,6CAE3B,CAAC;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC;AAE1D,eAAO,MAAM,mBAAmB,qDAAqB,CAAC;AAEtD,uEAAuE;AACvE,eAAO,MAAM,UAAU,wCAEtB,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;;;;;;AAEhD,mFAAmF;AACnF,qBAAa,cAAe,SAAQ,mBAUnC;CAAG;AAEJ,sFAAsF;AACtF,eAAO,MAAM,gBAAgB,kFAAiD,CAAC;AAC/E,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAC,IAAI,CAAC;;;;;;;;;AAE5D,6FAA6F;AAC7F,qBAAa,cAAe,SAAQ,mBAkBnC;IACC,yFAAyF;IACzF,IAAI,eAAe,IAAI,UAAU,CAEhC;CACF"}
@@ -1,3 +1,4 @@
1
+ import { closedStruct } from "./closed-struct.js";
1
2
  import { EventId } from "./event.js";
2
3
  import { ItemKey } from "./item.js";
3
4
  import { LoopName } from "./loop.js";
@@ -11,32 +12,28 @@ export const DEFAULT_CYCLE_LIMIT = CycleLimit.make(3);
11
12
  /** The number of admitted or completed Runs of one Loop on an Item. */
12
13
  export const CycleCount = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.brand("CycleCount"));
13
14
  /** The admitted and completed Runs of one Loop in the current cycle generation. */
14
- export class LoopCycleCount extends Schema.Class("LoopCycleCount")(Schema.Struct({
15
+ export class LoopCycleCount extends Schema.Class("LoopCycleCount")(closedStruct({
15
16
  loop: LoopName,
16
17
  admitted: CycleCount,
17
18
  completed: CycleCount,
18
- })
19
- .check(Schema.makeFilter(({ admitted, completed }) => completed <= admitted, {
19
+ }).check(Schema.makeFilter(({ admitted, completed }) => completed <= admitted, {
20
20
  message: "Completed runs can't exceed admitted runs",
21
- }))
22
- .annotate({ parseOptions: { onExcessProperty: "error" } })) {
21
+ }))) {
23
22
  }
24
23
  /** The ID of the Event and cycle generation that first exhausted an Item's budget. */
25
24
  export const CycleBudgetAskId = EventId.pipe(Schema.brand("CycleBudgetAskId"));
26
25
  /** An Ask for the operator to reset an Item's cycle budget; no Runs open until the reset. */
27
- export class CycleBudgetAsk extends Schema.Class("CycleBudgetAsk")(Schema.Struct({
26
+ export class CycleBudgetAsk extends Schema.Class("CycleBudgetAsk")(closedStruct({
28
27
  id: CycleBudgetAskId,
29
28
  itemKey: ItemKey,
30
29
  repository: RepositoryName,
31
30
  loop: LoopName,
32
31
  limit: CycleLimit,
33
32
  counts: Schema.NonEmptyArray(LoopCycleCount),
34
- })
35
- .check(Schema.makeFilter(({ loop, limit, counts }) => new Set(counts.map((count) => count.loop)).size === counts.length &&
33
+ }).check(Schema.makeFilter(({ loop, limit, counts }) => new Set(counts.map((count) => count.loop)).size === counts.length &&
36
34
  counts.some((count) => count.loop === loop && count.admitted >= limit), {
37
35
  message: "Expected unique participating loops, including the exhausted loop at its limit",
38
- }))
39
- .annotate({ parseOptions: { onExcessProperty: "error" } })) {
36
+ }))) {
40
37
  /** The highest `completed` count across Loops; each Loop runs at most once per round. */
41
38
  get completedCycles() {
42
39
  return CycleCount.make(Math.max(...this.counts.map(({ completed }) => completed)));
@@ -1 +1 @@
1
- {"version":3,"file":"cycle-budget.js","sourceRoot":"","sources":["../src/cycle-budget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW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,CAAC,CAAC,CAAC,CAAC;IACrF,CAAC;CACF"}
@@ -2,4 +2,10 @@ import { Schema } from "effect";
2
2
  /** The folder with `usine.yaml`, Loop files, and Agent files. */
3
3
  export declare const InstanceDirectory: Schema.brand<Schema.NonEmptyString, "InstanceDirectory">;
4
4
  export type InstanceDirectory = typeof InstanceDirectory.Type;
5
+ /**
6
+ * The UUID of one instance folder, which tells apart instances that share a GitHub App. It
7
+ * stays the same across restarts of the instance.
8
+ */
9
+ export declare const InstanceId: Schema.brand<Schema.String, "InstanceId">;
10
+ export type InstanceId = typeof InstanceId.Type;
5
11
  //# sourceMappingURL=instance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,iEAAiE;AACjE,eAAO,MAAM,iBAAiB,0DAAgE,CAAC;AAC/F,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAC"}
1
+ {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,iEAAiE;AACjE,eAAO,MAAM,iBAAiB,0DAAgE,CAAC;AAC/F,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,UAAU,2CAAwE,CAAC;AAChG,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC"}
package/dist/instance.js CHANGED
@@ -1,4 +1,9 @@
1
1
  import { Schema } from "effect";
2
2
  /** The folder with `usine.yaml`, Loop files, and Agent files. */
3
3
  export const InstanceDirectory = Schema.NonEmptyString.pipe(Schema.brand("InstanceDirectory"));
4
+ /**
5
+ * The UUID of one instance folder, which tells apart instances that share a GitHub App. It
6
+ * stays the same across restarts of the instance.
7
+ */
8
+ export const InstanceId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand("InstanceId"));
4
9
  //# sourceMappingURL=instance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instance.js","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,iEAAiE;AACjE,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"instance.js","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,iEAAiE;AACjE,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;AAG/F;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"again.d.ts","sourceRoot":"","sources":["../../src/run/again.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;AAIhC;;;GAGG;AACH,qBAAa,QAAS,SAAQ,aAK7B;CAAG"}
1
+ {"version":3,"file":"again.d.ts","sourceRoot":"","sources":["../../src/run/again.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;AAKhC;;;GAGG;AACH,qBAAa,QAAS,SAAQ,aAK7B;CAAG"}
package/dist/run/again.js CHANGED
@@ -1,13 +1,14 @@
1
1
  import { Schema } from "effect";
2
+ import { closedStruct } from "../closed-struct.js";
2
3
  import { OperatorLogin } from "../operator.js";
3
4
  import { RunId } from "./run.js";
4
5
  /**
5
6
  * The origin of a Run created by running a succeeded or canceled Run again (ADR 0002).
6
7
  * `requestedBy` is the operator login from `usine.yaml`, or `None` if none is configured.
7
8
  */
8
- export class RunAgain extends Schema.Class("RunAgain")(Schema.Struct({
9
+ export class RunAgain extends Schema.Class("RunAgain")(closedStruct({
9
10
  from: RunId,
10
11
  requestedBy: Schema.OptionFromNullOr(OperatorLogin),
11
- }).annotate({ parseOptions: { onExcessProperty: "error" } })) {
12
+ })) {
12
13
  }
13
14
  //# sourceMappingURL=again.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"again.js","sourceRoot":"","sources":["../../src/run/again.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,MAAM,CAAC,KAAK,CAAW,UAAU,CAAC,CAC9D,MAAM,CAAC,MAAM,CAAC;IACZ,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,MAAM,CAAC,gBAAgB,CAAC,aAAa,CAAC;CACpD,CAAC,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,EAAE,gBAAgB,EAAE,OAAO,EAAE,EAAE,CAAC,CAC7D;CAAG"}
1
+ {"version":3,"file":"again.js","sourceRoot":"","sources":["../../src/run/again.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,MAAM,CAAC,KAAK,CAAW,UAAU,CAAC,CAC9D,YAAY,CAAC;IACX,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,MAAM,CAAC,gBAAgB,CAAC,aAAa,CAAC;CACpD,CAAC,CACH;CAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"approval.d.ts","sourceRoot":"","sources":["../../src/run/approval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGxC,0HAA0H;AAC1H,eAAO,MAAM,iBAAiB,YAAI,IAAI,EAAE,YAAY,CAAU,CAAC;AAC/D,eAAO,MAAM,eAAe,gDAAqC,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC;;;;;AAE1D;;;GAGG;AACH,qBAAa,cAAe,SAAQ,mBAYnC;CAAG;;;;;AAEJ;;;GAGG;AACH,qBAAa,WAAY,SAAQ,gBAG/B;CAAG"}
1
+ {"version":3,"file":"approval.d.ts","sourceRoot":"","sources":["../../src/run/approval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIxC,0HAA0H;AAC1H,eAAO,MAAM,iBAAiB,YAAI,IAAI,EAAE,YAAY,CAAU,CAAC;AAC/D,eAAO,MAAM,eAAe,gDAAqC,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC;;;;;AAE1D;;;GAGG;AACH,qBAAa,cAAe,SAAQ,mBAUnC;CAAG;;;;;AAEJ;;;GAGG;AACH,qBAAa,WAAY,SAAQ,gBAG/B;CAAG"}
@@ -1,4 +1,5 @@
1
1
  import { Option, Schema } from "effect";
2
+ import { closedStruct } from "../closed-struct.js";
2
3
  import { OperatorLogin } from "../operator.js";
3
4
  /** The approval channels: `ui` for the web UI's Approve action and `github-ask` for a 👍 on the GitHub Ask (ADR 0017). */
4
5
  export const APPROVAL_CHANNELS = ["ui", "github-ask"];
@@ -7,12 +8,10 @@ export const ApprovalChannel = Schema.Literals(APPROVAL_CHANNELS);
7
8
  * The approver and channel, recorded when the approval takes effect. A `ui` approval has no
8
9
  * `approver` if `usine.yaml` sets no operator login; a `github-ask` approval always has one.
9
10
  */
10
- export class ApprovalSource extends Schema.Class("ApprovalSource")(Schema.Struct({
11
+ export class ApprovalSource extends Schema.Class("ApprovalSource")(closedStruct({
11
12
  channel: ApprovalChannel,
12
13
  approver: Schema.OptionFromNullOr(OperatorLogin),
13
- })
14
- .check(Schema.makeFilter(({ channel, approver }) => channel !== "github-ask" || Option.isSome(approver), { message: "Expected an approver for a GitHub ask approval" }))
15
- .annotate({ parseOptions: { onExcessProperty: "error" } })) {
14
+ }).check(Schema.makeFilter(({ channel, approver }) => channel !== "github-ask" || Option.isSome(approver), { message: "Expected an approver for a GitHub ask approval" }))) {
16
15
  }
17
16
  /**
18
17
  * A Run's approval. `approvedAt` is when the approval Event arrived, and `source` is `None` for
@@ -1 +1 @@
1
- {"version":3,"file":"approval.js","sourceRoot":"","sources":["../../src/run/approval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,0HAA0H;AAC1H,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,YAAY,CAAU,CAAC;AAC/D,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAGlE;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,MAAM,CAAC,KAAK,CAAiB,gBAAgB,CAAC,CAChF,MAAM,CAAC,MAAM,CAAC;IACZ,OAAO,EAAE,eAAe;IACxB,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,aAAa,CAAC;CACjD,CAAC;KACC,KAAK,CACJ,MAAM,CAAC,UA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E,EAAE,OAAO,EAAE,gDAAgD,EAAE,CAC9D,CACF,CACF;CAAG;AAEJ;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,MAAM,CAAC,KAAK,CAAc,aAAa,CAAC,CAAC;IACxE,UAAU,EAAE,MAAM,CAAC,WAAW;IAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;CACtC,CAAC;CAAG"}
package/dist/worker.d.ts CHANGED
@@ -1,18 +1,34 @@
1
1
  import { Schema } from "effect";
2
2
  export declare const WorkerName: Schema.brand<Schema.String, "WorkerName">;
3
3
  export type WorkerName = typeof WorkerName.Type;
4
- export declare const WORKER_KINDS: readonly ["local", "exe.dev", "ssh"];
5
- export declare const WorkerKind: Schema.Literals<readonly ["local", "exe.dev", "ssh"]>;
4
+ export declare const WORKER_KINDS: readonly ["local", "exe.dev", "ssh", "cloudflare"];
5
+ export declare const WorkerKind: Schema.Literals<readonly ["local", "exe.dev", "ssh", "cloudflare"]>;
6
6
  export type WorkerKind = typeof WorkerKind.Type;
7
7
  /**
8
- * The GitHub bot login that an Attempt writes as: the factory's GitHub App on local and SSH
9
- * Workers, or the exe.dev GitHub integration on exe.dev Workers (ADR 0011).
8
+ * The GitHub bot login that an Attempt writes as: the factory's GitHub App on local, SSH, and
9
+ * Cloudflare Workers, or the exe.dev GitHub integration on exe.dev Workers (ADR 0011).
10
10
  */
11
11
  export declare const BotLogin: Schema.brand<Schema.String, "BotLogin">;
12
12
  export type BotLogin = typeof BotLogin.Type;
13
+ /** The user ID of a GitHub App's bot account. It differs from the App ID. */
14
+ export declare const BotUserId: Schema.brand<Schema.Int, "BotUserId">;
15
+ export type BotUserId = typeof BotUserId.Type;
16
+ declare const BotAccount_base: Schema.Class<BotAccount, Schema.Struct<{
17
+ readonly login: Schema.brand<Schema.String, "BotLogin">;
18
+ readonly id: Schema.brand<Schema.Int, "BotUserId">;
19
+ }>, {}>;
13
20
  /**
14
- * The `ssh` destination: a host name, address, or SSH config Host alias, optionally prefixed
15
- * with `user@`. Rejects values that `ssh` could parse as an option, such as `-oProxyCommand=...`.
21
+ * A GitHub App's bot account. The factory App's account authors and commits every Attempt's
22
+ * commits on every Worker kind (ADR 0011).
23
+ */
24
+ export declare class BotAccount extends BotAccount_base {
25
+ /** The ID-based noreply address, which GitHub links to the account even after a rename. */
26
+ get noreplyEmail(): string;
27
+ }
28
+ /**
29
+ * The `ssh` destination: a host name, IPv4 or IPv6 address, or SSH config Host alias, optionally
30
+ * prefixed with `user@`. Rejects values that `ssh` could parse as an option, such as
31
+ * `-oProxyCommand=...`.
16
32
  */
17
33
  export declare const SshDestination: Schema.brand<Schema.String, "SshDestination">;
18
34
  export type SshDestination = typeof SshDestination.Type;
@@ -38,16 +54,112 @@ export type GatewayDomain = typeof GatewayDomain.Type;
38
54
  export declare const GatewayAdminPort: Schema.brand<Schema.Int, "GatewayAdminPort">;
39
55
  export type GatewayAdminPort = typeof GatewayAdminPort.Type;
40
56
  /**
41
- * An LLM provider whose credential the Gateway stores. The harness for that provider, such as
42
- * Claude Code for `anthropic`, uses the Attempt's caller token instead of a login on the machine.
57
+ * An LLM provider whose credential the Gateway stores. The harness for that provider, Claude
58
+ * Code for `anthropic` and Codex for `openai`, uses the Attempt's caller token instead of a login
59
+ * on the machine.
43
60
  */
44
- export declare const GatewayLlmProvider: Schema.Literals<readonly ["anthropic"]>;
61
+ export declare const GatewayLlmProvider: Schema.Literals<readonly ["anthropic", "openai"]>;
45
62
  export type GatewayLlmProvider = typeof GatewayLlmProvider.Type;
46
63
  /**
47
- * The kind of LLM provider credential that the Gateway stores, as reported by its admin API.
48
- * `api-key` is billed at API rates; `subscription` uses a plan, such as a Claude plan from
49
- * `claude setup-token` ([ADR 0013](../../../docs/adr/0013-cost-accounting-native-meters-guardrails.md)).
64
+ * The kind of LLM provider credential that the Gateway stores, as reported by its admin API, or
65
+ * that a Cloudflare Worker's outbound handler holds, always `api-key`. `api-key` is billed at
66
+ * API rates; `subscription` uses a plan: a Claude plan from `claude setup-token`, or a ChatGPT
67
+ * plan from `codex login`
68
+ * ([ADR 0013](../../../docs/adr/0013-cost-accounting-native-meters-guardrails.md)).
50
69
  */
51
70
  export declare const GatewayCredentialKind: Schema.Literals<readonly ["api-key", "subscription"]>;
52
71
  export type GatewayCredentialKind = typeof GatewayCredentialKind.Type;
72
+ /**
73
+ * A container image reference, `[registry/]repository[:tag][@digest]`, such as
74
+ * `ghcr.io/basaltbytes/usine-worker:claude-2.1.308-codex-0.159.2`. Rejects values that the
75
+ * container CLI could parse as an option.
76
+ */
77
+ export declare const ContainerImage: Schema.brand<Schema.String, "ContainerImage">;
78
+ export type ContainerImage = typeof ContainerImage.Type;
79
+ /**
80
+ * The ID that the container runtime gives a container when it creates it: 64 lowercase hex
81
+ * digits. A start of a stopped container keeps it.
82
+ */
83
+ export declare const ContainerId: Schema.brand<Schema.String, "ContainerId">;
84
+ export type ContainerId = typeof ContainerId.Type;
85
+ /** The CPUs a container may use, such as `1.5`. */
86
+ export declare const ContainerCpus: Schema.brand<Schema.Finite, "ContainerCpus">;
87
+ export type ContainerCpus = typeof ContainerCpus.Type;
88
+ /** A container's memory limit in MiB. */
89
+ export declare const ContainerMemoryMib: Schema.brand<Schema.Int, "ContainerMemoryMib">;
90
+ export type ContainerMemoryMib = typeof ContainerMemoryMib.Type;
91
+ /** The maximum number of processes and threads in a container. */
92
+ export declare const ContainerPids: Schema.brand<Schema.Int, "ContainerPids">;
93
+ export type ContainerPids = typeof ContainerPids.Type;
94
+ declare const ContainerLimits_base: Schema.Class<ContainerLimits, Schema.Struct<{
95
+ readonly cpus: Schema.brand<Schema.Finite, "ContainerCpus">;
96
+ readonly memoryMib: Schema.brand<Schema.Int, "ContainerMemoryMib">;
97
+ readonly pids: Schema.brand<Schema.Int, "ContainerPids">;
98
+ }>, {}>;
99
+ /** The CPU, memory, and process limits of one Attempt container. */
100
+ export declare class ContainerLimits extends ContainerLimits_base {
101
+ }
102
+ /** The fields of `ContainerLimits`, in the order that logs and the web UI give them. */
103
+ export declare const CONTAINER_LIMITS: readonly ["cpus", "memoryMib", "pids"];
104
+ export type ContainerLimit = (typeof CONTAINER_LIMITS)[number];
105
+ /**
106
+ * A Cloudflare container instance type. From `lite` (1/16 vCPU, 256 MiB, 2 GB disk) to
107
+ * `standard-4` (4 vCPU, 12 GiB, 20 GB disk).
108
+ */
109
+ export declare const CloudflareInstanceType: Schema.Literals<readonly ["lite", "basic", "standard-1", "standard-2", "standard-3", "standard-4"]>;
110
+ export type CloudflareInstanceType = typeof CloudflareInstanceType.Type;
111
+ /**
112
+ * The name of an image in the Cloudflare Worker's `containers[].images`, which the Worker starts
113
+ * each Attempt's sandbox from.
114
+ */
115
+ export declare const CloudflareImageName: Schema.brand<Schema.String, "CloudflareImageName">;
116
+ export type CloudflareImageName = typeof CloudflareImageName.Type;
117
+ /**
118
+ * An LLM provider whose API key the Cloudflare Worker's outbound handlers hold for an Attempt:
119
+ * `anthropic` for Claude Code and `openai` for Codex.
120
+ */
121
+ export declare const CloudflareLlmProvider: Schema.Literals<readonly ["anthropic", "openai"]>;
122
+ export type CloudflareLlmProvider = typeof CloudflareLlmProvider.Type;
123
+ /** The cloud provider that creates one machine per Attempt for a provisioned SSH Worker. */
124
+ export declare const MachineProvider: Schema.Literals<readonly ["hetzner", "boat"]>;
125
+ export type MachineProvider = typeof MachineProvider.Type;
126
+ /**
127
+ * A machine's ID at its provider: a Hetzner Cloud server ID, such as `52341896`, or a Boat
128
+ * sandbox ID, such as `bx_23456789`.
129
+ */
130
+ export declare const MachineId: Schema.brand<Schema.String, "MachineId">;
131
+ export type MachineId = typeof MachineId.Type;
132
+ /** A Hetzner Cloud server type, such as `cx33` or `cpx32`. */
133
+ export declare const HetznerServerType: Schema.brand<Schema.String, "HetznerServerType">;
134
+ export type HetznerServerType = typeof HetznerServerType.Type;
135
+ /** A Hetzner Cloud location, such as `fsn1`, `nbg1`, or `hel1`. */
136
+ export declare const HetznerLocation: Schema.brand<Schema.String, "HetznerLocation">;
137
+ export type HetznerLocation = typeof HetznerLocation.Type;
138
+ /**
139
+ * The image of each Hetzner Cloud server: a snapshot's ID or description, or a system image's
140
+ * name, such as `debian-13`.
141
+ */
142
+ export declare const HetznerImage: Schema.brand<Schema.String, "HetznerImage">;
143
+ export type HetznerImage = typeof HetznerImage.Type;
144
+ /** The name of a Hetzner Cloud resource, such as a network or an SSH key. */
145
+ export declare const HetznerResourceName: Schema.brand<Schema.String, "HetznerResourceName">;
146
+ export type HetznerResourceName = typeof HetznerResourceName.Type;
147
+ /** Returns whether `value` is a valid Hetzner Cloud label value. */
148
+ export declare const isHetznerLabelValue: (value: string) => boolean;
149
+ /**
150
+ * Extra labels for each Hetzner Cloud server, by Hetzner's label rules. Keys that start with
151
+ * `usine-` are usine's own.
152
+ */
153
+ export declare const HetznerLabels: Schema.$Record<Schema.String, Schema.String>;
154
+ export type HetznerLabels = typeof HetznerLabels.Type;
155
+ /** A Unix user name for SSH, such as `usine`. */
156
+ export declare const SshUser: Schema.brand<Schema.String, "SshUser">;
157
+ export type SshUser = typeof SshUser.Type;
158
+ /**
159
+ * A Boat machine size: `small`, `default` (4 vCPU and 8 GB), `large`, or `xlarge`, which needs
160
+ * a Boat plan of $100 per month or more.
161
+ */
162
+ export declare const BoatSize: Schema.Literals<readonly ["small", "default", "large", "xlarge"]>;
163
+ export type BoatSize = typeof BoatSize.Type;
164
+ export {};
53
165
  //# sourceMappingURL=worker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,UAAU,2CAIW,CAAC;AAEnC,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAEhD,eAAO,MAAM,YAAY,YAAI,OAAO,EAAE,SAAS,EAAE,KAAK,CAAU,CAAC;AACjE,eAAO,MAAM,UAAU,uDAAgC,C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AM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC"}
package/dist/worker.js CHANGED
@@ -2,20 +2,36 @@ import { Schema } from "effect";
2
2
  export const WorkerName = Schema.String.check(Schema.isPattern(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u, {
3
3
  message: "Expected a kebab-case worker name",
4
4
  })).pipe(Schema.brand("WorkerName"));
5
- export const WORKER_KINDS = ["local", "exe.dev", "ssh"];
5
+ export const WORKER_KINDS = ["local", "exe.dev", "ssh", "cloudflare"];
6
6
  export const WorkerKind = Schema.Literals(WORKER_KINDS);
7
7
  /**
8
- * The GitHub bot login that an Attempt writes as: the factory's GitHub App on local and SSH
9
- * Workers, or the exe.dev GitHub integration on exe.dev Workers (ADR 0011).
8
+ * The GitHub bot login that an Attempt writes as: the factory's GitHub App on local, SSH, and
9
+ * Cloudflare Workers, or the exe.dev GitHub integration on exe.dev Workers (ADR 0011).
10
10
  */
11
11
  export const BotLogin = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\[bot\]$/u, {
12
12
  message: "Expected a GitHub bot login: <slug>[bot]",
13
13
  })).pipe(Schema.brand("BotLogin"));
14
+ /** The user ID of a GitHub App's bot account. It differs from the App ID. */
15
+ export const BotUserId = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).pipe(Schema.brand("BotUserId"));
14
16
  /**
15
- * The `ssh` destination: a host name, address, or SSH config Host alias, optionally prefixed
16
- * with `user@`. Rejects values that `ssh` could parse as an option, such as `-oProxyCommand=...`.
17
+ * A GitHub App's bot account. The factory App's account authors and commits every Attempt's
18
+ * commits on every Worker kind (ADR 0011).
17
19
  */
18
- export const SshDestination = Schema.String.check(Schema.isPattern(/^(?:[A-Za-z0-9._-]+@)?[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?$/u, {
20
+ export class BotAccount extends Schema.Class("BotAccount")({
21
+ login: BotLogin,
22
+ id: BotUserId,
23
+ }) {
24
+ /** The ID-based noreply address, which GitHub links to the account even after a rename. */
25
+ get noreplyEmail() {
26
+ return `${String(this.id)}+${this.login}@users.noreply.github.com`;
27
+ }
28
+ }
29
+ /**
30
+ * The `ssh` destination: a host name, IPv4 or IPv6 address, or SSH config Host alias, optionally
31
+ * prefixed with `user@`. Rejects values that `ssh` could parse as an option, such as
32
+ * `-oProxyCommand=...`.
33
+ */
34
+ export const SshDestination = Schema.String.check(Schema.isPattern(/^(?:[A-Za-z0-9._-]+@)?(?:[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?|[0-9A-Fa-f]{0,4}(?::[0-9A-Fa-f]{0,4}){2,7})$/u, {
19
35
  message: "Expected an SSH destination: a host name or address, optionally prefixed by a user",
20
36
  })).pipe(Schema.brand("SshDestination"));
21
37
  export const SshPort = Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 65_535 })).pipe(Schema.brand("SshPort"));
@@ -39,14 +55,122 @@ export const GatewayDomain = Schema.String.check(Schema.isPattern(/^(?:[a-z0-9](
39
55
  /** The Gateway admin API port on the Gateway's loopback interface (`USINE_GATEWAY_ADMIN_PORT`), used through an SSH forward. */
40
56
  export const GatewayAdminPort = Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 65_535 })).pipe(Schema.brand("GatewayAdminPort"));
41
57
  /**
42
- * An LLM provider whose credential the Gateway stores. The harness for that provider, such as
43
- * Claude Code for `anthropic`, uses the Attempt's caller token instead of a login on the machine.
58
+ * An LLM provider whose credential the Gateway stores. The harness for that provider, Claude
59
+ * Code for `anthropic` and Codex for `openai`, uses the Attempt's caller token instead of a login
60
+ * on the machine.
44
61
  */
45
- export const GatewayLlmProvider = Schema.Literals(["anthropic"]);
62
+ export const GatewayLlmProvider = Schema.Literals(["anthropic", "openai"]);
46
63
  /**
47
- * The kind of LLM provider credential that the Gateway stores, as reported by its admin API.
48
- * `api-key` is billed at API rates; `subscription` uses a plan, such as a Claude plan from
49
- * `claude setup-token` ([ADR 0013](../../../docs/adr/0013-cost-accounting-native-meters-guardrails.md)).
64
+ * The kind of LLM provider credential that the Gateway stores, as reported by its admin API, or
65
+ * that a Cloudflare Worker's outbound handler holds, always `api-key`. `api-key` is billed at
66
+ * API rates; `subscription` uses a plan: a Claude plan from `claude setup-token`, or a ChatGPT
67
+ * plan from `codex login`
68
+ * ([ADR 0013](../../../docs/adr/0013-cost-accounting-native-meters-guardrails.md)).
50
69
  */
51
70
  export const GatewayCredentialKind = Schema.Literals(["api-key", "subscription"]);
71
+ /**
72
+ * A container image reference, `[registry/]repository[:tag][@digest]`, such as
73
+ * `ghcr.io/basaltbytes/usine-worker:claude-2.1.308-codex-0.159.2`. Rejects values that the
74
+ * container CLI could parse as an option.
75
+ */
76
+ export const ContainerImage = Schema.String.check(Schema.isPattern(/^[a-z0-9][A-Za-z0-9._/:@-]{0,254}$/u, {
77
+ message: "Expected a container image reference, such as ghcr.io/owner/image:tag, without spaces or a leading dash",
78
+ })).pipe(Schema.brand("ContainerImage"));
79
+ /**
80
+ * The ID that the container runtime gives a container when it creates it: 64 lowercase hex
81
+ * digits. A start of a stopped container keeps it.
82
+ */
83
+ export const ContainerId = Schema.String.check(Schema.isPattern(/^[0-9a-f]{64}$/u, {
84
+ message: "Expected a container ID of 64 lowercase hex digits",
85
+ })).pipe(Schema.brand("ContainerId"));
86
+ /** The CPUs a container may use, such as `1.5`. */
87
+ export const ContainerCpus = Schema.Finite.check(Schema.isGreaterThan(0)).pipe(Schema.brand("ContainerCpus"));
88
+ /** A container's memory limit in MiB. */
89
+ export const ContainerMemoryMib = Schema.Int.check(Schema.isGreaterThanOrEqualTo(256)).pipe(Schema.brand("ContainerMemoryMib"));
90
+ /** The maximum number of processes and threads in a container. */
91
+ export const ContainerPids = Schema.Int.check(Schema.isGreaterThanOrEqualTo(64)).pipe(Schema.brand("ContainerPids"));
92
+ /** The CPU, memory, and process limits of one Attempt container. */
93
+ export class ContainerLimits extends Schema.Class("ContainerLimits")({
94
+ cpus: ContainerCpus,
95
+ memoryMib: ContainerMemoryMib,
96
+ pids: ContainerPids,
97
+ }) {
98
+ }
99
+ /** The fields of `ContainerLimits`, in the order that logs and the web UI give them. */
100
+ export const CONTAINER_LIMITS = ["cpus", "memoryMib", "pids"];
101
+ /**
102
+ * A Cloudflare container instance type. From `lite` (1/16 vCPU, 256 MiB, 2 GB disk) to
103
+ * `standard-4` (4 vCPU, 12 GiB, 20 GB disk).
104
+ */
105
+ export const CloudflareInstanceType = Schema.Literals([
106
+ "lite",
107
+ "basic",
108
+ "standard-1",
109
+ "standard-2",
110
+ "standard-3",
111
+ "standard-4",
112
+ ]);
113
+ /**
114
+ * The name of an image in the Cloudflare Worker's `containers[].images`, which the Worker starts
115
+ * each Attempt's sandbox from.
116
+ */
117
+ export const CloudflareImageName = Schema.String.check(Schema.isPattern(/^[A-Za-z_][A-Za-z0-9_]{0,62}$/u, {
118
+ message: "Expected an image name of letters, digits, and underscores that doesn't start with a digit",
119
+ })).pipe(Schema.brand("CloudflareImageName"));
120
+ /**
121
+ * An LLM provider whose API key the Cloudflare Worker's outbound handlers hold for an Attempt:
122
+ * `anthropic` for Claude Code and `openai` for Codex.
123
+ */
124
+ export const CloudflareLlmProvider = Schema.Literals(["anthropic", "openai"]);
125
+ /** The cloud provider that creates one machine per Attempt for a provisioned SSH Worker. */
126
+ export const MachineProvider = Schema.Literals(["hetzner", "boat"]);
127
+ /**
128
+ * A machine's ID at its provider: a Hetzner Cloud server ID, such as `52341896`, or a Boat
129
+ * sandbox ID, such as `bx_23456789`.
130
+ */
131
+ export const MachineId = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9_-]{1,64}$/u, { message: "Expected a provider machine ID" })).pipe(Schema.brand("MachineId"));
132
+ /** A Hetzner Cloud server type, such as `cx33` or `cpx32`. */
133
+ export const HetznerServerType = Schema.String.check(Schema.isPattern(/^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/u, {
134
+ message: "Expected a Hetzner server type, such as cx33",
135
+ })).pipe(Schema.brand("HetznerServerType"));
136
+ /** A Hetzner Cloud location, such as `fsn1`, `nbg1`, or `hel1`. */
137
+ export const HetznerLocation = Schema.String.check(Schema.isPattern(/^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/u, {
138
+ message: "Expected a Hetzner location, such as nbg1",
139
+ })).pipe(Schema.brand("HetznerLocation"));
140
+ /**
141
+ * The image of each Hetzner Cloud server: a snapshot's ID or description, or a system image's
142
+ * name, such as `debian-13`.
143
+ */
144
+ export const HetznerImage = Schema.String.check(Schema.isPattern(/^[!-~](?:[ -~]{0,253}[!-~])?$/u, {
145
+ message: "Expected a Hetzner image ID, snapshot description, or image name",
146
+ })).pipe(Schema.brand("HetznerImage"));
147
+ /** The name of a Hetzner Cloud resource, such as a network or an SSH key. */
148
+ export const HetznerResourceName = Schema.String.check(Schema.isPattern(/^[!-~](?:[ -~]{0,126}[!-~])?$/u, {
149
+ message: "Expected a Hetzner resource name without control characters",
150
+ })).pipe(Schema.brand("HetznerResourceName"));
151
+ const HETZNER_LABEL_KEY = /^(?:[a-z0-9A-Z](?:[-_.a-z0-9A-Z]*[a-z0-9A-Z])?\/)?[a-z0-9A-Z](?:[-_.a-z0-9A-Z]{0,61}[a-z0-9A-Z])?$/u;
152
+ const HETZNER_LABEL_VALUE = /^(?:[a-z0-9A-Z](?:[-_.a-z0-9A-Z]{0,61}[a-z0-9A-Z])?)?$/u;
153
+ /** Returns whether `value` is a valid Hetzner Cloud label value. */
154
+ export const isHetznerLabelValue = (value) => HETZNER_LABEL_VALUE.test(value);
155
+ /**
156
+ * Extra labels for each Hetzner Cloud server, by Hetzner's label rules. Keys that start with
157
+ * `usine-` are usine's own.
158
+ */
159
+ export const HetznerLabels = Schema.Record(Schema.String, Schema.String.check(Schema.isPattern(HETZNER_LABEL_VALUE, { message: "Expected a Hetzner label value" }))).check(Schema.makeFilter((labels) => {
160
+ const keys = Object.keys(labels);
161
+ const invalid = keys.find((key) => !HETZNER_LABEL_KEY.test(key));
162
+ if (invalid !== undefined)
163
+ return `Expected a Hetzner label key, not "${invalid}"`;
164
+ const reserved = keys.find((key) => key.startsWith("usine-"));
165
+ return reserved === undefined
166
+ ? true
167
+ : `Expected a label key that doesn't start with usine-, which usine sets itself, not "${reserved}"`;
168
+ }));
169
+ /** A Unix user name for SSH, such as `usine`. */
170
+ export const SshUser = Schema.String.check(Schema.isPattern(/^[a-z_][a-z0-9_-]{0,31}$/u, { message: "Expected a Unix user name" })).pipe(Schema.brand("SshUser"));
171
+ /**
172
+ * A Boat machine size: `small`, `default` (4 vCPU and 8 GB), `large`, or `xlarge`, which needs
173
+ * a Boat plan of $100 per month or more.
174
+ */
175
+ export const BoatSize = Schema.Literals(["small", "default", "large", "xlarge"]);
52
176
  //# sourceMappingURL=worker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAC3C,MAAM,CAAC,SAAS,CAAC,6BAA6B,EAAE;IAC9C,OAAO,EAAE,mCAAmC;CAC7C,CAAC,CACH,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;AAInC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,CAAU,CAAC;AACjE,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AAGxD;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CACzC,MAAM,CAAC,SAAS,CAAC,oDAAoD,EAAE;IACrE,OAAO,EAAE,0CAA0C;CACpD,CAAC,CACH,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC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