oculon 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +344 -2
  3. package/dist/agent.d.ts +47 -0
  4. package/dist/agent.js +104 -0
  5. package/dist/cases.d.ts +68 -0
  6. package/dist/cases.js +158 -0
  7. package/dist/cli/main.d.ts +12 -0
  8. package/dist/cli/main.js +1999 -0
  9. package/dist/cli.d.ts +2 -0
  10. package/dist/cli.js +15 -0
  11. package/dist/core/context.d.ts +19 -0
  12. package/dist/core/context.js +19 -0
  13. package/dist/core/features.d.ts +22 -0
  14. package/dist/core/features.js +28 -0
  15. package/dist/core/graph.d.ts +38 -0
  16. package/dist/core/graph.js +81 -0
  17. package/dist/core/http.d.ts +42 -0
  18. package/dist/core/http.js +266 -0
  19. package/dist/core/keys.d.ts +8 -0
  20. package/dist/core/keys.js +22 -0
  21. package/dist/core/llm.d.ts +93 -0
  22. package/dist/core/llm.js +180 -0
  23. package/dist/core/merkle.d.ts +15 -0
  24. package/dist/core/merkle.js +46 -0
  25. package/dist/core/paths.d.ts +2 -0
  26. package/dist/core/paths.js +6 -0
  27. package/dist/core/png.d.ts +17 -0
  28. package/dist/core/png.js +101 -0
  29. package/dist/core/quota.d.ts +15 -0
  30. package/dist/core/quota.js +90 -0
  31. package/dist/core/stats.d.ts +24 -0
  32. package/dist/core/stats.js +67 -0
  33. package/dist/core/store.d.ts +20 -0
  34. package/dist/core/store.js +213 -0
  35. package/dist/core/text.d.ts +9 -0
  36. package/dist/core/text.js +30 -0
  37. package/dist/core/types.d.ts +38 -0
  38. package/dist/core/types.js +1 -0
  39. package/dist/index.d.ts +342 -0
  40. package/dist/index.js +495 -0
  41. package/dist/live.d.ts +53 -0
  42. package/dist/live.js +236 -0
  43. package/dist/mcp.d.ts +43 -0
  44. package/dist/mcp.js +651 -0
  45. package/dist/modules/airport.d.ts +60 -0
  46. package/dist/modules/airport.js +111 -0
  47. package/dist/modules/audit.d.ts +73 -0
  48. package/dist/modules/audit.js +211 -0
  49. package/dist/modules/bgp.d.ts +147 -0
  50. package/dist/modules/bgp.js +206 -0
  51. package/dist/modules/blackout.d.ts +41 -0
  52. package/dist/modules/blackout.js +98 -0
  53. package/dist/modules/brief.d.ts +26 -0
  54. package/dist/modules/brief.js +99 -0
  55. package/dist/modules/calendar.d.ts +27 -0
  56. package/dist/modules/calendar.js +145 -0
  57. package/dist/modules/calibrate.d.ts +46 -0
  58. package/dist/modules/calibrate.js +92 -0
  59. package/dist/modules/cloud.d.ts +32 -0
  60. package/dist/modules/cloud.js +94 -0
  61. package/dist/modules/condor.d.ts +66 -0
  62. package/dist/modules/condor.js +214 -0
  63. package/dist/modules/connect.d.ts +47 -0
  64. package/dist/modules/connect.js +114 -0
  65. package/dist/modules/contradictions.d.ts +27 -0
  66. package/dist/modules/contradictions.js +76 -0
  67. package/dist/modules/country.d.ts +82 -0
  68. package/dist/modules/country.js +136 -0
  69. package/dist/modules/cricket.d.ts +34 -0
  70. package/dist/modules/cricket.js +166 -0
  71. package/dist/modules/darkships.d.ts +219 -0
  72. package/dist/modules/darkships.js +400 -0
  73. package/dist/modules/defi.d.ts +237 -0
  74. package/dist/modules/defi.js +512 -0
  75. package/dist/modules/emailsec.d.ts +47 -0
  76. package/dist/modules/emailsec.js +146 -0
  77. package/dist/modules/exposure.d.ts +43 -0
  78. package/dist/modules/exposure.js +89 -0
  79. package/dist/modules/factcheck.d.ts +39 -0
  80. package/dist/modules/factcheck.js +127 -0
  81. package/dist/modules/falcon.d.ts +58 -0
  82. package/dist/modules/falcon.js +219 -0
  83. package/dist/modules/feedback.d.ts +24 -0
  84. package/dist/modules/feedback.js +37 -0
  85. package/dist/modules/fence.d.ts +52 -0
  86. package/dist/modules/fence.js +128 -0
  87. package/dist/modules/ferret.d.ts +47 -0
  88. package/dist/modules/ferret.js +220 -0
  89. package/dist/modules/filings.d.ts +86 -0
  90. package/dist/modules/filings.js +166 -0
  91. package/dist/modules/fires.d.ts +56 -0
  92. package/dist/modules/fires.js +150 -0
  93. package/dist/modules/hazards.d.ts +37 -0
  94. package/dist/modules/hazards.js +83 -0
  95. package/dist/modules/health.d.ts +24 -0
  96. package/dist/modules/health.js +82 -0
  97. package/dist/modules/heron.d.ts +68 -0
  98. package/dist/modules/heron.js +184 -0
  99. package/dist/modules/hound.d.ts +100 -0
  100. package/dist/modules/hound.js +301 -0
  101. package/dist/modules/impact.d.ts +39 -0
  102. package/dist/modules/impact.js +63 -0
  103. package/dist/modules/launches.d.ts +24 -0
  104. package/dist/modules/launches.js +61 -0
  105. package/dist/modules/listen.d.ts +48 -0
  106. package/dist/modules/listen.js +125 -0
  107. package/dist/modules/lynx.d.ts +43 -0
  108. package/dist/modules/lynx.js +127 -0
  109. package/dist/modules/magpie.d.ts +70 -0
  110. package/dist/modules/magpie.js +174 -0
  111. package/dist/modules/meerkat.d.ts +42 -0
  112. package/dist/modules/meerkat.js +293 -0
  113. package/dist/modules/monitor.d.ts +27 -0
  114. package/dist/modules/monitor.js +105 -0
  115. package/dist/modules/narratives.d.ts +33 -0
  116. package/dist/modules/narratives.js +136 -0
  117. package/dist/modules/owl.d.ts +71 -0
  118. package/dist/modules/owl.js +290 -0
  119. package/dist/modules/papers.d.ts +46 -0
  120. package/dist/modules/papers.js +135 -0
  121. package/dist/modules/personal.d.ts +54 -0
  122. package/dist/modules/personal.js +153 -0
  123. package/dist/modules/pulse.d.ts +19 -0
  124. package/dist/modules/pulse.js +59 -0
  125. package/dist/modules/raven.d.ts +80 -0
  126. package/dist/modules/raven.js +147 -0
  127. package/dist/modules/recall.d.ts +44 -0
  128. package/dist/modules/recall.js +123 -0
  129. package/dist/modules/regs.d.ts +88 -0
  130. package/dist/modules/regs.js +142 -0
  131. package/dist/modules/rewind.d.ts +22 -0
  132. package/dist/modules/rewind.js +68 -0
  133. package/dist/modules/sanctions.d.ts +62 -0
  134. package/dist/modules/sanctions.js +173 -0
  135. package/dist/modules/scam.d.ts +43 -0
  136. package/dist/modules/scam.js +111 -0
  137. package/dist/modules/scoop.d.ts +31 -0
  138. package/dist/modules/scoop.js +74 -0
  139. package/dist/modules/ships.d.ts +33 -0
  140. package/dist/modules/ships.js +113 -0
  141. package/dist/modules/sky.d.ts +47 -0
  142. package/dist/modules/sky.js +183 -0
  143. package/dist/modules/squawk.d.ts +46 -0
  144. package/dist/modules/squawk.js +106 -0
  145. package/dist/modules/tortoise.d.ts +40 -0
  146. package/dist/modules/tortoise.js +104 -0
  147. package/dist/modules/travel.d.ts +94 -0
  148. package/dist/modules/travel.js +241 -0
  149. package/dist/modules/urlcheck.d.ts +63 -0
  150. package/dist/modules/urlcheck.js +223 -0
  151. package/dist/modules/vulns.d.ts +142 -0
  152. package/dist/modules/vulns.js +276 -0
  153. package/dist/plugins.d.ts +41 -0
  154. package/dist/plugins.js +70 -0
  155. package/dist/report.d.ts +12 -0
  156. package/dist/report.js +90 -0
  157. package/dist/scheduler.d.ts +22 -0
  158. package/dist/scheduler.js +139 -0
  159. package/dist/sources/aircraft.d.ts +76 -0
  160. package/dist/sources/aircraft.js +107 -0
  161. package/dist/sources/airports.d.ts +28 -0
  162. package/dist/sources/airports.js +100 -0
  163. package/dist/sources/ais.d.ts +32 -0
  164. package/dist/sources/ais.js +111 -0
  165. package/dist/sources/apify.d.ts +28 -0
  166. package/dist/sources/apify.js +80 -0
  167. package/dist/sources/arxiv.d.ts +13 -0
  168. package/dist/sources/arxiv.js +27 -0
  169. package/dist/sources/certs.d.ts +12 -0
  170. package/dist/sources/certs.js +23 -0
  171. package/dist/sources/corp.d.ts +46 -0
  172. package/dist/sources/corp.js +60 -0
  173. package/dist/sources/earth.d.ts +39 -0
  174. package/dist/sources/earth.js +76 -0
  175. package/dist/sources/fda.d.ts +77 -0
  176. package/dist/sources/fda.js +121 -0
  177. package/dist/sources/finance.d.ts +181 -0
  178. package/dist/sources/finance.js +270 -0
  179. package/dist/sources/gdelt.d.ts +19 -0
  180. package/dist/sources/gdelt.js +33 -0
  181. package/dist/sources/github.d.ts +17 -0
  182. package/dist/sources/github.js +33 -0
  183. package/dist/sources/hackernews.d.ts +20 -0
  184. package/dist/sources/hackernews.js +37 -0
  185. package/dist/sources/labels.d.ts +21 -0
  186. package/dist/sources/labels.js +87 -0
  187. package/dist/sources/launch.d.ts +16 -0
  188. package/dist/sources/launch.js +41 -0
  189. package/dist/sources/ofac.d.ts +29 -0
  190. package/dist/sources/ofac.js +86 -0
  191. package/dist/sources/onchain.d.ts +77 -0
  192. package/dist/sources/onchain.js +189 -0
  193. package/dist/sources/opentimestamps.d.ts +44 -0
  194. package/dist/sources/opentimestamps.js +131 -0
  195. package/dist/sources/polymarket.d.ts +36 -0
  196. package/dist/sources/polymarket.js +70 -0
  197. package/dist/sources/predict.d.ts +18 -0
  198. package/dist/sources/predict.js +59 -0
  199. package/dist/sources/press.d.ts +30 -0
  200. package/dist/sources/press.js +111 -0
  201. package/dist/sources/resend.d.ts +14 -0
  202. package/dist/sources/resend.js +29 -0
  203. package/dist/sources/robinhood.d.ts +109 -0
  204. package/dist/sources/robinhood.js +129 -0
  205. package/dist/sources/sec.d.ts +67 -0
  206. package/dist/sources/sec.js +129 -0
  207. package/dist/sources/sentinel.d.ts +13 -0
  208. package/dist/sources/sentinel.js +63 -0
  209. package/dist/sources/signatures.d.ts +14 -0
  210. package/dist/sources/signatures.js +103 -0
  211. package/dist/sources/social.d.ts +22 -0
  212. package/dist/sources/social.js +56 -0
  213. package/dist/sources/space.d.ts +160 -0
  214. package/dist/sources/space.js +230 -0
  215. package/dist/sources/usgs.d.ts +17 -0
  216. package/dist/sources/usgs.js +24 -0
  217. package/dist/sources/wayback.d.ts +10 -0
  218. package/dist/sources/wayback.js +28 -0
  219. package/dist/sources/websec.d.ts +19 -0
  220. package/dist/sources/websec.js +40 -0
  221. package/dist/sources/wikidata.d.ts +11 -0
  222. package/dist/sources/wikidata.js +30 -0
  223. package/dist/sources/wikimedia.d.ts +28 -0
  224. package/dist/sources/wikimedia.js +52 -0
  225. package/dist/telegram.d.ts +104 -0
  226. package/dist/telegram.js +927 -0
  227. package/dist/web/assets/favicon-32.png +0 -0
  228. package/dist/web/assets/fx.js +178 -0
  229. package/dist/web/assets/icon-192.png +0 -0
  230. package/dist/web/assets/icon-512.png +0 -0
  231. package/dist/web/assets/icon-maskable-512.png +0 -0
  232. package/dist/web/assets/night-americas.jpg +0 -0
  233. package/dist/web/assets/night-emea.jpg +0 -0
  234. package/dist/web/assets/og.png +0 -0
  235. package/dist/web/assets/redsea-bm.jpg +0 -0
  236. package/dist/web/docs.html +263 -0
  237. package/dist/web/index.html +1828 -0
  238. package/dist/web/insights.d.ts +100 -0
  239. package/dist/web/insights.js +134 -0
  240. package/dist/web/landing.html +1143 -0
  241. package/dist/web/legal.html +176 -0
  242. package/dist/web/manifest.webmanifest +20 -0
  243. package/dist/web/mcp.html +104 -0
  244. package/dist/web/mcphttp.d.ts +10 -0
  245. package/dist/web/mcphttp.js +67 -0
  246. package/dist/web/openapi.d.ts +1 -0
  247. package/dist/web/openapi.js +51 -0
  248. package/dist/web/public.d.ts +45 -0
  249. package/dist/web/public.js +135 -0
  250. package/dist/web/server.d.ts +69 -0
  251. package/dist/web/server.js +750 -0
  252. package/dist/web/share.d.ts +35 -0
  253. package/dist/web/share.js +132 -0
  254. package/dist/web/sw.js +28 -0
  255. package/package.json +60 -4
package/dist/index.js ADDED
@@ -0,0 +1,495 @@
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 { createContext } from './core/context.js';
14
+ import { setPaidQuota } from './core/llm.js';
15
+ import { takeQuota } from './core/quota.js';
16
+ import { catalysts } from './modules/calendar.js';
17
+ import { pulse } from './modules/pulse.js';
18
+ import { exposure } from './modules/exposure.js';
19
+ import { blackout } from './modules/blackout.js';
20
+ import { hazards } from './modules/hazards.js';
21
+ import { fires } from './modules/fires.js';
22
+ import { cloudStatus } from './modules/cloud.js';
23
+ import { bgp } from './modules/bgp.js';
24
+ import { cve, packageVulns, vulns } from './modules/vulns.js';
25
+ import { regs } from './modules/regs.js';
26
+ import { defi, protocol } from './modules/defi.js';
27
+ import { squawks } from './modules/squawk.js';
28
+ import { filings, recentEvents } from './modules/filings.js';
29
+ import { darkShips, vesselIdentity } from './modules/darkships.js';
30
+ import { podcast, transcribe } from './modules/listen.js';
31
+ import { connect, resolveEntities } from './modules/connect.js';
32
+ import { feedbackStats, recordFeedback } from './modules/feedback.js';
33
+ import { events, lights, snapshot } from './modules/condor.js';
34
+ import { cricket } from './modules/cricket.js';
35
+ import { mil, track } from './modules/falcon.js';
36
+ import { ferret } from './modules/ferret.js';
37
+ import { hound } from './modules/hound.js';
38
+ import { owl } from './modules/owl.js';
39
+ import { auto, getPrediction, listPredictions, predict, resolve, scoreboard } from './modules/raven.js';
40
+ import { stamp, verify } from './modules/tortoise.js';
41
+ import { token, wallet } from './modules/magpie.js';
42
+ import { deployerProfile, overview, rhTokenCheck } from './modules/heron.js';
43
+ import { addWatch, listWatch, removeWatch, runWatch } from './modules/meerkat.js';
44
+ import { makeBrief } from './modules/brief.js';
45
+ import { shipsNear, shipTrack } from './modules/ships.js';
46
+ import { checkScoops, scoreboard as scoopBoard } from './modules/scoop.js';
47
+ import { addFence, boxAround, checkFences, listFences, removeFence } from './modules/fence.js';
48
+ import { lynx } from './modules/lynx.js';
49
+ import { screen } from './modules/sanctions.js';
50
+ import { launches } from './modules/launches.js';
51
+ import { rewind } from './modules/rewind.js';
52
+ import { quotaUsage } from './core/quota.js';
53
+ import { air, spaceWeather } from './modules/sky.js';
54
+ import { readPage, webSearch } from './sources/press.js';
55
+ import { urlCheck } from './modules/urlcheck.js';
56
+ import { audit } from './modules/audit.js';
57
+ import { factCheck } from './modules/factcheck.js';
58
+ import { travel } from './modules/travel.js';
59
+ import { addMonitor, parseMonitor } from './modules/monitor.js';
60
+ import { recall } from './modules/recall.js';
61
+ import { emailSecurity } from './modules/emailsec.js';
62
+ import { papers } from './modules/papers.js';
63
+ import { countryBrief } from './modules/country.js';
64
+ import { airportStatus } from './modules/airport.js';
65
+ import { scamCheck } from './modules/scam.js';
66
+ export class Oculon {
67
+ ctx;
68
+ constructor(opts = {}) {
69
+ if (opts.contact)
70
+ process.env.OCULON_CONTACT = opts.contact;
71
+ if (opts.githubToken)
72
+ process.env.GITHUB_TOKEN = opts.githubToken;
73
+ this.ctx = createContext(opts);
74
+ // Paid LLM calls count against a daily budget in this install's database.
75
+ setPaidQuota((source) => takeQuota(this.ctx.store, source));
76
+ }
77
+ /** Owl: what the world is suddenly paying attention to, fused across sources. */
78
+ radar(opts) {
79
+ return owl(this.ctx, opts);
80
+ }
81
+ /** Ferret: pre-release footprints of a domain (new hostnames, pages, repos). */
82
+ footprint(domain, opts) {
83
+ return ferret(this.ctx, domain, opts);
84
+ }
85
+ /** Cricket: hype phase of a topic across readers, developers, news, research, builders. */
86
+ hype(topic) {
87
+ return cricket(this.ctx, topic);
88
+ }
89
+ /** Falcon: one aircraft by registration or ICAO hex. */
90
+ aircraft(query) {
91
+ return track(this.ctx, query);
92
+ }
93
+ /** Falcon: worldwide military air traffic by region. */
94
+ military() {
95
+ return mil(this.ctx);
96
+ }
97
+ /** Hound: dossier on a company, person or project. */
98
+ dossier(name, opts) {
99
+ return hound(this.ctx, name, opts);
100
+ }
101
+ /** Condor: open natural events (NASA EONET). */
102
+ naturalEvents(days) {
103
+ return events(this.ctx, days);
104
+ }
105
+ /** Condor: night-time lights of a place, recent vs baseline. */
106
+ nightLights(place, opts) {
107
+ return lights(this.ctx, place, opts);
108
+ }
109
+ /** Condor: true-color satellite image of a place, saved as PNG. */
110
+ satelliteImage(place, date, dir) {
111
+ return snapshot(this.ctx, place, date, dir);
112
+ }
113
+ /** Raven: record a forecast for the first outcome of a Polymarket market. */
114
+ forecast(marketSlug, probability, rationale) {
115
+ return predict(this.ctx, marketSlug, probability, rationale);
116
+ }
117
+ /** Raven: automatic forecasts where a market swing is corroborated by another source. */
118
+ autoForecast() {
119
+ return auto(this.ctx);
120
+ }
121
+ /** Raven: score forecasts whose markets resolved. */
122
+ resolveForecasts() {
123
+ return resolve(this.ctx);
124
+ }
125
+ scoreboard() {
126
+ return scoreboard(this.ctx);
127
+ }
128
+ forecasts(filter = 'all', limit = 100) {
129
+ return listPredictions(this.ctx, filter, limit);
130
+ }
131
+ getForecast(id) {
132
+ return getPrediction(this.ctx, id);
133
+ }
134
+ /** Tortoise: timestamp all unstamped forecasts on Bitcoin via OpenTimestamps. */
135
+ stampProofs() {
136
+ return stamp(this.ctx);
137
+ }
138
+ /** Tortoise: verify a forecast's proof down to the Bitcoin block. */
139
+ verifyProof(predictionId) {
140
+ return verify(this.ctx, predictionId);
141
+ }
142
+ /** Magpie: wallet portfolio, history and risk (EVM or Solana address). */
143
+ wallet(address) {
144
+ return wallet(this.ctx, address);
145
+ }
146
+ /** Magpie: token contract risk, DEX pairs and price. On chain "robinhood" this uses Heron's own rules. */
147
+ token(address, chain = 'eth') {
148
+ return token(this.ctx, address, chain);
149
+ }
150
+ /** Heron: Robinhood Chain activity, trending pools and new pools with risk flags. */
151
+ robinhood() {
152
+ return overview(this.ctx);
153
+ }
154
+ /** Heron: everything a Robinhood Chain deployer launched (token or deployer address) and how many tokens died. */
155
+ robinhoodDeployer(address) {
156
+ return deployerProfile(this.ctx, address);
157
+ }
158
+ /** Heron: risk read on a Robinhood Chain token (verification, holder concentration, pool behavior). */
159
+ robinhoodToken(address) {
160
+ return rhTokenCheck(this.ctx, address);
161
+ }
162
+ /** Condor: geomagnetic storms and solar flares (NOAA SWPC). */
163
+ spaceWeather(days = 7, opts = {}) {
164
+ return spaceWeather(this.ctx, days, opts);
165
+ }
166
+ /** Condor: PM2.5 air quality near a place (OpenAQ). */
167
+ airQuality(place) {
168
+ return air(this.ctx, place);
169
+ }
170
+ /** Web search (Tavily, Exa fallback). */
171
+ webSearch(query, max = 6) {
172
+ return webSearch(this.ctx, query, max);
173
+ }
174
+ /** Readable text of a web page (Jina Reader, Firecrawl fallback). */
175
+ readPage(url) {
176
+ return readPage(this.ctx, url);
177
+ }
178
+ /** Octopus: answer a question in plain language using Oculon's tools and a free-tier LLM. */
179
+ async ask(question, opts) {
180
+ const { ask } = await import('./agent.js');
181
+ return ask(this, question, opts);
182
+ }
183
+ /** Narrative tracker: group new headlines into storylines and flag new or fast-growing ones. */
184
+ async narrativesRun() {
185
+ return (await import('./modules/narratives.js')).runNarratives(this.ctx);
186
+ }
187
+ async narratives(activeDays = 14) {
188
+ return (await import('./modules/narratives.js')).listNarratives(this.ctx, activeDays);
189
+ }
190
+ /** Company early-warning score (0-100) with each component explained. */
191
+ async health(company) {
192
+ return (await import('./modules/health.js')).health(this.ctx, company);
193
+ }
194
+ /** Disaster impact of current strong quakes and severe storms, or around a named place. */
195
+ async impact(place, radiusKm = 50) {
196
+ const m = await import('./modules/impact.js');
197
+ if (!place)
198
+ return m.impact(this.ctx);
199
+ const { geocode } = await import('./sources/earth.js');
200
+ const g = await geocode(this.ctx, place);
201
+ const p = g.data?.[0];
202
+ if (!p)
203
+ throw new Error(`place not found: ${place}`);
204
+ return m.impact(this.ctx, { place: { name: p.name, lat: p.lat, lon: p.lon }, radiusKm });
205
+ }
206
+ /** Conflicting factual claims across independent sources on a topic. */
207
+ async contradictions(topic) {
208
+ return (await import('./modules/contradictions.js')).contradictions(this.ctx, topic);
209
+ }
210
+ /** Replay past days, measure which radar items became news, and tune the radar threshold. */
211
+ async calibrate(days = 10) {
212
+ return (await import('./modules/calibrate.js')).calibrate(this.ctx, { days });
213
+ }
214
+ /** Write a self-contained HTML report of the last `days` days; returns the file path. */
215
+ async report(days = 7, out) {
216
+ return (await import('./report.js')).buildReport(this, { days, ...(out ? { out } : {}) });
217
+ }
218
+ /** Installed plugins and any that failed to load. */
219
+ async plugins() {
220
+ return (await import('./plugins.js')).loadPlugins();
221
+ }
222
+ async pluginRun(ref, args = {}) {
223
+ return (await import('./plugins.js')).runPluginTool(this, ref, args);
224
+ }
225
+ /** OFAC sanctions screening: wallet address (plus direct counterparties), vessel IMO, or exact name. */
226
+ sanctions(query) {
227
+ return screen(this.ctx, query);
228
+ }
229
+ /** Lynx: Polymarket vs Kalshi and Manifold on the same questions; big verified gaps become signals. */
230
+ markets(opts) {
231
+ return lynx(this.ctx, opts);
232
+ }
233
+ /** Launch Radar: new models, apps, packages, hosts, pages and repos for a company. */
234
+ launches(company, opts) {
235
+ return launches(this.ctx, company, opts);
236
+ }
237
+ /** Time Machine: what Oculon would have seen on a past date (YYYY-MM-DD). */
238
+ rewind(date) {
239
+ return rewind(this.ctx, date);
240
+ }
241
+ /** Geofence: a named box (south, west, north, east) watched for military aircraft/vessels, quakes and events. */
242
+ fenceAdd(name, box, kinds) {
243
+ return addFence(this.ctx, name, box, kinds);
244
+ }
245
+ /** Geofence around a place, `radiusKm` each way. */
246
+ async fenceAddAround(name, place, radiusKm = 100, kinds) {
247
+ return addFence(this.ctx, name, await boxAround(this.ctx, place, radiusKm), kinds);
248
+ }
249
+ fenceList() {
250
+ return listFences(this.ctx);
251
+ }
252
+ fenceRemove(id) {
253
+ return removeFence(this.ctx, id);
254
+ }
255
+ /** Check every fence and report what is new inside it. */
256
+ fenceCheck() {
257
+ return checkFences(this.ctx);
258
+ }
259
+ /** First to Know: check strong signals against when major media first covered them. */
260
+ scoopsCheck(max = 8) {
261
+ return checkScoops(this.ctx, max);
262
+ }
263
+ /** First to Know scoreboard: how often and by how much Oculon was ahead of the media. */
264
+ scoops() {
265
+ return scoopBoard(this.ctx);
266
+ }
267
+ /** Case Files: open a new investigation, or re-run case `id`. Long-running (about 1-3 minutes). */
268
+ async caseInvestigate(input, opts) {
269
+ const { investigate } = await import('./cases.js');
270
+ return investigate(this, input, opts);
271
+ }
272
+ async caseList() {
273
+ return (await import('./cases.js')).listCases(this);
274
+ }
275
+ async caseGet(id) {
276
+ return (await import('./cases.js')).getCase(this, id);
277
+ }
278
+ async caseWatch(id, on) {
279
+ return (await import('./cases.js')).setCaseWatch(this, id, on);
280
+ }
281
+ /** Falcon at sea: live vessels around a place for `seconds` (aisstream.io). */
282
+ ships(place, seconds = 30) {
283
+ return shipsNear(this.ctx, place, seconds);
284
+ }
285
+ /** Falcon at sea: follow one ship by MMSI for up to `seconds`. */
286
+ ship(mmsi, seconds = 60) {
287
+ return shipTrack(this.ctx, mmsi, seconds);
288
+ }
289
+ /** Meerkat: add a watchlist target (company, domain, wallet, token, plane, topic, lights, air). */
290
+ watchAdd(kind, target, label) {
291
+ return addWatch(this.ctx, kind, target, label);
292
+ }
293
+ watchList() {
294
+ return listWatch(this.ctx);
295
+ }
296
+ watchRemove(id) {
297
+ return removeWatch(this.ctx, id);
298
+ }
299
+ /** Meerkat: re-check every watch item and report what changed since last time. */
300
+ watchRun(ids) {
301
+ return runWatch(this.ctx, ids);
302
+ }
303
+ /** Monitor in plain language: "internet outages in Iran" becomes a watch rule that alerts on changes. */
304
+ monitor(text) {
305
+ return addMonitor(this.ctx, text);
306
+ }
307
+ /** Read a monitoring sentence into a rule without saving it. */
308
+ monitorParse(text) {
309
+ return parseMonitor(text);
310
+ }
311
+ /** Is a link dangerous? Safe Browsing, URLhaus, urlscan.io history, domain age and URL heuristics. */
312
+ urlCheck(url) {
313
+ return urlCheck(this.ctx, url);
314
+ }
315
+ /** Dependency audit of package.json, requirements.txt or "npm:name@version" items (deps.dev, OpenSSF Scorecard). */
316
+ audit(manifest, opts = {}) {
317
+ return audit(this.ctx, manifest, opts);
318
+ }
319
+ /** Fact check a claim or a news link against published fact checks and current reporting. */
320
+ factCheck(claimOrUrl) {
321
+ return factCheck(this.ctx, claimOrUrl);
322
+ }
323
+ /** Travel risk brief for a place: official advice, weather, air, outbreaks, hazards, quakes and outages. */
324
+ travel(place, opts = {}) {
325
+ return travel(this.ctx, place, opts);
326
+ }
327
+ /** Recalls for a VIN, "year make model", or a product (NHTSA, CPSC, FDA). */
328
+ recall(query) {
329
+ return recall(this.ctx, query);
330
+ }
331
+ /** Can someone spoof email from this domain? SPF, DMARC, DKIM, MTA-STS, DNSSEC, with fixes. */
332
+ emailSecurity(domain) {
333
+ return emailSecurity(this.ctx, domain);
334
+ }
335
+ /** Research brief: most cited and newest papers on a topic, growth per year, an overview with citations. */
336
+ papers(topic, opts = {}) {
337
+ return papers(this.ctx, topic, opts);
338
+ }
339
+ /** Country brief: economy, leaders, currency, IMF outlook, travel advice, outages, disasters, headlines. */
340
+ country(name) {
341
+ return countryBrief(this.ctx, name);
342
+ }
343
+ /** Is this message a scam? Checks its links, sender domain and known scam patterns. */
344
+ scamCheck(message) {
345
+ return scamCheck(this.ctx, message);
346
+ }
347
+ /** Airport status: METAR and TAF, FAA delays and ground stops (US), emergency squawks nearby. */
348
+ airport(code) {
349
+ return airportStatus(this.ctx, code);
350
+ }
351
+ /** Today's brief (stored once per day; refresh to rewrite). */
352
+ brief(opts) {
353
+ return makeBrief(this.ctx, opts);
354
+ }
355
+ /** Today's API usage against the free-tier budgets. */
356
+ quota() {
357
+ return quotaUsage(this.ctx.store);
358
+ }
359
+ /** Most recent signals from every module. */
360
+ signals(limit = 50) {
361
+ return this.ctx.graph.recentSignals(limit);
362
+ }
363
+ /** An entity and its neighbors in the graph, e.g. "domain:openai.com". */
364
+ entity(id) {
365
+ return { entity: this.ctx.graph.get(id), neighbors: this.ctx.graph.neighbors(id) };
366
+ }
367
+ /** Social pulse: recent posts about a subject on X, Reddit, TikTok (Apify) and Bluesky, with pace and top posts. */
368
+ pulse(query, platforms) {
369
+ return pulse(this.ctx, query, platforms);
370
+ }
371
+ /** Listen: transcribe a public audio or video file (Deepgram), with summary, topics and passages about `subject`. */
372
+ listen(url, subject = '') {
373
+ return transcribe(this.ctx, url, subject);
374
+ }
375
+ /** Recent podcast episodes about a subject; transcribes episode number `pick` (default: newest English one). */
376
+ podcast(subject, pick) {
377
+ return podcast(this.ctx, subject, pick);
378
+ }
379
+ /** Exposure: open ports, software and known CVEs on a domain's machines (Shodan InternetDB, free). */
380
+ exposure(domain) {
381
+ return exposure(this.ctx, domain);
382
+ }
383
+ /** Blackout radar: internet outages by country and network (Cloudflare Radar, IODA). */
384
+ blackout(days = 2) {
385
+ return blackout(this.ctx, days);
386
+ }
387
+ /** Official orange and red disaster alerts (GDACS). */
388
+ hazards(days = 7) {
389
+ return hazards(this.ctx, days);
390
+ }
391
+ /** Vessels that switched off AIS near a place (Global Fishing Watch). */
392
+ darkShips(place, days = 30) {
393
+ return darkShips(this.ctx, place, days);
394
+ }
395
+ /** Vessel identity by name, MMSI or IMO: flag, type, owners, earlier names, OFAC check. */
396
+ vessel(query) {
397
+ return vesselIdentity(this.ctx, query);
398
+ }
399
+ /** Sentinel-2 (10 m) or Sentinel-1 radar image of a place from Copernicus; optional before/after pair. */
400
+ async sentinel(place, opts) {
401
+ return (await import('./modules/condor.js')).sentinel(this.ctx, place, opts);
402
+ }
403
+ /** Active fires and thermal hotspots near a place (NASA FIRMS, VIIRS). */
404
+ fires(place, days = 2) {
405
+ return fires(this.ctx, place, days);
406
+ }
407
+ /** Outages on the platforms the internet runs on: status pages of major services, AWS, Azure, Google Cloud. */
408
+ cloud() {
409
+ return cloudStatus(this.ctx);
410
+ }
411
+ /**
412
+ * BGP: a country (two-letter code), a network (AS number), an IP address, or "world" for global hijacks,
413
+ * route leaks and DDoS target countries (RIPEstat, Cloudflare Radar).
414
+ */
415
+ bgp(resource = 'world', days = 2) {
416
+ return bgp(this.ctx, resource, days);
417
+ }
418
+ /** Vulnerabilities newly exploited in the wild (CISA KEV), new critical CVEs (NVD) and advisories (GitHub). */
419
+ vulns(opts = {}) {
420
+ return vulns(this.ctx, opts);
421
+ }
422
+ /** One CVE in depth: CVSS, EPSS trend, KEV status, affected packages and fixes. */
423
+ cve(id) {
424
+ return cve(this.ctx, id);
425
+ }
426
+ /** Known vulnerabilities of a package version (OSV.dev), flagged when exploited in the wild. */
427
+ packageVulns(ecosystem, name, version) {
428
+ return packageVulns(this.ctx, ecosystem, name, version);
429
+ }
430
+ /** US Federal Register: executive orders, rules, proposed rules and tomorrow's documents (public inspection). */
431
+ regs(opts = {}) {
432
+ return regs(this.ctx, opts);
433
+ }
434
+ /** DeFi risk radar: TVL crashes, stablecoin depegs, hacks, chain moves, fear and greed (DefiLlama, alternative.me). */
435
+ defi() {
436
+ return defi(this.ctx);
437
+ }
438
+ /** One DeFi protocol in depth: TVL trend and drawdown, audits, hacks, funding, warnings. */
439
+ protocol(name) {
440
+ return protocol(this.ctx, name);
441
+ }
442
+ /** Aircraft squawking emergency codes right now: 7500 hijack, 7600 radio failure, 7700 emergency. */
443
+ squawks() {
444
+ return squawks(this.ctx);
445
+ }
446
+ /** SEC EDGAR full-text search across filings, e.g. "cybersecurity incident" in 8-Ks. */
447
+ filings(query, opts = {}) {
448
+ return filings(this.ctx, query, opts);
449
+ }
450
+ /** A company's recent 8-K events decoded into plain English (restatements, CEO exits, cyber incidents...). */
451
+ secEvents(tickerOrCik, days = 90) {
452
+ return recentEvents(this.ctx, tickerOrCik, { days });
453
+ }
454
+ /** Catalyst calendar: earnings, key macro releases and prediction markets closing in the next `days`. */
455
+ calendar(days = 14) {
456
+ return catalysts(this.ctx, days);
457
+ }
458
+ /** Link nodes that are the same real thing (org:nvidia, company:nvidia, domain:nvidia.com). */
459
+ resolveEntities() {
460
+ return resolveEntities(this.ctx);
461
+ }
462
+ /** Shortest path between two things in the graph: "how is A connected to B". */
463
+ connect(a, b, maxDepth = 6) {
464
+ return connect(this.ctx, a, b, maxDepth);
465
+ }
466
+ /** Record a Useful/Noise vote on a signal; it moves that module's alert bar. */
467
+ feedback(signalId, verdict, voter = 'local') {
468
+ return recordFeedback(this.ctx, signalId, verdict, voter);
469
+ }
470
+ feedbackStats() {
471
+ return feedbackStats(this.ctx);
472
+ }
473
+ /** Start the live Wikipedia + Bluesky stream listeners. Call stop() on the result to end them. */
474
+ async live(opts = {}) {
475
+ const { LiveMonitor } = await import('./live.js');
476
+ const m = new LiveMonitor(this, opts);
477
+ m.start();
478
+ return m;
479
+ }
480
+ close() {
481
+ this.ctx.store.close();
482
+ }
483
+ }
484
+ /** Collapse provenance into per-source status counts plus distinct notes. Handy for compact output. */
485
+ export function summarizeProvenance(provenance) {
486
+ const sources = {};
487
+ const notes = new Set();
488
+ for (const p of provenance) {
489
+ const s = (sources[p.source] ??= {});
490
+ s[p.status] = (s[p.status] ?? 0) + 1;
491
+ if (p.note)
492
+ notes.add(`${p.source}: ${p.status} ${p.note}`);
493
+ }
494
+ return { sources, notes: [...notes] };
495
+ }
package/dist/live.d.ts ADDED
@@ -0,0 +1,53 @@
1
+ import type { Signal } from './core/types.js';
2
+ import type { Oculon } from './index.js';
3
+ export interface LiveOptions {
4
+ log?: (m: string) => void;
5
+ onSignals?: (s: Signal[]) => Promise<void> | void;
6
+ /** Extra Bluesky terms to watch closely (lowercase). Defaults to watchlist topics and companies. */
7
+ watchTerms?: () => string[];
8
+ wiki?: boolean;
9
+ bluesky?: boolean;
10
+ }
11
+ /** Terms worth counting in a post: hashtags and capitalized words or two-word names. */
12
+ export declare function postTerms(text: string): string[];
13
+ /** Per-minute counters with a one-hour memory. */
14
+ export declare class TermCounter {
15
+ private buckets;
16
+ add(term: string, minute: number): void;
17
+ prune(nowMinute: number): void;
18
+ /** Counts in the last `recent` minutes and the per-window average over the rest of the hour. */
19
+ surge(nowMinute: number, recent?: number): {
20
+ term: string;
21
+ recent: number;
22
+ baseline: number;
23
+ }[];
24
+ minutesCovered(): number;
25
+ }
26
+ export declare class LiveMonitor {
27
+ private readonly o;
28
+ private readonly opts;
29
+ private stopped;
30
+ private wikiEdits;
31
+ private flagged;
32
+ private terms;
33
+ private timer;
34
+ private ws;
35
+ private abort;
36
+ readonly stats: {
37
+ wikiEdits: number;
38
+ posts: number;
39
+ signals: number;
40
+ startedAt: string;
41
+ };
42
+ constructor(o: Oculon, opts?: LiveOptions);
43
+ private log;
44
+ start(): void;
45
+ stop(): void;
46
+ private wikiLoop;
47
+ private blueskyConnect;
48
+ /** Called every minute: decide what is surging. Exposed for tests. */
49
+ evaluate(nowMs?: number): Promise<Signal[]>;
50
+ /** Test hooks: feed events without network. */
51
+ _wikiEdit(title: string, user: string, t?: number): void;
52
+ _post(text: string, t?: number): void;
53
+ }