import type { ApplicationComponent, DeploymentDrainDefinition, DeploymentStateDefinition } from './deploy'; import { type DeploymentService } from './service-contract'; import type { DeploymentStateHandoff } from './deployment-evidence'; import { type RuntimeTransitionHost } from './runtime-transition'; import { type PlatformActivationConfig, type PlatformActivationResult, type PlatformReleaseIdentity } from './platform-bootstrap-runtime'; export declare const SERVICE_STATE_DIRECTORY = "/var/lib/forgezero/services"; export declare const SERVICE_CONFIG_DIRECTORY = "/etc/forgezero/services"; export declare const SERVICE_UNIT_DIRECTORY = "/etc/systemd/system"; export declare const SERVICE_NGINX_DIRECTORY = "/etc/nginx/conf.d"; export declare const NATIVE_RUNTIME_PROFILE_DIRECTORY = "/etc/forgezero/runtime-profiles"; export interface PlatformApiNativeRuntimeProfile { format: 1; name: string; driver: 'forgezero-platform-api/v1'; deploymentKey: string; component: string; configPath: '/etc/forgezero/deploy-activation.json'; } export type NativeRuntimeProfile = PlatformApiNativeRuntimeProfile; /** Load only a root-owned, non-writable host policy. Repository data cannot supply this object. */ export declare function readNativeRuntimeProfile(name: string): NativeRuntimeProfile; export interface NativeRuntimeProfileDriver { load(name: string): NativeRuntimeProfile; activatePlatform(config: PlatformActivationConfig, release: string, identity: PlatformReleaseIdentity, drain?: DeploymentDrainDefinition): Promise; readConfig(path: string): PlatformActivationConfig; } export interface ServiceActivationRequest { key: string; revision: string; release: string; root: string; service: DeploymentService; } export interface NativeApplicationActivationRequest { key: string; revision: string; release: string; root: string; artifactDigest: `sha256:${string}`; component: string; application: ApplicationComponent; } interface TypedServiceActivationRequest extends ServiceActivationRequest { state?: DeploymentStateDefinition; drain?: DeploymentDrainDefinition; health?: ApplicationComponent['service']['health']; resources?: ApplicationComponent['resources']; } export interface ServiceActivationState { format: 1; id: string; key: string; revision: string; strategy: DeploymentService['strategy']; publicPort: number; applicationPorts: number[]; activeSlot: 0 | 1; healthPath: string; containerRuntime?: { engine: 'docker' | 'containerd'; runtimeClass: 'runc' | 'kata-qemu-snp'; namespace?: 'forgezero'; evidence?: string; }; /** Persisted proof of the most recent candidate health, ingress switch and old-slot retirement. */ transitionEvidence?: ServiceTransitionEvidence; /** Root-only bearer used exclusively by the localhost runtime transition contract. */ runtimeControlToken?: string; updatedAtTs: number; } export interface ServiceTransitionEvidence { candidateSlot: 0 | 1; previousSlot?: 0 | 1; readiness: 'passed'; ingress: 'switched'; switchedAtTs: number; stateHandoff: DeploymentStateHandoff; drain: { status: 'not-required' | 'completed' | 'failed'; requestedMs: number; actualMs: number; oldSlotRetired: boolean; }; } export interface ServiceSupervisorHost extends RuntimeTransitionHost { write(path: string, content: string, mode: number): void; read(path: string): string; exists(path: string): boolean; list(path: string): string[]; realpath(path: string): string; mkdir(path: string, mode: number): void; remove(path: string): void; exec(argv: readonly string[]): Promise<{ exitCode: number; output: string; }>; health(port: number, path: string, timeoutMs?: number, method?: 'GET' | 'HEAD', expectedStatus?: readonly number[]): Promise; now(): number; } /** Serialized by the root helper. Starts the new slot, proves health, switches nginx, then drains old. */ export declare function activateSupervisedService(request: TypedServiceActivationRequest, host?: ServiceSupervisorHost): Promise; /** Runs a v2 native application through the same root-owned slot lifecycle as a container. */ export declare function activateNativeApplication(request: NativeApplicationActivationRequest, host?: ServiceSupervisorHost, profiles?: NativeRuntimeProfileDriver): Promise; export {};