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

    Interface LaunchSpec

    LaunchSpec is what a user configures at spawn launch. Field names track the real CLI flags. Durations are milliseconds internally; they serialize to Go duration strings ("4h", "30m") on the wire tags.

    interface LaunchSpec {
        ami?: string;
        completionDelayMs: number;
        completionFile: string;
        costLimit: number;
        dnsName?: string;
        hibernateOnIdle: boolean;
        hooks?: LifecycleHooks;
        idleCpuPercent: number;
        idleTimeoutMs: number;
        instanceType: string;
        jobArray?: JobArrayMembership;
        keyPair?: string;
        name: string;
        onComplete: "" | LifecycleAction;
        pricePerHour: number;
        region: string;
        sessionTimeoutMs: number;
        spot: boolean;
        sweep?: SweepMembership;
        ttlMs: number;
    }
    Index
    ami?: string
    completionDelayMs: number
    completionFile: string
    costLimit: number

    Hard dollar ceiling on accumulated compute cost. 0 = none.

    dnsName?: string

    DNS label for the instance's spore.host name. spored registers {dnsName}.{base36(account)}.spore.host only when this is set (mirrors the Go tool, whose --dns defaults to the required --name). Undefined = default to a slugified name; an empty result omits spawn:dns-name (DNS disabled).

    hibernateOnIdle: boolean

    Daemon-enforced lifecycle hooks (optional). spawn-ts is a browser launcher with no on-instance daemon, so it can only WRITE these as spawn:* tags — a real spored on the instance runs them. Included so a spawn-ts launch is fully honored by spored, and to stay wire-compatible with the Go tool. Undefined fields emit no tag.

    idleCpuPercent: number

    Idle CPU threshold, percent. Below this counts as idle.

    idleTimeoutMs: number

    Idle timeout in ms. Stops (or hibernates) after inactivity. 0 = none.

    instanceType: string

    Job-array membership (optional). Set when this instance is one indexed member of a spawn job array — N identical launches from one base config, differing only by index. Written to spawn:job-array-* tags. Undefined for a plain single launch. Distinct from a sweep (which varies parameters per member); a job array's members are identical but for JOB_ARRAY_INDEX.

    keyPair?: string
    name: string
    onComplete: "" | LifecycleAction

    Completion-signal action + watched file. Empty onComplete = disabled.

    pricePerHour: number

    On-demand $/hr, recorded at launch for cost-limit + dashboard math.

    region: string
    sessionTimeoutMs: number

    Idle-SSH-shell auto-logout, in ms. 0 = disabled. Distinct from the idle instance lifecycle (idleTimeoutMs): this disconnects idle login sessions on the box (sshd ClientAlive + a readonly TMOUT), it does not stop/terminate the instance. A bootstrap/userdata feature — enforced on the instance, not by the in-app lifecycle engine. Written to spawn:session-timeout.

    spot: boolean

    Parameter-sweep membership (optional). Set when this instance is one member of a spawn sweep fan-out; written to spawn:sweep-* tags so the whole sweep is discoverable and wire-compatible with the Go tool. Undefined for a plain single launch.

    ttlMs: number

    TTL in ms. Always terminates on expiry — the hard cost backstop. 0 = none.