oculon 0.1.6 → 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.
- package/README.md +93 -17
- package/dist/cli/main.js +397 -0
- package/dist/core/calls.d.ts +63 -0
- package/dist/core/calls.js +120 -0
- package/dist/core/der.d.ts +2 -0
- package/dist/core/der.js +17 -0
- package/dist/core/http.d.ts +30 -1
- package/dist/core/http.js +133 -29
- package/dist/core/pdf.d.ts +51 -0
- package/dist/core/pdf.js +211 -0
- package/dist/core/qr.d.ts +23 -0
- package/dist/core/qr.js +577 -0
- package/dist/core/quota.js +5 -0
- package/dist/core/raster.d.ts +6 -0
- package/dist/core/raster.js +298 -0
- package/dist/core/safeurl.d.ts +5 -0
- package/dist/core/safeurl.js +26 -0
- package/dist/core/verdict.d.ts +30 -0
- package/dist/core/verdict.js +164 -0
- package/dist/core/zip.d.ts +9 -0
- package/dist/core/zip.js +46 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.js +128 -0
- package/dist/mcp.d.ts +1 -0
- package/dist/mcp.js +256 -6
- package/dist/modules/address.d.ts +6 -2
- package/dist/modules/address.js +32 -5
- package/dist/modules/apk.d.ts +37 -0
- package/dist/modules/apk.js +191 -0
- package/dist/modules/approvals.d.ts +40 -0
- package/dist/modules/approvals.js +155 -0
- package/dist/modules/archive.d.ts +21 -0
- package/dist/modules/archive.js +94 -0
- package/dist/modules/checks.d.ts +59 -0
- package/dist/modules/checks.js +167 -0
- package/dist/modules/contract.d.ts +56 -0
- package/dist/modules/contract.js +167 -0
- package/dist/modules/deployer.d.ts +42 -0
- package/dist/modules/deployer.js +90 -0
- package/dist/modules/doc.d.ts +83 -0
- package/dist/modules/doc.js +841 -0
- package/dist/modules/eml.d.ts +46 -0
- package/dist/modules/eml.js +175 -0
- package/dist/modules/hashcheck.d.ts +19 -3
- package/dist/modules/hashcheck.js +28 -4
- package/dist/modules/image.d.ts +32 -0
- package/dist/modules/image.js +276 -0
- package/dist/modules/invite.d.ts +27 -0
- package/dist/modules/invite.js +69 -0
- package/dist/modules/job.d.ts +33 -0
- package/dist/modules/job.js +64 -0
- package/dist/modules/meerkat.d.ts +1 -1
- package/dist/modules/meerkat.js +35 -2
- package/dist/modules/monitor.js +14 -0
- package/dist/modules/poisoning.d.ts +43 -0
- package/dist/modules/poisoning.js +114 -0
- package/dist/modules/qrcheck.d.ts +24 -0
- package/dist/modules/qrcheck.js +136 -0
- package/dist/modules/repo.d.ts +61 -0
- package/dist/modules/repo.js +162 -0
- package/dist/modules/report.d.ts +32 -0
- package/dist/modules/report.js +108 -0
- package/dist/modules/signature.d.ts +35 -0
- package/dist/modules/signature.js +283 -0
- package/dist/modules/site.d.ts +62 -0
- package/dist/modules/site.js +191 -0
- package/dist/modules/stocktoken.d.ts +48 -0
- package/dist/modules/stocktoken.js +99 -0
- package/dist/modules/trace.d.ts +37 -0
- package/dist/modules/trace.js +150 -0
- package/dist/modules/txexplain.d.ts +40 -0
- package/dist/modules/txexplain.js +135 -0
- package/dist/modules/urlcheck.js +15 -1
- package/dist/modules/utility.d.ts +27 -1
- package/dist/modules/utility.js +108 -11
- package/dist/modules/where.d.ts +63 -0
- package/dist/modules/where.js +165 -0
- package/dist/report-pdf.d.ts +7 -0
- package/dist/report-pdf.js +84 -0
- package/dist/sources/cfurlscan.d.ts +24 -0
- package/dist/sources/cfurlscan.js +46 -0
- package/dist/sources/chainabuse.d.ts +17 -0
- package/dist/sources/chainabuse.js +19 -0
- package/dist/sources/evm.d.ts +135 -0
- package/dist/sources/evm.js +260 -0
- package/dist/sources/phishlists.d.ts +20 -0
- package/dist/sources/phishlists.js +90 -0
- package/dist/telegram.d.ts +17 -0
- package/dist/telegram.js +151 -4
- package/dist/web/card.d.ts +28 -0
- package/dist/web/card.js +75 -0
- package/dist/web/docs.html +1 -1
- package/dist/web/index.html +213 -5
- package/dist/web/landing.html +1 -1
- package/dist/web/legal.html +3 -1
- package/dist/web/mcp.html +1 -1
- package/dist/web/openapi.js +15 -0
- package/dist/web/pages.d.ts +24 -0
- package/dist/web/pages.js +139 -0
- package/dist/web/public.js +16 -1
- package/dist/web/server.d.ts +13 -0
- package/dist/web/server.js +152 -13
- package/dist/web/token.html +25 -4
- package/dist/web/token.json +12 -1
- package/dist/web/utility.html +40 -14
- package/package.json +2 -2
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
2
|
+
const when = (iso) => `${iso.slice(0, 16).replace('T', ' ')} UTC`;
|
|
3
|
+
function shell(title, desc, body, canonical) {
|
|
4
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
5
|
+
<title>${esc(title)}</title><meta name="description" content="${esc(desc)}"><meta name="robots" content="noindex">
|
|
6
|
+
<link rel="icon" type="image/png" href="/favicon.ico"><meta name="theme-color" content="#000000">
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
8
|
+
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet">
|
|
9
|
+
<style>
|
|
10
|
+
:root{--line:#1f2a2d;--soft:#cfd8da;--mut:#8fa3a7;--y:#00f0ff;--bad:#ff5d6c;--warn:#f5a524;--ok:#3ddc97;--sans:'Space Grotesk',system-ui,sans-serif;--mono:'Space Mono',ui-monospace,Consolas,monospace}
|
|
11
|
+
*{box-sizing:border-box}html,body{overflow-x:clip}
|
|
12
|
+
body{margin:0;background:#000;color:#fff;font-family:var(--sans);-webkit-font-smoothing:antialiased}
|
|
13
|
+
a{color:var(--y)}
|
|
14
|
+
header{border-bottom:1px solid #222}header .in{display:flex;justify-content:space-between;align-items:center;padding:18px clamp(16px,3vw,40px);gap:16px}
|
|
15
|
+
.logo{font-size:16px;font-weight:600;letter-spacing:.4em;text-decoration:none;color:#fff}.logo img{width:20px;height:20px;vertical-align:-4px;margin-right:12px}
|
|
16
|
+
header nav{display:flex;gap:20px;font-size:14px}header nav a{color:var(--soft);text-decoration:none}
|
|
17
|
+
main{max-width:980px;margin:0 auto;padding:48px clamp(16px,4vw,40px) 90px}
|
|
18
|
+
.lbl{font:12px var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--mut)}
|
|
19
|
+
h1{margin:10px 0 8px;font-size:clamp(28px,4.5vw,44px);font-weight:400;letter-spacing:-.03em;line-height:1.1;overflow-wrap:anywhere}
|
|
20
|
+
h2{margin:40px 0 12px;font-size:20px;font-weight:500;padding-top:18px;border-top:1px solid #222}
|
|
21
|
+
p,li{color:var(--soft);font-size:16px;line-height:1.65}
|
|
22
|
+
.pill{display:inline-block;font:700 13px var(--mono);letter-spacing:.06em;text-transform:uppercase;padding:6px 10px;color:#000;background:var(--mut)}
|
|
23
|
+
.pill.bad{background:var(--bad);color:#fff}.pill.warn{background:var(--warn)}.pill.ok{background:var(--ok)}
|
|
24
|
+
.kv{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:22px}
|
|
25
|
+
.kv div{border:1px solid var(--line);padding:12px 14px;background:rgba(4,10,12,.9)}.kv b{display:block;font:400 11px var(--mono);letter-spacing:.14em;color:var(--mut);text-transform:uppercase}.kv span{display:block;margin-top:6px;font:700 15px var(--mono);overflow-wrap:anywhere}
|
|
26
|
+
.tw{overflow-x:auto;border:1px solid var(--line)}
|
|
27
|
+
table{width:100%;border-collapse:collapse;font:13px var(--mono)}
|
|
28
|
+
th{text-align:left;font-weight:400;color:var(--mut);letter-spacing:.1em;text-transform:uppercase;font-size:11px;padding:10px 10px;border-bottom:1px solid var(--line);white-space:nowrap}
|
|
29
|
+
td{padding:9px 10px;border-bottom:1px solid #111a1c;color:#e8eef0;vertical-align:top}
|
|
30
|
+
td.n{text-align:right;white-space:nowrap}
|
|
31
|
+
.bar{display:inline-block;height:8px;background:var(--y);vertical-align:middle;min-width:2px}
|
|
32
|
+
.s-LIVE{color:var(--ok)}.s-CACHED{color:var(--y)}.s-ERROR{color:var(--bad)}.s-UNAVAILABLE{color:var(--warn)}
|
|
33
|
+
.st{font:700 12px var(--mono);text-transform:uppercase;letter-spacing:.08em}.st.up{color:var(--ok)}.st.slow{color:var(--warn)}.st.degraded{color:var(--warn)}.st.down{color:var(--bad)}
|
|
34
|
+
.btn{display:inline-block;font:700 13px var(--mono);letter-spacing:.08em;background:var(--y);color:#000;padding:11px 15px;text-decoration:none;margin:6px 10px 0 0}
|
|
35
|
+
.btn.o{background:none;color:var(--y);border:1px solid rgba(0,240,255,.5)}
|
|
36
|
+
.note{font-size:13px;color:var(--mut)}
|
|
37
|
+
pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#050b0d;border:1px solid var(--line);padding:14px;font:12px/1.6 var(--mono);color:#dfe7e9;max-height:520px;overflow:auto}
|
|
38
|
+
footer{border-top:1px solid #222}footer .in{max-width:980px;margin:0 auto;padding:22px clamp(16px,4vw,40px);font:12px var(--mono);color:#5e5e5e;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}footer a{color:var(--mut)}
|
|
39
|
+
@media (max-width:720px){.kv{grid-template-columns:repeat(2,minmax(0,1fr))}}
|
|
40
|
+
</style><link rel="canonical" href="${esc(canonical)}"></head><body>
|
|
41
|
+
<header><div class="in"><a class="logo" href="/"><img src="/assets/logo.svg" alt="">OCULON</a><nav><a href="/app">App</a><a href="/docs">Docs</a><a href="/status">Status</a></nav></div></header>
|
|
42
|
+
<main>${body}</main>
|
|
43
|
+
<footer><div class="in"><span>Oculon contributors · MIT</span><span><a href="/">Home</a> · <a href="/docs">Docs</a> · <a href="/status">Status</a> · <a href="/thetoken">Token</a></span></div></footer>
|
|
44
|
+
</body></html>`;
|
|
45
|
+
}
|
|
46
|
+
/** /replay/<id>: what a check said and every source it called, in order. */
|
|
47
|
+
export function replayPage(c, history, base) {
|
|
48
|
+
const v = c.verdict;
|
|
49
|
+
const t0 = c.calls.length ? Date.parse(c.calls[0].at) - c.calls[0].ms : Date.parse(c.createdAt);
|
|
50
|
+
const maxMs = Math.max(1, ...c.calls.map((k) => k.ms));
|
|
51
|
+
const rows = c.calls.map((k, i) => `<tr><td class="n">${i + 1}</td><td class="n">+${Math.max(0, ((Date.parse(k.at) - k.ms - t0) / 1000)).toFixed(2)}s</td><td>${esc(k.source)}</td><td>${esc(k.host)}${k.via ? ' <span class="note">(mirror)</span>' : ''}</td><td class="s-${esc(k.status)}">${esc(k.status)}${k.note ? `<div class="note">${esc(k.note)}</div>` : ''}</td><td class="n">${k.ms} ms <span class="bar" style="width:${Math.round((k.ms / maxMs) * 80)}px"></span></td></tr>`).join('');
|
|
52
|
+
const seen = c.seenBefore ? `<h2>Seen before</h2><p>Last checked ${esc(when(c.seenBefore.at))}, verdict then: <b>${esc(c.seenBefore.verdict ?? 'none')}</b>. ${c.seenBefore.changes.length ? '' : 'Nothing changed since then.'}</p>${c.seenBefore.changes.length ? `<ul>${c.seenBefore.changes.map((x) => `<li>${esc(x)}</li>`).join('')}</ul>` : ''}` : '';
|
|
53
|
+
const hist = history.length > 1 ? `<h2>History of this target</h2><div class="tw"><table><tr><th>When</th><th>Verdict</th><th>Risk</th><th></th></tr>${history.map((h) => `<tr><td>${esc(when(h.at))}</td><td>${esc(h.verdict ?? '-')}</td><td class="n">${h.risk ?? '-'}</td><td>${h.id === c.id ? '<span class="note">this check</span>' : `<a href="/replay/${esc(h.id)}">replay</a>`}</td></tr>`).join('')}</table></div>` : '';
|
|
54
|
+
const result = c.result ? `<h2>Full result</h2><pre>${esc(JSON.stringify(c.result, null, 2).slice(0, 60_000))}</pre>` : '';
|
|
55
|
+
const body = `<div class="lbl">Replay log · ${esc(c.kind)}</div><h1>${esc(c.label)}</h1>
|
|
56
|
+
<p><span class="pill ${esc(v.tone)}">${esc(v.verdict ?? 'result')}</span>${v.risk !== null ? ` <span class="note">risk ${v.risk}/100</span>` : ''}</p>
|
|
57
|
+
<div class="kv"><div><b>Checked</b><span>${esc(when(c.createdAt))}</span></div><div><b>Took</b><span>${(c.durationMs / 1000).toFixed(1)} s</span></div><div><b>Source calls</b><span>${c.calls.length}</span></div><div><b>Live / cached / failed</b><span>${v.sources.live} / ${v.sources.cached} / ${v.sources.failed}</span></div></div>
|
|
58
|
+
<p><a class="btn" href="/report/${esc(c.id)}.pdf">Download PDF report</a><a class="btn o" href="/app#investigate">Run a new check</a></p>
|
|
59
|
+
${v.points.length ? `<h2>Why</h2><ul>${v.points.map((p) => `<li>${esc(p)}</li>`).join('')}</ul>` : ''}${seen}
|
|
60
|
+
<h2>Every source called</h2><p class="note">In the order they answered. Cached answers took 0 ms. A failed source is not a finding; a mirror answered when the main host was down.</p>
|
|
61
|
+
${rows ? `<div class="tw"><table><tr><th>#</th><th>Start</th><th>Source</th><th>Host</th><th>Status</th><th>Time</th></tr>${rows}</table></div>` : '<p>No network calls: this check ran on the input alone.</p>'}
|
|
62
|
+
${hist}${result}<p class="note" style="margin-top:28px">Kept for 90 days. Anyone with this link can see it.</p>`;
|
|
63
|
+
return shell(`Replay: ${c.label}`, `Oculon replay log of a ${c.kind} check`, body, `${base}/replay/${c.id}`);
|
|
64
|
+
}
|
|
65
|
+
/** /status: which sources answered in the last day. */
|
|
66
|
+
export function statusPage(list, base, hours) {
|
|
67
|
+
const n = (s) => list.filter((x) => x.state === s).length;
|
|
68
|
+
const rows = list.map((s) => `<tr><td>${esc(s.source)}<div class="note">${esc(s.hosts.join(', '))}</div></td><td><span class="st ${s.state}">${s.state}</span>${s.skippedUntil ? `<div class="note">skipped until ${esc(s.skippedUntil.slice(11, 16))} UTC, fallback in use</div>` : ''}</td><td class="n">${s.okPct}%</td><td class="n">${s.calls}</td><td class="n">${s.medianMs === null ? '-' : `${s.medianMs} ms`}</td><td>${s.lastError ? `${esc(s.lastError.at.slice(11, 16))} <span class="note">${esc(s.lastError.note)}</span>` : '<span class="note">none</span>'}</td></tr>`).join('');
|
|
69
|
+
const body = `<div class="lbl">Source status · last ${hours} hours</div><h1>Which sources are up, slow or down.</h1>
|
|
70
|
+
<p>Every check calls public sources. This page shows how each one answered Oculon in the last ${hours} hours, measured from real calls. When a source keeps failing it is skipped for a few minutes and a mirror or the last cached answer is used instead, and the result says so.</p>
|
|
71
|
+
<div class="kv"><div><b>Up</b><span style="color:var(--ok)">${n('up')}</span></div><div><b>Slow</b><span style="color:var(--warn)">${n('slow')}</span></div><div><b>Degraded</b><span style="color:var(--warn)">${n('degraded')}</span></div><div><b>Down</b><span style="color:var(--bad)">${n('down')}</span></div></div>
|
|
72
|
+
<h2>Sources</h2>${rows ? `<div class="tw"><table><tr><th>Source</th><th>State</th><th>Worked</th><th>Calls</th><th>Median</th><th>Last error</th></tr>${rows}</table></div>` : '<p>No live calls yet in this window.</p>'}
|
|
73
|
+
<p class="note" style="margin-top:20px">Up: the last calls worked. Degraded: some of the last five failed. Down: they all failed, or the source is being skipped. Slow: median above 5 seconds. JSON: <a href="/api/status">/api/status</a>.</p>`;
|
|
74
|
+
return shell('Oculon status', 'Which Oculon sources are up, slow or down', body, `${base}/status`);
|
|
75
|
+
}
|
|
76
|
+
const FIRST_SENTENCE = /^.*?(?<!\be\.g|\bi\.e|\bvs)[.?!](?=\s+[A-Z("]|$)/;
|
|
77
|
+
const WS = /\s+/g;
|
|
78
|
+
/** First sentence, not fooled by "e.g." or "i.e.". */
|
|
79
|
+
function firstSentence(d) {
|
|
80
|
+
const m = FIRST_SENTENCE.exec(d.replace(WS, ' '));
|
|
81
|
+
return (m ? m[0] : d).trim();
|
|
82
|
+
}
|
|
83
|
+
/** /llms.txt: a short guide for AI agents (llmstxt.org format). */
|
|
84
|
+
export function llmsTxt(tools, base, mcpUrl) {
|
|
85
|
+
const groups = [
|
|
86
|
+
['Everyday checks', /scam|url_check|doc_check|image_check|qr_check|repo_check|domain_report|site_check|email_file|apk_check|job_check|photo_location|archive|invite_check|iban|email_headers|lookalike|phone|password|breaches|company|email_security|recall|travel|fact_check/],
|
|
87
|
+
['Threat intel', /ip_check|hash|ransomware|vulns|cve|package|exposure|bgp|blackout|cloud/],
|
|
88
|
+
['Crypto', /token|wallet|honeypot|approvals|tx_explain|token_creator|stock_token|contract_risk|signature|poisoning|trace_funds|address_check|robinhood|defi|protocol|sanctions/],
|
|
89
|
+
];
|
|
90
|
+
const line = (t) => `- [${t.name}](${base}/llms-full.txt#${t.name}): ${firstSentence(t.description)}`;
|
|
91
|
+
const used = new Set();
|
|
92
|
+
const sections = groups.map(([g, re]) => {
|
|
93
|
+
const ts = tools.filter((t) => re.test(t.name) && !used.has(t.name));
|
|
94
|
+
ts.forEach((t) => used.add(t.name));
|
|
95
|
+
return `## ${g}\n\n${ts.map(line).join('\n')}`;
|
|
96
|
+
});
|
|
97
|
+
const rest = tools.filter((t) => !used.has(t.name));
|
|
98
|
+
return `# Oculon
|
|
99
|
+
|
|
100
|
+
> Free, open-source OSINT engine (MIT). Checks things before you trust them: messages, links, documents, IBANs, phone numbers, email headers, IPs, file hashes, tokens and wallets. Every answer lists the sources it used and whether each was live, cached or unavailable.
|
|
101
|
+
|
|
102
|
+
Use it from an AI agent over MCP: add ${mcpUrl} as a remote MCP server (no key, no sign-in), or run \`npx oculon mcp\` locally. ${tools.length} tools.
|
|
103
|
+
|
|
104
|
+
Rules for agents:
|
|
105
|
+
- Report data as given. A source marked ERROR or UNAVAILABLE is not a finding.
|
|
106
|
+
- Check tools return a verdict, a risk score, reasons, and a check id. Pass \`brief: true\` to any tool for a short answer with fewer tokens.
|
|
107
|
+
- A check id opens a replay log (${base}/replay/<id>) with every source call, and a PDF report (${base}/report/<id>.pdf).
|
|
108
|
+
- Source health: ${base}/status (JSON at ${base}/api/status).
|
|
109
|
+
|
|
110
|
+
## Docs
|
|
111
|
+
|
|
112
|
+
- [Full tool reference](${base}/llms-full.txt): every tool with its arguments
|
|
113
|
+
- [Documentation](${base.replace('//app.', '//docs.')}): install, CLI, SDK, MCP, web
|
|
114
|
+
- [OpenAPI](${base}/openapi.json): the HTTP API
|
|
115
|
+
- [Source code](https://github.com/oculonlive/oculon)
|
|
116
|
+
|
|
117
|
+
${sections.join('\n\n')}
|
|
118
|
+
|
|
119
|
+
## Optional
|
|
120
|
+
|
|
121
|
+
${rest.map(line).join('\n')}
|
|
122
|
+
`;
|
|
123
|
+
}
|
|
124
|
+
/** /llms-full.txt: every tool with its full description and arguments. */
|
|
125
|
+
export function llmsFull(tools, base, mcpUrl) {
|
|
126
|
+
const args = (s) => {
|
|
127
|
+
const props = (s.properties ?? {});
|
|
128
|
+
const req = new Set((s.required ?? []));
|
|
129
|
+
const rows = Object.entries(props).map(([k, p]) => ` - \`${k}\` (${p.type ?? 'any'}${req.has(k) ? ', required' : ''})${p.description ? `: ${p.description}` : ''}${p.enum ? ` One of: ${p.enum.join(', ')}.` : ''}`);
|
|
130
|
+
return rows.length ? rows.join('\n') : ' - no arguments';
|
|
131
|
+
};
|
|
132
|
+
return `# Oculon: full tool reference
|
|
133
|
+
|
|
134
|
+
MCP endpoint: ${mcpUrl} (remote, no key) or \`npx oculon mcp\` (local, stdio).
|
|
135
|
+
Every tool also takes \`brief\` (boolean): a short answer for agents (verdict, risk, top reasons, sources, check id).
|
|
136
|
+
Check tools return \`check.id\`: replay log at ${base}/replay/<id>, PDF report at ${base}/report/<id>.pdf.
|
|
137
|
+
|
|
138
|
+
${tools.map((t) => `## ${t.name}\n\n${t.description}\n\nArguments:\n${args(t.inputSchema)}\n`).join('\n')}`;
|
|
139
|
+
}
|
package/dist/web/public.js
CHANGED
|
@@ -10,6 +10,8 @@ import { createHash, timingSafeEqual } from 'node:crypto';
|
|
|
10
10
|
/** Read-only endpoints the public pages call. Everything else needs the admin cookie. */
|
|
11
11
|
export const PUBLIC_API = new Set([
|
|
12
12
|
'/api/meta',
|
|
13
|
+
'/api/status',
|
|
14
|
+
'/api/check',
|
|
13
15
|
'/api/readme',
|
|
14
16
|
'/api/console',
|
|
15
17
|
'/api/signals',
|
|
@@ -55,9 +57,22 @@ export const PUBLIC_API = new Set([
|
|
|
55
57
|
'/api/lookalike',
|
|
56
58
|
'/api/honeypot',
|
|
57
59
|
'/api/address',
|
|
60
|
+
'/api/approvals',
|
|
61
|
+
'/api/contract',
|
|
62
|
+
'/api/poisoning',
|
|
63
|
+
'/api/trace',
|
|
64
|
+
'/api/repo',
|
|
65
|
+
'/api/report/domain',
|
|
66
|
+
'/api/report/wallet',
|
|
67
|
+
'/api/site',
|
|
68
|
+
'/api/tx',
|
|
69
|
+
'/api/creator',
|
|
70
|
+
'/api/archive',
|
|
71
|
+
'/api/invite',
|
|
72
|
+
'/api/stocktoken',
|
|
58
73
|
]);
|
|
59
74
|
/** Endpoints that start outside work (a CLI process or several upstream calls) get a tighter budget. */
|
|
60
|
-
const HEAVY = new Set(['/api/console', '/api/rhtoken', '/api/verify', '/api/url', '/api/travel', '/api/audit', '/api/recall', '/api/emailsec', '/api/country', '/api/airport', '/api/scam', '/api/ip', '/api/hash', '/api/company', '/api/phone', '/api/lookalike', '/api/honeypot', '/api/address']);
|
|
75
|
+
const HEAVY = new Set(['/api/console', '/api/rhtoken', '/api/verify', '/api/url', '/api/travel', '/api/audit', '/api/recall', '/api/emailsec', '/api/country', '/api/airport', '/api/scam', '/api/ip', '/api/hash', '/api/company', '/api/phone', '/api/lookalike', '/api/honeypot', '/api/address', '/api/approvals', '/api/contract', '/api/poisoning', '/api/trace', '/api/repo', '/api/report/domain', '/api/report/wallet', '/api/site', '/api/tx', '/api/creator', '/api/archive', '/api/invite']);
|
|
61
76
|
/** Signals from these modules describe the owner's own watchlist, cases, fences, votes or raw social streams. */
|
|
62
77
|
const PRIVATE_MODULES = new Set(['meerkat', 'case', 'fence', 'feedback', 'live']);
|
|
63
78
|
export function publicSignals(list) {
|
package/dist/web/server.d.ts
CHANGED
|
@@ -73,11 +73,24 @@ export interface TokenInfo {
|
|
|
73
73
|
launchpad: string;
|
|
74
74
|
txBase: string;
|
|
75
75
|
deployBlock: number;
|
|
76
|
+
uniswap?: string;
|
|
77
|
+
dexscreener?: string;
|
|
78
|
+
pool?: {
|
|
79
|
+
dex: string;
|
|
80
|
+
pair: string;
|
|
81
|
+
id: string;
|
|
82
|
+
url?: string;
|
|
83
|
+
};
|
|
84
|
+
supply?: string;
|
|
85
|
+
launched?: string;
|
|
86
|
+
migrated?: string;
|
|
76
87
|
}
|
|
77
88
|
/** The burn section on /thetoken: total, share of supply and every burn with its time and transaction. */
|
|
78
89
|
export declare function burnBlock(b: BurnInfo | null, t: Partial<TokenInfo>): string;
|
|
79
90
|
/** The address block on /thetoken, from src/web/token.json. An empty address says no token is official yet. */
|
|
80
91
|
export declare function tokenBlock(t: Partial<TokenInfo>): string;
|
|
92
|
+
/** The details table on /thetoken: supply, pool, launch and migration, all from token.json (read from the chain). */
|
|
93
|
+
export declare function tokenDetails(t: Partial<TokenInfo>): string;
|
|
81
94
|
export declare function createWebServer(opts?: WebOptions): {
|
|
82
95
|
server: Server;
|
|
83
96
|
oculon: Oculon;
|
package/dist/web/server.js
CHANGED
|
@@ -24,7 +24,9 @@ import { mailEnabled } from '../sources/resend.js';
|
|
|
24
24
|
import { analyst, crossExamine, isAnalystModel } from '../analyst.js';
|
|
25
25
|
import { scrubSecrets } from '../core/keys.js';
|
|
26
26
|
import { readBurns, rpcClient } from './burns.js';
|
|
27
|
-
import {
|
|
27
|
+
import { CHECK_ROUTES } from '../modules/checks.js';
|
|
28
|
+
import { llmsFull, llmsTxt, replayPage, statusPage } from './pages.js';
|
|
29
|
+
import { UTILITY, badgeSvg, createNonce, getInvestigation, holderFor, listInvestigations, runSafety, safetyState, signOutHolder, startInvestigation, startInvestigationHold, startSafety, startSafetyHold, tokenConfig, verifyHolder } from '../modules/utility.js';
|
|
28
30
|
/** Analyst questions and cross-examinations per visitor address per hour on a public install. */
|
|
29
31
|
const ANALYST_PER_HOUR = Number(process.env.OCULON_ANALYST_PER_HOUR ?? 40);
|
|
30
32
|
const analystHits = new Map();
|
|
@@ -282,6 +284,19 @@ export const ROUTES = {
|
|
|
282
284
|
'/api/lookalike': async (q, o) => slim(await o.lookalikes(need(q, 'domain', 120))),
|
|
283
285
|
'/api/honeypot': async (q, o) => slim(await o.honeypotCheck(need(q, 'address', 60), q.get('chain') ? { chain: q.get('chain').slice(0, 12) } : {})),
|
|
284
286
|
'/api/address': async (q, o) => slim(await o.addressCheck(need(q, 'address', 120), q.get('network') ? { network: q.get('network').slice(0, 20) } : {})),
|
|
287
|
+
'/api/approvals': async (q, o) => slim(await o.approvalsCheck(need(q, 'address', 60), q.get('chain') ? { chain: q.get('chain').slice(0, 12) } : {})),
|
|
288
|
+
'/api/contract': async (q, o) => slim(await o.contractRisk(need(q, 'address', 60), q.get('chain') ? { chain: q.get('chain').slice(0, 12) } : {})),
|
|
289
|
+
'/api/poisoning': async (q, o) => slim(await o.poisoningCheck(need(q, 'address', 60), q.get('chain') ? { chain: q.get('chain').slice(0, 12) } : {})),
|
|
290
|
+
'/api/trace': async (q, o) => slim(await o.traceFunds(need(q, 'address', 60), { ...(q.get('chain') ? { chain: q.get('chain').slice(0, 12) } : {}), ...(q.get('hops') ? { hops: Number(q.get('hops')) || 3 } : {}) })),
|
|
291
|
+
'/api/repo': async (q, o) => slim(await o.repoCheck(need(q, 'repo', 200))),
|
|
292
|
+
'/api/report/domain': async (q, o) => slim(await o.domainReport(need(q, 'domain', 120))),
|
|
293
|
+
'/api/report/wallet': async (q, o) => slim(await o.walletReport(need(q, 'address', 60), q.get('chain') ? { chain: q.get('chain').slice(0, 12) } : {})),
|
|
294
|
+
'/api/site': async (q, o) => slim(await o.siteCheck(need(q, 'url', 2000))),
|
|
295
|
+
'/api/tx': async (q, o) => slim(await o.explainTx(need(q, 'hash', 200), q.get('chain') ? { chain: q.get('chain').slice(0, 12) } : {})),
|
|
296
|
+
'/api/creator': async (q, o) => slim(await o.creatorCheck(need(q, 'address', 60), q.get('chain') ? { chain: q.get('chain').slice(0, 12) } : {})),
|
|
297
|
+
'/api/archive': async (q, o) => slim(await o.archivePage(need(q, 'url', 2000))),
|
|
298
|
+
'/api/invite': async (q, o) => slim(await o.inviteCheck(need(q, 'link', 300))),
|
|
299
|
+
'/api/stocktoken': async (q, o) => slim(await o.stockToken((q.get('q') ?? '').slice(0, 60))),
|
|
285
300
|
'/api/satellites': async (q, o) => slim(await o.satellites((q.get('q') ?? '').slice(0, 60))),
|
|
286
301
|
'/api/papers': async (q, o) => slim(await o.papers(need(q, 'topic', 200), q.get('years') ? { years: Number(q.get('years')) || 3 } : {})),
|
|
287
302
|
'/api/country': async (q, o) => {
|
|
@@ -360,9 +375,11 @@ export const ROUTES = {
|
|
|
360
375
|
return { version: SERVER_INFO.version, mcpTools: activeTools().length, modules, onchain: onchainEnabled() };
|
|
361
376
|
},
|
|
362
377
|
'/api/readme': () => {
|
|
378
|
+
// The GitHub header (banner and badges, written as HTML) is left out: the docs page renders Markdown only.
|
|
379
|
+
const strip = (md) => (/^<p align="center">/.test(md) ? `# Oculon\n\n${md.slice(Math.max(0, md.indexOf('**Open-source')))}` : md);
|
|
363
380
|
for (const p of [join(HERE, '..', '..', 'README.md'), join(HERE, '..', 'README.md')])
|
|
364
381
|
if (existsSync(p))
|
|
365
|
-
return { markdown: readFileSync(p, 'utf8') };
|
|
382
|
+
return { markdown: strip(readFileSync(p, 'utf8')) };
|
|
366
383
|
throw new HttpError(404, 'README not found');
|
|
367
384
|
},
|
|
368
385
|
};
|
|
@@ -385,6 +402,8 @@ async function readJson(req, limit = 10_000) {
|
|
|
385
402
|
throw new HttpError(400, 'invalid JSON body');
|
|
386
403
|
}
|
|
387
404
|
}
|
|
405
|
+
/** File uploads (base64 in a JSON body) and the check each one runs. */
|
|
406
|
+
const UPLOADS = { '/api/doc': 'doc', '/api/imagecheck': 'image', '/api/qr': 'qr', '/api/eml': 'eml', '/api/apk': 'apk', '/api/where': 'where' };
|
|
388
407
|
/** Writes that change what the whole install watches. */
|
|
389
408
|
const OWNER_ONLY = new Set(['/api/monitor', '/api/watch/delete', '/api/fences', '/api/fences/delete', '/api/cases']);
|
|
390
409
|
export const POST_ROUTES = {
|
|
@@ -393,7 +412,20 @@ export const POST_ROUTES = {
|
|
|
393
412
|
const raw = String(b.headers ?? '');
|
|
394
413
|
if (!raw.trim())
|
|
395
414
|
throw new HttpError(400, 'missing headers');
|
|
396
|
-
return o.headerCheck(raw.slice(0, 100_000));
|
|
415
|
+
return slim(await o.headerCheck(raw.slice(0, 100_000)));
|
|
416
|
+
},
|
|
417
|
+
'/api/job': async (b, o) => {
|
|
418
|
+
const raw = String(b.message ?? '');
|
|
419
|
+
if (!raw.trim())
|
|
420
|
+
throw new HttpError(400, 'missing message');
|
|
421
|
+
return slim(await o.jobCheck(raw.slice(0, 30_000)));
|
|
422
|
+
},
|
|
423
|
+
// Signature requests (typed data JSON, calldata) can be long too.
|
|
424
|
+
'/api/signature': async (b, o) => {
|
|
425
|
+
const raw = String(b.request ?? '');
|
|
426
|
+
if (!raw.trim())
|
|
427
|
+
throw new HttpError(400, 'missing request');
|
|
428
|
+
return slim(await o.signatureCheck(raw.slice(0, 100_000), { ...(b.chain ? { chain: String(b.chain).slice(0, 12) } : {}), ...(b.to ? { to: String(b.to).slice(0, 60) } : {}) }));
|
|
397
429
|
},
|
|
398
430
|
'/api/fences': (b, o) => {
|
|
399
431
|
const box = Array.isArray(b.box) ? b.box.map(Number) : null;
|
|
@@ -561,8 +593,37 @@ export function tokenBlock(t) {
|
|
|
561
593
|
// The third cell links to the launchpad page when there is one, otherwise to a block explorer.
|
|
562
594
|
const link = launchpad ? { k: 'Launchpad', u: launchpad, label: new URL(launchpad).hostname.replace(/^www\./, '') } : explorer ? { k: 'Explorer', u: explorer, label: 'view' } : null;
|
|
563
595
|
const cell = (k, v) => `<div><b>${k}</b><span>${v ? esc(v) : '-'}</span></div>`;
|
|
564
|
-
|
|
565
|
-
|
|
596
|
+
const badge = /^0x[0-9a-fA-F]{40}$/.test(ca) ? `<a class="sbadge" href="/safety/${esc(ca.toLowerCase())}" title="Live safety check of this token"><img src="/badge/${esc(ca.toLowerCase())}.svg" alt="Oculon safety badge" height="22"></a>` : '';
|
|
597
|
+
return `<div class="ca"><div class="lbl">Contract address</div><div class="addr"><code id="ca-value">${esc(ca)}</code><button id="copy-ca" type="button">COPY</button></div>${badge}`
|
|
598
|
+
+ `<div class="meta">${cell('Chain', (t.chain ?? '').trim())}${cell('Ticker', (t.ticker ?? '').trim() ? `$${(t.ticker ?? '').trim().replace(/^\$/, '')}` : '')}${t.pool ? cell('DEX', t.pool.dex) : `<div><b>${link ? link.k : 'Explorer'}</b><span>${link ? `<a href="${esc(link.u)}" target="_blank" rel="noopener">${esc(link.label)}</a>` : '-'}</span></div>`}</div>${tokenLinks(t)}</div>`;
|
|
599
|
+
}
|
|
600
|
+
/** Where to trade and track the token: one button per configured https link. */
|
|
601
|
+
function tokenLinks(t) {
|
|
602
|
+
const esc = (s) => s.replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
603
|
+
const safe = (u) => (/^https:\/\/[^\s"'<>]+$/.test(u ?? '') ? u : '');
|
|
604
|
+
const links = [['Uniswap', t.uniswap, 'Trade'], ['DexScreener', t.dexscreener, 'Chart'], ['Pons', t.launchpad, 'Launchpad'], ['Etherscan', t.explorer, 'Explorer']];
|
|
605
|
+
const items = links.filter(([, u]) => safe(u)).map(([name, u, kind]) => `<a href="${esc(safe(u))}" target="_blank" rel="noopener"><b>${kind}</b><span>${name}</span></a>`);
|
|
606
|
+
return items.length ? `<div class="golinks">${items.join('')}</div>` : '';
|
|
607
|
+
}
|
|
608
|
+
/** The details table on /thetoken: supply, pool, launch and migration, all from token.json (read from the chain). */
|
|
609
|
+
export function tokenDetails(t) {
|
|
610
|
+
const esc = (s) => s.replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
611
|
+
if (!(t.ca ?? '').trim())
|
|
612
|
+
return '';
|
|
613
|
+
const when = (iso) => (iso && !Number.isNaN(Date.parse(iso)) ? `${iso.slice(0, 10)} ${iso.slice(11, 16)} UTC` : '');
|
|
614
|
+
const safe = (u) => (/^https:\/\/[^\s"'<>]+$/.test(u ?? '') ? u : '');
|
|
615
|
+
const rows = [];
|
|
616
|
+
if (t.chain)
|
|
617
|
+
rows.push(['Chain', esc(t.chain)]);
|
|
618
|
+
if (t.supply)
|
|
619
|
+
rows.push(['Total supply', `${esc(t.supply)} ${esc((t.ticker ?? '').replace(/^\$/, ''))}`]);
|
|
620
|
+
if (t.pool)
|
|
621
|
+
rows.push(['Pool', `${esc(t.pool.pair)} on ${esc(t.pool.dex)}${safe(t.pool.url) ? ` · <a href="${esc(safe(t.pool.url))}" target="_blank" rel="noopener">${esc(t.pool.id.slice(0, 10))}…${esc(t.pool.id.slice(-6))}</a>` : ''}`]);
|
|
622
|
+
if (t.launched)
|
|
623
|
+
rows.push(['Launched', `${esc(when(t.launched))}${t.launchpad ? ' on the Pons launchpad' : ''}${t.deployBlock ? `, block ${t.deployBlock.toLocaleString('en-US')}` : ''}`]);
|
|
624
|
+
if (t.migrated)
|
|
625
|
+
rows.push(['Migrated', `${esc(when(t.migrated))}: the bonding curve completed and trading moved to ${esc(t.pool?.dex ?? 'a DEX pool')}. Same contract address, nothing to swap or claim.`]);
|
|
626
|
+
return rows.length ? `<h2>Details</h2><div class="dtable">${rows.map(([k, v]) => `<div><b>${k}</b><span>${v}</span></div>`).join('')}</div>` : '';
|
|
566
627
|
}
|
|
567
628
|
function send(res, status, body, type, cache = 'no-store') {
|
|
568
629
|
res.writeHead(status, {
|
|
@@ -574,6 +635,9 @@ function send(res, status, body, type, cache = 'no-store') {
|
|
|
574
635
|
});
|
|
575
636
|
res.end(body);
|
|
576
637
|
}
|
|
638
|
+
function siteDomainEarly(opts) {
|
|
639
|
+
return (opts.domain ?? process.env.OCULON_DOMAIN ?? '').trim().toLowerCase() || null;
|
|
640
|
+
}
|
|
577
641
|
export function createWebServer(opts = {}) {
|
|
578
642
|
const oculon = opts.oculon ?? new Oculon();
|
|
579
643
|
const log = opts.log ?? (() => { });
|
|
@@ -585,7 +649,8 @@ export function createWebServer(opts = {}) {
|
|
|
585
649
|
// OCULON_OPEN=1 opens the whole app to every visitor (no sign-in, no read-only gate, no rate limit).
|
|
586
650
|
const openApp = opts.open ?? process.env.OCULON_OPEN === '1';
|
|
587
651
|
// One MCP server for the HTTP transport, sharing this server's Oculon instance.
|
|
588
|
-
const
|
|
652
|
+
const appBase = siteDomainEarly(opts) ? `https://app.${siteDomainEarly(opts)}` : `http://127.0.0.1:${opts.port ?? 4747}`;
|
|
653
|
+
const mcpServer = new McpServer(() => oculon, { remote: publicMode, baseUrl: appBase });
|
|
589
654
|
// OCULON_PURGE_ONCHAIN=1 clears data left by the paused on-chain modules when the server starts.
|
|
590
655
|
if (!onchainEnabled() && process.env.OCULON_PURGE_ONCHAIN === '1') {
|
|
591
656
|
const removed = oculon.ctx.store.purgeOnchain();
|
|
@@ -742,7 +807,7 @@ export function createWebServer(opts = {}) {
|
|
|
742
807
|
try {
|
|
743
808
|
if (req.method === 'GET') {
|
|
744
809
|
if (url.pathname === '/api/utility/info')
|
|
745
|
-
return json({ token: tokenConfig(), amounts: { investigate: UTILITY.investigate.toString(), safety: UTILITY.safety.toString(), holder: UTILITY.holder.toString() }, safetyDays: UTILITY.safetyDays, holderMonitors: UTILITY.holderMonitors, holder: holderFor(oculon.ctx, owner), investigations: listInvestigations(oculon.ctx, 12) });
|
|
810
|
+
return json({ token: tokenConfig(), amounts: { investigate: UTILITY.investigate.toString(), safety: UTILITY.safety.toString(), holdInvestigate: UTILITY.holdInvestigate.toString(), holdSafety: UTILITY.holdSafety.toString(), holder: UTILITY.holder.toString() }, safetyDays: UTILITY.safetyDays, holderMonitors: UTILITY.holderMonitors, holder: holderFor(oculon.ctx, owner), investigations: listInvestigations(oculon.ctx, 12) });
|
|
746
811
|
if (url.pathname === '/api/utility/investigation') {
|
|
747
812
|
const v = getInvestigation(oculon.ctx, url.searchParams.get('id') ?? '');
|
|
748
813
|
return v ? json(v) : json({ error: 'no such investigation' }, 404);
|
|
@@ -765,9 +830,9 @@ export function createWebServer(opts = {}) {
|
|
|
765
830
|
return json({ ok: true });
|
|
766
831
|
}
|
|
767
832
|
if (url.pathname === '/api/utility/investigate')
|
|
768
|
-
return json(await startInvestigation(oculon, String(b.tx ?? ''), String(b.target ?? ''), String(b.signature ?? '')));
|
|
833
|
+
return json(b.mode === 'hold' ? await startInvestigationHold(oculon, String(b.target ?? ''), String(b.address ?? ''), String(b.nonce ?? ''), String(b.signature ?? '')) : await startInvestigation(oculon, String(b.tx ?? ''), String(b.target ?? ''), String(b.signature ?? '')));
|
|
769
834
|
if (url.pathname === '/api/utility/safety')
|
|
770
|
-
return json(await startSafety(oculon, String(b.tx ?? ''), String(b.token ?? ''), String(b.signature ?? '')));
|
|
835
|
+
return json(b.mode === 'hold' ? await startSafetyHold(oculon, String(b.token ?? ''), String(b.address ?? ''), String(b.nonce ?? ''), String(b.signature ?? '')) : await startSafety(oculon, String(b.tx ?? ''), String(b.token ?? ''), String(b.signature ?? '')));
|
|
771
836
|
}
|
|
772
837
|
return json({ error: 'not found' }, 404);
|
|
773
838
|
}
|
|
@@ -862,6 +927,31 @@ export function createWebServer(opts = {}) {
|
|
|
862
927
|
if (req.method === 'POST' && OWNER_ONLY.has(url.pathname) && !owner) {
|
|
863
928
|
return send(res, 403, '{"error":"the shared watchlist is managed by the owner; add your own monitors instead"}', 'application/json');
|
|
864
929
|
}
|
|
930
|
+
if (UPLOADS[url.pathname] && req.method === 'POST') {
|
|
931
|
+
if (!sameSite())
|
|
932
|
+
return send(res, 403, '{"error":"forbidden"}', 'application/json');
|
|
933
|
+
const ip = (viaEdge && String(req.headers['x-oculon-client-ip'] ?? '').trim()) || clientIp(req);
|
|
934
|
+
if (publicMode && !isAdmin(req, adminToken) && !analystLimit(ip))
|
|
935
|
+
return send(res, 429, '{"error":"You have checked a lot this hour. Try again a bit later."}', 'application/json');
|
|
936
|
+
try {
|
|
937
|
+
const b = await readJson(req, UPLOADS[url.pathname] === 'apk' ? 56_000_000 : 15_000_000);
|
|
938
|
+
const b64 = String(b.data ?? '').replace(/^data:[^;]+;base64,/, '');
|
|
939
|
+
if (!b64)
|
|
940
|
+
throw new HttpError(400, 'choose a file first');
|
|
941
|
+
const file = Buffer.from(b64, 'base64');
|
|
942
|
+
const name = String(b.name ?? 'document').slice(0, 120);
|
|
943
|
+
const { createHash } = await import('node:crypto');
|
|
944
|
+
const kind = UPLOADS[url.pathname];
|
|
945
|
+
const hash = createHash('sha256').update(file).digest('hex');
|
|
946
|
+
const run = { doc: () => oculon.docCheck(file, name), image: () => oculon.imageCheck(file, name), qr: () => oculon.qrCheck(file, name), eml: () => oculon.emlCheck(file, name), apk: () => oculon.apkCheck(file, name), where: () => oculon.whereCheck(file, name) }[kind];
|
|
947
|
+
const r = await oculon.recordCheck(kind, hash, run, { label: name });
|
|
948
|
+
log(`POST ${url.pathname}`);
|
|
949
|
+
return send(res, 200, JSON.stringify({ ...slim(r.value), check: r.check }), 'application/json; charset=utf-8');
|
|
950
|
+
}
|
|
951
|
+
catch (e) {
|
|
952
|
+
return send(res, e instanceof HttpError ? e.status : 400, JSON.stringify({ error: e.message }), 'application/json; charset=utf-8');
|
|
953
|
+
}
|
|
954
|
+
}
|
|
865
955
|
if (req.method === 'POST' && POST_ROUTES[url.pathname]) {
|
|
866
956
|
// Writes only from this dashboard: a custom header (forces a CORS preflight that this server never
|
|
867
957
|
// grants), a JSON body, and a same-host Origin when the browser sends one.
|
|
@@ -878,8 +968,14 @@ export function createWebServer(opts = {}) {
|
|
|
878
968
|
return send(res, 403, '{"error":"forbidden"}', 'application/json');
|
|
879
969
|
}
|
|
880
970
|
try {
|
|
881
|
-
const body = await readJson(req);
|
|
882
|
-
const out =
|
|
971
|
+
const body = await readJson(req, url.pathname === '/api/headers' || url.pathname === '/api/signature' || url.pathname === '/api/job' ? 200_000 : undefined);
|
|
972
|
+
const out = url.pathname === '/api/job'
|
|
973
|
+
? await oculon.recordCheck('job', String(body.message ?? ''), async () => POST_ROUTES[url.pathname](body, oculon), { label: `job offer: ${String(body.message ?? '').trim().slice(0, 60)}` }).then((r) => ({ ...r.value, check: r.check }))
|
|
974
|
+
: url.pathname === '/api/signature'
|
|
975
|
+
? await oculon.recordCheck('signature', String(body.request ?? ''), async () => POST_ROUTES[url.pathname](body, oculon), { label: `signature request: ${String(body.request ?? '').trim().slice(0, 60)}` }).then((r) => ({ ...r.value, check: r.check }))
|
|
976
|
+
: url.pathname === '/api/headers'
|
|
977
|
+
? await oculon.recordCheck('headers', String(body.headers ?? ''), async () => POST_ROUTES[url.pathname](body, oculon), { label: `email headers: ${(/^subject:\s*(.+)$/im.exec(String(body.headers ?? ''))?.[1] ?? 'pasted').slice(0, 70)}` }).then((r) => ({ ...r.value, check: r.check }))
|
|
978
|
+
: await POST_ROUTES[url.pathname](body, oculon);
|
|
883
979
|
log(`POST ${url.pathname}`);
|
|
884
980
|
return send(res, 200, JSON.stringify(out), 'application/json; charset=utf-8');
|
|
885
981
|
}
|
|
@@ -889,6 +985,46 @@ export function createWebServer(opts = {}) {
|
|
|
889
985
|
}
|
|
890
986
|
if (req.method !== 'GET')
|
|
891
987
|
return send(res, 405, '{"error":"method not allowed"}', 'application/json');
|
|
988
|
+
{
|
|
989
|
+
const base = siteDomain ? `https://app.${siteDomain}` : `http://${req.headers.host ?? '127.0.0.1'}`;
|
|
990
|
+
if (url.pathname === '/llms.txt' || url.pathname === '/llms-full.txt') {
|
|
991
|
+
const r = (await mcpServer.handle({ jsonrpc: '2.0', id: 0, method: 'tools/list' }));
|
|
992
|
+
const tools = r?.result?.tools ?? [];
|
|
993
|
+
const mcpUrl = siteDomain ? `https://mcp.${siteDomain}` : `${base}/mcp`;
|
|
994
|
+
res.setHeader('access-control-allow-origin', '*');
|
|
995
|
+
return send(res, 200, url.pathname === '/llms.txt' ? llmsTxt(tools, base, mcpUrl) : llmsFull(tools, base, mcpUrl), 'text/plain; charset=utf-8', 'public, max-age=3600');
|
|
996
|
+
}
|
|
997
|
+
if (url.pathname === '/status' || url.pathname === '/status/') {
|
|
998
|
+
const hours = Math.min(48, Number(url.searchParams.get('hours') ?? 24) || 24);
|
|
999
|
+
return send(res, 200, statusPage(oculon.sourceStatus(hours), base, hours), 'text/html; charset=utf-8', 'no-cache');
|
|
1000
|
+
}
|
|
1001
|
+
if (url.pathname === '/api/status') {
|
|
1002
|
+
const hours = Math.min(48, Number(url.searchParams.get('hours') ?? 24) || 24);
|
|
1003
|
+
res.setHeader('access-control-allow-origin', '*');
|
|
1004
|
+
return send(res, 200, JSON.stringify({ hours, sources: oculon.sourceStatus(hours) }), 'application/json; charset=utf-8');
|
|
1005
|
+
}
|
|
1006
|
+
const replayId = /^\/replay\/([A-Za-z0-9_-]{10,40})\/?$/.exec(url.pathname)?.[1];
|
|
1007
|
+
if (replayId) {
|
|
1008
|
+
const c = oculon.check(replayId);
|
|
1009
|
+
if (!c)
|
|
1010
|
+
return send(res, 404, '<!doctype html><meta charset="utf-8"><title>Not found</title><body style="background:#000;color:#ccc;font-family:system-ui;padding:40px"><p>This check does not exist, or it is older than 90 days.</p>', 'text/html; charset=utf-8');
|
|
1011
|
+
return send(res, 200, replayPage(c, oculon.checkHistory(replayId), base), 'text/html; charset=utf-8', 'private, max-age=60');
|
|
1012
|
+
}
|
|
1013
|
+
if (url.pathname === '/api/check') {
|
|
1014
|
+
const c = oculon.check(url.searchParams.get('id') ?? '');
|
|
1015
|
+
if (!c)
|
|
1016
|
+
return send(res, 404, '{"error":"no such check"}', 'application/json');
|
|
1017
|
+
return send(res, 200, JSON.stringify({ ...c, history: oculon.checkHistory(c.id) }), 'application/json; charset=utf-8');
|
|
1018
|
+
}
|
|
1019
|
+
const reportId = /^\/report\/([A-Za-z0-9_-]{10,40})\.pdf$/.exec(url.pathname)?.[1];
|
|
1020
|
+
if (reportId) {
|
|
1021
|
+
const pdf = oculon.checkPdf(reportId, base);
|
|
1022
|
+
if (!pdf)
|
|
1023
|
+
return send(res, 404, '{"error":"no such check"}', 'application/json');
|
|
1024
|
+
res.writeHead(200, { 'content-type': 'application/pdf', 'content-disposition': `inline; filename="oculon-${reportId.slice(0, 8)}.pdf"`, 'cache-control': 'private, max-age=300', 'x-content-type-options': 'nosniff' });
|
|
1025
|
+
return void res.end(pdf);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
892
1028
|
if (url.pathname === '/openapi.json') {
|
|
893
1029
|
res.setHeader('access-control-allow-origin', '*');
|
|
894
1030
|
return send(res, 200, JSON.stringify(openApiSpec(siteDomain ? `https://app.${siteDomain}` : `http://${req.headers.host ?? '127.0.0.1'}`), null, 2), 'application/json; charset=utf-8', 'public, max-age=3600');
|
|
@@ -942,7 +1078,7 @@ export function createWebServer(opts = {}) {
|
|
|
942
1078
|
info = JSON.parse(readFileSync(join(HERE, 'token.json'), 'utf8'));
|
|
943
1079
|
}
|
|
944
1080
|
catch { /* no file: nothing official */ }
|
|
945
|
-
const html = readFileSync(join(HERE, 'token.html'), 'utf8').replace('{{TOKEN_BLOCK}}', tokenBlock(info) + burnBlock(await tokenBurns(info), info));
|
|
1081
|
+
const html = readFileSync(join(HERE, 'token.html'), 'utf8').replace('{{TOKEN_BLOCK}}', tokenBlock(info) + burnBlock(await tokenBurns(info), info)).replace('{{TOKEN_DETAILS}}', tokenDetails(info));
|
|
946
1082
|
return send(res, 200, renderPage(html, siteDomain && hostName.endsWith(siteDomain) ? siteDomain : null), 'text/html; charset=utf-8');
|
|
947
1083
|
}
|
|
948
1084
|
if (url.pathname === '/manifest.webmanifest')
|
|
@@ -987,7 +1123,10 @@ export function createWebServer(opts = {}) {
|
|
|
987
1123
|
try {
|
|
988
1124
|
if (!onchainEnabled() && ONCHAIN_ROUTES.has(url.pathname))
|
|
989
1125
|
return send(res, 404, '{"error":"on-chain features are paused"}', 'application/json');
|
|
990
|
-
|
|
1126
|
+
const ck = CHECK_ROUTES[url.pathname];
|
|
1127
|
+
let out = ck && url.searchParams.get(ck.param)?.trim()
|
|
1128
|
+
? await oculon.recordCheck(ck.kind, `${url.searchParams.get(ck.param).trim()}${url.searchParams.get('chain') ? `@${url.searchParams.get('chain').trim().toLowerCase()}` : ''}`, async () => route(url.searchParams, oculon)).then((r) => (r.value && typeof r.value === 'object' ? { ...r.value, check: r.check } : r.value))
|
|
1129
|
+
: await route(url.searchParams, oculon);
|
|
991
1130
|
if (!onchainEnabled())
|
|
992
1131
|
out = withoutOnchain(url.pathname, out);
|
|
993
1132
|
if (!admin && url.pathname === '/api/signals')
|
package/dist/web/token.html
CHANGED
|
@@ -40,6 +40,7 @@ code{font:.86em var(--mono);background:rgba(0,20,24,.8);border:1px solid rgba(0,
|
|
|
40
40
|
.ca .meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:18px}
|
|
41
41
|
.ca .meta div{border:1px solid #1f2a2d;padding:12px 14px}.ca .meta b{display:block;font:400 11px var(--mono);letter-spacing:.14em;color:var(--mut);text-transform:uppercase}.ca .meta span{display:block;margin-top:6px;font:700 16px var(--mono);overflow-wrap:anywhere}
|
|
42
42
|
.ca.none p{margin:0}
|
|
43
|
+
.sbadge{display:inline-block;margin-top:14px}.sbadge img{display:block}
|
|
43
44
|
.burn{margin-top:16px;border:1px solid rgba(255,93,108,.35);background:rgba(18,4,6,.75);backdrop-filter:blur(8px);padding:24px}
|
|
44
45
|
.btot{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;margin-top:10px}.btot span{font:700 clamp(28px,5vw,40px) var(--mono);color:#ff7a86}.btot em{font:400 14px var(--mono);color:var(--mut);font-style:normal}
|
|
45
46
|
.btable{margin-top:16px;overflow-x:auto}.btable table{width:100%;border-collapse:collapse;font:13px var(--mono)}
|
|
@@ -50,7 +51,20 @@ code{font:.86em var(--mono);background:rgba(0,20,24,.8);border:1px solid rgba(0,
|
|
|
50
51
|
.three a{display:block;border:1px solid #1f2a2d;background:rgba(4,8,9,.85);padding:16px;text-decoration:none;transition:border-color .3s}.three a:hover{border-color:rgba(0,240,255,.5)}
|
|
51
52
|
.three b{display:block;font:400 11px var(--mono);letter-spacing:.14em;color:var(--mut)}.three span{display:block;margin-top:6px;font:700 15px var(--mono);color:var(--y);overflow-wrap:anywhere}
|
|
52
53
|
footer{border-top:1px solid var(--line);background:rgba(0,0,0,.6)}footer .in{max-width:860px;margin:0 auto;padding:26px clamp(20px,5vw,40px);display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;font:12px var(--mono);color:#5e5e5e}footer a{color:var(--mut)}
|
|
53
|
-
|
|
54
|
+
.golinks{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px}
|
|
55
|
+
.golinks a{display:block;border:1px solid rgba(0,240,255,.35);background:rgba(0,240,255,.05);padding:12px 14px;text-decoration:none;transition:background .25s,border-color .25s}
|
|
56
|
+
.golinks a:hover{background:rgba(0,240,255,.14);border-color:var(--y)}
|
|
57
|
+
.golinks b{display:block;font:400 11px var(--mono);letter-spacing:.14em;color:var(--mut);text-transform:uppercase}.golinks span{display:block;margin-top:5px;font:700 15px var(--mono);color:var(--y)}
|
|
58
|
+
.dtable{border:1px solid #1f2a2d;background:rgba(4,8,9,.85)}
|
|
59
|
+
.dtable div{display:grid;grid-template-columns:170px minmax(0,1fr);gap:16px;padding:13px 16px;border-bottom:1px solid #141c1e}.dtable div:last-child{border-bottom:0}
|
|
60
|
+
.dtable b{font:400 11px var(--mono);letter-spacing:.14em;color:var(--mut);text-transform:uppercase;padding-top:4px}.dtable span{font-size:16px;color:#e8eef0;line-height:1.6;overflow-wrap:anywhere}.dtable a{color:var(--y)}
|
|
61
|
+
.util{border:1px solid #1f2a2d;background:rgba(4,8,9,.85);margin-top:16px}
|
|
62
|
+
.util .uh,.util .ur{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) minmax(0,.8fr);gap:16px;padding:14px 16px;border-bottom:1px solid #141c1e}.util .ur:last-child{border-bottom:0}
|
|
63
|
+
.util .uh span{font:400 11px var(--mono);letter-spacing:.14em;color:var(--mut);text-transform:uppercase}
|
|
64
|
+
.util .ur>span{font:700 16px var(--mono);color:var(--y)}.util .ur>span:first-child{font:500 17px var(--sans);color:#fff}
|
|
65
|
+
.util em{display:block;font:300 14px/1.5 var(--sans);font-style:normal;color:var(--mut);margin-top:4px}
|
|
66
|
+
.ubtn{display:inline-block;font:700 13px var(--mono);letter-spacing:.08em;background:var(--y);color:#000 !important;padding:12px 16px;text-decoration:none}
|
|
67
|
+
@media (max-width:760px){.ca .meta,.three{grid-template-columns:minmax(0,1fr)}.golinks{grid-template-columns:repeat(2,minmax(0,1fr))}.dtable div{grid-template-columns:minmax(0,1fr);gap:4px}.util .uh{display:none}.util .ur{grid-template-columns:minmax(0,1fr);gap:8px}.util .ur>span[data-k]::before{content:attr(data-k);display:block;font:400 11px var(--mono);letter-spacing:.14em;color:var(--mut);text-transform:uppercase}}
|
|
54
68
|
</style>
|
|
55
69
|
</head>
|
|
56
70
|
<body>
|
|
@@ -60,6 +74,7 @@ footer{border-top:1px solid var(--line);background:rgba(0,0,0,.6)}footer .in{max
|
|
|
60
74
|
<div class="lbl">Official token</div>
|
|
61
75
|
<h1>One address.<br><span>Three places.</span></h1>
|
|
62
76
|
{{TOKEN_BLOCK}}
|
|
77
|
+
{{TOKEN_DETAILS}}
|
|
63
78
|
|
|
64
79
|
<h2>How to check an address</h2>
|
|
65
80
|
<p>The official address is posted in three places at the same time. Before you use any address, make sure it matches all three exactly, character by character.</p>
|
|
@@ -70,9 +85,15 @@ footer{border-top:1px solid var(--line);background:rgba(0,0,0,.6)}footer .in{max
|
|
|
70
85
|
</div>
|
|
71
86
|
<p>If an address is missing from any of the three, it is not Oculon. Oculon will never message you first, ask for your recovery phrase, or ask you to send funds to an address.</p>
|
|
72
87
|
|
|
73
|
-
<h2>
|
|
74
|
-
<p>
|
|
75
|
-
<
|
|
88
|
+
<h2>Utility</h2>
|
|
89
|
+
<p>Holding is the main way in: your wallet signs a one-time request and its balance is read live. Burning is optional. Everything is read from the chain, nothing leaves your wallet, and Oculon stays free for everyone.</p>
|
|
90
|
+
<div class="util">
|
|
91
|
+
<div class="uh"><span>Use</span><span>Hold</span><span>Or burn</span></div>
|
|
92
|
+
<div class="ur"><span><b>Deep investigation</b><em>A domain, wallet, token or company checked against every relevant source, published as its own page.</em></span><span data-k="Hold">1,500,000<em>one every 30 days per wallet</em></span><span data-k="Or burn">1,500,000<em>for one</em></span></div>
|
|
93
|
+
<div class="ur"><span><b>Live safety badge</b><em>A Robinhood Chain token monitored about every 15 minutes, with a badge that turns red on danger. Paying never changes the verdict.</em></span><span data-k="Hold">2,000,000<em>live while you hold, one badge per wallet</em></span><span data-k="Or burn">1,000,000<em>for 30 days</em></span></div>
|
|
94
|
+
<div class="ur"><span><b>Holder tier</b><em>Up to 30 personal monitors, checked every 15 minutes instead of every hour.</em></span><span data-k="Hold">3,500,000<em>sign once</em></span><span data-k="Or burn">-</span></div>
|
|
95
|
+
</div>
|
|
96
|
+
<p><a class="ubtn" href="/utility">Open the utility page →</a></p>
|
|
76
97
|
|
|
77
98
|
<h2>What Oculon is</h2>
|
|
78
99
|
<p>Oculon is a free, open-source OSINT engine under the MIT licence. It checks things before you trust them: a suspicious message, a link, a phone number, a leaked password, a supplier, an IP address, a vulnerability or a news claim. Every answer lists the sources it used and whether each was live, cached or unavailable.</p>
|
package/dist/web/token.json
CHANGED
|
@@ -2,8 +2,19 @@
|
|
|
2
2
|
"ca": "0x12a3f1a05d827007f17a43a250cce44868c4a263",
|
|
3
3
|
"chain": "Robinhood Chain",
|
|
4
4
|
"ticker": "OCULON",
|
|
5
|
-
"explorer": "",
|
|
5
|
+
"explorer": "https://robin.etherscan.io/token/0x12a3f1a05d827007f17a43a250cce44868c4a263",
|
|
6
6
|
"launchpad": "https://ponsfamily.com/launchpad/0x12a3f1a05d827007f17a43a250cce44868c4a263",
|
|
7
|
+
"uniswap": "https://app.uniswap.org/explore/tokens/robinhood/0x12a3f1a05d827007f17a43a250cce44868c4a263",
|
|
8
|
+
"dexscreener": "https://dexscreener.com/robinhood/0x74dcc6227ee273a799144dd31987ba5df105d10fd414057797fefbab97b6155a",
|
|
9
|
+
"pool": {
|
|
10
|
+
"dex": "Uniswap v4",
|
|
11
|
+
"pair": "OCULON / ETH",
|
|
12
|
+
"id": "0x74dcc6227ee273a799144dd31987ba5df105d10fd414057797fefbab97b6155a",
|
|
13
|
+
"url": "https://app.uniswap.org/explore/pools/robinhood/0x74dcc6227ee273a799144dd31987ba5df105d10fd414057797fefbab97b6155a"
|
|
14
|
+
},
|
|
15
|
+
"supply": "1,000,000,000",
|
|
16
|
+
"launched": "2026-11-25T14:38:27Z",
|
|
17
|
+
"migrated": "2026-11-25T21:22:31Z",
|
|
7
18
|
"txBase": "https://robin.etherscan.io",
|
|
8
19
|
"deployBlock": 123115234
|
|
9
20
|
}
|