import { type Adapter, type OperationKind } from "../protocol/operation-registry"; export type ChatTransport = Extract; export type ChatOperationDisposition = "allowed" | "unsupported_on_chat"; export interface ChatCommandError { code: "unsupported_on_chat" | "secret_input_forbidden"; message: string; } export type ChatCommandDecision = { ok: true; } | { ok: false; error: ChatCommandError; }; export interface ChatOperationRequest { kind: OperationKind; operation: string; input?: unknown; } /** * Chat authorization follows each transport's canonical registry disposition. * Explicit policy prohibitions remain as defense in depth for shell execution, * callback-provider registration, and endpoint credentials. */ export declare const CHAT_OPERATION_POLICY: Readonly>>>; /** Reject unsafe or unknown commands before their SDK request can be sent. */ export declare function authorizeChatOperation(transport: ChatTransport, request: ChatOperationRequest): ChatCommandDecision; /** Execute only an authorized command, ensuring rejected payloads produce no SDK send. */ export declare function sendAuthorizedChatOperation(transport: ChatTransport, request: ChatOperationRequest, send: () => Promise): Promise<{ ok: true; result: T; } | { ok: false; error: ChatCommandError; }>; export type ChatCommandOutcome = { ok: true; result: unknown; } | { ok: false; error: { code: string; message: string; }; }; /** * The chat transport is an untrusted presentation surface, not a general SDK * result renderer. Never serialize SDK result bodies or provider error text. */ export declare function projectChatCommandOutcome(request: Pick, outcome: ChatCommandOutcome): Record;