spawn-ts API reference - v0.6.0
    Preparing search index...

    Interface ManagedInstance

    ManagedInstance is spawn's view of one instance: the provider-observable identity/state plus the lifecycle config decoded from its spawn:* tags.

    interface ManagedInstance {
        completionDelayMs: number;
        completionFile: string;
        computeSeconds: number;
        costLimit: number;
        cpuPercent: number;
        hibernateOnIdle: boolean;
        hooks?: LifecycleHooks;
        idleCpuPercent: number;
        idleTimeoutMs: number;
        instanceId: string;
        instanceType: string;
        jobArray?: JobArrayMembership;
        lastActivityMs: number;
        launchTimeMs: number;
        name: string;
        onComplete: "" | LifecycleAction;
        pricePerHour: number;
        privateIp?: string;
        publicIp?: string;
        region: string;
        spot: boolean;
        state: InstanceState;
        sweep?: SweepMembership;
        tags: Record<string, string>;
        ttlDeadlineMs: number;
        ttlMs: number;
    }
    Index
    completionDelayMs: number
    completionFile: string
    computeSeconds: number

    Accumulated compute seconds across the instance's whole life (billing only runs while running). Mirrors spawn:compute-seconds — used so cost-limit and cost display survive stop/start without resetting.

    costLimit: number
    cpuPercent: number

    Latest observed CPU %, for idle detection + dashboard.

    hibernateOnIdle: boolean

    Daemon-enforced lifecycle hooks decoded from the instance's spawn:* tags (pre-stop / spot-webhook / notify / active-processes). Undefined when none are set. Informational here — enforced by spored on the instance.

    idleCpuPercent: number
    idleTimeoutMs: number
    instanceId: string
    instanceType: string

    Job-array membership, decoded from the instance's spawn:job-array-* tags. Undefined when the instance is not part of a job array.

    lastActivityMs: number

    Last time (ms epoch) activity was observed; drives idle detection.

    launchTimeMs: number

    Original launch time (ms epoch). Never resets on stop/start.

    name: string
    onComplete: "" | LifecycleAction
    pricePerHour: number
    privateIp?: string
    publicIp?: string
    region: string
    spot: boolean

    Parameter-sweep membership, decoded from the instance's spawn:sweep-* / spawn:param:* tags. Undefined when the instance is not part of a sweep.

    tags: Record<string, string>

    Raw tag map as it exists on the instance (source of truth for config).

    ttlDeadlineMs: number

    Absolute TTL deadline (ms epoch) = launchTime + TTL. Authoritative across stop/wake cycles — never recomputed from "now", so stopping and restarting can't extend an instance's life past its deadline. 0 = no TTL.

    ttlMs: number