@usine/core 0.3.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.
- package/LICENSE +661 -21
- package/README.md +43 -18
- package/dist/agent/agent.d.ts +12 -8
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.js +14 -10
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/brain.d.ts +2 -6
- package/dist/agent/brain.d.ts.map +1 -1
- package/dist/agent/brain.js +3 -7
- package/dist/agent/brain.js.map +1 -1
- package/dist/agent/capability.d.ts +4 -4
- package/dist/agent/capability.d.ts.map +1 -1
- package/dist/agent/capability.js +4 -4
- package/dist/agent/capability.js.map +1 -1
- package/dist/agent/session.d.ts +90 -28
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +103 -28
- package/dist/agent/session.js.map +1 -1
- package/dist/attempt/attempt.d.ts +92 -12
- package/dist/attempt/attempt.d.ts.map +1 -1
- package/dist/attempt/attempt.js +114 -13
- package/dist/attempt/attempt.js.map +1 -1
- package/dist/attempt/channel.d.ts +91 -51
- package/dist/attempt/channel.d.ts.map +1 -1
- package/dist/attempt/channel.js +74 -45
- package/dist/attempt/channel.js.map +1 -1
- package/dist/attempt/failure.d.ts +27 -14
- package/dist/attempt/failure.d.ts.map +1 -1
- package/dist/attempt/failure.js +27 -14
- package/dist/attempt/failure.js.map +1 -1
- package/dist/attempt/outcome.d.ts +3 -5
- package/dist/attempt/outcome.d.ts.map +1 -1
- package/dist/attempt/outcome.js +2 -4
- package/dist/attempt/outcome.js.map +1 -1
- package/dist/attempt/salvage.d.ts +77 -0
- package/dist/attempt/salvage.d.ts.map +1 -0
- package/dist/attempt/salvage.js +49 -0
- package/dist/attempt/salvage.js.map +1 -0
- package/dist/attempt/start.d.ts +35 -0
- package/dist/attempt/start.d.ts.map +1 -0
- package/dist/attempt/start.js +30 -0
- package/dist/attempt/start.js.map +1 -0
- package/dist/closed-struct.d.ts +7 -0
- package/dist/closed-struct.d.ts.map +1 -0
- package/dist/closed-struct.js +12 -0
- package/dist/closed-struct.js.map +1 -0
- package/dist/cycle-budget.d.ts +7 -8
- package/dist/cycle-budget.d.ts.map +1 -1
- package/dist/cycle-budget.js +16 -20
- package/dist/cycle-budget.js.map +1 -1
- package/dist/event.d.ts +4 -8
- package/dist/event.d.ts.map +1 -1
- package/dist/event.js +4 -8
- package/dist/event.js.map +1 -1
- package/dist/instance.d.ts +7 -1
- package/dist/instance.d.ts.map +1 -1
- package/dist/instance.js +6 -1
- package/dist/instance.js.map +1 -1
- package/dist/item.d.ts +1 -2
- package/dist/item.d.ts.map +1 -1
- package/dist/item.js +1 -2
- package/dist/item.js.map +1 -1
- package/dist/loop.d.ts +10 -2
- package/dist/loop.d.ts.map +1 -1
- package/dist/loop.js +9 -2
- package/dist/loop.js.map +1 -1
- package/dist/operator.d.ts +8 -0
- package/dist/operator.d.ts.map +1 -0
- package/dist/operator.js +9 -0
- package/dist/operator.js.map +1 -0
- package/dist/repository.d.ts +6 -8
- package/dist/repository.d.ts.map +1 -1
- package/dist/repository.js +8 -10
- package/dist/repository.js.map +1 -1
- package/dist/run/again.d.ts +13 -0
- package/dist/run/again.d.ts.map +1 -0
- package/dist/run/again.js +14 -0
- package/dist/run/again.js.map +1 -0
- package/dist/run/approval.d.ts +27 -0
- package/dist/run/approval.d.ts.map +1 -0
- package/dist/run/approval.js +25 -0
- package/dist/run/approval.js.map +1 -0
- package/dist/run/run.d.ts +2 -2
- package/dist/run/run.d.ts.map +1 -1
- package/dist/run/run.js +2 -2
- package/dist/run/run.js.map +1 -1
- package/dist/run/state.d.ts +22 -31
- package/dist/run/state.d.ts.map +1 -1
- package/dist/run/state.js +23 -36
- package/dist/run/state.js.map +1 -1
- package/dist/step/harvest.d.ts +44 -0
- package/dist/step/harvest.d.ts.map +1 -0
- package/dist/step/harvest.js +368 -0
- package/dist/step/harvest.js.map +1 -0
- package/dist/step/result.d.ts +15 -4
- package/dist/step/result.d.ts.map +1 -1
- package/dist/step/result.js +14 -4
- package/dist/step/result.js.map +1 -1
- package/dist/step/step.d.ts +2 -8
- package/dist/step/step.d.ts.map +1 -1
- package/dist/step/step.js +2 -8
- package/dist/step/step.js.map +1 -1
- package/dist/worker.d.ts +160 -4
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +171 -4
- package/dist/worker.js.map +1 -1
- package/package.json +32 -7
package/dist/step/result.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare const Commit_base: Schema.Class<Commit, Schema.TaggedStruct<"Commit", {
|
|
|
3
3
|
readonly sha: Schema.brand<Schema.String, "CommitSha">;
|
|
4
4
|
readonly summary: Schema.NonEmptyString;
|
|
5
5
|
}>, {}>;
|
|
6
|
-
/** A commit
|
|
6
|
+
/** A commit between the workspace base and the final HEAD. */
|
|
7
7
|
export declare class Commit extends Commit_base {
|
|
8
8
|
}
|
|
9
9
|
declare const PullRequest_base: Schema.Class<PullRequest, Schema.TaggedStruct<"PullRequest", {
|
|
@@ -13,20 +13,31 @@ declare const PullRequest_base: Schema.Class<PullRequest, Schema.TaggedStruct<"P
|
|
|
13
13
|
/** A pull request the agent created or updated during the Attempt. */
|
|
14
14
|
export declare class PullRequest extends PullRequest_base {
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* - `issue-comment`: in an issue or pull request conversation.
|
|
18
|
+
* - `review`: a submitted pull request review.
|
|
19
|
+
* - `review-comment`: on a line of a pull request diff, including replies in a review thread.
|
|
20
|
+
*/
|
|
21
|
+
export declare const CommentKind: Schema.Literals<readonly ["issue-comment", "review", "review-comment"]>;
|
|
22
|
+
export type CommentKind = typeof CommentKind.Type;
|
|
16
23
|
declare const Comment_base: Schema.Class<Comment, Schema.TaggedStruct<"Comment", {
|
|
17
24
|
readonly url: Schema.URLFromString;
|
|
25
|
+
readonly kind: Schema.Literals<readonly ["issue-comment", "review", "review-comment"]>;
|
|
26
|
+
readonly at: Schema.OptionFromOptionalKey<Schema.DateTimeUtcFromString>;
|
|
18
27
|
}>, {}>;
|
|
19
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* A GitHub comment or review that the agent created or updated on the Run's Item. `at` is the
|
|
30
|
+
* creation time of a comment or submission time of a review, or `None` for older records.
|
|
31
|
+
*/
|
|
20
32
|
export declare class Comment extends Comment_base {
|
|
21
33
|
}
|
|
22
|
-
/** A commit or GitHub artifact recorded as an outcome of the Agent's work. */
|
|
23
34
|
export declare const StepResultFact: Schema.Union<readonly [typeof Commit, typeof PullRequest, typeof Comment]>;
|
|
24
35
|
export type StepResultFact = typeof StepResultFact.Type;
|
|
25
36
|
declare const StepResult_base: Schema.Class<StepResult, Schema.Struct<{
|
|
26
37
|
readonly message: Schema.NonEmptyString;
|
|
27
38
|
readonly facts: Schema.$Array<Schema.Union<readonly [typeof Commit, typeof PullRequest, typeof Comment]>>;
|
|
28
39
|
}>, {}>;
|
|
29
|
-
/** The agent's final message
|
|
40
|
+
/** The agent's final message and the facts kept after workspace cleanup. */
|
|
30
41
|
export declare class StepResult extends StepResult_base {
|
|
31
42
|
}
|
|
32
43
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../src/step/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;AAGhC,
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../src/step/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;AAGhC,8DAA8D;AAC9D,qBAAa,MAAO,SAAQ,WAG1B;CAAG;;;;;AAEL,sEAAsE;AACtE,qBAAa,WAAY,SAAQ,gBAMhC;CAAG;AAEJ;;;;GAIG;AACH,eAAO,MAAM,WAAW,yEAAiE,CAAC;AAC1F,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;;;;;;AAElD;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,YAI3B;CAAG;AAEL,eAAO,MAAM,cAAc,4EAA+C,CAAC;AAC3E,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAC;;;;;AAExD,4EAA4E;AAC5E,qBAAa,UAAW,SAAQ,eAG9B;CAAG"}
|
package/dist/step/result.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { CommitSha } from "../repository.js";
|
|
3
|
-
/** A commit
|
|
3
|
+
/** A commit between the workspace base and the final HEAD. */
|
|
4
4
|
export class Commit extends Schema.TaggedClass("StepResult/Commit")("Commit", {
|
|
5
5
|
sha: CommitSha,
|
|
6
6
|
summary: Schema.NonEmptyString,
|
|
@@ -12,14 +12,24 @@ export class PullRequest extends Schema.TaggedClass("StepResult/PullRequest")("P
|
|
|
12
12
|
url: Schema.URLFromString,
|
|
13
13
|
}) {
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* - `issue-comment`: in an issue or pull request conversation.
|
|
17
|
+
* - `review`: a submitted pull request review.
|
|
18
|
+
* - `review-comment`: on a line of a pull request diff, including replies in a review thread.
|
|
19
|
+
*/
|
|
20
|
+
export const CommentKind = Schema.Literals(["issue-comment", "review", "review-comment"]);
|
|
21
|
+
/**
|
|
22
|
+
* A GitHub comment or review that the agent created or updated on the Run's Item. `at` is the
|
|
23
|
+
* creation time of a comment or submission time of a review, or `None` for older records.
|
|
24
|
+
*/
|
|
16
25
|
export class Comment extends Schema.TaggedClass("StepResult/Comment")("Comment", {
|
|
17
26
|
url: Schema.URLFromString,
|
|
27
|
+
kind: CommentKind,
|
|
28
|
+
at: Schema.OptionFromOptionalKey(Schema.DateTimeUtcFromString),
|
|
18
29
|
}) {
|
|
19
30
|
}
|
|
20
|
-
/** A commit or GitHub artifact recorded as an outcome of the Agent's work. */
|
|
21
31
|
export const StepResultFact = Schema.Union([Commit, PullRequest, Comment]);
|
|
22
|
-
/** The agent's final message
|
|
32
|
+
/** The agent's final message and the facts kept after workspace cleanup. */
|
|
23
33
|
export class StepResult extends Schema.Class("StepResult")({
|
|
24
34
|
message: Schema.NonEmptyString,
|
|
25
35
|
facts: Schema.Array(StepResultFact),
|
package/dist/step/result.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/step/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/step/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,8DAA8D;AAC9D,MAAM,OAAO,MAAO,SAAQ,MAAM,CAAC,WAAW,CAAS,mBAAmB,CAAC,CAAC,QAAQ,EAAE;IACpF,GAAG,EAAE,SAAS;IACd,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAAC;CAAG;AAEL,sEAAsE;AACtE,MAAM,OAAO,WAAY,SAAQ,MAAM,CAAC,WAAW,CAAc,wBAAwB,CAAC,CACxF,aAAa,EACb;IACE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;IAC1D,GAAG,EAAE,MAAM,CAAC,aAAa;CAC1B,CACF;CAAG;AAEJ;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,eAAe,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAG1F;;;GAGG;AACH,MAAM,OAAO,OAAQ,SAAQ,MAAM,CAAC,WAAW,CAAU,oBAAoB,CAAC,CAAC,SAAS,EAAE;IACxF,GAAG,EAAE,MAAM,CAAC,aAAa;IACzB,IAAI,EAAE,WAAW;IACjB,EAAE,EAAE,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC,qBAAqB,CAAC;CAC/D,CAAC;CAAG;AAEL,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AAG3E,4EAA4E;AAC5E,MAAM,OAAO,UAAW,SAAQ,MAAM,CAAC,KAAK,CAAa,YAAY,CAAC,CAAC;IACrE,OAAO,EAAE,MAAM,CAAC,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC;CACpC,CAAC;CAAG"}
|
package/dist/step/step.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { StepResult } from "./result.ts";
|
|
3
|
-
/**
|
|
4
|
-
* The loop-authored step name. Renaming a step in the loop file retires it and
|
|
5
|
-
* its stored results stay under the old name (ADR 0002).
|
|
6
|
-
*/
|
|
3
|
+
/** The step name from the loop file. After a rename, stored results stay under the old name (ADR 0002). */
|
|
7
4
|
export declare const StepName: Schema.brand<Schema.NonEmptyString, "StepName">;
|
|
8
5
|
export type StepName = typeof StepName.Type;
|
|
9
6
|
declare const Step_base: Schema.Class<Step, Schema.Struct<{
|
|
@@ -11,10 +8,7 @@ declare const Step_base: Schema.Class<Step, Schema.Struct<{
|
|
|
11
8
|
readonly name: Schema.brand<Schema.NonEmptyString, "StepName">;
|
|
12
9
|
readonly result: Schema.Option<typeof StepResult>;
|
|
13
10
|
}>, {}>;
|
|
14
|
-
/**
|
|
15
|
-
* A named unit of work inside a run, exactly one per run in v1. The result is
|
|
16
|
-
* stored when an attempt succeeds and is none until then.
|
|
17
|
-
*/
|
|
11
|
+
/** A unit of work in a Run, exactly one per Run in v1. `result` is `None` until an Attempt succeeds. */
|
|
18
12
|
export declare class Step extends Step_base {
|
|
19
13
|
}
|
|
20
14
|
export {};
|
package/dist/step/step.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/step/step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/step/step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,2GAA2G;AAC3G,eAAO,MAAM,QAAQ,iDAAuD,CAAC;AAE7E,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC;;;;;;AAE5C,wGAAwG;AACxG,qBAAa,IAAK,SAAQ,SAIxB;CAAG"}
|
package/dist/step/step.js
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { RunId } from "../run/run.js";
|
|
3
3
|
import { StepResult } from "./result.js";
|
|
4
|
-
/**
|
|
5
|
-
* The loop-authored step name. Renaming a step in the loop file retires it and
|
|
6
|
-
* its stored results stay under the old name (ADR 0002).
|
|
7
|
-
*/
|
|
4
|
+
/** The step name from the loop file. After a rename, stored results stay under the old name (ADR 0002). */
|
|
8
5
|
export const StepName = Schema.NonEmptyString.pipe(Schema.brand("StepName"));
|
|
9
|
-
/**
|
|
10
|
-
* A named unit of work inside a run, exactly one per run in v1. The result is
|
|
11
|
-
* stored when an attempt succeeds and is none until then.
|
|
12
|
-
*/
|
|
6
|
+
/** A unit of work in a Run, exactly one per Run in v1. `result` is `None` until an Attempt succeeds. */
|
|
13
7
|
export class Step extends Schema.Class("Step")({
|
|
14
8
|
runId: RunId,
|
|
15
9
|
name: StepName,
|
package/dist/step/step.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.js","sourceRoot":"","sources":["../../src/step/step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC
|
|
1
|
+
{"version":3,"file":"step.js","sourceRoot":"","sources":["../../src/step/step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,2GAA2G;AAC3G,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AAI7E,wGAAwG;AACxG,MAAM,OAAO,IAAK,SAAQ,MAAM,CAAC,KAAK,CAAO,MAAM,CAAC,CAAC;IACnD,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;CAClC,CAAC;CAAG"}
|
package/dist/worker.d.ts
CHANGED
|
@@ -1,9 +1,165 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
/** Kebab-case name of a configured Worker. */
|
|
3
2
|
export declare const WorkerName: Schema.brand<Schema.String, "WorkerName">;
|
|
4
3
|
export type WorkerName = typeof WorkerName.Type;
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const WorkerKind: Schema.Literals<readonly ["local", "exe.dev"]>;
|
|
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"]>;
|
|
8
6
|
export type WorkerKind = typeof WorkerKind.Type;
|
|
7
|
+
/**
|
|
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
|
+
*/
|
|
11
|
+
export declare const BotLogin: Schema.brand<Schema.String, "BotLogin">;
|
|
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
|
+
}>, {}>;
|
|
20
|
+
/**
|
|
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=...`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const SshDestination: Schema.brand<Schema.String, "SshDestination">;
|
|
34
|
+
export type SshDestination = typeof SshDestination.Type;
|
|
35
|
+
export declare const SshPort: Schema.brand<Schema.Int, "SshPort">;
|
|
36
|
+
export type SshPort = typeof SshPort.Type;
|
|
37
|
+
/** The `ssh` private key path, absolute or starting with `~/`. */
|
|
38
|
+
export declare const SshIdentityFile: Schema.brand<Schema.String, "SshIdentityFile">;
|
|
39
|
+
export type SshIdentityFile = typeof SshIdentityFile.Type;
|
|
40
|
+
/**
|
|
41
|
+
* The absolute directory on the Worker's machine that contains `workers/<worker>`, with cached
|
|
42
|
+
* clones, Attempt checkouts, and Attempt credentials.
|
|
43
|
+
*/
|
|
44
|
+
export declare const WorkerRoot: Schema.brand<Schema.String, "WorkerRoot">;
|
|
45
|
+
export type WorkerRoot = typeof WorkerRoot.Type;
|
|
46
|
+
/**
|
|
47
|
+
* The Gateway's private DNS domain, which serves `git.<domain>` for GitHub, `llm.<domain>` for
|
|
48
|
+
* LLM providers, and `<domain>` for the forward proxy
|
|
49
|
+
* ([ADR 0027](../../../docs/adr/0027-gateway-credential-proxy.md)).
|
|
50
|
+
*/
|
|
51
|
+
export declare const GatewayDomain: Schema.brand<Schema.String, "GatewayDomain">;
|
|
52
|
+
export type GatewayDomain = typeof GatewayDomain.Type;
|
|
53
|
+
/** The Gateway admin API port on the Gateway's loopback interface (`USINE_GATEWAY_ADMIN_PORT`), used through an SSH forward. */
|
|
54
|
+
export declare const GatewayAdminPort: Schema.brand<Schema.Int, "GatewayAdminPort">;
|
|
55
|
+
export type GatewayAdminPort = typeof GatewayAdminPort.Type;
|
|
56
|
+
/**
|
|
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.
|
|
60
|
+
*/
|
|
61
|
+
export declare const GatewayLlmProvider: Schema.Literals<readonly ["anthropic", "openai"]>;
|
|
62
|
+
export type GatewayLlmProvider = typeof GatewayLlmProvider.Type;
|
|
63
|
+
/**
|
|
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)).
|
|
69
|
+
*/
|
|
70
|
+
export declare const GatewayCredentialKind: Schema.Literals<readonly ["api-key", "subscription"]>;
|
|
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 {};
|
|
9
165
|
//# sourceMappingURL=worker.d.ts.map
|
package/dist/worker.d.ts.map
CHANGED
|
@@ -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,
|
|
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,EAAE,YAAY,CAAU,CAAC;AAC/E,eAAO,MAAM,UAAU,qEAAgC,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,QAAQ,yCAIW,CAAC;AACjC,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC;AAE5C,6EAA6E;AAC7E,eAAO,MAAM,SAAS,uCAErB,CAAC;AACF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAC;;;;;AAE9C;;;GAGG;AACH,qBAAa,U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AAE9D,mEAAmE;AACnE,eAAO,MAAM,eAAe,gDAIW,CAAC;AACxC,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,YAAY,6CAIW,CAAC;AACrC,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAC;AAEpD,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,oDAIW,CAAC;AAC5C,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAC;AAMlE,oEAAoE;AACpE,eAAO,MAAM,mBAAmB,UAAW,MAAM,KAAG,OAA0C,CAAC;AAE/F;;;GAGG;AACH,eAAO,MAAM,aAAa,8CAezB,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAC;AAEtD,iDAAiD;AACjD,eAAO,MAAM,OAAO,wCAEW,CAAC;AAChC,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,QAAQ,mEAA2D,CAAC;AACjF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC"}
|
package/dist/worker.js
CHANGED
|
@@ -1,9 +1,176 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
/** Kebab-case name of a configured Worker. */
|
|
3
2
|
export const WorkerName = Schema.String.check(Schema.isPattern(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u, {
|
|
4
|
-
message: "Expected a kebab-case
|
|
3
|
+
message: "Expected a kebab-case worker name",
|
|
5
4
|
})).pipe(Schema.brand("WorkerName"));
|
|
6
|
-
|
|
7
|
-
export const WORKER_KINDS = ["local", "exe.dev"];
|
|
5
|
+
export const WORKER_KINDS = ["local", "exe.dev", "ssh", "cloudflare"];
|
|
8
6
|
export const WorkerKind = Schema.Literals(WORKER_KINDS);
|
|
7
|
+
/**
|
|
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
|
+
*/
|
|
11
|
+
export const BotLogin = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\[bot\]$/u, {
|
|
12
|
+
message: "Expected a GitHub bot login: <slug>[bot]",
|
|
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"));
|
|
16
|
+
/**
|
|
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).
|
|
19
|
+
*/
|
|
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, {
|
|
35
|
+
message: "Expected an SSH destination: a host name or address, optionally prefixed by a user",
|
|
36
|
+
})).pipe(Schema.brand("SshDestination"));
|
|
37
|
+
export const SshPort = Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 65_535 })).pipe(Schema.brand("SshPort"));
|
|
38
|
+
/** The `ssh` private key path, absolute or starting with `~/`. */
|
|
39
|
+
export const SshIdentityFile = Schema.String.check(Schema.isPattern(/^(?:\/|~\/)[!-~]+$/u, {
|
|
40
|
+
message: "Expected an absolute or ~/ key path without spaces or control characters",
|
|
41
|
+
})).pipe(Schema.brand("SshIdentityFile"));
|
|
42
|
+
/**
|
|
43
|
+
* The absolute directory on the Worker's machine that contains `workers/<worker>`, with cached
|
|
44
|
+
* clones, Attempt checkouts, and Attempt credentials.
|
|
45
|
+
*/
|
|
46
|
+
export const WorkerRoot = Schema.String.check(Schema.isPattern(/^(?:\/[!-.0-~]+)+$/u, {
|
|
47
|
+
message: "Expected an absolute directory without spaces, control characters, or a trailing /",
|
|
48
|
+
})).pipe(Schema.brand("WorkerRoot"));
|
|
49
|
+
/**
|
|
50
|
+
* The Gateway's private DNS domain, which serves `git.<domain>` for GitHub, `llm.<domain>` for
|
|
51
|
+
* LLM providers, and `<domain>` for the forward proxy
|
|
52
|
+
* ([ADR 0027](../../../docs/adr/0027-gateway-credential-proxy.md)).
|
|
53
|
+
*/
|
|
54
|
+
export const GatewayDomain = Schema.String.check(Schema.isPattern(/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/u, { message: "Expected a lowercase DNS domain" })).pipe(Schema.brand("GatewayDomain"));
|
|
55
|
+
/** The Gateway admin API port on the Gateway's loopback interface (`USINE_GATEWAY_ADMIN_PORT`), used through an SSH forward. */
|
|
56
|
+
export const GatewayAdminPort = Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 65_535 })).pipe(Schema.brand("GatewayAdminPort"));
|
|
57
|
+
/**
|
|
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.
|
|
61
|
+
*/
|
|
62
|
+
export const GatewayLlmProvider = Schema.Literals(["anthropic", "openai"]);
|
|
63
|
+
/**
|
|
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)).
|
|
69
|
+
*/
|
|
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"]);
|
|
9
176
|
//# sourceMappingURL=worker.js.map
|
package/dist/worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,
|
|
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,EAAE,YAAY,CAAU,CAAC;AAC/E,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,CAAC;AAGjC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC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K,SAAS;QAC3B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,sFAAsF,QAAQ,GAAG,CAAC;AACxG,CAAC,CAAC,CACH,CAAC;AAGF,iDAAiD;AACjD,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CACxC,MAAM,CAAC,SAAS,CAAC,2BAA2B,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC,CACxF,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AAGhC;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usine/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Domain model for usine: Event → Run → Step → Attempt, branded ids, the run state machine, and the typed attempt-failure taxonomy.",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/basaltbytes/usine.git",
|
|
9
9
|
"directory": "packages/core"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
|
-
"dist"
|
|
12
|
+
"dist",
|
|
13
|
+
"!dist/tsconfig.tsbuildinfo"
|
|
13
14
|
],
|
|
14
15
|
"type": "module",
|
|
15
16
|
"sideEffects": false,
|
|
@@ -46,6 +47,14 @@
|
|
|
46
47
|
"types": "./dist/attempt/outcome.d.ts",
|
|
47
48
|
"default": "./dist/attempt/outcome.js"
|
|
48
49
|
},
|
|
50
|
+
"./attempt/salvage": {
|
|
51
|
+
"types": "./dist/attempt/salvage.d.ts",
|
|
52
|
+
"default": "./dist/attempt/salvage.js"
|
|
53
|
+
},
|
|
54
|
+
"./attempt/start": {
|
|
55
|
+
"types": "./dist/attempt/start.d.ts",
|
|
56
|
+
"default": "./dist/attempt/start.js"
|
|
57
|
+
},
|
|
49
58
|
"./event": {
|
|
50
59
|
"types": "./dist/event.d.ts",
|
|
51
60
|
"default": "./dist/event.js"
|
|
@@ -62,6 +71,10 @@
|
|
|
62
71
|
"types": "./dist/loop.d.ts",
|
|
63
72
|
"default": "./dist/loop.js"
|
|
64
73
|
},
|
|
74
|
+
"./operator": {
|
|
75
|
+
"types": "./dist/operator.d.ts",
|
|
76
|
+
"default": "./dist/operator.js"
|
|
77
|
+
},
|
|
65
78
|
"./repository": {
|
|
66
79
|
"types": "./dist/repository.d.ts",
|
|
67
80
|
"default": "./dist/repository.js"
|
|
@@ -74,6 +87,14 @@
|
|
|
74
87
|
"types": "./dist/run/state.d.ts",
|
|
75
88
|
"default": "./dist/run/state.js"
|
|
76
89
|
},
|
|
90
|
+
"./run/approval": {
|
|
91
|
+
"types": "./dist/run/approval.d.ts",
|
|
92
|
+
"default": "./dist/run/approval.js"
|
|
93
|
+
},
|
|
94
|
+
"./run/again": {
|
|
95
|
+
"types": "./dist/run/again.d.ts",
|
|
96
|
+
"default": "./dist/run/again.js"
|
|
97
|
+
},
|
|
77
98
|
"./step": {
|
|
78
99
|
"types": "./dist/step/step.d.ts",
|
|
79
100
|
"default": "./dist/step/step.js"
|
|
@@ -82,6 +103,10 @@
|
|
|
82
103
|
"types": "./dist/step/result.d.ts",
|
|
83
104
|
"default": "./dist/step/result.js"
|
|
84
105
|
},
|
|
106
|
+
"./step/harvest": {
|
|
107
|
+
"types": "./dist/step/harvest.d.ts",
|
|
108
|
+
"default": "./dist/step/harvest.js"
|
|
109
|
+
},
|
|
85
110
|
"./worker": {
|
|
86
111
|
"types": "./dist/worker.d.ts",
|
|
87
112
|
"default": "./dist/worker.js"
|
|
@@ -95,14 +120,14 @@
|
|
|
95
120
|
"access": "public"
|
|
96
121
|
},
|
|
97
122
|
"devDependencies": {
|
|
98
|
-
"@effect/vitest": "4.0.
|
|
99
|
-
"effect": "4.0.
|
|
123
|
+
"@effect/vitest": "4.0.6",
|
|
124
|
+
"effect": "4.0.6",
|
|
100
125
|
"typescript": "7.0.2",
|
|
101
|
-
"vitest": "
|
|
126
|
+
"vitest": "5.0.5",
|
|
102
127
|
"@usine/tsconfig": "0.0.0"
|
|
103
128
|
},
|
|
104
129
|
"peerDependencies": {
|
|
105
|
-
"effect": "4.0.
|
|
130
|
+
"effect": "4.0.6"
|
|
106
131
|
},
|
|
107
132
|
"engines": {
|
|
108
133
|
"node": ">=22"
|