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
package/README.md CHANGED
@@ -21,8 +21,8 @@ npx oculon ask "why is Nvidia in the news this week?"
21
21
  - **Sourced by design.** Every answer names the sources it used and whether each one was live, cached or unavailable. Nothing is presented without provenance.
22
22
  - **Cross-source signals.** When independent sources move on the same subject, Oculon fuses them into one scored signal with the evidence behind it, and storylines are tracked across days.
23
23
  - **Measured, not claimed.** A time machine replays past days to calibrate the radar, a first-to-know check compares Oculon against media coverage, and forecasts are timestamped on Bitcoin so they cannot be edited later.
24
- - **Built for agents.** 75 MCP tools, locally over stdio or remotely at `https://mcp.oculon.live`; the SDK and CLI return the same objects, and `--json` works on every command.
25
- - **Everyday checks.** Is this message a scam? Is this link dangerous? Is this claim true? Is my car recalled? Can someone spoof my email domain? Are my dependencies safe? What should I know before I travel? Each answer names its sources, and any result can be shared as a link with a preview card.
24
+ - **Built for agents.** 83 MCP tools locally over stdio, and 74 of them remotely at `https://mcp.oculon.live`; the SDK and CLI return the same objects, and `--json` works on every command.
25
+ - **Everyday checks.** Is this message a scam? Is this link dangerous? Is this claim true? Is my car recalled? Can someone spoof my email domain? Are my dependencies safe? What should I know before I travel? Who is calling me? Has my password leaked? Is this supplier real? Each answer names its sources, and any result can be shared as a link with a preview card.
26
26
  - **Monitors in plain words.** "Tell me when there is an internet outage in Iran" becomes a rule that is re-checked on a schedule and reports only what changed, by email, in Telegram or in the app. Every visitor keeps their own monitors, with no account.
27
27
  - **Everywhere people are.** A public Telegram bot ([@oculon_radar_bot](https://t.me/oculon_radar_bot)): forward it a suspicious message and it checks it. An OpenAPI spec at `/openapi.json` for ChatGPT Actions, n8n and Zapier.
28
28
  - **Free to run.** Daily per-source budgets keep every free tier free, and the data lives in one local SQLite file.
@@ -45,6 +45,14 @@ npx oculon ask "why is Nvidia in the news this week?"
45
45
  | Papers | `oculon papers "<topic>"` | Research brief: the most cited papers of recent years among the most relevant, the newest relevant ones, papers per year (growing, steady or shrinking), PubMed counts for medical topics, and a short overview that cites the numbered papers | OpenAlex, PubMed, Semantic Scholar, Groq, Gemini, Mistral |
46
46
  | Country | `oculon country <name>` | One-page country brief: GDP, growth, GDP per person, inflation, unemployment and population, the IMF outlook for this year and next, head of state and government, capital, currency and its rate to the dollar, US and UK travel advice, internet outages, disaster alerts and the latest headlines | World Bank, IMF, Wikidata, open.er-api.com, US State Department, UK FCDO, Cloudflare Radar, GDACS, Guardian |
47
47
  | Airport | `oculon airport <JFK\|EGLL\|name>` | Is an airport running normally? Current METAR and TAF (flight category, wind, visibility, ceiling), FAA ground stops, ground delay programs, delays and closures at US airports, and aircraft squawking an emergency within 150 km | aviationweather.gov (NOAA), FAA NAS status, adsb.lol, OurAirports |
48
+ | Phone | `oculon phone <+number> [--country US]` | Who is behind a number in a suspicious SMS or a missed call: country from the calling code, line type (mobile, landline, VoIP, premium rate), carrier and location, and warnings for premium-rate numbers, UK 070 personal numbers and the Caribbean area codes the FCC names in "one ring" callback scams. Never looks up the owner | ITU calling codes (offline), Numverify (free key, 100 a month) |
49
+ | Password | `oculon password` · web app | Has a password appeared in a data breach? Only the first 5 characters of its SHA-1 hash are sent and the match happens locally (in the web app, in the browser); the password is never stored, logged or shown | Have I Been Pwned (Pwned Passwords) |
50
+ | Breaches | `oculon breaches [domain]` | The newest breaches added to Have I Been Pwned, or every breach of one domain or company: date, accounts affected and the kinds of data exposed. Sensitive breaches are left out | Have I Been Pwned (CC BY 4.0) |
51
+ | Company | `oculon company <name\|LEI\|EU VAT>` | Is a supplier real before you pay its invoice? An EU VAT number is checked live (valid or not, registered name and address); a name or LEI returns the legal entity, registered address, status, registration number and ultimate parent, with warnings for invalid numbers, inactive companies and lapsed records | EU VIES, GLEIF (Global LEI Index) |
52
+ | IP check | `oculon ip <IP\|domain>` | Who runs an address and is it known for abuse: network, owner and type, location, abuse reports, internet scanning, threat reports, antivirus verdicts, malware infrastructure, hijacked or criminal networks, Tor exits and open ports; a verdict, a 0-100 risk and the reasons. Big shared services that collect stray reports are not blamed | AbuseIPDB, GreyNoise, AlienVault OTX, VirusTotal, ThreatFox, Spamhaus DROP, Tor Project, ip-api.com, IPinfo, PeeringDB, Shodan InternetDB |
53
+ | Hash check | `oculon hash <md5\|sha1\|sha256>` | Is a file known malware, a known good file, or unknown? Malware family, first seen, detections, and the known-software sets it belongs to | CIRCL hashlookup (NIST NSRL), MalwareBazaar, ThreatFox, AlienVault OTX, VirusTotal |
54
+ | Ransomware | `oculon ransomware [CC\|sector\|name]` | Claims posted on ransomware leak sites, newest first, by country, sector or a company or domain, with counts by group, country and sector. Leak-site links are never passed on | ransomware.live |
55
+ | Satellites | `oculon satellite [name\|NORAD id]` | Everything launched in the last 30 days grouped by launch, or one object's orbit (perigee, apogee, period, inclination), owner, launch date and status | CelesTrak |
48
56
  | Share | web app · `/r/<id>` | Any everyday check can be shared as a link: the server runs the check, keeps a snapshot and serves it as a page with a preview card for X, Telegram, WhatsApp and Slack | Oculon |
49
57
  | Personal monitors | web app · Telegram `/monitor` | Each visitor (a random id in a cookie, no account) or Telegram chat keeps up to 10 monitors of its own, written in plain language and re-checked about hourly; changes are kept as alerts and sent by email (after a confirmation link, with one-click unsubscribe) or to the Telegram chat | Resend (email), Meerkat |
50
58
  | Monitor | `oculon monitor "<request>"` | Watch anything in plain language: "internet outages in Iran", "critical CVEs for nginx", "earthquakes above 6 near Tokyo", "news about OpenAI", "travel risk changes for Bangkok", "flood or cyclone alerts for the Philippines". The request becomes a watchlist rule; only changes are reported, with evidence, in the app, Telegram and the signal feed | Groq, Gemini, Mistral (with a pattern fallback), Meerkat |
@@ -129,6 +137,14 @@ oculon watch add company Nvidia # watchlist: company domain plane
129
137
  oculon watch run # report only what changed since last time
130
138
  oculon brief # today's brief
131
139
  oculon quota # today's API usage vs daily budgets
140
+ oculon phone "+1 876 555 0100" # who is calling? one-ring scam area code
141
+ oculon password # has my password leaked? (asked without echo)
142
+ oculon breaches adobe.com # breaches of a domain
143
+ oculon company NL004495445B01 # EU VAT number, LEI or company name
144
+ oculon ip 185.220.101.1 # abuse reports, scanners, Tor, threat reports
145
+ oculon hash <sha256> # known malware or a known good file?
146
+ oculon ransomware Healthcare # ransomware leak-site claims
147
+ oculon satellite 25544 # ISS orbit, owner, status
132
148
  oculon ask "is there a geomagnetic storm right now?"
133
149
  oculon radar # what the world is suddenly watching
134
150
  oculon dossier Nvidia # company / person dossier
@@ -263,7 +279,7 @@ TELEGRAM_ALERT_MIN_SCORE=70
263
279
  TELEGRAM_WATCH_MINUTES=15
264
280
  ```
265
281
 
266
- Run `oculon telegram` (or `oculon serve --telegram`). Every module has a command (`/help` lists them), including `/ask`, `/case`, `/calendar`, `/connect Nvidia to Jensen Huang`, `/live`, `/brief`, `/report` and `/alerts on|off`. Alerts arrive with Useful and Noise buttons; `/feedback` shows how the votes moved each module's alert bar. Chats outside the allowlist are refused and cannot vote.
282
+ Run `oculon telegram` (or `oculon serve --telegram`). Every module has a command (`/help` lists them; the password check is left out so nobody types a password into a chat), including `/ask`, `/case`, `/calendar`, `/connect Nvidia to Jensen Huang`, `/live`, `/brief`, `/report` and `/alerts on|off`. Alerts arrive with Useful and Noise buttons; `/feedback` shows how the votes moved each module's alert bar. Chats outside the allowlist are refused and cannot vote.
267
283
 
268
284
  ## Configuration
269
285
 
@@ -337,6 +353,8 @@ The repository includes a `Dockerfile` (on Railway, set the service health check
337
353
  - Social pulse samples are small (X returns about 10 posts per search on Apify's free plan) and X, TikTok and Bluesky are fetched by popularity, so pace is measured on Reddit only. Address labels come from a community dataset (MIT) and can be incomplete or stale.
338
354
  - Plugins run with full Node permissions; install only code you trust.
339
355
  - `oculon ask` answers are written by an LLM from tool results; they can still misread data, so check the cited sources.
356
+ - The VirusTotal public API is for non-commercial use and allows 4 lookups a minute, so IP and hash checks can wait up to 15 s for it. Numverify's free plan allows 100 lookups a month (Oculon uses at most 3 a day); after that the phone check answers from the offline calling-code table. ip-api.com and Numverify free plans are HTTP only.
357
+ - Ransomware claims are posted by criminal groups and are sometimes wrong or exaggerated. EU VIES often answers "too many requests" for a country for a few minutes; the check retries once and then says so. Germany does not publish VAT holders' names through VIES.
340
358
  - Respect each data provider's terms. OpenStreetMap, Nominatim and adsb.lol data are ODbL-licensed and require attribution.
341
359
 
342
360
  ## Development
package/dist/cli/main.js CHANGED
@@ -189,6 +189,16 @@ ${c.bold('Everyday checks')}
189
189
  oculon papers "<topic>" research brief: most cited and newest papers
190
190
  oculon country <name> country brief: economy, leaders, currency, advice, news
191
191
  oculon airport <JFK|EGLL|name> airport weather, FAA delays and ground stops
192
+ oculon phone <+number> [--country US] who is calling? country, line type, premium-rate and callback-scam warnings
193
+ oculon password has this password leaked? (asked without echo; k-anonymity)
194
+ oculon breaches [domain] newest data breaches, or every breach of one domain (HIBP)
195
+ oculon company <name|LEI|EU VAT> is this supplier real? VAT check (VIES), LEI register (GLEIF)
196
+
197
+ ${c.bold('Threat intel')}
198
+ oculon ip <IP|domain> abuse reports, scanners, threat reports, Tor, Spamhaus DROP, open ports
199
+ oculon hash <md5|sha1|sha256> is this file known malware or a known good file?
200
+ oculon ransomware [CC|sector|name] ransomware leak-site claims, newest first
201
+ oculon satellite [name|NORAD id] launches of the last 30 days, or one object's orbit (CelesTrak)
192
202
 
193
203
  ${c.bold('Web')}
194
204
  oculon search <query> web search
@@ -231,6 +241,39 @@ const need = (a, i, what) => {
231
241
  };
232
242
  class UsageError extends Error {
233
243
  }
244
+ /** Read one line from the terminal without echoing it (for passwords). */
245
+ function readHidden(prompt) {
246
+ return new Promise((resolveLine) => {
247
+ const stdin = process.stdin;
248
+ process.stdout.write(prompt);
249
+ let buf = '';
250
+ stdin.setRawMode?.(true);
251
+ stdin.resume();
252
+ stdin.setEncoding('utf8');
253
+ const done = (v) => {
254
+ stdin.setRawMode?.(false);
255
+ stdin.pause();
256
+ stdin.removeListener('data', onData);
257
+ process.stdout.write('\n');
258
+ resolveLine(v);
259
+ };
260
+ const onData = (ch) => {
261
+ for (const k of ch) {
262
+ if (k === '\r' || k === '\n')
263
+ return done(buf);
264
+ if (k === '\u0003') {
265
+ done('');
266
+ process.exit(130);
267
+ }
268
+ if (k === '\u007f' || k === '\b')
269
+ buf = buf.slice(0, -1);
270
+ else
271
+ buf += k;
272
+ }
273
+ };
274
+ stdin.on('data', onData);
275
+ });
276
+ }
234
277
  const json = (a) => a.flags.json === true;
235
278
  const emit = (a, data, human) => (json(a) ? out(JSON.stringify(data, null, 2)) : human());
236
279
  export const COMMANDS = {
@@ -711,6 +754,156 @@ export const COMMANDS = {
711
754
  printSources(r);
712
755
  });
713
756
  },
757
+ async ip(o, a) {
758
+ const q = a.pos[1]?.trim();
759
+ if (!q)
760
+ throw new UsageError('usage: oculon ip <IP address | domain>');
761
+ const r = await o.ipCheck(q);
762
+ emit(a, r, () => {
763
+ const d = r.result;
764
+ const tone = d.verdict === 'malicious' ? c.red : d.verdict === 'suspicious' ? c.yellow : c.green;
765
+ out(`${c.bold(d.ip)}${d.resolvedFrom ? c.dim(` (${d.resolvedFrom})`) : ''} ${tone(d.verdict.toUpperCase())} ${c.dim(`risk ${d.risk}/100`)}`);
766
+ const where = d.location ? [d.location.city, d.location.region, d.location.country].filter(Boolean).join(', ') : 'unknown';
767
+ out(` network ${[d.network.asn, d.network.name].filter(Boolean).join(' ') || 'unknown'}${d.network.type ? c.dim(` · ${d.network.type}`) : ''}`);
768
+ out(` where ${where}${d.network.reverse ? c.dim(` · ${d.network.reverse}`) : ''}`);
769
+ const fl = Object.entries(d.flags).filter(([, v]) => v).map(([k]) => k);
770
+ if (fl.length)
771
+ out(` flags ${fl.join(', ')}`);
772
+ if (d.ports?.ports.length)
773
+ out(` ports ${d.ports.ports.slice(0, 12).join(', ')}${d.ports.vulns.length ? c.yellow(` · ${d.ports.vulns.length} known CVEs`) : ''}`);
774
+ for (const x of d.reasons)
775
+ out(` - ${x}`);
776
+ for (const x of d.advice)
777
+ out(` → ${x}`);
778
+ printSources(r);
779
+ });
780
+ },
781
+ async hash(o, a) {
782
+ const q = a.pos[1]?.trim();
783
+ if (!q)
784
+ throw new UsageError('usage: oculon hash <MD5 | SHA-1 | SHA-256>');
785
+ const r = await o.hashCheck(q);
786
+ emit(a, r, () => {
787
+ const d = r.result;
788
+ const tone = d.verdict === 'malicious' ? c.red : d.verdict === 'suspicious' ? c.yellow : d.verdict === 'known good' ? c.green : c.gray;
789
+ out(`${tone(d.verdict.toUpperCase())} ${c.dim(`${d.algorithm} ${d.hash}`)}`);
790
+ if (d.name || d.family)
791
+ out(` ${[d.name, d.family && `family ${d.family}`].filter(Boolean).join(' · ')}`);
792
+ for (const x of d.reasons)
793
+ out(` - ${x}`);
794
+ if (d.bazaar)
795
+ out(c.dim(` ${d.bazaar.link}`));
796
+ if (d.virustotal)
797
+ out(c.dim(` ${d.virustotal.link}`));
798
+ for (const x of d.advice)
799
+ out(` → ${x}`);
800
+ printSources(r);
801
+ });
802
+ },
803
+ async ransomware(o, a) {
804
+ const r = await o.ransomware(a.pos.slice(1).join(' ').trim());
805
+ emit(a, r, () => {
806
+ const d = r.result;
807
+ out(`${c.bold(d.query ? `Ransomware claims: ${d.query}` : 'Newest ransomware claims')} ${c.dim(`${d.total} found`)}`);
808
+ if (d.byGroup.length)
809
+ out(c.dim(` groups ${d.byGroup.slice(0, 6).map((x) => `${x.name} ${x.count}`).join(' · ')}`));
810
+ if (d.byCountry.length && d.mode !== 'country')
811
+ out(c.dim(` countries ${d.byCountry.slice(0, 6).map((x) => `${x.name} ${x.count}`).join(' · ')}`));
812
+ for (const v of d.victims.slice(0, 15))
813
+ out(` ${c.dim((v.discovered ?? v.attacked ?? '').slice(0, 10))} ${c.bold(trunc(v.victim, 60))} ${c.red(v.group)}${v.country ? c.dim(` ${v.country}`) : ''}${v.sector ? c.dim(` · ${v.sector}`) : ''}`);
814
+ out(c.dim(` ${d.note}`));
815
+ printSources(r);
816
+ });
817
+ },
818
+ async company(o, a) {
819
+ const q = a.pos.slice(1).join(' ').trim();
820
+ if (!q)
821
+ throw new UsageError('usage: oculon company <name | LEI | EU VAT number>');
822
+ const r = await o.companyCheck(q);
823
+ emit(a, r, () => {
824
+ const d = r.result;
825
+ if (d.vat)
826
+ out(`${c.bold(`VAT ${d.vat.country}${d.vat.number}`)} ${d.vat.valid ? c.green('VALID') : c.red('NOT VALID')}${d.vat.name ? ` ${d.vat.name}` : ''}${d.vat.address ? c.dim(`\n ${d.vat.address}`) : ''}`);
827
+ for (const x of d.records.slice(0, 6)) {
828
+ out(`${c.bold(x.name)} ${c.dim(x.lei)} ${x.status === 'ACTIVE' ? c.green(x.status) : c.yellow(x.status ?? '?')} ${x.registration === 'ISSUED' ? c.dim('LEI issued') : c.yellow(`LEI ${(x.registration ?? '?').toLowerCase()}`)}`);
829
+ out(c.dim(` ${[x.address, x.registeredAs && `reg. ${x.registeredAs}`, x.created && `since ${x.created}`].filter(Boolean).join(' · ')}`));
830
+ if (x.parent)
831
+ out(c.dim(` ultimate parent ${x.parent.name} (${x.parent.lei})`));
832
+ }
833
+ for (const w of d.warnings)
834
+ out(c.yellow(` ! ${w}`));
835
+ printSources(r);
836
+ });
837
+ },
838
+ async password(o, a) {
839
+ let pw = a.pos.slice(1).join(' ');
840
+ if (!pw && !process.stdin.isTTY)
841
+ pw = readFileSync(0, 'utf8').replace(/\r?\n$/, '');
842
+ if (!pw && process.stdin.isTTY)
843
+ pw = await readHidden('Password (not shown, not stored): ');
844
+ if (!pw)
845
+ throw new UsageError('usage: oculon password (asks without echo; or pipe it in)');
846
+ const r = await o.passwordCheck(pw);
847
+ emit(a, r, () => {
848
+ const d = r.result;
849
+ out(d.pwned ? c.red(`PWNED seen ${d.count.toLocaleString('en-US')} times in breaches`) : c.green('NOT FOUND in known breaches'));
850
+ for (const x of d.advice)
851
+ out(` → ${x}`);
852
+ out(c.dim(' Only the first 5 characters of the SHA-1 hash were sent (Have I Been Pwned, k-anonymity).'));
853
+ });
854
+ },
855
+ async breaches(o, a) {
856
+ const r = await o.breaches(a.pos.slice(1).join(' ').trim());
857
+ emit(a, r, () => {
858
+ const d = r.result;
859
+ out(c.bold(d.query ? `Breaches: ${d.query} ${d.total ? c.red(`${d.total} found`) : c.green('none found')}` : 'Newest breaches in Have I Been Pwned'));
860
+ for (const b of d.breaches)
861
+ out(` ${c.dim(b.breachDate ?? '')} ${c.bold(b.title)}${b.domain ? c.dim(` ${b.domain}`) : ''} ${b.accounts.toLocaleString('en-US')} accounts\n ${c.dim(trunc(b.dataClasses.join(', '), 120))}`);
862
+ out(c.dim(` ${d.note}`));
863
+ printSources(r);
864
+ });
865
+ },
866
+ async phone(o, a) {
867
+ const q = a.pos.slice(1).join(' ').trim();
868
+ if (!q)
869
+ throw new UsageError('usage: oculon phone <+number> [--country US]');
870
+ const r = await o.phoneCheck(q, typeof a.flags.country === 'string' ? { country: a.flags.country } : {});
871
+ emit(a, r, () => {
872
+ const d = r.result;
873
+ const tone = d.risk === 'high' ? c.red : d.risk === 'medium' ? c.yellow : c.green;
874
+ out(`${c.bold(d.e164)} ${tone(`${d.risk.toUpperCase()} RISK`)}${d.valid === false ? c.red(' not valid') : ''}`);
875
+ out(` ${[d.country, d.location, d.lineType, d.carrier].filter(Boolean).join(' · ')}`);
876
+ for (const w of d.warnings)
877
+ out(c.yellow(` ! ${w}`));
878
+ for (const x of d.advice)
879
+ out(` → ${x}`);
880
+ printSources(r);
881
+ });
882
+ },
883
+ async satellite(o, a) {
884
+ const r = await o.satellites(a.pos.slice(1).join(' ').trim());
885
+ emit(a, r, () => {
886
+ const d = r.result;
887
+ if (d.mode === 'recent') {
888
+ out(`${c.bold('Launched in the last 30 days')} ${c.dim(`${d.total} objects`)}`);
889
+ for (const l of d.launches.slice(0, 20))
890
+ out(` ${c.dim(l.id)} ${l.names.join(', ')} ${c.dim(`(${l.objects})`)}`);
891
+ }
892
+ else {
893
+ if (!d.objects.length)
894
+ out(c.yellow(` ${d.note}`));
895
+ for (const x of d.objects) {
896
+ out(`${c.bold(x.name)} ${c.dim(`NORAD ${x.norad} · ${x.intlId}`)}${x.status ? ` ${x.status}` : ''}`);
897
+ if (x.orbit)
898
+ out(` ${x.orbit.regime} ${x.orbit.perigeeKm}-${x.orbit.apogeeKm} km · ${x.orbit.periodMin} min · ${x.orbit.inclination}°`);
899
+ const meta = [x.owner && `owner ${x.owner}`, x.type, x.launchDate && `launched ${x.launchDate}`, x.decayed && `decayed ${x.decayed}`].filter(Boolean);
900
+ if (meta.length)
901
+ out(c.dim(` ${meta.join(' · ')}`));
902
+ }
903
+ }
904
+ printSources(r);
905
+ });
906
+ },
714
907
  async papers(o, a) {
715
908
  const topic = a.pos.slice(1).join(' ').trim();
716
909
  if (!topic)
@@ -1865,6 +2058,8 @@ export const COMMANDS = {
1865
2058
  ['on-chain', ['ZERION_API_KEY', 'ETHERSCAN_API_KEY', 'WEBACY_API_KEY', 'HELIUS_API_KEY', 'ROBINHOOD_PUBLIC_RPC_URL']],
1866
2059
  ['companies', ['ADZUNA_APP_KEY', 'COURTLISTENER_TOKEN', 'COMPANIES_HOUSE_API_KEY', 'BRANDFETCH_API_KEY']],
1867
2060
  ['web security', ['URLSCAN_API_KEY', 'SAFE_BROWSING_KEY', 'ABUSECH_AUTH_KEY']],
2061
+ ['threat intel', ['ABUSEIPDB_API_KEY', 'OTX_API_KEY', 'IPINFO_TOKEN', 'VIRUSTOTAL_API_KEY']],
2062
+ ['phone', ['NUMVERIFY_API_KEY']],
1868
2063
  ['fact checks', ['GOOGLE_API_KEY']],
1869
2064
  ['social/research', ['YOUTUBE_API_KEY', 'BLUESKY_APP_PASSWORD', 'OPENALEX_API_KEY']],
1870
2065
  ['air quality', ['OPENAQ_API_KEY']],
@@ -1986,7 +2181,7 @@ export async function main(argv = process.argv.slice(2)) {
1986
2181
  }
1987
2182
  catch (e) {
1988
2183
  if (e instanceof UsageError) {
1989
- out(`${c.red('usage')}: ${e.message}. See \`oculon help\`.`);
2184
+ out(`${c.red('usage')}: ${e.message.replace(/^usage:\s*/i, '')}. See \`oculon help\`.`);
1990
2185
  return 2;
1991
2186
  }
1992
2187
  out(`${c.red('error')}: ${e.message}`);
package/dist/core/http.js CHANGED
@@ -56,6 +56,10 @@ const HOST_GAP_MS = {
56
56
  'api.osv.dev': 100,
57
57
  'www.4byte.directory': 500,
58
58
  'api.semanticscholar.org': 1100, // 1 request per second with a key
59
+ 'www.virustotal.com': 15_500, // public API: 4 requests a minute
60
+ 'ip-api.com': 1400, // 45 requests a minute
61
+ 'api.greynoise.io': 1000,
62
+ 'www.peeringdb.com': 3100, // anonymous: 20 requests a minute
59
63
  };
60
64
  const chains = new Map();
61
65
  async function throttle(host) {
@@ -63,6 +63,26 @@ export const DAILY_BUDGET = {
63
63
  apify: 40,
64
64
  deepgram: 30, // transcriptions per day
65
65
  'shodan-internetdb': 2000,
66
+ // IP, hash, phone, breach, company and satellite checks.
67
+ abuseipdb: 900, // 1,000/day free
68
+ virustotal: 450, // 500/day public API (and 4/minute, see the host gap)
69
+ otx: 5000,
70
+ ipinfo: 1500, // 50,000/month Lite
71
+ numverify: 3, // 100/month free; the offline check still answers
72
+ greynoise: 40, // community API is rate limited for unauthenticated use
73
+ 'ip-api': 5000, // 45/minute
74
+ peeringdb: 500,
75
+ 'tor-exits': 50,
76
+ 'spamhaus-drop': 30,
77
+ 'circl-hashlookup': 3000,
78
+ malwarebazaar: 2000,
79
+ threatfox: 2000,
80
+ 'ransomware-live': 1000,
81
+ 'pwned-passwords': 20_000,
82
+ hibp: 200,
83
+ gleif: 3000,
84
+ vies: 1000,
85
+ celestrak: 200, // asks for at most one fetch of the same data per two hours
66
86
  };
67
87
  const envName = (source) => `OCULON_QUOTA_${source.toUpperCase().replace(/[^A-Z0-9]/g, '_')}`;
68
88
  export function budgetFor(source) {
package/dist/index.d.ts CHANGED
@@ -232,6 +232,26 @@ export declare class Oculon {
232
232
  country(name: string): Promise<ModuleResult<import("./modules/country.js").CountryBrief>>;
233
233
  /** Is this message a scam? Checks its links, sender domain and known scam patterns. */
234
234
  scamCheck(message: string): Promise<ModuleResult<import("./modules/scam.js").ScamCheck>>;
235
+ /** Who runs this IP (or domain), and is it known for abuse? AbuseIPDB, GreyNoise, OTX, VirusTotal, ThreatFox, Spamhaus DROP, Tor. */
236
+ ipCheck(ipOrDomain: string): Promise<ModuleResult<import("./modules/ipintel.js").IpCheck>>;
237
+ /** Is this file hash (MD5, SHA-1, SHA-256) known malware or a known good file? */
238
+ hashCheck(hash: string): Promise<ModuleResult<import("./modules/hashcheck.js").HashCheck>>;
239
+ /** Ransomware leak-site claims: newest, or by country code, sector, company or domain (ransomware.live). */
240
+ ransomware(query?: string): Promise<ModuleResult<import("./modules/ransomware.js").RansomwareResult>>;
241
+ /** Company identity: EU VAT number (VIES), LEI or name (GLEIF), with status and ultimate parent. */
242
+ companyCheck(nameLeiOrVat: string): Promise<ModuleResult<import("./modules/company.js").CompanyCheck>>;
243
+ /** Is this password in known breaches? Only 5 characters of its SHA-1 hash leave the machine. */
244
+ passwordCheck(password: string): Promise<ModuleResult<import("./modules/breach.js").PasswordCheck>>;
245
+ /** Pwned Passwords suffix counts for a 5-character SHA-1 prefix (for checks that hash on the client). */
246
+ pwnedRange(prefix: string): Promise<import("./core/types.js").Sourced<Map<string, number>>>;
247
+ /** Newest breaches in Have I Been Pwned, or the breaches of one domain or company. */
248
+ breaches(domain?: string): Promise<ModuleResult<import("./modules/breach.js").BreachList>>;
249
+ /** Phone number check: country, line type, carrier, premium-rate and callback-scam warnings. */
250
+ phoneCheck(number: string, opts?: {
251
+ country?: string;
252
+ }): Promise<ModuleResult<import("./modules/phone.js").PhoneCheck>>;
253
+ /** Satellites: launches of the last 30 days, or one object's orbit, owner and status (CelesTrak). */
254
+ satellites(query?: string): Promise<ModuleResult<import("./modules/satellites.js").SatResult>>;
235
255
  /** Airport status: METAR and TAF, FAA delays and ground stops (US), emergency squawks nearby. */
236
256
  airport(code: string): Promise<ModuleResult<import("./modules/airport.js").AirportStatus>>;
237
257
  /** Today's brief (stored once per day; refresh to rewrite). */
package/dist/index.js CHANGED
@@ -63,6 +63,13 @@ import { papers } from './modules/papers.js';
63
63
  import { countryBrief } from './modules/country.js';
64
64
  import { airportStatus } from './modules/airport.js';
65
65
  import { scamCheck } from './modules/scam.js';
66
+ import { ipCheck } from './modules/ipintel.js';
67
+ import { hashCheck } from './modules/hashcheck.js';
68
+ import { ransomware } from './modules/ransomware.js';
69
+ import { companyCheck } from './modules/company.js';
70
+ import { breaches, passwordCheck, pwnedRange } from './modules/breach.js';
71
+ import { phoneCheck } from './modules/phone.js';
72
+ import { satellites } from './modules/satellites.js';
66
73
  export class Oculon {
67
74
  ctx;
68
75
  constructor(opts = {}) {
@@ -352,6 +359,42 @@ export class Oculon {
352
359
  scamCheck(message) {
353
360
  return scamCheck(this.ctx, message);
354
361
  }
362
+ /** Who runs this IP (or domain), and is it known for abuse? AbuseIPDB, GreyNoise, OTX, VirusTotal, ThreatFox, Spamhaus DROP, Tor. */
363
+ ipCheck(ipOrDomain) {
364
+ return ipCheck(this.ctx, ipOrDomain);
365
+ }
366
+ /** Is this file hash (MD5, SHA-1, SHA-256) known malware or a known good file? */
367
+ hashCheck(hash) {
368
+ return hashCheck(this.ctx, hash);
369
+ }
370
+ /** Ransomware leak-site claims: newest, or by country code, sector, company or domain (ransomware.live). */
371
+ ransomware(query = '') {
372
+ return ransomware(this.ctx, query);
373
+ }
374
+ /** Company identity: EU VAT number (VIES), LEI or name (GLEIF), with status and ultimate parent. */
375
+ companyCheck(nameLeiOrVat) {
376
+ return companyCheck(this.ctx, nameLeiOrVat);
377
+ }
378
+ /** Is this password in known breaches? Only 5 characters of its SHA-1 hash leave the machine. */
379
+ passwordCheck(password) {
380
+ return passwordCheck(this.ctx, password);
381
+ }
382
+ /** Pwned Passwords suffix counts for a 5-character SHA-1 prefix (for checks that hash on the client). */
383
+ pwnedRange(prefix) {
384
+ return pwnedRange(this.ctx, prefix);
385
+ }
386
+ /** Newest breaches in Have I Been Pwned, or the breaches of one domain or company. */
387
+ breaches(domain = '') {
388
+ return breaches(this.ctx, domain);
389
+ }
390
+ /** Phone number check: country, line type, carrier, premium-rate and callback-scam warnings. */
391
+ phoneCheck(number, opts = {}) {
392
+ return phoneCheck(this.ctx, number, opts);
393
+ }
394
+ /** Satellites: launches of the last 30 days, or one object's orbit, owner and status (CelesTrak). */
395
+ satellites(query = '') {
396
+ return satellites(this.ctx, query);
397
+ }
355
398
  /** Airport status: METAR and TAF, FAA delays and ground stops (US), emergency squawks nearby. */
356
399
  airport(code) {
357
400
  return airportStatus(this.ctx, code);
package/dist/mcp.d.ts CHANGED
@@ -10,6 +10,13 @@ export interface Tool {
10
10
  inputSchema: Json;
11
11
  run: (o: Oculon, a: Json) => Promise<unknown> | unknown;
12
12
  }
13
+ /**
14
+ * Checks tool arguments against the tool's input schema before running it. A misspelled argument used
15
+ * to be dropped silently, so a scam check called with `text` instead of `message` ran on nothing and
16
+ * answered "no strong signs": the agent got a confident wrong answer instead of an error it can fix.
17
+ * Numeric strings are accepted for number fields and converted in place. Returns a message, or null.
18
+ */
19
+ export declare function checkArgs(inputSchema: Json, args: Json): string | null;
13
20
  export declare const TOOLS: Tool[];
14
21
  interface Request {
15
22
  jsonrpc: '2.0';
package/dist/mcp.js CHANGED
@@ -7,11 +7,50 @@ import { createInterface } from 'node:readline';
7
7
  import { Oculon, summarizeProvenance } from './index.js';
8
8
  import { ONCHAIN_TOOLS, onchainEnabled } from './core/features.js';
9
9
  import { availableKinds } from './modules/monitor.js';
10
- export const SERVER_INFO = { name: 'oculon', version: '0.1.3' };
10
+ export const SERVER_INFO = { name: 'oculon', version: '0.1.5' };
11
11
  const SUPPORTED = ['2025-06-18', '2025-03-26', '2024-11-05'];
12
12
  const str = (d) => ({ type: 'string', description: d });
13
13
  const num = (d) => ({ type: 'number', description: d });
14
14
  const schema = (props = {}, required = []) => ({ type: 'object', properties: props, required, additionalProperties: false });
15
+ /**
16
+ * Checks tool arguments against the tool's input schema before running it. A misspelled argument used
17
+ * to be dropped silently, so a scam check called with `text` instead of `message` ran on nothing and
18
+ * answered "no strong signs": the agent got a confident wrong answer instead of an error it can fix.
19
+ * Numeric strings are accepted for number fields and converted in place. Returns a message, or null.
20
+ */
21
+ export function checkArgs(inputSchema, args) {
22
+ const props = (inputSchema.properties ?? {});
23
+ const required = (inputSchema.required ?? []);
24
+ const allowed = Object.keys(props);
25
+ if (inputSchema.additionalProperties === false) {
26
+ const unknown = Object.keys(args).filter((k) => !(k in props));
27
+ if (unknown.length)
28
+ return `unknown argument${unknown.length > 1 ? 's' : ''} ${unknown.map((k) => `"${k}"`).join(', ')}; this tool takes ${allowed.length ? allowed.map((k) => `"${k}"`).join(', ') : 'no arguments'}`;
29
+ }
30
+ for (const k of required) {
31
+ const v = args[k];
32
+ if (v === undefined || v === null || (typeof v === 'string' && !v.trim()))
33
+ return `missing required argument "${k}"`;
34
+ }
35
+ for (const [k, v] of Object.entries(args)) {
36
+ const p = props[k];
37
+ if (!p || v === undefined || v === null)
38
+ continue;
39
+ if (p.type === 'string' && typeof v !== 'string')
40
+ return `argument "${k}" must be a string`;
41
+ if (p.type === 'number' || p.type === 'integer') {
42
+ const n = typeof v === 'string' && v.trim() !== '' ? Number(v) : v;
43
+ if (typeof n !== 'number' || !Number.isFinite(n))
44
+ return `argument "${k}" must be a number`;
45
+ args[k] = n;
46
+ }
47
+ if (p.type === 'boolean' && typeof v !== 'boolean')
48
+ return `argument "${k}" must be true or false`;
49
+ if (Array.isArray(p.enum) && !p.enum.includes(v))
50
+ return `argument "${k}" must be one of ${p.enum.join(', ')}`;
51
+ }
52
+ return null;
53
+ }
15
54
  /** Module results go out as result + signals + a compact provenance summary (full per-request provenance is noisy). */
16
55
  function compact(r) {
17
56
  return { module: r.module, input: r.input, generatedAt: r.generatedAt, result: r.result, signals: r.signals, provenance: summarizeProvenance(r.provenance) };
@@ -216,6 +255,54 @@ export const TOOLS = [
216
255
  inputSchema: schema({ domain: str('Domain or email address, e.g. "example.com"') }, ['domain']),
217
256
  run: async (o, a) => compact(await o.emailSecurity(String(a.domain))),
218
257
  },
258
+ {
259
+ name: 'oculon_ip_check',
260
+ description: 'Who runs this IP address, and is it known for abuse? Pass an IPv4 or IPv6 address, or a domain (its first address is checked). Returns network (ASN, owner, type), location, flags (Tor exit, proxy, hosting, internet scanner, known benign service), AbuseIPDB reports, GreyNoise scanner status, AlienVault OTX threat reports, VirusTotal engine verdicts, ThreatFox malware infrastructure, Spamhaus DROP listing and open ports, with a verdict (malicious, suspicious, no known abuse), a 0-100 risk and the reasons.',
261
+ inputSchema: schema({ ip: str('IP address or domain, e.g. "185.220.101.1"') }, ['ip']),
262
+ run: async (o, a) => compact(await o.ipCheck(String(a.ip))),
263
+ },
264
+ {
265
+ name: 'oculon_hash_check',
266
+ description: 'Is this file known malware, a known good file, or unknown? Pass an MD5, SHA-1 or SHA-256 hash. Checks CIRCL hashlookup (NIST NSRL and other known-software sets), MalwareBazaar, ThreatFox, AlienVault OTX and VirusTotal, and returns a verdict, the malware family when known, the reasons and what to do.',
267
+ inputSchema: schema({ hash: str('MD5, SHA-1 or SHA-256 in hex') }, ['hash']),
268
+ run: async (o, a) => compact(await o.hashCheck(String(a.hash))),
269
+ },
270
+ {
271
+ name: 'oculon_ransomware',
272
+ description: 'Ransomware leak-site claims collected by ransomware.live. Leave query empty for the newest claims, or pass a two-letter country code ("DE"), a sector ("Healthcare", "Manufacturing") or a company name or domain. Returns victims with group, country, sector and dates, plus counts by group, country and sector. These are claims by criminals and can be wrong.',
273
+ inputSchema: schema({ query: str('Optional: country code, sector, company or domain') }, []),
274
+ run: async (o, a) => compact(await o.ransomware(a.query ? String(a.query) : '')),
275
+ },
276
+ {
277
+ name: 'oculon_company_lookup',
278
+ description: 'Is this company or supplier real? Pass an EU VAT number (checked live in the European Commission VIES service: valid or not, registered name and address), a 20-character LEI, or a company name (Global LEI Index: legal name, registered address, status, registration number, ultimate parent). Useful before paying an invoice from a new supplier.',
279
+ inputSchema: schema({ query: str('Company name, LEI, or EU VAT number such as "NL004495445B01"') }, ['query']),
280
+ run: async (o, a) => compact(await o.companyCheck(String(a.query))),
281
+ },
282
+ {
283
+ name: 'oculon_password_check',
284
+ description: 'Has this password appeared in known data breaches (Have I Been Pwned Pwned Passwords)? Only the first 5 characters of its SHA-1 hash are sent; the match is done locally and the password is never stored. Pass the password, or "sha1:<40 hex>" if you already have the hash. Local only: this tool is not offered on the remote server.',
285
+ inputSchema: schema({ password: str('The password, or "sha1:<hash>"') }, ['password']),
286
+ run: async (o, a) => compact(await o.passwordCheck(String(a.password))),
287
+ },
288
+ {
289
+ name: 'oculon_breaches',
290
+ description: 'Data breaches from Have I Been Pwned: leave domain empty for the newest breaches, or pass a domain or company name for all of its breaches, with date, accounts affected and the kinds of data exposed.',
291
+ inputSchema: schema({ domain: str('Optional: domain or company name, e.g. "adobe.com"') }, []),
292
+ run: async (o, a) => compact(await o.breaches(a.domain ? String(a.domain) : '')),
293
+ },
294
+ {
295
+ name: 'oculon_phone_check',
296
+ description: 'Who is behind this phone number? Pass it in international format (+44 20 7946 0958), or a national number with country. Returns country, line type (mobile, landline, VoIP, premium rate), carrier and location when known, and warnings for premium-rate numbers, UK 070 personal numbers and the Caribbean "one ring" callback-scam area codes. Never looks up the owner.',
297
+ inputSchema: schema({ number: str('Phone number'), country: str('ISO country code for a national number, e.g. "US"') }, ['number']),
298
+ run: async (o, a) => compact(await o.phoneCheck(String(a.number), a.country ? { country: String(a.country) } : {})),
299
+ },
300
+ {
301
+ name: 'oculon_satellites',
302
+ description: 'Satellites from CelesTrak. Leave query empty for everything launched in the last 30 days, grouped by launch. Or pass a satellite name ("ISS", "starlink-1007") or NORAD catalog number for its orbit (perigee, apogee, period, inclination, regime), owner, launch date and status.',
303
+ inputSchema: schema({ query: str('Optional: satellite name or NORAD number') }, []),
304
+ run: async (o, a) => compact(await o.satellites(a.query ? String(a.query) : '')),
305
+ },
219
306
  {
220
307
  name: 'oculon_papers',
221
308
  description: 'Research brief on a topic: the most cited papers of recent years, the newest relevant ones, papers per year (is the field growing?), PubMed counts for medical topics, and a short overview that cites the numbered papers. Sources: OpenAlex, PubMed, Semantic Scholar.',
@@ -540,7 +627,8 @@ export const TOOLS = [
540
627
  },
541
628
  ];
542
629
  /** Tools that change the shared watchlist, fences or plugins; not offered to anonymous remote clients. */
543
- const REMOTE_HIDDEN = new Set(['oculon_watch_add', 'oculon_fence_add', 'oculon_watch_run', 'oculon_case_new', 'oculon_stamp_proofs', 'oculon_resolve_forecasts', 'oculon_auto_forecast', 'oculon_forecast']);
630
+ // Tools that change the shared watchlist, plus the password check: a password should never travel to a public server.
631
+ const REMOTE_HIDDEN = new Set(['oculon_watch_add', 'oculon_fence_add', 'oculon_watch_run', 'oculon_case_new', 'oculon_stamp_proofs', 'oculon_resolve_forecasts', 'oculon_auto_forecast', 'oculon_forecast', 'oculon_password_check']);
544
632
  /** Tools this build offers: on-chain tools are left out unless OCULON_ONCHAIN=1. */
545
633
  export function activeTools() {
546
634
  return onchainEnabled() ? TOOLS : TOOLS.filter((t) => !ONCHAIN_TOOLS.has(t.name));
@@ -600,8 +688,14 @@ export class McpServer {
600
688
  const tool = (await this.allTools()).find((t) => t.name === name);
601
689
  if (!tool)
602
690
  return fail(-32602, `unknown tool: ${name}`);
691
+ const raw = msg.params?.arguments ?? {};
692
+ if (typeof raw !== 'object' || raw === null || Array.isArray(raw))
693
+ return reply({ content: [{ type: 'text', text: 'Error: arguments must be a JSON object' }], isError: true });
694
+ const bad = checkArgs(tool.inputSchema, raw);
695
+ if (bad)
696
+ return reply({ content: [{ type: 'text', text: `Error: ${bad}` }], isError: true });
603
697
  try {
604
- const args = msg.params?.arguments ?? {};
698
+ const args = raw;
605
699
  if (this.opts.remote && name === 'oculon_monitor')
606
700
  args.dry_run = true;
607
701
  const out = await tool.run(this.o, args);
@@ -0,0 +1,53 @@
1
+ import type { Ctx } from '../core/context.js';
2
+ import type { ModuleResult, Sourced } from '../core/types.js';
3
+ export interface PasswordCheck {
4
+ pwned: boolean;
5
+ count: number;
6
+ prefix: string;
7
+ advice: string[];
8
+ }
9
+ export interface Breach {
10
+ name: string;
11
+ title: string;
12
+ domain: string | null;
13
+ breachDate: string | null;
14
+ addedDate: string | null;
15
+ accounts: number;
16
+ dataClasses: string[];
17
+ verified: boolean;
18
+ spamList: boolean;
19
+ malware: boolean;
20
+ description: string;
21
+ url: string;
22
+ }
23
+ export interface BreachList {
24
+ query: string | null;
25
+ total: number;
26
+ breaches: Breach[];
27
+ note: string;
28
+ }
29
+ export declare const sha1Hex: (s: string) => string;
30
+ /** Suffix counts for one 5-character SHA-1 prefix; padding rows (count 0) are dropped. */
31
+ export declare function pwnedRange(ctx: Ctx, prefix: string): Promise<Sourced<Map<string, number>>>;
32
+ /** Is this password in known breaches? Pass the password itself, or "sha1:<40 hex>". */
33
+ export declare function passwordCheck(ctx: Ctx, password: string): Promise<ModuleResult<PasswordCheck>>;
34
+ interface RawBreach {
35
+ Name?: string;
36
+ Title?: string;
37
+ Domain?: string;
38
+ BreachDate?: string;
39
+ AddedDate?: string;
40
+ PwnCount?: number;
41
+ DataClasses?: string[];
42
+ IsVerified?: boolean;
43
+ IsSensitive?: boolean;
44
+ IsRetired?: boolean;
45
+ IsSpamList?: boolean;
46
+ IsMalware?: boolean;
47
+ IsFabricated?: boolean;
48
+ Description?: string;
49
+ }
50
+ export declare function toBreach(x: RawBreach): Breach;
51
+ /** Newest breaches, or the breaches of one domain or company name. Sensitive, retired and fabricated breaches are left out. */
52
+ export declare function breaches(ctx: Ctx, input?: string): Promise<ModuleResult<BreachList>>;
53
+ export {};