/** Browser-safe dedicated Connection RPC contract owned by this plugin. */ import type { ConnectionRpcResult } from '@deepseek-ai/dsh-client-connection'; import type { CodexAuthState, CodexLoginMethod, CodexNetworkState, CodexProxyMode, CodexResetCreditsSnapshot, CodexResetRedeemOutcome, CodexUsageSnapshot } from './types.ts'; /** Carrier-neutral result shape shared by both halves of this channel. */ export type RpcResult = ConnectionRpcResult; /** Logical channel registered by the Host half and called by the browser half. */ export declare const CODEX_AUTH_RPC_CHANNEL = "/dsh-codex-provider"; /** Browser-safe authentication RPC face. */ export interface CodexAuthRpcClient { status(signal?: AbortSignal): Promise>; network(signal?: AbortSignal): Promise>; setProxyMode(mode: CodexProxyMode, signal?: AbortSignal): Promise>; usage(signal?: AbortSignal): Promise>; resetCredits(signal?: AbortSignal): Promise>; redeemResetCredit(creditId: string | null, signal?: AbortSignal): Promise>; login(method: CodexLoginMethod, signal?: AbortSignal): Promise>; cancel(signal?: AbortSignal): Promise>; logout(signal?: AbortSignal): Promise>; } /** Minimal Connection caller required by this package. */ export interface CodexAuthConnectionRpc { call(channel: string, endpoint: string, payload: unknown, signal?: AbortSignal): Promise>; } /** Build the browser face over Connection's plugin-owned unary channel. */ export declare function createCodexAuthRpcClient(rpc: CodexAuthConnectionRpc): CodexAuthRpcClient; /** Validate one untrusted Host reply before it reaches UI state. */ export declare function parseCodexAuthState(value: unknown): CodexAuthState | undefined; /** Validate one secret-free network route returned by the Host. */ export declare function parseCodexNetworkState(value: unknown): CodexNetworkState | undefined; /** Validate one secret-free usage snapshot returned by the Host. */ export declare function parseCodexUsageSnapshot(value: unknown): CodexUsageSnapshot | undefined; /** Validate one secret-free banked-reset listing returned by the Host. */ export declare function parseCodexResetCreditsSnapshot(value: unknown): CodexResetCreditsSnapshot | undefined; /** Validate one secret-free redemption outcome returned by the Host. */ export declare function parseCodexResetRedeemOutcome(value: unknown): CodexResetRedeemOutcome | undefined;