oculon 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +344 -2
- package/dist/agent.d.ts +47 -0
- package/dist/agent.js +104 -0
- package/dist/cases.d.ts +68 -0
- package/dist/cases.js +158 -0
- package/dist/cli/main.d.ts +12 -0
- package/dist/cli/main.js +1999 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +15 -0
- package/dist/core/context.d.ts +19 -0
- package/dist/core/context.js +19 -0
- package/dist/core/features.d.ts +22 -0
- package/dist/core/features.js +28 -0
- package/dist/core/graph.d.ts +38 -0
- package/dist/core/graph.js +81 -0
- package/dist/core/http.d.ts +42 -0
- package/dist/core/http.js +266 -0
- package/dist/core/keys.d.ts +8 -0
- package/dist/core/keys.js +22 -0
- package/dist/core/llm.d.ts +93 -0
- package/dist/core/llm.js +180 -0
- package/dist/core/merkle.d.ts +15 -0
- package/dist/core/merkle.js +46 -0
- package/dist/core/paths.d.ts +2 -0
- package/dist/core/paths.js +6 -0
- package/dist/core/png.d.ts +17 -0
- package/dist/core/png.js +101 -0
- package/dist/core/quota.d.ts +15 -0
- package/dist/core/quota.js +90 -0
- package/dist/core/stats.d.ts +24 -0
- package/dist/core/stats.js +67 -0
- package/dist/core/store.d.ts +20 -0
- package/dist/core/store.js +213 -0
- package/dist/core/text.d.ts +9 -0
- package/dist/core/text.js +30 -0
- package/dist/core/types.d.ts +38 -0
- package/dist/core/types.js +1 -0
- package/dist/index.d.ts +346 -0
- package/dist/index.js +503 -0
- package/dist/live.d.ts +53 -0
- package/dist/live.js +236 -0
- package/dist/mcp.d.ts +43 -0
- package/dist/mcp.js +651 -0
- package/dist/modules/airport.d.ts +60 -0
- package/dist/modules/airport.js +111 -0
- package/dist/modules/audit.d.ts +73 -0
- package/dist/modules/audit.js +211 -0
- package/dist/modules/bgp.d.ts +147 -0
- package/dist/modules/bgp.js +206 -0
- package/dist/modules/blackout.d.ts +41 -0
- package/dist/modules/blackout.js +98 -0
- package/dist/modules/brief.d.ts +26 -0
- package/dist/modules/brief.js +99 -0
- package/dist/modules/calendar.d.ts +27 -0
- package/dist/modules/calendar.js +145 -0
- package/dist/modules/calibrate.d.ts +46 -0
- package/dist/modules/calibrate.js +92 -0
- package/dist/modules/cloud.d.ts +32 -0
- package/dist/modules/cloud.js +94 -0
- package/dist/modules/condor.d.ts +66 -0
- package/dist/modules/condor.js +214 -0
- package/dist/modules/connect.d.ts +47 -0
- package/dist/modules/connect.js +114 -0
- package/dist/modules/contradictions.d.ts +27 -0
- package/dist/modules/contradictions.js +76 -0
- package/dist/modules/country.d.ts +82 -0
- package/dist/modules/country.js +136 -0
- package/dist/modules/cricket.d.ts +34 -0
- package/dist/modules/cricket.js +166 -0
- package/dist/modules/darkships.d.ts +219 -0
- package/dist/modules/darkships.js +400 -0
- package/dist/modules/defi.d.ts +237 -0
- package/dist/modules/defi.js +512 -0
- package/dist/modules/emailsec.d.ts +47 -0
- package/dist/modules/emailsec.js +146 -0
- package/dist/modules/exposure.d.ts +43 -0
- package/dist/modules/exposure.js +89 -0
- package/dist/modules/factcheck.d.ts +39 -0
- package/dist/modules/factcheck.js +127 -0
- package/dist/modules/falcon.d.ts +58 -0
- package/dist/modules/falcon.js +219 -0
- package/dist/modules/feedback.d.ts +24 -0
- package/dist/modules/feedback.js +37 -0
- package/dist/modules/fence.d.ts +52 -0
- package/dist/modules/fence.js +128 -0
- package/dist/modules/ferret.d.ts +47 -0
- package/dist/modules/ferret.js +220 -0
- package/dist/modules/filings.d.ts +86 -0
- package/dist/modules/filings.js +166 -0
- package/dist/modules/fires.d.ts +56 -0
- package/dist/modules/fires.js +150 -0
- package/dist/modules/hazards.d.ts +37 -0
- package/dist/modules/hazards.js +83 -0
- package/dist/modules/health.d.ts +24 -0
- package/dist/modules/health.js +82 -0
- package/dist/modules/heron.d.ts +68 -0
- package/dist/modules/heron.js +184 -0
- package/dist/modules/hound.d.ts +100 -0
- package/dist/modules/hound.js +301 -0
- package/dist/modules/impact.d.ts +39 -0
- package/dist/modules/impact.js +63 -0
- package/dist/modules/launches.d.ts +24 -0
- package/dist/modules/launches.js +61 -0
- package/dist/modules/listen.d.ts +48 -0
- package/dist/modules/listen.js +125 -0
- package/dist/modules/lynx.d.ts +43 -0
- package/dist/modules/lynx.js +127 -0
- package/dist/modules/magpie.d.ts +70 -0
- package/dist/modules/magpie.js +174 -0
- package/dist/modules/meerkat.d.ts +42 -0
- package/dist/modules/meerkat.js +293 -0
- package/dist/modules/monitor.d.ts +27 -0
- package/dist/modules/monitor.js +105 -0
- package/dist/modules/narratives.d.ts +33 -0
- package/dist/modules/narratives.js +136 -0
- package/dist/modules/owl.d.ts +71 -0
- package/dist/modules/owl.js +290 -0
- package/dist/modules/papers.d.ts +46 -0
- package/dist/modules/papers.js +135 -0
- package/dist/modules/personal.d.ts +54 -0
- package/dist/modules/personal.js +153 -0
- package/dist/modules/pulse.d.ts +19 -0
- package/dist/modules/pulse.js +59 -0
- package/dist/modules/raven.d.ts +80 -0
- package/dist/modules/raven.js +147 -0
- package/dist/modules/recall.d.ts +44 -0
- package/dist/modules/recall.js +123 -0
- package/dist/modules/regs.d.ts +88 -0
- package/dist/modules/regs.js +142 -0
- package/dist/modules/rewind.d.ts +22 -0
- package/dist/modules/rewind.js +68 -0
- package/dist/modules/sanctions.d.ts +62 -0
- package/dist/modules/sanctions.js +173 -0
- package/dist/modules/scam.d.ts +43 -0
- package/dist/modules/scam.js +149 -0
- package/dist/modules/scoop.d.ts +31 -0
- package/dist/modules/scoop.js +74 -0
- package/dist/modules/ships.d.ts +33 -0
- package/dist/modules/ships.js +113 -0
- package/dist/modules/sky.d.ts +47 -0
- package/dist/modules/sky.js +183 -0
- package/dist/modules/squawk.d.ts +46 -0
- package/dist/modules/squawk.js +106 -0
- package/dist/modules/tortoise.d.ts +59 -0
- package/dist/modules/tortoise.js +133 -0
- package/dist/modules/travel.d.ts +94 -0
- package/dist/modules/travel.js +241 -0
- package/dist/modules/urlcheck.d.ts +63 -0
- package/dist/modules/urlcheck.js +223 -0
- package/dist/modules/vulns.d.ts +142 -0
- package/dist/modules/vulns.js +276 -0
- package/dist/plugins.d.ts +41 -0
- package/dist/plugins.js +70 -0
- package/dist/report.d.ts +12 -0
- package/dist/report.js +90 -0
- package/dist/scheduler.d.ts +22 -0
- package/dist/scheduler.js +139 -0
- package/dist/sources/aircraft.d.ts +76 -0
- package/dist/sources/aircraft.js +107 -0
- package/dist/sources/airports.d.ts +28 -0
- package/dist/sources/airports.js +100 -0
- package/dist/sources/ais.d.ts +32 -0
- package/dist/sources/ais.js +111 -0
- package/dist/sources/apify.d.ts +28 -0
- package/dist/sources/apify.js +80 -0
- package/dist/sources/arxiv.d.ts +13 -0
- package/dist/sources/arxiv.js +27 -0
- package/dist/sources/certs.d.ts +12 -0
- package/dist/sources/certs.js +23 -0
- package/dist/sources/corp.d.ts +46 -0
- package/dist/sources/corp.js +60 -0
- package/dist/sources/earth.d.ts +39 -0
- package/dist/sources/earth.js +76 -0
- package/dist/sources/fda.d.ts +77 -0
- package/dist/sources/fda.js +121 -0
- package/dist/sources/finance.d.ts +181 -0
- package/dist/sources/finance.js +270 -0
- package/dist/sources/gdelt.d.ts +19 -0
- package/dist/sources/gdelt.js +33 -0
- package/dist/sources/github.d.ts +17 -0
- package/dist/sources/github.js +33 -0
- package/dist/sources/hackernews.d.ts +20 -0
- package/dist/sources/hackernews.js +37 -0
- package/dist/sources/labels.d.ts +21 -0
- package/dist/sources/labels.js +87 -0
- package/dist/sources/launch.d.ts +16 -0
- package/dist/sources/launch.js +41 -0
- package/dist/sources/ofac.d.ts +29 -0
- package/dist/sources/ofac.js +86 -0
- package/dist/sources/onchain.d.ts +77 -0
- package/dist/sources/onchain.js +189 -0
- package/dist/sources/opentimestamps.d.ts +49 -0
- package/dist/sources/opentimestamps.js +145 -0
- package/dist/sources/polymarket.d.ts +36 -0
- package/dist/sources/polymarket.js +70 -0
- package/dist/sources/predict.d.ts +18 -0
- package/dist/sources/predict.js +59 -0
- package/dist/sources/press.d.ts +30 -0
- package/dist/sources/press.js +111 -0
- package/dist/sources/resend.d.ts +14 -0
- package/dist/sources/resend.js +29 -0
- package/dist/sources/robinhood.d.ts +109 -0
- package/dist/sources/robinhood.js +129 -0
- package/dist/sources/sec.d.ts +67 -0
- package/dist/sources/sec.js +129 -0
- package/dist/sources/sentinel.d.ts +13 -0
- package/dist/sources/sentinel.js +63 -0
- package/dist/sources/signatures.d.ts +14 -0
- package/dist/sources/signatures.js +103 -0
- package/dist/sources/social.d.ts +22 -0
- package/dist/sources/social.js +56 -0
- package/dist/sources/space.d.ts +160 -0
- package/dist/sources/space.js +230 -0
- package/dist/sources/usgs.d.ts +17 -0
- package/dist/sources/usgs.js +24 -0
- package/dist/sources/wayback.d.ts +10 -0
- package/dist/sources/wayback.js +28 -0
- package/dist/sources/websec.d.ts +19 -0
- package/dist/sources/websec.js +40 -0
- package/dist/sources/wikidata.d.ts +11 -0
- package/dist/sources/wikidata.js +30 -0
- package/dist/sources/wikimedia.d.ts +28 -0
- package/dist/sources/wikimedia.js +52 -0
- package/dist/telegram.d.ts +104 -0
- package/dist/telegram.js +927 -0
- package/dist/web/assets/favicon-32.png +0 -0
- package/dist/web/assets/fx.js +178 -0
- package/dist/web/assets/icon-192.png +0 -0
- package/dist/web/assets/icon-512.png +0 -0
- package/dist/web/assets/icon-maskable-512.png +0 -0
- package/dist/web/assets/night-americas.jpg +0 -0
- package/dist/web/assets/night-emea.jpg +0 -0
- package/dist/web/assets/og.png +0 -0
- package/dist/web/assets/redsea-bm.jpg +0 -0
- package/dist/web/docs.html +281 -0
- package/dist/web/index.html +1828 -0
- package/dist/web/insights.d.ts +100 -0
- package/dist/web/insights.js +134 -0
- package/dist/web/landing.html +1144 -0
- package/dist/web/legal.html +176 -0
- package/dist/web/manifest.webmanifest +20 -0
- package/dist/web/mcp.html +104 -0
- package/dist/web/mcphttp.d.ts +10 -0
- package/dist/web/mcphttp.js +67 -0
- package/dist/web/openapi.d.ts +1 -0
- package/dist/web/openapi.js +51 -0
- package/dist/web/public.d.ts +45 -0
- package/dist/web/public.js +136 -0
- package/dist/web/server.d.ts +69 -0
- package/dist/web/server.js +764 -0
- package/dist/web/share.d.ts +35 -0
- package/dist/web/share.js +132 -0
- package/dist/web/sw.js +28 -0
- package/package.json +60 -4
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
2
|
+
import { mkdirSync } from 'node:fs';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { oculonHome } from './paths.js';
|
|
5
|
+
const SCHEMA = `
|
|
6
|
+
CREATE TABLE IF NOT EXISTS cache (
|
|
7
|
+
key TEXT PRIMARY KEY,
|
|
8
|
+
body TEXT NOT NULL,
|
|
9
|
+
fetched_at INTEGER NOT NULL
|
|
10
|
+
);
|
|
11
|
+
CREATE TABLE IF NOT EXISTS entities (
|
|
12
|
+
id TEXT PRIMARY KEY,
|
|
13
|
+
kind TEXT NOT NULL,
|
|
14
|
+
name TEXT NOT NULL,
|
|
15
|
+
attrs TEXT NOT NULL DEFAULT '{}',
|
|
16
|
+
created_at INTEGER NOT NULL,
|
|
17
|
+
updated_at INTEGER NOT NULL
|
|
18
|
+
);
|
|
19
|
+
CREATE TABLE IF NOT EXISTS edges (
|
|
20
|
+
src TEXT NOT NULL,
|
|
21
|
+
dst TEXT NOT NULL,
|
|
22
|
+
rel TEXT NOT NULL,
|
|
23
|
+
source TEXT NOT NULL,
|
|
24
|
+
weight REAL NOT NULL DEFAULT 1,
|
|
25
|
+
created_at INTEGER NOT NULL,
|
|
26
|
+
updated_at INTEGER NOT NULL,
|
|
27
|
+
PRIMARY KEY (src, dst, rel)
|
|
28
|
+
);
|
|
29
|
+
CREATE INDEX IF NOT EXISTS edges_dst ON edges (dst);
|
|
30
|
+
CREATE TABLE IF NOT EXISTS observations (
|
|
31
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
32
|
+
entity_id TEXT NOT NULL,
|
|
33
|
+
module TEXT NOT NULL,
|
|
34
|
+
kind TEXT NOT NULL,
|
|
35
|
+
value REAL,
|
|
36
|
+
payload TEXT NOT NULL DEFAULT '{}',
|
|
37
|
+
source TEXT NOT NULL,
|
|
38
|
+
observed_at INTEGER NOT NULL
|
|
39
|
+
);
|
|
40
|
+
CREATE INDEX IF NOT EXISTS obs_entity ON observations (entity_id, kind, observed_at);
|
|
41
|
+
CREATE TABLE IF NOT EXISTS signals (
|
|
42
|
+
id TEXT PRIMARY KEY,
|
|
43
|
+
module TEXT NOT NULL,
|
|
44
|
+
entity_id TEXT,
|
|
45
|
+
title TEXT NOT NULL,
|
|
46
|
+
score REAL NOT NULL,
|
|
47
|
+
evidence TEXT NOT NULL,
|
|
48
|
+
created_at INTEGER NOT NULL
|
|
49
|
+
);
|
|
50
|
+
CREATE INDEX IF NOT EXISTS signals_time ON signals (created_at);
|
|
51
|
+
CREATE TABLE IF NOT EXISTS predictions (
|
|
52
|
+
id TEXT PRIMARY KEY,
|
|
53
|
+
market_id TEXT NOT NULL,
|
|
54
|
+
slug TEXT NOT NULL,
|
|
55
|
+
question TEXT NOT NULL,
|
|
56
|
+
outcome TEXT NOT NULL,
|
|
57
|
+
p_model REAL NOT NULL,
|
|
58
|
+
p_market REAL NOT NULL,
|
|
59
|
+
method TEXT NOT NULL,
|
|
60
|
+
rationale TEXT NOT NULL,
|
|
61
|
+
evidence TEXT NOT NULL DEFAULT '[]',
|
|
62
|
+
created_at INTEGER NOT NULL,
|
|
63
|
+
leaf TEXT NOT NULL,
|
|
64
|
+
batch_id TEXT,
|
|
65
|
+
merkle_path TEXT,
|
|
66
|
+
resolved_at INTEGER,
|
|
67
|
+
result INTEGER,
|
|
68
|
+
brier_model REAL,
|
|
69
|
+
brier_market REAL
|
|
70
|
+
);
|
|
71
|
+
CREATE INDEX IF NOT EXISTS predictions_open ON predictions (resolved_at);
|
|
72
|
+
CREATE TABLE IF NOT EXISTS quota (
|
|
73
|
+
source TEXT NOT NULL,
|
|
74
|
+
day TEXT NOT NULL,
|
|
75
|
+
used INTEGER NOT NULL DEFAULT 0,
|
|
76
|
+
PRIMARY KEY (source, day)
|
|
77
|
+
);
|
|
78
|
+
CREATE TABLE IF NOT EXISTS watchlist (
|
|
79
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
80
|
+
kind TEXT NOT NULL,
|
|
81
|
+
target TEXT NOT NULL,
|
|
82
|
+
label TEXT,
|
|
83
|
+
created_at INTEGER NOT NULL,
|
|
84
|
+
last_run INTEGER,
|
|
85
|
+
last_state TEXT,
|
|
86
|
+
UNIQUE (kind, target)
|
|
87
|
+
);
|
|
88
|
+
CREATE TABLE IF NOT EXISTS cases (
|
|
89
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
90
|
+
question TEXT NOT NULL,
|
|
91
|
+
created_at INTEGER NOT NULL,
|
|
92
|
+
updated_at INTEGER NOT NULL,
|
|
93
|
+
runs INTEGER NOT NULL DEFAULT 0,
|
|
94
|
+
watch INTEGER NOT NULL DEFAULT 0,
|
|
95
|
+
report TEXT,
|
|
96
|
+
markdown TEXT
|
|
97
|
+
);
|
|
98
|
+
CREATE TABLE IF NOT EXISTS scoops (
|
|
99
|
+
signal_id TEXT PRIMARY KEY,
|
|
100
|
+
subject TEXT NOT NULL,
|
|
101
|
+
oculon_at INTEGER NOT NULL,
|
|
102
|
+
media_at INTEGER,
|
|
103
|
+
media_source TEXT,
|
|
104
|
+
media_url TEXT,
|
|
105
|
+
lead_hours REAL,
|
|
106
|
+
checked_at INTEGER NOT NULL
|
|
107
|
+
);
|
|
108
|
+
CREATE TABLE IF NOT EXISTS fences (
|
|
109
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
110
|
+
name TEXT NOT NULL,
|
|
111
|
+
south REAL NOT NULL,
|
|
112
|
+
west REAL NOT NULL,
|
|
113
|
+
north REAL NOT NULL,
|
|
114
|
+
east REAL NOT NULL,
|
|
115
|
+
kinds TEXT NOT NULL,
|
|
116
|
+
created_at INTEGER NOT NULL,
|
|
117
|
+
last_run INTEGER,
|
|
118
|
+
last_state TEXT
|
|
119
|
+
);
|
|
120
|
+
CREATE TABLE IF NOT EXISTS narratives (
|
|
121
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
122
|
+
name TEXT NOT NULL,
|
|
123
|
+
created_at INTEGER NOT NULL,
|
|
124
|
+
updated_at INTEGER NOT NULL
|
|
125
|
+
);
|
|
126
|
+
CREATE TABLE IF NOT EXISTS narrative_items (
|
|
127
|
+
url TEXT PRIMARY KEY,
|
|
128
|
+
narrative_id INTEGER NOT NULL,
|
|
129
|
+
title TEXT NOT NULL,
|
|
130
|
+
source TEXT NOT NULL,
|
|
131
|
+
day TEXT NOT NULL,
|
|
132
|
+
added_at INTEGER NOT NULL
|
|
133
|
+
);
|
|
134
|
+
CREATE INDEX IF NOT EXISTS narrative_items_n ON narrative_items (narrative_id, day);
|
|
135
|
+
CREATE TABLE IF NOT EXISTS health (
|
|
136
|
+
company TEXT NOT NULL,
|
|
137
|
+
day TEXT NOT NULL,
|
|
138
|
+
score REAL NOT NULL,
|
|
139
|
+
parts TEXT NOT NULL,
|
|
140
|
+
PRIMARY KEY (company, day)
|
|
141
|
+
);
|
|
142
|
+
CREATE TABLE IF NOT EXISTS scheduler_runs (
|
|
143
|
+
name TEXT NOT NULL,
|
|
144
|
+
day TEXT NOT NULL,
|
|
145
|
+
ran_at INTEGER NOT NULL,
|
|
146
|
+
PRIMARY KEY (name, day)
|
|
147
|
+
);
|
|
148
|
+
CREATE TABLE IF NOT EXISTS briefs (
|
|
149
|
+
day TEXT PRIMARY KEY,
|
|
150
|
+
markdown TEXT NOT NULL,
|
|
151
|
+
model TEXT,
|
|
152
|
+
created_at INTEGER NOT NULL
|
|
153
|
+
);
|
|
154
|
+
CREATE TABLE IF NOT EXISTS proof_batches (
|
|
155
|
+
id TEXT PRIMARY KEY,
|
|
156
|
+
root TEXT NOT NULL,
|
|
157
|
+
size INTEGER NOT NULL,
|
|
158
|
+
created_at INTEGER NOT NULL,
|
|
159
|
+
receipts TEXT NOT NULL DEFAULT '[]',
|
|
160
|
+
bitcoin_height INTEGER,
|
|
161
|
+
bitcoin_time INTEGER,
|
|
162
|
+
verified_at INTEGER
|
|
163
|
+
);
|
|
164
|
+
`;
|
|
165
|
+
export class Store {
|
|
166
|
+
db;
|
|
167
|
+
constructor(path = process.env.OCULON_DB || join(oculonHome(), 'oculon.db')) {
|
|
168
|
+
if (path !== ':memory:')
|
|
169
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
170
|
+
this.db = new DatabaseSync(path);
|
|
171
|
+
// WAL plus a busy timeout: the web console runs the CLI in a second process against the same file.
|
|
172
|
+
if (path !== ':memory:')
|
|
173
|
+
this.db.exec('PRAGMA journal_mode = WAL; PRAGMA busy_timeout = 8000;');
|
|
174
|
+
this.db.exec(SCHEMA);
|
|
175
|
+
}
|
|
176
|
+
cacheGet(key) {
|
|
177
|
+
const row = this.db.prepare('SELECT body, fetched_at FROM cache WHERE key = ?').get(key);
|
|
178
|
+
return row ? { body: row.body, fetchedAt: row.fetched_at } : undefined;
|
|
179
|
+
}
|
|
180
|
+
cachePut(key, body, fetchedAt = Date.now()) {
|
|
181
|
+
this.db
|
|
182
|
+
.prepare('INSERT INTO cache (key, body, fetched_at) VALUES (?, ?, ?) ON CONFLICT(key) DO UPDATE SET body = excluded.body, fetched_at = excluded.fetched_at')
|
|
183
|
+
.run(key, body, fetchedAt);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Deletes everything the on-chain modules left behind (Robinhood Chain pools and deployers, wallet and
|
|
187
|
+
* token checks, DeFi): their signals, scoops, observations, entities, edges and watch targets.
|
|
188
|
+
*/
|
|
189
|
+
purgeOnchain() {
|
|
190
|
+
const ent = "(%s LIKE 'wallet:%' OR %s LIKE 'token:%' OR %s LIKE 'event:token:%' OR %s LIKE 'event:deployer:%')";
|
|
191
|
+
const on = (col) => ent.replaceAll('%s', col);
|
|
192
|
+
const mods = "('heron', 'magpie', 'defi')";
|
|
193
|
+
const run = (sql) => Number(this.db.prepare(sql).run().changes);
|
|
194
|
+
return {
|
|
195
|
+
scoops: run(`DELETE FROM scoops WHERE signal_id LIKE 'heron-%' OR signal_id LIKE 'magpie-%' OR signal_id LIKE 'defi-%'`),
|
|
196
|
+
signals: run(`DELETE FROM signals WHERE module IN ${mods} OR (entity_id IS NOT NULL AND ${on('entity_id')})`),
|
|
197
|
+
observations: run(`DELETE FROM observations WHERE module IN ${mods} OR ${on('entity_id')}`),
|
|
198
|
+
edges: run(`DELETE FROM edges WHERE ${on('src')} OR ${on('dst')}`),
|
|
199
|
+
entities: run(`DELETE FROM entities WHERE ${on('id')}`),
|
|
200
|
+
watchlist: run(`DELETE FROM watchlist WHERE kind IN ('wallet', 'token') OR target LIKE '%@robinhood'`),
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
/** Drop raw API responses older than `days` (derived entries such as calibration stay), optionally compacting the file. */
|
|
204
|
+
pruneCache(days = 14, vacuum = false, now = Date.now()) {
|
|
205
|
+
const removed = Number(this.db.prepare("DELETE FROM cache WHERE fetched_at < ? AND key NOT LIKE 'derived:%'").run(now - days * 86_400_000).changes);
|
|
206
|
+
if (vacuum)
|
|
207
|
+
this.db.exec('VACUUM');
|
|
208
|
+
return { removed };
|
|
209
|
+
}
|
|
210
|
+
close() {
|
|
211
|
+
this.db.close();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Lowercase content words: length >= 4, capitalized names >= 3 ("Fed"), or acronyms >= 2 ("AI", "NBA"). */
|
|
2
|
+
export declare function keywords(text: string): Set<string>;
|
|
3
|
+
/** Overlap score between two keyword sets: shared / size of the smaller set. */
|
|
4
|
+
export declare function overlap(a: Set<string>, b: Set<string>): {
|
|
5
|
+
score: number;
|
|
6
|
+
shared: string[];
|
|
7
|
+
};
|
|
8
|
+
export declare function signalId(module: string, ...parts: string[]): string;
|
|
9
|
+
export declare const articleTitle: (a: string) => string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
const STOP = new Set(`the a an and or of to in on for with by at from is are was were be been will would can could should this that these those it its as
|
|
3
|
+
into over after before about than then vs via new how why what who when where which says said year years day days week weeks
|
|
4
|
+
your you our their his her they them we us not no yes more most will just like also first last next time people`.split(/\s+/));
|
|
5
|
+
/** Lowercase content words: length >= 4, capitalized names >= 3 ("Fed"), or acronyms >= 2 ("AI", "NBA"). */
|
|
6
|
+
export function keywords(text) {
|
|
7
|
+
const out = new Set();
|
|
8
|
+
for (const raw of text.replace(/_/g, ' ').split(/[^\p{L}\p{N}]+/u)) {
|
|
9
|
+
if (!raw)
|
|
10
|
+
continue;
|
|
11
|
+
const w = raw.toLowerCase();
|
|
12
|
+
if (STOP.has(w))
|
|
13
|
+
continue;
|
|
14
|
+
const capitalized = /^\p{Lu}/u.test(raw);
|
|
15
|
+
const acronym = raw.length >= 2 && raw === raw.toUpperCase() && /\p{L}/u.test(raw);
|
|
16
|
+
if (w.length >= 4 || acronym || (capitalized && w.length >= 3))
|
|
17
|
+
out.add(w);
|
|
18
|
+
}
|
|
19
|
+
return out;
|
|
20
|
+
}
|
|
21
|
+
/** Overlap score between two keyword sets: shared / size of the smaller set. */
|
|
22
|
+
export function overlap(a, b) {
|
|
23
|
+
const shared = [...a].filter((w) => b.has(w));
|
|
24
|
+
const denom = Math.min(a.size, b.size);
|
|
25
|
+
return { score: denom ? shared.length / denom : 0, shared };
|
|
26
|
+
}
|
|
27
|
+
export function signalId(module, ...parts) {
|
|
28
|
+
return `${module}-${createHash('sha256').update(parts.join('|')).digest('hex').slice(0, 12)}`;
|
|
29
|
+
}
|
|
30
|
+
export const articleTitle = (a) => a.replace(/_/g, ' ');
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** Status of a piece of data, so every result says where it came from and how fresh it is. */
|
|
2
|
+
export type Status = 'LIVE' | 'CACHED' | 'UNAVAILABLE' | 'ERROR';
|
|
3
|
+
export interface Provenance {
|
|
4
|
+
source: string;
|
|
5
|
+
url: string;
|
|
6
|
+
status: Status;
|
|
7
|
+
/** ISO timestamp of when the underlying data was fetched. */
|
|
8
|
+
fetchedAt: string;
|
|
9
|
+
note?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface Sourced<T> {
|
|
12
|
+
data: T | null;
|
|
13
|
+
prov: Provenance;
|
|
14
|
+
}
|
|
15
|
+
export interface Evidence {
|
|
16
|
+
source: string;
|
|
17
|
+
text: string;
|
|
18
|
+
url?: string;
|
|
19
|
+
value?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface Signal {
|
|
22
|
+
id: string;
|
|
23
|
+
module: string;
|
|
24
|
+
title: string;
|
|
25
|
+
/** 0-100. */
|
|
26
|
+
score: number;
|
|
27
|
+
entity?: string;
|
|
28
|
+
evidence: Evidence[];
|
|
29
|
+
createdAt: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ModuleResult<T> {
|
|
32
|
+
module: string;
|
|
33
|
+
input: string;
|
|
34
|
+
generatedAt: string;
|
|
35
|
+
result: T;
|
|
36
|
+
signals: Signal[];
|
|
37
|
+
provenance: Provenance[];
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Oculon SDK.
|
|
3
|
+
*
|
|
4
|
+
* import { Oculon } from 'oculon';
|
|
5
|
+
* const o = new Oculon();
|
|
6
|
+
* const radar = await o.radar();
|
|
7
|
+
* const dossier = await o.dossier('Nvidia');
|
|
8
|
+
* o.close();
|
|
9
|
+
*
|
|
10
|
+
* Every call returns a ModuleResult: { result, signals, provenance } where provenance labels each
|
|
11
|
+
* underlying fetch LIVE / CACHED / UNAVAILABLE / ERROR with its source URL and time.
|
|
12
|
+
*/
|
|
13
|
+
import { type ContextOptions, type Ctx } from './core/context.js';
|
|
14
|
+
import type { Entity, Neighbor } from './core/graph.js';
|
|
15
|
+
import { type Platform } from './modules/pulse.js';
|
|
16
|
+
import { regs } from './modules/regs.js';
|
|
17
|
+
import { type Verdict } from './modules/feedback.js';
|
|
18
|
+
import type { ModuleResult, Provenance, Signal } from './core/types.js';
|
|
19
|
+
import { type FerretOptions } from './modules/ferret.js';
|
|
20
|
+
import { type HoundOptions } from './modules/hound.js';
|
|
21
|
+
import { type OwlOptions } from './modules/owl.js';
|
|
22
|
+
import { type Prediction, type Scoreboard } from './modules/raven.js';
|
|
23
|
+
export interface OculonOptions extends Pick<ContextOptions, 'dbPath' | 'fetch' | 'throttle' | 'now'> {
|
|
24
|
+
/** Contact string for User-Agents (enables SEC EDGAR). Falls back to OCULON_CONTACT. */
|
|
25
|
+
contact?: string;
|
|
26
|
+
/** GitHub token for higher rate limits. Falls back to GITHUB_TOKEN. */
|
|
27
|
+
githubToken?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare class Oculon {
|
|
30
|
+
readonly ctx: Ctx;
|
|
31
|
+
constructor(opts?: OculonOptions);
|
|
32
|
+
/** Owl: what the world is suddenly paying attention to, fused across sources. */
|
|
33
|
+
radar(opts?: OwlOptions): Promise<ModuleResult<import("./modules/owl.js").OwlResult>>;
|
|
34
|
+
/** Ferret: pre-release footprints of a domain (new hostnames, pages, repos). */
|
|
35
|
+
footprint(domain: string, opts?: FerretOptions): Promise<ModuleResult<import("./modules/ferret.js").FerretResult>>;
|
|
36
|
+
/** Cricket: hype phase of a topic across readers, developers, news, research, builders. */
|
|
37
|
+
hype(topic: string): Promise<ModuleResult<import("./modules/cricket.js").CricketResult>>;
|
|
38
|
+
/** Falcon: one aircraft by registration or ICAO hex. */
|
|
39
|
+
aircraft(query: string): Promise<ModuleResult<import("./modules/falcon.js").TrackResult>>;
|
|
40
|
+
/** Falcon: worldwide military air traffic by region. */
|
|
41
|
+
military(): Promise<ModuleResult<import("./modules/falcon.js").MilResult>>;
|
|
42
|
+
/** Hound: dossier on a company, person or project. */
|
|
43
|
+
dossier(name: string, opts?: HoundOptions): Promise<ModuleResult<import("./modules/hound.js").Dossier>>;
|
|
44
|
+
/** Condor: open natural events (NASA EONET). */
|
|
45
|
+
naturalEvents(days?: number): Promise<ModuleResult<{
|
|
46
|
+
events: (import("./sources/earth.js").EonetEvent & {
|
|
47
|
+
severity: number | null;
|
|
48
|
+
why: string | null;
|
|
49
|
+
})[];
|
|
50
|
+
}>>;
|
|
51
|
+
/** Condor: night-time lights of a place, recent vs baseline. */
|
|
52
|
+
nightLights(place: string, opts?: {
|
|
53
|
+
recentDays?: number;
|
|
54
|
+
baselineDays?: number;
|
|
55
|
+
}): Promise<ModuleResult<import("./modules/condor.js").LightsResult>>;
|
|
56
|
+
/** Condor: true-color satellite image of a place, saved as PNG. */
|
|
57
|
+
satelliteImage(place: string, date?: string, dir?: string): Promise<ModuleResult<{
|
|
58
|
+
place: import("./sources/earth.js").Place;
|
|
59
|
+
date: string;
|
|
60
|
+
file: string | null;
|
|
61
|
+
url: string;
|
|
62
|
+
}>>;
|
|
63
|
+
/** Raven: record a forecast for the first outcome of a Polymarket market. */
|
|
64
|
+
forecast(marketSlug: string, probability: number, rationale?: string): Promise<ModuleResult<Prediction>>;
|
|
65
|
+
/** Raven: automatic forecasts where a market swing is corroborated by another source. */
|
|
66
|
+
autoForecast(): Promise<ModuleResult<{
|
|
67
|
+
created: Prediction[];
|
|
68
|
+
skipped: string[];
|
|
69
|
+
}>>;
|
|
70
|
+
/** Raven: score forecasts whose markets resolved. */
|
|
71
|
+
resolveForecasts(): Promise<ModuleResult<{
|
|
72
|
+
checked: number;
|
|
73
|
+
resolved: Prediction[];
|
|
74
|
+
}>>;
|
|
75
|
+
scoreboard(): Scoreboard;
|
|
76
|
+
forecasts(filter?: 'all' | 'open' | 'resolved', limit?: number): Prediction[];
|
|
77
|
+
getForecast(id: string): Prediction | null;
|
|
78
|
+
/** Tortoise: timestamp all unstamped forecasts on Bitcoin via OpenTimestamps. */
|
|
79
|
+
stampProofs(): Promise<ModuleResult<{
|
|
80
|
+
batch: import("./modules/tortoise.js").Batch | null;
|
|
81
|
+
reason?: string;
|
|
82
|
+
}>>;
|
|
83
|
+
/** Tortoise: verify a forecast's proof down to the Bitcoin block. */
|
|
84
|
+
verifyProof(predictionId: string): Promise<ModuleResult<import("./modules/tortoise.js").Verification>>;
|
|
85
|
+
/** Tortoise: the forecast, its hash, Merkle path and root, for checking without this install. */
|
|
86
|
+
proofBundle(predictionId: string): import("./modules/tortoise.js").ProofBundle;
|
|
87
|
+
/** Tortoise: the standard OpenTimestamps `.ots` file for a forecast's batch, or null before stamping. */
|
|
88
|
+
proofOts(predictionId: string): Buffer<ArrayBufferLike> | null;
|
|
89
|
+
/** Magpie: wallet portfolio, history and risk (EVM or Solana address). */
|
|
90
|
+
wallet(address: string): Promise<ModuleResult<import("./modules/magpie.js").WalletResult>>;
|
|
91
|
+
/** Magpie: token contract risk, DEX pairs and price. On chain "robinhood" this uses Heron's own rules. */
|
|
92
|
+
token(address: string, chain?: string): Promise<ModuleResult<import("./modules/magpie.js").TokenResult>>;
|
|
93
|
+
/** Heron: Robinhood Chain activity, trending pools and new pools with risk flags. */
|
|
94
|
+
robinhood(): Promise<ModuleResult<import("./modules/heron.js").OverviewResult>>;
|
|
95
|
+
/** Heron: everything a Robinhood Chain deployer launched (token or deployer address) and how many tokens died. */
|
|
96
|
+
robinhoodDeployer(address: string): Promise<ModuleResult<import("./modules/heron.js").DeployerProfile>>;
|
|
97
|
+
/** Heron: risk read on a Robinhood Chain token (verification, holder concentration, pool behavior). */
|
|
98
|
+
robinhoodToken(address: string): Promise<ModuleResult<import("./modules/heron.js").RhTokenResult>>;
|
|
99
|
+
/** Condor: geomagnetic storms and solar flares (NOAA SWPC). */
|
|
100
|
+
spaceWeather(days?: number, opts?: {
|
|
101
|
+
nasa?: boolean;
|
|
102
|
+
}): Promise<ModuleResult<import("./modules/sky.js").SpaceWeather>>;
|
|
103
|
+
/** Condor: PM2.5 air quality near a place (OpenAQ). */
|
|
104
|
+
airQuality(place: string): Promise<ModuleResult<import("./modules/sky.js").AirResult>>;
|
|
105
|
+
/** Web search (Tavily, Exa fallback). */
|
|
106
|
+
webSearch(query: string, max?: number): Promise<import("./core/types.js").Sourced<import("./sources/press.js").WebResult[]>>;
|
|
107
|
+
/** Readable text of a web page (Jina Reader, Firecrawl fallback). */
|
|
108
|
+
readPage(url: string): Promise<import("./core/types.js").Sourced<string>>;
|
|
109
|
+
/** Octopus: answer a question in plain language using Oculon's tools and a free-tier LLM. */
|
|
110
|
+
ask(question: string, opts?: {
|
|
111
|
+
maxSteps?: number;
|
|
112
|
+
onStep?: (s: string) => void;
|
|
113
|
+
}): Promise<import("./agent.js").AskResult>;
|
|
114
|
+
/** Narrative tracker: group new headlines into storylines and flag new or fast-growing ones. */
|
|
115
|
+
narrativesRun(): Promise<ModuleResult<{
|
|
116
|
+
added: number;
|
|
117
|
+
created: string[];
|
|
118
|
+
narratives: import("./modules/narratives.js").Narrative[];
|
|
119
|
+
}>>;
|
|
120
|
+
narratives(activeDays?: number): Promise<import("./modules/narratives.js").Narrative[]>;
|
|
121
|
+
/** Company early-warning score (0-100) with each component explained. */
|
|
122
|
+
health(company: string): Promise<ModuleResult<import("./modules/health.js").HealthResult>>;
|
|
123
|
+
/** Disaster impact of current strong quakes and severe storms, or around a named place. */
|
|
124
|
+
impact(place?: string, radiusKm?: number): Promise<ModuleResult<{
|
|
125
|
+
impacts: import("./modules/impact.js").Impact[];
|
|
126
|
+
}>>;
|
|
127
|
+
/** Conflicting factual claims across independent sources on a topic. */
|
|
128
|
+
contradictions(topic: string): Promise<ModuleResult<import("./modules/contradictions.js").ContradictionResult>>;
|
|
129
|
+
/** Replay past days, measure which radar items became news, and tune the radar threshold. */
|
|
130
|
+
calibrate(days?: number): Promise<ModuleResult<import("./modules/calibrate.js").Calibration>>;
|
|
131
|
+
/** Write a self-contained HTML report of the last `days` days; returns the file path. */
|
|
132
|
+
report(days?: number, out?: string): Promise<{
|
|
133
|
+
file: string;
|
|
134
|
+
html: string;
|
|
135
|
+
counts: Record<string, number>;
|
|
136
|
+
}>;
|
|
137
|
+
/** Installed plugins and any that failed to load. */
|
|
138
|
+
plugins(): Promise<{
|
|
139
|
+
plugins: import("./plugins.js").Plugin[];
|
|
140
|
+
errors: string[];
|
|
141
|
+
}>;
|
|
142
|
+
pluginRun(ref: string, args?: Record<string, unknown>): Promise<unknown>;
|
|
143
|
+
/** OFAC sanctions screening: wallet address (plus direct counterparties), vessel IMO, or exact name. */
|
|
144
|
+
sanctions(query: string): Promise<ModuleResult<import("./modules/sanctions.js").ScreenResult>>;
|
|
145
|
+
/** Lynx: Polymarket vs Kalshi and Manifold on the same questions; big verified gaps become signals. */
|
|
146
|
+
markets(opts?: {
|
|
147
|
+
limit?: number;
|
|
148
|
+
minGapPp?: number;
|
|
149
|
+
}): Promise<ModuleResult<import("./modules/lynx.js").LynxResult>>;
|
|
150
|
+
/** Launch Radar: new models, apps, packages, hosts, pages and repos for a company. */
|
|
151
|
+
launches(company: string, opts?: {
|
|
152
|
+
domain?: string;
|
|
153
|
+
org?: string;
|
|
154
|
+
days?: number;
|
|
155
|
+
}): Promise<ModuleResult<import("./modules/launches.js").LaunchResult>>;
|
|
156
|
+
/** Time Machine: what Oculon would have seen on a past date (YYYY-MM-DD). */
|
|
157
|
+
rewind(date: string): Promise<ModuleResult<import("./modules/rewind.js").RewindResult>>;
|
|
158
|
+
/** Geofence: a named box (south, west, north, east) watched for military aircraft/vessels, quakes and events. */
|
|
159
|
+
fenceAdd(name: string, box: [number, number, number, number], kinds?: string[]): import("./modules/fence.js").Fence;
|
|
160
|
+
/** Geofence around a place, `radiusKm` each way. */
|
|
161
|
+
fenceAddAround(name: string, place: string, radiusKm?: number, kinds?: string[]): Promise<import("./modules/fence.js").Fence>;
|
|
162
|
+
fenceList(): import("./modules/fence.js").Fence[];
|
|
163
|
+
fenceRemove(id: number): boolean;
|
|
164
|
+
/** Check every fence and report what is new inside it. */
|
|
165
|
+
fenceCheck(): Promise<{
|
|
166
|
+
checks: import("./modules/fence.js").FenceCheck[];
|
|
167
|
+
signals: Signal[];
|
|
168
|
+
provenance: Provenance[];
|
|
169
|
+
}>;
|
|
170
|
+
/** First to Know: check strong signals against when major media first covered them. */
|
|
171
|
+
scoopsCheck(max?: number): Promise<import("./modules/scoop.js").Scoop[]>;
|
|
172
|
+
/** First to Know scoreboard: how often and by how much Oculon was ahead of the media. */
|
|
173
|
+
scoops(): import("./modules/scoop.js").Scoreboard;
|
|
174
|
+
/** Case Files: open a new investigation, or re-run case `id`. Long-running (about 1-3 minutes). */
|
|
175
|
+
caseInvestigate(input: {
|
|
176
|
+
question?: string;
|
|
177
|
+
id?: number;
|
|
178
|
+
}, opts?: {
|
|
179
|
+
onStep?: (s: string) => void;
|
|
180
|
+
}): Promise<{
|
|
181
|
+
case: import("./cases.js").CaseFile;
|
|
182
|
+
added: import("./cases.js").Finding[];
|
|
183
|
+
signals: Signal[];
|
|
184
|
+
}>;
|
|
185
|
+
caseList(): Promise<import("./cases.js").CaseFile[]>;
|
|
186
|
+
caseGet(id: number): Promise<import("./cases.js").CaseFile | null>;
|
|
187
|
+
caseWatch(id: number, on: boolean): Promise<boolean>;
|
|
188
|
+
/** Falcon at sea: live vessels around a place for `seconds` (aisstream.io). */
|
|
189
|
+
ships(place: string, seconds?: number): Promise<ModuleResult<import("./modules/ships.js").ShipsResult>>;
|
|
190
|
+
/** Falcon at sea: follow one ship by MMSI for up to `seconds`. */
|
|
191
|
+
ship(mmsi: string, seconds?: number): Promise<ModuleResult<import("./modules/ships.js").ShipTrack>>;
|
|
192
|
+
/** Meerkat: add a watchlist target (company, domain, wallet, token, plane, topic, lights, air). */
|
|
193
|
+
watchAdd(kind: string, target: string, label?: string): import("./modules/meerkat.js").WatchItem;
|
|
194
|
+
watchList(): import("./modules/meerkat.js").WatchItem[];
|
|
195
|
+
watchRemove(id: number): boolean;
|
|
196
|
+
/** Meerkat: re-check every watch item and report what changed since last time. */
|
|
197
|
+
watchRun(ids?: number[]): Promise<{
|
|
198
|
+
runs: import("./modules/meerkat.js").WatchRun[];
|
|
199
|
+
signals: Signal[];
|
|
200
|
+
}>;
|
|
201
|
+
/** Monitor in plain language: "internet outages in Iran" becomes a watch rule that alerts on changes. */
|
|
202
|
+
monitor(text: string): Promise<{
|
|
203
|
+
item: import("./modules/meerkat.js").WatchItem;
|
|
204
|
+
rule: import("./modules/monitor.js").MonitorRule;
|
|
205
|
+
method: string;
|
|
206
|
+
}>;
|
|
207
|
+
/** Read a monitoring sentence into a rule without saving it. */
|
|
208
|
+
monitorParse(text: string): Promise<import("./modules/monitor.js").MonitorRule & {
|
|
209
|
+
method: string;
|
|
210
|
+
}>;
|
|
211
|
+
/** Is a link dangerous? Safe Browsing, URLhaus, urlscan.io history, domain age and URL heuristics. */
|
|
212
|
+
urlCheck(url: string): Promise<ModuleResult<import("./modules/urlcheck.js").UrlCheck>>;
|
|
213
|
+
/** Dependency audit of package.json, requirements.txt or "npm:name@version" items (deps.dev, OpenSSF Scorecard). */
|
|
214
|
+
audit(manifest: string, opts?: {
|
|
215
|
+
max?: number;
|
|
216
|
+
}): Promise<ModuleResult<import("./modules/audit.js").AuditResult>>;
|
|
217
|
+
/** Fact check a claim or a news link against published fact checks and current reporting. */
|
|
218
|
+
factCheck(claimOrUrl: string): Promise<ModuleResult<import("./modules/factcheck.js").FactCheckResult>>;
|
|
219
|
+
/** Travel risk brief for a place: official advice, weather, air, outbreaks, hazards, quakes and outages. */
|
|
220
|
+
travel(place: string, opts?: {
|
|
221
|
+
fires?: boolean;
|
|
222
|
+
}): Promise<ModuleResult<import("./modules/travel.js").TravelBrief>>;
|
|
223
|
+
/** Recalls for a VIN, "year make model", or a product (NHTSA, CPSC, FDA). */
|
|
224
|
+
recall(query: string): Promise<ModuleResult<import("./modules/recall.js").RecallResult>>;
|
|
225
|
+
/** Can someone spoof email from this domain? SPF, DMARC, DKIM, MTA-STS, DNSSEC, with fixes. */
|
|
226
|
+
emailSecurity(domain: string): Promise<ModuleResult<import("./modules/emailsec.js").EmailSecurity>>;
|
|
227
|
+
/** Research brief: most cited and newest papers on a topic, growth per year, an overview with citations. */
|
|
228
|
+
papers(topic: string, opts?: {
|
|
229
|
+
years?: number;
|
|
230
|
+
}): Promise<ModuleResult<import("./modules/papers.js").PapersResult>>;
|
|
231
|
+
/** Country brief: economy, leaders, currency, IMF outlook, travel advice, outages, disasters, headlines. */
|
|
232
|
+
country(name: string): Promise<ModuleResult<import("./modules/country.js").CountryBrief>>;
|
|
233
|
+
/** Is this message a scam? Checks its links, sender domain and known scam patterns. */
|
|
234
|
+
scamCheck(message: string): Promise<ModuleResult<import("./modules/scam.js").ScamCheck>>;
|
|
235
|
+
/** Airport status: METAR and TAF, FAA delays and ground stops (US), emergency squawks nearby. */
|
|
236
|
+
airport(code: string): Promise<ModuleResult<import("./modules/airport.js").AirportStatus>>;
|
|
237
|
+
/** Today's brief (stored once per day; refresh to rewrite). */
|
|
238
|
+
brief(opts?: {
|
|
239
|
+
refresh?: boolean;
|
|
240
|
+
lang?: string;
|
|
241
|
+
}): Promise<import("./modules/brief.js").Brief>;
|
|
242
|
+
/** Today's API usage against the free-tier budgets. */
|
|
243
|
+
quota(): {
|
|
244
|
+
source: string;
|
|
245
|
+
used: number;
|
|
246
|
+
budget: number | null;
|
|
247
|
+
}[];
|
|
248
|
+
/** Most recent signals from every module. */
|
|
249
|
+
signals(limit?: number): Signal[];
|
|
250
|
+
/** An entity and its neighbors in the graph, e.g. "domain:openai.com". */
|
|
251
|
+
entity(id: string): {
|
|
252
|
+
entity: Entity | undefined;
|
|
253
|
+
neighbors: Neighbor[];
|
|
254
|
+
};
|
|
255
|
+
/** Social pulse: recent posts about a subject on X, Reddit, TikTok (Apify) and Bluesky, with pace and top posts. */
|
|
256
|
+
pulse(query: string, platforms?: Platform[]): Promise<ModuleResult<import("./modules/pulse.js").Pulse>>;
|
|
257
|
+
/** Listen: transcribe a public audio or video file (Deepgram), with summary, topics and passages about `subject`. */
|
|
258
|
+
listen(url: string, subject?: string): Promise<ModuleResult<import("./modules/listen.js").Transcript | null>>;
|
|
259
|
+
/** Recent podcast episodes about a subject; transcribes episode number `pick` (default: newest English one). */
|
|
260
|
+
podcast(subject: string, pick?: number): Promise<ModuleResult<{
|
|
261
|
+
episodes: import("./modules/listen.js").Episode[];
|
|
262
|
+
transcript: import("./modules/listen.js").Transcript | null;
|
|
263
|
+
picked: import("./modules/listen.js").Episode | null;
|
|
264
|
+
}>>;
|
|
265
|
+
/** Exposure: open ports, software and known CVEs on a domain's machines (Shodan InternetDB, free). */
|
|
266
|
+
exposure(domain: string): Promise<ModuleResult<import("./modules/exposure.js").Exposure>>;
|
|
267
|
+
/** Blackout radar: internet outages by country and network (Cloudflare Radar, IODA). */
|
|
268
|
+
blackout(days?: number): Promise<ModuleResult<import("./modules/blackout.js").Blackout>>;
|
|
269
|
+
/** Official orange and red disaster alerts (GDACS). */
|
|
270
|
+
hazards(days?: number): Promise<ModuleResult<import("./modules/hazards.js").Hazard[] & {
|
|
271
|
+
bulletins?: import("./modules/hazards.js").Bulletin[];
|
|
272
|
+
}>>;
|
|
273
|
+
/** Vessels that switched off AIS near a place (Global Fishing Watch). */
|
|
274
|
+
darkShips(place: string, days?: number): Promise<ModuleResult<import("./modules/darkships.js").DarkShips>>;
|
|
275
|
+
/** Vessel identity by name, MMSI or IMO: flag, type, owners, earlier names, OFAC check. */
|
|
276
|
+
vessel(query: string): Promise<ModuleResult<import("./modules/darkships.js").VesselIdentity[]>>;
|
|
277
|
+
/** Sentinel-2 (10 m) or Sentinel-1 radar image of a place from Copernicus; optional before/after pair. */
|
|
278
|
+
sentinel(place: string, opts?: {
|
|
279
|
+
date?: string;
|
|
280
|
+
days?: number;
|
|
281
|
+
kind?: 'optical' | 'radar';
|
|
282
|
+
compareTo?: string;
|
|
283
|
+
}): Promise<ModuleResult<{
|
|
284
|
+
shots: import("./modules/condor.js").SentinelShot[];
|
|
285
|
+
}>>;
|
|
286
|
+
/** Active fires and thermal hotspots near a place (NASA FIRMS, VIIRS). */
|
|
287
|
+
fires(place: string, days?: number): Promise<ModuleResult<import("./modules/fires.js").Fires>>;
|
|
288
|
+
/** Outages on the platforms the internet runs on: status pages of major services, AWS, Azure, Google Cloud. */
|
|
289
|
+
cloud(): Promise<ModuleResult<import("./modules/cloud.js").CloudStatus>>;
|
|
290
|
+
/**
|
|
291
|
+
* BGP: a country (two-letter code), a network (AS number), an IP address, or "world" for global hijacks,
|
|
292
|
+
* route leaks and DDoS target countries (RIPEstat, Cloudflare Radar).
|
|
293
|
+
*/
|
|
294
|
+
bgp(resource?: string, days?: number): Promise<ModuleResult<import("./modules/bgp.js").BgpResult>>;
|
|
295
|
+
/** Vulnerabilities newly exploited in the wild (CISA KEV), new critical CVEs (NVD) and advisories (GitHub). */
|
|
296
|
+
vulns(opts?: {
|
|
297
|
+
days?: number;
|
|
298
|
+
vendor?: string;
|
|
299
|
+
}): Promise<ModuleResult<import("./modules/vulns.js").VulnsResult>>;
|
|
300
|
+
/** One CVE in depth: CVSS, EPSS trend, KEV status, affected packages and fixes. */
|
|
301
|
+
cve(id: string): Promise<ModuleResult<import("./modules/vulns.js").CveDetail>>;
|
|
302
|
+
/** Known vulnerabilities of a package version (OSV.dev), flagged when exploited in the wild. */
|
|
303
|
+
packageVulns(ecosystem: string, name: string, version?: string): Promise<ModuleResult<{
|
|
304
|
+
ecosystem: string;
|
|
305
|
+
name: string;
|
|
306
|
+
version: string | null;
|
|
307
|
+
vulns: import("./modules/vulns.js").PackageVuln[];
|
|
308
|
+
}>>;
|
|
309
|
+
/** US Federal Register: executive orders, rules, proposed rules and tomorrow's documents (public inspection). */
|
|
310
|
+
regs(opts?: Parameters<typeof regs>[1]): Promise<ModuleResult<import("./modules/regs.js").RegsResult>>;
|
|
311
|
+
/** DeFi risk radar: TVL crashes, stablecoin depegs, hacks, chain moves, fear and greed (DefiLlama, alternative.me). */
|
|
312
|
+
defi(): Promise<ModuleResult<import("./modules/defi.js").DefiOverview>>;
|
|
313
|
+
/** One DeFi protocol in depth: TVL trend and drawdown, audits, hacks, funding, warnings. */
|
|
314
|
+
protocol(name: string): Promise<ModuleResult<import("./modules/defi.js").ProtocolDetail | null>>;
|
|
315
|
+
/** Aircraft squawking emergency codes right now: 7500 hijack, 7600 radio failure, 7700 emergency. */
|
|
316
|
+
squawks(): Promise<ModuleResult<import("./modules/squawk.js").Squawks>>;
|
|
317
|
+
/** SEC EDGAR full-text search across filings, e.g. "cybersecurity incident" in 8-Ks. */
|
|
318
|
+
filings(query: string, opts?: {
|
|
319
|
+
forms?: string[];
|
|
320
|
+
days?: number;
|
|
321
|
+
}): Promise<ModuleResult<import("./modules/filings.js").FilingsResult>>;
|
|
322
|
+
/** A company's recent 8-K events decoded into plain English (restatements, CEO exits, cyber incidents...). */
|
|
323
|
+
secEvents(tickerOrCik: string, days?: number): Promise<ModuleResult<import("./modules/filings.js").RecentEvents>>;
|
|
324
|
+
/** Catalyst calendar: earnings, key macro releases and prediction markets closing in the next `days`. */
|
|
325
|
+
calendar(days?: number): Promise<ModuleResult<import("./modules/calendar.js").Calendar>>;
|
|
326
|
+
/** Link nodes that are the same real thing (org:nvidia, company:nvidia, domain:nvidia.com). */
|
|
327
|
+
resolveEntities(): import("./modules/connect.js").ResolveResult;
|
|
328
|
+
/** Shortest path between two things in the graph: "how is A connected to B". */
|
|
329
|
+
connect(a: string, b: string, maxDepth?: number): import("./modules/connect.js").ConnectResult;
|
|
330
|
+
/** Record a Useful/Noise vote on a signal; it moves that module's alert bar. */
|
|
331
|
+
feedback(signalId: string, verdict: Verdict, voter?: string): {
|
|
332
|
+
module: string;
|
|
333
|
+
title: string;
|
|
334
|
+
} | null;
|
|
335
|
+
feedbackStats(): import("./modules/feedback.js").ModuleFeedback[];
|
|
336
|
+
/** Start the live Wikipedia + Bluesky stream listeners. Call stop() on the result to end them. */
|
|
337
|
+
live(opts?: import('./live.js').LiveOptions): Promise<import("./live.js").LiveMonitor>;
|
|
338
|
+
close(): void;
|
|
339
|
+
}
|
|
340
|
+
/** Collapse provenance into per-source status counts plus distinct notes. Handy for compact output. */
|
|
341
|
+
export declare function summarizeProvenance(provenance: Provenance[]): {
|
|
342
|
+
sources: Record<string, Record<string, number>>;
|
|
343
|
+
notes: string[];
|
|
344
|
+
};
|
|
345
|
+
export type { ModuleResult, Provenance, Signal, Prediction, Scoreboard, Entity, Neighbor };
|
|
346
|
+
export type { Evidence, Status } from './core/types.js';
|