oculon 0.1.7 → 0.2.0

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 (92) hide show
  1. package/README.md +73 -13
  2. package/dist/cli/main.js +316 -1
  3. package/dist/core/der.d.ts +2 -0
  4. package/dist/core/der.js +17 -0
  5. package/dist/core/http.d.ts +19 -1
  6. package/dist/core/http.js +24 -0
  7. package/dist/core/qr.d.ts +23 -0
  8. package/dist/core/qr.js +577 -0
  9. package/dist/core/quota.js +5 -0
  10. package/dist/core/raster.d.ts +6 -0
  11. package/dist/core/raster.js +298 -0
  12. package/dist/core/safeurl.d.ts +5 -0
  13. package/dist/core/safeurl.js +26 -0
  14. package/dist/core/verdict.js +1 -1
  15. package/dist/core/zip.d.ts +9 -0
  16. package/dist/core/zip.js +46 -0
  17. package/dist/index.d.ts +61 -0
  18. package/dist/index.js +99 -0
  19. package/dist/mcp.js +131 -5
  20. package/dist/modules/address.d.ts +6 -2
  21. package/dist/modules/address.js +32 -5
  22. package/dist/modules/apk.d.ts +37 -0
  23. package/dist/modules/apk.js +191 -0
  24. package/dist/modules/approvals.d.ts +40 -0
  25. package/dist/modules/approvals.js +155 -0
  26. package/dist/modules/archive.d.ts +21 -0
  27. package/dist/modules/archive.js +94 -0
  28. package/dist/modules/checks.js +33 -0
  29. package/dist/modules/contract.d.ts +56 -0
  30. package/dist/modules/contract.js +167 -0
  31. package/dist/modules/deployer.d.ts +42 -0
  32. package/dist/modules/deployer.js +90 -0
  33. package/dist/modules/doc.d.ts +24 -2
  34. package/dist/modules/doc.js +133 -7
  35. package/dist/modules/eml.d.ts +46 -0
  36. package/dist/modules/eml.js +175 -0
  37. package/dist/modules/hashcheck.d.ts +19 -3
  38. package/dist/modules/hashcheck.js +28 -4
  39. package/dist/modules/image.d.ts +32 -0
  40. package/dist/modules/image.js +276 -0
  41. package/dist/modules/invite.d.ts +27 -0
  42. package/dist/modules/invite.js +69 -0
  43. package/dist/modules/job.d.ts +33 -0
  44. package/dist/modules/job.js +64 -0
  45. package/dist/modules/meerkat.d.ts +1 -1
  46. package/dist/modules/meerkat.js +35 -2
  47. package/dist/modules/monitor.js +14 -0
  48. package/dist/modules/poisoning.d.ts +43 -0
  49. package/dist/modules/poisoning.js +114 -0
  50. package/dist/modules/qrcheck.d.ts +24 -0
  51. package/dist/modules/qrcheck.js +136 -0
  52. package/dist/modules/repo.d.ts +61 -0
  53. package/dist/modules/repo.js +162 -0
  54. package/dist/modules/report.d.ts +32 -0
  55. package/dist/modules/report.js +108 -0
  56. package/dist/modules/signature.d.ts +35 -0
  57. package/dist/modules/signature.js +283 -0
  58. package/dist/modules/site.d.ts +62 -0
  59. package/dist/modules/site.js +191 -0
  60. package/dist/modules/stocktoken.d.ts +48 -0
  61. package/dist/modules/stocktoken.js +99 -0
  62. package/dist/modules/trace.d.ts +37 -0
  63. package/dist/modules/trace.js +150 -0
  64. package/dist/modules/txexplain.d.ts +40 -0
  65. package/dist/modules/txexplain.js +135 -0
  66. package/dist/modules/urlcheck.js +15 -1
  67. package/dist/modules/where.d.ts +63 -0
  68. package/dist/modules/where.js +165 -0
  69. package/dist/report-pdf.js +3 -0
  70. package/dist/sources/cfurlscan.d.ts +24 -0
  71. package/dist/sources/cfurlscan.js +46 -0
  72. package/dist/sources/chainabuse.d.ts +17 -0
  73. package/dist/sources/chainabuse.js +19 -0
  74. package/dist/sources/evm.d.ts +135 -0
  75. package/dist/sources/evm.js +260 -0
  76. package/dist/sources/phishlists.d.ts +20 -0
  77. package/dist/sources/phishlists.js +90 -0
  78. package/dist/telegram.d.ts +17 -0
  79. package/dist/telegram.js +151 -4
  80. package/dist/web/docs.html +1 -1
  81. package/dist/web/index.html +147 -11
  82. package/dist/web/landing.html +1 -1
  83. package/dist/web/legal.html +3 -1
  84. package/dist/web/mcp.html +1 -1
  85. package/dist/web/openapi.js +13 -0
  86. package/dist/web/pages.js +2 -2
  87. package/dist/web/public.js +14 -1
  88. package/dist/web/server.d.ts +13 -0
  89. package/dist/web/server.js +77 -12
  90. package/dist/web/token.html +24 -4
  91. package/dist/web/token.json +12 -1
  92. package/package.json +2 -2
package/README.md CHANGED
@@ -1,14 +1,39 @@
1
- # Oculon
1
+ <p align="center">
2
+ <a href="https://oculon.live"><img src=".github/assets/banner.png" alt="Oculon: check before you trust. Every answer sourced." width="100%"></a>
3
+ </p>
4
+
5
+ <h1 align="center">Oculon</h1>
6
+
7
+ <p align="center">
8
+ <a href="https://x.com/oculonlive"><img alt="X @oculonlive" src="https://img.shields.io/badge/X-@oculonlive-000000?style=for-the-badge&logo=x&logoColor=white"></a>
9
+ <a href="https://www.npmjs.com/package/oculon"><img alt="npm" src="https://img.shields.io/npm/v/oculon?style=for-the-badge&logo=npm&label=npm&color=00b8c8"></a>
10
+ <a href="https://glama.ai/mcp/servers/oculonlive/oculon"><img alt="Glama MCP" src="https://img.shields.io/badge/Glama-MCP_server-00b8c8?style=for-the-badge"></a>
11
+ <a href="https://t.me/oculonportal"><img alt="Telegram community" src="https://img.shields.io/badge/Telegram-community-26A5E4?style=for-the-badge&logo=telegram&logoColor=white"></a>
12
+ <a href="https://fomo.family/profile/oculonlive"><img alt="fomo @oculonlive" src="https://img.shields.io/badge/fomo-@oculonlive-5865F2?style=for-the-badge"></a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://github.com/oculonlive/oculon/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/oculonlive/oculon/actions/workflows/ci.yml/badge.svg"></a>
17
+ <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-00f0ff.svg"></a>
18
+ <img alt="Node 22.13+" src="https://img.shields.io/badge/node-%E2%89%A522.13-00f0ff.svg">
19
+ <img alt="Runtime dependencies: 0" src="https://img.shields.io/badge/runtime%20dependencies-0-00f0ff.svg">
20
+ <a href="https://oculon.live/safety/0x12a3f1a05d827007f17a43a250cce44868c4a263"><img alt="Oculon safety" src="https://oculon.live/badge/0x12a3f1a05d827007f17a43a250cce44868c4a263.svg"></a>
21
+ </p>
2
22
 
3
23
  **Open-source intelligence engine for the physical and digital world.** Oculon watches more than 50 public data sources (routing tables, exploit catalogs, transponders, satellites, ship trackers, registries and prediction markets), finds what is unusual, fuses observations about the same subject from independent sources into scored signals, and labels every result with where it came from and how fresh it is. An AI agent on top answers plain-language questions with sources.
4
24
 
5
- [oculon.live](https://oculon.live) · [Documentation](https://oculon.live/docs) · [Privacy](https://oculon.live/privacy) · [Terms](https://oculon.live/terms) · [Token](#official-token)
6
-
7
- [![CI](https://github.com/oculonlive/oculon/actions/workflows/ci.yml/badge.svg)](https://github.com/oculonlive/oculon/actions/workflows/ci.yml)
8
- [![License: MIT](https://img.shields.io/badge/license-MIT-00f0ff.svg)](LICENSE)
9
- ![Node 22.13+](https://img.shields.io/badge/node-%E2%89%A522.13-00f0ff.svg)
10
- ![Runtime dependencies: 0](https://img.shields.io/badge/runtime%20dependencies-0-00f0ff.svg)
11
- [![Oculon safety](https://oculon.live/badge/0x12a3f1a05d827007f17a43a250cce44868c4a263.svg)](https://oculon.live/safety/0x12a3f1a05d827007f17a43a250cce44868c4a263)
25
+ | | |
26
+ |---|---|
27
+ | **Website** | [oculon.live](https://oculon.live) |
28
+ | **Web app** | [app.oculon.live](https://app.oculon.live) |
29
+ | **Docs** | [docs.oculon.live](https://docs.oculon.live) |
30
+ | **Remote MCP** | [mcp.oculon.live](https://mcp.oculon.live) (no key, no sign-in) |
31
+ | **For AI agents** | [oculon.live/llms.txt](https://oculon.live/llms.txt) |
32
+ | **Source status** | [oculon.live/status](https://oculon.live/status) |
33
+ | **Token** | [oculon.live/thetoken](https://oculon.live/thetoken) · [details below](#official-token) |
34
+ | **Community** | [Telegram portal](https://t.me/oculonportal) · [X](https://x.com/oculonlive) · [fomo](https://fomo.family/profile/oculonlive) |
35
+ | **Telegram bot** | [@oculon_radar_bot](https://t.me/oculon_radar_bot) |
36
+ | **Legal** | [Privacy](https://oculon.live/privacy) · [Terms](https://oculon.live/terms) |
12
37
 
13
38
  It ships as a CLI, a TypeScript SDK, an MCP server for Claude and other agents (local, or remote at `https://mcp.oculon.live` with nothing to install), a web app and a Telegram bot, all over the same result objects. It has no runtime dependencies. About 20 sources work with no key; optional free-tier keys switch on the rest (see `.env.example`).
14
39
 
@@ -23,12 +48,15 @@ npx oculon ask "why is Nvidia in the news this week?"
23
48
  - **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.
24
49
  - **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.
25
50
  - **Robinhood Chain, read block by block.** Oculon watches pools the minute they open, follows each token back to the wallet that deployed it (directly or through a launchpad) and counts how many of that wallet's launches are already dead. See [On-chain](#on-chain-robinhood-chain).
26
- - **Built for agents.** 91 MCP tools locally over stdio (98 with the on-chain tools on), and 89 remotely at `https://mcp.oculon.live`; the SDK and CLI return the same objects, and `--json` works on every command. Check results show up as verdict cards inside Claude and ChatGPT, `brief: true` gives any tool a short answer with fewer tokens, and `/llms.txt` explains every tool to an agent.
51
+ - **Built for agents.** 111 MCP tools locally over stdio (118 with the on-chain tools on), and 109 remotely at `https://mcp.oculon.live`; the SDK and CLI return the same objects, and `--json` works on every command. Check results show up as verdict cards inside Claude and ChatGPT, `brief: true` gives any tool a short answer with fewer tokens, and `/llms.txt` explains every tool to an agent.
27
52
  - **Every check is kept and can be replayed.** Each check gets an id: `/replay/<id>` lists every source it called, in order, with status and time, and `/report/<id>.pdf` is the same check as a PDF to send on. Checking the same thing again says what changed since last time.
28
53
  - **Honest about its sources.** `/status` shows which sources are up, slow or down, measured from real calls. A source that keeps failing is skipped for a few minutes and a mirror or the last cached answer is used instead, and the result says so.
54
+ - **Wallet safety (new in 0.2).** Who can take your tokens (active approvals, risky spenders flagged), what a token owner can still do (mint, blacklist, taxes, upgrades), what a signature request really allows before you sign it, lookalike addresses planted in your history, where stolen funds went, what happened in a transaction, who made a token and how many of their tokens are dead, and whether a site is a wallet drainer. Rug-pull and approval monitors watch them for you.
55
+ - **Files and repos (new in 0.2).** Is this image made by AI or edited (C2PA Content Credentials, generator traces)? Where does this QR code lead? Does this Word or Excel file hide macros or a remote template? Is this GitHub repo from a "job test" safe to run? Is this Android app a banking trojan? What is in this whole email, attachments included? Where and when was this photo taken, and what was the weather then? QR codes, images, Office files, APKs and emails are read here, with no dependencies.
56
+ - **One report per target (new in 0.2).** `oculon check example.com` or `oculon check 0x...` runs every relevant check at once and keeps it as one page and one PDF.
29
57
  - **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.
30
58
  - **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.
31
- - **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.
59
+ - **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. A Telegram community, entered through the [Oculon portal](https://t.me/oculonportal). An OpenAPI spec at `/openapi.json` for ChatGPT Actions, n8n and Zapier.
32
60
  - **Free to run.** Daily per-source budgets keep every free tier free, and the data lives in one local SQLite file.
33
61
 
34
62
  ## Contents
@@ -55,7 +83,26 @@ npx oculon ask "why is Nvidia in the news this week?"
55
83
  | Lookalike domains | `oculon lookalike <domain>` | Typos, swapped letters, homoglyphs, extra words and other endings of a brand that exist in DNS, with mail servers, plus certificates issued in the last 90 days for names containing the brand | Google DNS, crt.sh, CertSpotter |
56
84
  | Honeypot | `oculon honeypot <token> [--chain eth\|bsc\|base]` | Can this token be sold? A buy and sell simulation on its main pool plus recent holders' sells: honeypot verdict, buy and sell tax, holders who could not sell | honeypot.is |
57
85
  | Crypto address | `oculon address <address>` | Before you send funds: chain from the format (Bitcoin, EVM, Solana, Tron), US OFAC sanctions, balance, transactions and labels, contracts posing as wallets, unused addresses | mempool.space, Blockscout, Solana RPC, OFAC |
58
- | Document | `oculon doc <file.pdf\|.png\|.jpg>` · web app upload | Was this invoice, bank statement or payment screenshot edited? Reads the file itself: the programs that made and saved it (online PDF editors, image editors, word processors), creation vs modification date, how many times it was saved, the same font embedded twice, white boxes over text, annotations, digital signatures, and dangerous parts (JavaScript, launch actions, embedded files). Every IBAN in its text is checked. Screenshots and scans are read with a free AI vision model when a key is set. A clean result is not proof that a document is genuine | Offline; OpenRouter or Gemini (free) for text in images |
86
+ | Document | `oculon doc <file.pdf\|.docx\|.xlsx\|.png\|.jpg>` · web app upload · Telegram: send the file | Was this invoice, bank statement or payment screenshot edited? Reads the file itself: the programs that made and saved it (online PDF editors, image editors, word processors), creation vs modification date, how many times it was saved, the same font embedded twice, white boxes over text, annotations, digital signatures, and dangerous parts (JavaScript, launch actions, embedded files). Word, Excel and PowerPoint files: VBA and Excel 4.0 macros, remote templates (attachedTemplate injection), DDE fields, embedded objects, ActiveX, hidden and very hidden sheets, author and last editor. Every IBAN in its text is checked. Screenshots and scans are read with a free AI vision model when a key is set. A clean result is not proof that a document is genuine | Offline; OpenRouter or Gemini (free) for text in images |
87
+ | Image | `oculon photo <image>` · web app upload · Telegram: send it as a file | Was this image made by AI, edited, or taken with a camera? C2PA Content Credentials (the app that signed it, the actions it lists, the IPTC digital source type, organizations named in the signing certificates), IPTC and XMP source type and credit lines, generator settings and prompts left by Stable Diffusion, ComfyUI, NovelAI, InvokeAI and Midjourney, EXIF camera and editing software. Missing metadata proves nothing: most apps strip it | Offline |
88
+ | QR code | `oculon qr <image>` · web app upload · Telegram: send the photo | Reads the QR code in a photo or screenshot (PNG or baseline JPEG, versions 1 to 15) with a built-in decoder, then checks where it leads: links through the URL check (plus link shorteners), crypto payment codes and addresses through the address check, SEPA payment codes through the IBAN check; Wi-Fi, SMS, phone and contact codes are explained | Offline decoder; URL, address and IBAN check sources |
89
+ | GitHub repo | `oculon repo <owner/name>` | Is this repo safe to clone and run? Built for fake job tests and "run our bot" scams: npm install hooks, setup.py commands and VS Code tasks that run on folder open, code that downloads and runs code, wallet extension, browser password and keychain theft, Discord and Telegram webhooks, obfuscation and code hidden past the edge of the screen, committed program files, owner account age | GitHub API |
90
+ | Full report | `oculon check <domain\|0x address>` · `--pdf report.pdf` | Every relevant check on one page. Domain: link check, email protection, internet exposure, lookalikes, company. Wallet: address, approvals, poisoning, fund trace. Token: contract risk, sell simulation, address. Each part keeps its own verdict and sources | The sources of each part |
91
+ | Site check | `oculon site <link>` | Is this page a wallet drainer or phishing? Wallet connection code next to permit, Permit2, setApprovalForAll and unlimited approve requests, a receiver address written into the script, token-balance APIs used to rank what to take, known drainer kits; seed phrase, login and card forms on the wrong domain or sending elsewhere, Telegram bot tokens and Discord webhooks in the code, lookalikes of well known apps. Generic wallet-library strings alone never make a drainer verdict, and official domains of known apps are recognized. Scripts are read, never run | The page itself, plus the URL check sources |
92
+ | Transaction | `oculon tx <hash>` | What happened in a transaction, in plain words: the function called, every token and NFT transfer, approvals given or removed, and the fee. Flags tokens taken from a wallet in a transaction it did not send (an earlier approval or permit being used); spam tokens faking transfers are recognized by their missing market. Finds the chain by itself | Public RPC, OpenChain / 4byte, DexScreener, Sourcify |
93
+ | Token creator | `oculon creator <token>` | Who created the token, the other contracts that wallet deployed, which of those tokens are dead today (no pool or under $1,000), the wallet's age and who first funded it (an exchange, a mixer) | Etherscan, DexScreener, public RPC, eth-labels |
94
+ | Email file | `oculon eml <message.eml>` · Telegram: send the file | A whole email: the header check (SPF, DKIM, DMARC, spoofing), the message and every link through the scam check, and each attachment through the matching check (document, QR, image, malware hash). Risky attachment types (programs, scripts, HTML, disk images) are flagged | The sources of each check |
95
+ | Android app | `oculon apk <app.apk>` · Telegram: send the file | Is this APK safe to install? Its binary manifest is read here: package, version, every permission, and the ones banking trojans use (reading SMS codes, accessibility services, drawing over other apps, notification access, device admin, installing other apps); the signing certificate (Android debug keys flagged); the SHA-256 in malware databases | Offline; hash check sources |
96
+ | Job offer | `oculon job "<message>"` | Is this job offer a scam? Fees before you start, paid "tasks" you top up, crypto pay, pay that does not fit the work, contact only through WhatsApp or Telegram, no interview, early requests for ID or bank details, check-cashing, coding test tasks that ask you to run a repo (checked with the repo check), and every link and the sender | Scam check sources, GitHub |
97
+ | Photo location | `oculon where <photo.jpg>` · Telegram: send the file with /where | Where and when a photo was taken: GPS and capture time from EXIF, the place name, and the weather and daylight at that place and hour, so claims about a photo can be checked. Flags capture and GPS times that disagree | Nominatim (OpenStreetMap), Open-Meteo |
98
+ | Archive | `oculon archive <link>` | Keep evidence of a page: saved in the Wayback Machine now, with the page status, final address and SHA-256 recorded in the check (and its PDF). Falls back to the newest snapshot when the archive is busy | Wayback Machine |
99
+ | Invite link | `oculon invite <t.me or discord.gg link>` | What is behind a Telegram or Discord invite: name, members and online, verified badge, Telegram's scam label, when a Discord server was created, and the fake support or fake project pattern | t.me preview pages, Discord invite API |
100
+ | Robinhood Stock Tokens | `oculon stocktoken [TSLA\|0x...]` | The official list of Robinhood Stock Tokens: for a ticker, the official contract on Robinhood Chain, ISIN, which sessions trade, the live bid and ask per token (with the corporate-action multiplier), daily range and volume, supply on chain, and upcoming dividends and splits. For an address, whether it is official; tokens that copy a ticker or call themselves Robinhood tokens without being on the list are flagged as fake | Robinhood Stock Token API (api.robinhood.com/rhj), Robinhood Chain RPC |
101
+ | Approvals | `oculon approvals <wallet> [--chain eth\|arbitrum\|polygon]` | Who can take tokens out of this wallet right now: every ERC-20 and NFT approval it signed, re-read on chain so revoked and used-up ones drop out. Known routers and marketplaces are named; plain wallets, unverified contracts and unknown contracts with unlimited access are flagged. Fake approval events from spam tokens are filtered out. Links to revoke.cash | Etherscan (free key), public RPC, Sourcify, OFAC |
102
+ | Contract risk | `oculon contract <token> [--chain eth\|base\|bsc\|arbitrum\|polygon]` | What the owner can still do to holders: mint, blacklist, pause trading, change taxes, limit wallets, change balances, withdraw, upgrade the code, self-destruct. Read from verified source, or from the selectors in the bytecode when the source is not published. Current owner (renounced or not), proxy admin and implementation, holder concentration, locked liquidity, main pool and its age | Sourcify, Etherscan, public RPC, GoPlus, DexScreener, 4byte / OpenChain |
103
+ | Signature | `oculon signature <request>` · web app paste | What a wallet signature request really allows, before you sign: ERC-2612 and DAI permits, Uniswap Permit2 allowances and transfers, Seaport orders that give assets away for nothing, approve and setApprovalForAll calldata, multicall bundles, unknown functions named through the signature databases, raw eth_sign hashes and messages asking for a seed phrase | Offline decoding; public RPC and Sourcify for the spender |
104
+ | Address poisoning | `oculon poisoning <wallet>` | Lookalike addresses planted in a wallet's history (same first and last characters as an address the wallet really paid), zero-value transfers it never signed, fake USDT and USDC, and whether funds were already sent to a lookalike | Etherscan |
105
+ | Fund trace | `oculon trace <address> [--hops 3]` | Where money went from an address: the largest outgoing flows priced in USD (spam tokens without a real pool are ignored), hop by hop, until an exchange (where funds can be frozen), a mixer, a bridge, a contract or a sanctioned address, with the transaction hashes for a report | Etherscan, DexScreener, eth-labels, OFAC |
59
106
  | 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) |
60
107
  | 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) |
61
108
  | 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) |
@@ -203,7 +250,7 @@ Or with any MCP client that launches stdio servers:
203
250
  { "mcpServers": { "oculon": { "command": "npx", "args": ["-y", "oculon", "mcp"] } } }
204
251
  ```
205
252
 
206
- Every module is a tool (91, plus one per installed plugin tool; `tools/list` returns them with schemas). A few: `oculon_ask`, `oculon_radar`, `oculon_dossier`, `oculon_case_new`, `oculon_calendar`, `oculon_connect`, `oculon_markets_crosscheck`, `oculon_sanctions`, `oculon_health`, `oculon_narratives`, `oculon_ships`, `oculon_military_air`, `oculon_satellite_image` (returns the image), `oculon_forecast`, `oculon_verify_proof`, `oculon_watch_add`, `oculon_brief`, `oculon_signals`, `oculon_entity`.
253
+ Every module is a tool (111, plus one per installed plugin tool; `tools/list` returns them with schemas). A few: `oculon_ask`, `oculon_radar`, `oculon_dossier`, `oculon_case_new`, `oculon_calendar`, `oculon_connect`, `oculon_markets_crosscheck`, `oculon_sanctions`, `oculon_health`, `oculon_narratives`, `oculon_ships`, `oculon_military_air`, `oculon_satellite_image` (returns the image), `oculon_forecast`, `oculon_verify_proof`, `oculon_watch_add`, `oculon_brief`, `oculon_signals`, `oculon_entity`.
207
254
 
208
255
  - **Brief mode.** Every tool takes `brief: true` and then answers with the verdict, risk, top reasons, which sources answered and the check id, instead of the full result.
209
256
  - **Verdict cards.** Check tools (scam, link, document, IBAN, email headers, phone, IP, token and more) return `structuredContent` and point to a UI resource, so chat apps that render MCP UI (MCP Apps hosts and ChatGPT apps) show a card with the verdict, risk, reasons, sources and links to the replay log and PDF report.
@@ -312,7 +359,13 @@ All optional, read from the environment or a `.env` file in the working director
312
359
  | `OCULON_HOME` | Data folder (default `~/.oculon`) |
313
360
  | `OCULON_DB` | Database path override |
314
361
  | `OCULON_CONTACT` | Contact email, sent only to SEC EDGAR (which requires one); no other API receives it |
315
- | `GITHUB_TOKEN` | Raises GitHub limits from 60 to 5000 requests/hour |
362
+ | `GITHUB_TOKEN` | Raises GitHub limits from 60 to 5000 requests/hour (a classic token with only `public_repo` is enough) |
363
+ | `ETHERSCAN_API_KEY`, `BLOCKSCOUT_API_KEY` | Wallet history for approvals, poisoning, fund trace and the token creator: Etherscan covers Ethereum, Arbitrum and Polygon, Blockscout covers Optimism and Robinhood Chain (both free) |
364
+ | `ALCHEMY_API_KEY` | Transfers on Base and BNB Chain too (poisoning, fund trace), USD prices, NFT spam flags, and a fallback RPC (free; enable the networks in the Alchemy app) |
365
+ | `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` | With the URL Scanner permission, the site check also opens pages in a real browser (free) |
366
+ | `ARCHIVE_ACCESS_KEY`, `ARCHIVE_SECRET_KEY` | archive.org S3 keys: the archive check uses the logged-in Save Page Now, which is rarely busy (free) |
367
+ | `HYBRID_ANALYSIS_KEY` | Sandbox reports in the hash, APK and email attachment checks (free) |
368
+ | `CHAINABUSE_API_KEY` | Victims' scam reports in the address and site checks (free, 750 calls a month; answers are kept for a week) |
316
369
  | LLM, search, news, markets, company, security, social and air keys | See `.env.example`; each is optional. `oculon doctor` shows which groups are on |
317
370
 
318
371
  API keys never appear in output: provenance URLs, errors and agent tool results are scrubbed of every key in the environment.
@@ -361,6 +414,13 @@ The repository includes a `Dockerfile` (on Railway, set the service health check
361
414
  - The watchlist and geofences need two runs before they can report a change; the first run records a baseline.
362
415
  - First to Know is deliberately strict: Wikipedia spikes usually follow the news, so most such signals score "media first". Lead time is most likely on footprint, chain and flight signals.
363
416
  - The document check looks for traces that editing leaves. A careful forger, or a fake made from scratch, leaves none, so "no signs of editing" is not proof that a document is genuine. Text in screenshots is read by an AI vision model, which can misread characters.
417
+ - Approvals need event logs: Etherscan's free plan covers Ethereum, Arbitrum and Polygon, Blockscout's covers Optimism and Robinhood Chain. Base and BNB Chain logs are paid everywhere, so approvals there say so instead of guessing. Poisoning and the fund trace also run on Base and BNB Chain through Alchemy's transfers API, which lists value transactions only; transfers out of a wallet are confirmed by reading who sent each transaction. Contract risk, transaction explain and signature decoding work on all seven chains.
418
+ - Contract risk lists what the code allows, not what the owner will do. Unverified contracts are read from the function selectors in their bytecode, which can miss powers hidden behind generic functions.
419
+ - The fund trace follows the largest flows only (three per hop by default) and stops at contracts, so funds that go through a swap or a bridge need another trace on the other side.
420
+ - The QR reader handles versions 1 to 15 (up to about 400 characters), PNG and baseline JPEG; progressive JPEGs and interlaced PNGs are refused with a message. The image check does not verify C2PA signatures cryptographically; it reports what the manifest and its certificates say. Telegram re-compresses photos and strips their metadata, so send images as files for the AI and edit check.
421
+ - The site check fetches the page once with a browser User-Agent and reads up to 12 scripts; drainers that only load their code after a wallet connects, or that hide it from non-browser visitors, can look clean. The token creator record only sees contracts the wallet deployed itself, not tokens made through a launchpad factory. The job check matches patterns in English.
422
+ - The Wayback Machine often answers "busy" to Save Page Now; the archive check then gives the newest earlier snapshot and says so. Telegram previews show members only for public groups and channels.
423
+ - The repo check reads up to 40 files (install hooks and configs first) and matches known malicious patterns; a clean result is not a guarantee. GitHub no longer lists who starred a repo (the API returns an empty list even with a token), so bought stars are not checked.
364
424
  - Lynx only reports pairs an LLM confirms as the same question; exact matches across venues are rare, so an empty result is common and honest.
365
425
  - AIS coverage depends on community receivers and is absent in some regions; empty windows say so.
366
426
  - Sanctions screening uses exact matches on the OFAC SDN list only; it is not legal advice and does not cover other jurisdictions.
package/dist/cli/main.js CHANGED
@@ -9,6 +9,7 @@ import { oculonHome } from '../core/paths.js';
9
9
  import { fmtTime } from '../modules/listen.js';
10
10
  import { Oculon, summarizeProvenance } from '../index.js';
11
11
  import { ONCHAIN_COMMANDS, ONCHAIN_PAUSED_MESSAGE, onchainEnabled } from '../core/features.js';
12
+ import { toneOf } from '../core/verdict.js';
12
13
  const HERE = dirname(fileURLToPath(import.meta.url));
13
14
  const VERSION = (() => {
14
15
  for (const p of [join(HERE, '..', '..', 'package.json'), join(HERE, '..', 'package.json')]) {
@@ -198,7 +199,30 @@ ${c.bold('Everyday checks')}
198
199
  oculon iban <IBAN> [--country NL] is this IBAN valid, and is the account in the supplier's country?
199
200
  oculon headers < headers.txt raw email headers: SPF, DKIM, DMARC, path, origin, spoofing signs
200
201
  oculon address <crypto address> chain, OFAC sanctions, balance and activity, no keys needed
201
- oculon doc <file.pdf|.png|.jpg> was this invoice, statement or screenshot edited? checks its IBANs too
202
+ oculon doc <file.pdf|.docx|.xlsx|.png|.jpg> was this invoice or statement edited? macros, IBANs, editors
203
+ oculon photo <image> made by AI, edited, or a camera photo? C2PA credentials, generator traces
204
+ oculon qr <image> read a QR code and check where it leads (link, crypto, bank, Wi-Fi)
205
+ oculon repo <owner/name> is this GitHub repo safe to run? install hooks, stealers, fake stars
206
+ oculon check <domain|0x address> full report: every check on one page (--pdf report.pdf)
207
+
208
+ ${c.bold('Wallet safety')}
209
+ oculon approvals <wallet> who can take your tokens: active approvals, risky spenders flagged
210
+ oculon contract <token> what the owner can still do: mint, blacklist, taxes, upgrades, liquidity
211
+ oculon signature <request|file> what a signature request really allows (permits, Permit2, Seaport, calldata)
212
+ oculon poisoning <wallet> lookalike addresses and fake tokens planted in your history
213
+ oculon trace <address> [--hops 3] follow the money to exchanges, mixers and bridges
214
+ oculon site <link> wallet drainer and phishing check of a page
215
+ oculon tx <hash> what happened in a transaction, in plain words
216
+ oculon creator <token> who made this token and how many of their tokens are dead
217
+ oculon stocktoken [TSLA|0x..] Robinhood Stock Tokens: official contract, live price, dividends, fakes
218
+
219
+ ${c.bold('More checks')}
220
+ oculon eml <message.eml> a whole email: headers, message, links and attachments
221
+ oculon apk <app.apk> is this Android app safe to install? permissions, signer, malware
222
+ oculon job "<message>" is this job offer a scam?
223
+ oculon where <photo.jpg> where and when a photo was taken, and the weather then
224
+ oculon archive <link> save a page as evidence (Wayback Machine, hash)
225
+ oculon invite <t.me|discord.gg link> what is behind a Telegram or Discord invite
202
226
 
203
227
  ${c.bold('Threat intel')}
204
228
  oculon ip <IP|domain> abuse reports, scanners, threat reports, Tor, Spamhaus DROP, open ports
@@ -284,6 +308,34 @@ function readHidden(prompt) {
284
308
  }
285
309
  const json = (a) => a.flags.json === true;
286
310
  const emit = (a, data, human) => (json(a) ? out(JSON.stringify(data, null, 2)) : human());
311
+ const chainOpt = (a) => (typeof a.flags.chain === 'string' ? { chain: a.flags.chain } : {});
312
+ /**
313
+ * Runs a check that is recorded (seen before, replay log, PDF), prints the verdict, the module's own lines,
314
+ * the reasons and advice. --pdf <file> also writes the PDF report.
315
+ */
316
+ async function checked(o, a, kind, target, run, lines, label) {
317
+ const chain = typeof a.flags.chain === 'string' ? `@${a.flags.chain.toLowerCase()}` : '';
318
+ const { value: r, check } = await o.recordCheck(kind, `${target}${chain}`, run, { label: label ?? `${target}${chain ? ` (${chain.slice(1)})` : ''}` });
319
+ if (typeof a.flags.pdf === 'string') {
320
+ const { writeFileSync } = await import('node:fs');
321
+ writeFileSync(a.flags.pdf, o.checkPdf(check.id));
322
+ }
323
+ emit(a, { ...r, check }, () => {
324
+ const d = r.result;
325
+ const tone = toneOf(d.verdict, d.risk);
326
+ const col = tone === 'bad' ? c.red : tone === 'warn' ? c.yellow : tone === 'ok' ? c.green : c.cyan;
327
+ out(`${c.bold(label ?? r.input)} ${col(d.verdict.toUpperCase())} ${c.dim(`risk ${d.risk}/100`)}`);
328
+ lines(d);
329
+ for (const x of d.reasons)
330
+ out(c.yellow(` ! ${x}`));
331
+ for (const x of d.advice)
332
+ out(` → ${x}`);
333
+ if (check.seenBefore)
334
+ out(c.cyan(` seen before ${check.seenBefore.at.slice(0, 16).replace('T', ' ')} UTC${check.seenBefore.changes.length ? `: ${check.seenBefore.changes.join('; ')}` : ', nothing changed'}`));
335
+ out(c.dim(` check ${check.id} · oculon replay ${check.id} --pdf report.pdf${typeof a.flags.pdf === 'string' ? ` · wrote ${a.flags.pdf}` : ''}`));
336
+ printSources(r);
337
+ });
338
+ }
287
339
  export const COMMANDS = {
288
340
  async radar(o, a) {
289
341
  const r = await o.radar();
@@ -1028,6 +1080,269 @@ export const COMMANDS = {
1028
1080
  printSources(r);
1029
1081
  });
1030
1082
  },
1083
+ async approvals(o, a) {
1084
+ const q = String(a.pos[1] ?? '').trim();
1085
+ if (!q)
1086
+ throw new UsageError('usage: oculon approvals <wallet address> [--chain eth|arbitrum|polygon]');
1087
+ await checked(o, a, 'approvals', q, () => o.approvalsCheck(q, chainOpt(a)), (d) => {
1088
+ out(c.dim(` ${d.active} active approval${d.active === 1 ? '' : 's'}, ${d.unlimited} unlimited · ${d.chain}`));
1089
+ for (const x of d.approvals.slice(0, 25)) {
1090
+ const tone = x.risk === 'high' ? c.red : x.risk === 'medium' ? c.yellow : c.dim;
1091
+ out(tone(` ${x.risk.padEnd(6)} ${(x.symbol ?? x.token.slice(0, 10)).padEnd(10)} -> ${x.spenderName ?? x.spender} (${x.spenderType}) ${x.amount}`));
1092
+ }
1093
+ out(c.dim(` revoke: ${d.revokeUrl}`));
1094
+ });
1095
+ },
1096
+ async contract(o, a) {
1097
+ const q = String(a.pos[1] ?? '').trim();
1098
+ if (!q)
1099
+ throw new UsageError('usage: oculon contract <token address> [--chain eth|base|bsc|arbitrum|polygon]');
1100
+ await checked(o, a, 'contract', q, () => o.contractRisk(q, chainOpt(a)), (d) => {
1101
+ out(c.dim(` ${d.name ?? d.contractName ?? ''} ${d.symbol ? `(${d.symbol})` : ''} · ${d.chain} · ${d.verified ? `verified on ${d.verifiedBy}` : 'NOT verified'}`));
1102
+ out(c.dim(` owner ${d.owner ?? 'none found'}${d.ownerRenounced ? ' (renounced)' : ''}${d.proxy ? ` · proxy -> ${d.proxy.implementation ?? '?'}` : ''}`));
1103
+ if (d.holders)
1104
+ out(c.dim(` holders ${d.holders.count ?? '?'} · top 10 hold ${d.holders.top10Percent ?? '?'}%`));
1105
+ if (d.liquidity)
1106
+ out(c.dim(` liquidity $${Math.round(d.liquidity.usd ?? 0).toLocaleString('en-US')} ${d.liquidity.pair ?? ''} ${d.liquidity.dex ?? ''}${d.liquidity.lockedPercent !== null ? ` · ${d.liquidity.lockedPercent}% LP locked or burned` : ''}`));
1107
+ });
1108
+ },
1109
+ async signature(o, a) {
1110
+ let raw = a.pos.slice(1).join(' ').trim();
1111
+ if (raw && existsSync(raw))
1112
+ raw = readFileSync(raw, 'utf8');
1113
+ if (!raw && !process.stdin.isTTY)
1114
+ raw = readFileSync(0, 'utf8');
1115
+ if (!raw)
1116
+ throw new UsageError('usage: oculon signature <typed data JSON | 0x calldata | file> [--to <contract>] [--chain eth] (or pipe it in)');
1117
+ await checked(o, a, 'signature', raw, () => o.signatureCheck(raw, { ...chainOpt(a), ...(typeof a.flags.to === 'string' ? { to: a.flags.to } : {}) }), (d) => {
1118
+ out(c.dim(` ${d.type} · ${d.kind}${d.chain ? ` · ${d.chain}` : ''}`));
1119
+ for (const x of d.allows)
1120
+ out(` allows: ${x}`);
1121
+ for (const p of d.parties)
1122
+ out(c.dim(` ${p.role}: ${p.address} ${p.name ?? p.type ?? ''}`));
1123
+ }, `signature request: ${raw.slice(0, 60)}`);
1124
+ },
1125
+ async poisoning(o, a) {
1126
+ const q = String(a.pos[1] ?? '').trim();
1127
+ if (!q)
1128
+ throw new UsageError('usage: oculon poisoning <wallet address> [--chain eth|arbitrum|polygon]');
1129
+ await checked(o, a, 'poisoning', q, () => o.poisoningCheck(q, chainOpt(a)), (d) => {
1130
+ out(c.dim(` ${d.checkedTransfers} token transfers read · ${d.realCounterparties} addresses this wallet really paid · ${d.zeroValue} zero-value transfers it never signed`));
1131
+ for (const l of d.lookalikes)
1132
+ out(c.red(` ${l.fake} posing as ${l.real} (${l.how.join(', ')}, ${l.seen}x)`));
1133
+ for (const f of d.fakeTokens)
1134
+ out(c.yellow(` fake ${f.symbol}: ${f.contract} (${f.transfers} transfers)`));
1135
+ });
1136
+ },
1137
+ async trace(o, a) {
1138
+ const q = String(a.pos[1] ?? '').trim();
1139
+ if (!q)
1140
+ throw new UsageError('usage: oculon trace <address> [--chain eth|arbitrum|polygon] [--hops 3]');
1141
+ await checked(o, a, 'trace', q, () => o.traceFunds(q, { ...chainOpt(a), ...(a.flags.hops ? { hops: Number(a.flags.hops) } : {}) }), (d) => {
1142
+ for (const n of d.nodes.slice(1)) {
1143
+ const tone = n.kind === 'exchange' ? c.cyan : n.kind === 'mixer' || n.kind === 'sanctioned' || n.kind === 'scam' ? c.red : c.dim;
1144
+ out(tone(` ${' '.repeat(n.hop - 1)}hop ${n.hop} ${n.address} ${n.label ?? n.kind} ${n.amount ?? ''}${n.stop ? ` [${n.stop}]` : ''}`));
1145
+ if (n.firstTx)
1146
+ out(c.dim(` ${' '.repeat(n.hop - 1)} tx ${n.firstTx}`));
1147
+ }
1148
+ });
1149
+ },
1150
+ async photo(o, a) {
1151
+ const file = a.pos.slice(1).join(' ').trim();
1152
+ if (!file)
1153
+ throw new UsageError('usage: oculon photo <photo.jpg|image.png|image.webp>');
1154
+ if (!existsSync(file))
1155
+ throw new UsageError(`no such file: ${file}`);
1156
+ const bytes = readFileSync(file);
1157
+ const { createHash } = await import('node:crypto');
1158
+ const name = file.split(/[\\/]/).pop();
1159
+ await checked(o, a, 'image', createHash('sha256').update(bytes).digest('hex'), () => o.imageCheck(bytes, name), (d) => {
1160
+ if (d.c2pa)
1161
+ out(c.dim(` Content Credentials: ${d.c2pa.generator ?? 'present'}${d.c2pa.sourceType ? ` · ${d.c2pa.sourceType}` : ''}${d.c2pa.signers.length ? ` · signed by ${d.c2pa.signers.slice(0, 3).join(', ')}` : ''}`));
1162
+ if (d.generator)
1163
+ out(c.dim(` generator: ${d.generator.tool}${d.generator.prompt ? ` · prompt: "${d.generator.prompt.slice(0, 160)}"` : ''}`));
1164
+ if (d.camera || d.software)
1165
+ out(c.dim(` ${d.camera ? `camera ${d.camera}` : ''}${d.camera && d.software ? ' · ' : ''}${d.software ? `software ${d.software}` : ''}`));
1166
+ for (const n of d.notes)
1167
+ out(c.dim(` ${n}`));
1168
+ }, name);
1169
+ },
1170
+ async qr(o, a) {
1171
+ const file = a.pos.slice(1).join(' ').trim();
1172
+ if (!file)
1173
+ throw new UsageError('usage: oculon qr <photo.jpg|screenshot.png>');
1174
+ if (!existsSync(file))
1175
+ throw new UsageError(`no such file: ${file}`);
1176
+ const bytes = readFileSync(file);
1177
+ const { createHash } = await import('node:crypto');
1178
+ const name = file.split(/[\\/]/).pop();
1179
+ await checked(o, a, 'qr', createHash('sha256').update(bytes).digest('hex'), () => o.qrCheck(bytes, name), (d) => {
1180
+ if (d.content)
1181
+ out(` content: ${d.content.slice(0, 300)}`);
1182
+ for (const [k, v] of Object.entries(d.target))
1183
+ if (k !== 'url' && k !== 'text')
1184
+ out(c.dim(` ${k}: ${v}`));
1185
+ }, name);
1186
+ },
1187
+ async repo(o, a) {
1188
+ const q = String(a.pos[1] ?? '').trim();
1189
+ if (!q)
1190
+ throw new UsageError('usage: oculon repo <owner/name | github.com link>');
1191
+ await checked(o, a, 'repo', q, () => o.repoCheck(q), (d) => {
1192
+ out(c.dim(` ${d.url} · ${d.stats.stars} stars · created ${d.stats.createdAt.slice(0, 10)} · ${d.stats.scanned} of ${d.stats.files} files read${d.account ? ` · owner ${d.account.login}, account ${d.account.ageDays ?? '?'} days old` : ''}`));
1193
+ for (const f of d.findings.slice(0, 20))
1194
+ out((f.severity === 'high' ? c.red : f.severity === 'medium' ? c.yellow : c.dim)(` ${f.severity.padEnd(6)} ${f.file}${f.line ? `:${f.line}` : ''} ${f.what}`));
1195
+ });
1196
+ },
1197
+ async check(o, a) {
1198
+ const q = String(a.pos[1] ?? '').trim();
1199
+ if (!q)
1200
+ throw new UsageError('usage: oculon check <domain | 0x address> [--chain eth] [--pdf report.pdf] full report: every check on one page');
1201
+ const wallet = /^0x[0-9a-fA-F]{40}$/.test(q);
1202
+ await checked(o, a, wallet ? 'walletreport' : 'domainreport', q, () => (wallet ? o.walletReport(q, chainOpt(a)) : o.domainReport(q)), (d) => {
1203
+ for (const p of d.parts) {
1204
+ const tone = p.tone === 'bad' ? c.red : p.tone === 'warn' ? c.yellow : p.tone === 'ok' ? c.green : c.dim;
1205
+ out(tone(` ${p.part.padEnd(20)} ${p.error ? `not checked: ${p.error}` : `${p.verdict ?? 'done'}${p.risk !== null ? ` (risk ${p.risk})` : ''}`}`));
1206
+ for (const x of p.points.slice(0, 2))
1207
+ out(c.dim(` ${' '.repeat(20)} ${x}`));
1208
+ }
1209
+ });
1210
+ },
1211
+ async site(o, a) {
1212
+ const q = String(a.pos[1] ?? '').trim();
1213
+ if (!q)
1214
+ throw new UsageError('usage: oculon site <link> wallet drainer and phishing check of a page');
1215
+ await checked(o, a, 'site', q, () => o.siteCheck(q), (d) => {
1216
+ out(c.dim(` ${d.finalUrl}${d.title ? ` · "${d.title.slice(0, 80)}"` : ''} · ${d.scripts.read} scripts read${d.reputation?.ageDays != null ? ` · domain ${d.reputation.ageDays} days old` : ''}`));
1217
+ if (d.browser)
1218
+ out(c.dim(` browser scan (Cloudflare): ${d.browser.malicious ? 'malicious' : 'no verdict'}${d.browser.categories.length ? ` · ${d.browser.categories.join(', ')}` : ''} · ${d.browser.domains} domains contacted · ${d.browser.report}`));
1219
+ if (d.reports?.count)
1220
+ out(c.dim(` Chainabuse: ${d.reports.count} reports · ${d.reports.url}`));
1221
+ for (const f of d.forms.filter((x) => x.password || x.seed || x.card))
1222
+ out(c.dim(` form -> ${f.action || '(same page)'}${f.external ? ' (another domain)' : ''}${f.seed ? ' · seed phrase' : ''}${f.password ? ' · password' : ''}${f.card ? ' · card' : ''}`));
1223
+ });
1224
+ },
1225
+ async tx(o, a) {
1226
+ const q = String(a.pos[1] ?? '').trim();
1227
+ if (!q)
1228
+ throw new UsageError('usage: oculon tx <transaction hash> [--chain eth|base|arbitrum|bsc|polygon]');
1229
+ await checked(o, a, 'tx', q, () => o.explainTx(q, chainOpt(a)), (d) => {
1230
+ for (const x of d.summary)
1231
+ out(` ${x}`);
1232
+ out(c.dim(` ${d.explorer}`));
1233
+ });
1234
+ },
1235
+ async creator(o, a) {
1236
+ const q = String(a.pos[1] ?? '').trim();
1237
+ if (!q)
1238
+ throw new UsageError('usage: oculon creator <token address> [--chain eth|arbitrum|polygon]');
1239
+ await checked(o, a, 'creator', q, () => o.creatorCheck(q, chainOpt(a)), (d) => {
1240
+ out(c.dim(` creator ${d.deployer ?? 'not found'}${d.createdAt ? ` · created ${d.createdAt.slice(0, 10)}` : ''}${d.fundedBy ? ` · first funded by ${d.fundedBy.label ?? d.fundedBy.address}` : ''}`));
1241
+ for (const x of d.deployments.filter((y) => y.isToken).slice(0, 20))
1242
+ out((x.dead ? c.red : c.green)(` ${(x.symbol ?? '?').padEnd(12)} ${x.address} ${x.createdAt.slice(0, 10)} ${x.liquidityUsd === null ? 'no pool' : '$' + Math.round(x.liquidityUsd).toLocaleString('en-US')}${x.dead ? ' dead' : ''}`));
1243
+ for (const n of d.notes)
1244
+ out(c.dim(` ${n}`));
1245
+ });
1246
+ },
1247
+ async eml(o, a) {
1248
+ const file = a.pos.slice(1).join(' ').trim();
1249
+ if (!file)
1250
+ throw new UsageError('usage: oculon eml <message.eml> a whole email: headers, message, links and attachments');
1251
+ if (!existsSync(file))
1252
+ throw new UsageError(`no such file: ${file}`);
1253
+ const bytes = readFileSync(file);
1254
+ const { createHash } = await import('node:crypto');
1255
+ const name = file.split(/[\\/]/).pop();
1256
+ await checked(o, a, 'eml', createHash('sha256').update(bytes).digest('hex'), () => o.emlCheck(bytes, name), (d) => {
1257
+ out(c.dim(` ${d.from ?? '?'} · "${d.subject ?? ''}" · ${d.date ?? ''}`));
1258
+ if (d.headers)
1259
+ out(` headers ${d.headers.verdict ?? '?'}`);
1260
+ if (d.body)
1261
+ out(` message ${d.body.verdict ?? '?'} · ${d.body.links} links`);
1262
+ for (const x of d.attachments)
1263
+ out((x.tone === 'bad' ? c.red : x.tone === 'warn' ? c.yellow : c.dim)(` attachment ${x.name} (${x.check}): ${x.verdict ?? 'checked'}${x.points[0] ? ' · ' + x.points[0] : ''}`));
1264
+ }, name);
1265
+ },
1266
+ async apk(o, a) {
1267
+ const file = a.pos.slice(1).join(' ').trim();
1268
+ if (!file)
1269
+ throw new UsageError('usage: oculon apk <app.apk> is this Android app safe to install?');
1270
+ if (!existsSync(file))
1271
+ throw new UsageError(`no such file: ${file}`);
1272
+ const bytes = readFileSync(file);
1273
+ const { createHash } = await import('node:crypto');
1274
+ const name = file.split(/[\\/]/).pop();
1275
+ await checked(o, a, 'apk', createHash('sha256').update(bytes).digest('hex'), () => o.apkCheck(bytes, name), (d) => {
1276
+ out(c.dim(` ${d.package ?? '?'} ${d.version ?? ''} · SDK ${d.minSdk ?? '?'}-${d.targetSdk ?? '?'} · ${d.permissions.length} permissions · signed by ${d.signer.join(', ') || 'unknown'}`));
1277
+ for (const r of d.risky)
1278
+ out(c.yellow(` ${r.permission}: ${r.why}`));
1279
+ }, name);
1280
+ },
1281
+ async job(o, a) {
1282
+ let raw = a.pos.slice(1).join(' ').trim();
1283
+ if (raw && existsSync(raw))
1284
+ raw = readFileSync(raw, 'utf8');
1285
+ if (!raw && !process.stdin.isTTY)
1286
+ raw = readFileSync(0, 'utf8');
1287
+ if (!raw)
1288
+ throw new UsageError('usage: oculon job "<the job message>" (or a file, or pipe it in)');
1289
+ await checked(o, a, 'job', raw, () => o.jobCheck(raw), (d) => {
1290
+ for (const p of d.patterns)
1291
+ out(c.dim(` ${p.name}: "${p.evidence}"`));
1292
+ if (d.repo)
1293
+ out(c.dim(` repo ${d.repo.repo}: ${d.repo.verdict}`));
1294
+ }, `job offer: ${raw.slice(0, 60)}`);
1295
+ },
1296
+ async where(o, a) {
1297
+ const file = a.pos.slice(1).join(' ').trim();
1298
+ if (!file)
1299
+ throw new UsageError('usage: oculon where <photo.jpg> where and when a photo was taken, and the weather then');
1300
+ if (!existsSync(file))
1301
+ throw new UsageError(`no such file: ${file}`);
1302
+ const bytes = readFileSync(file);
1303
+ const { createHash } = await import('node:crypto');
1304
+ const name = file.split(/[\\/]/).pop();
1305
+ await checked(o, a, 'where', createHash('sha256').update(bytes).digest('hex'), () => o.whereCheck(bytes, name), (d) => {
1306
+ if (d.gps)
1307
+ out(` ${d.gps.lat}, ${d.gps.lon} ${d.gps.map}`);
1308
+ if (d.taken)
1309
+ out(c.dim(` taken ${d.taken.local ?? '?'} local${d.taken.gpsUtc ? ` · GPS time ${d.taken.gpsUtc}` : ''}${d.camera ? ` · ${d.camera}` : ''}`));
1310
+ for (const n of d.notes)
1311
+ out(c.dim(` ${n}`));
1312
+ }, name);
1313
+ },
1314
+ async archive(o, a) {
1315
+ const q = String(a.pos[1] ?? '').trim();
1316
+ if (!q)
1317
+ throw new UsageError('usage: oculon archive <link> save a page as evidence (Wayback Machine, hash)');
1318
+ await checked(o, a, 'archive', q, () => o.archivePage(q), (d) => {
1319
+ if (d.snapshot)
1320
+ out(` snapshot ${d.snapshot}`);
1321
+ if (d.page)
1322
+ out(c.dim(` sha256 ${d.page.sha256} · HTTP ${d.page.status} · ${d.page.finalUrl}`));
1323
+ });
1324
+ },
1325
+ async invite(o, a) {
1326
+ const q = String(a.pos[1] ?? '').trim();
1327
+ if (!q)
1328
+ throw new UsageError('usage: oculon invite <t.me/... or discord.gg/... link>');
1329
+ await checked(o, a, 'invite', q, () => o.inviteCheck(q), (d) => {
1330
+ out(c.dim(` ${d.platform} ${d.kind ?? ''} "${d.name ?? '?'}" · ${d.members ?? '?'} members${d.online != null ? `, ${d.online} online` : ''}${d.verified ? ' · verified' : ''}${d.createdAt ? ` · created ${d.createdAt.slice(0, 10)}` : ''}`));
1331
+ });
1332
+ },
1333
+ async stocktoken(o, a) {
1334
+ const q = a.pos.slice(1).join(' ').trim();
1335
+ await checked(o, a, 'stocktoken', q || 'overview', () => o.stockToken(q), (d) => {
1336
+ if (d.symbol && d.contract)
1337
+ out(c.dim(` ${d.name ?? d.symbol} · ISIN ${d.isin ?? '?'} · ${d.contract} (${d.chain ?? '?'}) · ${d.status ?? ''}`));
1338
+ if (d.price)
1339
+ out(` bid $${d.price.tokenBid?.toFixed(2) ?? '?'} / ask $${d.price.tokenAsk?.toFixed(2) ?? '?'} · day $${d.price.dailyLow ?? '?'}-$${d.price.dailyHigh ?? '?'}${d.price.halted ? c.red(' · HALTED') : ''}`);
1340
+ if (Object.keys(d.sessions).length)
1341
+ out(c.dim(` sessions: ${Object.entries(d.sessions).map(([k, v]) => `${k} ${v}`).join(' · ')}${d.supply !== null ? ` · supply ${d.supply.toLocaleString('en-US')} tokens` : ''}`));
1342
+ for (const x of d.corporateActions.slice(0, 8))
1343
+ out(c.dim(` ${x.date ?? '?'} ${x.symbol.padEnd(6)} ${x.type}${x.detail ? ` (${x.detail})` : ''} · ${x.status}`));
1344
+ }, q ? `stock token ${q}` : 'Robinhood Stock Tokens');
1345
+ },
1031
1346
  async honeypot(o, a) {
1032
1347
  const q = String(a.pos[1] ?? '').trim();
1033
1348
  if (!q)
@@ -0,0 +1,2 @@
1
+ /** Organization and common names found in DER certificates (OIDs 2.5.4.10 and 2.5.4.3), without parsing ASN.1 fully. */
2
+ export declare function certNames(buf: Buffer, skip?: RegExp): string[];
@@ -0,0 +1,17 @@
1
+ /** Organization and common names found in DER certificates (OIDs 2.5.4.10 and 2.5.4.3), without parsing ASN.1 fully. */
2
+ export function certNames(buf, skip = /timestamp|time ?stamping|\broot\b|intermediate|trusted g4|assured id|^ca$/i) {
3
+ const out = new Set();
4
+ for (const oid of [Buffer.from([0x06, 0x03, 0x55, 0x04, 0x0a]), Buffer.from([0x06, 0x03, 0x55, 0x04, 0x03])]) {
5
+ let at = buf.indexOf(oid);
6
+ while (at >= 0 && out.size < 12) {
7
+ const tag = buf[at + 5], len = buf[at + 6];
8
+ if ([0x0c, 0x13, 0x14, 0x16].includes(tag) && len > 1 && len < 80) {
9
+ const s = buf.toString('utf8', at + 7, at + 7 + len).trim();
10
+ if (/^[\x20-\x7e]+$/.test(s) && !skip.test(s))
11
+ out.add(s);
12
+ }
13
+ at = buf.indexOf(oid, at + 1);
14
+ }
15
+ }
16
+ return [...out];
17
+ }
@@ -1,5 +1,5 @@
1
1
  import type { Store } from './store.js';
2
- import type { Sourced } from './types.js';
2
+ import type { Provenance, Sourced } from './types.js';
3
3
  export declare function userAgent(url?: string): string;
4
4
  export interface GetOptions {
5
5
  source: string;
@@ -42,6 +42,24 @@ export declare class Http {
42
42
  retries?: number;
43
43
  }): Promise<Sourced<Buffer>>;
44
44
  private getBytesRaw;
45
+ /**
46
+ * Uncached GET of a web page that keeps what a page check needs: the final URL after redirects, the status,
47
+ * the response headers and the body (capped at `maxBytes`). Not retried: a page that fails is reported as is.
48
+ */
49
+ getPage(url: string, o: {
50
+ source: string;
51
+ headers?: Record<string, string>;
52
+ timeoutMs?: number;
53
+ maxBytes?: number;
54
+ }): Promise<{
55
+ data: {
56
+ status: number;
57
+ finalUrl: string;
58
+ headers: Record<string, string>;
59
+ body: Buffer;
60
+ } | null;
61
+ prov: Provenance;
62
+ }>;
45
63
  /** Record a finished call: the running check's replay log, and (for live calls) the /status stats. */
46
64
  private note;
47
65
  /**
package/dist/core/http.js CHANGED
@@ -198,6 +198,30 @@ export class Http {
198
198
  }
199
199
  return { data: null, prov: prov(o.source, url, 'ERROR', Date.now(), lastErr) };
200
200
  }
201
+ /**
202
+ * Uncached GET of a web page that keeps what a page check needs: the final URL after redirects, the status,
203
+ * the response headers and the body (capped at `maxBytes`). Not retried: a page that fails is reported as is.
204
+ */
205
+ async getPage(url, o) {
206
+ const doFetch = this.cfg.fetch ?? fetch;
207
+ const t0 = Date.now();
208
+ try {
209
+ if (this.cfg.throttle !== false)
210
+ await throttle(new URL(url).host);
211
+ const res = await doFetch(url, { headers: { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0 Safari/537.36', accept: 'text/html,application/xhtml+xml,*/*', ...o.headers }, redirect: 'follow', signal: AbortSignal.timeout(o.timeoutMs ?? 20_000) });
212
+ const buf = Buffer.from(await res.arrayBuffer());
213
+ const headers = {};
214
+ res.headers.forEach((v, k) => { headers[k] = v; });
215
+ const data = { status: res.status, finalUrl: res.url || url, headers, body: buf.subarray(0, o.maxBytes ?? 3_000_000) };
216
+ const st = res.ok ? 'LIVE' : res.status === 404 ? 'UNAVAILABLE' : 'ERROR';
217
+ this.note(o.source, url, st, Date.now() - t0, res.ok ? undefined : `HTTP ${res.status}`);
218
+ return { data, prov: prov(o.source, url, st, Date.now(), res.ok ? undefined : `HTTP ${res.status}`) };
219
+ }
220
+ catch (e) {
221
+ this.note(o.source, url, 'ERROR', Date.now() - t0, errMsg(e));
222
+ return { data: null, prov: prov(o.source, url, 'ERROR', Date.now(), errMsg(e)) };
223
+ }
224
+ }
201
225
  /** Record a finished call: the running check's replay log, and (for live calls) the /status stats. */
202
226
  note(source, url, status, ms, note, via, live = true) {
203
227
  let host = '';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * QR code reader without dependencies: finds the three finder patterns in a grayscale image, locates the
3
+ * alignment pattern, samples the module grid through a perspective transform, reads format information,
4
+ * removes the mask, de-interleaves the blocks, corrects errors with Reed-Solomon and decodes numeric,
5
+ * alphanumeric and byte segments (UTF-8). Supports versions 1 to 15 (up to about 400 characters), which covers
6
+ * links, payment and wallet codes, Wi-Fi codes and contact cards in practice.
7
+ */
8
+ import type { Gray } from './raster.js';
9
+ /** Corrects a block in place (data then EC codewords). Returns false when there are too many errors. */
10
+ export declare function rsCorrect(msg: number[], nsym: number): boolean;
11
+ type Ec = [number, [number, number][]];
12
+ /** Per version: EC codewords per block and (block count, data codewords) groups, for L, M, Q, H. */
13
+ export declare const EC: Record<number, [Ec, Ec, Ec, Ec]>;
14
+ export declare const ALIGN: Record<number, number[]>;
15
+ /** Modules that hold function patterns (not data) for a version. */
16
+ export declare function functionMask(version: number): Uint8Array;
17
+ /** Decodes a sampled module grid (1 = dark), row-major. */
18
+ export declare function decodeGrid(grid: Uint8Array, n: number): string | null;
19
+ /** Dark/light per pixel: local mean thresholding over an integral image. */
20
+ export declare function binarize(img: Gray, invert?: boolean): Uint8Array;
21
+ /** Finds and decodes QR codes in an image. Returns the decoded texts (usually one). */
22
+ export declare function readQr(img: Gray): string[];
23
+ export {};