export type TransportConfig = { type: "local" | "ssh"; host?: string | undefined; user?: string | undefined; port?: number | undefined; identityFile?: string | undefined; /** * - Absolute readable known-hosts file overriding the standard user locations. */ knownHostsFile?: string | undefined; credentials?: SshCredentialsConfig | undefined; /** * - Forward the local SSH agent to the deployment host (`ForwardAgent=yes`). Only enable for hosts you trust. */ forwardAgent?: boolean | undefined; sshOptions?: string[] | undefined; extra?: Record | undefined; }; export type SshCredentialsConfig = { type: "ephemeral-agent"; } & ({ deployKey: string; identityFiles?: string[]; } | { deployKey?: undefined; identityFiles: string[]; }); export type HttpTransportConfig = { /** * - Base URL of the mounted control plane, e.g. `https://app.example/rampway/deployments`. */ endpoint: string; /** * - Bearer token for the control plane. */ accessToken?: string | undefined; /** * - Environment variable holding the bearer token, when `accessToken` is not inline. */ accessTokenEnv?: string | undefined; /** * - Control-plane project identifier; defaults to the stage application. */ project?: string | undefined; /** * - Polling interval while waiting for a run to finish. */ pollIntervalMs?: number | undefined; /** * - Maximum time to wait for a run to reach a terminal status. */ timeoutMs?: number | undefined; }; export type LinkedEntry = { path: string; required: boolean; }; export type HealthCheckEntry = { name?: string | undefined; path?: string | undefined; command?: string | undefined; }; export type RuntimeConfig = { type: string; command?: string | undefined; packageDir?: string | undefined; config?: string | undefined; daemonLogPath?: string | undefined; daemonPidPath?: string | undefined; daemonStartTimeoutMs?: number | undefined; rollbackCompatibility?: string | undefined; socketPath?: string | undefined; versionPath?: string | undefined; env?: Record | undefined; composeRoot?: string | undefined; handoffCommand?: string | undefined; healthCommand?: string | undefined; }; export type TaskEntry = { name?: string | undefined; command: string; cwd?: string | undefined; env?: Record | undefined; optional?: boolean | undefined; onlyIfChanged?: string[] | undefined; }; export type OperationalTaskEntry = { name: string; command: string; cwd?: string | undefined; env?: Record | undefined; forwardEnv?: string[] | undefined; }; export type TaskResult = { name: string; command: string; optional?: boolean | undefined; status: "passed" | "failed" | "skipped"; error?: string | undefined; skipReason?: string | undefined; }; export type OperationalTaskReport = { application: string; stage: string; task: string; releaseId: string; status: "passed"; }; export type StageConfig = { application: string; stageName: string; /** * - Optional path-safe deployment namespace isolating release, current, shared, lock, state, and runtime paths below one deploy root. */ namespace?: string | undefined; repo?: string | undefined; branch: string; revision?: string | undefined; deployTo: string; strategy: "local-copy" | "remote-git" | "archive-upload"; /** * - Source-relative paths omitted by local-copy deployments. */ sourceExcludes: string[]; transport: TransportConfig; http?: HttpTransportConfig | undefined; hosts?: { host: string; user?: string; port?: number; roles?: string[]; }[] | undefined; keepReleases: number; linkedFiles: LinkedEntry[]; linkedDirs: LinkedEntry[]; tasks: Record; operationalTasks: Record; hooks: Record; healthChecks: HealthCheckEntry[]; runtime: RuntimeConfig; }; export type DeployPaths = { deployTo: string; releasesPath: string; sharedPath: string; currentPath: string; lockPath: string; statePath: string; runtimePath: string; runtimeBootPath: string; runtimeHandoffPath: string; reportPath: string; releasePath?: string | undefined; }; export type RuntimeBootIdentity = { runtimeType: string; releaseId: string; revision: string; releasePath: string; configPath: string; configIdentity: string; snapshotIdentity: string; acceptedAt: string; }; export type RuntimeBootState = RuntimeBootIdentity & { schemaVersion: 2; application: string; stage: string; integrityDigest: string; }; export type LegacyRuntimeBootState = Omit & { schemaVersion: 1; application: string; stage: string; integrityDigest: string; }; export type ReadRuntimeBootState = RuntimeBootState | LegacyRuntimeBootState; export type RuntimeSnapshot = { schemaVersion?: number | undefined; type: string; contractDigest?: string | undefined; materialDigest?: string | undefined; command?: string | undefined; packageDir?: string | undefined; configPath?: string | undefined; configIdentity?: string | undefined; packageVersion?: string | undefined; packageIdentity?: string | undefined; daemonLogPath?: string | undefined; daemonPidPath?: string | undefined; daemonStartTimeoutMs?: number | undefined; rollbackCompatibility?: string | undefined; rollbackCompatibilityDigest?: string | undefined; socketPath?: string | undefined; versionPath?: string | undefined; envNames?: string[] | undefined; composeRoot?: string | undefined; daemonRuntime?: { format: number; digest: string; path: string; version: string; } | undefined; daemonRuntimeManifestPath?: string | undefined; foregroundIdentityDigest?: string | undefined; }; export type RuntimeRelease = { releaseId: string; revision: string; runtime: RuntimeSnapshot; }; export type RuntimeState = { schemaVersion: number; active: RuntimeRelease; releases: Record; referencedReleaseIds: string[]; }; export type CleanupProtectionReason = "current" | "active runtime state" | "draining runtime reference" | "runtime release pin"; export type ReleaseCleanupProtection = { releaseId: string; reasons: CleanupProtectionReason[]; }; export type ReleaseCleanupPlan = { keep: number; currentRelease: string | null; releases: string[]; managed: string[]; unmanaged: string[]; protected: ReleaseCleanupProtection[]; removable: string[]; retained: string[]; /** * - Projected live releases after every removable release is deleted. */ remaining: string[]; counts: { managed: number; unmanaged: number; protected: number; removable: number; retained: number; remaining: number; }; }; export type ReleaseCleanupFailure = { error: string; /** * - Releases confirmed removed before cleanup became pending. */ removedCount: number; exitCode?: number | undefined; signal?: string | undefined; }; export type ReleaseCleanupCounts = { managed: number; protected: number; removable: number; removed: number; remaining: number; }; export type ReleaseCleanupReport = { application: string; stage: string; event: "cleanup-releases"; status: "dry-run" | "cleaned" | "already-clean"; dryRun: boolean; currentRelease: string; activeRevision: string; cleanedAt: string; durationMs: number; plan: ReleaseCleanupPlan; removed: string[]; remaining: string[]; counts: ReleaseCleanupCounts; }; export type GenerationTransitionRecovery = { recoveryStatus: "recovered" | "already_recovered"; activeReleaseId: string; candidateReleaseId: string; previousReleaseId: string; failedCandidateStatus?: "draining" | "stopped" | undefined; referencedReleaseIds: string[]; }; export type DeployPlanStep = { phase: string; action: string; name?: string | undefined; detail: string; }; export type DeployReport = { application: string; stage: string; releaseId: string; revision: string; branch?: string | undefined; deployedAt?: string | undefined; event: string; durationMs?: number | undefined; previousRelease?: string | undefined; healthChecks?: string | undefined; runtime?: object | undefined; cleanupRemoved?: string[] | undefined; cleanupStatus?: "completed" | "pending" | undefined; cleanupFailure?: ReleaseCleanupFailure | undefined; cleanupRecoveryCommand?: string | undefined; /** * - Non-fatal maintenance failures after runtime acceptance. */ warnings?: string[] | undefined; /** * - The requested revision was already active, so release and runtime lifecycle work was skipped. */ idempotent?: boolean | undefined; /** * - The request joined the canonical deployment of the same revision and expected-active fence. */ coalesced?: boolean | undefined; /** * - Control-plane run identifier, when deployed over HTTP. */ runId?: string | undefined; /** * - Transport actually used for the deploy. */ transport?: "local" | "ssh" | "http" | undefined; }; export type RollbackReport = { application: string; stage: string; releaseId: string; rolledBackAt: string; revision: string; previousRelease?: string | undefined; event: string; durationMs: number; healthChecks: string; runtime: object; /** * - Non-fatal maintenance failures after runtime acceptance. */ warnings?: string[] | undefined; }; export type ResumePublicationReport = { application: string; stage: string; releaseId: string; revision: string; branch?: string | undefined; resumedAt: string; event: "resume-publication"; durationMs: number; previousRelease: string; healthChecks: "passed"; runtime: object; cleanupRemoved: string[]; }; export type ReleasesReport = { application: string; stage: string; current: string | null; releases: string[]; releaseCount: number; paths: { releases: string; current: string; }; }; export type TaskListEntry = { command: string; cwd?: string | undefined; env?: Record | undefined; optional?: boolean | undefined; onlyIfChanged?: string[] | undefined; }; export type TasksReport = { application: string; stage: string; taskGroupCount: number; taskCount: number; taskGroups: Array<{ name: string; tasks: TaskListEntry[]; }>; }; export type StatusReport = { application: string; stage: string; deployTo: string; current: string | null; releases: string[]; releaseCount: number; latestRelease: string | undefined; paths: { current: string; releases: string; shared: string; lock: string; }; runtime: { type: string; }; }; export type DoctorReport = { ok: boolean; configPath: string; application: string; stage: string; namespace: string | null; deployTo: string; paths: { releases: string; current: string; shared: string; lock: string; state: string; runtime: string; runtimeBoot: string; runtimeHandoff: string; report: string; }; transport: { type: string; }; strategy: string; runtime: { type: string; }; linkedFiles: number; linkedDirs: number; taskGroups: number; healthChecks: number; warnings: string[]; }; export type ReleaseInfo = { application: string; stage: string; releaseId: string; revision: string; branch: string; deployedAt: string; deployedBy: string; host: string; rampwayVersion: string; }; export type LockInfo = { id: string; owner: string; host: string; pid: number; createdAt: string; }; export type CommandOptions = { config?: string | undefined; source?: string | undefined; revision?: string | undefined; /** * - Lock-held current release REVISION fence: a full 40-character Git SHA for deploy, or an exact bounded persisted revision token for cleanup-releases. */ expectedActiveRevision?: string | undefined; task?: string | undefined; branch?: string | undefined; yes?: boolean | undefined; dryRun?: boolean | undefined; force?: boolean | undefined; allowDirty?: boolean | undefined; json?: boolean | undefined; /** * - Enable SSH agent forwarding (`ForwardAgent=yes`) on the stage's ssh transport for this invocation. */ sshForwardAgent?: boolean | undefined; releaseId?: string | undefined; to?: string | undefined; releasePath?: string | undefined; dir?: string | undefined; /** * - Deploy transport selection. `auto` (default) tries the HTTP control plane first and falls back to the direct transport only when the endpoint is unavailable or not deployed. */ transport?: "ssh" | "http" | "auto" | undefined; }; export type CommandArgs = { stageName: string; options: CommandOptions; commandContext?: Function | undefined; }; export type Transport = { mkdirp: (targetPath: string) => Promise; exists: (targetPath: string) => Promise; symlink: (target: string, linkPath: string, type?: string) => Promise; readlink: (linkPath: string) => Promise; realpath: (targetPath: string) => Promise; isDirectory: (targetPath: string) => Promise; rm: (targetPath: string) => Promise; rename: (from: string, to: string) => Promise; writeFile: (filePath: string, content: string) => Promise; writeFileExclusive: (filePath: string, content: string) => Promise; removeFileIfContent: (filePath: string, expectedContent: string) => Promise; readFile: (filePath: string) => Promise; readFileBuffer?: ((filePath: string) => Promise) | undefined; list: (targetPath: string) => Promise; listDirectory?: ((targetPath: string) => Promise) | undefined; copyDir: (from: string, to: string, opts?: { exclude?: string[]; }) => Promise; run: (command: string, opts?: { cwd?: string; env?: Record; secretEnv?: Record; }) => Promise<{ code: number; output: string; }>; stat?: ((targetPath: string) => Promise<{ isDirectory?: () => boolean; isFile?: () => boolean; isSymbolicLink?: () => boolean; } | undefined>) | undefined; }; export type RuntimeAdapter = { plan: () => string[]; deploy: (transport: Transport, opts: { releasePath: string; releaseId?: string; previousReleaseId?: string; revision?: string; currentPath?: string; targetSnapshot?: RuntimeSnapshot; currentSnapshot?: RuntimeSnapshot; deferCommit?: boolean; }) => Promise<{ status: string; }>; prepare?: ((transport: Transport, opts: { releasePath: string; runtimePath: string; releaseId?: string; revision?: string; }) => Promise) | undefined; prepareRollback?: ((transport: Transport, opts: { snapshot: RuntimeSnapshot; releasePath: string; runtimePath: string; }) => Promise) | undefined; acceptSnapshot?: ((transport: Transport, opts: { snapshot: RuntimeSnapshot; runtimePath: string; runtimeResult: any; }) => Promise) | undefined; verifySnapshot?: ((transport: Transport, opts: { snapshot: RuntimeSnapshot; runtimePath: string; contract?: boolean; configMaterialRequired?: boolean; }) => Promise) | undefined; commit?: ((transport: Transport, opts: { snapshot: RuntimeSnapshot; }) => Promise) | undefined; recoverPublication?: ((transport: Transport, opts: { releasePath: string; releaseId: string; revision: string; currentReleasePath: string; currentReleaseId: string; currentRevision: string; runtimePath: string; snapshot?: RuntimeSnapshot; }) => Promise<{ snapshot: RuntimeSnapshot; referencedReleaseIds: string[]; runtimeResult?: object; }>) | undefined; recoverGenerationTransition?: ((transport: Transport, opts: { releasePath: string; releaseId: string; revision: string; previousReleasePath: string; previousReleaseId: string; previousRevision: string; targetSnapshot: RuntimeSnapshot; }) => Promise) | undefined; validate?: ((transport: Transport, opts: { releasePath: string; snapshot?: RuntimeSnapshot; }) => Promise<{ output?: string; }>) | undefined; status?: ((transport: Transport, opts: { releasePath: string; snapshot?: RuntimeSnapshot; }) => Promise<{ output?: string; }>) | undefined; logs?: ((transport: Transport, opts: { releasePath: string; snapshot?: RuntimeSnapshot; }) => Promise<{ output?: string; }>) | undefined; recover?: ((transport: Transport, opts: { releasePath: string; force?: boolean; snapshot?: RuntimeSnapshot; }) => Promise<{ output?: string; }>) | undefined; readReferencedReleaseIds?: ((transport: Transport, opts: { releasePath: string; snapshot: RuntimeSnapshot; }) => Promise) | undefined; validateSnapshot?: ((snapshot: RuntimeSnapshot, opts?: { configMaterialRequired?: boolean; }) => void) | undefined; validateRollbackTarget?: ((snapshot: RuntimeSnapshot) => void) | undefined; bootIdentity?: ((snapshot: RuntimeSnapshot, opts: { releasePath: string; releaseId: string; revision: string; acceptedAt: string; }) => RuntimeBootIdentity | undefined) | undefined; verifyForegroundBootMaterial?: ((transport: Transport, state: ReadRuntimeBootState) => Promise) | undefined; foregroundBoot?: ((opts: { releasePath: string; releaseId: string; revision: string; configPath: string; configIdentity: string; bootAttestation: string; snapshot: RuntimeSnapshot; onStarted: () => Promise; }) => Promise<{ code?: number; }>) | undefined; handoffExternalOwner?: ((transport: Transport, opts: { boot: RuntimeBootState; snapshot: RuntimeSnapshot; runtimeResult: any; persistReferencedReleaseIds: (releaseIds: string[]) => Promise; }) => Promise) | undefined; requiresStableState?: boolean | undefined; type?: string | undefined; }; export type CommandPlan = { command: string; args: string[]; pipeTo?: CommandPlan | undefined; }; export type DeployOptions = { transport: Transport; stage: StageConfig; sourcePath?: string | undefined; revision?: string | undefined; /** * - Canonical full 40-character Git SHA fencing a deploy. */ expectedActiveRevision?: string | undefined; /** * - Exact prepared config path to include in a generated direct-deploy recovery command. */ configPath?: string | undefined; branch?: string | undefined; dryRun?: boolean | undefined; releaseId?: string | undefined; force?: boolean | undefined; reporter?: import("./core/reporter.js").Reporter | undefined; }; export type NodePackageInstallOptions = { packageManager?: "npm" | "pnpm" | "yarn" | "bun" | undefined; cwd?: string | undefined; env?: Record | undefined; optional?: boolean | undefined; production?: boolean | undefined; clean?: boolean | undefined; frozenLockfile?: boolean | undefined; }; export type ConfigModule = { config: object; configPath: string; }; export type RollbridgeRuntimeConfig = { type: string; command: string; packageDir: string; config?: string | undefined; daemonLogPath?: string | undefined; daemonPidPath?: string | undefined; daemonStartTimeoutMs?: number | undefined; rollbackCompatibility?: string | undefined; socketPath?: string | undefined; versionPath?: string | undefined; env?: Record | undefined; externalOwner?: { type: "foreground"; handoffTimeoutMs?: number; pollIntervalMs?: number; } | undefined; /** * Recover an unguarded inactive legacy owner through an explicitly authorized shutdown before deployment. */ inactiveLegacyOwnerTakeover?: boolean | undefined; }; export type RuntimeOwnerHandoff = { schemaVersion: number; application: string; stage: string; runtimeType: string; releaseId: string; revision: string; releasePath: string; bootDigest: string; lockId: string; createdAt: string; integrityDigest: string; }; export type ComposeRuntimeConfig = { type: "compose"; composeRoot: string; handoffCommand: string; healthCommand: string; }; export type SpawnResult = { code: number; output: string; }; export type RegistryFactory = (config: RuntimeConfig) => RuntimeAdapter; export type InitResult = { created: boolean; path: string; }; //# sourceMappingURL=types.d.ts.map