@usine/executor 0.1.0 → 0.2.1

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 (83) hide show
  1. package/README.md +52 -21
  2. package/dist/child-command.d.ts +8 -5
  3. package/dist/child-command.d.ts.map +1 -1
  4. package/dist/child-command.js +10 -7
  5. package/dist/child-command.js.map +1 -1
  6. package/dist/exe-dev/channel.d.ts +8 -4
  7. package/dist/exe-dev/channel.d.ts.map +1 -1
  8. package/dist/exe-dev/channel.js +16 -19
  9. package/dist/exe-dev/channel.js.map +1 -1
  10. package/dist/exe-dev/commands.d.ts +1 -1
  11. package/dist/exe-dev/commands.d.ts.map +1 -1
  12. package/dist/exe-dev/commands.js +7 -8
  13. package/dist/exe-dev/commands.js.map +1 -1
  14. package/dist/exe-dev/exe-dev.d.ts +8 -0
  15. package/dist/exe-dev/exe-dev.d.ts.map +1 -0
  16. package/dist/exe-dev/exe-dev.js +154 -0
  17. package/dist/exe-dev/exe-dev.js.map +1 -0
  18. package/dist/exe-dev/grants.d.ts +3 -4
  19. package/dist/exe-dev/grants.d.ts.map +1 -1
  20. package/dist/exe-dev/grants.js +31 -15
  21. package/dist/exe-dev/grants.js.map +1 -1
  22. package/dist/exe-dev/model.d.ts +8 -23
  23. package/dist/exe-dev/model.d.ts.map +1 -1
  24. package/dist/exe-dev/model.js +5 -12
  25. package/dist/exe-dev/model.js.map +1 -1
  26. package/dist/exe-dev/preflight.d.ts +3 -2
  27. package/dist/exe-dev/preflight.d.ts.map +1 -1
  28. package/dist/exe-dev/preflight.js +8 -8
  29. package/dist/exe-dev/preflight.js.map +1 -1
  30. package/dist/exe-dev/shell.d.ts +5 -5
  31. package/dist/exe-dev/shell.d.ts.map +1 -1
  32. package/dist/exe-dev/shell.js +7 -7
  33. package/dist/exe-dev/shell.js.map +1 -1
  34. package/dist/exe-dev/sweep.d.ts +3 -5
  35. package/dist/exe-dev/sweep.d.ts.map +1 -1
  36. package/dist/exe-dev/sweep.js +8 -10
  37. package/dist/exe-dev/sweep.js.map +1 -1
  38. package/dist/executor.d.ts +122 -0
  39. package/dist/executor.d.ts.map +1 -0
  40. package/dist/executor.js +100 -0
  41. package/dist/executor.js.map +1 -0
  42. package/dist/guard.d.ts +11 -0
  43. package/dist/guard.d.ts.map +1 -0
  44. package/dist/guard.js +74 -0
  45. package/dist/guard.js.map +1 -0
  46. package/dist/harness-preflight.d.ts +6 -0
  47. package/dist/harness-preflight.d.ts.map +1 -0
  48. package/dist/harness-preflight.js +50 -0
  49. package/dist/harness-preflight.js.map +1 -0
  50. package/dist/invalid-frame.d.ts +1 -1
  51. package/dist/invalid-frame.d.ts.map +1 -1
  52. package/dist/invalid-frame.js +2 -1
  53. package/dist/invalid-frame.js.map +1 -1
  54. package/dist/keyed-lock.d.ts +2 -2
  55. package/dist/keyed-lock.js +2 -2
  56. package/dist/local/local.d.ts +20 -0
  57. package/dist/local/local.d.ts.map +1 -0
  58. package/dist/local/{index.js → local.js} +87 -115
  59. package/dist/local/local.js.map +1 -0
  60. package/dist/prepared-attempt.d.ts +5 -0
  61. package/dist/prepared-attempt.d.ts.map +1 -0
  62. package/dist/prepared-attempt.js +32 -0
  63. package/dist/prepared-attempt.js.map +1 -0
  64. package/dist/provision.d.ts +20 -10
  65. package/dist/provision.d.ts.map +1 -1
  66. package/dist/provision.js +94 -23
  67. package/dist/provision.js.map +1 -1
  68. package/dist/run-host-session.d.ts +13 -8
  69. package/dist/run-host-session.d.ts.map +1 -1
  70. package/dist/run-host-session.js +116 -41
  71. package/dist/run-host-session.js.map +1 -1
  72. package/package.json +11 -11
  73. package/dist/exe-dev/index.d.ts +0 -8
  74. package/dist/exe-dev/index.d.ts.map +0 -1
  75. package/dist/exe-dev/index.js +0 -239
  76. package/dist/exe-dev/index.js.map +0 -1
  77. package/dist/index.d.ts +0 -82
  78. package/dist/index.d.ts.map +0 -1
  79. package/dist/index.js +0 -82
  80. package/dist/index.js.map +0 -1
  81. package/dist/local/index.d.ts +0 -15
  82. package/dist/local/index.d.ts.map +0 -1
  83. package/dist/local/index.js.map +0 -1
package/README.md CHANGED
@@ -1,56 +1,87 @@
1
1
  # @usine/executor
2
2
 
3
- Worker execution for [usine](https://github.com/basaltbytes/usine). The platform-free package root defines five operations: preflight, prepare, launch, cancel, and cleanup. It also owns the credential provider, Worker capability errors, and adapter-neutral request types.
3
+ Worker execution for [usine](https://github.com/basaltbytes/usine). The platform-free package root defines Worker preflight, scoped Attempt preparation, and cancellation. Each prepared Attempt launches its own run host and releases its resources at completion or when its scope closes. It also owns the credential provider, Worker capability errors, and adapter-neutral request types.
4
+
5
+ ## Attempt lifetime
6
+
7
+ Call `Executor.prepare(request)` inside `Effect.scoped`, then call `prepared.launch(io)`
8
+ once. The returned `PreparedAttempt` owns the checkout and repository access. Its
9
+ `workspace` is an `AttemptWorkspace` descriptor containing the Worker, RunSpec, and
10
+ worktree path; it can be serialized without exposing credentials or live handles.
11
+
12
+ ```ts
13
+ const result = yield* Effect.scoped(
14
+ Effect.gen(function* () {
15
+ const prepared = yield* executor.prepare(request)
16
+ return yield* prepared.launch(transcriptSink)
17
+ }),
18
+ )
19
+ ```
20
+
21
+ Preparation remains interruptible during clone, fetch, credential requests, and lock
22
+ waits. A failed prepare releases partial acquisitions immediately. An unlaunched
23
+ Attempt releases its resources when the surrounding scope closes. Launch finishes
24
+ cleanup before returning on success, failure, or interruption; closing the owner
25
+ scope also stops a launch running in another fiber. Each Attempt launches at most
26
+ once. Cleanup failures are logged without replacing a successful agent result with
27
+ a retryable failure. Set `CheckoutRequest.maxAttemptMinutes` to bound live run-host
28
+ execution; preparation and resource cleanup are outside that time budget.
29
+
30
+ Recognizable Effect log lines on run-host stdout are dropped with a warning that records safe shape metadata. Invalid JSON, schema-invalid frames, and protocol sequence violations still fail the Attempt.
31
+
32
+ This replaces the 0.x `Executor.launch(prepared, io)` and `Executor.cleanup(prepared)`
33
+ methods. Consumers supply a scope instead of coordinating cleanup. The engine's
34
+ `StepExecutor` reservation, execution, and interruption contract remains unchanged.
35
+
36
+ ## Worker preflight
37
+
38
+ Call `executor.preflight(worker, brains)` with the instance roster’s `BrainSpec` values before scheduling Attempts. Both adapters invoke `usine-run-host --preflight '<brain-json>'` on the Worker. The run host checks each selected harness’s executable and authentication; Codex requires supported CLI 0.144.0 or 0.153.4 and a ChatGPT login, Claude requires its CLI and subscription login, and Pi children require API keys for their selected models.
39
+
40
+ `prepare` repeats the assigned brain’s probe before acquiring credentials or creating a checkout. This checks roster changes and logouts after startup. A reported capability gap returns `WorkerCapabilityError` and requires operator action. Transport failures and probe timeouts remain infrastructure failures eligible for retry. Custom run hosts must implement the credential-free `HarnessReadiness` response from `@usine/core/agent/capability`.
41
+
42
+ This replaces exe.dev’s `HarnessLoginCheck` and `harnessLoginChecks` options. Pass the roster to `preflight` so readiness follows the agents the instance actually uses.
4
43
 
5
44
  ## Local Worker
6
45
 
7
46
  The Node adapter at `@usine/executor/local` does the following for each Attempt:
8
47
 
9
- - checks Git and the installed run-host protocol without changing worker state;
48
+ - checks Git, the installed run-host protocol, and the assigned harness before accepting work;
10
49
  - updates a per-repository bare cache, then creates a detached worktree at the resolved revision;
11
50
  - mints one repository credential and passes it only through the child process environment;
12
- - exchanges protocol-v3 envelopes with `@usine/run-host` over newline-delimited standard input and output, including immutable payload and agent context plus normalized session events;
51
+ - exchanges protocol-v6 envelopes with `@usine/run-host` over newline-delimited standard input and output, including immutable payload, agent context, child-session budget, and normalized session events;
13
52
  - interrupts cooperatively before a hard kill, then removes the worktree and wipes the credential.
14
53
 
15
54
  `LocalExecutorOptions.runHost` can override the child command for another compatible host. The adapter otherwise launches the executable shipped by `@usine/run-host` and rejects a protocol-version mismatch during preflight.
16
55
 
56
+ The adapter sets `TURBO_CACHE_DIR` to `.usine/workers/<worker>/turbo` for the run host. Startup cache sweeps prune only the `*.git` cache directories the adapter itself creates under `repos/`; every other entry is skipped and logged at debug level, and each sweep ends with an info log of pruned, skipped, and failed counts.
57
+
17
58
  The local layer requires Effect `FileSystem`, `Path`, and `ChildProcessSpawner` services plus a `CredentialProvider`. Everything is 0.x, so APIs may change. Supply `effect` at the version pinned by the usine workspace.
18
59
 
19
60
  ## exe.dev Worker
20
61
 
21
62
  `@usine/executor/exe-dev` runs the same contract on a persistent exe.dev VM. The configured Worker name must match the VM name. The VM image must already contain Git, Node.js 22 or later, the compatible `usine-run-host` executable, and every coding-agent login used by the instance.
22
63
 
23
- Preflight changes no remote state. It reads VM metadata through `ssh exe.dev ls --json`, checks Git and Node.js over SSH, compares the run-host protocol version, runs the configured harness login checks, and asks exe.dev to test each native GitHub integration.
64
+ Preflight creates no checkouts or credential grants. It reads VM metadata through `ssh exe.dev ls --json`, checks Git and Node.js over SSH, compares the run-host protocol version, probes the supplied roster through the remote run host, and asks exe.dev to test each native GitHub integration.
24
65
 
25
- Prepare attaches the repository's integration to the VM with a bounded `--for` grant. It then fetches a bare cached clone from `github.int.exe.xyz` and creates a detached worktree for the Attempt. Launch keeps one SSH process open and carries protocol-v3 frames on that process's standard input and output. Cleanup removes the worktree, prunes its cache registration, and detaches the integration after the last concurrent Attempt using it finishes.
66
+ Prepare attaches the repository's integration to the VM with a bounded `--for` grant. It then fetches a bare cached clone from `github.int.exe.xyz` and creates a detached worktree for the Attempt. Launch keeps one SSH process open and exchanges protocol-v6 frames on that process's standard input and output. Cleanup removes the worktree, prunes its cache registration, and detaches the integration after the last concurrent Attempt using it finishes.
26
67
 
27
68
  The first prepare on each VM after orchestrator startup sweeps abandoned Attempt worktrees and prunes cached worktree registrations left by a crash. Each sweep removal is isolated and logged: an immovable leftover never blocks its siblings or later prepares, and the sweep runs once per process regardless of partial failures. One-shot lobby and SSH commands carry a ten-minute timeout, and the SSH client sends keepalives so a dead link fails the operation instead of parking it. Cancellation also bounds interrupt persistence and delivery before escalating to a hard kill, so a parked store or remote process cannot stall shutdown; before removing a workspace, cleanup reads the run host's recorded pid on the VM and confirms the process is dead, because killing the local SSH client alone says nothing about the remote side.
28
69
 
29
- Concurrent Attempts against different repositories leave their integrations attached to the VM simultaneously; each grant stays time-boxed, and the refcounted release detaches an integration only after its last Attempt finishes. A failed detach is logged and left to lapse with its time-box.
70
+ Concurrent Attempts against different repositories leave their integrations attached to the VM simultaneously; each grant stays time-boxed, and the refcounted release detaches an integration only after its last Attempt finishes. A failed detach is logged and left to lapse with its time-box. If remote termination cannot be confirmed, cleanup retains the checkout and its Git registration for recovery, logs its location, and still releases the credential grant. Partial preparation rolls back without requiring remote-process confirmation because no run host has launched.
30
71
 
31
72
  ```ts
32
- import { Repository } from "@usine/core"
33
- import {
34
- GitHubIntegration,
35
- HarnessLoginCheck,
36
- IntegrationName,
37
- layer,
38
- } from "@usine/executor/exe-dev"
73
+ import { RepositoryName } from "@usine/core/repository"
74
+ import { layer } from "@usine/executor/exe-dev"
75
+ import { GitHubIntegration, IntegrationName } from "@usine/executor/exe-dev"
39
76
 
40
77
  const executorLayer = layer({
41
78
  githubIntegrations: [
42
79
  new GitHubIntegration({
43
- repository: Repository.Name.make("acme/widget"),
80
+ repository: RepositoryName.make("acme/widget"),
44
81
  name: IntegrationName.make("usine-acme-widget"),
45
82
  }),
46
83
  ],
47
- harnessLoginChecks: [
48
- new HarnessLoginCheck({
49
- harness: "codex",
50
- command: "codex",
51
- args: ["login", "status"],
52
- }),
53
- ],
84
+
54
85
  })
55
86
  ```
56
87
 
@@ -1,18 +1,21 @@
1
1
  import { Effect } from "effect";
2
2
  import { ChildProcess, type ChildProcessSpawner } from "effect/unstable/process";
3
- import { ExecutorOperationError, type ExecutorOperation } from "./index.ts";
3
+ import { ExecutorOperationError, type ExecutorOperation } from "./executor.ts";
4
4
  export interface CommandResult {
5
5
  readonly exitCode: number;
6
6
  readonly stderr: string;
7
7
  readonly stdout: string;
8
8
  }
9
9
  /**
10
- * The named variables are the only ones a child may inherit; everything else
11
- * in the orchestrator environment — the App private key above all — stays out.
10
+ * Returns only the named process variables, so the App private key and every
11
+ * other orchestrator secret stay out of the child.
12
12
  */
13
13
  export declare const allowlistedEnvironment: (names: ReadonlyArray<string>) => Effect.Effect<Record<string, string>>;
14
- /** One bounded child process, output collected whole; the exit code is the caller's. */
14
+ /**
15
+ * Runs one child process under the timeout and returns its whole output; the
16
+ * caller decides what the exit code means.
17
+ */
15
18
  export declare const collectCommand: (spawner: ChildProcessSpawner.ChildProcessSpawner["Service"], operation: ExecutorOperation, command: string, args: ReadonlyArray<string>, options: ChildProcess.CommandOptions) => Effect.Effect<CommandResult, ExecutorOperationError>;
16
- /** Turns a collected result into stdout, logging and failing on a non-zero exit. */
19
+ /** Returns the collected stdout, or logs and fails when the exit code is non-zero. */
17
20
  export declare const requireSuccess: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", host: string, command: string, args: readonly string[], result: CommandResult) => Effect.Effect<string, ExecutorOperationError, never>;
18
21
  //# sourceMappingURL=child-command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"child-command.d.ts","sourceRoot":"","sources":["../src/child-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,EAAyB,MAAM,QAAQ,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE5E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAKD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,UAC1B,aAAa,CAAC,MAAM,CAAC,KAC3B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASpC,CAAC;AAEJ,wFAAwF;AACxF,eAAO,MAAM,cAAc,YAChB,mBAAmB,CAAC,mBAAmB,CAAC,SAAS,CAAC,aAChD,iBAAiB,WACnB,MAAM,QACT,aAAa,CAAC,MAAM,CAAC,WAClB,YAAY,CAAC,cAAc,KACnC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,sBAAsB,CA+BnD,CAAC;AAEJ,oFAAoF;AACpF,eAAO,MAAM,cAAc,+MAsBzB,CAAC"}
1
+ {"version":3,"file":"child-command.d.ts","sourceRoot":"","sources":["../src/child-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,EAAyB,MAAM,QAAQ,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE/E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAKD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,UAC1B,aAAa,CAAC,MAAM,CAAC,KAC3B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASpC,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,cAAc,YAChB,mBAAmB,CAAC,mBAAmB,CAAC,SAAS,CAAC,aAChD,iBAAiB,WACnB,MAAM,QACT,aAAa,CAAC,MAAM,CAAC,WAClB,YAAY,CAAC,cAAc,KACnC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,sBAAsB,CA+BnD,CAAC;AAEJ,sFAAsF;AACtF,eAAO,MAAM,cAAc,+MAsBzB,CAAC"}
@@ -1,16 +1,19 @@
1
1
  import { Array as Arr, Config, Effect, Fiber, Option, Stream } from "effect";
2
2
  import { ChildProcess } from "effect/unstable/process";
3
- import { ExecutorOperationError } from "./index.js";
4
- /** Every adapter command is bounded: a hung clone or SSH hop must stay cancellable. */
3
+ import { ExecutorOperationError } from "./executor.js";
4
+ /** Bounds every adapter command so a hung clone or SSH hop stays cancellable. */
5
5
  const COMMAND_TIMEOUT = "10 minutes";
6
6
  /**
7
- * The named variables are the only ones a child may inherit; everything else
8
- * in the orchestrator environment — the App private key above all — stays out.
7
+ * Returns only the named process variables, so the App private key and every
8
+ * other orchestrator secret stay out of the child.
9
9
  */
10
10
  export const allowlistedEnvironment = (names) => Effect.forEach(names, (name) => Effect.map(Config.option(Config.string(name)), (value) => Option.map(value, (found) => [name, found]))).pipe(Effect.map((entries) => Object.fromEntries(Arr.getSomes(entries))),
11
- // An unreadable process environment at layer build is startup breakage.
11
+ // An unreadable process environment at layer build is a defect, not a failure to handle.
12
12
  Effect.orDie);
13
- /** One bounded child process, output collected whole; the exit code is the caller's. */
13
+ /**
14
+ * Runs one child process under the timeout and returns its whole output; the
15
+ * caller decides what the exit code means.
16
+ */
14
17
  export const collectCommand = (spawner, operation, command, args, options) => Effect.scoped(Effect.gen(function* () {
15
18
  const handle = yield* spawner.spawn(ChildProcess.make(command, args, options));
16
19
  const stdoutFiber = yield* handle.stdout.pipe(Stream.decodeText(), Stream.mkString, Effect.forkChild);
@@ -26,7 +29,7 @@ export const collectCommand = (spawner, operation, command, args, options) => Ef
26
29
  message: `${command} could not be executed`,
27
30
  cause,
28
31
  })));
29
- /** Turns a collected result into stdout, logging and failing on a non-zero exit. */
32
+ /** Returns the collected stdout, or logs and fails when the exit code is non-zero. */
30
33
  export const requireSuccess = Effect.fn("Executor.requireSuccess")(function* (operation, host, command, args, result) {
31
34
  if (result.exitCode !== 0) {
32
35
  yield* Effect.logWarning("Executor command exited non-zero", {
@@ -1 +1 @@
1
- {"version":3,"file":"child-command.js","sourceRoot":"","sources":["../src/child-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC7E,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,OAAO,wBAAwB;IAC3C,KAAK;CACN,CAAC,CACL,CACF,CAAC;AAEJ,sFAAsF;AACtF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC,yBAAyB,CAAC,CAAC,QAAQ,CAAC,EAC1E,SAA4B,EAC5B,IAAY,EACZ,OAAe,EACf,IAA2B,EAC3B,MAAqB;IAErB,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC1B,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,kCAAkC,EAAE;YAC3D,SAAS;YACT,IAAI;YACJ,OAAO;YACP,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;YACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;SAClC,CAAC,CAAC;QACH,OAAO,KAAK,CAAC,CAAC,IAAI,sBAAsB,CAAC;YACvC,SAAS;YACT,OAAO,EAAE,GAAG,OAAO,qBAAqB,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;YACjE,KAAK,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,kCAAkC,CAAC;SACvF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC;AACvB,CAAC,CAAC,CAAC"}
@@ -1,8 +1,12 @@
1
+ import type * as AttemptChannel from "@usine/core/attempt/channel";
1
2
  import { Effect } from "effect";
2
3
  import { ChildProcessSpawner } from "effect/unstable/process";
3
- import type { RunHostCommand } from "../index.ts";
4
- import { type RunHostSession } from "../run-host-session.ts";
4
+ import type { AttemptWorkspace, RunHostCommand } from "../executor.ts";
5
5
  import type { ExeDevCommands } from "./commands.ts";
6
- import type { PreparedStates } from "./model.ts";
7
- export declare const attemptChannelFor: (commands: ExeDevCommands, preparedStates: PreparedStates, runHost: RunHostCommand, interruptGrace: Parameters<typeof Effect.timeoutOption>[1]) => Effect.Effect<RunHostSession, never, ChildProcessSpawner.ChildProcessSpawner>;
6
+ import type { VmState } from "./model.ts";
7
+ export declare const attemptChannelFor: (commands: ExeDevCommands, runHost: RunHostCommand, interruptGrace: import("effect/Duration").Input) => Effect.Effect<{
8
+ cancel: (attemptId: import("@usine/core/attempt").AttemptId) => Effect.Effect<void, import("../executor.ts").ExecutorError>;
9
+ intervene: (attemptId: import("@usine/core/attempt").AttemptId, intervention: AttemptChannel.Intervention) => Effect.Effect<void, import("@usine/core/attempt/failure").AttemptFailure>;
10
+ launch: (prepared: AttemptWorkspace, vm: VmState, io: AttemptChannel.Sink) => Effect.Effect<import("@usine/core/step/result").StepResult, import("@usine/core/attempt/failure").AgentFailure | import("@usine/core/attempt/failure").ChildSessionBudgetFailure | import("@usine/core/attempt/failure").DefectFailure | import("@usine/core/attempt/failure").InfraFailure | import("@usine/core/attempt/failure").RunawayFailure, never>;
11
+ }, never, ChildProcessSpawner.ChildProcessSpawner>;
8
12
  //# sourceMappingURL=channel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../src/exe-dev/channel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAgB,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAwC,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,eAAO,MAAM,iBAAiB,EAAE,CAC9B,QAAQ,EAAE,cAAc,EACxB,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,cAAc,EACvB,cAAc,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KACvD,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,KAAK,EAAE,mBAAmB,CAAC,mBAAmB,CAwD/E,CAAC"}
1
+ {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../src/exe-dev/channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,cAAc,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAgB,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,eAAO,MAAM,iBAAiB;;;uBAkDP,gBAAgB,MAAM,OAAO,MAAM,cAAc,CAAC,IAAI;kDAG3E,CAAC"}
@@ -1,33 +1,25 @@
1
- import { AttemptFailure } from "@usine/core";
2
- import { Effect, Ref, Stream } from "effect";
1
+ import { Effect, Stream } from "effect";
3
2
  import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
4
3
  import { runHostSessionFor } from "../run-host-session.js";
5
4
  import { runHostShellCommand } from "./shell.js";
6
- export const attemptChannelFor = Effect.fn("ExeDevExecutor.attemptChannelFor")(function* (commands, preparedStates, runHost, interruptGrace) {
5
+ export const attemptChannelFor = Effect.fn("ExeDevExecutor.attemptChannelFor")(function* (commands, runHost, interruptGrace) {
7
6
  const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
8
- const spawn = Effect.fn("ExeDevExecutor.spawnRunHost")(function* (prepared, input) {
7
+ const spawn = Effect.fn("ExeDevExecutor.spawnRunHost")(function* (prepared, vm, input) {
9
8
  const attemptId = prepared.spec.attemptId;
10
- const state = (yield* Ref.get(preparedStates)).get(attemptId);
11
- if (state === undefined) {
12
- return yield* new AttemptFailure.InfraFailure({
13
- message: `Attempt ${attemptId} has no prepared exe.dev workspace`,
14
- cause: new Error("prepared Attempt state missing"),
15
- });
16
- }
17
9
  yield* Effect.annotateCurrentSpan({
18
10
  attemptId,
19
11
  worker: prepared.worker,
20
- host: state.vm.sshDest,
12
+ host: vm.sshDest,
21
13
  });
22
14
  yield* Effect.logInfo("Launching the run host over SSH", {
23
15
  attemptId,
24
16
  worker: prepared.worker,
25
- host: state.vm.sshDest,
17
+ host: vm.sshDest,
26
18
  worktree: prepared.worktree,
27
19
  });
28
20
  const handle = yield* spawner.spawn(ChildProcess.make(commands.ssh.command, [
29
21
  ...commands.ssh.args,
30
- state.vm.sshDest,
22
+ vm.sshDest,
31
23
  "--",
32
24
  runHostShellCommand(prepared.worktree, runHost.command, runHost.args),
33
25
  ], {
@@ -35,11 +27,16 @@ export const attemptChannelFor = Effect.fn("ExeDevExecutor.attemptChannelFor")(f
35
27
  extendEnv: false,
36
28
  stdin: { stream: Stream.fromQueue(input), endOnDone: true },
37
29
  }));
38
- // Identity scrub is safe here because this process never holds a secret
39
- // the run host could echo: credentials are edge-injected on the VM by the
40
- // exe.dev integration. Revisit if any credential ever crosses this seam.
41
- return { handle, host: state.vm.sshDest, scrub: (text) => text };
30
+ // Nothing to scrub: this process never has a secret the run host could echo,
31
+ // because the exe.dev integration injects credentials on the VM. If a
32
+ // credential ever passes through this process, scrub it here.
33
+ return { handle, host: vm.sshDest, scrub: (text) => text };
42
34
  });
43
- return yield* runHostSessionFor({ interruptGrace, spawn });
35
+ const session = yield* runHostSessionFor({ interruptGrace });
36
+ return {
37
+ cancel: session.cancel,
38
+ intervene: session.intervene,
39
+ launch: (prepared, vm, io) => session.launch(prepared, io, (input) => spawn(prepared, vm, input)),
40
+ };
44
41
  });
45
42
  //# sourceMappingURL=channel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"channel.js","sourceRoot":"","sources":["../../src/exe-dev/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aA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AAC,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE;SAC5D,CACF,CACF,CAAC;QACF,6EAA6E;QAC7E,sEAAsE;QACtE,8DAA8D;QAC9D,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,EAAE,CAAC;IAC7E,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,iBAAiB,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC;IAC7D,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,MAAM,EAAE,CAAC,QAA0B,EAAE,EAAW,EAAE,EAAuB,EAAE,EAAE,CAC3E,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;KACtE,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { Effect } from "effect";
2
2
  import { ChildProcessSpawner } from "effect/unstable/process";
3
3
  import { type CommandResult } from "../child-command.ts";
4
- import type { ExecutorOperation, ExecutorOperationError, RunHostCommand } from "../index.ts";
4
+ import type { ExecutorOperation, ExecutorOperationError, RunHostCommand } from "../executor.ts";
5
5
  import type { SshDestination } from "./model.ts";
6
6
  export interface ExeDevCommands {
7
7
  readonly environment: Record<string, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/exe-dev/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,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,EACvB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,KACxB,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,sBAAsB,CAAC,CAAC;IAC1D,QAAQ,CAAC,MAAM,EAAE,CACf,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,KACxB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;CACpD;AAkBD,eAAO,MAAM,WAAW;;uBAuCT,iBAAiB,QACtB,aAAa,CAAC,MAAM,CAAC,KAC1B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC;2BAInC,iBAAiB,QACtB,aAAa,CAAC,MAAM,CAAC,KAC1B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC;wBAgBnC,iBAAiB,WACnB,cAAc,WACd,MAAM,QACT,aAAa,CAAC,MAAM,CAAC,KAC1B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC;2BAjBnC,iBAAiB,WACnB,cAAc,WACd,MAAM,QACT,aAAa,CAAC,MAAM,CAAC,KAC1B,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,sBAAsB,CAAC;;kDA6BvD,CAAC"}
@@ -3,9 +3,8 @@ import { ChildProcessSpawner } from "effect/unstable/process";
3
3
  import { allowlistedEnvironment, collectCommand, requireSuccess, } from "../child-command.js";
4
4
  import { shellCommand } from "./shell.js";
5
5
  /**
6
- * The local SSH process receives only what SSH itself needs. In particular,
7
- * GitHub and factory credentials from the orchestrator environment never
8
- * cross into either the SSH client or the VM.
6
+ * The local SSH client inherits only what SSH itself needs; GitHub and factory
7
+ * credentials from the orchestrator environment never reach it or the VM.
9
8
  */
10
9
  const SSH_ENVIRONMENT_ALLOWLIST = [
11
10
  "HOME",
@@ -23,8 +22,8 @@ export const commandsFor = Effect.fn("ExeDevExecutor.commandsFor")(function* (co
23
22
  const environment = yield* allowlistedEnvironment(SSH_ENVIRONMENT_ALLOWLIST);
24
23
  const ssh = configuredSsh ?? {
25
24
  command: "ssh",
26
- // The keepalive pair turns a dead TCP link into a non-zero SSH exit
27
- // instead of a silent forever-park: a lost VM must fail the operation.
25
+ // The keepalive pair turns a dead TCP link into a non-zero SSH exit instead
26
+ // of a silent park, so a lost VM fails the operation.
28
27
  args: ["-o", "BatchMode=yes", "-o", "ServerAliveInterval=30", "-o", "ServerAliveCountMax=4"],
29
28
  };
30
29
  const executeRaw = Effect.fn("ExeDevExecutor.executeRaw")(function* (operation, host, command, args) {
@@ -38,9 +37,9 @@ export const commandsFor = Effect.fn("ExeDevExecutor.commandsFor")(function* (co
38
37
  const result = yield* executeRaw(operation, host, command, args);
39
38
  return yield* requireSuccess(operation, host, command, args, result);
40
39
  });
41
- // Lobby arguments ride unquoted through OpenSSH's argv join. Every value
42
- // passed here must be a brand-validated token (Worker.Name,
43
- // IntegrationName, CredentialGrantMinutes); never pass free-form text.
40
+ // Lobby arguments pass unquoted through OpenSSH's argv join, so every value
41
+ // must be a brand-validated token (WorkerName, IntegrationName,
42
+ // CredentialGrantMinutes), never free-form text.
44
43
  const lobby = (operation, args) => executeChecked(operation, "exe.dev", ssh.command, [...ssh.args, "exe.dev", ...args]);
45
44
  const lobbyJson = (operation, args) => lobby(operation, [...args, "--json"]);
46
45
  const remoteRaw = (operation, sshDest, command, args) => executeRaw(operation, sshDest, ssh.command, [
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/exe-dev/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,cAAc,GAEf,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,YAA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E,CACjD,cAAc,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE;QAC9C,GAAG,GAAG,CAAC,IAAI;QACX,OAAO;QACP,IAAI;QACJ,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC;KAC5B,CAAC,CAAC;IAEL,OAAO;QACL,WAAW;QACX,KAAK;QACL,SAAS;QACT,MAAM;QACN,SAAS;QACT,GAAG;KACqB,CAAC;AAC7B,CAAC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Layer } from "effect";
2
+ import { ChildProcessSpawner } from "effect/unstable/process";
3
+ import { Executor } from "../executor.ts";
4
+ import type { ExeDevExecutorOptions } from "./model.ts";
5
+ /** Runs Attempts on exe.dev Workers over SSH. Requires Node; worker contracts are platform-free. */
6
+ export declare const layer: (options: ExeDevExecutorOptions) => Layer.Layer<Executor, never, ChildProcessSpawner.ChildProcessSpawner>;
7
+ export { CredentialGrantMinutes, type ExeDevExecutorOptions, GitHubIntegration, IntegrationName, } from "./model.ts";
8
+ //# sourceMappingURL=exe-dev.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exe-dev.d.ts","sourceRoot":"","sources":["../../src/exe-dev/exe-dev.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,EAAiB,MAAM,QAAQ,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAIL,QAAQ,EAGT,MAAM,gBAAgB,CAAC;AAQxB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AA6MxD,oGAAoG;AACpG,eAAO,MAAM,KAAK,YACP,qBAAqB,KAC7B,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,mBAAmB,CAAC,mBAAmB,CAClB,CAAC;AAEtD,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,154 @@
1
+ import { RepositoryName } from "@usine/core/repository";
2
+ import { Effect, Exit, Layer, Schema, Scope } from "effect";
3
+ import { ChildProcessSpawner } from "effect/unstable/process";
4
+ import { CheckoutRequest, CredentialUnavailableError, Executor, ExecutorError, ExecutorOperationError, } from "../executor.js";
5
+ import { verifyHarnesses } from "../harness-preflight.js";
6
+ import { prepareAttempt } from "../prepared-attempt.js";
7
+ import { keyedLockFor } from "../keyed-lock.js";
8
+ import { provisionWorktree, safeSegment } from "../provision.js";
9
+ import { attemptChannelFor } from "./channel.js";
10
+ import { commandsFor } from "./commands.js";
11
+ import { credentialGrantsFor } from "./grants.js";
12
+ import { preflightFor } from "./preflight.js";
13
+ import { RUN_HOST_KILL_SCRIPT, runHostPidFile } from "./shell.js";
14
+ import { abandonedWorktreeSweepFor } from "./sweep.js";
15
+ const isExecutorError = Schema.is(ExecutorError);
16
+ const executorError = (message, cause) => new ExecutorOperationError({ operation: "prepare", message, cause });
17
+ const makeExeDevExecutor = (options) => Effect.gen(function* () {
18
+ const commands = yield* commandsFor(options.ssh);
19
+ const fetches = yield* keyedLockFor();
20
+ const integrations = new Map(options.githubIntegrations.map(({ name, repository }) => [repository, name]));
21
+ const integrationNames = new Set(options.githubIntegrations.map(({ name }) => name));
22
+ const runHost = options.runHost ?? { command: "usine-run-host", args: [] };
23
+ // The grace covers an SSH round trip plus the agent flushing its final
24
+ // events, not just a local pipe.
25
+ const interruptGrace = options.interruptGrace ?? "10 seconds";
26
+ if (integrations.size !== options.githubIntegrations.length) {
27
+ return yield* Effect.die(new Error("ExeDevExecutorOptions.githubIntegrations contains duplicate repositories"));
28
+ }
29
+ if (integrationNames.size !== options.githubIntegrations.length) {
30
+ return yield* Effect.die(new Error("ExeDevExecutorOptions.githubIntegrations contains duplicate integration names"));
31
+ }
32
+ const machines = yield* preflightFor(options, commands, runHost);
33
+ const credentialGrants = yield* credentialGrantsFor(options, commands);
34
+ const sweepAbandonedWorktrees = yield* abandonedWorktreeSweepFor(commands);
35
+ const attemptChannel = yield* attemptChannelFor(commands, runHost, interruptGrace);
36
+ const prepare = Effect.fn("ExeDevExecutor.prepare")(function* (request) {
37
+ yield* Effect.annotateCurrentSpan({
38
+ attemptId: request.attemptId,
39
+ worker: request.worker,
40
+ repository: request.repository,
41
+ });
42
+ const integration = integrations.get(request.repository);
43
+ if (integration === undefined) {
44
+ return yield* new CredentialUnavailableError({
45
+ repository: request.repository,
46
+ message: `No exe.dev GitHub integration is configured for ${request.repository}`,
47
+ cause: new Error("repository integration missing"),
48
+ });
49
+ }
50
+ const vm = yield* machines.vmFor(request.worker);
51
+ yield* verifyHarnesses(request.worker, [request.agent.brain], runHost, (command, args) => commands.remote("preflight", vm.sshDest, command, args));
52
+ const root = `${vm.home}/.usine/workers/${safeSegment(request.worker)}`;
53
+ const cache = `${root}/repos/${safeSegment(request.repository)}.git`;
54
+ const worktree = `${root}/attempts/${safeSegment(request.attemptId)}`;
55
+ const staging = `${cache}.cloning`;
56
+ const remoteUrl = `https://github.int.exe.xyz/${request.repository}.git`;
57
+ yield* Effect.annotateCurrentSpan({ host: vm.sshDest });
58
+ yield* sweepAbandonedWorktrees(request.attemptId, request.worker, vm, root);
59
+ const remove = (operation, target) => Effect.asVoid(commands.remote(operation, vm.sshDest, "rm", ["-rf", target]));
60
+ const ops = {
61
+ ensureRoots: Effect.asVoid(commands.remote("prepare", vm.sshDest, "mkdir", [
62
+ "-p",
63
+ `${root}/repos`,
64
+ `${root}/attempts`,
65
+ ])),
66
+ removePath: remove,
67
+ cacheExists: Effect.gen(function* () {
68
+ const inspected = yield* commands.remoteRaw("prepare", vm.sshDest, "test", ["-d", cache]);
69
+ if (inspected.exitCode === 0)
70
+ return true;
71
+ if (inspected.exitCode === 1)
72
+ return false;
73
+ return yield* executorError(`Could not inspect the cached clone on Worker ${request.worker}`, new Error(inspected.stderr.trim()));
74
+ }),
75
+ promoteStaging: Effect.asVoid(commands.remote("prepare", vm.sshDest, "mv", [staging, cache])),
76
+ git: (operation, args) => commands.remote(operation, vm.sshDest, "git", args),
77
+ };
78
+ const releaseWorkspace = Effect.fn("ExeDevExecutor.releaseWorkspace")(function* (resource, exit) {
79
+ yield* Effect.annotateCurrentSpan({
80
+ attemptId: request.attemptId,
81
+ worker: request.worker,
82
+ host: vm.sshDest,
83
+ });
84
+ // The remote run host and its checkout form one cleanup dependency:
85
+ // an SSH exit does not prove the process on the VM has stopped. Never
86
+ // close the checkout scope unless this independent stop request succeeds.
87
+ const confirmed = yield* commands.remote("cleanup", vm.sshDest, "sh", [
88
+ "-c",
89
+ RUN_HOST_KILL_SCRIPT,
90
+ "sh",
91
+ runHostPidFile(resource.workspace.worktree),
92
+ ]);
93
+ yield* Effect.logInfo("Confirmed the remote run host before workspace removal", {
94
+ attemptId: request.attemptId,
95
+ worker: request.worker,
96
+ host: vm.sshDest,
97
+ runHost: confirmed.trim(),
98
+ });
99
+ yield* Scope.close(resource.scope, exit);
100
+ }, (effect) => effect.pipe(Effect.tapError((error) => Effect.logError("Remote termination failed; Attempt checkout retained for recovery", {
101
+ attemptId: request.attemptId,
102
+ worker: request.worker,
103
+ host: vm.sshDest,
104
+ worktree,
105
+ message: error.message,
106
+ })), Effect.ignore));
107
+ const { workspace: prepared } = yield* fetches
108
+ .withLock(request.repository)(Effect.gen(function* () {
109
+ // Credentials belong to the Attempt scope independently of the checkout:
110
+ // refusing destructive cleanup must still release this grant exactly once.
111
+ yield* credentialGrants.acquire(request.attemptId, request.worker, request.repository, integration);
112
+ return yield* Effect.acquireRelease(Effect.uninterruptibleMask((restore) => Effect.gen(function* () {
113
+ const scope = yield* Scope.make();
114
+ // Before preparation succeeds no run host can exist. Roll back the
115
+ // partial checkout unconditionally; only a completed workspace is
116
+ // transferred to the guarded remote-process release above.
117
+ const workspace = yield* restore(provisionWorktree({
118
+ request,
119
+ url: remoteUrl,
120
+ host: vm.sshDest,
121
+ layout: { cache, staging, worktree },
122
+ ops,
123
+ })).pipe(Scope.provide(scope), Effect.onError((cause) => Scope.close(scope, Exit.failCause(cause))));
124
+ return { workspace, scope };
125
+ })), releaseWorkspace, { interruptible: true });
126
+ }))
127
+ .pipe(Effect.mapError((cause) => isExecutorError(cause)
128
+ ? cause
129
+ : executorError("exe.dev workspace preparation failed", cause)));
130
+ yield* Effect.logInfo("exe.dev Attempt workspace ready", {
131
+ attemptId: request.attemptId,
132
+ worker: request.worker,
133
+ host: vm.sshDest,
134
+ repository: request.repository,
135
+ baseCommit: prepared.spec.baseCommit,
136
+ worktree,
137
+ });
138
+ return {
139
+ workspace: prepared,
140
+ launch: (io) => attemptChannel.launch(prepared, vm, io),
141
+ };
142
+ }, prepareAttempt);
143
+ return Executor.of({
144
+ kind: "exe.dev",
145
+ cancel: attemptChannel.cancel,
146
+ intervene: attemptChannel.intervene,
147
+ preflight: machines.preflight,
148
+ prepare,
149
+ });
150
+ });
151
+ /** Runs Attempts on exe.dev Workers over SSH. Requires Node; worker contracts are platform-free. */
152
+ export const layer = (options) => Layer.effect(Executor, makeExeDevExecutor(options));
153
+ export { CredentialGrantMinutes, GitHubIntegration, IntegrationName, } from "./model.js";
154
+ //# sourceMappingURL=exe-dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exe-dev.js","sourceRoot":"","sources":["../../src/exe-dev/exe-dev.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAEL,eAAe,EACf,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,O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AAEtD,OAAO,EACL,sBAAsB,EAEtB,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC"}
@@ -1,9 +1,8 @@
1
- import { Effect } from "effect";
2
- import { CredentialUnavailableError } from "../index.ts";
1
+ import { Effect, Scope } from "effect";
2
+ import { CredentialUnavailableError } from "../executor.ts";
3
3
  import type { ExeDevCommands } from "./commands.ts";
4
4
  import { type ExeDevExecutorOptions } from "./model.ts";
5
5
  export declare const credentialGrantsFor: (options: ExeDevExecutorOptions, commands: ExeDevCommands) => Effect.Effect<{
6
- acquire: (worker: string & import("effect/Brand").Brand<"WorkerName">, repository: string & import("effect/Brand").Brand<"RepoName">, integration: string & import("effect/Brand").Brand<"ExeDevIntegrationName">) => Effect.Effect<void, CredentialUnavailableError, never>;
7
- release: (worker: string & import("effect/Brand").Brand<"WorkerName">, integration: string & import("effect/Brand").Brand<"ExeDevIntegrationName">) => Effect.Effect<void, import("../index.ts").ExecutorOperationError, never>;
6
+ acquire: (attemptId: string & import("effect/Brand").Brand<"AttemptId">, worker: string & import("effect/Brand").Brand<"WorkerName">, repository: string & import("effect/Brand").Brand<"RepositoryName">, integration: string & import("effect/Brand").Brand<"ExeDevIntegrationName">) => Effect.Effect<void, CredentialUnavailableError, Scope.Scope>;
8
7
  }, never, never>;
9
8
  //# sourceMappingURL=grants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../../src/exe-dev/grants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAO,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,YAAY,CAAC;AAKpB,eAAO,MAAM,mBAAmB;;;gBA6G9B,CAAC"}
1
+ {"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../../src/exe-dev/grants.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAO,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,YAAY,CAAC;AAKpB,eAAO,MAAM,mBAAmB;;gBA2I9B,CAAC"}