/** * The static-mode chat admission adapter. On a static-auth mesh the local manager admits the * session (`chat-session-open`): it draws the `chat_` alias and a fresh nkey identity and mints the * session's own leaf. This adapter runs one real `CotalEndpoint` under that leaf and ends the * session with `chat-session-retire` at the same manager instance that admitted it, on close or at * the leaf's expiry. `cotal chat` opens it for a static-auth target. * * The leaf never crosses the wire in the clear. The adapter sends a one-time curve key as * `sealTo`, and the manager seals the leaf to it, bound to the space, the admitting instance and * every reply field; a generic invoke, an agent tool or a browser sees only that ciphertext. The * adapter opens it once, checks every bound field, keeps the leaf in memory, and never writes it to * a file, a receipt, a log or any output record. Its retire path never sees it. * * The caller resolves the mesh once, into `target`. Every manager call mints its one-shot * instrument from a copy of that target's server, TLS requirement and trust material, so a later * `cotal use` or registry change cannot move the retirement to another mesh. */ import { SealRecipient } from "@cotal-ai/core"; import { type MeshTarget } from "@cotal-ai/workspace"; import { type ManagerReply } from "../lib/control.js"; import { NativeChatSession } from "./native-session.js"; import type { CloseReport } from "./session.js"; /** The leaf's whole life. The manager caps `ttl` here and never renews it. */ export declare const STATIC_CHAT_TTL_SEC = 900; /** What `chat-session-open` returned, checked. `actor` is the session's wire authority and * `alias` its routing-only slot name. */ export interface StaticAdmission { readonly alias: string; readonly actor: string; readonly lifecycleUid: string; readonly creds: string; readonly expiresAt: number; } /** Open and check one `chat-session-open` reply. The outer reply must have its contract shape; * the sealed payload must open with `recipient`, which it uses up, must carry exactly the sealed * keys, and must bind the expected space and responding instance, this recipient's own key and * the outer alias, actor, uid and expiry; and its credential must be the identity it names. * Undefined when any part does not hold; the caller never uses a reply that fails here. */ export declare function readAdmission(data: unknown, recipient: SealRecipient, expected: { readonly space: string; readonly managerInstanceId: string; }): StaticAdmission | undefined; /** The close report for a `chat-session-retire` reply. The adapter asks only after its own * endpoint stopped, so `connectionClosed` is that observed stop, and `NativeChatSession` * downgrades it when the stop failed. The retirement outcome is reported apart from it and never * changes it. A static mesh has no broker-side revocation, so no outcome here ends the leaf at * the broker: a copy of it still authenticates until `validUntil`. */ export declare function retireReport(reply: ManagerReply, managerInstanceId: string, validUntil: number): CloseReport; /** Open one static chat session on `target`, which the caller resolved once. The three lists are * a spawn's, under its rules: `subscribe` the initial channels, `allowSubscribe` the read ceiling * (empty means `subscribe`), `allowPublish` the post list (empty means none). `instanceId` * (`--on`) chooses the admitting manager; retirement always goes to the instance that answered * the open. */ export declare function openStaticChatSession(target: MeshTarget, options: { readonly label: string; readonly subscribe?: readonly string[]; readonly allowSubscribe?: readonly string[]; readonly allowPublish?: readonly string[]; readonly instanceId?: string; }): Promise; //# sourceMappingURL=static-session.d.ts.map