/**
 * Detectors for relaycast `agent_token_invalid` responses.
 *
 * Mirrors the recovery contract introduced in upstream PR #137. The Agent Relay
 * MCP server (and any SDK consumer) uses these helpers to recognise when a
 * Relaycast agent token has been invalidated mid-session so the stale
 * credential can be cleared and the caller pointed at a fresh
 * `register_agent` call.
 *
 * Detection is intentionally structural: the upstream `@relaycast/sdk`
 * RelayError surfaces a `code` field once PR #137 ships, but until then
 * (and as a defensive fallback) the status + message pair is enough to
 * identify an invalid agent token.
 */
export declare const INVALID_AGENT_TOKEN_CODE = "agent_token_invalid";
export declare const INVALID_AGENT_TOKEN_MESSAGE = "Invalid agent token";
/**
 * True when `error` looks like an invalid-agent-token response from
 * Relaycast. Recognises both the typed `agent_token_invalid` code (PR #137)
 * and the legacy status-401 + "Invalid agent token" message pair.
 *
 * The optional `visited` set guards against cyclic `cause` graphs
 * (`a.cause = b; b.cause = a`) — a `WeakSet` so we don't leak references.
 */
export declare function isInvalidAgentTokenError(error: unknown, visited?: WeakSet<object>): boolean;
/**
 * True when a tool result swallowed an invalid-token error into its
 * content array (the pattern the Agent Relay MCP server uses when an upstream
 * call returns `Invalid agent token` in a 401 body).
 */
export declare function isInvalidAgentTokenToolResult(result: unknown): boolean;
/**
 * Human-readable guidance returned to the MCP client after invalidating a
 * stale agent token. Matches the wording surfaced by the Agent Relay MCP
 * server so prompts that key on this string keep working across both
 * implementations.
 */
export declare function agentTokenRecoveryMessage(): string;
//# sourceMappingURL=relaycast-errors.d.ts.map