@usine/core 0.2.0 → 0.4.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 (102) hide show
  1. package/README.md +43 -16
  2. package/dist/agent/agent.d.ts +12 -8
  3. package/dist/agent/agent.d.ts.map +1 -1
  4. package/dist/agent/agent.js +14 -10
  5. package/dist/agent/agent.js.map +1 -1
  6. package/dist/agent/brain.d.ts +2 -6
  7. package/dist/agent/brain.d.ts.map +1 -1
  8. package/dist/agent/brain.js +3 -7
  9. package/dist/agent/brain.js.map +1 -1
  10. package/dist/agent/capability.d.ts +4 -4
  11. package/dist/agent/capability.d.ts.map +1 -1
  12. package/dist/agent/capability.js +4 -4
  13. package/dist/agent/capability.js.map +1 -1
  14. package/dist/agent/session.d.ts +95 -21
  15. package/dist/agent/session.d.ts.map +1 -1
  16. package/dist/agent/session.js +100 -21
  17. package/dist/agent/session.js.map +1 -1
  18. package/dist/attempt/attempt.d.ts +63 -11
  19. package/dist/attempt/attempt.d.ts.map +1 -1
  20. package/dist/attempt/attempt.js +81 -11
  21. package/dist/attempt/attempt.js.map +1 -1
  22. package/dist/attempt/channel.d.ts +142 -44
  23. package/dist/attempt/channel.d.ts.map +1 -1
  24. package/dist/attempt/channel.js +124 -36
  25. package/dist/attempt/channel.js.map +1 -1
  26. package/dist/attempt/failure.d.ts +27 -14
  27. package/dist/attempt/failure.d.ts.map +1 -1
  28. package/dist/attempt/failure.js +27 -14
  29. package/dist/attempt/failure.js.map +1 -1
  30. package/dist/attempt/outcome.d.ts +3 -5
  31. package/dist/attempt/outcome.d.ts.map +1 -1
  32. package/dist/attempt/outcome.js +2 -4
  33. package/dist/attempt/outcome.js.map +1 -1
  34. package/dist/attempt/salvage.d.ts +50 -0
  35. package/dist/attempt/salvage.d.ts.map +1 -0
  36. package/dist/attempt/salvage.js +21 -0
  37. package/dist/attempt/salvage.js.map +1 -0
  38. package/dist/attempt/start.d.ts +35 -0
  39. package/dist/attempt/start.d.ts.map +1 -0
  40. package/dist/attempt/start.js +30 -0
  41. package/dist/attempt/start.js.map +1 -0
  42. package/dist/cycle-budget.d.ts +7 -8
  43. package/dist/cycle-budget.d.ts.map +1 -1
  44. package/dist/cycle-budget.js +9 -10
  45. package/dist/cycle-budget.js.map +1 -1
  46. package/dist/event.d.ts +4 -8
  47. package/dist/event.d.ts.map +1 -1
  48. package/dist/event.js +4 -8
  49. package/dist/event.js.map +1 -1
  50. package/dist/instance.d.ts +1 -1
  51. package/dist/instance.d.ts.map +1 -1
  52. package/dist/instance.js +1 -1
  53. package/dist/instance.js.map +1 -1
  54. package/dist/item.d.ts +1 -2
  55. package/dist/item.d.ts.map +1 -1
  56. package/dist/item.js +1 -2
  57. package/dist/item.js.map +1 -1
  58. package/dist/loop.d.ts +10 -2
  59. package/dist/loop.d.ts.map +1 -1
  60. package/dist/loop.js +9 -2
  61. package/dist/loop.js.map +1 -1
  62. package/dist/operator.d.ts +8 -0
  63. package/dist/operator.d.ts.map +1 -0
  64. package/dist/operator.js +9 -0
  65. package/dist/operator.js.map +1 -0
  66. package/dist/repository.d.ts +6 -8
  67. package/dist/repository.d.ts.map +1 -1
  68. package/dist/repository.js +8 -10
  69. package/dist/repository.js.map +1 -1
  70. package/dist/run/again.d.ts +13 -0
  71. package/dist/run/again.d.ts.map +1 -0
  72. package/dist/run/again.js +13 -0
  73. package/dist/run/again.js.map +1 -0
  74. package/dist/run/approval.d.ts +27 -0
  75. package/dist/run/approval.d.ts.map +1 -0
  76. package/dist/run/approval.js +26 -0
  77. package/dist/run/approval.js.map +1 -0
  78. package/dist/run/run.d.ts +2 -2
  79. package/dist/run/run.d.ts.map +1 -1
  80. package/dist/run/run.js +2 -2
  81. package/dist/run/run.js.map +1 -1
  82. package/dist/run/state.d.ts +22 -31
  83. package/dist/run/state.d.ts.map +1 -1
  84. package/dist/run/state.js +23 -36
  85. package/dist/run/state.js.map +1 -1
  86. package/dist/step/harvest.d.ts +44 -0
  87. package/dist/step/harvest.d.ts.map +1 -0
  88. package/dist/step/harvest.js +368 -0
  89. package/dist/step/harvest.js.map +1 -0
  90. package/dist/step/result.d.ts +15 -4
  91. package/dist/step/result.d.ts.map +1 -1
  92. package/dist/step/result.js +14 -4
  93. package/dist/step/result.js.map +1 -1
  94. package/dist/step/step.d.ts +2 -8
  95. package/dist/step/step.d.ts.map +1 -1
  96. package/dist/step/step.js +2 -8
  97. package/dist/step/step.js.map +1 -1
  98. package/dist/worker.d.ts +48 -4
  99. package/dist/worker.d.ts.map +1 -1
  100. package/dist/worker.js +47 -4
  101. package/dist/worker.js.map +1 -1
  102. package/package.json +27 -2
@@ -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 the run host found between the workspace base and final HEAD. */
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
- /** A GitHub comment the agent created or updated during the Attempt. */
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 plus the facts that survive workspace cleanup. */
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,6EAA6E;AAC7E,qBAAa,MAAO,SAAQ,WAG1B;CAAG;;;;;AAEL,sEAAsE;AACtE,qBAAa,WAAY,SAAQ,gBAMhC;CAAG;;;;AAEJ,wEAAwE;AACxE,qBAAa,OAAQ,SAAQ,YAE3B;CAAG;AAEL,8EAA8E;AAC9E,eAAO,MAAM,cAAc,4EAA+C,CAAC;AAC3E,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAC;;;;;AAExD,+EAA+E;AAC/E,qBAAa,UAAW,SAAQ,eAG9B;CAAG"}
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"}
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
  import { CommitSha } from "../repository.js";
3
- /** A commit the run host found between the workspace base and final HEAD. */
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
- /** A GitHub comment the agent created or updated during the Attempt. */
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 plus the facts that survive workspace cleanup. */
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),
@@ -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,6EAA6E;AAC7E,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,wEAAwE;AACxE,MAAM,OAAO,OAAQ,SAAQ,MAAM,CAAC,WAAW,CAAU,oBAAoB,CAAC,CAAC,SAAS,EAAE;IACxF,GAAG,EAAE,MAAM,CAAC,aAAa;CAC1B,CAAC;CAAG;AAEL,8EAA8E;AAC9E,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AAG3E,+EAA+E;AAC/E,MAAM,OAAO,UAAW,SAAQ,MAAM,CAAC,KAAK,CAAa,YAAY,CAAC,CAAC;IACrE,OAAO,EAAE,MAAM,CAAC,cAAc;IAC9B,KAAK,EAAE,MAAM,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Y,CAAC,CAAC;IACrE,OAAO,EAAE,MAAM,CAAC,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC;CACpC,CAAC;CAAG"}
@@ -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 {};
@@ -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;;;GAGG;AACH,eAAO,MAAM,QAAQ,iDAAuD,CAAC;AAE7E,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC;;;;;;AAE5C;;;GAGG;AACH,qBAAa,IAAK,SAAQ,SAIxB;CAAG"}
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,
@@ -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;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AAI7E;;;GAGG;AACH,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"}
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,53 @@
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
- /** The Worker adapters the engine ships. */
6
- export declare const WORKER_KINDS: readonly ["local", "exe.dev"];
7
- export declare const WorkerKind: Schema.Literals<readonly ["local", "exe.dev"]>;
4
+ export declare const WORKER_KINDS: readonly ["local", "exe.dev", "ssh"];
5
+ export declare const WorkerKind: Schema.Literals<readonly ["local", "exe.dev", "ssh"]>;
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 and SSH
9
+ * 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
+ /**
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=...`.
16
+ */
17
+ export declare const SshDestination: Schema.brand<Schema.String, "SshDestination">;
18
+ export type SshDestination = typeof SshDestination.Type;
19
+ export declare const SshPort: Schema.brand<Schema.Int, "SshPort">;
20
+ export type SshPort = typeof SshPort.Type;
21
+ /** The `ssh` private key path, absolute or starting with `~/`. */
22
+ export declare const SshIdentityFile: Schema.brand<Schema.String, "SshIdentityFile">;
23
+ export type SshIdentityFile = typeof SshIdentityFile.Type;
24
+ /**
25
+ * The absolute directory on the Worker's machine that contains `workers/<worker>`, with cached
26
+ * clones, Attempt checkouts, and Attempt credentials.
27
+ */
28
+ export declare const WorkerRoot: Schema.brand<Schema.String, "WorkerRoot">;
29
+ export type WorkerRoot = typeof WorkerRoot.Type;
30
+ /**
31
+ * The Gateway's private DNS domain, which serves `git.<domain>` for GitHub, `llm.<domain>` for
32
+ * LLM providers, and `<domain>` for the forward proxy
33
+ * ([ADR 0027](../../../docs/adr/0027-gateway-credential-proxy.md)).
34
+ */
35
+ export declare const GatewayDomain: Schema.brand<Schema.String, "GatewayDomain">;
36
+ export type GatewayDomain = typeof GatewayDomain.Type;
37
+ /** The Gateway admin API port on the Gateway's loopback interface (`USINE_GATEWAY_ADMIN_PORT`), used through an SSH forward. */
38
+ export declare const GatewayAdminPort: Schema.brand<Schema.Int, "GatewayAdminPort">;
39
+ export type GatewayAdminPort = typeof GatewayAdminPort.Type;
40
+ /**
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.
43
+ */
44
+ export declare const GatewayLlmProvider: Schema.Literals<readonly ["anthropic"]>;
45
+ export type GatewayLlmProvider = typeof GatewayLlmProvider.Type;
46
+ /**
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)).
50
+ */
51
+ export declare const GatewayCredentialKind: Schema.Literals<readonly ["api-key", "subscription"]>;
52
+ export type GatewayCredentialKind = typeof GatewayCredentialKind.Type;
9
53
  //# 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,8CAA8C;AAC9C,eAAO,MAAM,UAAU,2CAIW,CAAC;AAEnC,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAEhD,4CAA4C;AAC5C,eAAO,MAAM,YAAY,YAAI,OAAO,EAAE,SAAS,CAAU,CAAC;AAC1D,eAAO,MAAM,UAAU,gDAAgC,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC"}
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,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;;;GAGG;AACH,eAAO,MAAM,cAAc,+CAIW,CAAC;AACvC,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAC;AAExD,eAAO,MAAM,OAAO,qCAEnB,CAAC;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAE1C,kEAAkE;AAClE,eAAO,MAAM,eAAe,gDAIW,CAAC;AACxC,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,UAAU,2CAIW,CAAC;AACnC,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,aAAa,8CAKW,CAAC;AACtC,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAC;AAEtD,gIAAgI;AAChI,eAAO,MAAM,gBAAgB,8CAEW,CAAC;AACzC,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAC,IAAI,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,kBAAkB,yCAAiC,CAAC;AACjE,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC,IAAI,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,uDAA+C,CAAC;AAClF,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAC,IAAI,CAAC"}
package/dist/worker.js CHANGED
@@ -1,9 +1,52 @@
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 Worker name",
3
+ message: "Expected a kebab-case worker name",
5
4
  })).pipe(Schema.brand("WorkerName"));
6
- /** The Worker adapters the engine ships. */
7
- export const WORKER_KINDS = ["local", "exe.dev"];
5
+ export const WORKER_KINDS = ["local", "exe.dev", "ssh"];
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 and SSH
9
+ * 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
+ /**
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
+ */
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, {
19
+ message: "Expected an SSH destination: a host name or address, optionally prefixed by a user",
20
+ })).pipe(Schema.brand("SshDestination"));
21
+ export const SshPort = Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 65_535 })).pipe(Schema.brand("SshPort"));
22
+ /** The `ssh` private key path, absolute or starting with `~/`. */
23
+ export const SshIdentityFile = Schema.String.check(Schema.isPattern(/^(?:\/|~\/)[!-~]+$/u, {
24
+ message: "Expected an absolute or ~/ key path without spaces or control characters",
25
+ })).pipe(Schema.brand("SshIdentityFile"));
26
+ /**
27
+ * The absolute directory on the Worker's machine that contains `workers/<worker>`, with cached
28
+ * clones, Attempt checkouts, and Attempt credentials.
29
+ */
30
+ export const WorkerRoot = Schema.String.check(Schema.isPattern(/^(?:\/[!-.0-~]+)+$/u, {
31
+ message: "Expected an absolute directory without spaces, control characters, or a trailing /",
32
+ })).pipe(Schema.brand("WorkerRoot"));
33
+ /**
34
+ * The Gateway's private DNS domain, which serves `git.<domain>` for GitHub, `llm.<domain>` for
35
+ * LLM providers, and `<domain>` for the forward proxy
36
+ * ([ADR 0027](../../../docs/adr/0027-gateway-credential-proxy.md)).
37
+ */
38
+ 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"));
39
+ /** The Gateway admin API port on the Gateway's loopback interface (`USINE_GATEWAY_ADMIN_PORT`), used through an SSH forward. */
40
+ export const GatewayAdminPort = Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 65_535 })).pipe(Schema.brand("GatewayAdminPort"));
41
+ /**
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.
44
+ */
45
+ export const GatewayLlmProvider = Schema.Literals(["anthropic"]);
46
+ /**
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)).
50
+ */
51
+ export const GatewayCredentialKind = Schema.Literals(["api-key", "subscription"]);
9
52
  //# 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,8CAA8C;AAC9C,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,4CAA4C;AAC5C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,SAAS,CAAU,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/wor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Domain model for usine: Event → Run → Step → Attempt, branded ids, the run state machine, and the typed attempt-failure taxonomy.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -9,7 +9,8 @@
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"