import type { SessionMessagingFacet } from "@yanlinglabs/winter-agent-sdk"; import type { ListedRuntimeObject, SerializedRuntimeAddress } from "../seams/messaging-contract.js"; /** The live status a handle can report, when it can. Same vocabulary as the directory's own. */ export type LiveSessionStatus = ListedRuntimeObject["status"]; export interface AttachedSession { /** * Push one turn into this session's input stream. * * The text is ALREADY RENDERED (attributed, escaped) by the time it gets here — a handle is a pipe, * not a policy. Absent on a Winter handle that only carries a facet: the facet's own `deliver` is * the runtime-side push, and it renders on the far side. */ push?(text: string): void | Promise; /** The live status, when the host tracks one. Absent falls back to the durable row's `status`. */ status?(): LiveSessionStatus; } export interface AttachedWinterSession extends AttachedSession { /** * `Query.messaging` (R-7b-4). The ONLY door into a spawned Winter session's children — a child * engine has no facet surface of its own, so `steer_child`/`resume_child` on the PARENT's facet is * how a child is reached, never a session address (Task 0 fix r2, concern 4). */ readonly messaging?: SessionMessagingFacet; } export interface AttachedSessionRegistry { /** Register a handle for a canonical address. Returns the detach function. */ attach(address: SerializedRuntimeAddress, handle: T): () => void; detach(address: SerializedRuntimeAddress): void; get(address: SerializedRuntimeAddress): T | undefined; addresses(): SerializedRuntimeAddress[]; } /** * A registry, and deliberately nothing more: no liveness inference, no reaping, no ordering. * * ATTACHING IS THE HOST'S CALL, not something this package can discover. `RuntimeSdk.query()` is * where a session is created, and until that door routes to both branches (spine-owned, Task 6) a * host attaches what it launched. `attach` returning its own detach — rather than the caller * remembering the address — is what keeps a handle from outliving the session in the one case that * matters, a re-launch of the same address: the OLD detach then removes only the handle it added. */ export declare function createAttachedSessionRegistry(): AttachedSessionRegistry;