@usine/executor 0.6.1-next.483.g71ecb9e.1.1 → 0.6.1-next.485.g3247872.1.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 (113) hide show
  1. package/README.md +2 -2
  2. package/dist/child-command.d.ts +17 -1
  3. package/dist/child-command.d.ts.map +1 -1
  4. package/dist/child-command.js +22 -12
  5. package/dist/child-command.js.map +1 -1
  6. package/dist/exe-dev/commands.d.ts +3 -3
  7. package/dist/exe-dev/preflight.d.ts +2 -2
  8. package/dist/exe-dev/preflight.d.ts.map +1 -1
  9. package/dist/exe-dev/preflight.js.map +1 -1
  10. package/dist/remote/commands.d.ts +20 -9
  11. package/dist/remote/commands.d.ts.map +1 -1
  12. package/dist/remote/commands.js +64 -23
  13. package/dist/remote/commands.js.map +1 -1
  14. package/dist/remote/container.d.ts +9 -9
  15. package/dist/remote/container.d.ts.map +1 -1
  16. package/dist/remote/container.js +9 -7
  17. package/dist/remote/container.js.map +1 -1
  18. package/dist/remote/liveness.d.ts +4 -4
  19. package/dist/remote/liveness.d.ts.map +1 -1
  20. package/dist/remote/liveness.js +7 -11
  21. package/dist/remote/liveness.js.map +1 -1
  22. package/dist/remote/machine.d.ts +4 -4
  23. package/dist/remote/machine.d.ts.map +1 -1
  24. package/dist/remote/memory.d.ts +2 -2
  25. package/dist/remote/memory.d.ts.map +1 -1
  26. package/dist/remote/memory.js.map +1 -1
  27. package/dist/remote/remote.js.map +1 -1
  28. package/dist/remote/sweep.d.ts +3 -3
  29. package/dist/remote/sweep.d.ts.map +1 -1
  30. package/dist/remote/sweep.js.map +1 -1
  31. package/dist/ssh/api-keys.d.ts +1 -1
  32. package/dist/ssh/container.d.ts +1 -1
  33. package/dist/ssh/container.d.ts.map +1 -1
  34. package/dist/ssh/container.js +5 -8
  35. package/dist/ssh/container.js.map +1 -1
  36. package/dist/ssh/credentials.d.ts +1 -1
  37. package/dist/ssh/gateway/attachments.d.ts +3 -3
  38. package/dist/ssh/gateway/attachments.d.ts.map +1 -1
  39. package/dist/ssh/gateway/attachments.js.map +1 -1
  40. package/dist/ssh/gateway/preflight.d.ts +4 -4
  41. package/dist/ssh/gateway/preflight.d.ts.map +1 -1
  42. package/dist/ssh/gateway/preflight.js +1 -14
  43. package/dist/ssh/gateway/preflight.js.map +1 -1
  44. package/dist/ssh/model.d.ts +6 -0
  45. package/dist/ssh/model.d.ts.map +1 -1
  46. package/dist/ssh/model.js.map +1 -1
  47. package/dist/ssh/preflight.d.ts +2 -2
  48. package/dist/ssh/preflight.d.ts.map +1 -1
  49. package/dist/ssh/preflight.js.map +1 -1
  50. package/dist/ssh/provisioner/boat.d.ts +22 -4
  51. package/dist/ssh/provisioner/boat.d.ts.map +1 -1
  52. package/dist/ssh/provisioner/boat.js +3 -3
  53. package/dist/ssh/provisioner/boat.js.map +1 -1
  54. package/dist/ssh/provisioner/boxd/api-pb.d.ts +46 -20
  55. package/dist/ssh/provisioner/boxd/api-pb.d.ts.map +1 -1
  56. package/dist/ssh/provisioner/boxd/api-pb.js +6 -1
  57. package/dist/ssh/provisioner/boxd/api-pb.js.map +1 -1
  58. package/dist/ssh/provisioner/boxd/client.d.ts +2 -8
  59. package/dist/ssh/provisioner/boxd/client.d.ts.map +1 -1
  60. package/dist/ssh/provisioner/boxd/client.js +1 -7
  61. package/dist/ssh/provisioner/boxd/client.js.map +1 -1
  62. package/dist/ssh/provisioner/boxd/exec.d.ts +73 -0
  63. package/dist/ssh/provisioner/boxd/exec.d.ts.map +1 -0
  64. package/dist/ssh/provisioner/boxd/exec.js +132 -0
  65. package/dist/ssh/provisioner/boxd/exec.js.map +1 -0
  66. package/dist/ssh/provisioner/boxd/grpc-client.d.ts +1 -3
  67. package/dist/ssh/provisioner/boxd/grpc-client.d.ts.map +1 -1
  68. package/dist/ssh/provisioner/boxd/grpc-client.js +7 -19
  69. package/dist/ssh/provisioner/boxd/grpc-client.js.map +1 -1
  70. package/dist/ssh/provisioner/boxd/status.d.ts +7 -0
  71. package/dist/ssh/provisioner/boxd/status.d.ts.map +1 -0
  72. package/dist/ssh/provisioner/boxd/status.js +19 -0
  73. package/dist/ssh/provisioner/boxd/status.js.map +1 -0
  74. package/dist/ssh/provisioner/boxd.d.ts +40 -10
  75. package/dist/ssh/provisioner/boxd.d.ts.map +1 -1
  76. package/dist/ssh/provisioner/boxd.js +29 -56
  77. package/dist/ssh/provisioner/boxd.js.map +1 -1
  78. package/dist/ssh/provisioner/checks.d.ts +2 -2
  79. package/dist/ssh/provisioner/checks.d.ts.map +1 -1
  80. package/dist/ssh/provisioner/checks.js +20 -23
  81. package/dist/ssh/provisioner/checks.js.map +1 -1
  82. package/dist/ssh/provisioner/connection.d.ts +18 -4
  83. package/dist/ssh/provisioner/connection.d.ts.map +1 -1
  84. package/dist/ssh/provisioner/connection.js +30 -7
  85. package/dist/ssh/provisioner/connection.js.map +1 -1
  86. package/dist/ssh/provisioner/drivers.d.ts +4 -3
  87. package/dist/ssh/provisioner/drivers.d.ts.map +1 -1
  88. package/dist/ssh/provisioner/drivers.js +5 -5
  89. package/dist/ssh/provisioner/drivers.js.map +1 -1
  90. package/dist/ssh/provisioner/hetzner.d.ts +5 -4
  91. package/dist/ssh/provisioner/hetzner.d.ts.map +1 -1
  92. package/dist/ssh/provisioner/hetzner.js +3 -3
  93. package/dist/ssh/provisioner/hetzner.js.map +1 -1
  94. package/dist/ssh/provisioner/machines.d.ts +1 -1
  95. package/dist/ssh/provisioner/machines.d.ts.map +1 -1
  96. package/dist/ssh/provisioner/machines.js +17 -15
  97. package/dist/ssh/provisioner/machines.js.map +1 -1
  98. package/dist/ssh/provisioner/model.d.ts +98 -14
  99. package/dist/ssh/provisioner/model.d.ts.map +1 -1
  100. package/dist/ssh/provisioner/model.js +2 -1
  101. package/dist/ssh/provisioner/model.js.map +1 -1
  102. package/dist/ssh/provisioner/reset.d.ts +3 -3
  103. package/dist/ssh/provisioner/reset.d.ts.map +1 -1
  104. package/dist/ssh/provisioner/reset.js.map +1 -1
  105. package/dist/ssh/runtime.d.ts +2 -2
  106. package/dist/ssh/runtime.d.ts.map +1 -1
  107. package/dist/ssh/runtime.js.map +1 -1
  108. package/dist/ssh/ssh.js.map +1 -1
  109. package/dist/ssh/workers.d.ts +2 -2
  110. package/dist/ssh/workers.d.ts.map +1 -1
  111. package/dist/ssh/workers.js +10 -2
  112. package/dist/ssh/workers.js.map +1 -1
  113. package/package.json +6 -6
package/README.md CHANGED
@@ -378,6 +378,6 @@ Preparation creates `.usine/outputs/` and excludes `.usine/` from Git commits an
378
378
 
379
379
  `PreparedAttempt.launch` and `Executor.outcome` return `StepCompletion`, whose `result` contains output refs and whose `outputs` contains the full documents. Durable storage records both before checkout cleanup. Collection allows at most ten files of at most 8 MiB each, with the same size limit on each compact JSON content body. The orchestrator caps command output before decoding and independently checks the count and content sizes.
380
380
 
381
- boxd preflight reads `<identity_file>.pub`, computes the OpenSSH SHA-256 fingerprint, and checks the account's linked fingerprints returned by `Whoami`. The verified log includes the fingerprint. Missing or unreadable public keys produce a `provider` capability error with the file path; an unlinked key also includes its fingerprint and the operator linking guide. The SSH proxy authenticates account-linked keys and ignores the machine's `authorized_keys`, so snapshots need no worker public key. API keys cannot manage account keys: an operator uses `infra/boxd/link-ssh-key.mjs` with a signed-in session token in `BOXD_TOKEN` to link the key before preflight and after key rotation.
381
+ boxd machines don't use SSH. Their endpoint is an `Exec` endpoint: the machine id and an `ExecTransport` that runs command lines on it through the `BoxdExec` service, in this process. `machineAt` gives such a machine an `ExecShell` instead of a `RemoteShell`, and `RemoteCommands`, liveness probes, containers, and the child host run its commands through the transport with no local program. Each boxd worker's driver builds one `BoxdExec` for its region, so every command of its machines shares one HTTP/2 connection, which holds the API key. `BoxdExec` raises the HTTP/2 connection and stream windows to 8 MiB, sends stdin in chunks of at most 64 KiB as the call writes them, pings a connection that receives nothing for 30 seconds, ends both output streams with every chunk received, and cancels the call when its scope closes. A call that ends without an exit code fails with `HostUnreachable`, so `RemoteCommands` fails with an `ExecutorOperationError` whose cause is `HostUnreachable`, and the readiness wait and liveness probe count the machine as not answering. `RemoteCommands` reports an SSH client's exit code 255 the same way, so no executor caller compares an exit code with 255, and a command on an exec shell that exits 255 itself returns that exit code. A boxd worker ignores `identity_file`, and its preflight warns when it is set; the executor pins no host key and writes no OpenSSH configuration for its machines. When a boxd machine stops answering, the executor asks boxd whether it still exists, and a deleted, stopped, failed, or destroyed machine ends its attempt as an infrastructure failure. If boxd's API fails, the machine counts as present and the attempt stays unresponsive.
382
382
 
383
- The SSH provisioner restores boxd machines from prepared snapshots, validates their captured size and region, applies the configured egress allowlist before connecting, disables idle timers, and pins the regional SSH proxy key. The transport finds the configured region's API endpoint with `ListRegions` on `boxd.sh` when it starts, and a region that boxd doesn't list fails preflight with the region ids it lists. Boat and boxd share the provisioner tailnet bootstrap. The gRPC transport uses a generated projection of the boxd 0.3.0 API behind a decoded client port; regenerate it with `pnpm boxd:generate` from this package. See [Add a boxd worker](https://docs.usine.dev/guides/add-a-boxd-worker/) for snapshot and live-test setup.
383
+ The SSH provisioner restores boxd machines from prepared snapshots, validates their captured size and region, applies the configured egress allowlist before connecting, and disables idle timers. The transport finds the configured region's API endpoint with `ListRegions` on `boxd.sh` when it starts, and a region that boxd doesn't list fails preflight with the region ids it lists. Boat and boxd share the provisioner tailnet bootstrap. The gRPC transport uses a generated projection of the boxd 0.3.0 API behind a decoded client port; regenerate it with `pnpm boxd:generate` from this package. See [Add a boxd worker](https://docs.usine.dev/guides/add-a-boxd-worker/) for snapshot and live-test setup.
@@ -1,4 +1,4 @@
1
- import { type Brand, Cause, Effect, Schema } from "effect";
1
+ import { type Brand, Cause, Effect, Schema, type Scope, Stream } from "effect";
2
2
  import { ChildProcess, type ChildProcessSpawner } from "effect/process";
3
3
  import { ExecutorOperationError, type ExecutorOperation } from "./executor.ts";
4
4
  export interface CommandResult {
@@ -13,12 +13,28 @@ export declare class CommandOutputLimitExceeded extends CommandOutputLimitExceed
13
13
  }
14
14
  /** Returns the variables in `names` that are set in the process environment. */
15
15
  export declare const allowlistedEnvironment: (names: ReadonlyArray<string>) => Effect.Effect<Record<string, string>>;
16
+ /** A started command's output and exit code. */
17
+ interface StartedCommand<E> {
18
+ readonly stdout: Stream.Stream<Uint8Array, E>;
19
+ readonly stderr: Stream.Stream<Uint8Array, E>;
20
+ readonly exitCode: Effect.Effect<number, E>;
21
+ }
22
+ /**
23
+ * Starts a command with `start`, reads its stdout and stderr to their end, then its exit code, with
24
+ * a 10-minute timeout, and returns them without checking the exit code. When `maxOutputBytes` is
25
+ * set, caps each output stream before decoding it. Fails with `ExecutorOperationError`, which
26
+ * names `command`, if the command can't run or times out; the cause is `HostUnreachable` if a host
27
+ * couldn't run it or lost it.
28
+ */
29
+ export declare const collectOutput: <E>(operation: ExecutorOperation, command: string, start: Effect.Effect<StartedCommand<E>, E, Scope.Scope>, maxOutputBytes?: number) => Effect.Effect<CommandResult, ExecutorOperationError>;
16
30
  /**
17
31
  * Runs `command` with a 10-minute timeout and returns its exit code and output without checking
18
32
  * the exit code. When `maxOutputBytes` is set, caps each output stream before decoding it.
19
33
  * Fails with `ExecutorOperationError` if the command can't run or times out.
20
34
  */
21
35
  export declare const collectCommand: (spawner: ChildProcessSpawner.ChildProcessSpawner["Service"], operation: ExecutorOperation, command: string, args: ReadonlyArray<string>, options: ChildProcess.CommandOptions, maxOutputBytes?: number) => Effect.Effect<CommandResult, ExecutorOperationError>;
36
+ /** Returns whether `error` reports that a remote host couldn't run a command or lost it. */
37
+ export declare const unreachableHost: (error: ExecutorOperationError) => boolean;
22
38
  /** Returns the collected stdout. If the exit code is non-zero, logs a warning and fails with `ExecutorOperationError`. */
23
39
  export declare const requireSuccess: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", host: string, command: string, args: readonly string[], result: CommandResult) => Effect.Effect<string, ExecutorOperationError, never>;
24
40
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"child-command.d.ts","sourceRoot":"","sources":["../src/child-command.ts"],"names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sB,KAAG,OACvB,CAAC;AAE1C,0HAA0H;AAC1H,eAAO,MAAM,cAAc,+MAsBzB,CAAC"}
@@ -1,4 +1,5 @@
1
- import { Array as Arr, Cause, Config, Effect, Option, Schema, Stream } from "effect";
1
+ import { HostUnreachable } from "@usine/agents/child-host";
2
+ import { Array as Arr, Cause, Config, Effect, Option, Schema, Stream, } from "effect";
2
3
  import { ChildProcess } from "effect/process";
3
4
  import { ExecutorOperationError } from "./executor.js";
4
5
  const COMMAND_TIMEOUT = "10 minutes";
@@ -18,17 +19,16 @@ const readText = (stream, maxBytes) => Effect.suspend(() => {
18
19
  /** Returns the variables in `names` that are set in the process environment. */
19
20
  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))), Effect.orDie);
20
21
  /**
21
- * Runs `command` with a 10-minute timeout and returns its exit code and output without checking
22
- * the exit code. When `maxOutputBytes` is set, caps each output stream before decoding it.
23
- * Fails with `ExecutorOperationError` if the command can't run or times out.
22
+ * Starts a command with `start`, reads its stdout and stderr to their end, then its exit code, with
23
+ * a 10-minute timeout, and returns them without checking the exit code. When `maxOutputBytes` is
24
+ * set, caps each output stream before decoding it. Fails with `ExecutorOperationError`, which
25
+ * names `command`, if the command can't run or times out; the cause is `HostUnreachable` if a host
26
+ * couldn't run it or lost it.
24
27
  */
25
- export const collectCommand = (spawner, operation, command, args, options, maxOutputBytes) => Effect.scoped(Effect.gen(function* () {
26
- const handle = yield* spawner.spawn(ChildProcess.make(command, args, options));
27
- const [exitCode, stdout, stderr] = yield* Effect.all([
28
- handle.exitCode,
29
- readText(handle.stdout, maxOutputBytes),
30
- readText(handle.stderr, maxOutputBytes),
31
- ], { concurrency: "unbounded" });
28
+ export const collectOutput = (operation, command, start, maxOutputBytes) => Effect.scoped(Effect.gen(function* () {
29
+ const started = yield* start;
30
+ const [stdout, stderr] = yield* Effect.all([readText(started.stdout, maxOutputBytes), readText(started.stderr, maxOutputBytes)], { concurrency: "unbounded" });
31
+ const exitCode = yield* started.exitCode;
32
32
  return { exitCode: Number(exitCode), stderr, stdout };
33
33
  })).pipe(Effect.timeout(COMMAND_TIMEOUT), Effect.mapError((cause) => ExecutorOperationError.make({
34
34
  operation,
@@ -36,9 +36,19 @@ export const collectCommand = (spawner, operation, command, args, options, maxOu
36
36
  ? `${command} didn't finish within ${COMMAND_TIMEOUT}`
37
37
  : Schema.is(CommandOutputLimitExceeded)(cause)
38
38
  ? `${command} output exceeds ${cause.maxBytes} bytes`
39
- : `Can't run ${command}`,
39
+ : Schema.is(HostUnreachable)(cause)
40
+ ? `Can't reach ${cause.destination} to run ${command}: ${cause.message}`
41
+ : `Can't run ${command}`,
40
42
  cause,
41
43
  })));
44
+ /**
45
+ * Runs `command` with a 10-minute timeout and returns its exit code and output without checking
46
+ * the exit code. When `maxOutputBytes` is set, caps each output stream before decoding it.
47
+ * Fails with `ExecutorOperationError` if the command can't run or times out.
48
+ */
49
+ export const collectCommand = (spawner, operation, command, args, options, maxOutputBytes) => collectOutput(operation, command, spawner.spawn(ChildProcess.make(command, args, options)), maxOutputBytes);
50
+ /** Returns whether `error` reports that a remote host couldn't run a command or lost it. */
51
+ export const unreachableHost = (error) => Schema.is(HostUnreachable)(error.cause);
42
52
  /** Returns the collected stdout. If the exit code is non-zero, logs a warning and fails with `ExecutorOperationError`. */
43
53
  export const requireSuccess = Effect.fn("Executor.requireSuccess")(function* (operation, host, command, args, result) {
44
54
  if (result.exitCode !== 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"child-command.js","sourceRoot":"","sources":["../src/child-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,GAAG,EAAc,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACjG,OAAO,EAAE,YAAY,EAA4B,MAAM,gBAAgB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CAAC,GAAG,CAAC;YACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;SAClC,CAAC,CAAC;QACH,OAAO,KAAK,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC;YACxC,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"}
@@ -19,9 +19,9 @@ export declare const commandsFor: (configuredSsh?: {
19
19
  shared: {
20
20
  shellFor: (ssh: SshCommand, destination: SshDestination) => RemoteShell;
21
21
  local: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", host: string, command: string, args: readonly string[]) => Effect.Effect<string, ExecutorOperationError, never>;
22
- inspect: (operation: ExecutorOperation, shell: RemoteShell, command: string, args: ReadonlyArray<string>) => Effect.Effect<CommandResult, ExecutorOperationError>;
23
- run: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteShell, command: string, args: readonly string[], context?: RemoteContext | undefined) => Effect.Effect<string, ExecutorOperationError, never>;
24
- runWithInput: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteShell, command: string, args: readonly string[], input: import("effect/Redacted").Redacted<string>) => Effect.Effect<string, ExecutorOperationError, never>;
22
+ inspect: (operation: ExecutorOperation, shell: import("@usine/agents/child-host").RemoteHost, command: string, args: ReadonlyArray<string>) => Effect.Effect<CommandResult, ExecutorOperationError>;
23
+ run: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: import("@usine/agents/child-host").RemoteHost, command: string, args: readonly string[], context?: RemoteContext | undefined) => Effect.Effect<string, ExecutorOperationError, never>;
24
+ runWithInput: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: import("@usine/agents/child-host").RemoteHost, command: string, args: readonly string[], input: import("effect/Redacted").Redacted<string>) => Effect.Effect<string, ExecutorOperationError, never>;
25
25
  };
26
26
  childHost: (sshDest: SshDestination) => RemoteShell;
27
27
  lobby: (operation: ExecutorOperation, args: ReadonlyArray<string>) => Effect.Effect<string, ExecutorOperationError>;
@@ -1,4 +1,4 @@
1
- import type { RemoteShell } from "@usine/agents/child-host";
1
+ import type { RemoteHost } from "@usine/agents/child-host";
2
2
  import { Harnesses } from "@usine/agents/harness/node";
3
3
  import type { BrainSpec } from "@usine/core/agent/brain";
4
4
  import { Effect } from "effect";
@@ -8,6 +8,6 @@ import { type ExeDevExecutorOptions, type VmState } from "./model.ts";
8
8
  export declare const preflightFor: (options: ExeDevExecutorOptions, commands: ExeDevCommands) => Effect.Effect<{
9
9
  preflight: (worker: string & import("effect/Brand").Brand<"WorkerName">, brains: readonly BrainSpec[], maxConcurrentAttempts: number) => Effect.Effect<import("../executor.ts").PreflightReport, import("../executor.ts").CredentialUnavailableError | ExecutorOperationError | WorkerCapabilityError, never>;
10
10
  vmFor: (worker: string & import("effect/Brand").Brand<"WorkerName">) => Effect.Effect<VmState, ExecutorOperationError | WorkerCapabilityError, never>;
11
- harnessProbe: (shell: RemoteShell) => import("../harness-preflight.ts").HarnessProbe;
11
+ harnessProbe: (shell: RemoteHost) => import("../harness-preflight.ts").HarnessProbe;
12
12
  }, never, Harnesses>;
13
13
  //# sourceMappingURL=preflight.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/exe-dev/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAuB,MAAM,QAAQ,CAAC;AACrD,OAAO,EACL,sBAAsB,EAGtB,qBAAqB,EAEtB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAY,KAAK,qBAAqB,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAkBhF,eAAO,MAAM,YAAY;;;0BAQM,WAAW;oBA0HxC,CAAC"}
1
+ {"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/exe-dev/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAuB,MAAM,QAAQ,CAAC;AACrD,OAAO,EACL,sBAAsB,EAGtB,qBAAqB,EAEtB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAY,KAAK,qBAAqB,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAkBhF,eAAO,MAAM,YAAY;;;0BAQM,UAAU;oBA0HvC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"preflight.js","sourceRoot":"","sources":["../../src/exe-dev/preflight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,GAEtB,MAAM,gBAAgB,CAAC;AACxB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C,CAAC;QACH,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,mCAAmC,EAAE;YACzD,MAAM;YACN,IAAI,EAAE,EAAE,CAAC,OAAO;YAChB,UAAU;YACV,SAAS,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;YACvE,YAAY,EAAE,OAAO,CAAC,kBAAkB,CAAC,MAAM;SAChD,CAAC,CAAC;QACH,OAAO,aAAa,CAAC;IACvB,CAAC,EAAE,mBAAmB,CAAC,CAAC;IAExB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAkB;QAC3E,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACrD,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC;QACxC,OAAO,KAAK,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AAC5C,CAAC,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type HostInvocation, RemoteShell, type SshCommand } from "@usine/agents/child-host";
1
+ import { type HostInvocation, type RemoteHost, RemoteShell, type SshCommand } from "@usine/agents/child-host";
2
2
  import type { SshDestination } from "@usine/core/worker";
3
3
  import { Effect, Redacted } from "effect";
4
4
  import { ChildProcessSpawner } from "effect/process";
@@ -18,12 +18,17 @@ export interface RemoteCommands {
18
18
  readonly shellFor: (ssh: SshCommand, destination: SshDestination) => RemoteShell;
19
19
  /** Runs a local command, such as the exe.dev lobby, with only the SSH client's environment. */
20
20
  readonly local: (operation: ExecutorOperation, host: string, command: string, args: ReadonlyArray<string>) => Effect.Effect<string, ExecutorOperationError>;
21
- /** Runs a remote command and returns its exit code and output without checking the exit code. */
22
- readonly inspect: (operation: ExecutorOperation, shell: RemoteShell, command: string, args: ReadonlyArray<string>) => Effect.Effect<CommandResult, ExecutorOperationError>;
21
+ /**
22
+ * Runs a remote command and returns its exit code and output without checking the exit code.
23
+ * Fails with an `ExecutorOperationError` whose cause is `HostUnreachable` if the host can't run
24
+ * the command or loses it: an exec transport failure, or an SSH client that exits with
25
+ * `SSH_FAILURE`.
26
+ */
27
+ readonly inspect: (operation: ExecutorOperation, shell: RemoteHost, command: string, args: ReadonlyArray<string>) => Effect.Effect<CommandResult, ExecutorOperationError>;
23
28
  /** Runs a remote command and returns its stdout. Fails if it exits non-zero. */
24
- readonly run: (operation: ExecutorOperation, shell: RemoteShell, command: string, args: ReadonlyArray<string>, context?: RemoteContext) => Effect.Effect<string, ExecutorOperationError>;
29
+ readonly run: (operation: ExecutorOperation, shell: RemoteHost, command: string, args: ReadonlyArray<string>, context?: RemoteContext) => Effect.Effect<string, ExecutorOperationError>;
25
30
  /** Runs a remote command with `input` on stdin, so a secret isn't in the command line or logs. */
26
- readonly runWithInput: (operation: ExecutorOperation, shell: RemoteShell, command: string, args: ReadonlyArray<string>, input: Redacted.Redacted<string>) => Effect.Effect<string, ExecutorOperationError>;
31
+ readonly runWithInput: (operation: ExecutorOperation, shell: RemoteHost, command: string, args: ReadonlyArray<string>, input: Redacted.Redacted<string>) => Effect.Effect<string, ExecutorOperationError>;
27
32
  }
28
33
  /**
29
34
  * The variables the local SSH client inherits. GitHub and factory credentials in the
@@ -40,13 +45,19 @@ export declare const DEFAULT_SSH: SshCommand;
40
45
  * stdin before it starts, so the values stay out of command arguments and the SSH client's
41
46
  * environment.
42
47
  */
43
- export declare const sendingShell: (shell: RemoteShell, variables: Readonly<Record<string, Redacted.Redacted<string>>>) => RemoteShell;
48
+ export declare const sendingShell: (shell: RemoteHost, variables: Readonly<Record<string, Redacted.Redacted<string>>>) => RemoteHost;
49
+ /**
50
+ * Returns the shell of `shell`'s machine outside any container and without a stdin environment.
51
+ * Its SSH client gives up connecting after `connectTimeoutSeconds`; an exec transport detects a
52
+ * dead connection with its own keepalive.
53
+ */
54
+ export declare const machineShellOf: (shell: RemoteHost, connectTimeoutSeconds: number) => RemoteHost;
44
55
  /** The `RemoteCommands` that use this process's spawner and the allowlisted SSH environment. */
45
56
  export declare const remoteCommandsFor: Effect.Effect<{
46
57
  shellFor: (ssh: SshCommand, destination: SshDestination) => RemoteShell;
47
58
  local: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", host: string, command: string, args: readonly string[]) => Effect.Effect<string, ExecutorOperationError, never>;
48
- inspect: (operation: ExecutorOperation, shell: RemoteShell, command: string, args: ReadonlyArray<string>) => Effect.Effect<CommandResult, ExecutorOperationError>;
49
- run: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteShell, command: string, args: readonly string[], context?: RemoteContext | undefined) => Effect.Effect<string, ExecutorOperationError, never>;
50
- runWithInput: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteShell, command: string, args: readonly string[], input: Redacted.Redacted<string>) => Effect.Effect<string, ExecutorOperationError, never>;
59
+ inspect: (operation: ExecutorOperation, shell: RemoteHost, command: string, args: ReadonlyArray<string>) => Effect.Effect<CommandResult, ExecutorOperationError>;
60
+ run: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteHost, command: string, args: readonly string[], context?: RemoteContext | undefined) => Effect.Effect<string, ExecutorOperationError, never>;
61
+ runWithInput: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteHost, command: string, args: readonly string[], input: Redacted.Redacted<string>) => Effect.Effect<string, ExecutorOperationError, never>;
51
62
  }, never, ChildProcessSpawner.ChildProcessSpawner>;
52
63
  //# sourceMappingURL=commands.d.ts.map
@@ -1 +1 @@
1
- {"version":3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kDA6DvD,CAAC"}
@@ -1,7 +1,7 @@
1
- import { RemoteShell, sshArguments, sshInput, } from "@usine/agents/child-host";
1
+ import { ExecShell, remoteCommandLine, HostUnreachable, remoteInput, RemoteShell, sshArguments, SSH_FAILURE, } from "@usine/agents/child-host";
2
2
  import { Effect, Redacted, Stream } from "effect";
3
3
  import { ChildProcessSpawner } from "effect/process";
4
- import { allowlistedEnvironment, collectCommand, requireSuccess, } from "../child-command.js";
4
+ import { allowlistedEnvironment, collectCommand, collectOutput, requireSuccess, } from "../child-command.js";
5
5
  import { ExecutorOperationError } from "../executor.js";
6
6
  /**
7
7
  * The variables the local SSH client inherits. GitHub and factory credentials in the
@@ -34,10 +34,27 @@ const encoder = new TextEncoder();
34
34
  */
35
35
  export const sendingShell = (shell, variables) => Object.keys(variables).length === 0
36
36
  ? shell
37
- : RemoteShell.make({
38
- ...shell,
39
- stdinEnvironment: { ...shell.stdinEnvironment, ...variables },
40
- });
37
+ : shell._tag === "RemoteShell"
38
+ ? RemoteShell.make({
39
+ ...shell,
40
+ stdinEnvironment: { ...shell.stdinEnvironment, ...variables },
41
+ })
42
+ : ExecShell.make({ ...shell, stdinEnvironment: { ...shell.stdinEnvironment, ...variables } });
43
+ /**
44
+ * Returns the shell of `shell`'s machine outside any container and without a stdin environment.
45
+ * Its SSH client gives up connecting after `connectTimeoutSeconds`; an exec transport detects a
46
+ * dead connection with its own keepalive.
47
+ */
48
+ export const machineShellOf = (shell, connectTimeoutSeconds) => shell._tag === "RemoteShell"
49
+ ? RemoteShell.make({
50
+ ssh: {
51
+ command: shell.ssh.command,
52
+ args: [...shell.ssh.args, "-o", `ConnectTimeout=${connectTimeoutSeconds}`],
53
+ },
54
+ sshEnvironment: shell.sshEnvironment,
55
+ destination: shell.destination,
56
+ })
57
+ : ExecShell.make({ transport: shell.transport, destination: shell.destination });
41
58
  /** The `RemoteCommands` that use this process's spawner and the allowlisted SSH environment. */
42
59
  export const remoteCommandsFor = Effect.gen(function* () {
43
60
  const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
@@ -55,33 +72,57 @@ export const remoteCommandsFor = Effect.gen(function* () {
55
72
  const result = yield* executeRaw(operation, host, command, args, environment);
56
73
  return yield* requireSuccess(operation, host, command, args, result);
57
74
  });
58
- const inspect = (operation, shell, command, args) => executeRaw(operation, shell.destination, shell.ssh.command, sshArguments(shell, { command, args }), shell.sshEnvironment, undefined, sshInput(shell, Stream.empty));
59
- const run = Effect.fn("RemoteExecutor.run")(function* (operation, shell, command, args, context = {}) {
60
- const sshArgs = sshArguments(shell, {
61
- cwd: context.cwd,
62
- environment: context.environment,
63
- command,
64
- args,
75
+ /**
76
+ * Runs `invocation` on `shell` with `input` on stdin and collects its output. An SSH client's
77
+ * `SSH_FAILURE` exit fails like an exec transport failure, with an `ExecutorOperationError` whose
78
+ * cause is `HostUnreachable`; `scrub` is applied to the client's message first.
79
+ */
80
+ const execute = Effect.fn("RemoteExecutor.execute")(function* (operation, shell, invocation, input, maxOutputBytes, scrub = (text) => text) {
81
+ yield* Effect.annotateCurrentSpan({ host: shell.destination, operation });
82
+ if (shell._tag === "ExecShell")
83
+ return yield* collectOutput(operation, invocation.command, shell.transport.run(remoteCommandLine(shell, invocation), remoteInput(shell, input)), maxOutputBytes);
84
+ const result = yield* collectCommand(spawner, operation, shell.ssh.command, sshArguments(shell, invocation), { env: { ...shell.sshEnvironment }, extendEnv: false, stdin: remoteInput(shell, input) }, maxOutputBytes);
85
+ if (result.exitCode !== SSH_FAILURE)
86
+ return result;
87
+ const cause = HostUnreachable.make({
88
+ destination: shell.destination,
89
+ message: scrub(result.stderr).trim() || `${shell.ssh.command} exited with code ${SSH_FAILURE}`,
90
+ });
91
+ yield* Effect.logWarning("The SSH client couldn't reach the host or lost the command", {
92
+ operation,
93
+ host: shell.destination,
94
+ command: invocation.command,
95
+ message: cause.message,
65
96
  });
66
- const result = yield* executeRaw(operation, shell.destination, shell.ssh.command, sshArgs, shell.sshEnvironment, context.maxOutputBytes, sshInput(shell, Stream.empty));
97
+ return yield* ExecutorOperationError.make({
98
+ operation,
99
+ message: `Can't reach ${cause.destination} to run ${invocation.command}: ${cause.message}`,
100
+ cause,
101
+ });
102
+ });
103
+ /** Returns the program and arguments to name in an error about `invocation` on `shell`. */
104
+ const described = (shell, invocation) => shell._tag === "RemoteShell"
105
+ ? { command: shell.ssh.command, args: sshArguments(shell, invocation) }
106
+ : { command: invocation.command, args: [...invocation.args] };
107
+ const inspect = (operation, shell, command, args) => execute(operation, shell, { command, args }, Stream.empty);
108
+ const run = Effect.fn("RemoteExecutor.run")(function* (operation, shell, command, args, context = {}) {
109
+ const invocation = { cwd: context.cwd, environment: context.environment, command, args };
67
110
  const scrub = context.scrub ?? ((text) => text);
68
- return yield* requireSuccess(operation, shell.destination, shell.ssh.command, sshArgs, {
111
+ const result = yield* execute(operation, shell, invocation, Stream.empty, context.maxOutputBytes, scrub);
112
+ const failed = described(shell, invocation);
113
+ return yield* requireSuccess(operation, shell.destination, failed.command, failed.args, {
69
114
  ...result,
70
115
  stdout: scrub(result.stdout),
71
116
  stderr: scrub(result.stderr),
72
117
  });
73
118
  });
74
119
  const runWithInput = Effect.fn("RemoteExecutor.runWithInput")(function* (operation, shell, command, args, input) {
75
- yield* Effect.annotateCurrentSpan({ host: shell.destination, operation });
76
- const sshArgs = sshArguments(shell, { command, args });
77
- const result = yield* collectCommand(spawner, operation, shell.ssh.command, sshArgs, {
78
- env: { ...shell.sshEnvironment },
79
- extendEnv: false,
80
- stdin: sshInput(shell, Stream.make(encoder.encode(Redacted.value(input)))),
81
- });
120
+ const invocation = { command, args };
82
121
  const secret = Redacted.value(input);
83
122
  const scrub = (text) => (secret === "" ? text : text.replaceAll(secret, "[REDACTED]"));
84
- return yield* requireSuccess(operation, shell.destination, shell.ssh.command, sshArgs, {
123
+ const result = yield* execute(operation, shell, invocation, Stream.make(encoder.encode(secret)), undefined, scrub);
124
+ const failed = described(shell, invocation);
125
+ return yield* requireSuccess(operation, shell.destination, failed.command, failed.args, {
85
126
  ...result,
86
127
  stdout: scrub(result.stdout),
87
128
  stderr: scrub(result.stderr),
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/remote/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EAEX,YAAY,EACZ,QAAQ,GACT,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,sBAAsB,EACtB,cAAc,EAEd,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAA0B,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AA+ChF;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,MAAM;IACN,MAAM;IACN,QAAQ;IACR,MAAM;IACN,OAAO;IACP,eAAe;IACf,eAAe;IACf,QAAQ;IACR,MAAM;CACE,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAe;IACrC,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,uBAAuB,CAAC;CAC7F,CAAC;AAEF,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAElC;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,KAAkB,EAClB,SAA8D,EACjD,EAAE,CACf,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,KAAK,CAAC;IACjC,CAAC,CAAC,KAAK;IACP,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC;QACf,GAAG,KAAK;QACR,gBAAgB,EAAE,EAAE,GAAG,KAAK,CAAC,gBAAgB,EAAE,GAAG,SAAS,EAAE;KAC9D,CAAC,CAAC;AAET,gGAAgG;AAChG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AAC,cAAc,CAAC,SAAS,EAAE,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE;YACtF,GAAG,MAAM;YACT,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;YAC5B,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;SAC7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,QAAQ;QACR,KAAK;QACL,OAAO;QACP,GAAG;QACH,YAAY;KACY,CAAC;AAC7B,CAAC,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { RemoteShell } from "@usine/agents/child-host";
1
+ import { type RemoteHost } from "@usine/agents/child-host";
2
2
  import type { Harness } from "@usine/core/agent/brain";
3
3
  import { type AttemptId } from "@usine/core/attempt";
4
4
  import type { Sink } from "@usine/core/attempt/channel";
@@ -90,17 +90,17 @@ export declare const STOP_CHILDREN_SCRIPT: string;
90
90
  * process left.
91
91
  */
92
92
  export declare const containersFor: (commands: RemoteCommands) => {
93
- start: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteShell, spec: ContainerSpec) => Effect.Effect<RemoteShell, ExecutorOperationError, import("effect/Scope").Scope>;
94
- trackMemory: (shell: RemoteShell, spec: ContainerSpec) => Effect.Effect<{
93
+ start: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteHost, spec: ContainerSpec) => Effect.Effect<RemoteHost, ExecutorOperationError, import("effect/Scope").Scope>;
94
+ trackMemory: (shell: RemoteHost, spec: ContainerSpec) => Effect.Effect<{
95
95
  recordKills: () => Effect.Effect<void, never, never>;
96
96
  recordTo: (record: Sink["outOfMemory"]) => Effect.Effect<void, never, never>;
97
97
  ensureRunning: Effect.Effect<boolean, ExecutorOperationError, never>;
98
98
  }, never, never>;
99
- stopChildren: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteShell, name: string, worktree: string, runtime: "docker" | "podman") => Effect.Effect<void, ExecutorOperationError, never>;
100
- sweep: (shell: RemoteShell, instance: string, instanceId: string & import("effect/Brand").Brand<"InstanceId">, worker: string & import("effect/Brand").Brand<"WorkerName">, kept: ReadonlySet<string>, runtime: "docker" | "podman") => Effect.Effect<string[], ExecutorOperationError, never>;
101
- remove: (shell: RemoteShell, name: string, runtime: "docker" | "podman") => Effect.Effect<void, never, never>;
102
- mark: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteShell, marker: string) => Effect.Effect<void, ExecutorOperationError, never>;
103
- marked: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteShell, marker: string) => Effect.Effect<boolean, ExecutorOperationError, never>;
104
- prepareCaches: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteShell, image: string & import("effect/Brand").Brand<"ContainerImage">, worker: string & import("effect/Brand").Brand<"WorkerName">, runtime: "docker" | "podman") => Effect.Effect<undefined, ExecutorOperationError, never>;
99
+ stopChildren: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteHost, name: string, worktree: string, runtime: "docker" | "podman") => Effect.Effect<void, ExecutorOperationError, never>;
100
+ sweep: (shell: RemoteHost, instance: string, instanceId: string & import("effect/Brand").Brand<"InstanceId">, worker: string & import("effect/Brand").Brand<"WorkerName">, kept: ReadonlySet<string>, runtime: "docker" | "podman") => Effect.Effect<string[], ExecutorOperationError, never>;
101
+ remove: (shell: RemoteHost, name: string, runtime: "docker" | "podman") => Effect.Effect<void, never, never>;
102
+ mark: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteHost, marker: string) => Effect.Effect<void, ExecutorOperationError, never>;
103
+ marked: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteHost, marker: string) => Effect.Effect<boolean, ExecutorOperationError, never>;
104
+ prepareCaches: (operation: "cancel" | "cleanup" | "launch" | "preflight" | "prepare", shell: RemoteHost, image: string & import("effect/Brand").Brand<"ContainerImage">, worker: string & import("effect/Brand").Brand<"WorkerName">, runtime: "docker" | "podman") => Effect.Effect<undefined, ExecutorOperationError, never>;
105
105
  };
106
106
  //# sourceMappingURL=container.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/remote/container.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,WAAW,EAAuB,MAAM,0BAA0B,CAAC;AAC/F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,KAAK,SAAS,EAA6B,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAY,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAe,MAAM,QAAQ,CAAC;AACzE,OAAO,EAA0B,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,KAAK,gBAAgB,EAAkB,MAAM,cAAc,CAAC;AAGrE,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AACpD,eAAO,MAAM,eAAe,wCAAwC,CAAC;AACrE,eAAO,MAAM,gBAAgB,gEAAmD,CAAC;AAsBjF,yFAAyF;AACzF,eAAO,MAAM,oBAAoB,QAyBzB,CAAC;AAkBT,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IAChC,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAA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AAM,CAAC,CAAC,CAAC,CAAC;CACvE;AAmBD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,QAUzB,CAAC;AAqGT;;;;GAIG;AACH,eAAO,MAAM,aAAa,aAAc,cAAc;;;;2BAuY7B,IAAI,CAAC,aAAa,CAAC;;;;;;;;;CAmF3C,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { catalog } from "@usine/agents/harness";
2
- import { CHILD_KILL_SCRIPT, RemoteShell } from "@usine/agents/child-host";
2
+ import { CHILD_KILL_SCRIPT, ExecShell, RemoteShell, } from "@usine/agents/child-host";
3
3
  import { ContainerOutOfMemoryKills } from "@usine/core/attempt";
4
4
  import { safeSegment } from "@usine/core/repository";
5
5
  import { ContainerId, } from "@usine/core/worker";
@@ -175,12 +175,14 @@ const containerFields = (shell, spec) => ({
175
175
  /** Returns the shell that runs commands in the container `name` on the machine of `shell`. */
176
176
  const containerShell = (shell, name, runtime) => {
177
177
  const container = { runtime, name };
178
- return RemoteShell.make({
179
- ssh: shell.ssh,
180
- sshEnvironment: shell.sshEnvironment,
181
- destination: shell.destination,
182
- container,
183
- });
178
+ return shell._tag === "RemoteShell"
179
+ ? RemoteShell.make({
180
+ ssh: shell.ssh,
181
+ sshEnvironment: shell.sshEnvironment,
182
+ destination: shell.destination,
183
+ container,
184
+ })
185
+ : ExecShell.make({ transport: shell.transport, destination: shell.destination, container });
184
186
  };
185
187
  /**
186
188
  * Returns the operations on the containers of a machine: start one for an Attempt or a