import * as _le_space_shared_types from '@le-space/shared-types'; import { MessageSigner, InstanceAllocation, PortMapping, RuntimeDiagnostics, CrnRecord, MessageHasher, DeploymentProgressListener, AlephBroadcastMessage, AlephBroadcastResponse, UcanStoreBootstrapPackage, RootfsRequiredPortForward, RootfsManifest as RootfsManifest$1 } from '@le-space/shared-types'; declare function requiredEnv(name: string, env?: NodeJS.ProcessEnv): string; declare function optionalEnv(name: string, fallback?: string, env?: NodeJS.ProcessEnv): string; declare function integerEnv(name: string, fallback: number, env?: NodeJS.ProcessEnv): number; declare function booleanEnv(name: string, fallback: boolean, env?: NodeJS.ProcessEnv): boolean; declare function jsonEnv(name: string, fallback: string, env?: NodeJS.ProcessEnv): T; declare function appendGithubOutput(name: string, value: unknown, env?: NodeJS.ProcessEnv): Promise; declare function appendGithubSummary(lines: string[], env?: NodeJS.ProcessEnv): Promise; declare function actionLog(level: 'notice' | 'warning' | 'error' | string, message: string, options?: { githubActions?: boolean; stderr?: NodeJS.WriteStream; }): void; type WalletLike = { address?: string; getAddress?(): Promise; signMessage(message: string): Promise; }; type WalletCtor = new (privateKey: string) => WalletLike; interface PrivateKeyIdentity { address: string; signer: MessageSigner; } declare function createPrivateKeySigner(privateKey: string, options?: { walletCtor?: WalletCtor; }): Promise; declare function createPrivateKeyIdentity(privateKey: string, options?: { walletCtor?: WalletCtor; }): Promise; interface DeployMetadataResult { peer_id?: string; probe_multiaddrs?: string[]; browser_bootstrap_multiaddrs?: string[]; bootstrap_registration?: { status?: string; reason?: string; itemHash?: string; httpStatus?: number; publishedMultiaddrs?: string[]; publishedBrowserMultiaddrs?: string[]; } | null; [key: string]: unknown; } interface DeployConfigurationResult { metadata?: DeployMetadataResult | null; [key: string]: unknown; } interface DeployOutputResult { sender?: string; itemHash?: string; httpStatus?: number; status?: string; selectedCrn?: { hash?: string; name?: string; } | null; portForwarding?: { aggregateItemHash?: string; aggregateStatus?: string; } | null; instanceDomain?: { domain?: string; url?: string; itemHash?: string; aggregateItemHash?: string; aggregateStatus?: string; httpStatus?: number; } | null; runtime?: { allocation?: InstanceAllocation | null; hostIpv4?: string | null; ipv6?: string | null; proxyUrl?: string | null; sshCommand?: string | null; setupHealth?: { ok?: boolean; status?: number; url?: string; error?: string; } | null; mappedPorts?: Record; diagnostics?: RuntimeDiagnostics | null; selectedCrn?: CrnRecord | null; } | null; configuration?: DeployConfigurationResult | null; verification?: { ok?: boolean; [key: string]: unknown; } | null; } declare function emitDeployOutputs(deployResult: DeployOutputResult, env?: NodeJS.ProcessEnv): Promise<{ runtimeJson: string; verificationJson: string; }>; declare function emitGeocodedCrnOutputs(geocodedCrns: unknown[], env?: NodeJS.ProcessEnv): Promise; interface FetchLikeResponse { ok: boolean; status: number; url?: string; json(): Promise; } type FetchLike = (url: string, init?: RequestInit) => Promise; declare function listGeocodedCrns(options: { fetch: FetchLike; url?: string; limit?: number; dnsResolveUrl?: string; countryLookupBaseUrl?: string; }): Promise; interface JsonFetchLikeResponse { ok: boolean; status: number; json(): Promise; } type JsonFetchLike = (url: string, init?: RequestInit) => Promise; declare function forgetAlephMessages(args: { sender: string; hashes?: string[]; aggregates?: string[]; reason?: string; signer: MessageSigner; hasher: MessageHasher; fetch: JsonFetchLike; channel?: string; apiHost?: string; sync?: boolean; now?: number; onProgress?: DeploymentProgressListener; }): Promise<{ sender: string; itemHash: string; response: _le_space_shared_types.AlephBroadcastResponse; httpStatus: number; status: _le_space_shared_types.MessageStatus; }>; interface RetentionRecord { instance_item_hash: string; rootfs_item_hash: string; site_item_hash: string; rootfs_cid: string; site_url: string; relay_peer_id: string; rootfs_version: string; deployed_at: string; vm_name: string; } declare function retainSuccessfulDeployments(args: { sender: string; currentRecord: unknown; keepCount: number; signer: MessageSigner; hasher: MessageHasher; fetch: JsonFetchLike; aggregateKey?: string; extraForgetHashes?: string[]; reason?: string; channel?: string; apiHost?: string; crnListUrl?: string; schedulerAllocationUrl?: string; now?: number; }): Promise<{ sender: string; aggregateKey: string; keepCount: number; aggregatePublication: { itemHash: string; status: _le_space_shared_types.MessageStatus; response: _le_space_shared_types.AlephBroadcastResponse; httpStatus: number; }; retainedRecords: RetentionRecord[]; prunedRecords: RetentionRecord[]; forgetHashes: string[]; forgottenHashes: string[]; outstandingForgetHashes: string[]; forgetStatuses: Record; forgetResult: { sender: string; itemHash: string; response: _le_space_shared_types.AlephBroadcastResponse; httpStatus: number; status: _le_space_shared_types.MessageStatus; } | null; followUpForgetResults: { hash: string; result: Awaited>; }[]; forgetStageResults: { stage: "instances" | "dependents"; hashes: string[]; eraseResults?: Array<{ hash: string; status: "erased" | "missing" | "skipped"; crnUrl: string | null; crnHash: string | null; source: "provided" | "scheduler" | "manual" | "missing"; }>; skipped?: boolean; skippedReason?: string; forgottenHashes: string[]; outstandingForgetHashes: string[]; statuses: Record; forgetResult: Awaited> | null; followUpForgetResults: Array<{ hash: string; result: Awaited>; }>; }[]; }>; interface RelayBootstrapAuthorizationPayload { ownerAddress: string; publisherAddress: string; peerId: string; registrationId?: string; profile?: string; version?: string; instanceItemHash?: string; issuedAt: number; expiresAt?: number; } interface RelayBootstrapAuthorizationRecord { scheme: string; payload: RelayBootstrapAuthorizationPayload; signature: string; } interface RelayBootstrapProofPayload { peerId: string; multiaddrs?: string[]; browserMultiaddrs?: string[]; multiaddrsHash?: string; browserMultiaddrsHash?: string; registrationId?: string; profile?: string; version?: string; updatedAt: number; } interface RelayBootstrapProofRecord { scheme: string; payload: RelayBootstrapProofPayload; signature: string; } type RelayBootstrapProofSigner = (address: string, payload: string) => Promise; interface RelayBootstrapPublicationResult { status: "published" | "skipped"; reason?: string; itemHash?: string; message?: AlephBroadcastMessage; response?: AlephBroadcastResponse; httpStatus?: number; publishedMultiaddrs?: string[]; publishedBrowserMultiaddrs?: string[]; forgottenHashes?: string[]; forgetResult?: Awaited>; } declare function publishRelayBootstrapRegistration(args: { sender: string; signer: MessageSigner; hasher: MessageHasher; fetch: JsonFetchLike; peerId: string; multiaddrs: string[]; browserMultiaddrs?: string[]; registrationId?: string; apiHost?: string; channel?: string; ref?: string; compactMultiaddrLimit?: number; profile?: string; version?: string; ownerAddress?: string; publisherAddress?: string; ownerSigner?: RelayBootstrapProofSigner; publisherSigner?: RelayBootstrapProofSigner; ownerAuthorization?: RelayBootstrapAuthorizationRecord; relayProof?: RelayBootstrapProofRecord; authorizationIssuedAt?: number; authorizationExpiresAt?: number; instanceItemHash?: string; forgetPrevious?: boolean; forgetPreviousReason?: string; sync?: boolean; now?: number; }): Promise; interface DeployPlan { profile: string; adminDid?: string; ucanStoreAdminApiToken?: string; ucanStoreBootstrapPackage?: UcanStoreBootstrapPackage; privateKey: string; bootstrapPublisherPrivateKey: string; bootstrapOwnerPrivateKey: string; apiHost: string; crnListUrl: string; /** * "auto" reads crns.json and falls back to the corechannel aggregate, * "aggregate" skips crns.json entirely. */ crnSource: DeploymentCrnSource; name: string; sshPublicKey: string; rootfsManifestUrl: string; rootfsItemHash: string; rootfsVersion: string; rootfsSizeMiB: number; placementStrategy: DeploymentPlacementStrategy; crnHash: string; preferredCountryCode: string; geoCrnLimit: number; maxCrnAttempts: number; vcpus: number; memoryMiB: number; seconds: number; channel: string; instanceCustomDomain: string; waitAttempts: number; waitDelayMs: number; runtimeAttempts: number; runtimeDelayMs: number; setupAttempts: number; setupDelayMs: number; verifyAttempts: number; verifyDelayMs: number; tcpTimeoutMs: number; httpTimeoutMs: number; metadataAttempts: number; metadataDelayMs: number; metadataTimeoutMs: number; configureTimeoutMs: number; enableCaddyProxy: boolean; autoConfigure: boolean; verifyReachability: boolean; preserveFailedDeployment: boolean; requiredPorts: RootfsRequiredPortForward[]; publishPortForwards: boolean; } type DeploymentPlacementStrategy = "scheduler" | "manual"; type DeploymentCrnSource = "auto" | "aggregate"; declare function loadRootfsManifestForDeploy(args: { manifestUrl: string; fetch: FetchLike; }): Promise; declare function resolveDeployPlanRootfs(plan: DeployPlan, fetch: FetchLike): Promise; declare function parseDeployPlan(env?: NodeJS.ProcessEnv): DeployPlan; interface DeployExecutorDependencies { fetch?: typeof fetch; sleep?: (ms: number) => Promise; tcpProbe?: (host: string, port: number, timeoutMs?: number) => Promise<{ ok: boolean | null; error?: string; }>; signer?: MessageSigner; sender?: string; hasher?: MessageHasher; manifest?: RootfsManifest$1 | null; log?: (message: string) => void; } declare function executeDeployPlan(plan: DeployPlan, dependencies?: DeployExecutorDependencies): Promise; declare const DERIVE_MODE = "derive-from-aleph-private-key"; type UcanStoreBootstrapDerivationMode = typeof DERIVE_MODE; interface DerivedUcanStoreBootstrapOptions { alephPrivateKey: string; operatorAddress?: string; serviceDid: string; serviceOrigin: string; pwaOrigin: string; allowedCapabilities?: string[]; defaultUserDelegationExpiration?: number | null; maxUserDelegationExpiration?: number | null; derivationContext?: string; derivationSalt?: string; spaceDidMode?: "admin" | "derived"; } declare function deriveUcanStoreBootstrapPackage(options: DerivedUcanStoreBootstrapOptions): Promise; declare function shouldDeriveUcanStoreBootstrapPackage(env?: NodeJS.ProcessEnv): boolean; declare function deriveUcanStoreBootstrapPackageFromEnv(env?: NodeJS.ProcessEnv): Promise; declare function buildScaffoldDeployResult(env?: NodeJS.ProcessEnv): DeployOutputResult; declare function runActionMode(env?: NodeJS.ProcessEnv, hooks?: { stdout?: (text: string) => void; listGeocodedCrns?: typeof listGeocodedCrns; deployExecutor?: typeof executeDeployPlan; deriveUcanStoreBootstrapPackage?: typeof deriveUcanStoreBootstrapPackageFromEnv; retainSuccessfulDeployments?: typeof retainSuccessfulDeployments; publishRelayBootstrapRegistration?: typeof publishRelayBootstrapRegistration; createPrivateKeyIdentity?: (privateKey: string) => Promise; }): Promise; declare function main(): Promise; interface RootfsContractPort { port: number; tcp?: boolean; udp?: boolean; purpose?: string; } interface RootfsContractRootfs { profile: string; installMode: string; installDir: string; binaryPath: string; dataDir: string; envFile: string; } interface RootfsContractServices { bootstrap: string; main: string; autotlsRefresh: string; } interface RootfsContractManifest { copyTarget: string; notes?: string; } interface RootfsContractSource { repository?: string; subdirectory?: string; } interface RootfsContract { schemaVersion: number; id: string; displayName?: string; source?: RootfsContractSource; rootfs: RootfsContractRootfs; services: RootfsContractServices; ports: RootfsContractPort[]; manifest: RootfsContractManifest; } type RootfsBuildDriver = 'auto' | 'host' | 'docker'; interface RootfsBuildPlan { contract: RootfsContract; contractPath: string; projectDir: string; orbitdbRelayDir?: string; alephDir: string; outDir: string; driver: RootfsBuildDriver; rootfsSizeMiB: number; rootfsImageSize: string; rootfsVersion: string; channel: string; skipUpload: boolean; skipBuild: boolean; ipfsAddUrl: string; ipfsGatewayUrl: string; alephApiHost: string; alephMessageWaitAttempts: number; alephMessageWaitDelaySeconds: number; alephPinAttempts: number; alephPinDelaySeconds: number; ipfsGatewayWaitAttempts: number; ipfsGatewayWaitDelaySeconds: number; manifestPath: string; latestManifestPath: string | null; versionedManifestPath: string | null; imagePath: string; baseImagePath: string; binaryPath: string; } interface RootfsManifest { profile: string; version: string; rootfsInstallStrategy: string; requiresBootstrapNetwork: boolean; /** Guest fetches its bootstrap config from the Aleph aggregate itself. */ supportsBootstrapConfigAggregate?: boolean; bootstrapSummary: string; rootfsSourceSizeBytes?: number; requiredPortForwards: RootfsContract["ports"]; rootfsCid?: string; rootfsItemHash?: string; rootfsSizeMiB: number; createdAt: string; notes: string; playwrightVersion?: string; } interface RootfsManifestOutputPaths { primaryPath: string; copyTargetPath?: string; versionedTargetPath?: string; } interface RootfsToolchainAvailability { hasDocker: boolean; dockerDaemonRunning?: boolean; hasVirtCustomize: boolean; githubActions?: boolean; } interface RootfsCommandPlan { command: string; args: string[]; env?: Record; workdir?: string; } interface RootfsExecutionPlan { mode: "host" | "docker"; reason: string; referenceRootfsDir: string; prepareCommand?: RootfsCommandPlan; runCommand: RootfsCommandPlan; } interface RootfsExecutionPlanOptions { referenceRootfsDir?: string; projectMountPath?: string; rootfsMountPath?: string; orbitdbRelayMountPath?: string; dockerImageTag?: string; } interface RootfsPublicationArtifacts { ipfsAddResponsePath: string; storeMessagePath: string; storeMessageStderrPath: string; } interface RootfsPublicationResult { cid: string; itemHash: string; sourceSizeBytes?: number; } interface RootfsBuildPipeline { buildPlan: RootfsBuildPlan; executionPlan: RootfsExecutionPlan; publicationArtifacts: RootfsPublicationArtifacts; manifestPaths: RootfsManifestOutputPaths; } interface RootfsFinalizeResult { manifest: RootfsManifest; manifestJson: string; manifestPaths: RootfsManifestOutputPaths; publication?: RootfsPublicationResult; } interface RootfsExecutedCommand { command: string; args: string[]; workdir?: string; env?: Record; } interface RootfsCommandRunner { run(command: RootfsExecutedCommand): Promise; } interface RootfsExecutionResult { pipeline: RootfsBuildPipeline; executedCommands: RootfsExecutedCommand[]; } interface RootfsPublishExecutionResult extends RootfsExecutionResult { finalized: RootfsFinalizeResult; } declare function buildRootfs(buildPlan: RootfsBuildPlan, deps: RootfsCommandRunner, availability: RootfsToolchainAvailability, options?: RootfsExecutionPlanOptions): Promise; interface ParsedRootfsRunnerInputs { buildPlan: RootfsBuildPlan; availability: RootfsToolchainAvailability; referenceRootfsDir?: string; createdAt?: string; } interface RootfsIpfsUploadResult { cid: string; responseText: string; sourceSizeBytes?: number; itemHash?: string; apiHost?: string; cleanup?: () => Promise; } declare function parseRootfsRunnerInputs(env?: NodeJS.ProcessEnv): Promise; declare function runLocalCommand(command: { command: string; args: string[]; workdir?: string; env?: Record; }): Promise; declare function uploadRootfsImageToIpfs(buildPlan: RootfsBuildPlan, env?: NodeJS.ProcessEnv): Promise; declare function emitRootfsOutputs(result: RootfsPublishExecutionResult, env?: NodeJS.ProcessEnv): Promise; declare function runRootfsMode(env?: NodeJS.ProcessEnv, hooks?: { stdout?: (text: string) => void; parseInputs?: typeof parseRootfsRunnerInputs; buildRootfs?: typeof buildRootfs; runCommand?: typeof runLocalCommand; uploadRootfsImageToIpfs?: typeof uploadRootfsImageToIpfs; }): Promise; declare function rootfsMain(): Promise; interface RelayProbeResult { address: string; protocols: string[]; family: string; required: boolean; ok: boolean; dialMs: number | null; pingMs: number | null; remoteAddrs: string[]; error: string | null; warning: string | null; } declare function parseLastJsonObject(text: string): Record; interface SitePublishResult { cidV0: string; cidV1: string; } interface StaticSiteCar { rootCid: any; rootCidV0: string; rootCidV1: string; bytes: Uint8Array; } declare function cidV0ToV1(cidV0: string): string; declare function buildStaticSiteCar(directory: string): Promise; declare function computeStaticSiteDirectoryCid(directory: string): Promise; declare function uploadStaticSiteDirectory(directory: string, gateway: string): Promise; interface BrowserTransportCerthashVerification { ok: boolean; profile: string; webtransport: string[]; webrtcDirect: string[]; missingCerthash: string[]; errors: string[]; } declare function verifyBrowserTransportCerthashes(addrs: string[], profile?: string): BrowserTransportCerthashVerification; declare function runSitePublishMode(env?: NodeJS.ProcessEnv): Promise; declare function runDomainLinkMode(env?: NodeJS.ProcessEnv): Promise; declare function runProbeMode(env?: NodeJS.ProcessEnv, options?: { probe?: (addrs: string[], env: NodeJS.ProcessEnv) => Promise; }): Promise; declare function runBootstrapEnvMode(env?: NodeJS.ProcessEnv): Promise; declare function runSiteMode(env?: NodeJS.ProcessEnv): Promise; export { type BrowserTransportCerthashVerification, type DeployConfigurationResult, type DeployExecutorDependencies, type DeployMetadataResult, type DeployOutputResult, type DeployPlan, type DeploymentCrnSource, type DeploymentPlacementStrategy, type DerivedUcanStoreBootstrapOptions, type ParsedRootfsRunnerInputs, type PrivateKeyIdentity, type UcanStoreBootstrapDerivationMode, actionLog, appendGithubOutput, appendGithubSummary, booleanEnv, buildScaffoldDeployResult, buildStaticSiteCar, cidV0ToV1, computeStaticSiteDirectoryCid, createPrivateKeyIdentity, createPrivateKeySigner, deriveUcanStoreBootstrapPackage, deriveUcanStoreBootstrapPackageFromEnv, emitDeployOutputs, emitGeocodedCrnOutputs, emitRootfsOutputs, executeDeployPlan, integerEnv, jsonEnv, loadRootfsManifestForDeploy, main, optionalEnv, parseDeployPlan, parseLastJsonObject, parseRootfsRunnerInputs, requiredEnv, resolveDeployPlanRootfs, rootfsMain, runActionMode, runBootstrapEnvMode, runDomainLinkMode, runLocalCommand, runProbeMode, runRootfsMode, runSiteMode, runSitePublishMode, shouldDeriveUcanStoreBootstrapPackage, uploadStaticSiteDirectory, verifyBrowserTransportCerthashes };