import { type RpcCommand, type RpcResponse } from "./rpc-types.ts";
import type { RpcSessionEntry } from "./session-registry.ts";
import { type ReleaseSettlePort } from "./session-release-interrupt.ts";
/** `customType` of the transcript entry a release appends. */
export declare const SESSION_RELEASED_ENTRY_TYPE = "session_released";
export type ReleaseSessionCommand = Extract<RpcCommand, {
    type: "release_session";
}>;
/** What `pi.session.admitExternalMessage` throws once a release has closed admission. */
export declare const RELEASED_ADMISSION_CLOSED = "release_session handed this session to another runtime; deliver there instead (admission is closed here)";
/** `errorData.hint` of a refusal whose `busy` names `queued`: only an interrupt hands that input back. */
export declare const RELEASE_QUEUED_HINT = "queued user input is still owed a turn; release with interrupt: true to take it out and receive it in dropped.user_messages";
export type ReleaseBusySignal = "turn" | "prompt" | "queued" | "delivery" | "bash" | "compaction" | "session_work" | "activity" | "request";
/** What the router lends a release: its lookup, its request accounting, and the park teardown. */
export interface SessionReleasePort extends ReleaseSettlePort {
    readonly draining: () => boolean;
    readonly hostInstance: string | undefined;
    /** The live entry, or a throw carrying the wire code (`unknown_session`, `session_closing`). */
    lookup(sessionId: string): RpcSessionEntry;
    code(cause: unknown): string;
    /** Requests for the session in flight on any connection, the release itself not counted. */
    otherRequests(sessionId: string): number;
    /** Caller holds are already authorized; force is required only for OTHER attachments. */
    otherAttachments(sessionId: string): number;
    /**
     * Claims every attachment and tears the session down, sealing it as released. Its claim is taken
     * before its first await. `false` when another close already owns the entry.
     */
    tearDown(sessionId: string, sessionPath: string): Promise<boolean>;
}
export declare function releaseSession(port: SessionReleasePort, command: ReleaseSessionCommand): Promise<RpcResponse>;
//# sourceMappingURL=session-release.d.ts.map