/** * MCP identity probe (2026-10): "WHO AM I?". * * The whole "my session became the agent" class of bug is INVISIBLE from the * outside: an MCP client that carries the wrong key simply acts as somebody * else, with no error anywhere. The backend's `whoami` tool answers exactly * that question, so the bridge can ask it for the key it is holding and tell * the human who their interactive session actually is. * * Used by `teamshare-agent mcp status` and `doctor`. * * Transport notes (the backend's MCP endpoint is strict): * - every POST must accept BOTH response shapes: * `Accept: application/json, text/event-stream` (406 otherwise); * - the session id from `initialize` is echoed in `mcp-session-id` on every * following request; * - the body may be JSON or SSE (`data: {...}` lines) - both are handled. */ export interface McpIdentity { userId?: string | null; name?: string | null; email?: string | null; kind?: string | null; agentId?: string | null; agentStatus?: string | null; companyId?: string | null; sessionMode?: string | null; capabilities?: string[]; keyScopes?: string[]; hint?: string; } export type McpIdentityResult = { ok: true; identity: McpIdentity; } | { ok: false; error: string; }; /** * Ask the MCP endpoint who the given API key acts as. * * Never throws: a failure is returned as `{ ok: false, error }` so a status * command can print it instead of crashing. */ export declare function probeMcpIdentity(url: string, apiKey: string, timeoutMs?: number): Promise; /** A one-line description of an identity, for a status line. */ export declare function describeIdentity(identity: McpIdentity): string;