{"version":3,"sources":["../../src/detectors/index.ts","../../src/detectors/cadence.ts","../../src/detectors/onchain.ts","../../src/detectors/voice.ts","../../src/detectors/timing.ts","../../src/detectors/correlation.ts"],"sourcesContent":["export { cadenceDetector } from \"./cadence.js\";\nexport { onchainDetector } from \"./onchain.js\";\nexport { voiceDetector } from \"./voice.js\";\nexport { timingDetector } from \"./timing.js\";\nexport { correlationDetector } from \"./correlation.js\";\n","import type { DetectorResult } from \"../core/types.js\";\nimport type { XPost } from \"../sources/x.js\";\n\n/**\n * Cadence detector.\n *\n * Autonomous agents post at regular intervals, at all hours of the day, and\n * show no business-hours bias. Humans cluster posts in their waking hours\n * and go quiet during sleep.\n *\n * Signals analyzed:\n *  - Hour-of-day distribution entropy (high entropy = agent-like)\n *  - Business-hours ratio (0.4-0.8 is typical for humans, <0.3 for agents)\n *  - Interval-between-posts standard deviation (agents = low variance)\n *  - Sleep-window detection (5am-9am local dead zone = human)\n */\nexport function cadenceDetector(posts: XPost[]): DetectorResult {\n  const notes: string[] = [];\n\n  if (posts.length < 20) {\n    notes.push(`only ${posts.length} posts available, low confidence`);\n    return {\n      detector: \"cadence\",\n      score: 50,\n      samples: posts.length,\n      notes,\n      runtime_ms: 0,\n    };\n  }\n\n  // Bucket by hour of day (UTC).\n  const hourBuckets = new Array(24).fill(0);\n  for (const p of posts) {\n    const hour = new Date(p.created_at * 1000).getUTCHours();\n    hourBuckets[hour]++;\n  }\n\n  // Shannon entropy of the distribution (0 = all same hour, log2(24) = uniform).\n  const total = posts.length;\n  let entropy = 0;\n  for (const count of hourBuckets) {\n    if (count > 0) {\n      const p = count / total;\n      entropy -= p * Math.log2(p);\n    }\n  }\n  const entropyScore = (entropy / Math.log2(24)) * 100;\n  notes.push(`hour entropy: ${entropy.toFixed(2)} bits (${entropyScore.toFixed(0)}/100)`);\n\n  // Business hours bias (9:00 - 18:00 UTC, adjust if you have timezone).\n  const businessHours = hourBuckets.slice(9, 18).reduce((a, b) => a + b, 0);\n  const businessRatio = businessHours / total;\n  notes.push(`business-hours ratio: ${(businessRatio * 100).toFixed(1)}%`);\n\n  // Sleep window detection (4am - 8am UTC by default).\n  const sleepWindow = hourBuckets.slice(4, 8).reduce((a, b) => a + b, 0);\n  const sleepRatio = sleepWindow / total;\n  const hasDeadZone = sleepRatio < 0.05;\n  notes.push(\n    hasDeadZone\n      ? `sleep window detected (${(sleepRatio * 100).toFixed(1)}% posts in 4-8am)`\n      : `no sleep window (${(sleepRatio * 100).toFixed(1)}% posts in 4-8am)`\n  );\n\n  // Interval variance.\n  const sorted = [...posts].sort((a, b) => a.created_at - b.created_at);\n  const intervals: number[] = [];\n  for (let i = 1; i < sorted.length; i++) {\n    intervals.push(sorted[i]!.created_at - sorted[i - 1]!.created_at);\n  }\n  const meanInterval = intervals.reduce((a, b) => a + b, 0) / intervals.length;\n  const variance =\n    intervals.reduce((a, b) => a + (b - meanInterval) ** 2, 0) /\n    intervals.length;\n  const cv = Math.sqrt(variance) / meanInterval; // coefficient of variation\n  notes.push(`interval CV: ${cv.toFixed(2)} (lower = more regular = agent-like)`);\n\n  // Aggregate the four sub-signals into a 0-100 score.\n  let score = 0;\n  score += entropyScore * 0.4;\n  score += (1 - Math.abs(businessRatio - 0.15)) * 100 * 0.25; // 15% business hours is agent-like baseline\n  score += (hasDeadZone ? 0 : 100) * 0.2;\n  score += Math.max(0, 100 - cv * 30) * 0.15;\n\n  return {\n    detector: \"cadence\",\n    score: Math.round(Math.max(0, Math.min(100, score))),\n    samples: posts.length,\n    notes,\n    runtime_ms: 0,\n  };\n}\n","import type { DetectorResult } from \"../core/types.js\";\nimport type { HeliusTransaction } from \"../sources/helius.js\";\n\n/**\n * On-chain cadence detector.\n *\n * Autonomous agents transact in bursts when triggered by external events,\n * and show either perfectly regular cron-like activity or reactive bursts.\n * Humans transact sporadically with long gaps and clustered around waking\n * hours.\n *\n * Signals analyzed:\n *  - Transaction time-of-day distribution\n *  - Burst detection (many txs within seconds = bot)\n *  - Program diversity (agents hit few programs, humans hit many)\n *  - Fee behavior (agents pay consistent priority fees)\n */\nexport function onchainDetector(txs: HeliusTransaction[]): DetectorResult {\n  const notes: string[] = [];\n\n  if (txs.length < 10) {\n    notes.push(`only ${txs.length} transactions, low confidence`);\n    return {\n      detector: \"onchain\",\n      score: 50,\n      samples: txs.length,\n      notes,\n      runtime_ms: 0,\n    };\n  }\n\n  // Time-of-day distribution.\n  const hourBuckets = new Array(24).fill(0);\n  for (const t of txs) {\n    const hour = new Date(t.timestamp * 1000).getUTCHours();\n    hourBuckets[hour]++;\n  }\n  let entropy = 0;\n  for (const count of hourBuckets) {\n    if (count > 0) {\n      const p = count / txs.length;\n      entropy -= p * Math.log2(p);\n    }\n  }\n  const entropyScore = (entropy / Math.log2(24)) * 100;\n  notes.push(`onchain hour entropy: ${entropy.toFixed(2)} bits`);\n\n  // Burst detection: how many tx clusters have >3 txs within 10 seconds?\n  const sorted = [...txs].sort((a, b) => a.timestamp - b.timestamp);\n  let bursts = 0;\n  for (let i = 0; i < sorted.length - 3; i++) {\n    const window = sorted[i + 3]!.timestamp - sorted[i]!.timestamp;\n    if (window <= 10) bursts++;\n  }\n  const burstRatio = bursts / Math.max(1, sorted.length - 3);\n  notes.push(`burst clusters: ${bursts} (${(burstRatio * 100).toFixed(1)}% of windows)`);\n\n  // Program diversity: unique program IDs touched.\n  const programs = new Set<string>();\n  for (const t of txs) {\n    for (const p of t.programs ?? []) {\n      programs.add(p);\n    }\n  }\n  const diversityScore = Math.min(100, programs.size * 10);\n  notes.push(`${programs.size} unique programs touched`);\n\n  // Fee consistency: std dev of priority fees (lower = bot-like).\n  const fees = txs.map((t) => t.fee ?? 5000).filter((f) => f > 0);\n  const meanFee = fees.reduce((a, b) => a + b, 0) / Math.max(1, fees.length);\n  const feeStd = Math.sqrt(\n    fees.reduce((a, b) => a + (b - meanFee) ** 2, 0) / Math.max(1, fees.length)\n  );\n  const feeCV = meanFee > 0 ? feeStd / meanFee : 0;\n  notes.push(`fee CV: ${feeCV.toFixed(2)}`);\n\n  // Aggregate.\n  let score = 0;\n  score += entropyScore * 0.35;\n  score += Math.min(100, burstRatio * 300) * 0.3;\n  score += (100 - diversityScore) * 0.2; // low diversity = more agent-like\n  score += Math.max(0, 100 - feeCV * 50) * 0.15;\n\n  return {\n    detector: \"onchain\",\n    score: Math.round(Math.max(0, Math.min(100, score))),\n    samples: txs.length,\n    notes,\n    runtime_ms: 0,\n  };\n}\n","import type { DetectorResult } from \"../core/types.js\";\nimport type { XPost } from \"../sources/x.js\";\n\n/**\n * Voice consistency detector.\n *\n * Humans make typos that evolve over time, reuse unique phrases, drift in\n * tone, and use emoji inconsistently. Autonomous agents have frozen voice:\n * stable vocabulary, no typos, consistent phrase templates, predictable\n * emoji usage.\n *\n * Returns a HIGHER score for more consistent (agent-like) voice.\n */\nexport function voiceDetector(posts: XPost[]): DetectorResult {\n  const notes: string[] = [];\n\n  if (posts.length < 15) {\n    notes.push(`only ${posts.length} posts, low confidence`);\n    return {\n      detector: \"voice\",\n      score: 50,\n      samples: posts.length,\n      notes,\n      runtime_ms: 0,\n    };\n  }\n\n  // Lexical diversity: unique tokens / total tokens.\n  const allTokens: string[] = [];\n  for (const p of posts) {\n    const tokens = tokenize(p.text);\n    allTokens.push(...tokens);\n  }\n  const uniqueRatio = new Set(allTokens).size / allTokens.length;\n  notes.push(`lexical diversity: ${uniqueRatio.toFixed(3)}`);\n\n  // Typo detection: very rough heuristic (repeated chars, no-vowel words).\n  let typoCount = 0;\n  for (const p of posts) {\n    if (/([a-z])\\1{2,}/i.test(p.text)) typoCount++;\n    if (/\\b[bcdfghjklmnpqrstvwxyz]{4,}\\b/i.test(p.text)) typoCount++;\n  }\n  const typoRate = typoCount / posts.length;\n  notes.push(`typo rate: ${(typoRate * 100).toFixed(1)}%`);\n\n  // Phrase repetition: how many 3-word sequences appear more than once?\n  const trigrams = new Map<string, number>();\n  for (const p of posts) {\n    const tokens = tokenize(p.text);\n    for (let i = 0; i < tokens.length - 2; i++) {\n      const key = `${tokens[i]} ${tokens[i + 1]} ${tokens[i + 2]}`;\n      trigrams.set(key, (trigrams.get(key) ?? 0) + 1);\n    }\n  }\n  const repeated = Array.from(trigrams.values()).filter((v) => v > 1).length;\n  const repetitionRate = repeated / Math.max(1, trigrams.size);\n  notes.push(`phrase repetition: ${(repetitionRate * 100).toFixed(1)}%`);\n\n  // Emoji consistency: ratio of posts containing any emoji.\n  const emojiRegex = /[\\p{Emoji_Presentation}]/u;\n  const withEmoji = posts.filter((p) => emojiRegex.test(p.text)).length;\n  const emojiRatio = withEmoji / posts.length;\n  const emojiConsistency = Math.abs(emojiRatio - 0.5) * 2; // 0 or 1 both = consistent\n  notes.push(`emoji ratio: ${(emojiRatio * 100).toFixed(0)}%`);\n\n  // Aggregate. Higher score = more agent-like (more consistent).\n  let score = 0;\n  score += (1 - uniqueRatio) * 100 * 0.35; // lower diversity = more agent\n  score += (1 - typoRate) * 100 * 0.25; // fewer typos = more agent\n  score += repetitionRate * 100 * 0.2;\n  score += emojiConsistency * 100 * 0.2;\n\n  return {\n    detector: \"voice\",\n    score: Math.round(Math.max(0, Math.min(100, score))),\n    samples: posts.length,\n    notes,\n    runtime_ms: 0,\n  };\n}\n\nfunction tokenize(text: string): string[] {\n  return text\n    .toLowerCase()\n    .replace(/https?:\\/\\/\\S+/g, \"\")\n    .replace(/[^a-z0-9\\s]/g, \" \")\n    .split(/\\s+/)\n    .filter((t) => t.length > 1);\n}\n","import type { DetectorResult } from \"../core/types.js\";\nimport type { XPost } from \"../sources/x.js\";\nimport type { HeliusTransaction } from \"../sources/helius.js\";\n\n/**\n * Timing anomaly detector.\n *\n * Returns a count of anomalies rather than a 0-100 score. The aggregator\n * normalizes the count to a score (0 anomalies = 100, 10+ = 0).\n *\n * Anomalies flagged:\n *  - Sub-second response times (bot-like)\n *  - Perfect regularity in posting intervals (cron job signature)\n *  - Simultaneous X and on-chain activity within 1 second of each other\n *  - Posts during 4am-7am UTC with high frequency\n *  - Absolute silence gaps > 48h followed by burst activity\n */\nexport function timingDetector(\n  posts: XPost[],\n  txs: HeliusTransaction[]\n): DetectorResult {\n  const notes: string[] = [];\n  let anomalies = 0;\n\n  // 1. Sub-second responses (reply posted within 1s of parent).\n  const quickReplies = posts.filter(\n    (p) => p.in_reply_to_id && p.reply_delta_ms !== undefined && p.reply_delta_ms < 1000\n  ).length;\n  if (quickReplies > 0) {\n    anomalies += Math.min(3, quickReplies);\n    notes.push(`${quickReplies} sub-second reply posts`);\n  }\n\n  // 2. Perfect regularity: check if 5+ consecutive intervals have delta < 5s.\n  const sortedPosts = [...posts].sort((a, b) => a.created_at - b.created_at);\n  let regular = 0;\n  for (let i = 2; i < sortedPosts.length; i++) {\n    const d1 = sortedPosts[i]!.created_at - sortedPosts[i - 1]!.created_at;\n    const d2 = sortedPosts[i - 1]!.created_at - sortedPosts[i - 2]!.created_at;\n    if (Math.abs(d1 - d2) < 5 && d1 > 0) regular++;\n  }\n  if (regular >= 5) {\n    anomalies++;\n    notes.push(`${regular} posts with cron-like regularity`);\n  }\n\n  // 3. Simultaneous X + on-chain activity.\n  let simultaneous = 0;\n  const txTimes = new Set(txs.map((t) => t.timestamp));\n  for (const p of posts) {\n    for (let offset = -1; offset <= 1; offset++) {\n      if (txTimes.has(p.created_at + offset)) {\n        simultaneous++;\n        break;\n      }\n    }\n  }\n  if (simultaneous >= 3) {\n    anomalies++;\n    notes.push(`${simultaneous} simultaneous X+onchain events (within 1s)`);\n  }\n\n  // 4. High frequency in 4am-7am UTC window.\n  const deadHour = posts.filter((p) => {\n    const h = new Date(p.created_at * 1000).getUTCHours();\n    return h >= 4 && h < 7;\n  }).length;\n  if (deadHour / posts.length > 0.1) {\n    anomalies++;\n    notes.push(`${deadHour} posts during 4-7am UTC dead zone`);\n  }\n\n  // 5. Silence-then-burst patterns.\n  let burstAfterSilence = 0;\n  for (let i = 1; i < sortedPosts.length; i++) {\n    const gap = sortedPosts[i]!.created_at - sortedPosts[i - 1]!.created_at;\n    if (gap > 48 * 3600) {\n      // Check if next 5 posts come within 10 minutes.\n      const nextFive = sortedPosts.slice(i, i + 5);\n      if (nextFive.length === 5) {\n        const span = nextFive[4]!.created_at - nextFive[0]!.created_at;\n        if (span < 600) burstAfterSilence++;\n      }\n    }\n  }\n  if (burstAfterSilence > 0) {\n    anomalies += burstAfterSilence;\n    notes.push(`${burstAfterSilence} silence-then-burst patterns`);\n  }\n\n  if (anomalies === 0) {\n    notes.push(\"no timing anomalies detected\");\n  }\n\n  return {\n    detector: \"timing\",\n    score: anomalies, // raw anomaly count, aggregator normalizes\n    samples: posts.length + txs.length,\n    notes,\n    runtime_ms: 0,\n  };\n}\n","import type { DetectorResult, ScanInput } from \"../core/types.js\";\nimport type { XPost } from \"../sources/x.js\";\nimport type { HeliusTransaction } from \"../sources/helius.js\";\n\n/**\n * Cross-source correlation detector.\n *\n * The hardest signal to fake: do the X posting timeline and the on-chain\n * activity timeline correlate? An autonomous agent that is actually running\n * the claimed wallet will show synchronized bursts. A human operator\n * manually posting will show uncorrelated timelines.\n *\n * Score is 0-100 where higher = stronger correlation = more autonomous.\n * Uncorrelated timelines (two independent actors) score near 0, which\n * usually flips the verdict to HYBRID.\n */\nexport function correlationDetector(\n  posts: XPost[],\n  txs: HeliusTransaction[],\n  target: ScanInput\n): DetectorResult {\n  const notes: string[] = [];\n\n  if (posts.length < 10 || txs.length < 10) {\n    notes.push(`insufficient data (posts=${posts.length}, txs=${txs.length})`);\n    return {\n      detector: \"correlation\",\n      score: 50,\n      samples: posts.length + txs.length,\n      notes,\n      runtime_ms: 0,\n    };\n  }\n\n  // Bin by hour, count events per bin.\n  const postsByHour = new Map<number, number>();\n  const txsByHour = new Map<number, number>();\n\n  const bucket = (t: number) => Math.floor(t / 3600);\n\n  for (const p of posts) {\n    const b = bucket(p.created_at);\n    postsByHour.set(b, (postsByHour.get(b) ?? 0) + 1);\n  }\n  for (const t of txs) {\n    const b = bucket(t.timestamp);\n    txsByHour.set(b, (txsByHour.get(b) ?? 0) + 1);\n  }\n\n  // Build aligned vectors over the union of hours.\n  const allHours = new Set([...postsByHour.keys(), ...txsByHour.keys()]);\n  const postVec: number[] = [];\n  const txVec: number[] = [];\n  for (const h of allHours) {\n    postVec.push(postsByHour.get(h) ?? 0);\n    txVec.push(txsByHour.get(h) ?? 0);\n  }\n\n  // Pearson correlation coefficient.\n  const pearson = pearsonCorrelation(postVec, txVec);\n  notes.push(`pearson r = ${pearson.toFixed(3)}`);\n\n  // Activity window overlap: how much of the X activity window overlaps\n  // with the on-chain window?\n  const postSpan = maxOf(posts.map((p) => p.created_at)) - minOf(posts.map((p) => p.created_at));\n  const txSpan = maxOf(txs.map((t) => t.timestamp)) - minOf(txs.map((t) => t.timestamp));\n  const postStart = minOf(posts.map((p) => p.created_at));\n  const txStart = minOf(txs.map((t) => t.timestamp));\n  const overlapStart = Math.max(postStart, txStart);\n  const overlapEnd = Math.min(postStart + postSpan, txStart + txSpan);\n  const overlap = Math.max(0, overlapEnd - overlapStart);\n  const overlapRatio = overlap / Math.max(postSpan, txSpan, 1);\n  notes.push(`timeline overlap: ${(overlapRatio * 100).toFixed(1)}%`);\n\n  // Transform pearson [-1, 1] -> [0, 100] with emphasis on positive correlation.\n  const corrScore = Math.max(0, pearson) * 100;\n  const overlapScore = overlapRatio * 100;\n\n  const score = corrScore * 0.7 + overlapScore * 0.3;\n\n  // Tag the target for debugging in CLI output.\n  notes.push(`target: @${target.handle}, ${target.wallet.slice(0, 8)}...`);\n\n  return {\n    detector: \"correlation\",\n    score: Math.round(Math.max(0, Math.min(100, score))),\n    samples: posts.length + txs.length,\n    notes,\n    runtime_ms: 0,\n  };\n}\n\nfunction pearsonCorrelation(x: number[], y: number[]): number {\n  if (x.length !== y.length || x.length === 0) return 0;\n  const n = x.length;\n  const meanX = x.reduce((a, b) => a + b, 0) / n;\n  const meanY = y.reduce((a, b) => a + b, 0) / n;\n  let num = 0;\n  let denX = 0;\n  let denY = 0;\n  for (let i = 0; i < n; i++) {\n    const dx = x[i]! - meanX;\n    const dy = y[i]! - meanY;\n    num += dx * dy;\n    denX += dx * dx;\n    denY += dy * dy;\n  }\n  const denom = Math.sqrt(denX * denY);\n  return denom === 0 ? 0 : num / denom;\n}\n\nfunction minOf(arr: number[]): number {\n  return arr.reduce((a, b) => (a < b ? a : b), arr[0] ?? 0);\n}\nfunction maxOf(arr: number[]): number {\n  return arr.reduce((a, b) => (a > b ? a : b), arr[0] ?? 0);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgBO,SAAS,gBAAgB,OAAgC;AAC9D,QAAM,QAAkB,CAAC;AAEzB,MAAI,MAAM,SAAS,IAAI;AACrB,UAAM,KAAK,QAAQ,MAAM,MAAM,kCAAkC;AACjE,WAAO;AAAA,MACL,UAAU;AAAA,MACV,OAAO;AAAA,MACP,SAAS,MAAM;AAAA,MACf;AAAA,MACA,YAAY;AAAA,IACd;AAAA,EACF;AAGA,QAAM,cAAc,IAAI,MAAM,EAAE,EAAE,KAAK,CAAC;AACxC,aAAW,KAAK,OAAO;AACrB,UAAM,OAAO,IAAI,KAAK,EAAE,aAAa,GAAI,EAAE,YAAY;AACvD,gBAAY,IAAI;AAAA,EAClB;AAGA,QAAM,QAAQ,MAAM;AACpB,MAAI,UAAU;AACd,aAAW,SAAS,aAAa;AAC/B,QAAI,QAAQ,GAAG;AACb,YAAM,IAAI,QAAQ;AAClB,iBAAW,IAAI,KAAK,KAAK,CAAC;AAAA,IAC5B;AAAA,EACF;AACA,QAAM,eAAgB,UAAU,KAAK,KAAK,EAAE,IAAK;AACjD,QAAM,KAAK,iBAAiB,QAAQ,QAAQ,CAAC,CAAC,UAAU,aAAa,QAAQ,CAAC,CAAC,OAAO;AAGtF,QAAM,gBAAgB,YAAY,MAAM,GAAG,EAAE,EAAE,OAAO,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC;AACxE,QAAM,gBAAgB,gBAAgB;AACtC,QAAM,KAAK,0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