import * as ManagerPB from "@norskvideo/norsk-api/lib/manager_pb"; import * as CommonPB from "@norskvideo/norsk-api/lib/shared/common_pb"; import { Bundle, BundleJobSpec, BundleState, Capability, CapabilityRequirement, GpuResource, IntraReplicaRules, JobRequirements, LaunchSpec, NodeAssignedJob, NodeInventory, OnLaunch, StartMode, OnRuntimeFailure, ResiliencePolicy } from "./types"; export declare function fromPbOnRuntimeFailure(pb: ManagerPB.OnRuntimeFailure): OnRuntimeFailure; export declare function fromPbPlacementRule(pb: ManagerPB.PlacementRule): "off" | "soft" | "hard"; export declare function fromPbCapability(pb: CommonPB.Capability): Capability; export declare function fromPbCapabilityRequirement(pb: CommonPB.CapabilityRequirement): CapabilityRequirement; export declare function fromPbGpuResource(pb: CommonPB.GpuResource): GpuResource; export declare function fromPbJobRequirements(pb: ManagerPB.JobRequirements): JobRequirements; export declare function fromPbBundle(pb: ManagerPB.Bundle): Bundle; export declare function fromPbOnLaunch(pb: ManagerPB.OnLaunch): OnLaunch; export declare function toPbOnLaunch(v: OnLaunch): PbOnLaunch; export declare function fromPbBundleState(pb: ManagerPB.BundleState): BundleState; export declare function toPbBundleState(s: BundleState): ManagerPB.BundleState; /** The daemon's own reading (`apiToStartMode`): "manual", else auto — * the empty string a pre-startMode bundle carries included. */ export declare function fromPbStartMode(pb: string): StartMode; export declare function toPbStartMode(v: StartMode): string; export declare function fromPbBundleJobSpec(pb: ManagerPB.BundleJobSpec): BundleJobSpec; /** * Reconstruct the typed `LaunchSpec` from the wire-form `Job` carried * on a `BundleJobSpec`. If the carried Job has `productTemplate` set, this * is a product-template launch; otherwise it's the legacy services/volumes * path. The legacy variant passes the Job through as-is (cast to the * SDK's typed shape — same trick the v0 code used). */ /** Tags starting with this prefix are SDK-managed (well-known reserved * names) — `__stopDateTime` carries the auto-stop instant for example. * Callers can't set them via `LaunchSpec.tags` (silently stripped on * outbound) and they're surfaced as typed fields rather than raw tags * on inbound. */ export declare const RESERVED_TAG_PREFIX = "__"; /** Well-known reserved tag carrying the operator's submitted auto-stop * instant. The daemon has no first-class concept of stop time, so we * ride along on its tag-preservation behaviour. */ export declare const STOP_DATE_TIME_TAG = "__stopDateTime"; /** Phase G — well-known reserved tag carrying the bundle's * `overrideReservation` flag. Bundle-level in the typed API, but Manager * has no bundle field for it, so it rides on each product-template job's * tags exactly as `stopDateTime` does. Read back off whichever job * carries it. */ export declare const OVERRIDE_RESERVATION_TAG = "__overrideReservation"; export declare function fromPbLaunchSpec(pbJob: ManagerPB.Job): LaunchSpec; export declare function fromPbIntraReplicaRules(pb: ManagerPB.IntraReplicaRules): IntraReplicaRules; export declare function fromPbResiliencePolicy(pb: ManagerPB.ResiliencePolicy): ResiliencePolicy; /** * A wire inventory field whose value lay outside the contract and was * replaced at the boundary. `advertised` is what the producer sent, `used` * what the typed inventory carries. * * @public */ export interface InventoryContractViolation { field: "utilizationCap"; advertised: number; used: number; } export declare function fromPbNodeInventory(pb: CommonPB.NodeInventory, onViolation?: (v: InventoryContractViolation) => void): NodeInventory; export declare function fromPbNodeAssignedJob(pb: CommonPB.NodeAssignedJob): NodeAssignedJob; import { PlacementRule, OnLaunch as PbOnLaunch, OnRuntimeFailure as PbOnRuntimeFailure } from "@norskvideo/norsk-api/lib/manager_pb"; export declare function toPbOnRuntimeFailure(b: OnRuntimeFailure): PbOnRuntimeFailure; export declare function toPbPlacementRule(r: "off" | "soft" | "hard"): PlacementRule; export declare function toPbCapability(c: Capability): CommonPB.Capability; export declare function toPbCapabilityRequirement(r: CapabilityRequirement): CommonPB.CapabilityRequirement; export declare function toPbJobRequirements(r: JobRequirements): ManagerPB.JobRequirements; export declare function toPbBundleJobSpec(j: BundleJobSpec): ManagerPB.BundleJobSpec; /** * Project a typed `LaunchSpec` into the wire-form `Job` slot on * `BundleJobSpec`. Manager stamps this template per replica during * bundle expansion (setting jobId, tags, state, currentHash). For the * product-template variant only `productTemplate`, `productTemplateParameters`, and * `startDateTime` are meaningful — the rest stays at proto defaults. * The worker reads `productTemplate` + `productTemplateParameters` and ignores * services / volumes / writeFiles. * * `startDateTime` defaults to `new Date()` (immediate) when callers * omit it; Manager-daemon's `apiToJobTemplate` rejects unset values. */ export declare function toPbLaunchSpec(launch: LaunchSpec): ManagerPB.Job; export declare function toPbIntraReplicaRules(r: IntraReplicaRules): ManagerPB.IntraReplicaRules; export declare function toPbResiliencePolicy(r: ResiliencePolicy): ManagerPB.ResiliencePolicy; export declare function toPbBundle(b: Bundle): ManagerPB.Bundle; //# sourceMappingURL=conversions.d.ts.map