oculon 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +21 -3
  2. package/dist/cli/main.js +196 -1
  3. package/dist/core/http.js +4 -0
  4. package/dist/core/quota.js +20 -0
  5. package/dist/index.d.ts +20 -0
  6. package/dist/index.js +43 -0
  7. package/dist/mcp.d.ts +7 -0
  8. package/dist/mcp.js +97 -3
  9. package/dist/modules/breach.d.ts +53 -0
  10. package/dist/modules/breach.js +98 -0
  11. package/dist/modules/company.d.ts +53 -0
  12. package/dist/modules/company.js +149 -0
  13. package/dist/modules/contradictions.js +6 -4
  14. package/dist/modules/hashcheck.d.ts +29 -0
  15. package/dist/modules/hashcheck.js +82 -0
  16. package/dist/modules/ipintel.d.ts +52 -0
  17. package/dist/modules/ipintel.js +149 -0
  18. package/dist/modules/lynx.js +15 -9
  19. package/dist/modules/owl.js +4 -1
  20. package/dist/modules/phone.d.ts +32 -0
  21. package/dist/modules/phone.js +148 -0
  22. package/dist/modules/ransomware.d.ts +56 -0
  23. package/dist/modules/ransomware.js +85 -0
  24. package/dist/modules/satellites.d.ts +45 -0
  25. package/dist/modules/satellites.js +113 -0
  26. package/dist/sources/threatintel.d.ts +151 -0
  27. package/dist/sources/threatintel.js +256 -0
  28. package/dist/telegram.js +55 -5
  29. package/dist/web/ask.html +1 -1
  30. package/dist/web/assets/og-app.png +0 -0
  31. package/dist/web/assets/og-docs.png +0 -0
  32. package/dist/web/assets/og-mcp.png +0 -0
  33. package/dist/web/assets/og.png +0 -0
  34. package/dist/web/docs.html +1 -1
  35. package/dist/web/index.html +109 -11
  36. package/dist/web/insights.js +2 -0
  37. package/dist/web/landing.html +1 -1
  38. package/dist/web/legal.html +1 -1
  39. package/dist/web/mcp.html +1 -1
  40. package/dist/web/openapi.js +7 -0
  41. package/dist/web/public.js +9 -1
  42. package/dist/web/server.js +63 -4
  43. package/package.json +2 -2
@@ -8,7 +8,7 @@
8
8
  <link rel="icon" type="image/png" href="/favicon.ico">
9
9
  <link rel="apple-touch-icon" href="/assets/icon-192.png">
10
10
  <title>Oculon</title>
11
- <meta property="og:type" content="website"><meta property="og:site_name" content="Oculon"><meta property="og:title" content="Oculon app"><meta property="og:description" content="Investigate, monitor and share: the full Oculon intelligence app."><meta property="og:url" content="https://oculon.live/app"><meta property="og:image" content="https://oculon.live/assets/og.png"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:image" content="https://oculon.live/assets/og.png">
11
+ <meta property="og:type" content="website"><meta property="og:site_name" content="Oculon"><meta property="og:title" content="Oculon app"><meta property="og:description" content="Investigate, monitor and share: the full Oculon intelligence app."><meta property="og:url" content="https://oculon.live/app"><meta property="og:image" content="https://oculon.live/assets/og-app.png?v=2"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:image" content="https://oculon.live/assets/og-app.png?v=2">
12
12
  <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
13
13
  <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet">
14
14
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.min.css">
@@ -248,7 +248,7 @@ nav { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollb
248
248
  header .spacer { display: none; }
249
249
  header .status { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
250
250
  @media (max-width: 1300px) { header .status { display: none; } }
251
- @media (max-width: 720px) { header { flex-wrap: wrap; row-gap: 8px; } header nav { order: 5; flex-basis: 100%; } #pal-btn .kbd { display: none; } header .brand { margin-right: auto; } .ov-kpi b { font-size: 22px; overflow-wrap: anywhere; } .ov-kpi { padding: 12px 14px; } }
251
+ @media (max-width: 720px) { header { flex-wrap: wrap; row-gap: 8px; column-gap: 12px; padding: 10px 14px; } header nav { order: 5; flex-basis: 100%; } #pal-btn .kbd { display: none; } header .brand { margin-right: auto; } .ov-kpi b { font-size: 22px; overflow-wrap: anywhere; } .ov-kpi { padding: 12px 14px; } }
252
252
  .pal input { color: var(--text) !important; }
253
253
  #pal-btn { white-space: nowrap; flex: none; }
254
254
  .ib .ev2 a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(0,240,255,.4); text-underline-offset: 3px; }
@@ -563,6 +563,16 @@ nav button { white-space: nowrap; }
563
563
  <option value="airport">Airport status (JFK, EGLL…)</option>
564
564
  <option value="country">Country brief</option>
565
565
  <option value="papers">Research papers (topic)</option>
566
+ <option value="phone">Who is calling? (phone number)</option>
567
+ <option value="password">Has my password leaked?</option>
568
+ <option value="breaches">Data breaches (domain, or empty for newest)</option>
569
+ <option value="company">Is this supplier real? (name, LEI or EU VAT)</option>
570
+ </optgroup>
571
+ <optgroup label="Threat intel">
572
+ <option value="ip">IP address check (IP or domain)</option>
573
+ <option value="hash">File hash check (MD5, SHA-1, SHA-256)</option>
574
+ <option value="ransomware">Ransomware claims (country, sector, name, or empty)</option>
575
+ <option value="satellites">Satellites (name, NORAD number, or empty for new launches)</option>
566
576
  </optgroup>
567
577
  <optgroup label="Investigate">
568
578
  <option value="dossier">Dossier (company, person)</option>
@@ -923,7 +933,7 @@ function handleMapClick(e) {
923
933
  const waitMap = setInterval(() => { if (map) { map.on('click', handleMapClick); clearInterval(waitMap); } }, 300);
924
934
 
925
935
  /* investigate */
926
- const placeholders = { scam: 'USPS: your package is on hold, pay the $1.99 fee within 24 hours at usps-redelivery-help.top/track', recall: '2018 Honda Accord', emailsec: 'example.com', airport: 'JFK', country: 'Argentina', papers: 'solid-state battery', url: 'paypa1-secure-login.top/verify', factcheck: 'The Great Wall of China is visible from space', audit: 'npm:lodash@4.17.15 npm:request pypi:requests==2.19.0', travel: 'Lisbon', dossier: 'Nvidia', hype: 'ai agent', footprint: 'openai.com', lights: 'Gaza Strip', aircraft: 'N628TS', image: 'Kyoto', /*onchain*/wallet: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', token: '0xdac17f958d2ee523a2206206994597c13d831ec7', /*/onchain*/air: 'New Delhi', space: '(no input needed)', /*onchain*/robinhood: '(no input needed)', deployer: '0x… token or deployer', /*/onchain*/launches: 'OpenAI', markets: '(no input needed)', rewind: '2026-11-12', sanctions: 'IMO 1234567 or 0x… or exact name', health: 'Nvidia', impact: '(empty = current quakes and storms)', contradictions: 'Anthropic IPO' };
936
+ const placeholders = { phone: '+1 876 555 0100', password: 'type a password (it never leaves your browser)', breaches: '(empty = newest breaches) or adobe.com', company: 'NL004495445B01', ip: '185.220.101.1', hash: '094fd325049b8a9cf6d3e5ef2a6d4cc6a567d7d49c35f8bb8dd9e3c6acf3d78d', ransomware: '(empty = newest claims) or Healthcare, DE, a company', satellites: '(empty = new launches) or ISS, 25544', scam: 'USPS: your package is on hold, pay the $1.99 fee within 24 hours at usps-redelivery-help.top/track', recall: '2018 Honda Accord', emailsec: 'example.com', airport: 'JFK', country: 'Argentina', papers: 'solid-state battery', url: 'paypa1-secure-login.top/verify', factcheck: 'The Great Wall of China is visible from space', audit: 'npm:lodash@4.17.15 npm:request pypi:requests==2.19.0', travel: 'Lisbon', dossier: 'Nvidia', hype: 'ai agent', footprint: 'openai.com', lights: 'Gaza Strip', aircraft: 'N628TS', image: 'Kyoto', /*onchain*/wallet: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', token: '0xdac17f958d2ee523a2206206994597c13d831ec7', /*/onchain*/air: 'New Delhi', space: '(no input needed)', /*onchain*/robinhood: '(no input needed)', deployer: '0x… token or deployer', /*/onchain*/launches: 'OpenAI', markets: '(no input needed)', rewind: '2026-11-12', sanctions: 'IMO 1234567 or 0x… or exact name', health: 'Nvidia', impact: '(empty = current quakes and storms)', contradictions: 'Anthropic IPO' };
927
937
  const usd = (x) => (x == null ? '?' : '$' + Math.round(x).toLocaleString('en-US'));
928
938
 
929
939
  /* brief: tiny, safe Markdown renderer (escape first, then headings, bold, links, bullets) */
@@ -1037,7 +1047,7 @@ async function loadCases() {
1037
1047
  : '<p class="meta">No cases yet.</p>';
1038
1048
  document.querySelectorAll('[data-case]').forEach((a) => (a.onclick = async (e) => {
1039
1049
  e.preventDefault();
1040
- const k = await api('/api/case?id=' + encodeURIComponent(a.dataset.case));
1050
+ const k = await api('/api/case?id=' + encodeURIComponent(a.dataset.case)).catch(() => null);
1041
1051
  $('#case-view').innerHTML = k && k.markdown ? renderMd(k.markdown) : 'Not found.';
1042
1052
  $('#case-view').className = 'md';
1043
1053
  }));
@@ -1070,10 +1080,49 @@ $('#ask-go').onclick = async () => {
1070
1080
  finally { $('#ask-go').disabled = false; }
1071
1081
  };
1072
1082
  $('#ask-q').addEventListener('keydown', (e) => { if (e.key === 'Enter') $('#ask-go').click(); });
1073
- $('#inv-kind').onchange = () => { $('#inv-q').placeholder = placeholders[$('#inv-kind').value]; };
1083
+ $('#inv-kind').onchange = () => { const k = $('#inv-kind').value; $('#inv-q').placeholder = placeholders[k]; $('#inv-q').type = k === 'password' ? 'password' : 'text'; if (k === 'password') $('#inv-q').value = ''; };
1074
1084
  const spark = (xs) => { const m = Math.max(...xs, 1e-9); return `<span class="spark">${xs.map((x) => `<i style="height:${Math.max(2, Math.round((x / m) * 28))}px" title="${esc(x)}"></i>`).join('')}</span>`; };
1075
1085
  const sigList = (s) => (s.length ? `<h3>Signals</h3>${s.map(renderSignal).join('')}` : '');
1086
+ const link = (u, t) => `<a href="${safeUrl(u)}" target="_blank" rel="noopener noreferrer">${esc(t)}</a>`;
1087
+ const tonePill = (t, txt) => `<span class="pill ${t}">${esc(txt)}</span>`;
1076
1088
  const views = {
1089
+ ip: (r) => {
1090
+ const d = r.result;
1091
+ const t = d.verdict === 'malicious' ? 'bad' : d.verdict === 'suspicious' ? 'warn' : 'ok';
1092
+ const row = (k, v) => (v ? `<tr><td>${k}</td><td>${v}</td></tr>` : '');
1093
+ const flags = Object.entries(d.flags).filter(([, v]) => v).map(([k]) => `<span class="chip">${esc(k === 'knownGood' ? 'known benign' : k)}</span>`).join('');
1094
+ return `<h3>${esc(d.ip)}${d.resolvedFrom ? ` <span class="meta">${esc(d.resolvedFrom)}</span>` : ''} ${tonePill(t, d.verdict)} <span class="meta">risk ${d.risk}/100</span></h3>${flags ? `<p>${flags}</p>` : ''}<table>${row('Network', esc([d.network.asn, d.network.name].filter(Boolean).join(' ')) + (d.network.type ? ` <span class="meta">${esc(d.network.type)}</span>` : ''))}${row('Location', d.location ? esc([d.location.city, d.location.region, d.location.country].filter(Boolean).join(', ')) : '')}${row('Reverse DNS', esc(d.network.reverse || ''))}${row('AbuseIPDB', d.abuseipdb ? `${d.abuseipdb.reports} reports · confidence ${d.abuseipdb.score}%` : '')}${row('VirusTotal', d.virustotal ? `${d.virustotal.malicious} of ${d.virustotal.engines} engines flag it · ${link(d.virustotal.link, 'open')}` : '')}${row('GreyNoise', d.greynoise ? (d.greynoise.noise ? `scanning, ${esc(d.greynoise.classification || 'unknown')}` : d.greynoise.riot ? 'known benign service' : 'not seen scanning') : '')}${row('OTX', d.otx ? `${d.otx.count} threat report${d.otx.count === 1 ? '' : 's'}` : '')}${row('Open ports', d.ports && d.ports.ports.length ? esc(d.ports.ports.slice(0, 16).join(', ')) + (d.ports.vulns.length ? ` <span class="err">${d.ports.vulns.length} known CVEs</span>` : '') : '')}</table>${d.reasons.length ? `<h3>Why</h3><ul class="ev">${d.reasons.map((x) => `<li>${esc(x)}</li>`).join('')}</ul>` : ''}<h3>What to do</h3><ul class="ev">${d.advice.map((x) => `<li>${esc(x)}</li>`).join('')}</ul>`;
1095
+ },
1096
+ hash: (r) => {
1097
+ const d = r.result;
1098
+ const t = d.verdict === 'malicious' ? 'bad' : d.verdict === 'suspicious' ? 'warn' : d.verdict === 'known good' ? 'ok' : '';
1099
+ return `<h3>${tonePill(t, d.verdict)} ${d.family ? `<b>${esc(d.family)}</b>` : ''} <span class="meta">${esc(d.algorithm)}</span></h3><p class="meta"><code>${esc(d.hash)}</code>${d.name ? `<br>${esc(d.name)}` : ''}</p><ul class="ev">${d.reasons.map((x) => `<li>${esc(x)}</li>`).join('')}</ul><p>${[d.bazaar && link(d.bazaar.link, 'MalwareBazaar'), d.virustotal && link(d.virustotal.link, 'VirusTotal')].filter(Boolean).join(' · ')}</p><h3>What to do</h3><ul class="ev">${d.advice.map((x) => `<li>${esc(x)}</li>`).join('')}</ul>`;
1100
+ },
1101
+ ransomware: (r) => {
1102
+ const d = r.result;
1103
+ const tally = (xs) => xs.map((x) => `<span class="chip">${esc(x.name)} ${x.count}</span>`).join('');
1104
+ return `<h3>${d.query ? `Ransomware claims: ${esc(d.query)}` : 'Newest ransomware claims'} <span class="meta">${d.total} found</span></h3>${d.byGroup.length ? `<p class="meta">Groups ${tally(d.byGroup.slice(0, 6))}</p>` : ''}${d.byCountry.length && d.mode !== 'country' ? `<p class="meta">Countries ${tally(d.byCountry.slice(0, 6))}</p>` : ''}${d.victims.length ? `<ul class="ev">${d.victims.slice(0, 25).map((v) => `<li><b>${v.url ? link(v.url, v.victim) : esc(v.victim)}</b> <span class="pill bad">${esc(v.group)}</span> <span class="meta">${esc([v.country, v.sector, (v.discovered || v.attacked || '').slice(0, 10)].filter(Boolean).join(' · '))}</span>${v.description ? `<div class="meta">${esc(v.description)}</div>` : ''}</li>`).join('')}</ul>` : '<p>No claims found.</p>'}<p class="meta">${esc(d.note)}</p>`;
1105
+ },
1106
+ company: (r) => {
1107
+ const d = r.result;
1108
+ const vat = d.vat ? `<h3>VAT ${esc(d.vat.country + d.vat.number)} ${tonePill(d.vat.valid ? 'ok' : 'bad', d.vat.valid ? 'valid' : 'not valid')}</h3>${d.vat.name ? `<p><b>${esc(d.vat.name)}</b>${d.vat.address ? `<br><span class="meta">${esc(d.vat.address)}</span>` : ''}</p>` : ''}` : '';
1109
+ const recs = d.records.map((x) => `<li><b>${link(x.url, x.name)}</b> ${tonePill(x.status === 'ACTIVE' ? 'ok' : 'warn', (x.status || '?').toLowerCase())} ${x.registration && x.registration !== 'ISSUED' ? tonePill('warn', 'LEI ' + x.registration.toLowerCase()) : ''}<div class="meta">LEI ${esc(x.lei)}${x.registeredAs ? ' · reg. ' + esc(x.registeredAs) : ''}${x.created ? ' · since ' + esc(x.created) : ''}</div>${x.address ? `<div class="meta">${esc(x.address)}</div>` : ''}${x.parent ? `<div class="meta">Ultimate parent: ${esc(x.parent.name)}</div>` : ''}</li>`).join('');
1110
+ return `${vat}${d.warnings.length ? `<ul class="ev">${d.warnings.map((w) => `<li class="err">${esc(w)}</li>`).join('')}</ul>` : ''}${recs ? `<h3>LEI register</h3><ul class="ev">${recs}</ul>` : ''}<p class="meta">${esc(d.note)}</p>`;
1111
+ },
1112
+ breaches: (r) => {
1113
+ const d = r.result;
1114
+ return `<h3>${d.query ? `Breaches: ${esc(d.query)} ${tonePill(d.total ? 'bad' : 'ok', d.total ? d.total + ' found' : 'none found')}` : 'Newest breaches'}</h3>${d.breaches.length ? `<ul class="ev">${d.breaches.map((b) => `<li><b>${link(b.url, b.title)}</b> <span class="meta">${esc(b.breachDate || '')} · ${b.accounts.toLocaleString('en-US')} accounts${b.domain ? ' · ' + esc(b.domain) : ''}</span><div class="meta">${esc(b.dataClasses.join(', '))}</div><div>${esc(b.description)}</div></li>`).join('')}</ul>` : ''}<p class="meta">${esc(d.note)}</p>`;
1115
+ },
1116
+ phone: (r) => {
1117
+ const d = r.result;
1118
+ const t = d.risk === 'high' ? 'bad' : d.risk === 'medium' ? 'warn' : 'ok';
1119
+ return `<h3>${esc(d.e164)} ${tonePill(t, d.risk + ' risk')}${d.valid === false ? ' ' + tonePill('bad', 'not valid') : ''}</h3><p>${esc([d.country, d.location, d.lineType, d.carrier].filter(Boolean).join(' · '))}</p>${d.warnings.length ? `<ul class="ev">${d.warnings.map((w) => `<li class="err">${esc(w)}</li>`).join('')}</ul>` : ''}<h3>What to do</h3><ul class="ev">${d.advice.map((x) => `<li>${esc(x)}</li>`).join('')}</ul>`;
1120
+ },
1121
+ satellites: (r) => {
1122
+ const d = r.result;
1123
+ if (d.mode === 'recent') return `<h3>Launched in the last 30 days <span class="meta">${d.total} objects</span></h3><table><tr><th>launch</th><th>objects</th><th>names</th></tr>${d.launches.map((l) => `<tr><td>${esc(l.id)}</td><td class="num">${l.objects}</td><td>${esc(l.names.join(', '))}</td></tr>`).join('')}</table><p class="meta">${esc(d.note)}</p>`;
1124
+ return d.objects.length ? `<ul class="ev">${d.objects.map((x) => `<li><b>${link(x.url, x.name)}</b> <span class="meta">NORAD ${x.norad} · ${esc(x.intlId)}</span>${x.status ? ' ' + tonePill(x.status === 'operational' ? 'ok' : '', x.status) : ''}${x.orbit ? `<div>${esc(x.orbit.regime)} · ${x.orbit.perigeeKm}-${x.orbit.apogeeKm} km · ${x.orbit.periodMin} min · ${x.orbit.inclination}°</div>` : ''}<div class="meta">${esc([x.owner && 'owner ' + x.owner, x.type, x.launchDate && 'launched ' + x.launchDate, x.decayed && 'decayed ' + x.decayed].filter(Boolean).join(' · '))}</div></li>`).join('')}</ul><p class="meta">${esc(d.note)}</p>` : `<p>${esc(d.note)}</p>`;
1125
+ },
1077
1126
  scam: (r) => {
1078
1127
  const d = r.result;
1079
1128
  const tone = d.verdict === 'likely scam' ? 'bad' : d.verdict === 'suspicious' ? 'warn' : 'ok';
@@ -1223,7 +1272,25 @@ $('#inv-go').onclick = async () => {
1223
1272
  if (q.startsWith('(')) q = '';
1224
1273
  const out = $('#inv-out');
1225
1274
  if (kind === 'image') { out.innerHTML = `<p class="meta">Loading satellite image of ${esc(q)}…</p><img class="sat" alt="Satellite image of ${esc(q)}" src="/api/image?place=${encodeURIComponent(q)}">`; return; }
1226
- const param = { scam: 'message', recall: 'q', emailsec: 'domain', airport: 'code', country: 'name', papers: 'topic', url: 'url', factcheck: 'claim', audit: 'packages', travel: 'place', dossier: 'name', hype: 'topic', footprint: 'domain', lights: 'place', aircraft: 'q', /*onchain*/wallet: 'address', token: 'address', /*/onchain*/air: 'place', space: 'x', /*onchain*/robinhood: 'x', deployer: 'address', /*/onchain*/launches: 'company', markets: 'x', rewind: 'date', sanctions: 'q', health: 'company', impact: 'place', contradictions: 'topic' }[kind];
1275
+ if (kind === 'password') {
1276
+ // k-anonymity: hash here, send 5 characters of the SHA-1, match the rest in this browser.
1277
+ const pw = $('#inv-q').value;
1278
+ if (!pw) { out.innerHTML = '<p class="err">Type a password first.</p>'; return; }
1279
+ if (!crypto.subtle) { out.innerHTML = '<p class="err">This browser cannot hash here (it needs a secure https page).</p>'; return; }
1280
+ $('#inv-go').disabled = true;
1281
+ out.innerHTML = '<p class="meta">Checking…</p>';
1282
+ try {
1283
+ const buf = await crypto.subtle.digest('SHA-1', new TextEncoder().encode(pw));
1284
+ const hex = [...new Uint8Array(buf)].map((b) => b.toString(16).padStart(2, '0')).join('').toUpperCase();
1285
+ const r = await api('/api/pwned?prefix=' + hex.slice(0, 5));
1286
+ const hit = r.suffixes.find(([s]) => s === hex.slice(5));
1287
+ const n = hit ? hit[1] : 0;
1288
+ out.innerHTML = `<h3><span class="pill ${n ? 'bad' : 'ok'}">${n ? 'leaked' : 'not found'}</span> ${n ? `<span class="meta">seen ${n.toLocaleString('en-US')} times in data breaches</span>` : '<span class="meta">not in any known breach</span>'}</h3><ul class="ev">${n ? '<li>Stop using this password everywhere you use it, starting with email and banking.</li><li>Use a password manager to make a different password for every site, and turn on two-factor sign-in.</li>' : '<li>Still use it on one site only, and keep two-factor sign-in on.</li>'}</ul><p class="meta">Your password never left this browser: only the first 5 characters of its SHA-1 hash (${esc(hex.slice(0, 5))}) were sent, and the match happened here. Data: Have I Been Pwned, Pwned Passwords.</p>`;
1289
+ } catch (err) { out.innerHTML = `<p class="err">${esc(err.message)}</p>`; }
1290
+ finally { $('#inv-go').disabled = false; }
1291
+ return;
1292
+ }
1293
+ const param = { phone: 'number', breaches: 'domain', company: 'q', ip: 'ip', hash: 'hash', ransomware: 'q', satellites: 'q', scam: 'message', recall: 'q', emailsec: 'domain', airport: 'code', country: 'name', papers: 'topic', url: 'url', factcheck: 'claim', audit: 'packages', travel: 'place', dossier: 'name', hype: 'topic', footprint: 'domain', lights: 'place', aircraft: 'q', /*onchain*/wallet: 'address', token: 'address', /*/onchain*/air: 'place', space: 'x', /*onchain*/robinhood: 'x', deployer: 'address', /*/onchain*/launches: 'company', markets: 'x', rewind: 'date', sanctions: 'q', health: 'company', impact: 'place', contradictions: 'topic' }[kind];
1227
1294
  $('#inv-go').disabled = true;
1228
1295
  out.innerHTML = '<p class="meta">Working… some sources are rate-limited and take a while.</p>';
1229
1296
  try {
@@ -1352,13 +1419,44 @@ function drawGraph() {
1352
1419
  const line = getComputedStyle(document.documentElement).getPropertyValue('--line');
1353
1420
  ctx.strokeStyle = line; ctx.lineWidth = 1;
1354
1421
  for (const e of edges) { const [x1, y1] = graphState.tx(nodes[e.a]); const [x2, y2] = graphState.tx(nodes[e.b]); ctx.beginPath(); ctx.moveTo(x1, y1); ctx.lineTo(x2, y2); ctx.stroke(); }
1355
- const text = getComputedStyle(document.documentElement).getPropertyValue('--text');
1356
- nodes.forEach((n, i) => {
1357
- const [x, y] = graphState.tx(n); const r = 3 + Math.min(9, Math.sqrt(n.deg) * 2);
1358
- ctx.beginPath(); ctx.arc(x, y, r, 0, Math.PI * 2); ctx.fillStyle = KIND_COLORS[n.kind] || '#94a3b8'; ctx.fill();
1359
- if (i === hover || n.deg >= 4) { ctx.fillStyle = text; ctx.font = '11px system-ui'; ctx.fillText(n.name.slice(0, 40), x + r + 3, y + 4); }
1422
+ const css = getComputedStyle(document.documentElement);
1423
+ const text = css.getPropertyValue('--text'), bg = css.getPropertyValue('--bg') || '#000';
1424
+ const radius = (n) => 3 + Math.min(9, Math.sqrt(n.deg) * 2);
1425
+ nodes.forEach((n) => {
1426
+ const [x, y] = graphState.tx(n);
1427
+ ctx.beginPath(); ctx.arc(x, y, radius(n), 0, Math.PI * 2); ctx.fillStyle = KIND_COLORS[n.kind] || '#94a3b8'; ctx.fill();
1360
1428
  });
1429
+ // Labels: the hovered node first, then the best-connected ones, and only where a label does not overlap
1430
+ // one already drawn, so dense clusters stay readable instead of turning into a block of text.
1431
+ ctx.font = '11px system-ui'; ctx.textBaseline = 'middle'; ctx.lineJoin = 'round';
1432
+ const placed = [], max = w < 520 ? 14 : 40;
1433
+ const order = nodes.map((n, i) => i).filter((i) => i === hover || nodes[i].deg >= 4).sort((a, b) => (b === hover) - (a === hover) || nodes[b].deg - nodes[a].deg);
1434
+ for (const i of order) {
1435
+ const n = nodes[i], [x, y] = graphState.tx(n), r = radius(n);
1436
+ const label = n.name.length > 28 ? n.name.slice(0, 27) + '…' : n.name;
1437
+ const tw = ctx.measureText(label).width;
1438
+ let lx = x + r + 4; if (lx + tw > w - 4) lx = x - r - 4 - tw;
1439
+ const box = [lx - 2, y - 8, lx + tw + 2, y + 8];
1440
+ if (i !== hover && (placed.length >= max || placed.some((p) => box[0] < p[2] && box[2] > p[0] && box[1] < p[3] && box[3] > p[1]))) continue;
1441
+ placed.push(box);
1442
+ ctx.strokeStyle = bg; ctx.lineWidth = 3; ctx.strokeText(label, lx, y);
1443
+ ctx.fillStyle = text; ctx.fillText(label, lx, y);
1444
+ }
1445
+ ctx.textBaseline = 'alphabetic';
1361
1446
  }
1447
+ function graphPick(e, reach) {
1448
+ if (!graphState?.tx) return -1;
1449
+ const rect = $('#graph').getBoundingClientRect(); const mx = e.clientX - rect.left, my = e.clientY - rect.top;
1450
+ let best = -1, bd = reach * reach;
1451
+ graphState.nodes.forEach((n, i) => { const [x, y] = graphState.tx(n); const d = (x - mx) ** 2 + (y - my) ** 2; if (d < bd) { bd = d; best = i; } });
1452
+ return best;
1453
+ }
1454
+ // Touch has no hover: a tap picks the nearest node within a finger's reach.
1455
+ $('#graph').addEventListener('pointerdown', (e) => {
1456
+ if (e.pointerType === 'mouse' || !graphState) return;
1457
+ const best = graphPick(e, 28);
1458
+ if (best !== graphState.hover) { graphState.hover = best; drawGraph(); $('#graph-hover').textContent = best >= 0 ? `${graphState.nodes[best].kind}: ${graphState.nodes[best].name}` : 'Tap a node to see it; tap again to open its neighbors.'; }
1459
+ });
1362
1460
  $('#graph').addEventListener('mousemove', (e) => {
1363
1461
  if (!graphState?.tx) return;
1364
1462
  const rect = e.target.getBoundingClientRect(); const mx = e.clientX - rect.left, my = e.clientY - rect.top;
@@ -84,6 +84,8 @@ const KEY_GROUPS = [
84
84
  ['Companies', ['ADZUNA_APP_KEY', 'COURTLISTENER_TOKEN', 'COMPANIES_HOUSE_API_KEY', 'BRANDFETCH_API_KEY']],
85
85
  ['Social and audio', ['APIFY_TOKEN', 'YOUTUBE_API_KEY', 'BLUESKY_APP_PASSWORD', 'DEEPGRAM_API_KEY']],
86
86
  ['Web security', ['URLSCAN_API_KEY', 'SAFE_BROWSING_KEY', 'ABUSECH_AUTH_KEY']],
87
+ ['Threat intel', ['ABUSEIPDB_API_KEY', 'OTX_API_KEY', 'IPINFO_TOKEN', 'VIRUSTOTAL_API_KEY']],
88
+ ['Phone', ['NUMVERIFY_API_KEY']],
87
89
  ['Fact checks', ['GOOGLE_API_KEY']],
88
90
  ['Telegram bot', ['TELEGRAM_BOT_TOKEN']],
89
91
  ];
@@ -8,7 +8,7 @@
8
8
  <link rel="icon" type="image/png" href="/favicon.ico">
9
9
  <link rel="apple-touch-icon" href="/assets/icon-192.png">
10
10
  <title>Oculon</title>
11
- <meta property="og:type" content="website"><meta property="og:site_name" content="Oculon"><meta property="og:title" content="Oculon: check anything, every answer sourced"><meta property="og:description" content="Open-source intelligence engine and agent: link and claim checks, recalls, travel risk, routing, vulnerabilities, ships and satellites, with sources on every answer."><meta property="og:url" content="https://oculon.live/"><meta property="og:image" content="https://oculon.live/assets/og.png"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:image" content="https://oculon.live/assets/og.png">
11
+ <meta property="og:type" content="website"><meta property="og:site_name" content="Oculon"><meta property="og:title" content="Oculon: check anything, every answer sourced"><meta property="og:description" content="Open-source intelligence engine and agent: link and claim checks, recalls, travel risk, routing, vulnerabilities, ships and satellites, with sources on every answer."><meta property="og:url" content="https://oculon.live/"><meta property="og:image" content="https://oculon.live/assets/og.png?v=2"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:image" content="https://oculon.live/assets/og.png?v=2">
12
12
  <!--onchain--><meta name="description" content="Open-source intelligence engine: routing, vulnerabilities, ships, satellites and Robinhood Chain, with sources on every answer."><!--/onchain-->
13
13
  <!--offchain--><meta name="description" content="Open-source intelligence engine: routing, vulnerabilities, ships, satellites and markets, with sources on every answer."><!--/offchain-->
14
14
  <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -8,7 +8,7 @@
8
8
  <link rel="icon" type="image/png" href="/favicon.ico">
9
9
  <link rel="apple-touch-icon" href="/assets/icon-192.png">
10
10
  <title>Oculon Legal</title>
11
- <meta property="og:type" content="website"><meta property="og:site_name" content="Oculon"><meta property="og:title" content="Oculon"><meta property="og:description" content="Privacy and terms for Oculon."><meta property="og:url" content="https://oculon.live/privacy"><meta property="og:image" content="https://oculon.live/assets/og.png"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:image" content="https://oculon.live/assets/og.png">
11
+ <meta property="og:type" content="website"><meta property="og:site_name" content="Oculon"><meta property="og:title" content="Oculon"><meta property="og:description" content="Privacy and terms for Oculon."><meta property="og:url" content="https://oculon.live/privacy"><meta property="og:image" content="https://oculon.live/assets/og.png?v=2"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:image" content="https://oculon.live/assets/og.png?v=2">
12
12
  <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
13
13
  <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet">
14
14
  <style>
package/dist/web/mcp.html CHANGED
@@ -7,7 +7,7 @@
7
7
  <link rel="icon" type="image/png" href="/favicon.ico">
8
8
  <title>Oculon MCP</title>
9
9
  <meta name="description" content="Remote MCP server for Oculon: OSINT checks with sources for any AI agent, nothing to install.">
10
- <meta property="og:type" content="website"><meta property="og:site_name" content="Oculon"><meta property="og:title" content="Oculon MCP server"><meta property="og:description" content="One URL gives any AI agent Oculon's checks: scams, links, claims, recalls, travel risk, CVEs, outages and research, each with sources."><meta property="og:url" content="{{URL}}"><meta property="og:image" content="https://oculon.live/assets/og.png"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:image" content="https://oculon.live/assets/og.png">
10
+ <meta property="og:type" content="website"><meta property="og:site_name" content="Oculon"><meta property="og:title" content="Oculon MCP server"><meta property="og:description" content="One URL gives any AI agent Oculon's checks: scams, links, claims, recalls, travel risk, CVEs, outages and research, each with sources."><meta property="og:url" content="{{URL}}"><meta property="og:image" content="https://oculon.live/assets/og-mcp.png?v=2"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:image" content="https://oculon.live/assets/og-mcp.png?v=2">
11
11
  <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
12
12
  <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet">
13
13
  <style>
@@ -6,6 +6,13 @@ const E = [
6
6
  ['/api/factcheck', 'factCheck', 'Fact check a claim or a news link against published fact checks and current reporting.', [{ name: 'claim', desc: 'Claim text or article URL', example: 'The Great Wall of China is visible from space', required: true }]],
7
7
  ['/api/recall', 'recall', 'Vehicle recalls by VIN or "year make model", or product recalls by name (NHTSA, CPSC, FDA).', [{ name: 'q', desc: 'VIN, vehicle or product', example: '2018 Honda Accord', required: true }]],
8
8
  ['/api/emailsec', 'emailSecurity', 'Can someone spoof email from this domain? SPF, DMARC, DKIM, MTA-STS, DNSSEC, with fixes.', [{ name: 'domain', desc: 'Domain', example: 'example.com', required: true }]],
9
+ ['/api/phone', 'phoneCheck', 'Who is calling? Country, line type, carrier, premium-rate and callback-scam warnings for a phone number.', [{ name: 'number', desc: 'Phone number in international format', example: '+1 876 555 0100', required: true }, { name: 'country', desc: 'ISO country code for a national number', example: 'US' }]],
10
+ ['/api/company', 'companyCheck', 'Is this supplier real? EU VAT number (VIES), LEI or company name (GLEIF): status, address, ultimate parent.', [{ name: 'q', desc: 'Company name, LEI or EU VAT number', example: 'NL004495445B01', required: true }]],
11
+ ['/api/breaches', 'dataBreaches', 'Newest data breaches in Have I Been Pwned, or every breach of one domain.', [{ name: 'domain', desc: 'Domain or company (optional)', example: 'adobe.com' }]],
12
+ ['/api/ip', 'ipCheck', 'Who runs this IP, and is it known for abuse? AbuseIPDB, GreyNoise, OTX, VirusTotal, ThreatFox, Spamhaus DROP, Tor, open ports.', [{ name: 'ip', desc: 'IP address or domain', example: '185.220.101.1', required: true }]],
13
+ ['/api/hash', 'hashCheck', 'Is this file known malware or a known good file? MD5, SHA-1 or SHA-256.', [{ name: 'hash', desc: 'File hash in hex', example: '094fd325049b8a9cf6d3e5ef2a6d4cc6a567d7d49c35f8bb8dd9e3c6acf3d78d', required: true }]],
14
+ ['/api/ransomware', 'ransomwareClaims', 'Ransomware leak-site claims: newest, or by country code, sector, company or domain.', [{ name: 'q', desc: 'Country code, sector, company or domain (optional)', example: 'Healthcare' }]],
15
+ ['/api/satellites', 'satellites', 'Satellites launched in the last 30 days, or one object\'s orbit, owner and status.', [{ name: 'q', desc: 'Satellite name or NORAD number (optional)', example: '25544' }]],
9
16
  ['/api/travel', 'travelRisk', 'Travel risk for the coming week: official advice, weather, air, outbreaks, disasters, quakes, outages.', [{ name: 'place', desc: 'City or country', example: 'Lisbon', required: true }]],
10
17
  ['/api/airport', 'airportStatus', 'Airport weather (METAR, TAF), FAA delays and ground stops, nearby emergency squawks.', [{ name: 'code', desc: 'IATA or ICAO code, or name', example: 'JFK', required: true }]],
11
18
  ['/api/country', 'countryBrief', 'Country brief: economy, IMF outlook, leaders, currency, travel advice, outages, headlines.', [{ name: 'name', desc: 'Country name or ISO code', example: 'Argentina', required: true }]],
@@ -43,9 +43,17 @@ export const PUBLIC_API = new Set([
43
43
  '/api/airport',
44
44
  '/api/share',
45
45
  '/api/scam',
46
+ '/api/ip',
47
+ '/api/hash',
48
+ '/api/ransomware',
49
+ '/api/company',
50
+ '/api/pwned',
51
+ '/api/breaches',
52
+ '/api/phone',
53
+ '/api/satellites',
46
54
  ]);
47
55
  /** Endpoints that start outside work (a CLI process or several upstream calls) get a tighter budget. */
48
- const HEAVY = new Set(['/api/console', '/api/rhtoken', '/api/verify', '/api/url', '/api/travel', '/api/audit', '/api/recall', '/api/emailsec', '/api/country', '/api/airport', '/api/scam']);
56
+ const HEAVY = new Set(['/api/console', '/api/rhtoken', '/api/verify', '/api/url', '/api/travel', '/api/audit', '/api/recall', '/api/emailsec', '/api/country', '/api/airport', '/api/scam', '/api/ip', '/api/hash', '/api/company', '/api/phone']);
49
57
  /** Signals from these modules describe the owner's own watchlist, cases, fences, votes or raw social streams. */
50
58
  const PRIVATE_MODULES = new Set(['meerkat', 'case', 'fence', 'feedback', 'live']);
51
59
  export function publicSignals(list) {
@@ -50,6 +50,19 @@ function need(q, key, max = 200) {
50
50
  throw new HttpError(400, `parameter too long: ${key}`);
51
51
  return v;
52
52
  }
53
+ // Modules throw plain errors for bad input ("not a CVE id", "date must be YYYY-MM-DD") and for missing
54
+ // records ("no prediction x"). Those are the caller's problem, not a server failure, so they map to 400 and
55
+ // 404; anything else stays a 500.
56
+ function statusFor(e) {
57
+ if (e instanceof HttpError)
58
+ return e.status;
59
+ const m = e?.message ?? '';
60
+ if (/^no (such|prediction|case|share|entity|record)\b|\bnot found\b/i.test(m))
61
+ return 404;
62
+ if (/^(not an? |invalid |missing |expected |paste |give |that does not look|could not decode|could not read the manifest|could not turn that)|\b(must be|must include|expected) [A-Za-z0-9"(-]/i.test(m))
63
+ return 400;
64
+ return 500;
65
+ }
53
66
  class HttpError extends Error {
54
67
  status;
55
68
  constructor(status, message) {
@@ -69,7 +82,21 @@ export function consoleArgv(input) {
69
82
  return null;
70
83
  const [cmd, a1, a2, a3] = parts;
71
84
  const onchain = onchainEnabled();
72
- const bare = ['bgp', 'vulns', 'hazards', 'cloud', 'squawk', 'blackout', 'regs', 'calendar', 'quota', 'help', ...(onchain ? ['rh', 'defi'] : [])];
85
+ const bare = ['bgp', 'vulns', 'hazards', 'cloud', 'squawk', 'blackout', 'regs', 'calendar', 'quota', 'help', 'ransomware', 'breaches', 'satellite', ...(onchain ? ['rh', 'defi'] : [])];
86
+ if (cmd === 'ip' && parts.length === 2 && /^([\d.]{7,15}|[0-9a-f:]{2,39}|[a-z0-9.-]+\.[a-z]{2,})$/i.test(a1))
87
+ return ['ip', a1.toLowerCase()];
88
+ if (cmd === 'hash' && parts.length === 2 && /^([a-f0-9]{32}|[a-f0-9]{40}|[a-f0-9]{64})$/i.test(a1))
89
+ return ['hash', a1.toLowerCase()];
90
+ if (cmd === 'phone' && parts.length === 2 && /^\+\d{7,15}$/.test(a1))
91
+ return ['phone', a1];
92
+ if (cmd === 'breaches' && parts.length === 2 && /^[a-z0-9.-]+\.[a-z]{2,}$/i.test(a1))
93
+ return ['breaches', a1.toLowerCase()];
94
+ if (cmd === 'ransomware' && parts.length === 2 && /^[\p{L}\d.-]{2,40}$/u.test(a1))
95
+ return ['ransomware', a1];
96
+ if (cmd === 'satellite' && parts.length === 2 && /^[\w()-]{3,30}$/.test(a1))
97
+ return ['satellite', a1];
98
+ if (cmd === 'company' && parts.length === 2 && /^[A-Z0-9]{8,20}$/i.test(a1))
99
+ return ['company', a1.toUpperCase()];
73
100
  if (parts.length === 1 && bare.includes(cmd))
74
101
  return [cmd];
75
102
  if (onchain && cmd === 'deployer' && parts.length === 2 && HEX_ADDR.test(a1))
@@ -201,7 +228,12 @@ export const ROUTES = {
201
228
  '/api/rewind': async (q, o) => slim(await o.rewind(need(q, 'date', 10))),
202
229
  '/api/scoops': (_q, o) => o.scoops(),
203
230
  '/api/cases': async (_q, o) => (await o.caseList()).map((k) => ({ id: k.id, question: k.question, confidence: k.report?.confidence ?? null, findings: k.report?.findings.length ?? 0, runs: k.runs, watch: k.watch, updatedAt: k.updatedAt })),
204
- '/api/case': async (q, o) => o.caseGet(Number(need(q, 'id', 10))),
231
+ '/api/case': async (q, o) => {
232
+ const id = need(q, 'id', 10);
233
+ if (!/^\d+$/.test(id))
234
+ throw new HttpError(400, 'id must be a case number');
235
+ return (await o.caseGet(Number(id))) ?? (() => { throw new HttpError(404, 'no such case'); })();
236
+ },
205
237
  '/api/fences': (_q, o) => o.fenceList().map((f) => ({ id: f.id, name: f.name, box: [f.south, f.west, f.north, f.east], kinds: f.kinds, lastRun: f.lastRun, now: f.lastState ? { milAircraft: Object.values(f.lastState.milAircraft), milVessels: Object.values(f.lastState.milVessels), quakes: Object.values(f.lastState.quakes), events: Object.values(f.lastState.events) } : null })),
206
238
  '/api/quakes': async (_q, o) => {
207
239
  const { recentQuakes } = await import('../sources/usgs.js');
@@ -228,6 +260,23 @@ export const ROUTES = {
228
260
  throw e instanceof HttpError ? e : new HttpError(400, e.message);
229
261
  }
230
262
  },
263
+ '/api/ip': async (q, o) => slim(await o.ipCheck(need(q, 'ip', 253))),
264
+ '/api/hash': async (q, o) => slim(await o.hashCheck(need(q, 'hash', 64))),
265
+ '/api/ransomware': async (q, o) => slim(await o.ransomware((q.get('q') ?? '').slice(0, 80))),
266
+ '/api/company': async (q, o) => slim(await o.companyCheck(need(q, 'q', 120))),
267
+ // Password checks hash in the browser and send only 5 characters of the SHA-1; the server never sees the password.
268
+ '/api/pwned': async (q, o) => {
269
+ const prefix = need(q, 'prefix', 5);
270
+ if (!/^[0-9a-f]{5}$/i.test(prefix))
271
+ throw new HttpError(400, 'prefix must be the first 5 hex characters of a SHA-1 hash');
272
+ const r = await o.pwnedRange(prefix);
273
+ if (!r.data)
274
+ throw new HttpError(502, `Pwned Passwords is not answering right now (${r.prov.note ?? r.prov.status})`);
275
+ return { prefix: prefix.toUpperCase(), suffixes: [...r.data], provenance: [r.prov] };
276
+ },
277
+ '/api/breaches': async (q, o) => slim(await o.breaches((q.get('domain') ?? '').slice(0, 120))),
278
+ '/api/phone': async (q, o) => slim(await o.phoneCheck(need(q, 'number', 32), q.get('country') ? { country: q.get('country').slice(0, 2) } : {})),
279
+ '/api/satellites': async (q, o) => slim(await o.satellites((q.get('q') ?? '').slice(0, 60))),
231
280
  '/api/papers': async (q, o) => slim(await o.papers(need(q, 'topic', 200), q.get('years') ? { years: Number(q.get('years')) || 3 } : {})),
232
281
  '/api/country': async (q, o) => {
233
282
  try {
@@ -802,7 +851,7 @@ export function createWebServer(opts = {}) {
802
851
  return send(res, 200, readFileSync(r.result.file), 'image/png');
803
852
  }
804
853
  catch (e) {
805
- return send(res, e instanceof HttpError ? e.status : 500, JSON.stringify({ error: e.message }), 'application/json');
854
+ return send(res, statusFor(e), JSON.stringify({ error: e.message }), 'application/json');
806
855
  }
807
856
  }
808
857
  const route = ROUTES[url.pathname];
@@ -823,7 +872,7 @@ export function createWebServer(opts = {}) {
823
872
  send(res, 200, JSON.stringify(out), 'application/json; charset=utf-8');
824
873
  }
825
874
  catch (e) {
826
- const status = e instanceof HttpError ? e.status : 500;
875
+ const status = statusFor(e);
827
876
  log(`${url.pathname} ${status} ${e.message}`);
828
877
  send(res, status, JSON.stringify({ error: e.message }), 'application/json; charset=utf-8');
829
878
  }
@@ -831,6 +880,16 @@ export function createWebServer(opts = {}) {
831
880
  const scheduler = opts.watchMinutes && opts.watchMinutes > 0
832
881
  ? startScheduler(oculon, { scanMinutes: opts.watchMinutes, log: (m) => log(`schedule ${m}`), baseUrl: siteDomain ? `https://${siteDomain}` : `http://127.0.0.1:${opts.port ?? 4747}`, appUrl: siteDomain ? `https://app.${siteDomain}/#watch` : `http://127.0.0.1:${opts.port ?? 4747}/app#watch`, ...(opts.onSignals ? { onSignals: opts.onSignals } : {}), ...(opts.onBrief ? { onBrief: opts.onBrief } : {}), ...(opts.onReport ? { onReport: opts.onReport } : {}), ...(opts.onPersonal ? { onPersonal: opts.onPersonal } : {}) })
833
882
  : null;
883
+ server.on('error', (e) => {
884
+ const port = opts.port ?? 4747;
885
+ if (e.code === 'EADDRINUSE')
886
+ console.error(`Port ${port} is already in use, probably by another Oculon server. Stop that one, or pick another port: oculon serve --port ${port + 1}`);
887
+ else if (e.code === 'EACCES')
888
+ console.error(`No permission to listen on port ${port}. Pick a port above 1024: oculon serve --port 4747`);
889
+ else
890
+ console.error(`The server could not start: ${e.message}`);
891
+ process.exit(1);
892
+ });
834
893
  server.listen(opts.port ?? 4747, opts.host ?? '127.0.0.1');
835
894
  return {
836
895
  server,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "oculon",
3
- "version": "0.1.3",
4
- "description": "OSINT engine you can run, script and plug into agents: 70+ live tools for scams, links, outages, CVEs and research, each result with its sources. CLI, SDK, MCP server and web app. Zero dependencies.",
3
+ "version": "0.1.5",
4
+ "description": "OSINT engine you can run, script and plug into agents: 80+ live tools for scams, links, IPs, malware, outages, CVEs and research, each result with its sources. CLI, SDK, MCP server and web app. Zero dependencies.",
5
5
  "keywords": [
6
6
  "osint",
7
7
  "open-source-intelligence",