import { type NolArtifactRef, type NolModelManifest, type NolRecipeRevision } from "../_types/schemas/nol.js"; import { type NolExportPlan } from "../_types/schemas/nol-assets.js"; import { type NolArtifactStore } from "../_types/execution/nol/artifacts.js"; import { type NolGgufEditorRuntime } from "../_types/execution/nol/gguf-checkpoint-edits.js"; import type { NolJob, NolStore } from "../_types/orchestrator/nol/store.js"; export declare const NOL_EXPORT_JOB_KIND = "nol_asset_export"; /** All executable paths, runtime pins and root resolution originate in the host. * No export plan can provide Python, a filesystem path, an executor or a hook. */ interface ProfileBase { id: string; pythonPath: string; limits: NolExportPlan["limits"]; resolveCheckpoint(model: NolModelManifest, signal: AbortSignal): Promise; assertCurrent(): void; } export type NolExportExecutionProfile = ProfileBase & ({ exporter: "checkpoint"; editorPath: string; expectedEditorSha256: string; } | { exporter: "gguf"; editorPath: string; expectedEditorSha256: string; dependencyLockPath: string; runtime: NolGgufEditorRuntime; } | { exporter: "lora"; exporterPath: string; expectedExporterSha256: string; checkpointEditorPath: string; expectedCheckpointEditorSha256: string; }); export interface NolExportContext { actorId: string; assertAuthorized(): void; signal?: AbortSignal; } export interface NolExportExecutionInput { /** Trusted host path, absent from the frozen JSON plan/profile. */ onFailureDiagnostic?(value: unknown): Promise; plan: NolExportPlan; profile: NolExportExecutionProfile; model: NolModelManifest; recipe: NolRecipeRevision; checkpointRoot: string; sourceCheckpoints: Array<{ model: NolModelManifest; root: string; }>; artifactRoot: string; outputDirectory: string; signal: AbortSignal; } export interface NolExportExecutionResult { outputDirectory: string; model: NolModelManifest; receipt: { parentModelDigest: string; recipeDigest: string; [key: string]: unknown; }; receiptArtifact: NolArtifactRef; receiptPath: string; } export interface NolExportResult { schema: "omnius.nol.export-result.v1"; projectId: string; jobId: string; generation: number; planDigest: string; plan: NolArtifactRef; executionProfileDigest: string; artifactKind: "checkpoint" | "adapter"; model: NolArtifactRef; modelDigest: string; recipe: NolArtifactRef; parents: Array<{ model: NolArtifactRef; modelDigest: string; }>; receipt: NolArtifactRef; files: NolModelManifest["files"]; scientificVerdict: "unvalidated"; activationAuthorized: false; } export interface NolExportServiceOptions { id: string; projectRoot: string; workRoot: string; store: NolStore; artifacts: NolArtifactStore; ownerId: string; profiles: readonly NolExportExecutionProfile[]; limits: { maxJobs: number; maxOutputBytesPerJob: number; maxMetadataBytesPerJob: number; maxTotalStorageBytes: number; minimumFreeBytes: number; }; leaseMs?: number; /** Trusted embedding-host seam. The shipped default executes the pinned * CPU exporters; this callback is never accepted from a plan or transport. */ execute?: (input: NolExportExecutionInput) => Promise; } /** CPU export jobs with bounded, nonrefundable durable storage admission. * Each immutable slot reserves a complete worst-case output directory AND CAS * copy before execution. Known CAS references then receive normal transactional * reservations before publication. Slots survive failures, orphaned output and * service reopen; this is not an assertion of a system-wide disk reservation. */ export declare class NolExportService { private readonly options; readonly projectId: string; readonly scopeDigest: string; private readonly root; private readonly workRoot; private readonly scope; private readonly scopeId; private readonly profiles; private readonly ownerId; private readonly leaseMs; private readonly limits; private readonly casQuota; private readonly active; private closing; constructor(options: NolExportServiceOptions); get ownedJobIds(): string[]; private assertScope; private authorize; private profile; private admission; submit(input: unknown, context: NolExportContext): NolJob; run(jobId: string, context: NolExportContext): Promise; cancel(jobId: string, actorId: string, reason?: string): NolJob; stopOwned(actorId: string, reason?: string): Promise; shutdown(): Promise; private current; private space; private execute; result(jobId: string, context: NolExportContext): Promise; } export declare function executeNolExport(input: NolExportExecutionInput): Promise; export {};