LittleDemon WebShell


Linux premium331.web-hosting.com 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64
Path : /home/livedhms/lmgt/node_modules/next/dist/server/mcp/
File Upload :
Command :
Current File : //home/livedhms/lmgt/node_modules/next/dist/server/mcp/mcp-telemetry-tracker.js.map

{"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":["getMcpTelemetryUsage","mcpTelemetryTracker","recordMcpTelemetry","resetMcpTelemetry","McpTelemetryTracker","recordToolCall","toolName","current","usageMap","get","set","getUsages","Array","from","entries","map","featureName","count","invocationCount","reset","clear","hasUsage","size","Map","telemetry","mcpUsages","length","eventMcpToolUsage","require","events","event","record"],"mappings":"AAAA;;;CAGC;;;;;;;;;;;;;;;;;IAmDeA,oBAAoB;eAApBA;;IALHC,mBAAmB;eAAnBA;;IAmBGC,kBAAkB;eAAlBA;;IAPAC,iBAAiB;eAAjBA;;;AAjDhB,MAAMC;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;AAGO,MAAMtB,sBAAsB,IAAIG;AAKhC,SAASJ;IACd,OAAOC,oBAAoBU,SAAS;AACtC;AAKO,SAASR;IACdF,oBAAoBkB,KAAK;AAC3B;AAKO,SAASjB,mBAAmBsB,SAElC;IACC,MAAMC,YAAYzB;IAClB,IAAIyB,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]}

LittleDemon - FACEBOOK
[ KELUAR ]