/** Whether a metadata id uses Claude Code's legacy cloaking shape. */ export declare function isClaudeCloakingUserId(userId: string): boolean; /** Extract a stable session id from a supported Anthropic metadata user id. */ export declare function extractClaudeMetadataSessionId(userId: unknown): string | undefined; /** Generate a legacy Claude Code cloaking metadata id. */ export declare function generateClaudeCloakingUserId(): string; /** Derive the stable Claude device id for an installation and optional account. */ export declare function deriveClaudeDeviceId(installId: string, accountId?: string): string; /** Read a non-empty string from provider metadata. */ export declare function readAnthropicMetadataString(metadata: Record | undefined, key: string): string | undefined; /** Resolve the account id aliases accepted in Anthropic request metadata. */ export declare function readAnthropicMetadataAccountId(metadata: Record | undefined): string | undefined; /** Resolve the provider-facing metadata user id for API-key or OAuth requests. */ export declare function resolveAnthropicMetadataUserId(userId: unknown, isOAuthToken: boolean, sessionId?: string, accountId?: string): string | undefined; /** * Rebind a caller-supplied metadata user id to the account serving the request. * * A caller resolves metadata once per model call (`AgentLoop#metadataResolver`), * but a credential rotation inside one stream swaps only the bearer. Without * this, the retry after a rotation sends account B's token with account A's * `account_uuid` and `device_id` — the same cross-account association a pooled * setup must not create. The caller's `session_id` is kept so the conversation * still looks continuous; only the account identity moves. * * Opaque and cloaking shapes are returned untouched: they are either a real * client's own id or one this process did not mint, so rewriting them would be * guessing at its contents. */ export declare function rebindAnthropicMetadataUserId(userId: unknown, accountId: string | undefined): unknown; /** Apply Claude Code's wire-only tool prefix. */ export declare const applyClaudeToolPrefix: (name: string) => string; /** Remove one Claude Code wire-only tool prefix. */ export declare const stripClaudeToolPrefix: (name: string) => string;