@loucompanion/forge-bridge 0.1.3-dev.d46a8e73d03d → 0.1.3-dev.e7b62d8fdd33
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 -0
- package/dist/bridge/bridge.base.d.ts +4 -1
- package/dist/bridge/bridge.service.d.ts +55 -3
- package/dist/bridge/bridge.service.js +834 -87
- package/dist/bridge/bridge.types.d.ts +89 -1
- package/dist/bridge/runner-host-capabilities.d.ts +15 -0
- package/dist/bridge/runner-host-capabilities.js +93 -0
- package/dist/cleanup/cleanup.service.d.ts +14 -2
- package/dist/cleanup/cleanup.service.js +496 -3
- package/dist/cleanup/cleanup.types.d.ts +10 -0
- package/dist/cleanup/index.d.ts +1 -1
- package/dist/cleanup/index.js +1 -1
- package/dist/cleanup/internals.d.ts +2 -2
- package/dist/cleanup/internals.js +1 -1
- package/dist/cli/cli.help.js +37 -3
- package/dist/cli/cli.service.d.ts +33 -2
- package/dist/cli/cli.service.js +209 -27
- package/dist/cli/local-config.d.ts +5 -0
- package/dist/cli/local-config.js +45 -1
- package/dist/runtime/aspnet-runtime-prebuild.d.ts +36 -0
- package/dist/runtime/aspnet-runtime-prebuild.js +340 -0
- package/dist/runtime/attempt-node-runtime-launcher.d.ts +17 -0
- package/dist/runtime/attempt-node-runtime-launcher.js +105 -0
- package/dist/runtime/attempt-process-supervisor-registry.d.ts +20 -0
- package/dist/runtime/attempt-process-supervisor-registry.js +64 -0
- package/dist/runtime/attempt-process-supervisor.d.ts +97 -0
- package/dist/runtime/attempt-process-supervisor.js +386 -0
- package/dist/runtime/docker-engine-probe.d.ts +83 -0
- package/dist/runtime/docker-engine-probe.js +300 -0
- package/dist/runtime/generated-output-reset.d.ts +10 -0
- package/dist/runtime/generated-output-reset.js +103 -0
- package/dist/runtime/host-listener-inspector.d.ts +46 -0
- package/dist/runtime/host-listener-inspector.js +349 -0
- package/dist/runtime/host-port-broker.d.ts +76 -0
- package/dist/runtime/host-port-broker.js +333 -0
- package/dist/runtime/host-runtime-contract.d.ts +47 -0
- package/dist/runtime/host-runtime-contract.js +700 -0
- package/dist/runtime/host-runtime-lease.d.ts +197 -0
- package/dist/runtime/host-runtime-lease.js +2203 -0
- package/dist/runtime/host-runtime-promotion.d.ts +23 -0
- package/dist/runtime/host-runtime-promotion.js +159 -0
- package/dist/runtime/memory-capacity.d.ts +68 -0
- package/dist/runtime/memory-capacity.js +121 -0
- package/dist/runtime/node-host-runtime-adapter.d.ts +54 -0
- package/dist/runtime/node-host-runtime-adapter.js +284 -0
- package/dist/runtime/playwright-host-runtime-adapter.d.ts +21 -0
- package/dist/runtime/playwright-host-runtime-adapter.js +231 -0
- package/dist/runtime/runtime-isolation-lease.d.ts +67 -0
- package/dist/runtime/runtime-isolation-lease.js +158 -0
- package/dist/runtime/workspace-resource-estimator.d.ts +17 -0
- package/dist/runtime/workspace-resource-estimator.js +174 -0
- package/dist/sandbox/preflight.d.ts +45 -1
- package/dist/sandbox/preflight.js +299 -34
- package/dist/sandbox/process.js +125 -40
- package/dist/sandbox/repository-lock.js +41 -3
- package/dist/sandbox/runtime.d.ts +66 -3
- package/dist/sandbox/runtime.js +670 -105
- package/dist/sandbox/sandbox.types.d.ts +10 -0
- package/dist/sandbox/smoke.d.ts +76 -0
- package/dist/sandbox/smoke.js +380 -0
- package/dist/sandbox/worker-supervisor.js +1 -1
- package/dist/sandbox/worker.js +2 -5
- package/dist/sandbox/workspace.service.d.ts +1 -0
- package/dist/sandbox/workspace.service.js +28 -5
- package/dist/session/managed-attempt-tools.d.ts +21 -0
- package/dist/session/managed-attempt-tools.js +912 -0
- package/dist/session/managed-build-coordinator.d.ts +5 -0
- package/dist/session/managed-build-coordinator.js +105 -0
- package/dist/session/managed-build-receipt.d.ts +21 -0
- package/dist/session/managed-build-receipt.js +335 -0
- package/dist/session/phase-completion.artifacts.d.ts +17 -0
- package/dist/session/phase-completion.artifacts.js +233 -24
- package/dist/session/phase-completion.d.ts +12 -2
- package/dist/session/phase-completion.helpers.d.ts +5 -0
- package/dist/session/phase-completion.helpers.js +51 -10
- package/dist/session/phase-completion.js +14 -3
- package/dist/session/phase-completion.prompts.d.ts +3 -3
- package/dist/session/phase-completion.prompts.js +24 -8
- package/dist/session/phase-completion.runtime.d.ts +13 -1
- package/dist/session/phase-completion.runtime.js +189 -8
- package/dist/session/phase-completion.schemas.js +117 -4
- package/dist/session/phase-completion.validation.d.ts +4 -1
- package/dist/session/phase-completion.validation.js +153 -22
- package/dist/session/pre-publication-validation.d.ts +46 -0
- package/dist/session/pre-publication-validation.js +208 -0
- package/dist/session/provider-cli/ci-repair-readiness.d.ts +16 -0
- package/dist/session/provider-cli/ci-repair-readiness.js +110 -0
- package/dist/session/provider-cli/provider-cli.artifacts.d.ts +3 -2
- package/dist/session/provider-cli/provider-cli.artifacts.js +65 -7
- package/dist/session/provider-cli/provider-cli.deterministic.js +49 -1
- package/dist/session/provider-cli/provider-cli.process.d.ts +25 -0
- package/dist/session/provider-cli/provider-cli.process.js +463 -34
- package/dist/session/provider-cli/provider-cli.prompts.d.ts +4 -1
- package/dist/session/provider-cli/provider-cli.prompts.js +108 -25
- package/dist/session/provider-cli/provider-cli.qa-sidecars.js +1 -0
- package/dist/session/provider-cli/provider-cli.repair-epoch.d.ts +6 -0
- package/dist/session/provider-cli/provider-cli.repair-epoch.js +11 -0
- package/dist/session/provider-cli/provider-cli.runtime.d.ts +1 -1
- package/dist/session/provider-cli/provider-cli.runtime.js +6 -3
- package/dist/session/provider-cli/provider-cli.service.d.ts +22 -2
- package/dist/session/provider-cli/provider-cli.service.js +524 -100
- package/dist/session/provider-cli/provider-cli.types.d.ts +5 -0
- package/dist/session/provider-cli/provider-output-state.d.ts +2 -0
- package/dist/session/provider-cli/provider-output-state.js +91 -16
- package/dist/session/provider-cli/provider-usage.d.ts +7 -0
- package/dist/session/provider-cli/provider-usage.js +28 -5
- package/dist/session/session-redaction.d.ts +3 -0
- package/dist/session/session-redaction.js +38 -0
- package/dist/session/session.base.d.ts +6 -1
- package/dist/session/session.service.d.ts +8 -2
- package/dist/session/session.service.js +522 -41
- package/dist/session/session.types.d.ts +72 -0
- package/dist/session/session.types.js +74 -3
- package/dist/shared/format/format-bytes.d.ts +1 -0
- package/dist/shared/format/format-bytes.js +9 -0
- package/dist/shared/path/path.d.ts +1 -0
- package/dist/shared/path/path.js +21 -1
- package/dist/shared/process/dotnet-toolchain.d.ts +14 -0
- package/dist/shared/process/dotnet-toolchain.js +179 -0
- package/dist/shared/process/host-process-recovery.d.ts +12 -0
- package/dist/shared/process/host-process-recovery.js +78 -0
- package/dist/shared/process/host-process-supervisor.d.ts +59 -0
- package/dist/shared/process/host-process-supervisor.js +330 -0
- package/dist/shared/process/process.d.ts +1 -0
- package/dist/shared/process/process.js +1 -0
- package/dist/shared/redaction/redaction.js +12 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worktree/artifact-injector.d.ts +3 -2
- package/dist/worktree/artifact-injector.js +43 -4
- package/dist/worktree/dependency-warmer.d.ts +28 -1
- package/dist/worktree/dependency-warmer.js +308 -9
- package/dist/worktree/index.d.ts +2 -1
- package/dist/worktree/index.js +1 -0
- package/dist/worktree/prior-phase-artifact-hydrator.d.ts +2 -0
- package/dist/worktree/prior-phase-artifact-hydrator.js +136 -0
- package/dist/worktree/worktree-paths.d.ts +4 -0
- package/dist/worktree/worktree-paths.js +30 -0
- package/dist/worktree/worktree.base.d.ts +3 -0
- package/dist/worktree/worktree.service.d.ts +13 -2
- package/dist/worktree/worktree.service.js +238 -47
- package/dist/worktree/worktree.types.d.ts +5 -1
- package/package.json +5 -3
- package/runtime/windows-job-supervisor.ps1 +444 -0
- package/runtime/windows-listener-owner.ps1 +33 -0
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type { ApiKeySecretGrant, RunOnceResultPacket, RunnerDispatchEvent } from "../session/session.types.js";
|
|
1
|
+
import type { ApiKeySecretGrant, DispatchSandboxResourceRequest, RunOnceResultPacket, RunnerDispatchEvent } from "../session/session.types.js";
|
|
2
2
|
import type { SandboxFeatureMatrix } from "../sandbox/sandbox.types.js";
|
|
3
|
+
import type { HostRuntimeCapacitySnapshot } from "../runtime/host-runtime-lease.js";
|
|
4
|
+
import type { MemoryAdmissionDiagnostics } from "../runtime/memory-capacity.js";
|
|
5
|
+
import type { DockerEngineCapabilitySnapshot } from "../runtime/docker-engine-probe.js";
|
|
3
6
|
export interface BridgeServiceConfig {
|
|
4
7
|
readonly serverUrl: string;
|
|
5
8
|
readonly runnerId: string;
|
|
@@ -9,14 +12,24 @@ export interface BridgeServiceConfig {
|
|
|
9
12
|
readonly maxConcurrentSandboxBuilds: number;
|
|
10
13
|
readonly sandboxPidCapacity: number;
|
|
11
14
|
readonly dockerEnabled: boolean;
|
|
15
|
+
readonly allowOpenPublicSandbox: boolean;
|
|
12
16
|
readonly sandboxPublicationMode?: "bridge_push" | "shared_filesystem";
|
|
13
17
|
readonly dockerExecutable: string;
|
|
14
18
|
readonly dockerContext: string;
|
|
19
|
+
readonly dockerDesktopRecoveryEnabled: boolean;
|
|
20
|
+
readonly dockerRecoveryFailureThreshold: number;
|
|
21
|
+
readonly dockerRecoveryCooldownMs: number;
|
|
22
|
+
readonly dockerRecoveryStartupTimeoutMs: number;
|
|
15
23
|
readonly sandboxStateRoot: string;
|
|
16
24
|
readonly requireRootlessDocker: boolean;
|
|
17
25
|
readonly diskHighWatermarkPercent: number;
|
|
18
26
|
readonly diskLowWatermarkPercent: number;
|
|
19
27
|
readonly minimumWorkspaceBytes: number;
|
|
28
|
+
readonly sandboxHostMemoryReserveBytes?: number;
|
|
29
|
+
readonly defaultSandboxWorkerMemoryLimitBytes: number;
|
|
30
|
+
readonly defaultSandboxServiceMemoryLimitBytes: number;
|
|
31
|
+
readonly sandboxRuntimeOverheadBytes: number;
|
|
32
|
+
readonly sandboxMemorySampleIntervalMs: number;
|
|
20
33
|
readonly imageRetentionCount: number;
|
|
21
34
|
readonly imageRetentionTtlMs: number;
|
|
22
35
|
readonly auditRetentionCount: number;
|
|
@@ -42,6 +55,7 @@ export interface BridgeServiceConfig {
|
|
|
42
55
|
readonly protocolVersion: number;
|
|
43
56
|
readonly minServerVersion?: string | null;
|
|
44
57
|
readonly heartbeatIntervalMs: number;
|
|
58
|
+
readonly callbackAckTimeoutMs?: number;
|
|
45
59
|
readonly reconnectBackoffMs: readonly number[];
|
|
46
60
|
}
|
|
47
61
|
export interface BridgeRepoMapping {
|
|
@@ -56,6 +70,7 @@ export interface QaAppLaunchTarget {
|
|
|
56
70
|
readonly command?: string | null;
|
|
57
71
|
readonly working_directory?: string | null;
|
|
58
72
|
readonly ready_url?: string | null;
|
|
73
|
+
readonly managed_runtime_port?: string | null;
|
|
59
74
|
readonly routes?: readonly string[] | null;
|
|
60
75
|
readonly notes?: string | null;
|
|
61
76
|
}
|
|
@@ -64,6 +79,20 @@ export interface BridgeProviderStatus {
|
|
|
64
79
|
readonly version?: string | null;
|
|
65
80
|
readonly models?: readonly string[] | null;
|
|
66
81
|
}
|
|
82
|
+
export interface BridgeToolCapability {
|
|
83
|
+
readonly available: boolean;
|
|
84
|
+
readonly executable: string;
|
|
85
|
+
readonly version?: string | null;
|
|
86
|
+
}
|
|
87
|
+
export interface BridgeToolchainCapabilities {
|
|
88
|
+
readonly node: BridgeToolCapability;
|
|
89
|
+
readonly pnpm: BridgeToolCapability;
|
|
90
|
+
readonly dotnet: BridgeToolCapability;
|
|
91
|
+
readonly git: BridgeToolCapability;
|
|
92
|
+
readonly bash: BridgeToolCapability;
|
|
93
|
+
readonly powershell: BridgeToolCapability;
|
|
94
|
+
readonly docker?: BridgeToolCapability | null;
|
|
95
|
+
}
|
|
67
96
|
export interface BridgeCapabilities {
|
|
68
97
|
readonly schemaVersion?: number | null;
|
|
69
98
|
readonly activeSessionCount?: number | null;
|
|
@@ -75,9 +104,12 @@ export interface BridgeCapabilities {
|
|
|
75
104
|
readonly sandboxProfiles?: readonly string[] | null;
|
|
76
105
|
readonly runnerInstanceId?: string | null;
|
|
77
106
|
readonly trustDomainId?: string | null;
|
|
107
|
+
readonly executionFacilities?: readonly string[] | null;
|
|
108
|
+
readonly dockerEngine?: DockerEngineCapabilitySnapshot | null;
|
|
78
109
|
readonly sandboxRuntimes?: readonly string[] | null;
|
|
79
110
|
readonly sandboxRuntimeVersion?: string | null;
|
|
80
111
|
readonly sandboxFeatures?: SandboxFeatureMatrix | null;
|
|
112
|
+
readonly allowsOpenPublicSandbox?: boolean | null;
|
|
81
113
|
readonly sandboxPublicationModes?: readonly string[] | null;
|
|
82
114
|
readonly sandboxAuthModes?: Readonly<Record<string, readonly string[]>> | null;
|
|
83
115
|
readonly maxConcurrentSandboxes?: number | null;
|
|
@@ -92,6 +124,8 @@ export interface BridgeCapabilities {
|
|
|
92
124
|
readonly preflightGeneration?: number | null;
|
|
93
125
|
readonly sandboxUnavailableCode?: string | null;
|
|
94
126
|
readonly sandboxUnavailableReason?: string | null;
|
|
127
|
+
readonly sandboxMemoryCapacity?: SandboxMemoryCapacityDiagnostics | null;
|
|
128
|
+
readonly hostRuntime?: HostRuntimeCapacitySnapshot | null;
|
|
95
129
|
readonly supportsApiSecretGrant?: boolean | null;
|
|
96
130
|
readonly supportsManagedWorktrees?: boolean | null;
|
|
97
131
|
readonly supportsManagedForgeArtifacts?: boolean | null;
|
|
@@ -99,6 +133,23 @@ export interface BridgeCapabilities {
|
|
|
99
133
|
readonly supportsDraftRunOnce?: boolean | null;
|
|
100
134
|
readonly supportsDraftAttachments?: boolean | null;
|
|
101
135
|
readonly supportsDraftImageAttachments?: boolean | null;
|
|
136
|
+
readonly toolchains?: BridgeToolchainCapabilities | null;
|
|
137
|
+
readonly playwrightProjects?: readonly string[] | null;
|
|
138
|
+
readonly browserLaunch?: boolean | null;
|
|
139
|
+
readonly providerConnectivity?: Readonly<Record<string, boolean>> | null;
|
|
140
|
+
}
|
|
141
|
+
export interface SandboxMemoryCapacityDiagnostics {
|
|
142
|
+
readonly defaultWorkerMemoryLimitBytes: number;
|
|
143
|
+
readonly defaultServiceMemoryLimitBytes: number;
|
|
144
|
+
readonly runtimeOverheadBytes: number;
|
|
145
|
+
readonly hostReserveBytes: number;
|
|
146
|
+
readonly activeReservationBytes: number;
|
|
147
|
+
readonly daemonTotalBytes: number;
|
|
148
|
+
readonly daemonAvailableBytes: number;
|
|
149
|
+
readonly hostAvailableBytes: number;
|
|
150
|
+
readonly conservativeAvailableBytes: number;
|
|
151
|
+
readonly availableForAdmissionBytes: number;
|
|
152
|
+
readonly memoryAdmission: MemoryAdmissionDiagnostics;
|
|
102
153
|
}
|
|
103
154
|
export interface BridgeHelloRequest {
|
|
104
155
|
readonly version: string;
|
|
@@ -153,6 +204,8 @@ export interface BridgeOfferDecisionCallback {
|
|
|
153
204
|
readonly code?: string | null;
|
|
154
205
|
readonly message?: string | null;
|
|
155
206
|
readonly reservedUntil?: string | null;
|
|
207
|
+
readonly reservedResources?: DispatchSandboxResourceRequest | null;
|
|
208
|
+
readonly sandboxConfigCommitSha?: string | null;
|
|
156
209
|
}
|
|
157
210
|
export interface BridgeDispatchStartedCallback {
|
|
158
211
|
readonly dispatchAttemptId: string;
|
|
@@ -205,3 +258,38 @@ export type BridgeStartHandler = (dispatch: unknown) => Promise<void>;
|
|
|
205
258
|
export type BridgeLeaseUpdateHandler = (request: BridgeLeaseUpdateRequest) => Promise<void>;
|
|
206
259
|
export type BridgeCancelHandler = (request: BridgeCancelRequest) => Promise<void>;
|
|
207
260
|
export type BridgeReapHandler = (request: BridgeReapRequest) => Promise<void>;
|
|
261
|
+
export type BridgeReadinessProbeHandler = (request: unknown) => Promise<void>;
|
|
262
|
+
export interface BridgeRuntimeReadinessRequest {
|
|
263
|
+
readonly schemaVersion: 1;
|
|
264
|
+
readonly requestId: string;
|
|
265
|
+
readonly fencingToken: string;
|
|
266
|
+
readonly userId: string;
|
|
267
|
+
readonly projectId: string;
|
|
268
|
+
readonly repoId: string;
|
|
269
|
+
readonly runnerInstanceId: string;
|
|
270
|
+
readonly attempt: number;
|
|
271
|
+
readonly repoName: string;
|
|
272
|
+
readonly remoteUrl: string;
|
|
273
|
+
readonly defaultBranch: string;
|
|
274
|
+
readonly cloneOnDemand: boolean;
|
|
275
|
+
readonly runnerRepoLocalPath: string;
|
|
276
|
+
readonly revision: string;
|
|
277
|
+
readonly expiresAt: string;
|
|
278
|
+
}
|
|
279
|
+
export interface BridgeRuntimeReadinessResult {
|
|
280
|
+
readonly schemaVersion: 1;
|
|
281
|
+
readonly requestId: string;
|
|
282
|
+
readonly fencingToken: string;
|
|
283
|
+
readonly runnerInstanceId: string;
|
|
284
|
+
readonly status: "parallel_ready" | "serialized" | "failed";
|
|
285
|
+
readonly runtimeContractFingerprint?: string | null;
|
|
286
|
+
readonly runtimeContractSource?: string | null;
|
|
287
|
+
readonly reasonCode?: string | null;
|
|
288
|
+
readonly reasonMessage?: string | null;
|
|
289
|
+
readonly qaAppLaunchTarget?: BridgeRuntimeReadinessQaLaunchTarget | null;
|
|
290
|
+
readonly checkedAt: string;
|
|
291
|
+
}
|
|
292
|
+
export interface BridgeRuntimeReadinessQaLaunchTarget {
|
|
293
|
+
readonly managedRuntimePort: string;
|
|
294
|
+
readonly routes: readonly string[];
|
|
295
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BridgeServiceConfig, BridgeToolchainCapabilities } from "./bridge.types.js";
|
|
2
|
+
export interface RunnerHostCapabilitySnapshot {
|
|
3
|
+
readonly toolchains: BridgeToolchainCapabilities;
|
|
4
|
+
readonly playwrightProjects: readonly string[];
|
|
5
|
+
readonly browserLaunch: boolean;
|
|
6
|
+
readonly providerConnectivity: Readonly<Record<string, boolean>>;
|
|
7
|
+
}
|
|
8
|
+
export interface RunnerHostCapabilityProbe {
|
|
9
|
+
detect(config: BridgeServiceConfig): Promise<RunnerHostCapabilitySnapshot>;
|
|
10
|
+
}
|
|
11
|
+
export declare class ProcessRunnerHostCapabilityProbe implements RunnerHostCapabilityProbe {
|
|
12
|
+
detect(config: BridgeServiceConfig): Promise<RunnerHostCapabilitySnapshot>;
|
|
13
|
+
}
|
|
14
|
+
export declare function isUnavailablePlaywrightConfigError(error: unknown): boolean;
|
|
15
|
+
export declare function emptyRunnerHostCapabilitySnapshot(): RunnerHostCapabilitySnapshot;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
const execFileAsync = promisify(execFile);
|
|
6
|
+
export class ProcessRunnerHostCapabilityProbe {
|
|
7
|
+
async detect(config) {
|
|
8
|
+
const [pnpm, dotnet, git, bash, pwsh, windowsPowerShell] = await Promise.all([
|
|
9
|
+
probe("pnpm", ["--version"]),
|
|
10
|
+
probe("dotnet", ["--version"]),
|
|
11
|
+
probe("git", ["--version"]),
|
|
12
|
+
probe("bash", ["--version"]),
|
|
13
|
+
probe("pwsh", ["-NoProfile", "-Command", "$PSVersionTable.PSVersion.ToString()"]),
|
|
14
|
+
process.platform === "win32"
|
|
15
|
+
? probe("powershell.exe", ["-NoProfile", "-Command", "$PSVersionTable.PSVersion.ToString()"])
|
|
16
|
+
: Promise.resolve(unavailable("powershell.exe")),
|
|
17
|
+
]);
|
|
18
|
+
const playwrightProjects = await detectPlaywrightProjects(config.repoMappings);
|
|
19
|
+
const browserLaunch = playwrightProjects.length > 0
|
|
20
|
+
|| config.repoMappings.some(mapping => Boolean(mapping.qaAppLaunchTarget?.url
|
|
21
|
+
|| mapping.qaAppLaunchTarget?.command
|
|
22
|
+
|| mapping.qaAppLaunchTarget?.managed_runtime_port));
|
|
23
|
+
return {
|
|
24
|
+
toolchains: {
|
|
25
|
+
node: { available: true, executable: process.execPath, version: process.version },
|
|
26
|
+
pnpm,
|
|
27
|
+
dotnet,
|
|
28
|
+
git,
|
|
29
|
+
bash,
|
|
30
|
+
powershell: pwsh.available ? pwsh : windowsPowerShell,
|
|
31
|
+
},
|
|
32
|
+
playwrightProjects,
|
|
33
|
+
browserLaunch,
|
|
34
|
+
providerConnectivity: Object.fromEntries(Object.entries(config.providerStatuses)
|
|
35
|
+
.map(([provider, status]) => [provider, status.signedIn === true])),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function probe(executable, args) {
|
|
40
|
+
try {
|
|
41
|
+
const result = await execFileAsync(executable, [...args], { encoding: "utf8", timeout: 5_000 });
|
|
42
|
+
const version = `${result.stdout || result.stderr}`.trim().split(/\r?\n/u)[0] ?? "";
|
|
43
|
+
return { available: true, executable, version };
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return unavailable(executable);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function unavailable(executable) {
|
|
50
|
+
return { available: false, executable, version: null };
|
|
51
|
+
}
|
|
52
|
+
async function detectPlaywrightProjects(repoMappings) {
|
|
53
|
+
const projects = new Set();
|
|
54
|
+
for (const mapping of repoMappings) {
|
|
55
|
+
if (!mapping.localPath)
|
|
56
|
+
continue;
|
|
57
|
+
const candidates = [
|
|
58
|
+
"playwright.config.ts", "playwright.config.js", "playwright.config.mjs",
|
|
59
|
+
"tests/e2e/playwright.config.ts", "tests/e2e/playwright.config.js", "tests/e2e/playwright.config.mjs",
|
|
60
|
+
];
|
|
61
|
+
for (const relative of candidates) {
|
|
62
|
+
try {
|
|
63
|
+
const source = await fs.readFile(path.join(mapping.localPath, relative), "utf8");
|
|
64
|
+
for (const match of source.matchAll(/\bname\s*:\s*["']([^"']+)["']/gu))
|
|
65
|
+
projects.add(match[1]);
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (!isUnavailablePlaywrightConfigError(error))
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return [...projects].sort((left, right) => left.localeCompare(right));
|
|
74
|
+
}
|
|
75
|
+
export function isUnavailablePlaywrightConfigError(error) {
|
|
76
|
+
const code = error?.code;
|
|
77
|
+
return code === "ENOENT" || code === "EACCES" || code === "EPERM" || code === "ENOTDIR";
|
|
78
|
+
}
|
|
79
|
+
export function emptyRunnerHostCapabilitySnapshot() {
|
|
80
|
+
return {
|
|
81
|
+
toolchains: {
|
|
82
|
+
node: { available: true, executable: process.execPath, version: process.version },
|
|
83
|
+
pnpm: unavailable("pnpm"),
|
|
84
|
+
dotnet: unavailable("dotnet"),
|
|
85
|
+
git: unavailable("git"),
|
|
86
|
+
bash: unavailable("bash"),
|
|
87
|
+
powershell: unavailable(process.platform === "win32" ? "powershell.exe" : "pwsh"),
|
|
88
|
+
},
|
|
89
|
+
playwrightProjects: [],
|
|
90
|
+
browserLaunch: false,
|
|
91
|
+
providerConnectivity: {},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
+
import { GitClient } from "../shared/git/git.js";
|
|
2
|
+
import type { WorktreeLifecycleCoordinator } from "../worktree/worktree.base.js";
|
|
1
3
|
import type { CleanupService } from "./cleanup.base.js";
|
|
2
4
|
import type { CleanupRequest, CleanupResult } from "./cleanup.types.js";
|
|
3
|
-
export declare class
|
|
4
|
-
|
|
5
|
+
export declare class ManagedWorktreeCleanupService implements CleanupService {
|
|
6
|
+
private readonly stateRoot;
|
|
7
|
+
private readonly git;
|
|
8
|
+
private readonly coordinator;
|
|
9
|
+
constructor(stateRoot?: string, git?: GitClient, coordinator?: WorktreeLifecycleCoordinator);
|
|
10
|
+
run(request: CleanupRequest): Promise<CleanupResult>;
|
|
11
|
+
private runLocked;
|
|
12
|
+
private listWorktrees;
|
|
13
|
+
private staleRuntimeReadinessPaths;
|
|
14
|
+
private scanManagedCandidates;
|
|
15
|
+
private readRuntimeLeases;
|
|
16
|
+
private worktreeMetadataRoot;
|
|
5
17
|
}
|