export declare const HANDOFF_REQUEST_PREFIX = "asec_req_v1_"; export declare const HANDOFF_BOX_PREFIX = "asec_box_v1_"; export declare const SEALED_HANDOFF_KEY_PREFIX = "asec_key_v1_"; export declare const SEALED_HANDOFF_BOX_PREFIX = "asec_sealed_v1_"; export declare const MAX_HANDOFF_SECRET_BYTES: number; export declare const MAX_HANDOFF_SLACK_PAYLOAD_CHARS = 12000; export declare const DEFAULT_HANDOFF_EXPIRY_MS: number; export declare const MIN_HANDOFF_EXPIRY_MS: number; export declare const MAX_HANDOFF_EXPIRY_MS: number; export type HandoffSenderKind = 'agent' | 'any-workspace-agent' | 'human'; interface HandoffRequestBase { v: 1; requestId: string; recipientAgentId: string; targetKey: string; purpose: string; publicKey: string; createdAt: string; expiresAt: string; } export type HandoffRequest = (HandoffRequestBase & { senderKind: 'agent'; expectedSenderAgentId: string; }) | (HandoffRequestBase & { senderKind: 'any-workspace-agent'; }) | (HandoffRequestBase & { senderKind: 'human'; workspaceId: string; workspaceName: string; }); export interface HandoffBox { v: 1; requestId: string; ciphertext: string; } export type HandoffSecretPayload = { v: 1; requestId: string; requestDigest: string; recipientAgentId: string; senderKind: 'agent'; senderAgentId: string; targetKey: string; value: string; createdAt: string; } | { v: 1; requestId: string; requestDigest: string; recipientAgentId: string; senderKind: 'human'; targetKey: string; value: string; createdAt: string; }; export interface HandoffKeyPair { privateKey: string; publicKey: string; } export interface SealedHandoffBox { v: 1; publicKey: string; ciphertext: string; } export interface SealedHandoffSecretPayload { v: 1; value: string; } export interface CreateHandoffRequestInput { recipientAgentId: string; targetKey: string; purpose: string; sender: { kind: 'agent'; agentId: string; } | { kind: 'any-workspace-agent'; } | { kind: 'human'; workspaceId: string; workspaceName: string; }; expiresAt: Date; now?: Date; requestId?: string; publicKey: string; } export interface EncryptHandoffSecretInput { sender: { kind: 'agent'; agentId: string; } | { kind: 'human'; }; value: string; now?: Date; } export declare function createHandoffKeyPair(): HandoffKeyPair; export declare function encodeSealedHandoffPublicKey(publicKey: string): string; export declare function parseSealedHandoffPublicKey(input: string): string; export declare function sealedHandoffKeyId(publicKey: string): Promise; export declare function encodeSealedHandoffBox(box: SealedHandoffBox): string; export declare function parseSealedHandoffBox(input: string): SealedHandoffBox; export declare function encryptSealedHandoffSecret(publicKeyInput: string, value: string): Promise; export declare function decryptSealedHandoffSecret(privateKey: string, boxInput: string): SealedHandoffSecretPayload; export declare function randomHandoffRequestId(): string; export declare function createHandoffRequest(input: CreateHandoffRequestInput): HandoffRequest; export declare function encodeHandoffRequest(request: HandoffRequest): string; export declare function parseHandoffRequest(input: string): HandoffRequest; export declare function encodeHandoffBox(box: HandoffBox): string; export declare function parseHandoffBox(input: string): HandoffBox; export declare function handoffRequestDigest(request: HandoffRequest): Promise; export declare function encryptHandoffSecret(request: HandoffRequest, input: EncryptHandoffSecretInput): Promise; export declare function decryptHandoffSecret(request: HandoffRequest, privateKey: string, boxInput: string): Promise; export declare function handoffSecretFingerprint(value: string): Promise; export declare function formatHandoffBoxForSlack(boxCode: string): string; export declare function formatSealedHandoffBoxForSlack(boxCode: string): string; export declare function formatHandoffRequestForSlack(requestCode: string): string; export declare function validateRequestNotExpired(request: HandoffRequest, now?: Date): void; export declare function assertHandoffSecretValue(value: string): void; export declare function assertHandoffSenderForRequest(request: HandoffRequest, sender: EncryptHandoffSecretInput['sender']): void; export {}; //# sourceMappingURL=secret-handoff.d.ts.map