import type { ApprovalCategory, ApprovalChoice } from "../knowledge/native-approvals.js"; import { NATIVE_APPROVAL_REQUEST_IDS } from "../knowledge/native-approvals.js"; import type { NativeSettingsSnapshot } from "../knowledge/native-settings.js"; import type { NativeApprovalContent } from "./native-approval-content.js"; import type { FileApprovalIdentity, FileApprovalItem, FileApprovalRequest } from "./native-approval-files.js"; export interface ApprovalProposal { readonly category: ApprovalCategory; readonly choices: readonly (ApprovalChoice & { readonly payload: unknown; })[]; readonly details: string; readonly nativeId: string | number; readonly sessionId: string; readonly turnId: string; } export type ApprovalProtocolMessage = { readonly kind: "content"; readonly sessionId: string; readonly turnId: string; readonly events: readonly NativeApprovalContent[]; } | { readonly kind: "session-usage"; readonly sessionId: string; readonly event: Extract; } | { readonly kind: "file-item"; readonly item: FileApprovalItem; } | { readonly kind: "file-request"; readonly request: FileApprovalRequest; } | { readonly kind: "file-item-ended"; readonly item: FileApprovalIdentity; readonly events: readonly NativeApprovalContent[]; } | { readonly kind: "reply"; readonly operation: keyof typeof NATIVE_APPROVAL_REQUEST_IDS; readonly value: unknown; readonly failed: boolean; } | { readonly kind: "request"; readonly proposal: ApprovalProposal; } | { readonly kind: "cleared"; readonly nativeId: string | number; readonly sessionId: string; } | { readonly kind: "message"; readonly sessionId: string; readonly turnId: string; readonly text: string; } | { readonly kind: "complete"; readonly error: string | null; readonly sessionId: string; readonly turnId: string; readonly interrupted: boolean; readonly failed: boolean; } | { readonly kind: "ignored"; readonly method: string; } | { readonly kind: "unsupported"; }; export declare function approvalInitialize(): string; export declare function approvalInitialized(): string; export declare function approvalResume(saved: NativeSettingsSnapshot): string; export declare function approvalStart(sessionId: string, prompt: string): string; export declare function approvalResponse(nativeId: string | number, payload: unknown): string; export declare function matchesApprovalResume(value: unknown, saved: NativeSettingsSnapshot): boolean; export declare function approvalTurnId(value: unknown): string | null; export declare function decodeApprovalProtocol(value: unknown): ApprovalProtocolMessage; export declare function validNativeApprovalOptions(options: object): boolean; export declare function hasUserApprovalAuthority(saved: NativeSettingsSnapshot | undefined): saved is NativeSettingsSnapshot; export interface ApprovalDecision { readonly choiceId: string; readonly id: string; readonly requestId: string; } export type ParsedApprovalDecision = { readonly kind: "valid"; readonly decision: ApprovalDecision; } | { readonly kind: "invalid"; readonly id: string | null; readonly requestId: string | null; }; export declare function parseApprovalDecision(raw: string): ParsedApprovalDecision; //# sourceMappingURL=native-approvals.d.ts.map