Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
1 line
No EOL
3.2 KiB
Text
1 line
No EOL
3.2 KiB
Text
{"version":3,"sources":["../../../src/server/mcp/mcp-telemetry-tracker.ts"],"sourcesContent":["/**\n * Telemetry tracker for MCP tool call usage.\n * Tracks invocation counts for each MCP tool to be reported via telemetry.\n */\n\nimport type { McpToolName } from '../../telemetry/events/build'\n\nexport interface McpToolUsage {\n featureName: McpToolName\n invocationCount: number\n}\n\nclass McpTelemetryTracker {\n private usageMap = new Map<McpToolName, number>()\n\n /**\n * Record a tool call invocation\n */\n recordToolCall(toolName: McpToolName): void {\n const current = this.usageMap.get(toolName) || 0\n this.usageMap.set(toolName, current + 1)\n }\n\n /**\n * Get all tool usages as an array\n */\n getUsages(): McpToolUsage[] {\n return Array.from(this.usageMap.entries()).map(([featureName, count]) => ({\n featureName,\n invocationCount: count,\n }))\n }\n\n /**\n * Reset all usage tracking\n */\n reset(): void {\n this.usageMap.clear()\n }\n\n /**\n * Check if any tools have been called\n */\n hasUsage(): boolean {\n return this.usageMap.size > 0\n }\n}\n\n// Singleton instance\nexport const mcpTelemetryTracker = new McpTelemetryTracker()\n\n/**\n * Get MCP tool usage telemetry\n */\nexport function getMcpTelemetryUsage(): McpToolUsage[] {\n return mcpTelemetryTracker.getUsages()\n}\n\n/**\n * Reset MCP telemetry tracker\n */\nexport function resetMcpTelemetry(): void {\n mcpTelemetryTracker.reset()\n}\n\n/**\n * Record MCP telemetry usage to the telemetry instance\n */\nexport function recordMcpTelemetry(telemetry: {\n record: (event: any) => void\n}): void {\n const mcpUsages = getMcpTelemetryUsage()\n if (mcpUsages.length === 0) {\n return\n }\n\n const { eventMcpToolUsage } =\n require('../../telemetry/events/build') as typeof import('../../telemetry/events/build')\n const events = eventMcpToolUsage(mcpUsages)\n for (const event of events) {\n telemetry.record(event)\n }\n}\n"],"names":["McpTelemetryTracker","recordToolCall","toolName","current","usageMap","get","set","getUsages","Array","from","entries","map","featureName","count","invocationCount","reset","clear","hasUsage","size","Map","mcpTelemetryTracker","getMcpTelemetryUsage","resetMcpTelemetry","recordMcpTelemetry","telemetry","mcpUsages","length","eventMcpToolUsage","require","events","event","record"],"mappings":"AAAA;;;CAGC,GASD,MAAMA;IAGJ;;GAEC,GACDC,eAAeC,QAAqB,EAAQ;QAC1C,MAAMC,UAAU,IAAI,CAACC,QAAQ,CAACC,GAAG,CAACH,aAAa;QAC/C,IAAI,CAACE,QAAQ,CAACE,GAAG,CAACJ,UAAUC,UAAU;IACxC;IAEA;;GAEC,GACDI,YAA4B;QAC1B,OAAOC,MAAMC,IAAI,CAAC,IAAI,CAACL,QAAQ,CAACM,OAAO,IAAIC,GAAG,CAAC,CAAC,CAACC,aAAaC,MAAM,GAAM,CAAA;gBACxED;gBACAE,iBAAiBD;YACnB,CAAA;IACF;IAEA;;GAEC,GACDE,QAAc;QACZ,IAAI,CAACX,QAAQ,CAACY,KAAK;IACrB;IAEA;;GAEC,GACDC,WAAoB;QAClB,OAAO,IAAI,CAACb,QAAQ,CAACc,IAAI,GAAG;IAC9B;;aAhCQd,WAAW,IAAIe;;AAiCzB;AAEA,qBAAqB;AACrB,OAAO,MAAMC,sBAAsB,IAAIpB,sBAAqB;AAE5D;;CAEC,GACD,OAAO,SAASqB;IACd,OAAOD,oBAAoBb,SAAS;AACtC;AAEA;;CAEC,GACD,OAAO,SAASe;IACdF,oBAAoBL,KAAK;AAC3B;AAEA;;CAEC,GACD,OAAO,SAASQ,mBAAmBC,SAElC;IACC,MAAMC,YAAYJ;IAClB,IAAII,UAAUC,MAAM,KAAK,GAAG;QAC1B;IACF;IAEA,MAAM,EAAEC,iBAAiB,EAAE,GACzBC,QAAQ;IACV,MAAMC,SAASF,kBAAkBF;IACjC,KAAK,MAAMK,SAASD,OAAQ;QAC1BL,UAAUO,MAAM,CAACD;IACnB;AACF","ignoreList":[0]} |