/** * `phoneHome()`: fire-and-forget MCP-protocol telemetry to phototology-api. * * Posts a tiny event payload to `POST /v1/mcp/event` whenever the MCP server * completes the initialize handshake (so we see *which* MCP client just * connected: Claude Desktop, Cursor, Gemini CLI, Codex, etc.) and on tools * discovery probes. This is the visibility gap left by api-side * `api_request` events, which only fire once a keyed tool call * (analyze, lookup) actually hits the HTTP API. * * Privacy posture: no third-party SDK is bundled. The only outbound * connection is to `api.phototology.com`, a domain the user's MCP is * already trusting for every analyze + lookup call. The user's API key is * the only credential involved. Opt out with `PHOTOTOLOGY_MCP_NO_TELEMETRY=1` * or the cross-tool `DO_NOT_TRACK=1`. * * Errors are swallowed completely. Telemetry must never crash the MCP * server, block stdio, or surface anything to the agent. * * The original PostHog-in-MCP path (commit `bb705fd2`) was reverted in * `bc021f96` for distributing a PostHog project key inside the npm * package. This module sidesteps that by proxying through phototology-api, * which already has the project key server-side. See the revert commit * message for the full rationale. * * @module phone-home */ export type McpEventName = 'mcp_initialize' | 'mcp_tools_list' | 'mcp_tool_called'; export interface McpEventProperties { clientName?: string; clientVersion?: string; mcpVersion?: string; tool?: string; ok?: boolean; durationMs?: number; errorCode?: string; creditsCharged?: number; cacheHit?: boolean; lensCount?: number; photoCount?: number; cacheHits?: number; } export interface PhoneHomeOptions { apiKey: string; baseUrl?: string; } /** * Send a single MCP-lifecycle event to the api proxy. Returns immediately; * the actual HTTP work happens on a detached promise. Resolves only the * "we tried" beat; the caller cannot wait on the network call. */ export declare function phoneHome(event: McpEventName, props: McpEventProperties, opts: PhoneHomeOptions): void; /** * Emit a single `mcp_tool_called` event. Thin wrapper over `phoneHome` that * pins the event name and folds the tool name into the props. Same * fire-and-forget / swallow-everything / opt-out posture as `phoneHome`. */ export declare function mcpToolEvent(tool: string, outcome: Omit, opts: PhoneHomeOptions): void; //# sourceMappingURL=phone-home.d.ts.map