@usine/executor 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -37
- package/dist/child-command.d.ts +4 -7
- package/dist/child-command.d.ts.map +1 -1
- package/dist/child-command.js +6 -12
- package/dist/child-command.js.map +1 -1
- package/dist/claude-login-lock.d.ts +8 -0
- package/dist/claude-login-lock.d.ts.map +1 -0
- package/dist/claude-login-lock.js +9 -0
- package/dist/claude-login-lock.js.map +1 -0
- package/dist/credential-environment.d.ts +20 -0
- package/dist/credential-environment.d.ts.map +1 -0
- package/dist/credential-environment.js +20 -0
- package/dist/credential-environment.js.map +1 -0
- package/dist/durable-session.d.ts +63 -0
- package/dist/durable-session.d.ts.map +1 -0
- package/dist/durable-session.js +491 -0
- package/dist/durable-session.js.map +1 -0
- package/dist/exe-dev/commands.d.ts +23 -13
- package/dist/exe-dev/commands.d.ts.map +1 -1
- package/dist/exe-dev/commands.js +11 -57
- package/dist/exe-dev/commands.js.map +1 -1
- package/dist/exe-dev/exe-dev.d.ts +9 -3
- package/dist/exe-dev/exe-dev.d.ts.map +1 -1
- package/dist/exe-dev/exe-dev.js +53 -128
- package/dist/exe-dev/exe-dev.js.map +1 -1
- package/dist/exe-dev/grants.d.ts.map +1 -1
- package/dist/exe-dev/grants.js +35 -15
- package/dist/exe-dev/grants.js.map +1 -1
- package/dist/exe-dev/model.d.ts +15 -19
- package/dist/exe-dev/model.d.ts.map +1 -1
- package/dist/exe-dev/model.js +9 -12
- package/dist/exe-dev/model.js.map +1 -1
- package/dist/exe-dev/preflight.d.ts +8 -4
- package/dist/exe-dev/preflight.d.ts.map +1 -1
- package/dist/exe-dev/preflight.js +23 -33
- package/dist/exe-dev/preflight.js.map +1 -1
- package/dist/executor.d.ts +140 -41
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.js +90 -19
- package/dist/executor.js.map +1 -1
- package/dist/guard.d.ts +57 -7
- package/dist/guard.d.ts.map +1 -1
- package/dist/guard.js +273 -59
- package/dist/guard.js.map +1 -1
- package/dist/harness-preflight.d.ts +25 -4
- package/dist/harness-preflight.d.ts.map +1 -1
- package/dist/harness-preflight.js +25 -29
- package/dist/harness-preflight.js.map +1 -1
- package/dist/keyed-lock.d.ts +2 -3
- package/dist/keyed-lock.d.ts.map +1 -1
- package/dist/keyed-lock.js +2 -3
- package/dist/keyed-lock.js.map +1 -1
- package/dist/leftovers.d.ts +9 -0
- package/dist/leftovers.d.ts.map +1 -0
- package/dist/leftovers.js +14 -0
- package/dist/leftovers.js.map +1 -0
- package/dist/local/credentials.d.ts +21 -0
- package/dist/local/credentials.d.ts.map +1 -0
- package/dist/local/credentials.js +39 -0
- package/dist/local/credentials.js.map +1 -0
- package/dist/local/leftovers.d.ts +8 -0
- package/dist/local/leftovers.d.ts.map +1 -0
- package/dist/local/leftovers.js +23 -0
- package/dist/local/leftovers.js.map +1 -0
- package/dist/local/local.d.ts +16 -10
- package/dist/local/local.d.ts.map +1 -1
- package/dist/local/local.js +163 -129
- package/dist/local/local.js.map +1 -1
- package/dist/memory-preflight.d.ts +25 -0
- package/dist/memory-preflight.d.ts.map +1 -0
- package/dist/memory-preflight.js +83 -0
- package/dist/memory-preflight.js.map +1 -0
- package/dist/pre-push-hook.d.ts +20 -0
- package/dist/pre-push-hook.d.ts.map +1 -0
- package/dist/pre-push-hook.js +33 -0
- package/dist/pre-push-hook.js.map +1 -0
- package/dist/prepared-attempt.d.ts +33 -3
- package/dist/prepared-attempt.d.ts.map +1 -1
- package/dist/prepared-attempt.js +109 -31
- package/dist/prepared-attempt.js.map +1 -1
- package/dist/provision.d.ts +77 -14
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.js +357 -55
- package/dist/provision.js.map +1 -1
- package/dist/remote/commands.d.ts +51 -0
- package/dist/remote/commands.d.ts.map +1 -0
- package/dist/remote/commands.js +94 -0
- package/dist/remote/commands.js.map +1 -0
- package/dist/remote/leftovers.d.ts +14 -0
- package/dist/remote/leftovers.d.ts.map +1 -0
- package/dist/remote/leftovers.js +22 -0
- package/dist/remote/leftovers.js.map +1 -0
- package/dist/remote/liveness.d.ts +33 -0
- package/dist/remote/liveness.d.ts.map +1 -0
- package/dist/remote/liveness.js +194 -0
- package/dist/remote/liveness.js.map +1 -0
- package/dist/remote/machine.d.ts +64 -0
- package/dist/remote/machine.d.ts.map +1 -0
- package/dist/remote/machine.js +2 -0
- package/dist/remote/machine.js.map +1 -0
- package/dist/remote/remote.d.ts +24 -0
- package/dist/remote/remote.d.ts.map +1 -0
- package/dist/remote/remote.js +308 -0
- package/dist/remote/remote.js.map +1 -0
- package/dist/remote/sweep.d.ts +15 -0
- package/dist/remote/sweep.d.ts.map +1 -0
- package/dist/remote/sweep.js +116 -0
- package/dist/remote/sweep.js.map +1 -0
- package/dist/renewable-credential.d.ts +17 -0
- package/dist/renewable-credential.d.ts.map +1 -0
- package/dist/renewable-credential.js +58 -0
- package/dist/renewable-credential.js.map +1 -0
- package/dist/salvage.d.ts +30 -0
- package/dist/salvage.d.ts.map +1 -0
- package/dist/salvage.js +104 -0
- package/dist/salvage.js.map +1 -0
- package/dist/ssh/credentials.d.ts +40 -0
- package/dist/ssh/credentials.d.ts.map +1 -0
- package/dist/ssh/credentials.js +83 -0
- package/dist/ssh/credentials.js.map +1 -0
- package/dist/ssh/gateway/admin.d.ts +45 -0
- package/dist/ssh/gateway/admin.d.ts.map +1 -0
- package/dist/ssh/gateway/admin.js +129 -0
- package/dist/ssh/gateway/admin.js.map +1 -0
- package/dist/ssh/gateway/attachments.d.ts +22 -0
- package/dist/ssh/gateway/attachments.d.ts.map +1 -0
- package/dist/ssh/gateway/attachments.js +154 -0
- package/dist/ssh/gateway/attachments.js.map +1 -0
- package/dist/ssh/gateway/environment.d.ts +52 -0
- package/dist/ssh/gateway/environment.d.ts.map +1 -0
- package/dist/ssh/gateway/environment.js +78 -0
- package/dist/ssh/gateway/environment.js.map +1 -0
- package/dist/ssh/gateway/forward.d.ts +74 -0
- package/dist/ssh/gateway/forward.d.ts.map +1 -0
- package/dist/ssh/gateway/forward.js +247 -0
- package/dist/ssh/gateway/forward.js.map +1 -0
- package/dist/ssh/gateway/preflight.d.ts +28 -0
- package/dist/ssh/gateway/preflight.d.ts.map +1 -0
- package/dist/ssh/gateway/preflight.js +234 -0
- package/dist/ssh/gateway/preflight.js.map +1 -0
- package/dist/ssh/model.d.ts +65 -0
- package/dist/ssh/model.d.ts.map +1 -0
- package/dist/ssh/model.js +2 -0
- package/dist/ssh/model.js.map +1 -0
- package/dist/ssh/preflight.d.ts +16 -0
- package/dist/ssh/preflight.d.ts.map +1 -0
- package/dist/ssh/preflight.js +47 -0
- package/dist/ssh/preflight.js.map +1 -0
- package/dist/ssh/ssh.d.ts +20 -0
- package/dist/ssh/ssh.d.ts.map +1 -0
- package/dist/ssh/ssh.js +78 -0
- package/dist/ssh/ssh.js.map +1 -0
- package/dist/ssh/workers.d.ts +53 -0
- package/dist/ssh/workers.d.ts.map +1 -0
- package/dist/ssh/workers.js +173 -0
- package/dist/ssh/workers.js.map +1 -0
- package/package.json +12 -4
- package/dist/exe-dev/channel.d.ts +0 -12
- package/dist/exe-dev/channel.d.ts.map +0 -1
- package/dist/exe-dev/channel.js +0 -42
- package/dist/exe-dev/channel.js.map +0 -1
- package/dist/exe-dev/shell.d.ts +0 -12
- package/dist/exe-dev/shell.d.ts.map +0 -1
- package/dist/exe-dev/shell.js +0 -31
- package/dist/exe-dev/shell.js.map +0 -1
- package/dist/exe-dev/sweep.d.ts +0 -10
- package/dist/exe-dev/sweep.d.ts.map +0 -1
- package/dist/exe-dev/sweep.js +0 -117
- package/dist/exe-dev/sweep.js.map +0 -1
- package/dist/invalid-frame.d.ts +0 -17
- package/dist/invalid-frame.d.ts.map +0 -1
- package/dist/invalid-frame.js +0 -111
- package/dist/invalid-frame.js.map +0 -1
- package/dist/run-host-session.d.ts +0 -27
- package/dist/run-host-session.d.ts.map +0 -1
- package/dist/run-host-session.js +0 -303
- package/dist/run-host-session.js.map +0 -1
package/dist/exe-dev/commands.js
CHANGED
|
@@ -1,66 +1,20 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import {
|
|
3
|
-
import { allowlistedEnvironment, collectCommand, requireSuccess, } from "../child-command.js";
|
|
4
|
-
import { shellCommand } from "./shell.js";
|
|
5
|
-
/**
|
|
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.
|
|
8
|
-
*/
|
|
9
|
-
const SSH_ENVIRONMENT_ALLOWLIST = [
|
|
10
|
-
"HOME",
|
|
11
|
-
"LANG",
|
|
12
|
-
"LC_ALL",
|
|
13
|
-
"PATH",
|
|
14
|
-
"SHELL",
|
|
15
|
-
"SSH_AGENT_PID",
|
|
16
|
-
"SSH_AUTH_SOCK",
|
|
17
|
-
"TMPDIR",
|
|
18
|
-
"USER",
|
|
19
|
-
];
|
|
2
|
+
import { DEFAULT_SSH, remoteCommandsFor, } from "../remote/commands.js";
|
|
20
3
|
export const commandsFor = Effect.fn("ExeDevExecutor.commandsFor")(function* (configuredSsh) {
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
args: ["-o", "BatchMode=yes", "-o", "ServerAliveInterval=30", "-o", "ServerAliveCountMax=4"],
|
|
28
|
-
};
|
|
29
|
-
const executeRaw = Effect.fn("ExeDevExecutor.executeRaw")(function* (operation, host, command, args) {
|
|
30
|
-
yield* Effect.annotateCurrentSpan({ host, operation });
|
|
31
|
-
return yield* collectCommand(spawner, operation, command, args, {
|
|
32
|
-
env: environment,
|
|
33
|
-
extendEnv: false,
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
const executeChecked = Effect.fn("ExeDevExecutor.executeChecked")(function* (operation, host, command, args) {
|
|
37
|
-
const result = yield* executeRaw(operation, host, command, args);
|
|
38
|
-
return yield* requireSuccess(operation, host, command, args, result);
|
|
39
|
-
});
|
|
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.
|
|
43
|
-
const lobby = (operation, args) => executeChecked(operation, "exe.dev", ssh.command, [...ssh.args, "exe.dev", ...args]);
|
|
4
|
+
const shared = yield* remoteCommandsFor;
|
|
5
|
+
const ssh = configuredSsh ?? DEFAULT_SSH;
|
|
6
|
+
const childHost = (sshDest) => shared.shellFor(ssh, sshDest);
|
|
7
|
+
// OpenSSH joins lobby arguments without quoting, so each value must be a brand-validated
|
|
8
|
+
// token (WorkerName, IntegrationName, CredentialGrantMinutes), never free-form text.
|
|
9
|
+
const lobby = (operation, args) => shared.local(operation, "exe.dev", ssh.command, [...ssh.args, "exe.dev", ...args]);
|
|
44
10
|
const lobbyJson = (operation, args) => lobby(operation, [...args, "--json"]);
|
|
45
|
-
const remoteRaw = (operation, sshDest, command, args) => executeRaw(operation, sshDest, ssh.command, [
|
|
46
|
-
...ssh.args,
|
|
47
|
-
sshDest,
|
|
48
|
-
"--",
|
|
49
|
-
shellCommand(command, args),
|
|
50
|
-
]);
|
|
51
|
-
const remote = (operation, sshDest, command, args) => executeChecked(operation, sshDest, ssh.command, [
|
|
52
|
-
...ssh.args,
|
|
53
|
-
sshDest,
|
|
54
|
-
"--",
|
|
55
|
-
shellCommand(command, args),
|
|
56
|
-
]);
|
|
57
11
|
return {
|
|
58
|
-
|
|
12
|
+
shared,
|
|
13
|
+
childHost,
|
|
59
14
|
lobby,
|
|
60
15
|
lobbyJson,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
ssh,
|
|
16
|
+
remoteRaw: (operation, sshDest, command, args) => shared.inspect(operation, childHost(sshDest), command, args),
|
|
17
|
+
remote: (operation, sshDest, command, args, context) => shared.run(operation, childHost(sshDest), command, args, context),
|
|
64
18
|
};
|
|
65
19
|
});
|
|
66
20
|
//# sourceMappingURL=commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/exe-dev/commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/exe-dev/commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EACL,WAAW,EAGX,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AA4B/B,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,EAAE,CAAC,4BAA4B,CAAC,CAAC,QAAQ,CAAC,EAC1E,aAA0B;IAE1B,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,iBAAiB,CAAC;IACxC,MAAM,GAAG,GAAG,aAAa,IAAI,WAAW,CAAC;IACzC,MAAM,SAAS,GAAG,CAAC,OAAuB,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAE7E,yFAAyF;IACzF,qFAAqF;IACrF,MAAM,KAAK,GAAG,CACZ,SAA4B,EAC5B,IAA2B,EACoB,EAAE,CACjD,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAErF,MAAM,SAAS,GAAG,CAChB,SAA4B,EAC5B,IAA2B,EACoB,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE1F,OAAO;QACL,MAAM;QACN,SAAS;QACT,KAAK;QACL,SAAS;QACT,SAAS,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAC/C,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC;QAC9D,MAAM,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CACrD,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC;KAC3C,CAAC;AAC7B,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import type { ClaudeLoginLock } from "@usine/agents/runtime";
|
|
2
|
+
import type { AttemptRuntime } from "@usine/durable/attempt-runtime";
|
|
1
3
|
import { Layer } from "effect";
|
|
2
|
-
import { ChildProcessSpawner } from "effect/unstable/process";
|
|
4
|
+
import type { ChildProcessSpawner } from "effect/unstable/process";
|
|
3
5
|
import { Executor } from "../executor.ts";
|
|
4
6
|
import type { ExeDevExecutorOptions } from "./model.ts";
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The executor for exe.dev Workers. Each Attempt's Pi parent is a durable task in this process
|
|
9
|
+
* (`AttemptRuntime`), and its children run on the Worker's VM over SSH. A live Attempt
|
|
10
|
+
* reattaches to its checkout after an orchestrator restart. Requires Node.
|
|
11
|
+
*/
|
|
12
|
+
export declare const layer: (options: ExeDevExecutorOptions) => Layer.Layer<Executor, never, AttemptRuntime | ClaudeLoginLock | ChildProcessSpawner.ChildProcessSpawner>;
|
|
7
13
|
export { CredentialGrantMinutes, type ExeDevExecutorOptions, GitHubIntegration, IntegrationName, } from "./model.ts";
|
|
8
14
|
//# sourceMappingURL=exe-dev.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exe-dev.d.ts","sourceRoot":"","sources":["../../src/exe-dev/exe-dev.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exe-dev.d.ts","sourceRoot":"","sources":["../../src/exe-dev/exe-dev.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAU,KAAK,EAAU,MAAM,QAAQ,CAAC;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAA8B,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAKtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAqFxD;;;;GAIG;AACH,eAAO,MAAM,KAAK,YACP,qBAAqB,KAC7B,KAAK,CAAC,KAAK,CACZ,QAAQ,EACR,KAAK,EACL,cAAc,GAAG,eAAe,GAAG,mBAAmB,CAAC,mBAAmB,CACpB,CAAC;AAEzD,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
package/dist/exe-dev/exe-dev.js
CHANGED
|
@@ -1,154 +1,79 @@
|
|
|
1
|
-
import { RepositoryName } from "@usine/core/repository";
|
|
2
|
-
import { Effect,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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";
|
|
1
|
+
import { RepositoryName, safeSegment } from "@usine/core/repository";
|
|
2
|
+
import { Effect, Layer, Option } from "effect";
|
|
3
|
+
import { CredentialUnavailableError, Executor } from "../executor.js";
|
|
4
|
+
import { remoteExecutorFor } from "../remote/remote.js";
|
|
10
5
|
import { commandsFor } from "./commands.js";
|
|
11
6
|
import { credentialGrantsFor } from "./grants.js";
|
|
12
7
|
import { preflightFor } from "./preflight.js";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
/** The host for which the exe.dev edge injects the GitHub credential. */
|
|
9
|
+
const EDGE_GITHUB_HOST = "github.int.exe.xyz";
|
|
10
|
+
/**
|
|
11
|
+
* Returns the environment for every child and harvesting command on the VM. It contains no
|
|
12
|
+
* secrets; the exe.dev edge injects the credential (ADR 0011).
|
|
13
|
+
*/
|
|
14
|
+
const edgeAccess = (machine) => ({
|
|
15
|
+
shell: machine.shell,
|
|
16
|
+
environment: { GH_HOST: EDGE_GITHUB_HOST },
|
|
17
|
+
gitEnvironment: {},
|
|
18
|
+
refresh: Effect.void,
|
|
19
|
+
scrub: (text) => text,
|
|
20
|
+
});
|
|
17
21
|
const makeExeDevExecutor = (options) => Effect.gen(function* () {
|
|
18
22
|
const commands = yield* commandsFor(options.ssh);
|
|
19
|
-
const fetches = yield* keyedLockFor();
|
|
20
23
|
const integrations = new Map(options.githubIntegrations.map(({ name, repository }) => [repository, name]));
|
|
21
24
|
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
25
|
if (integrations.size !== options.githubIntegrations.length) {
|
|
27
26
|
return yield* Effect.die(new Error("ExeDevExecutorOptions.githubIntegrations contains duplicate repositories"));
|
|
28
27
|
}
|
|
29
28
|
if (integrationNames.size !== options.githubIntegrations.length) {
|
|
30
29
|
return yield* Effect.die(new Error("ExeDevExecutorOptions.githubIntegrations contains duplicate integration names"));
|
|
31
30
|
}
|
|
32
|
-
const machines = yield* preflightFor(options, commands
|
|
31
|
+
const machines = yield* preflightFor(options, commands);
|
|
33
32
|
const credentialGrants = yield* credentialGrantsFor(options, commands);
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const integration = integrations.get(
|
|
43
|
-
if (integration === undefined)
|
|
33
|
+
const machineFor = Effect.fn("ExeDevExecutor.machineFor")(function* (worker) {
|
|
34
|
+
const vm = yield* machines.vmFor(worker);
|
|
35
|
+
return {
|
|
36
|
+
shell: commands.childHost(vm.sshDest),
|
|
37
|
+
workerDirectory: `${vm.home}/.usine/workers/${safeSegment(worker)}`,
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
const grantFor = Effect.fn("ExeDevExecutor.grantFor")(function* (repository) {
|
|
41
|
+
const integration = integrations.get(repository);
|
|
42
|
+
if (integration === undefined)
|
|
44
43
|
return yield* new CredentialUnavailableError({
|
|
45
|
-
repository
|
|
46
|
-
|
|
44
|
+
repository,
|
|
45
|
+
reason: "refused",
|
|
46
|
+
message: `No exe.dev GitHub integration is configured for ${repository}`,
|
|
47
47
|
cause: new Error("repository integration missing"),
|
|
48
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
49
|
return {
|
|
139
|
-
|
|
140
|
-
|
|
50
|
+
acquire: (attemptId, worker, _permissions, machine) => credentialGrants
|
|
51
|
+
.acquire(attemptId, worker, repository, integration)
|
|
52
|
+
.pipe(Effect.as(edgeAccess(machine))),
|
|
141
53
|
};
|
|
142
|
-
}
|
|
143
|
-
return
|
|
54
|
+
});
|
|
55
|
+
return yield* remoteExecutorFor({
|
|
144
56
|
kind: "exe.dev",
|
|
145
|
-
|
|
146
|
-
|
|
57
|
+
spanPrefix: "ExeDevExecutor",
|
|
58
|
+
label: "exe.dev",
|
|
59
|
+
commands: commands.shared,
|
|
60
|
+
machineFor,
|
|
147
61
|
preflight: machines.preflight,
|
|
148
|
-
|
|
62
|
+
harnessProbe: (machine) => machines.harnessProbe(machine.shell),
|
|
63
|
+
repositoryUrl: (_machine, repository) => `https://${EDGE_GITHUB_HOST}/${repository}.git`,
|
|
64
|
+
// exe.dev Workers have no Gateway; every harness uses its own login.
|
|
65
|
+
gatewayCredential: () => Effect.succeedNone,
|
|
66
|
+
grantFor,
|
|
67
|
+
readOnlyAccessGap: Option.some("An exe.dev GitHub integration has the access of exe.dev's GitHub App, which can't be limited to read-only"),
|
|
68
|
+
reclaim: () => Effect.void,
|
|
69
|
+
interruptGrace: options.interruptGrace ?? "10 seconds",
|
|
149
70
|
});
|
|
150
71
|
});
|
|
151
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* The executor for exe.dev Workers. Each Attempt's Pi parent is a durable task in this process
|
|
74
|
+
* (`AttemptRuntime`), and its children run on the Worker's VM over SSH. A live Attempt
|
|
75
|
+
* reattaches to its checkout after an orchestrator restart. Requires Node.
|
|
76
|
+
*/
|
|
152
77
|
export const layer = (options) => Layer.effect(Executor, makeExeDevExecutor(options));
|
|
153
78
|
export { CredentialGrantMinutes, GitHubIntegration, IntegrationName, } from "./model.js";
|
|
154
79
|
//# sourceMappingURL=exe-dev.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exe-dev.js","source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AE,OAAO,CAAC,cAAc,IAAI,YAAY;KACvD,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,OAA8B,EAK9B,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;AAEzD,OAAO,EACL,sBAAsB,EAEtB,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../../src/exe-dev/grants.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../../src/exe-dev/grants.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAO,KAAK,EAAY,MAAM,QAAQ,CAAC;AACtD,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;AAOpB,eAAO,MAAM,mBAAmB;;gBA0K9B,CAAC"}
|
package/dist/exe-dev/grants.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AttemptId } from "@usine/core/attempt";
|
|
2
2
|
import { RepositoryName } from "@usine/core/repository";
|
|
3
3
|
import { WorkerName } from "@usine/core/worker";
|
|
4
|
-
import { Effect, Ref, Scope } from "effect";
|
|
4
|
+
import { Effect, Ref, Scope, Schedule } from "effect";
|
|
5
5
|
import { CredentialUnavailableError } from "../executor.js";
|
|
6
6
|
import { keyedLockFor } from "../keyed-lock.js";
|
|
7
7
|
import { CredentialGrantMinutes, } from "./model.js";
|
|
8
|
+
const RENEWAL_RETRY_INTERVAL = "1 minute";
|
|
8
9
|
const grantKey = (worker, integration) => `${worker} ${integration}`;
|
|
9
10
|
export const credentialGrantsFor = Effect.fn("ExeDevExecutor.credentialGrantsFor")(function* (options, commands) {
|
|
10
11
|
const locks = yield* keyedLockFor();
|
|
@@ -14,11 +15,18 @@ export const credentialGrantsFor = Effect.fn("ExeDevExecutor.credentialGrantsFor
|
|
|
14
15
|
yield* Effect.annotateCurrentSpan({ attemptId, worker, repository, integration });
|
|
15
16
|
const scope = yield* Effect.scope;
|
|
16
17
|
const key = grantKey(worker, integration);
|
|
18
|
+
const attach = commands.lobby("prepare", [
|
|
19
|
+
"integrations",
|
|
20
|
+
"attach",
|
|
21
|
+
integration,
|
|
22
|
+
`vm:${worker}`,
|
|
23
|
+
"--for",
|
|
24
|
+
`${grantMinutes}m`,
|
|
25
|
+
]);
|
|
17
26
|
yield* locks.withLock(key)(Effect.uninterruptibleMask((restore) => Effect.gen(function* () {
|
|
18
27
|
const current = (yield* Ref.get(counts)).get(key) ?? 0;
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
// by this scope, and never borrows a sibling's reference on interruption.
|
|
28
|
+
// Counts the reference before attaching, because a failed SSH reply can still mean the edge
|
|
29
|
+
// accepted the attachment. This scope's finalizer releases it exactly once.
|
|
22
30
|
yield* Ref.update(counts, (currentCounts) => new Map(currentCounts).set(key, current + 1));
|
|
23
31
|
yield* Scope.addFinalizer(scope, release(attemptId, worker, integration).pipe(Effect.tapError((error) => Effect.logError("Attempt credential cleanup failed", {
|
|
24
32
|
attemptId,
|
|
@@ -27,18 +35,10 @@ export const credentialGrantsFor = Effect.fn("ExeDevExecutor.credentialGrantsFor
|
|
|
27
35
|
integration,
|
|
28
36
|
message: error.message,
|
|
29
37
|
})), Effect.ignore));
|
|
30
|
-
yield* restore(
|
|
31
|
-
.lobby("prepare", [
|
|
32
|
-
"integrations",
|
|
33
|
-
"attach",
|
|
34
|
-
integration,
|
|
35
|
-
`vm:${worker}`,
|
|
36
|
-
"--for",
|
|
37
|
-
`${grantMinutes}m`,
|
|
38
|
-
])
|
|
39
|
-
.pipe(Effect.mapError((cause) => new CredentialUnavailableError({
|
|
38
|
+
yield* restore(attach.pipe(Effect.mapError((cause) => new CredentialUnavailableError({
|
|
40
39
|
repository,
|
|
41
|
-
|
|
40
|
+
reason: "unreachable",
|
|
41
|
+
message: `Can't attach exe.dev GitHub integration "${integration}"`,
|
|
42
42
|
cause,
|
|
43
43
|
}))));
|
|
44
44
|
yield* Effect.logInfo("Attached or refreshed time-boxed exe.dev GitHub integration", {
|
|
@@ -50,6 +50,26 @@ export const credentialGrantsFor = Effect.fn("ExeDevExecutor.credentialGrantsFor
|
|
|
50
50
|
activeGrants: current + 1,
|
|
51
51
|
});
|
|
52
52
|
})));
|
|
53
|
+
// Renews at half the grant length until the scope closes and retries a failed renewal every
|
|
54
|
+
// minute. Finalizers stop this fiber before releasing the reference, after checkout cleanup.
|
|
55
|
+
const renew = Effect.fn("ExeDevExecutor.renewGrant")(function* () {
|
|
56
|
+
yield* Effect.annotateCurrentSpan({ attemptId, worker, repository, integration });
|
|
57
|
+
yield* locks.withLock(key)(attach);
|
|
58
|
+
yield* Effect.logInfo("Renewed exe.dev credential grant", {
|
|
59
|
+
attemptId,
|
|
60
|
+
worker,
|
|
61
|
+
repository,
|
|
62
|
+
integration,
|
|
63
|
+
grantMinutes,
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
yield* Effect.forever(Effect.sleep(`${grantMinutes * 30} seconds`).pipe(Effect.andThen(renew().pipe(Effect.tapError((error) => Effect.logError("Credential grant renewal failed; retrying in one minute", {
|
|
67
|
+
attemptId,
|
|
68
|
+
worker,
|
|
69
|
+
repository,
|
|
70
|
+
integration,
|
|
71
|
+
message: error.message,
|
|
72
|
+
})), Effect.retry(Schedule.spaced(RENEWAL_RETRY_INTERVAL)))), Effect.ignore)).pipe(Effect.forkScoped);
|
|
53
73
|
});
|
|
54
74
|
const release = Effect.fn("ExeDevExecutor.releaseGrant")(function* (attemptId, worker, integration) {
|
|
55
75
|
yield* Effect.annotateCurrentSpan({ attemptId, worker, integration });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grants.js","sourceRoot":"","sources":["../../src/exe-dev/grants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"grants.js","sourceRoot":"","sources":["../../src/exe-dev/grants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EACL,sBAAsB,GAGvB,MAAM,YAAY,CAAC;AAEpB,MAAM,sBAAsB,GAAG,UAAU,CAAC;AAE1C,MAAM,QAAQ,GAAG,CAAC,MAAkB,EAAE,WAA4B,EAAU,EAAE,CAC5E,GAAG,MAAM,IAAI,WAAW,EAAE,CAAC;AAE7B,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,EAAE,CAAC,oCAAoC,CAAC,CAAC,QAAQ,CAAC,EAC1F,OAA8B,EAC9B,QAAwB;IAExB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,YAAY,EAAU,CAAC;IAC5C,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,GAA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AC;YACd,CAAC,CAAC,CACH,CACF,CAAC;YACJ,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,qCAAqC,EAAE;gBAC3D,SAAS;gBACT,MAAM;gBACN,WAAW;aACZ,CAAC,CAAC;QACL,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,OAAO,EAAE,CAAC;AACrB,CAAC,CAAC,CAAC"}
|
package/dist/exe-dev/model.d.ts
CHANGED
|
@@ -1,38 +1,34 @@
|
|
|
1
|
+
import type { SshDestination } from "@usine/core/worker";
|
|
1
2
|
import { Schema, type Effect } from "effect";
|
|
2
|
-
import type {
|
|
3
|
-
/** The name of one exe.dev edge-injected integration. */
|
|
3
|
+
import type { SshCommand } from "@usine/agents/child-host";
|
|
4
4
|
export declare const IntegrationName: Schema.brand<Schema.String, "ExeDevIntegrationName">;
|
|
5
5
|
export type IntegrationName = typeof IntegrationName.Type;
|
|
6
|
-
/**
|
|
7
|
-
* An SSH destination handed to the local `ssh` client as argv, so anything
|
|
8
|
-
* that could read as an option (`-oProxyCommand=...`) is unrepresentable.
|
|
9
|
-
*/
|
|
10
|
-
export declare const SshDestination: Schema.brand<Schema.String, "ExeDevSshDestination">;
|
|
11
|
-
export type SshDestination = typeof SshDestination.Type;
|
|
12
|
-
/** An absolute remote home directory that cannot smuggle bytes past shell quoting. */
|
|
6
|
+
/** An absolute remote home directory path without NUL, CR, or LF bytes. */
|
|
13
7
|
export declare const HomePath: Schema.brand<Schema.String, "ExeDevHomePath">;
|
|
14
8
|
export type HomePath = typeof HomePath.Type;
|
|
15
9
|
declare const GitHubIntegration_base: Schema.Class<GitHubIntegration, Schema.Struct<{
|
|
10
|
+
/** Must be unique across integrations. */
|
|
16
11
|
readonly repository: Schema.brand<Schema.String, "RepositoryName">;
|
|
12
|
+
/**
|
|
13
|
+
* The integration name on exe.dev, unique in the options. Each Attempt attaches it to the
|
|
14
|
+
* Worker's VM for `credentialGrantMinutes`.
|
|
15
|
+
*/
|
|
17
16
|
readonly name: Schema.brand<Schema.String, "ExeDevIntegrationName">;
|
|
18
17
|
}>, {}>;
|
|
19
|
-
/**
|
|
18
|
+
/** An existing exe.dev GitHub integration, attached to the Worker's VM per Attempt. */
|
|
20
19
|
export declare class GitHubIntegration extends GitHubIntegration_base {
|
|
21
20
|
}
|
|
22
|
-
/**
|
|
21
|
+
/** The duration of one credential attachment, in minutes. */
|
|
23
22
|
export declare const CredentialGrantMinutes: Schema.brand<Schema.Int, "ExeDevCredentialGrantMinutes">;
|
|
24
23
|
export type CredentialGrantMinutes = typeof CredentialGrantMinutes.Type;
|
|
25
|
-
/** Repository access and run-host settings for the configured exe.dev Workers. */
|
|
26
24
|
export interface ExeDevExecutorOptions {
|
|
27
|
-
/** Existing
|
|
25
|
+
/** Existing exe.dev GitHub integrations, one per repository. */
|
|
28
26
|
readonly githubIntegrations: ReadonlyArray<GitHubIntegration>;
|
|
29
|
-
/**
|
|
30
|
-
readonly
|
|
31
|
-
/**
|
|
32
|
-
readonly ssh?: RunHostCommand;
|
|
33
|
-
/** Time-box for the edge credential attachment. Defaults to 65 minutes. */
|
|
27
|
+
/** The local SSH command for lobby, VM, and child commands. */
|
|
28
|
+
readonly ssh?: SshCommand;
|
|
29
|
+
/** The length of each credential attachment, in minutes, renewed at half this length. Defaults to 65. */
|
|
34
30
|
readonly credentialGrantMinutes?: CredentialGrantMinutes;
|
|
35
|
-
/**
|
|
31
|
+
/** The timeout for the parent task's cancellation, then separately for the Attempt to finish. Defaults to 10 seconds. */
|
|
36
32
|
readonly interruptGrace?: Parameters<typeof Effect.timeoutOption>[1];
|
|
37
33
|
}
|
|
38
34
|
export interface VmState {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/exe-dev/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,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@@
|
|
|
1
1
|
import { RepositoryName } from "@usine/core/repository";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
-
/** The name of one exe.dev edge-injected integration. */
|
|
4
3
|
export const IntegrationName = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*$/u, {
|
|
5
|
-
message: "Expected an exe.dev integration name
|
|
4
|
+
message: "Expected an exe.dev integration name of letters and digits, separated by single dots, underscores, or hyphens",
|
|
6
5
|
})).pipe(Schema.brand("ExeDevIntegrationName"));
|
|
7
|
-
/**
|
|
8
|
-
* An SSH destination handed to the local `ssh` client as argv, so anything
|
|
9
|
-
* that could read as an option (`-oProxyCommand=...`) is unrepresentable.
|
|
10
|
-
*/
|
|
11
|
-
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, {
|
|
12
|
-
message: "Expected an exe.dev SSH hostname, optionally prefixed by a user",
|
|
13
|
-
})).pipe(Schema.brand("ExeDevSshDestination"));
|
|
14
|
-
/** An absolute remote home directory that cannot smuggle bytes past shell quoting. */
|
|
6
|
+
/** An absolute remote home directory path without NUL, CR, or LF bytes. */
|
|
15
7
|
export const HomePath = Schema.String.check(Schema.isPattern(/^\/[^\0\r\n]*$/u, {
|
|
16
8
|
message: "Expected an absolute remote home directory without control bytes",
|
|
17
9
|
})).pipe(Schema.brand("ExeDevHomePath"));
|
|
18
|
-
/**
|
|
10
|
+
/** An existing exe.dev GitHub integration, attached to the Worker's VM per Attempt. */
|
|
19
11
|
export class GitHubIntegration extends Schema.Class("@usine/executor/ExeDevGitHubIntegration")({
|
|
12
|
+
/** Must be unique across integrations. */
|
|
20
13
|
repository: RepositoryName,
|
|
14
|
+
/**
|
|
15
|
+
* The integration name on exe.dev, unique in the options. Each Attempt attaches it to the
|
|
16
|
+
* Worker's VM for `credentialGrantMinutes`.
|
|
17
|
+
*/
|
|
21
18
|
name: IntegrationName,
|
|
22
19
|
}) {
|
|
23
20
|
}
|
|
24
|
-
/**
|
|
21
|
+
/** The duration of one credential attachment, in minutes. */
|
|
25
22
|
export const CredentialGrantMinutes = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).pipe(Schema.brand("ExeDevCredentialGrantMinutes"));
|
|
26
23
|
//# sourceMappingURL=model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/exe-dev/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/exe-dev/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAC;AAG7C,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAChD,MAAM,CAAC,SAAS,CAAC,uCAAuC,EAAE;IACxD,OAAO,EACL,+GAA+G;CAClH,CAAC,CACH,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC;AAG9C,2EAA2E;AAC3E,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CACzC,MAAM,CAAC,SAAS,CAAC,iBAAiB,EAAE;IAClC,OAAO,EAAE,kEAAkE;CAC5E,CAAC,CACH,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAGvC,uFAAuF;AACvF,MAAM,OAAO,iBAAkB,SAAQ,MAAM,CAAC,KAAK,CACjD,yCAAyC,CAC1C,CAAC;IACA,0CAA0C;IAC1C,UAAU,EAAE,cAAc;IAC1B;;;OAGG;IACH,IAAI,EAAE,eAAe;CACtB,CAAC;CAAG;AAEL,6DAA6D;AAC7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAC3F,MAAM,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAC7C,CAAC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import type { RemoteShell } from "@usine/agents/child-host";
|
|
2
|
+
import { ClaudeLoginLock } from "@usine/agents/runtime";
|
|
1
3
|
import type { BrainSpec } from "@usine/core/agent/brain";
|
|
2
4
|
import { Effect } from "effect";
|
|
3
|
-
import {
|
|
5
|
+
import { ChildProcessSpawner } from "effect/unstable/process";
|
|
6
|
+
import { ExecutorOperationError, WorkerCapabilityError } from "../executor.ts";
|
|
4
7
|
import type { ExeDevCommands } from "./commands.ts";
|
|
5
8
|
import { type ExeDevExecutorOptions, type VmState } from "./model.ts";
|
|
6
|
-
export declare const preflightFor: (options: ExeDevExecutorOptions, commands: ExeDevCommands
|
|
7
|
-
preflight: (worker: string & import("effect/Brand").Brand<"WorkerName">, brains: readonly BrainSpec[]) => Effect.Effect<undefined, import("../executor.ts").CredentialUnavailableError | ExecutorOperationError | WorkerCapabilityError, never>;
|
|
9
|
+
export declare const preflightFor: (options: ExeDevExecutorOptions, commands: ExeDevCommands) => Effect.Effect<{
|
|
10
|
+
preflight: (worker: string & import("effect/Brand").Brand<"WorkerName">, brains: readonly BrainSpec[], maxConcurrentAttempts: number) => Effect.Effect<undefined, import("../executor.ts").CredentialUnavailableError | ExecutorOperationError | WorkerCapabilityError, never>;
|
|
8
11
|
vmFor: (worker: string & import("effect/Brand").Brand<"WorkerName">) => Effect.Effect<VmState, ExecutorOperationError | WorkerCapabilityError, never>;
|
|
9
|
-
|
|
12
|
+
harnessProbe: (shell: RemoteShell) => import("../harness-preflight.ts").HarnessProbe;
|
|
13
|
+
}, never, ChildProcessSpawner.ChildProcessSpawner | ClaudeLoginLock>;
|
|
10
14
|
//# sourceMappingURL=preflight.d.ts.map
|