MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / logPluginFetch

Function logPluginFetch

source code/utils/plugins/fetchTelemetry.ts:81–98  ·  view source on GitHub ↗
(
  source: PluginFetchSource,
  urlOrSpec: string | undefined,
  outcome: PluginFetchOutcome,
  durationMs: number,
  errorKind?: string,
)

Source from the content-addressed store, hash-verified

79}
80
81export function logPluginFetch(
82 source: PluginFetchSource,
83 urlOrSpec: string | undefined,
84 outcome: PluginFetchOutcome,
85 durationMs: number,
86 errorKind?: string,
87): void {
88 // String values are bounded enums / hostname-only — no code, no paths,
89 // no raw error messages. Same privacy envelope as tengu_web_fetch_host.
90 logEvent('tengu_plugin_remote_fetch', {
91 source: source as SafeString,
92 host: (urlOrSpec ? extractHost(urlOrSpec) : 'unknown') as SafeString,
93 is_official: urlOrSpec ? isOfficialRepo(urlOrSpec) : false,
94 outcome: outcome as SafeString,
95 duration_ms: Math.round(durationMs),
96 ...(errorKind && { error_kind: errorKind as SafeString }),
97 })
98}
99
100/**
101 * Classify an error into a stable bucket for the error_kind field. Keeps

Callers 6

gitCloneFunction · 0.85
cacheMarketplaceFromGitFunction · 0.85
cacheMarketplaceFromUrlFunction · 0.85
getInstallCountsFunction · 0.85
downloadMcpbFunction · 0.85

Calls 3

logEventFunction · 0.85
extractHostFunction · 0.85
isOfficialRepoFunction · 0.85

Tested by

no test coverage detected