Cotal TypeScript packages
    Preparing search index...

    Interface RunHostingContext

    What the host needs from the manager: its coordinates and its trust material.

    interface RunHostingContext {
        admitRun?: (
            args: { runId: string; subject: string },
        ) => Promise<RunAdmission>;
        auth: SpaceAuth | undefined;
        cancelRun?: (
            args: {
                cancel: RunCancelInput;
                stage: "inspect" | "commit";
                subject: string;
            },
        ) => Promise<RemoteRunCancelResult>;
        endpoint: string;
        holder: { id: string; lifecycleUid: string };
        instanceId: string;
        issueAttempt?: (
            args: {
                driver: Identity;
                epoch: number;
                fencingToken: number;
                mediator: Identity;
                runId: string;
                served?: string;
                takeoverId: string;
            },
        ) => Promise<{ driver: string; mediator: string }>;
        issueOperator?: (
            args: {
                answers?: { amend?: true; runId: string; stepKey: string };
                identity: Identity;
                runId?: string;
                served?: string;
                takeoverId: string;
            },
        ) => Promise<string>;
        log: (line: string) => void;
        renewRun?: (
            args: {
                driver: Identity;
                epoch: number;
                fencingToken: number;
                holder: string;
                mediator: Identity;
                runId: string;
                takeoverId: string;
            },
        ) => Promise<{ driver: string; mediator: string }>;
        revokeRun?: (
            args: { reason: string; runId: string },
        ) => Promise<RunRevocation>;
        servers: string | undefined;
        space: string;
        submitRun?: (
            args: { subject: string },
        ) => Promise<RemoteRunSubmissionResult>;
    }
    Index
    admitRun?: (args: { runId: string; subject: string }) => Promise<RunAdmission>

    Signerless host: the closed first-run admission (admitRemoteRun on the issuing host). The manager forwards only the served v1 request subject it rebuilt from the parsed context and the run id it minted; the host resolves the issued caller and writes the admission. Separate from renewRun. Delegation to this registered host, not a proof of an arbitrary message.

    auth: SpaceAuth | undefined

    The space signer on an auth mesh; undefined on an open mesh (bare connections).

    cancelRun?: (
        args: {
            cancel: RunCancelInput;
            stage: "inspect" | "commit";
            subject: string;
        },
    ) => Promise<RemoteRunCancelResult>
    endpoint: string

    The endpoint hosting the runs: the manager's own service name.

    holder: { id: string; lifecycleUid: string }

    This manager process, as a checkpoint's holder-bound resume names it. Each attempt's holder id is derived from id and the takeover id (see the header).

    instanceId: string

    The registration instance id, the coordinate a checkpoint's timer schedule is addressed by.

    issueAttempt?: (
        args: {
            driver: Identity;
            epoch: number;
            fencingToken: number;
            mediator: Identity;
            runId: string;
            served?: string;
            takeoverId: string;
        },
    ) => Promise<{ driver: string; mediator: string }>

    Signerless host: the closed first-attempt/resume issuance for caller-held driver and mediator nkeys (authorizeRemoteRunAttempt then host signing). The host derives epoch/fence from the run record and refuses a revoked or foreign admission. Never used for renewal.

    issueOperator?: (
        args: {
            answers?: { amend?: true; runId: string; stepKey: string };
            identity: Identity;
            runId?: string;
            served?: string;
            takeoverId: string;
        },
    ) => Promise<string>

    Signerless host: one served read or answer's run-operator creds for a caller-held nkey (the callback combines the host JWT with the local seed, as renewRun does).

    log: (line: string) => void
    renewRun?: (
        args: {
            driver: Identity;
            epoch: number;
            fencingToken: number;
            holder: string;
            mediator: Identity;
            runId: string;
            takeoverId: string;
        },
    ) => Promise<{ driver: string; mediator: string }>

    Signerless host: the closed renewRunDriver issuance for one live attempt's SAME driver and mediator nkeys. When set, renewal never mints locally; a refusal keeps last-good and records debt on the slot.

    revokeRun?: (args: { reason: string; runId: string }) => Promise<RunRevocation>

    Issuing-host revoke under the authenticated holder, never the local by argument.

    servers: string | undefined
    space: string
    submitRun?: (args: { subject: string }) => Promise<RemoteRunSubmissionResult>

    Distinct observed keyed protocol. Absence refuses keyed commands, never legacy fallback.