import type { RuntimeSessionEvent } from "@skaile/workspaces/types"; /** * Snapshot of the tier-1 resume state last surfaced to the platform via a * `runtime_session` event. */ export type RuntimeSessionSnapshot = { driverSessionId: string; model: string | null; capabilitySignature: string; }; /** * Decide whether to emit a `runtime_session` event after a turn completes. * * The runner surfaces the driver's SDK session id (the tier-1 native-resume * token) plus the model and capability signature so the platform can persist * them on the Session independently of compaction. We emit whenever ANY of the * three changes since the last emission — not only on a session-id change — so * a mid-session shift (e.g. a live skill add that changes capabilities without * recreating the driver, or a model reconfigure) keeps the platform's stored * wake-time guards fresh. A stale signature/model would otherwise make the * wake-time guard drop a still-valid session to lossy tier-2 resume. * * The caller MUST short-circuit on a missing `driverSessionId` BEFORE computing * the capability signature, so the early no-session turns do not pay for the * hash needlessly; once a session id exists the per-turn compute is what * detects signature drift. * * Pure so the emit-on-change rule is unit-testable without booting serve. * * @returns the event to emit, or `null` when there is no session id yet or * nothing changed since `lastEmitted`. */ export declare function planRuntimeSessionEmit(input: { driverSessionId: string | undefined; model: string | null; capabilitySignature: string; lastEmitted: RuntimeSessionSnapshot | undefined; }): RuntimeSessionEvent | null; //# sourceMappingURL=runtime-session-emit.d.ts.map