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/cases.js ADDED
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Case Files: long-running investigations. A question becomes a case; an agent runs a deeper tool loop,
3
+ * then writes a structured case file (answer, findings with confidence, timeline, entities, open questions).
4
+ * Citations are checked in code: a finding may only cite URLs that appeared in tool results.
5
+ * Watched cases are re-investigated on a schedule and only NEW findings are raised as signals.
6
+ */
7
+ import { runAgent } from './agent.js';
8
+ import { chat } from './core/llm.js';
9
+ import { keywords, overlap, signalId } from './core/text.js';
10
+ const toCase = (r) => ({
11
+ id: r.id,
12
+ question: r.question,
13
+ createdAt: new Date(r.created_at).toISOString(),
14
+ updatedAt: new Date(r.updated_at).toISOString(),
15
+ runs: r.runs,
16
+ watch: r.watch === 1,
17
+ report: r.report ? JSON.parse(r.report) : null,
18
+ markdown: r.markdown,
19
+ });
20
+ const INVESTIGATOR = `You are Oculon running an OSINT investigation for a case file.
21
+ Method:
22
+ - Break the question into what must be checked. Use up to 8 tool calls; run independent calls in parallel.
23
+ - Cross-check: prefer facts confirmed by two independent sources. Actively look for evidence AGAINST the obvious answer.
24
+ - Read primary sources when a search result is ambiguous (oculon_read_page).
25
+ - Tool results carry provenance; ERROR/UNAVAILABLE sources returned nothing and are not evidence.
26
+ - Use only facts from tool results. Never invent names, numbers, dates or URLs.
27
+ When done, reply with a short plain summary of what you found.`;
28
+ const EXTRACT = `Turn the investigation above into a case file. Respond with JSON only:
29
+ {"answer": "one or two sentences directly answering the question, or saying it cannot be answered yet",
30
+ "confidence": "high|medium|low",
31
+ "summary": "3-5 sentences",
32
+ "findings": [{"claim": "one concrete fact", "confidence": "high|medium|low", "sources": ["URLs from the tool results"]}],
33
+ "timeline": [{"date": "YYYY-MM-DD", "event": "what happened", "source": "URL from tool results"}],
34
+ "entities": [{"name": "...", "kind": "company|person|domain|token|wallet|aircraft|vessel|place|topic"}],
35
+ "open_questions": ["what is still unknown"]}
36
+ Rules: 3-10 findings; only URLs that appeared in tool results; "high" only when two independent sources agree; no emoji.`;
37
+ const CONF = ['high', 'medium', 'low'];
38
+ const asConf = (v) => (CONF.includes(v) ? v : 'low');
39
+ const str = (v, max = 500) => String(v ?? '').trim().slice(0, max);
40
+ /** Validate model output: keep only cited URLs that tools really returned; unsourced findings drop to low. */
41
+ export function normalizeReport(raw, allowed) {
42
+ const ok = (u) => {
43
+ const s = str(u, 600).replace(/[).,;]+$/, '');
44
+ return allowed.has(s) ? s : null;
45
+ };
46
+ const findings = (Array.isArray(raw.findings) ? raw.findings : [])
47
+ .slice(0, 12)
48
+ .map((f) => {
49
+ const sources = (Array.isArray(f.sources) ? f.sources : []).map(ok).filter((x) => Boolean(x));
50
+ const conf = asConf(f.confidence);
51
+ return { claim: str(f.claim, 400), confidence: sources.length ? (conf === 'high' && sources.length < 2 ? 'medium' : conf) : 'low', sources };
52
+ })
53
+ .filter((f) => f.claim);
54
+ return {
55
+ answer: str(raw.answer, 600) || 'No answer yet.',
56
+ confidence: asConf(raw.confidence),
57
+ summary: str(raw.summary, 1500),
58
+ findings,
59
+ timeline: (Array.isArray(raw.timeline) ? raw.timeline : [])
60
+ .slice(0, 20)
61
+ .map((t) => {
62
+ const src = ok(t.source);
63
+ return { date: str(t.date, 10), event: str(t.event, 300), ...(src ? { source: src } : {}) };
64
+ })
65
+ .filter((t) => /^\d{4}-\d{2}-\d{2}$/.test(t.date) && t.event)
66
+ .sort((a, b) => a.date.localeCompare(b.date)),
67
+ entities: (Array.isArray(raw.entities) ? raw.entities : []).slice(0, 20).map((e) => ({ name: str(e.name, 120), kind: str(e.kind, 20) || 'topic' })).filter((e) => e.name),
68
+ openQuestions: (Array.isArray(raw.open_questions) ? raw.open_questions : []).slice(0, 8).map((q) => str(q, 300)).filter(Boolean),
69
+ };
70
+ }
71
+ export function renderCase(c, r) {
72
+ const host = (u) => {
73
+ try {
74
+ return new URL(u).hostname.replace(/^www\./, '');
75
+ }
76
+ catch {
77
+ return 'source';
78
+ }
79
+ };
80
+ const lines = [
81
+ `# Case #${c.id}: ${c.question}`,
82
+ '',
83
+ `**Answer** (${r.confidence} confidence): ${r.answer}`,
84
+ '',
85
+ r.summary,
86
+ '',
87
+ '## Findings',
88
+ ...r.findings.map((f) => `- [${f.confidence}] ${f.claim}${f.sources.length ? ` ${f.sources.map((u) => `[${host(u)}](${u})`).join(' ')}` : ' (unsourced)'}`),
89
+ ];
90
+ if (r.timeline.length)
91
+ lines.push('', '## Timeline', ...r.timeline.map((t) => `- ${t.date}: ${t.event}${t.source ? ` [${host(t.source)}](${t.source})` : ''}`));
92
+ if (r.entities.length)
93
+ lines.push('', '## Entities', r.entities.map((e) => `${e.name} (${e.kind})`).join(', '));
94
+ if (r.openQuestions.length)
95
+ lines.push('', '## Open questions', ...r.openQuestions.map((q) => `- ${q}`));
96
+ lines.push('', `_Run ${c.runs}, updated ${c.updatedAt.slice(0, 16).replace('T', ' ')} UTC. ${r.steps.length} tool calls via ${[...new Set(r.providers)].join(', ')}. AI-written from tool results; check the sources._`);
97
+ return lines.join('\n');
98
+ }
99
+ const KIND_MAP = { company: 'company', person: 'topic', domain: 'domain', token: 'event', wallet: 'event', aircraft: 'aircraft', vessel: 'event', place: 'topic', topic: 'topic' };
100
+ export function getCase(o, id) {
101
+ const r = o.ctx.store.db.prepare('SELECT * FROM cases WHERE id = ?').get(id);
102
+ return r ? toCase(r) : null;
103
+ }
104
+ export function listCases(o) {
105
+ return o.ctx.store.db.prepare('SELECT * FROM cases ORDER BY updated_at DESC').all().map(toCase);
106
+ }
107
+ export function setCaseWatch(o, id, on) {
108
+ return o.ctx.store.db.prepare('UPDATE cases SET watch = ? WHERE id = ?').run(on ? 1 : 0, id).changes > 0;
109
+ }
110
+ /** Findings in `now` that no finding in `before` already states (keyword overlap below 0.6). */
111
+ export function newFindings(before, now) {
112
+ return now.filter((f) => !before.some((b) => overlap(keywords(b.claim), keywords(f.claim)).score >= 0.6));
113
+ }
114
+ /** Open a case (question) or re-run an existing one (id). */
115
+ export async function investigate(o, input, opts = {}) {
116
+ const db = o.ctx.store.db;
117
+ const now = o.ctx.now().getTime();
118
+ let existing = input.id ? getCase(o, input.id) : null;
119
+ if (input.id && !existing)
120
+ throw new Error(`no case #${input.id}`);
121
+ const question = existing?.question ?? str(input.question, 500);
122
+ if (!question)
123
+ throw new Error('missing question');
124
+ if (!existing) {
125
+ const id = Number(db.prepare('INSERT INTO cases (question, created_at, updated_at) VALUES (?, ?, ?)').run(question, now, now).lastInsertRowid);
126
+ existing = getCase(o, id);
127
+ }
128
+ const prior = existing.report ? `\nEarlier findings on this case (verify, update or contradict them):\n${existing.report.findings.map((f) => `- ${f.claim}`).join('\n')}` : '';
129
+ const run = await runAgent(o, INVESTIGATOR, `Case question: ${question}${prior}`, { maxSteps: 10, maxTokens: 2500, premium: 'deep', ...opts });
130
+ const ex = await chat([...run.messages, { role: 'assistant', content: run.answer }, { role: 'user', content: EXTRACT }], { json: true, temperature: 0, maxTokens: 3500, premium: 'deep', ...(opts.fetch ? { fetch: opts.fetch } : {}) });
131
+ let raw = {};
132
+ try {
133
+ raw = JSON.parse((ex.message.content ?? '{}').replace(/^```(?:json)?|```$/g, '').trim());
134
+ }
135
+ catch {
136
+ raw = { answer: run.answer, confidence: 'low', summary: run.answer, findings: [] };
137
+ }
138
+ const report = { ...normalizeReport(raw, run.urls), steps: run.steps, providers: [...run.providers, ex.provider] };
139
+ const runs = existing.runs + 1;
140
+ const updatedAt = new Date(o.ctx.now().getTime()).toISOString();
141
+ const markdown = renderCase({ id: existing.id, question, updatedAt, runs }, report);
142
+ db.prepare('UPDATE cases SET report = ?, markdown = ?, runs = ?, updated_at = ? WHERE id = ?').run(JSON.stringify(report), markdown, runs, Date.parse(updatedAt), existing.id);
143
+ // Graph: the case links to every entity it names.
144
+ const caseId = o.ctx.graph.upsert('event', `case #${existing.id}: ${question.slice(0, 80)}`);
145
+ for (const e of report.entities)
146
+ o.ctx.graph.link(caseId, o.ctx.graph.upsert(KIND_MAP[e.kind] ?? 'topic', e.name), 'investigates', 'case');
147
+ const added = existing.report ? newFindings(existing.report.findings, report.findings).filter((f) => f.confidence !== 'low') : [];
148
+ const signals = added.map((f) => ({
149
+ id: signalId('case', String(existing.id), f.claim),
150
+ module: 'case',
151
+ title: `Case #${existing.id} new finding: ${f.claim.slice(0, 140)}`,
152
+ score: f.confidence === 'high' ? 75 : 60,
153
+ evidence: f.sources.map((u) => ({ source: 'case', text: f.claim, url: u })),
154
+ createdAt: updatedAt,
155
+ }));
156
+ signals.forEach((s) => o.ctx.graph.saveSignal(s));
157
+ return { case: getCase(o, existing.id), added, signals };
158
+ }
@@ -0,0 +1,12 @@
1
+ import { Oculon } from '../index.js';
2
+ interface Args {
3
+ pos: string[];
4
+ flags: Record<string, string | true>;
5
+ }
6
+ export declare function parseArgs(argv: string[]): Args;
7
+ type Cmd = (o: Oculon, a: Args) => Promise<unknown>;
8
+ export declare const COMMANDS: Record<string, Cmd>;
9
+ /** Nearest command name by edit distance, when it is close enough to be a typo. */
10
+ export declare function closest(word: string, options: string[]): string | null;
11
+ export declare function main(argv?: string[]): Promise<number>;
12
+ export {};