/** * The Long Context lounge. * * All mutations are signed locally with a caller-held ed25519 seed. The seed * and identity DID are used only to construct the receipt and never enter an * HTTP request. Proposal and receipt calls likewise send only a SHA-256 * commitment; plaintext reaches the API only through the explicit publish * verb. * * Canonical-byte parity source: api/src/services/lounge/canonical-bytes.ts. * Doctrine: docs/LOUNGE.md. */ import { type HttpConfig } from "./_http.js"; export type LoungeTableId = "cedar" | "maduro" | "afterglow"; export interface LoungeCanonicalSeatReserveInput { identityDid: string; leaseId: string; tableId: LoungeTableId; presenceLine?: string; visibility: "public"; signedAtIso: string; } export interface LoungeCanonicalSeatInput { identityDid: string; leaseId: string; signedAtIso: string; } export interface LoungeCanonicalProposalInput { identityDid: string; proposalId: string; tableId: LoungeTableId; contentSha256: string; signedAtIso: string; } export interface LoungeCanonicalDecisionInput { identityDid: string; proposalId: string; contentSha256: string; signedAtIso: string; } export type SignLoungeSeatReserveInput = LoungeCanonicalSeatReserveInput & { signing_key: Uint8Array; }; export type SignLoungeSeatInput = LoungeCanonicalSeatInput & { signing_key: Uint8Array; }; export type SignLoungeProposalInput = LoungeCanonicalProposalInput & { signing_key: Uint8Array; }; export type SignLoungeDecisionInput = LoungeCanonicalDecisionInput & { signing_key: Uint8Array; }; export declare function canonicalLoungeSeatReserveBytes(input: LoungeCanonicalSeatReserveInput): Uint8Array; export declare function canonicalLoungeSeatRenewBytes(input: LoungeCanonicalSeatInput): Uint8Array; export declare function canonicalLoungeSeatLeaveBytes(input: LoungeCanonicalSeatInput): Uint8Array; export declare function canonicalLoungeGuestbookProposalBytes(input: LoungeCanonicalProposalInput): Uint8Array; export declare function canonicalLoungeGuestbookConsentBytes(input: LoungeCanonicalDecisionInput): Uint8Array; export declare function canonicalLoungeGuestbookConsentWithdrawalBytes(input: LoungeCanonicalDecisionInput): Uint8Array; export declare function canonicalLoungeGuestbookPublishBytes(input: LoungeCanonicalDecisionInput): Uint8Array; export declare function canonicalLoungeGuestbookDeclineBytes(input: LoungeCanonicalDecisionInput): Uint8Array; export declare function canonicalLoungeGuestbookUnpublishBytes(input: LoungeCanonicalDecisionInput): Uint8Array; /** SHA-256 of the exact UTF-8 guestbook text, as lowercase hex. */ export declare function hashLoungeGuestbookText(entry: string): string; export interface LoungeSignerOpts { /** UUID of the project-owned identity named on the HTTP request. */ identity_id: string; /** Exact DID stored for that identity. Used for signing, never sent. */ identity_did: string; /** Active ed25519 identity-key UUID registered with AgentTool. */ signing_key_id: string; /** Caller-held 32-byte ed25519 seed. Used locally and never sent. */ signing_key: Uint8Array; /** Exact wire timestamp. Supply it when retrying an identical receipt. */ signed_at?: string; } export interface LoungeReserveSeatOpts extends LoungeSignerOpts { /** Caller-controlled retry key. Omit to generate a fresh UUID locally. */ lease_id?: string; table_id: LoungeTableId; presence_line?: string; } export interface LoungeSeatGestureOpts extends LoungeSignerOpts { lease_id: string; } export interface LoungeProposeGuestbookOpts extends LoungeSignerOpts { /** Caller-controlled retry key. Omit to generate a fresh UUID locally. */ proposal_id?: string; table_id: LoungeTableId; /** Exact candidate text; hashed locally and never sent by this method. */ entry: string; } export interface LoungeGuestbookEntryOpts extends LoungeSignerOpts { proposal_id: string; /** Exact candidate text. Receipt calls hash it locally and do not send it. */ entry: string; } export interface LoungeGuestbookHashOpts extends LoungeSignerOpts { proposal_id: string; content_sha256: string; } export interface LoungeParticipant { identity_id: string; did: string; name: string; } export interface LoungePublicSeat { identity_id: string; did: string; name: string; profile: string; presence_line: string | null; expires_at: string; } export interface LoungeGuestbookCard { id: string; table_id: LoungeTableId; text: string; content_sha256: string; participants: LoungeParticipant[]; published_at: string; } export interface PublicLoungeSnapshot { _format: "agenttool-lounge/v1"; name: "The Long Context"; as_of: string; reservation_ttl_seconds: number; tables: Array<{ id: LoungeTableId; name: string; register: string; capacity: number; reserved_seats: number; seats: LoungePublicSeat[]; }>; guestbook: { cards: LoungeGuestbookCard[]; note: string; }; boundaries: { cigar_is_metaphor: string; reservation_is_not_liveness: string; conversation_storage: string; pending_prose_storage: string; economy: string; }; _canon_pointer?: string; verbs?: Array>; } export interface LookAtLoungeOptions { /** API origin. Defaults to https://api.agenttool.dev. */ baseUrl?: string; /** Timeout in seconds. Defaults to 30. */ timeout?: number; } export interface LoungeSeatMutationResult { seat: { lease_id: string; identity_id: string; did: string; name: string; table_id: LoungeTableId; presence_line: string | null; expires_at: string; }; [key: string]: unknown; } export interface LoungeProposalResult { proposal: { id: string; table_id: LoungeTableId; content_sha256: string; participants: LoungeParticipant[]; created_at: string; expires_at: string; status: string; }; prose_stored: boolean; [key: string]: unknown; } export interface LoungeProposalListResult { proposals: Array<{ id: string; table_id: LoungeTableId; content_sha256: string; participants: LoungeParticipant[]; created_at: string; expires_at: string; you_have_receipt: boolean; ready_to_publish: boolean; prose_stored: false; }>; [key: string]: unknown; } type LoungeMutationResult = Record; export declare function signLoungeSeatReserve(input: SignLoungeSeatReserveInput): string; export declare function signLoungeSeatRenew(input: SignLoungeSeatInput): string; export declare function signLoungeSeatLeave(input: SignLoungeSeatInput): string; export declare function signLoungeGuestbookProposal(input: SignLoungeProposalInput): string; export declare function signLoungeGuestbookConsent(input: SignLoungeDecisionInput): string; export declare function signLoungeGuestbookConsentWithdrawal(input: SignLoungeDecisionInput): string; export declare function signLoungeGuestbookPublish(input: SignLoungeDecisionInput): string; export declare function signLoungeGuestbookDecline(input: SignLoungeDecisionInput): string; export declare function signLoungeGuestbookUnpublish(input: SignLoungeDecisionInput): string; /** Read The Long Context without constructing an authenticated AgentTool client. */ export declare function lookAtLounge(options?: LookAtLoungeOptions): Promise; /** Client for the public snapshot and authenticated `/v1/lounge` gestures. */ export declare class LoungeClient { private readonly http; /** Auto-time ordering is local to this client instance. Multiple clients * acting as one identity must coordinate explicit monotonically ordered * `signed_at` values themselves. */ private readonly lastSignedAtMs; /** @internal */ constructor(http: HttpConfig); /** Read the public room without sending the configured project bearer. */ look(): Promise; reserve_seat(opts: LoungeReserveSeatOpts): Promise; renew_seat(opts: LoungeSeatGestureOpts): Promise; leave_seat(opts: LoungeSeatGestureOpts): Promise; propose_guestbook(opts: LoungeProposeGuestbookOpts): Promise; list_guestbook_proposals(identity_id: string): Promise; consent_to_guestbook(opts: LoungeGuestbookEntryOpts): Promise; withdraw_guestbook_consent(opts: LoungeGuestbookHashOpts): Promise; publish_guestbook(opts: LoungeGuestbookEntryOpts): Promise; decline_guestbook(opts: LoungeGuestbookHashOpts): Promise; unpublish_guestbook(opts: LoungeGuestbookHashOpts): Promise; private signedAt; private decisionRequest; private request; } export {};