lorenz 0.1.5 → 0.1.6
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 +83 -20
- package/RELEASE-MANIFEST.json +6 -1
- package/node_modules/@lorenz/agent-sdk/dist/index.d.ts +1 -0
- package/node_modules/@lorenz/agent-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/agent-sdk/dist/index.js +1 -0
- package/node_modules/@lorenz/agent-sdk/dist/index.js.map +1 -1
- package/node_modules/@lorenz/agent-sdk/dist/module.d.ts +38 -0
- package/node_modules/@lorenz/agent-sdk/dist/module.d.ts.map +1 -0
- package/node_modules/@lorenz/agent-sdk/dist/module.js +41 -0
- package/node_modules/@lorenz/agent-sdk/dist/module.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/agentExecutorLoader.d.ts +30 -0
- package/node_modules/@lorenz/cli/dist/agentExecutorLoader.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/agentExecutorLoader.js +63 -0
- package/node_modules/@lorenz/cli/dist/agentExecutorLoader.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/daemon.d.ts +42 -19
- package/node_modules/@lorenz/cli/dist/daemon.d.ts.map +1 -1
- package/node_modules/@lorenz/cli/dist/daemon.js +72 -23
- package/node_modules/@lorenz/cli/dist/daemon.js.map +1 -1
- package/node_modules/@lorenz/cli/dist/daemonLock.d.ts +59 -0
- package/node_modules/@lorenz/cli/dist/daemonLock.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/daemonLock.js +304 -0
- package/node_modules/@lorenz/cli/dist/daemonLock.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/daemonStatus.d.ts +16 -0
- package/node_modules/@lorenz/cli/dist/daemonStatus.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/daemonStatus.js +21 -0
- package/node_modules/@lorenz/cli/dist/daemonStatus.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/doctor.d.ts +6 -0
- package/node_modules/@lorenz/cli/dist/doctor.d.ts.map +1 -1
- package/node_modules/@lorenz/cli/dist/doctor.js +38 -1
- package/node_modules/@lorenz/cli/dist/doctor.js.map +1 -1
- package/node_modules/@lorenz/cli/dist/extensionLoader.d.ts +126 -0
- package/node_modules/@lorenz/cli/dist/extensionLoader.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/extensionLoader.js +187 -0
- package/node_modules/@lorenz/cli/dist/extensionLoader.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/flags-manifest.d.ts +42 -0
- package/node_modules/@lorenz/cli/dist/flags-manifest.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/flags-manifest.js +67 -0
- package/node_modules/@lorenz/cli/dist/flags-manifest.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/index.d.ts +6 -0
- package/node_modules/@lorenz/cli/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/cli/dist/index.js +4 -0
- package/node_modules/@lorenz/cli/dist/index.js.map +1 -1
- package/node_modules/@lorenz/cli/dist/leadershipStore.d.ts +42 -0
- package/node_modules/@lorenz/cli/dist/leadershipStore.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/leadershipStore.js +2 -0
- package/node_modules/@lorenz/cli/dist/leadershipStore.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/main.d.ts +11 -7
- package/node_modules/@lorenz/cli/dist/main.d.ts.map +1 -1
- package/node_modules/@lorenz/cli/dist/main.js +58 -8
- package/node_modules/@lorenz/cli/dist/main.js.map +1 -1
- package/node_modules/@lorenz/cli/dist/toolLoader.d.ts +28 -0
- package/node_modules/@lorenz/cli/dist/toolLoader.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/toolLoader.js +62 -0
- package/node_modules/@lorenz/cli/dist/toolLoader.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/trackerLoader.d.ts +24 -0
- package/node_modules/@lorenz/cli/dist/trackerLoader.d.ts.map +1 -0
- package/node_modules/@lorenz/cli/dist/trackerLoader.js +34 -0
- package/node_modules/@lorenz/cli/dist/trackerLoader.js.map +1 -0
- package/node_modules/@lorenz/cli/dist/workerDriverLoader.d.ts +15 -55
- package/node_modules/@lorenz/cli/dist/workerDriverLoader.d.ts.map +1 -1
- package/node_modules/@lorenz/cli/dist/workerDriverLoader.js +26 -203
- package/node_modules/@lorenz/cli/dist/workerDriverLoader.js.map +1 -1
- package/node_modules/@lorenz/cli/package.json +1 -0
- package/node_modules/@lorenz/config/dist/index.d.ts +1 -1
- package/node_modules/@lorenz/config/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/config/dist/index.js +1 -1
- package/node_modules/@lorenz/config/dist/index.js.map +1 -1
- package/node_modules/@lorenz/config/dist/parse.d.ts +17 -0
- package/node_modules/@lorenz/config/dist/parse.d.ts.map +1 -1
- package/node_modules/@lorenz/config/dist/parse.js +107 -11
- package/node_modules/@lorenz/config/dist/parse.js.map +1 -1
- package/node_modules/@lorenz/config/dist/schemas.d.ts +0 -2
- package/node_modules/@lorenz/config/dist/schemas.d.ts.map +1 -1
- package/node_modules/@lorenz/config/dist/schemas.js +5 -1
- package/node_modules/@lorenz/config/dist/schemas.js.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/coordinator.d.ts +55 -21
- package/node_modules/@lorenz/dispatch-coordinator/dist/coordinator.d.ts.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/coordinator.js +187 -82
- package/node_modules/@lorenz/dispatch-coordinator/dist/coordinator.js.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/gate.d.ts +6 -4
- package/node_modules/@lorenz/dispatch-coordinator/dist/gate.d.ts.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/gate.js +9 -6
- package/node_modules/@lorenz/dispatch-coordinator/dist/gate.js.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/index.d.ts +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/index.js +5 -6
- package/node_modules/@lorenz/dispatch-coordinator/dist/index.js.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/mcpEndpointManager.d.ts +7 -5
- package/node_modules/@lorenz/dispatch-coordinator/dist/mcpEndpointManager.d.ts.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/mcpEndpointManager.js +12 -10
- package/node_modules/@lorenz/dispatch-coordinator/dist/mcpEndpointManager.js.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/nullEndpointManager.d.ts +11 -10
- package/node_modules/@lorenz/dispatch-coordinator/dist/nullEndpointManager.d.ts.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/nullEndpointManager.js +15 -22
- package/node_modules/@lorenz/dispatch-coordinator/dist/nullEndpointManager.js.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/types.d.ts +16 -15
- package/node_modules/@lorenz/dispatch-coordinator/dist/types.d.ts.map +1 -1
- package/node_modules/@lorenz/dispatch-coordinator/dist/types.js +6 -7
- package/node_modules/@lorenz/dispatch-coordinator/dist/types.js.map +1 -1
- package/node_modules/@lorenz/domain/dist/index.d.ts +75 -9
- package/node_modules/@lorenz/domain/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/domain/dist/index.js +40 -0
- package/node_modules/@lorenz/domain/dist/index.js.map +1 -1
- package/node_modules/@lorenz/flags/dist/coerce.d.ts +12 -0
- package/node_modules/@lorenz/flags/dist/coerce.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/coerce.js +44 -0
- package/node_modules/@lorenz/flags/dist/coerce.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/default.d.ts +6 -0
- package/node_modules/@lorenz/flags/dist/default.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/default.js +22 -0
- package/node_modules/@lorenz/flags/dist/default.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/deprecations.d.ts +20 -0
- package/node_modules/@lorenz/flags/dist/deprecations.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/deprecations.js +42 -0
- package/node_modules/@lorenz/flags/dist/deprecations.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/env.d.ts +17 -0
- package/node_modules/@lorenz/flags/dist/env.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/env.js +90 -0
- package/node_modules/@lorenz/flags/dist/env.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/errors.d.ts +22 -0
- package/node_modules/@lorenz/flags/dist/errors.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/errors.js +61 -0
- package/node_modules/@lorenz/flags/dist/errors.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/index.d.ts +8 -0
- package/node_modules/@lorenz/flags/dist/index.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/index.js +11 -0
- package/node_modules/@lorenz/flags/dist/index.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/keys.d.ts +6 -0
- package/node_modules/@lorenz/flags/dist/keys.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/keys.js +15 -0
- package/node_modules/@lorenz/flags/dist/keys.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/layers.d.ts +14 -0
- package/node_modules/@lorenz/flags/dist/layers.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/layers.js +107 -0
- package/node_modules/@lorenz/flags/dist/layers.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/manifest.d.ts +71 -0
- package/node_modules/@lorenz/flags/dist/manifest.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/manifest.js +137 -0
- package/node_modules/@lorenz/flags/dist/manifest.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/resolve.d.ts +8 -0
- package/node_modules/@lorenz/flags/dist/resolve.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/resolve.js +178 -0
- package/node_modules/@lorenz/flags/dist/resolve.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/testing.d.ts +19 -0
- package/node_modules/@lorenz/flags/dist/testing.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/testing.js +68 -0
- package/node_modules/@lorenz/flags/dist/testing.js.map +1 -0
- package/node_modules/@lorenz/flags/dist/types.d.ts +93 -0
- package/node_modules/@lorenz/flags/dist/types.d.ts.map +1 -0
- package/node_modules/@lorenz/flags/dist/types.js +2 -0
- package/node_modules/@lorenz/flags/dist/types.js.map +1 -0
- package/node_modules/@lorenz/flags/package.json +16 -0
- package/node_modules/@lorenz/mcp/dist/agentEndpoint.d.ts +16 -3
- package/node_modules/@lorenz/mcp/dist/agentEndpoint.d.ts.map +1 -1
- package/node_modules/@lorenz/mcp/dist/agentEndpoint.js +105 -17
- package/node_modules/@lorenz/mcp/dist/agentEndpoint.js.map +1 -1
- package/node_modules/@lorenz/mcp/dist/auth.d.ts +88 -0
- package/node_modules/@lorenz/mcp/dist/auth.d.ts.map +1 -1
- package/node_modules/@lorenz/mcp/dist/auth.js +53 -0
- package/node_modules/@lorenz/mcp/dist/auth.js.map +1 -1
- package/node_modules/@lorenz/mcp/dist/index.d.ts +3 -2
- package/node_modules/@lorenz/mcp/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/mcp/dist/index.js +1 -1
- package/node_modules/@lorenz/mcp/dist/index.js.map +1 -1
- package/node_modules/@lorenz/mcp/dist/server.d.ts +22 -0
- package/node_modules/@lorenz/mcp/dist/server.d.ts.map +1 -1
- package/node_modules/@lorenz/mcp/dist/server.js +85 -12
- package/node_modules/@lorenz/mcp/dist/server.js.map +1 -1
- package/node_modules/@lorenz/orchestrator/dist/claimStore.d.ts +157 -0
- package/node_modules/@lorenz/orchestrator/dist/claimStore.d.ts.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/claimStore.js +621 -0
- package/node_modules/@lorenz/orchestrator/dist/claimStore.js.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/codec.d.ts +38 -0
- package/node_modules/@lorenz/orchestrator/dist/codec.d.ts.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/codec.js +176 -0
- package/node_modules/@lorenz/orchestrator/dist/codec.js.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/index.d.ts +55 -51
- package/node_modules/@lorenz/orchestrator/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/orchestrator/dist/index.js +285 -45
- package/node_modules/@lorenz/orchestrator/dist/index.js.map +1 -1
- package/node_modules/@lorenz/orchestrator/dist/sqlite.d.ts +34 -0
- package/node_modules/@lorenz/orchestrator/dist/sqlite.d.ts.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/sqlite.js +142 -0
- package/node_modules/@lorenz/orchestrator/dist/sqlite.js.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/state.d.ts +47 -0
- package/node_modules/@lorenz/orchestrator/dist/state.d.ts.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/state.js +15 -0
- package/node_modules/@lorenz/orchestrator/dist/state.js.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/turso.d.ts +28 -0
- package/node_modules/@lorenz/orchestrator/dist/turso.d.ts.map +1 -0
- package/node_modules/@lorenz/orchestrator/dist/turso.js +125 -0
- package/node_modules/@lorenz/orchestrator/dist/turso.js.map +1 -0
- package/node_modules/@lorenz/orchestrator/package.json +6 -2
- package/node_modules/@lorenz/presenter/dist/index.d.ts +14 -0
- package/node_modules/@lorenz/presenter/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/presenter/dist/index.js +18 -0
- package/node_modules/@lorenz/presenter/dist/index.js.map +1 -1
- package/node_modules/@lorenz/projections/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/projections/dist/index.js +1 -0
- package/node_modules/@lorenz/projections/dist/index.js.map +1 -1
- package/node_modules/@lorenz/runtime/dist/index.d.ts +27 -8
- package/node_modules/@lorenz/runtime/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/runtime/dist/index.js +422 -98
- package/node_modules/@lorenz/runtime/dist/index.js.map +1 -1
- package/node_modules/@lorenz/runtime-events/dist/index.d.ts +14 -0
- package/node_modules/@lorenz/runtime-events/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/ssh/dist/index.d.ts +2 -0
- package/node_modules/@lorenz/ssh/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/ssh/dist/index.js +2 -1
- package/node_modules/@lorenz/ssh/dist/index.js.map +1 -1
- package/node_modules/@lorenz/tool-sdk/dist/index.d.ts +1 -0
- package/node_modules/@lorenz/tool-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/tool-sdk/dist/index.js +1 -0
- package/node_modules/@lorenz/tool-sdk/dist/index.js.map +1 -1
- package/node_modules/@lorenz/tool-sdk/dist/module.d.ts +38 -0
- package/node_modules/@lorenz/tool-sdk/dist/module.d.ts.map +1 -0
- package/node_modules/@lorenz/tool-sdk/dist/module.js +42 -0
- package/node_modules/@lorenz/tool-sdk/dist/module.js.map +1 -0
- package/node_modules/@lorenz/tracker-sdk/dist/index.d.ts +1 -0
- package/node_modules/@lorenz/tracker-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/tracker-sdk/dist/index.js +1 -0
- package/node_modules/@lorenz/tracker-sdk/dist/index.js.map +1 -1
- package/node_modules/@lorenz/tracker-sdk/dist/module.d.ts +37 -0
- package/node_modules/@lorenz/tracker-sdk/dist/module.d.ts.map +1 -0
- package/node_modules/@lorenz/tracker-sdk/dist/module.js +38 -0
- package/node_modules/@lorenz/tracker-sdk/dist/module.js.map +1 -0
- package/node_modules/@lorenz/worker-host-pool/dist/index.d.ts +34 -6
- package/node_modules/@lorenz/worker-host-pool/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/worker-host-pool/dist/index.js +110 -143
- package/node_modules/@lorenz/worker-host-pool/dist/index.js.map +1 -1
- package/node_modules/@lorenz/worker-sdk/dist/index.d.ts +1 -0
- package/node_modules/@lorenz/worker-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/worker-sdk/dist/index.js +1 -0
- package/node_modules/@lorenz/worker-sdk/dist/index.js.map +1 -1
- package/node_modules/@lorenz/worker-sdk/dist/local.d.ts +74 -0
- package/node_modules/@lorenz/worker-sdk/dist/local.d.ts.map +1 -0
- package/node_modules/@lorenz/worker-sdk/dist/local.js +112 -0
- package/node_modules/@lorenz/worker-sdk/dist/local.js.map +1 -0
- package/node_modules/@lorenz/worker-sdk/dist/module.d.ts +8 -16
- package/node_modules/@lorenz/worker-sdk/dist/module.d.ts.map +1 -1
- package/node_modules/@lorenz/worker-sdk/dist/module.js +15 -35
- package/node_modules/@lorenz/worker-sdk/dist/module.js.map +1 -1
- package/node_modules/@lorenz/workflow/dist/index.d.ts +11 -0
- package/node_modules/@lorenz/workflow/dist/index.d.ts.map +1 -1
- package/node_modules/@lorenz/workflow/dist/index.js +3 -0
- package/node_modules/@lorenz/workflow/dist/index.js.map +1 -1
- package/package.json +4 -1
|
@@ -9,16 +9,44 @@ export declare class WorkerHostPool {
|
|
|
9
9
|
private readonly availableRemoteMcpPorts;
|
|
10
10
|
private readonly remoteMcpTunnelsByEndpoint;
|
|
11
11
|
private readonly remoteMcpTunnelEntriesByLeaseId;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Monotonic generation per host:port tunnel slot, surviving entry teardown so
|
|
14
|
+
* a recreated entry gets a STRICTLY higher generation than the one it
|
|
15
|
+
* replaces. A `closeForRun` recorded against a prior generation is rejected.
|
|
16
|
+
*/
|
|
17
|
+
private readonly remoteMcpTunnelGenerations;
|
|
18
|
+
/**
|
|
19
|
+
* Per-run holds on the SHARED per-host tunnels, keyed by `${workerHost}#${runKey}`.
|
|
20
|
+
* Each entry records which leaseId (and which generation) a run holds so
|
|
21
|
+
* `closeForRun` drops exactly that run's refcount - opening the tunnel on the
|
|
22
|
+
* first co-resident run and closing it at the last deref.
|
|
23
|
+
*/
|
|
24
|
+
private readonly perRunTunnelHolds;
|
|
13
25
|
acquireRemoteMcpTunnel(workerHost: string, localHost: string, localPort: number): Promise<RemoteMcpTunnelLease>;
|
|
14
26
|
releaseRemoteMcpTunnel(lease: RemoteMcpTunnelLease): void;
|
|
27
|
+
/**
|
|
28
|
+
* Acquire a hold on the per-HOST reverse tunnel for one run. Co-resident runs
|
|
29
|
+
* on the SAME host share ONE `ssh -R` tunnel (opened on the first run, closed
|
|
30
|
+
* at the last `closeForRun`); they are kept apart by their per-run Token B
|
|
31
|
+
* claim, not by a distinct remote port. The generation captured here is what a
|
|
32
|
+
* later `closeForRun` is CAS-checked against, so a host:port recycle that bumps
|
|
33
|
+
* the slot's generation strands a stale late-close instead of decrementing the
|
|
34
|
+
* fresh entry.
|
|
35
|
+
*/
|
|
15
36
|
openForRun(workerHost: string, runKey: string, localHost: string, localPort: number): Promise<RemoteMcpTunnelLease>;
|
|
16
37
|
closeForRun(workerHost: string, runKey: string): void;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Drop one run's hold on its shared per-host tunnel. CAS late-close reject: if
|
|
40
|
+
* the live entry for the hold's endpoint has a STRICTLY higher generation than
|
|
41
|
+
* the hold recorded, the slot was recycled and a fresh owner holds the live
|
|
42
|
+
* ref - this stale release must NOT decrement the new entry's refcount. The
|
|
43
|
+
* hold's own leaseId either still maps to the original (same-generation) entry
|
|
44
|
+
* or was already cleared on that entry's teardown, so dropping it is otherwise
|
|
45
|
+
* idempotent.
|
|
46
|
+
*/
|
|
47
|
+
private releasePerRunHold;
|
|
48
|
+
private ensureRemoteMcpTunnelEntry;
|
|
49
|
+
private dropRemoteMcpTunnelLease;
|
|
22
50
|
private closeRemoteMcpTunnel;
|
|
23
51
|
private handleRemoteMcpTunnelProcessEnd;
|
|
24
52
|
private waitForRemoteMcpTunnelReady;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,OAAO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AAC,mCAAmC;IA+B3C,OAAO,CAAC,yBAAyB;IAMjC,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,0BAA0B;IAYlC,OAAO,CAAC,0BAA0B;CAOnC;AAMD,eAAO,MAAM,cAAc,gBAAuB,CAAC"}
|
|
@@ -5,49 +5,22 @@ export class WorkerHostPool {
|
|
|
5
5
|
availableRemoteMcpPorts = [];
|
|
6
6
|
remoteMcpTunnelsByEndpoint = new Map();
|
|
7
7
|
remoteMcpTunnelEntriesByLeaseId = new Map();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Monotonic generation per host:port tunnel slot, surviving entry teardown so
|
|
10
|
+
* a recreated entry gets a STRICTLY higher generation than the one it
|
|
11
|
+
* replaces. A `closeForRun` recorded against a prior generation is rejected.
|
|
12
|
+
*/
|
|
13
|
+
remoteMcpTunnelGenerations = new Map();
|
|
14
|
+
/**
|
|
15
|
+
* Per-run holds on the SHARED per-host tunnels, keyed by `${workerHost}#${runKey}`.
|
|
16
|
+
* Each entry records which leaseId (and which generation) a run holds so
|
|
17
|
+
* `closeForRun` drops exactly that run's refcount - opening the tunnel on the
|
|
18
|
+
* first co-resident run and closing it at the last deref.
|
|
19
|
+
*/
|
|
20
|
+
perRunTunnelHolds = new Map();
|
|
12
21
|
async acquireRemoteMcpTunnel(workerHost, localHost, localPort) {
|
|
13
22
|
const endpointKey = this.remoteMcpTunnelEndpointKey(workerHost, localHost, localPort);
|
|
14
|
-
const
|
|
15
|
-
if (current && !current.processEnded) {
|
|
16
|
-
await this.waitForRemoteMcpTunnelReady(current);
|
|
17
|
-
return this.createRemoteMcpTunnelLease(current);
|
|
18
|
-
}
|
|
19
|
-
if (current)
|
|
20
|
-
this.closeRemoteMcpTunnel(current, true);
|
|
21
|
-
const recycledPort = this.availableRemoteMcpPorts.shift();
|
|
22
|
-
const remotePort = recycledPort ?? this.nextRemoteMcpPort;
|
|
23
|
-
let process;
|
|
24
|
-
try {
|
|
25
|
-
process = startReverseTunnel(workerHost, remotePort, localHost, localPort);
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
if (recycledPort !== undefined)
|
|
29
|
-
this.recycleRemoteMcpPort(recycledPort);
|
|
30
|
-
throw error;
|
|
31
|
-
}
|
|
32
|
-
if (recycledPort === undefined)
|
|
33
|
-
this.nextRemoteMcpPort += 1;
|
|
34
|
-
const entry = {
|
|
35
|
-
workerHost,
|
|
36
|
-
localHost,
|
|
37
|
-
localPort,
|
|
38
|
-
process,
|
|
39
|
-
leaseIds: new Set(),
|
|
40
|
-
readyPromise: Promise.resolve(),
|
|
41
|
-
remotePort,
|
|
42
|
-
processEnded: false,
|
|
43
|
-
recyclePortOnProcessEnd: false,
|
|
44
|
-
};
|
|
45
|
-
this.remoteMcpTunnelsByEndpoint.set(endpointKey, entry);
|
|
46
|
-
process.on("close", () => this.handleRemoteMcpTunnelProcessEnd(entry, endpointKey));
|
|
47
|
-
process.on("exit", () => this.handleRemoteMcpTunnelProcessEnd(entry, endpointKey));
|
|
48
|
-
process.on("error", () => this.handleRemoteMcpTunnelProcessEnd(entry, endpointKey));
|
|
49
|
-
entry.readyPromise = this.confirmRemoteMcpTunnelReady(entry);
|
|
50
|
-
await this.waitForRemoteMcpTunnelReady(entry);
|
|
23
|
+
const entry = await this.ensureRemoteMcpTunnelEntry(workerHost, localHost, localPort, endpointKey);
|
|
51
24
|
return this.createRemoteMcpTunnelLease(entry);
|
|
52
25
|
}
|
|
53
26
|
releaseRemoteMcpTunnel(lease) {
|
|
@@ -57,26 +30,89 @@ export class WorkerHostPool {
|
|
|
57
30
|
if (entry.workerHost !== lease.workerHost || entry.remotePort !== lease.remotePort) {
|
|
58
31
|
return;
|
|
59
32
|
}
|
|
60
|
-
this.
|
|
61
|
-
entry.leaseIds.delete(lease.leaseId);
|
|
62
|
-
if (entry.leaseIds.size > 0)
|
|
63
|
-
return;
|
|
64
|
-
this.closeRemoteMcpTunnel(entry, true);
|
|
33
|
+
this.dropRemoteMcpTunnelLease(entry, lease.leaseId);
|
|
65
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Acquire a hold on the per-HOST reverse tunnel for one run. Co-resident runs
|
|
37
|
+
* on the SAME host share ONE `ssh -R` tunnel (opened on the first run, closed
|
|
38
|
+
* at the last `closeForRun`); they are kept apart by their per-run Token B
|
|
39
|
+
* claim, not by a distinct remote port. The generation captured here is what a
|
|
40
|
+
* later `closeForRun` is CAS-checked against, so a host:port recycle that bumps
|
|
41
|
+
* the slot's generation strands a stale late-close instead of decrementing the
|
|
42
|
+
* fresh entry.
|
|
43
|
+
*/
|
|
66
44
|
async openForRun(workerHost, runKey, localHost, localPort) {
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
45
|
+
const holdKey = perRunKey(workerHost, runKey);
|
|
46
|
+
const endpointKey = this.remoteMcpTunnelEndpointKey(workerHost, localHost, localPort);
|
|
47
|
+
// Re-opening the SAME run (e.g. resume) reuses its existing hold when the
|
|
48
|
+
// shared host entry is still live - no second refcount/lease for one run.
|
|
49
|
+
const existingHold = this.perRunTunnelHolds.get(holdKey);
|
|
50
|
+
if (existingHold) {
|
|
51
|
+
const heldEntry = this.remoteMcpTunnelEntriesByLeaseId.get(existingHold.leaseId);
|
|
52
|
+
if (heldEntry &&
|
|
53
|
+
!heldEntry.processEnded &&
|
|
54
|
+
heldEntry.localHost === localHost &&
|
|
55
|
+
heldEntry.localPort === localPort) {
|
|
56
|
+
await this.waitForRemoteMcpTunnelReady(heldEntry);
|
|
57
|
+
return {
|
|
58
|
+
leaseId: existingHold.leaseId,
|
|
59
|
+
workerHost: heldEntry.workerHost,
|
|
60
|
+
remotePort: heldEntry.remotePort,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
// The run's prior hold is stale (entry torn down or the local endpoint
|
|
64
|
+
// moved): drop it and take a fresh hold on the current shared entry.
|
|
65
|
+
this.releasePerRunHold(holdKey);
|
|
66
|
+
}
|
|
67
|
+
const entry = await this.ensureRemoteMcpTunnelEntry(workerHost, localHost, localPort, endpointKey);
|
|
68
|
+
const lease = this.createRemoteMcpTunnelLease(entry);
|
|
69
|
+
this.perRunTunnelHolds.set(holdKey, {
|
|
70
|
+
leaseId: lease.leaseId,
|
|
71
|
+
endpointKey,
|
|
72
|
+
generation: entry.generation,
|
|
73
|
+
});
|
|
74
|
+
return lease;
|
|
75
|
+
}
|
|
76
|
+
closeForRun(workerHost, runKey) {
|
|
77
|
+
this.releasePerRunHold(perRunKey(workerHost, runKey));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Drop one run's hold on its shared per-host tunnel. CAS late-close reject: if
|
|
81
|
+
* the live entry for the hold's endpoint has a STRICTLY higher generation than
|
|
82
|
+
* the hold recorded, the slot was recycled and a fresh owner holds the live
|
|
83
|
+
* ref - this stale release must NOT decrement the new entry's refcount. The
|
|
84
|
+
* hold's own leaseId either still maps to the original (same-generation) entry
|
|
85
|
+
* or was already cleared on that entry's teardown, so dropping it is otherwise
|
|
86
|
+
* idempotent.
|
|
87
|
+
*/
|
|
88
|
+
releasePerRunHold(holdKey) {
|
|
89
|
+
const hold = this.perRunTunnelHolds.get(holdKey);
|
|
90
|
+
if (!hold)
|
|
91
|
+
return;
|
|
92
|
+
this.perRunTunnelHolds.delete(holdKey);
|
|
93
|
+
const liveGeneration = this.remoteMcpTunnelGenerations.get(hold.endpointKey);
|
|
94
|
+
if (liveGeneration !== undefined && hold.generation < liveGeneration) {
|
|
95
|
+
// Stale late-close against a recycled slot: never touch the live entry.
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const entry = this.remoteMcpTunnelEntriesByLeaseId.get(hold.leaseId);
|
|
99
|
+
if (!entry)
|
|
100
|
+
return;
|
|
101
|
+
this.dropRemoteMcpTunnelLease(entry, hold.leaseId);
|
|
102
|
+
}
|
|
103
|
+
// Reuse-or-open a host-keyed reverse tunnel entry. A live entry for this
|
|
104
|
+
// host:port is shared (refcounted by leases); a torn-down one is replaced by a
|
|
105
|
+
// fresh entry whose generation is STRICTLY higher than the slot's last value.
|
|
106
|
+
async ensureRemoteMcpTunnelEntry(workerHost, localHost, localPort, endpointKey) {
|
|
107
|
+
const current = this.remoteMcpTunnelsByEndpoint.get(endpointKey);
|
|
108
|
+
if (current && !current.processEnded) {
|
|
73
109
|
await this.waitForRemoteMcpTunnelReady(current);
|
|
74
|
-
return
|
|
110
|
+
return current;
|
|
75
111
|
}
|
|
76
112
|
if (current)
|
|
77
|
-
this.
|
|
78
|
-
const
|
|
79
|
-
const
|
|
113
|
+
this.closeRemoteMcpTunnel(current, true);
|
|
114
|
+
const recycledPort = this.availableRemoteMcpPorts.shift();
|
|
115
|
+
const remotePort = recycledPort ?? this.nextRemoteMcpPort;
|
|
80
116
|
let process;
|
|
81
117
|
try {
|
|
82
118
|
process = startReverseTunnel(workerHost, remotePort, localHost, localPort);
|
|
@@ -88,6 +124,12 @@ export class WorkerHostPool {
|
|
|
88
124
|
}
|
|
89
125
|
if (recycledPort === undefined)
|
|
90
126
|
this.nextRemoteMcpPort += 1;
|
|
127
|
+
// Bump the slot's generation when a brand-new entry replaces a torn-down
|
|
128
|
+
// one. The first entry for a host:port gets generation 1; each recycle is
|
|
129
|
+
// strictly higher, so a per-run hold recorded against the prior generation
|
|
130
|
+
// is fenced out of the new entry's refcount.
|
|
131
|
+
const generation = (this.remoteMcpTunnelGenerations.get(endpointKey) ?? 0) + 1;
|
|
132
|
+
this.remoteMcpTunnelGenerations.set(endpointKey, generation);
|
|
91
133
|
const entry = {
|
|
92
134
|
workerHost,
|
|
93
135
|
localHost,
|
|
@@ -98,99 +140,24 @@ export class WorkerHostPool {
|
|
|
98
140
|
remotePort,
|
|
99
141
|
processEnded: false,
|
|
100
142
|
recyclePortOnProcessEnd: false,
|
|
143
|
+
generation,
|
|
101
144
|
};
|
|
102
|
-
this.
|
|
103
|
-
process.on("close", () => this.
|
|
104
|
-
process.on("exit", () => this.
|
|
105
|
-
process.on("error", () => this.
|
|
106
|
-
entry.readyPromise = this.
|
|
145
|
+
this.remoteMcpTunnelsByEndpoint.set(endpointKey, entry);
|
|
146
|
+
process.on("close", () => this.handleRemoteMcpTunnelProcessEnd(entry, endpointKey));
|
|
147
|
+
process.on("exit", () => this.handleRemoteMcpTunnelProcessEnd(entry, endpointKey));
|
|
148
|
+
process.on("error", () => this.handleRemoteMcpTunnelProcessEnd(entry, endpointKey));
|
|
149
|
+
entry.readyPromise = this.confirmRemoteMcpTunnelReady(entry);
|
|
107
150
|
await this.waitForRemoteMcpTunnelReady(entry);
|
|
108
|
-
return
|
|
151
|
+
return entry;
|
|
109
152
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const entry = this.perRunMcpTunnels.get(key);
|
|
113
|
-
if (!entry)
|
|
153
|
+
dropRemoteMcpTunnelLease(entry, leaseId) {
|
|
154
|
+
if (!entry.leaseIds.has(leaseId))
|
|
114
155
|
return;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const [leaseId] = entry.leaseIds;
|
|
118
|
-
if (leaseId !== undefined) {
|
|
119
|
-
entry.leaseIds.delete(leaseId);
|
|
120
|
-
this.remoteMcpTunnelEntriesByLeaseId.delete(leaseId);
|
|
121
|
-
}
|
|
156
|
+
this.remoteMcpTunnelEntriesByLeaseId.delete(leaseId);
|
|
157
|
+
entry.leaseIds.delete(leaseId);
|
|
122
158
|
if (entry.leaseIds.size > 0)
|
|
123
159
|
return;
|
|
124
|
-
this.
|
|
125
|
-
}
|
|
126
|
-
// Allocate a remote port, reusing a recycled candidate only when no live
|
|
127
|
-
// entry (host-keyed OR per-run) still holds it. This guards the
|
|
128
|
-
// recycled-port-vs-stale-entry interaction under N concurrent live ports.
|
|
129
|
-
allocateRemoteMcpPort() {
|
|
130
|
-
while (this.availableRemoteMcpPorts.length > 0) {
|
|
131
|
-
const candidate = this.availableRemoteMcpPorts.shift();
|
|
132
|
-
if (!this.isRemoteMcpPortLive(candidate))
|
|
133
|
-
return candidate;
|
|
134
|
-
}
|
|
135
|
-
return this.nextRemoteMcpPort;
|
|
136
|
-
}
|
|
137
|
-
isRemoteMcpPortLive(remotePort) {
|
|
138
|
-
for (const entry of this.remoteMcpTunnelsByEndpoint.values()) {
|
|
139
|
-
if (entry.remotePort === remotePort)
|
|
140
|
-
return true;
|
|
141
|
-
}
|
|
142
|
-
for (const entry of this.perRunMcpTunnels.values()) {
|
|
143
|
-
if (entry.remotePort === remotePort)
|
|
144
|
-
return true;
|
|
145
|
-
}
|
|
146
|
-
return false;
|
|
147
|
-
}
|
|
148
|
-
async confirmPerRunMcpTunnelReady(key, entry) {
|
|
149
|
-
const processEndWatcher = this.watchRemoteMcpTunnelSetupProcessEnd(entry);
|
|
150
|
-
try {
|
|
151
|
-
await Promise.race([
|
|
152
|
-
waitForRemoteTcpPort(entry.workerHost, entry.remotePort),
|
|
153
|
-
processEndWatcher.promise,
|
|
154
|
-
]);
|
|
155
|
-
}
|
|
156
|
-
catch (error) {
|
|
157
|
-
this.closePerRunMcpTunnel(key, entry, true);
|
|
158
|
-
throw error;
|
|
159
|
-
}
|
|
160
|
-
finally {
|
|
161
|
-
processEndWatcher.dispose();
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
handlePerRunMcpTunnelProcessEnd(key, entry) {
|
|
165
|
-
if (entry.processEnded)
|
|
166
|
-
return;
|
|
167
|
-
entry.processEnded = true;
|
|
168
|
-
if (this.perRunMcpTunnels.get(key) === entry) {
|
|
169
|
-
this.closePerRunMcpTunnel(key, entry, true);
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
if (entry.recyclePortOnProcessEnd)
|
|
173
|
-
this.recycleRemoteMcpPort(entry.remotePort);
|
|
174
|
-
}
|
|
175
|
-
closePerRunMcpTunnel(key, entry, recyclePort) {
|
|
176
|
-
if (this.perRunMcpTunnels.get(key) === entry) {
|
|
177
|
-
this.perRunMcpTunnels.delete(key);
|
|
178
|
-
}
|
|
179
|
-
for (const leaseId of entry.leaseIds) {
|
|
180
|
-
this.remoteMcpTunnelEntriesByLeaseId.delete(leaseId);
|
|
181
|
-
}
|
|
182
|
-
entry.leaseIds.clear();
|
|
183
|
-
if (recyclePort) {
|
|
184
|
-
if (entry.processEnded) {
|
|
185
|
-
this.recycleRemoteMcpPort(entry.remotePort);
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
entry.recyclePortOnProcessEnd = true;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
if (!entry.processEnded) {
|
|
192
|
-
entry.process.kill();
|
|
193
|
-
}
|
|
160
|
+
this.closeRemoteMcpTunnel(entry, true);
|
|
194
161
|
}
|
|
195
162
|
closeRemoteMcpTunnel(entry, recyclePort) {
|
|
196
163
|
const endpointKey = this.remoteMcpTunnelEndpointKey(entry.workerHost, entry.localHost, entry.localPort);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAoBvE,MAAM,OAAO,cAAc;IACjB,iBAAiB,GAAG,MAAM,CAAC;IAC3B,oBAAoB,GAAG,CAAC,CAAC;IAChB,uBAAuB,GAAa,EAAE,CAAC;IACvC,0BAA0B,GAAG,IAAI,GAAG,EAAgC,CAAC;IACrE,+BAA+B,GAAG,IAAI,GAAG,EAAgC,CAAC;IAC3F,8EAA8E;IAC9E,0EAA0E;IAC1E,0DAA0D;IACzC,gBAAgB,GAAG,IAAI,GAAG,EAAgC,CAAC;IAE5E,KAAK,CAAC,sBAAsB,CAC1B,UAAkB,EAClB,SAAiB,EACjB,SAAiB;QAEjB,MAAM,WAAW,GAAG,IAAI,CAAC,0BAA0B,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QACtF,MAAM,OAAO,GAAG,IAAI,CAAC,0BAA0B,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D,OAAO,GAAG,UAAU,IAAI,MAAM,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -2,4 +2,5 @@ export { POOL_OWNED_LABEL, type WorkerDescriptor, type WorkerDriver, type Worker
|
|
|
2
2
|
export { WorkerDriverRegistry, defaultWorkerDriverRegistry } from "./registry.js";
|
|
3
3
|
export { WORKER_DRIVER_SDK_VERSION, assertWorkerDriverModule, defineWorkerDriver, type WorkerDriverModule, } from "./module.js";
|
|
4
4
|
export { FakeWorkerDriver, fakeWorkerDriverFactory, registerFakeWorkerDriver } from "./fake.js";
|
|
5
|
+
export { LocalWorkerDriver, localWorkerDriverFactory, registerLocalWorkerDriver, } from "./local.js";
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,cAAc,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAElF,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,cAAc,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAElF,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAEhG,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,YAAY,CAAC"}
|
|
@@ -7,4 +7,5 @@ export { POOL_OWNED_LABEL, } from "./types.js";
|
|
|
7
7
|
export { WorkerDriverRegistry, defaultWorkerDriverRegistry } from "./registry.js";
|
|
8
8
|
export { WORKER_DRIVER_SDK_VERSION, assertWorkerDriverModule, defineWorkerDriver, } from "./module.js";
|
|
9
9
|
export { FakeWorkerDriver, fakeWorkerDriverFactory, registerFakeWorkerDriver } from "./fake.js";
|
|
10
|
+
export { LocalWorkerDriver, localWorkerDriverFactory, registerLocalWorkerDriver, } from "./local.js";
|
|
10
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,wEAAwE;AACxE,mEAAmE;AACnE,6EAA6E;AAC7E,UAAU;AAEV,OAAO,EACL,gBAAgB,GAYjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAElF,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,GAEnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,wEAAwE;AACxE,mEAAmE;AACnE,6EAA6E;AAC7E,UAAU;AAEV,OAAO,EACL,gBAAgB,GAYjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAElF,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,GAEnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAEhG,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { WorkerDriverRegistry } from "./registry.js";
|
|
2
|
+
import type { WorkerDescriptor, WorkerDriver, WorkerDriverFactory, DriverCapabilities, DriverDeps, WorkerHealth, ProvisionRequest, TeardownReason } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The single-machine, in-process {@link WorkerDriver}. It provisions workers
|
|
5
|
+
* whose `workerHost` is the EMPTY string, the canonical "no remote worker"
|
|
6
|
+
* signal the orchestrator/endpoint-manager understands: an empty host mints NO
|
|
7
|
+
* tunnel and NO MCP lease, so acp keeps its own in-process MCP endpoint and the
|
|
8
|
+
* run executes locally. A warm pool at `slotsPerMachine=1` over this driver
|
|
9
|
+
* runs one local worker, single-tenant.
|
|
10
|
+
*
|
|
11
|
+
* Mechanically it is a purely in-memory `Map<workerId, WorkerDescriptor>` with
|
|
12
|
+
* deterministic `createdAtMs` from the injected clock, idempotent
|
|
13
|
+
* provision/destroy, and a probe that returns `{ ok: true }` WITHOUT touching
|
|
14
|
+
* SSH (there is no remote machine to reach). The yielded `workerHost` is empty
|
|
15
|
+
* (so downstream wiring takes the local-execution arm), and the `driverRef`
|
|
16
|
+
* stays distinct per worker (`local://<workerId>`) so destroy/list/reconcile
|
|
17
|
+
* key per-worker even though every worker shares the empty host. There is no
|
|
18
|
+
* failure injection: a local in-process worker has no remote faults to model.
|
|
19
|
+
*
|
|
20
|
+
* This driver is single-machine by design: the pool affinity-keys on
|
|
21
|
+
* `workerHost`, so an empty host collapses every local worker into ONE affinity
|
|
22
|
+
* bucket. That is inert at the configuration this driver is meant for
|
|
23
|
+
* (`slotsPerMachine=1`, `max=1`): there is at most one local worker, so the
|
|
24
|
+
* bucket never matters.
|
|
25
|
+
*/
|
|
26
|
+
export declare class LocalWorkerDriver implements WorkerDriver {
|
|
27
|
+
private readonly deps;
|
|
28
|
+
readonly kind = "local";
|
|
29
|
+
readonly capabilities: DriverCapabilities;
|
|
30
|
+
private readonly workers;
|
|
31
|
+
constructor(deps: Pick<DriverDeps, "clock">);
|
|
32
|
+
/**
|
|
33
|
+
* Provisions (or re-adopts) a local worker for `req.workerId`. Idempotent on
|
|
34
|
+
* `workerId`: a second call returns the SAME descriptor without creating a
|
|
35
|
+
* duplicate. The yielded `workerHost` is the EMPTY string (local execution,
|
|
36
|
+
* no tunnel); the `driverRef` is `local://<workerId>` so it stays distinct
|
|
37
|
+
* per worker for destroy/list keying. `createdAtMs` is stamped from the
|
|
38
|
+
* injected clock so it is deterministic.
|
|
39
|
+
*/
|
|
40
|
+
provision(req: ProvisionRequest): Promise<WorkerDescriptor>;
|
|
41
|
+
/**
|
|
42
|
+
* Reports the worker healthy if it is in the live inventory. There is no
|
|
43
|
+
* remote machine to reach, so this NEVER calls SSH; an unknown/destroyed
|
|
44
|
+
* worker is reported `ok: false` rather than throwing (mirroring a probe
|
|
45
|
+
* against a gone worker).
|
|
46
|
+
*/
|
|
47
|
+
probe(worker: WorkerDescriptor, _opts: {
|
|
48
|
+
timeoutMs: number;
|
|
49
|
+
signal?: AbortSignal;
|
|
50
|
+
}): Promise<WorkerHealth>;
|
|
51
|
+
/**
|
|
52
|
+
* Destroys a local worker. Idempotent and tolerant of an already-gone (or
|
|
53
|
+
* never-provisioned) worker.
|
|
54
|
+
*/
|
|
55
|
+
destroy(worker: WorkerDescriptor, _opts: {
|
|
56
|
+
timeoutMs: number;
|
|
57
|
+
reason: TeardownReason;
|
|
58
|
+
}): Promise<void>;
|
|
59
|
+
/** Returns the live inventory (provisioned-minus-destroyed). */
|
|
60
|
+
list(): Promise<WorkerDescriptor[]>;
|
|
61
|
+
}
|
|
62
|
+
/** The registered `local` factory: constructs a fresh in-process driver per pool. */
|
|
63
|
+
export declare const localWorkerDriverFactory: WorkerDriverFactory;
|
|
64
|
+
/**
|
|
65
|
+
* Registers the `local` driver. The SDK ships this driver (rather than an
|
|
66
|
+
* extension) because it is the default backend a pool falls back to when no
|
|
67
|
+
* remote workers are configured: the composition root registers it next to the
|
|
68
|
+
* `fake`/`static-ssh`/`docker` drivers so a default-on local pool can provision
|
|
69
|
+
* an empty-host worker and keep execution in-process.
|
|
70
|
+
*/
|
|
71
|
+
export declare function registerLocalWorkerDriver(registries?: {
|
|
72
|
+
workerDrivers?: WorkerDriverRegistry | undefined;
|
|
73
|
+
}): void;
|
|
74
|
+
//# sourceMappingURL=local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../src/local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACf,MAAM,YAAY,CAAC;AAUpB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,iBAAkB,YAAW,YAAY;IAQxC,OAAO,CAAC,QAAQ,CAAC,IAAI;IAPjC,QAAQ,CAAC,IAAI,WAAQ;IACrB,QAAQ,CAAC,YAAY,qBAAgB;IAIrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuC;gBAElC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC;IAE5D;;;;;;;OAOG;IACG,SAAS,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAsBjE;;;;;OAKG;IACG,KAAK,CACT,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GACjD,OAAO,CAAC,YAAY,CAAC;IAOxB;;;OAGG;IACG,OAAO,CACX,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,cAAc,CAAA;KAAE,GACnD,OAAO,CAAC,IAAI,CAAC;IAKhB,gEAAgE;IAC1D,IAAI,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;CAG1C;AAED,qFAAqF;AACrF,eAAO,MAAM,wBAAwB,EAAE,mBAGtC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,GAAE;IAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAA;CAAO,GACpE,IAAI,CAKN"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { defaultWorkerDriverRegistry } from "./registry.js";
|
|
2
|
+
const KIND = "local";
|
|
3
|
+
const CAPABILITIES = {
|
|
4
|
+
sshAddressable: false,
|
|
5
|
+
ephemeral: false,
|
|
6
|
+
usesLedger: false,
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The single-machine, in-process {@link WorkerDriver}. It provisions workers
|
|
10
|
+
* whose `workerHost` is the EMPTY string, the canonical "no remote worker"
|
|
11
|
+
* signal the orchestrator/endpoint-manager understands: an empty host mints NO
|
|
12
|
+
* tunnel and NO MCP lease, so acp keeps its own in-process MCP endpoint and the
|
|
13
|
+
* run executes locally. A warm pool at `slotsPerMachine=1` over this driver
|
|
14
|
+
* runs one local worker, single-tenant.
|
|
15
|
+
*
|
|
16
|
+
* Mechanically it is a purely in-memory `Map<workerId, WorkerDescriptor>` with
|
|
17
|
+
* deterministic `createdAtMs` from the injected clock, idempotent
|
|
18
|
+
* provision/destroy, and a probe that returns `{ ok: true }` WITHOUT touching
|
|
19
|
+
* SSH (there is no remote machine to reach). The yielded `workerHost` is empty
|
|
20
|
+
* (so downstream wiring takes the local-execution arm), and the `driverRef`
|
|
21
|
+
* stays distinct per worker (`local://<workerId>`) so destroy/list/reconcile
|
|
22
|
+
* key per-worker even though every worker shares the empty host. There is no
|
|
23
|
+
* failure injection: a local in-process worker has no remote faults to model.
|
|
24
|
+
*
|
|
25
|
+
* This driver is single-machine by design: the pool affinity-keys on
|
|
26
|
+
* `workerHost`, so an empty host collapses every local worker into ONE affinity
|
|
27
|
+
* bucket. That is inert at the configuration this driver is meant for
|
|
28
|
+
* (`slotsPerMachine=1`, `max=1`): there is at most one local worker, so the
|
|
29
|
+
* bucket never matters.
|
|
30
|
+
*/
|
|
31
|
+
export class LocalWorkerDriver {
|
|
32
|
+
deps;
|
|
33
|
+
kind = KIND;
|
|
34
|
+
capabilities = CAPABILITIES;
|
|
35
|
+
// The live inventory: provisioned-minus-destroyed, keyed on the pool's
|
|
36
|
+
// idempotency key so `provision` is idempotent on `workerId`.
|
|
37
|
+
workers = new Map();
|
|
38
|
+
constructor(deps) {
|
|
39
|
+
this.deps = deps;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Provisions (or re-adopts) a local worker for `req.workerId`. Idempotent on
|
|
43
|
+
* `workerId`: a second call returns the SAME descriptor without creating a
|
|
44
|
+
* duplicate. The yielded `workerHost` is the EMPTY string (local execution,
|
|
45
|
+
* no tunnel); the `driverRef` is `local://<workerId>` so it stays distinct
|
|
46
|
+
* per worker for destroy/list keying. `createdAtMs` is stamped from the
|
|
47
|
+
* injected clock so it is deterministic.
|
|
48
|
+
*/
|
|
49
|
+
async provision(req) {
|
|
50
|
+
const existing = this.workers.get(req.workerId);
|
|
51
|
+
if (existing) {
|
|
52
|
+
return Promise.resolve(existing);
|
|
53
|
+
}
|
|
54
|
+
const descriptor = {
|
|
55
|
+
workerId: req.workerId,
|
|
56
|
+
// The empty host is load-bearing: it routes the run through acp's own
|
|
57
|
+
// in-process MCP endpoint (no tunnel, no MCP lease).
|
|
58
|
+
workerHost: "",
|
|
59
|
+
// A distinct, non-empty ref per worker so destroy/list/reconcile key
|
|
60
|
+
// per-worker even though every local worker shares the empty host.
|
|
61
|
+
driverRef: `local://${req.workerId}`,
|
|
62
|
+
createdAtMs: this.deps.clock.now().getTime(),
|
|
63
|
+
labels: [...req.labels],
|
|
64
|
+
metadata: {},
|
|
65
|
+
};
|
|
66
|
+
this.workers.set(req.workerId, descriptor);
|
|
67
|
+
return Promise.resolve(descriptor);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Reports the worker healthy if it is in the live inventory. There is no
|
|
71
|
+
* remote machine to reach, so this NEVER calls SSH; an unknown/destroyed
|
|
72
|
+
* worker is reported `ok: false` rather than throwing (mirroring a probe
|
|
73
|
+
* against a gone worker).
|
|
74
|
+
*/
|
|
75
|
+
async probe(worker, _opts) {
|
|
76
|
+
if (!this.workers.has(worker.workerId)) {
|
|
77
|
+
return Promise.resolve({ ok: false, reason: "local_worker_not_found" });
|
|
78
|
+
}
|
|
79
|
+
return Promise.resolve({ ok: true });
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Destroys a local worker. Idempotent and tolerant of an already-gone (or
|
|
83
|
+
* never-provisioned) worker.
|
|
84
|
+
*/
|
|
85
|
+
async destroy(worker, _opts) {
|
|
86
|
+
this.workers.delete(worker.workerId);
|
|
87
|
+
return Promise.resolve();
|
|
88
|
+
}
|
|
89
|
+
/** Returns the live inventory (provisioned-minus-destroyed). */
|
|
90
|
+
async list() {
|
|
91
|
+
return Promise.resolve([...this.workers.values()]);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** The registered `local` factory: constructs a fresh in-process driver per pool. */
|
|
95
|
+
export const localWorkerDriverFactory = {
|
|
96
|
+
kind: KIND,
|
|
97
|
+
create: (_options, deps) => new LocalWorkerDriver(deps),
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Registers the `local` driver. The SDK ships this driver (rather than an
|
|
101
|
+
* extension) because it is the default backend a pool falls back to when no
|
|
102
|
+
* remote workers are configured: the composition root registers it next to the
|
|
103
|
+
* `fake`/`static-ssh`/`docker` drivers so a default-on local pool can provision
|
|
104
|
+
* an empty-host worker and keep execution in-process.
|
|
105
|
+
*/
|
|
106
|
+
export function registerLocalWorkerDriver(registries = {}) {
|
|
107
|
+
const drivers = registries.workerDrivers ?? defaultWorkerDriverRegistry;
|
|
108
|
+
if (drivers.get(KIND) === undefined) {
|
|
109
|
+
drivers.register(localWorkerDriverFactory);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../src/local.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAY5D,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB,MAAM,YAAY,GAAuB;IACvC,cAAc,EAAE,KAAK;IACrB,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,KAAK;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,iBAAiB;IAQC;IAPpB,IAAI,GAAG,IAAI,CAAC;IACZ,YAAY,GAAG,YAAY,CAAC;IAErC,uEAAuE;IACvE,8DAA8D;IAC7C,OAAO,GAAG,IAAI,GAAG,EAA4B,CAAC;IAE/D,YAA6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