openplanter 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 (126) hide show
  1. package/README.md +210 -0
  2. package/dist/builder.d.ts +11 -0
  3. package/dist/builder.d.ts.map +1 -0
  4. package/dist/builder.js +179 -0
  5. package/dist/builder.js.map +1 -0
  6. package/dist/cli.d.ts +9 -0
  7. package/dist/cli.d.ts.map +1 -0
  8. package/dist/cli.js +548 -0
  9. package/dist/cli.js.map +1 -0
  10. package/dist/config.d.ts +51 -0
  11. package/dist/config.d.ts.map +1 -0
  12. package/dist/config.js +114 -0
  13. package/dist/config.js.map +1 -0
  14. package/dist/credentials.d.ts +52 -0
  15. package/dist/credentials.d.ts.map +1 -0
  16. package/dist/credentials.js +371 -0
  17. package/dist/credentials.js.map +1 -0
  18. package/dist/demo.d.ts +26 -0
  19. package/dist/demo.d.ts.map +1 -0
  20. package/dist/demo.js +95 -0
  21. package/dist/demo.js.map +1 -0
  22. package/dist/engine.d.ts +91 -0
  23. package/dist/engine.d.ts.map +1 -0
  24. package/dist/engine.js +1036 -0
  25. package/dist/engine.js.map +1 -0
  26. package/dist/index.d.ts +30 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +39 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/investigation-tools/aph-holdings.d.ts +61 -0
  31. package/dist/investigation-tools/aph-holdings.d.ts.map +1 -0
  32. package/dist/investigation-tools/aph-holdings.js +459 -0
  33. package/dist/investigation-tools/aph-holdings.js.map +1 -0
  34. package/dist/investigation-tools/asic-officer-lookup.d.ts +42 -0
  35. package/dist/investigation-tools/asic-officer-lookup.d.ts.map +1 -0
  36. package/dist/investigation-tools/asic-officer-lookup.js +197 -0
  37. package/dist/investigation-tools/asic-officer-lookup.js.map +1 -0
  38. package/dist/investigation-tools/asx-calendar-fetcher.d.ts +42 -0
  39. package/dist/investigation-tools/asx-calendar-fetcher.d.ts.map +1 -0
  40. package/dist/investigation-tools/asx-calendar-fetcher.js +271 -0
  41. package/dist/investigation-tools/asx-calendar-fetcher.js.map +1 -0
  42. package/dist/investigation-tools/asx-parser.d.ts +66 -0
  43. package/dist/investigation-tools/asx-parser.d.ts.map +1 -0
  44. package/dist/investigation-tools/asx-parser.js +314 -0
  45. package/dist/investigation-tools/asx-parser.js.map +1 -0
  46. package/dist/investigation-tools/bulk-asx-announcements.d.ts +53 -0
  47. package/dist/investigation-tools/bulk-asx-announcements.d.ts.map +1 -0
  48. package/dist/investigation-tools/bulk-asx-announcements.js +204 -0
  49. package/dist/investigation-tools/bulk-asx-announcements.js.map +1 -0
  50. package/dist/investigation-tools/entity-resolver.d.ts +77 -0
  51. package/dist/investigation-tools/entity-resolver.d.ts.map +1 -0
  52. package/dist/investigation-tools/entity-resolver.js +346 -0
  53. package/dist/investigation-tools/entity-resolver.js.map +1 -0
  54. package/dist/investigation-tools/hotcopper-scraper.d.ts +73 -0
  55. package/dist/investigation-tools/hotcopper-scraper.d.ts.map +1 -0
  56. package/dist/investigation-tools/hotcopper-scraper.js +318 -0
  57. package/dist/investigation-tools/hotcopper-scraper.js.map +1 -0
  58. package/dist/investigation-tools/index.d.ts +15 -0
  59. package/dist/investigation-tools/index.d.ts.map +1 -0
  60. package/dist/investigation-tools/index.js +15 -0
  61. package/dist/investigation-tools/index.js.map +1 -0
  62. package/dist/investigation-tools/insider-graph.d.ts +173 -0
  63. package/dist/investigation-tools/insider-graph.d.ts.map +1 -0
  64. package/dist/investigation-tools/insider-graph.js +732 -0
  65. package/dist/investigation-tools/insider-graph.js.map +1 -0
  66. package/dist/investigation-tools/insider-suspicion-scorer.d.ts +97 -0
  67. package/dist/investigation-tools/insider-suspicion-scorer.d.ts.map +1 -0
  68. package/dist/investigation-tools/insider-suspicion-scorer.js +327 -0
  69. package/dist/investigation-tools/insider-suspicion-scorer.js.map +1 -0
  70. package/dist/investigation-tools/multi-forum-scraper.d.ts +104 -0
  71. package/dist/investigation-tools/multi-forum-scraper.d.ts.map +1 -0
  72. package/dist/investigation-tools/multi-forum-scraper.js +415 -0
  73. package/dist/investigation-tools/multi-forum-scraper.js.map +1 -0
  74. package/dist/investigation-tools/price-fetcher.d.ts +81 -0
  75. package/dist/investigation-tools/price-fetcher.d.ts.map +1 -0
  76. package/dist/investigation-tools/price-fetcher.js +268 -0
  77. package/dist/investigation-tools/price-fetcher.js.map +1 -0
  78. package/dist/investigation-tools/shared.d.ts +39 -0
  79. package/dist/investigation-tools/shared.d.ts.map +1 -0
  80. package/dist/investigation-tools/shared.js +203 -0
  81. package/dist/investigation-tools/shared.js.map +1 -0
  82. package/dist/investigation-tools/timeline-linker.d.ts +90 -0
  83. package/dist/investigation-tools/timeline-linker.d.ts.map +1 -0
  84. package/dist/investigation-tools/timeline-linker.js +219 -0
  85. package/dist/investigation-tools/timeline-linker.js.map +1 -0
  86. package/dist/investigation-tools/volume-scanner.d.ts +70 -0
  87. package/dist/investigation-tools/volume-scanner.d.ts.map +1 -0
  88. package/dist/investigation-tools/volume-scanner.js +227 -0
  89. package/dist/investigation-tools/volume-scanner.js.map +1 -0
  90. package/dist/model.d.ts +136 -0
  91. package/dist/model.d.ts.map +1 -0
  92. package/dist/model.js +1071 -0
  93. package/dist/model.js.map +1 -0
  94. package/dist/patching.d.ts +45 -0
  95. package/dist/patching.d.ts.map +1 -0
  96. package/dist/patching.js +317 -0
  97. package/dist/patching.js.map +1 -0
  98. package/dist/prompts.d.ts +15 -0
  99. package/dist/prompts.d.ts.map +1 -0
  100. package/dist/prompts.js +351 -0
  101. package/dist/prompts.js.map +1 -0
  102. package/dist/replay-log.d.ts +54 -0
  103. package/dist/replay-log.d.ts.map +1 -0
  104. package/dist/replay-log.js +94 -0
  105. package/dist/replay-log.js.map +1 -0
  106. package/dist/runtime.d.ts +53 -0
  107. package/dist/runtime.d.ts.map +1 -0
  108. package/dist/runtime.js +259 -0
  109. package/dist/runtime.js.map +1 -0
  110. package/dist/settings.d.ts +39 -0
  111. package/dist/settings.d.ts.map +1 -0
  112. package/dist/settings.js +146 -0
  113. package/dist/settings.js.map +1 -0
  114. package/dist/tool-defs.d.ts +58 -0
  115. package/dist/tool-defs.d.ts.map +1 -0
  116. package/dist/tool-defs.js +1029 -0
  117. package/dist/tool-defs.js.map +1 -0
  118. package/dist/tools.d.ts +72 -0
  119. package/dist/tools.d.ts.map +1 -0
  120. package/dist/tools.js +1454 -0
  121. package/dist/tools.js.map +1 -0
  122. package/dist/tui.d.ts +49 -0
  123. package/dist/tui.d.ts.map +1 -0
  124. package/dist/tui.js +699 -0
  125. package/dist/tui.js.map +1 -0
  126. package/package.json +126 -0
@@ -0,0 +1,318 @@
1
+ /**
2
+ * hotcopper-scraper.ts – HotCopper Forum Scraper for ASX Ticker Sentiment & Rumor Extraction
3
+ *
4
+ * Scrapes HotCopper (https://hotcopper.com.au), Australia's largest stock
5
+ * market forum, for posts related to a given ASX ticker. Extracts post
6
+ * metadata, performs basic keyword-based sentiment analysis, and flags
7
+ * rumor-type posts that may be relevant to insider-trading investigations.
8
+ *
9
+ * DISCLAIMER:
10
+ * This tool is provided for research and educational purposes only.
11
+ * Scraping HotCopper may violate their Terms of Service. Users are
12
+ * solely responsible for ensuring compliance with all applicable laws,
13
+ * regulations, and website terms before using this tool. The authors
14
+ * accept no liability for misuse.
15
+ */
16
+ import { fetchHtml, parseDate, sentimentScore, isRumor, isoNow, } from "./shared.js";
17
+ // ── Constants ───────────────────────────────────────────────────
18
+ const BASE_URL = "https://hotcopper.com.au";
19
+ const DISCUSSION_URL = BASE_URL + "/asx/{ticker}/discussion/";
20
+ const THREAD_URL_PREFIX = BASE_URL + "/threads/";
21
+ const MAX_POST_TEXT_LEN = 500;
22
+ /** ASX ticker pattern (1–3 uppercase letters, optionally with dot prefix). */
23
+ const TICKER_RE = /\b([A-Z][A-Z0-9]{1,2}(?:\.[A-Z]{1,3})?)\b/g;
24
+ /** Common English words and abbreviations that match the ticker pattern. */
25
+ const NOISE_WORDS = new Set([
26
+ "I", "A", "IT", "IS", "AT", "TO", "IN", "ON", "OR", "AN", "IF",
27
+ "UP", "DO", "GO", "SO", "NO", "AS", "BY", "BE", "HE", "WE", "RE",
28
+ "MY", "US", "AM", "OF", "THE", "AND", "FOR", "BUT", "NOT", "ALL",
29
+ "ANY", "CAN", "HAS", "HER", "WAS", "ONE", "OUR", "OUT", "YOU",
30
+ "HAD", "HOT", "OIL", "OLD", "RED", "SIT", "TOP", "TWO", "WAR",
31
+ "ANN", "CEO", "CFO", "ASX", "ETF", "IPO", "AGM", "EPS", "ROE",
32
+ "IMO", "LOL", "FYI", "TBA", "AUD", "USD", "NZD", "GBP", "EUR",
33
+ "BUY", "NEW", "LOW", "HIGH", "DAY", "NAV", "P&L",
34
+ ]);
35
+ /** CSS selectors to try when extracting thread body content. */
36
+ const THREAD_BODY_SELECTORS = [
37
+ "article.message-body",
38
+ "div.message-body",
39
+ "div.bbWrapper",
40
+ "div.messageText",
41
+ "blockquote.messageText",
42
+ "div.message-content",
43
+ "article",
44
+ ];
45
+ // ── Helpers ─────────────────────────────────────────────────────
46
+ /**
47
+ * Parse HotCopper's DD/MM/YY date string into a Date.
48
+ * Falls back to the shared parseDate for other formats.
49
+ */
50
+ function parseHcDate(raw) {
51
+ return parseDate(raw);
52
+ }
53
+ /**
54
+ * Find ASX-style ticker symbols mentioned in text, excluding the primary ticker.
55
+ */
56
+ function extractTickerMentions(text, primaryTicker) {
57
+ const found = new Set();
58
+ let match;
59
+ // Reset regex state for global matching
60
+ const re = new RegExp(TICKER_RE.source, TICKER_RE.flags);
61
+ while ((match = re.exec(text)) !== null) {
62
+ found.add(match[1]);
63
+ }
64
+ found.delete(primaryTicker.toUpperCase());
65
+ // Filter out noise words
66
+ const filtered = [];
67
+ for (const t of found) {
68
+ if (!NOISE_WORDS.has(t)) {
69
+ filtered.push(t);
70
+ }
71
+ }
72
+ return filtered.sort();
73
+ }
74
+ /** Truncate text to max length, breaking at the last space. */
75
+ function truncate(text, maxLen = MAX_POST_TEXT_LEN) {
76
+ if (text.length <= maxLen)
77
+ return text;
78
+ const cut = text.slice(0, maxLen);
79
+ const spaceIdx = cut.lastIndexOf(" ");
80
+ return (spaceIdx > 0 ? cut.slice(0, spaceIdx) : cut) + "…";
81
+ }
82
+ /**
83
+ * Fetch a page, returning a CheerioAPI or null on failure.
84
+ * Handles errors gracefully without throwing.
85
+ */
86
+ async function fetchPage(url, delay, userAgent) {
87
+ try {
88
+ return await fetchHtml(url, { delay, userAgent });
89
+ }
90
+ catch {
91
+ return null;
92
+ }
93
+ }
94
+ // ── Scraping Logic ──────────────────────────────────────────────
95
+ /**
96
+ * Parse posts from a single HotCopper discussion listing page.
97
+ *
98
+ * @returns A tuple of `[posts, shouldContinue]`. `shouldContinue` is false
99
+ * when all remaining posts are older than the cutoff date.
100
+ */
101
+ function parseDiscussionPage($, ticker, cutoff) {
102
+ const posts = [];
103
+ const tickerUpper = ticker.toUpperCase();
104
+ const rows = $("table tr");
105
+ rows.each((_i, row) => {
106
+ const cells = $(row).find("td");
107
+ if (cells.length < 6)
108
+ return; // continue
109
+ // Date — typically the last cell
110
+ const dateText = $(cells[cells.length - 1]).text().trim();
111
+ const postDate = parseHcDate(dateText);
112
+ if (postDate === null)
113
+ return;
114
+ // Check cutoff
115
+ if (postDate.getTime() < cutoff.getTime()) {
116
+ // Signal to stop after processing this page
117
+ return;
118
+ }
119
+ // Subject link — find the first anchor with /threads/ in href
120
+ let foundSubject = false;
121
+ let subjectHref = "";
122
+ let subjectText = "";
123
+ cells.each((_j, cell) => {
124
+ if (foundSubject)
125
+ return;
126
+ const link = $(cell).find('a[href*="/threads/"]').first();
127
+ if (link.length > 0) {
128
+ foundSubject = true;
129
+ subjectHref = link.attr("href") ?? "";
130
+ subjectText = link.text().trim();
131
+ }
132
+ });
133
+ if (!foundSubject)
134
+ return;
135
+ // Clean title — remove "Re:" prefix
136
+ const threadTitle = subjectText.replace(/^Re:\s*/i, "");
137
+ // Build full URL
138
+ let threadUrl = subjectHref;
139
+ if (threadUrl.startsWith("/")) {
140
+ threadUrl = BASE_URL + threadUrl;
141
+ }
142
+ // Poster — look for link with "users=" in href
143
+ let poster = "";
144
+ const posterLink = $(row).find('a[href*="users="]').first();
145
+ if (posterLink.length > 0) {
146
+ poster = posterLink.text().trim();
147
+ }
148
+ // Sentiment and analysis on the title text
149
+ const combinedText = threadTitle;
150
+ const score = sentimentScore(combinedText);
151
+ const tickers = extractTickerMentions(combinedText, tickerUpper);
152
+ const rumor = isRumor(combinedText);
153
+ posts.push({
154
+ thread_title: threadTitle,
155
+ post_author: poster,
156
+ post_date: formatDateStr(postDate),
157
+ post_text: truncate(threadTitle),
158
+ sentiment_score: round3(score),
159
+ ticker_mentions: tickers,
160
+ url: threadUrl,
161
+ is_rumor: rumor,
162
+ });
163
+ });
164
+ // Determine shouldContinue: check if the last row's date is before cutoff
165
+ let shouldContinue = true;
166
+ const lastRow = rows.last();
167
+ if (lastRow.length > 0) {
168
+ const lastCells = lastRow.find("td");
169
+ if (lastCells.length >= 6) {
170
+ const lastDateText = $(lastCells[lastCells.length - 1]).text().trim();
171
+ const lastDate = parseHcDate(lastDateText);
172
+ if (lastDate !== null && lastDate.getTime() < cutoff.getTime()) {
173
+ shouldContinue = false;
174
+ }
175
+ }
176
+ }
177
+ return [posts, shouldContinue];
178
+ }
179
+ /**
180
+ * Fetch a thread page and extract the post body text.
181
+ */
182
+ async function scrapeThreadContent(url, delay, userAgent) {
183
+ const $ = await fetchPage(url, delay, userAgent);
184
+ if ($ === null)
185
+ return "";
186
+ // Try several selectors for post content
187
+ for (const selector of THREAD_BODY_SELECTORS) {
188
+ const elements = $(selector);
189
+ if (elements.length > 0) {
190
+ const textParts = [];
191
+ for (const el of elements.toArray()) {
192
+ textParts.push($(el).text().trim());
193
+ }
194
+ return textParts.join(" ");
195
+ }
196
+ }
197
+ // Fallback: extract text from main content area
198
+ const main = $("main").length > 0 ? $("main") : $("#content");
199
+ if (main.length > 0) {
200
+ return main.text().trim().slice(0, 2000);
201
+ }
202
+ return "";
203
+ }
204
+ /** Format a Date as YYYY-MM-DD. */
205
+ function formatDateStr(d) {
206
+ const y = d.getFullYear();
207
+ const m = String(d.getMonth() + 1).padStart(2, "0");
208
+ const day = String(d.getDate()).padStart(2, "0");
209
+ return `${y}-${m}-${day}`;
210
+ }
211
+ /** Round a number to 3 decimal places. */
212
+ function round3(n) {
213
+ return Math.round(n * 1000) / 1000;
214
+ }
215
+ // ── Main Scraper ────────────────────────────────────────────────
216
+ /**
217
+ * Scrape HotCopper discussion pages for the given ASX ticker.
218
+ *
219
+ * @param opts - Scraper options.
220
+ * @returns Structured result with posts, daily sentiment, flagged rumors, etc.
221
+ */
222
+ export async function scrapeHotcopper(opts) {
223
+ const ticker = opts.ticker.toUpperCase().trim();
224
+ const days = opts.days ?? 7;
225
+ const maxPages = opts.maxPages ?? 5;
226
+ const delay = opts.delay ?? 2.0;
227
+ const userAgent = opts.userAgent;
228
+ const scrapeThreadBodies = opts.scrapeThreadBodies ?? false;
229
+ const now = new Date();
230
+ const cutoff = new Date(now.getTime() - days * 24 * 60 * 60 * 1000);
231
+ const allPosts = [];
232
+ for (let pageNum = 1; pageNum <= maxPages; pageNum++) {
233
+ const baseUrl = DISCUSSION_URL.replace("{ticker}", ticker.toLowerCase());
234
+ const url = pageNum === 1 ? baseUrl : `${baseUrl}page-${pageNum}`;
235
+ const pageDelay = pageNum > 1 ? delay : 0.0;
236
+ const $ = await fetchPage(url, pageDelay, userAgent);
237
+ if ($ === null)
238
+ break;
239
+ const [posts, shouldContinue] = parseDiscussionPage($, ticker, cutoff);
240
+ allPosts.push(...posts);
241
+ if (!shouldContinue)
242
+ break;
243
+ }
244
+ // Optionally fetch full thread text for richer sentiment
245
+ if (scrapeThreadBodies) {
246
+ const seenUrls = new Set();
247
+ for (const post of allPosts) {
248
+ if (seenUrls.has(post.url))
249
+ continue;
250
+ seenUrls.add(post.url);
251
+ const body = await scrapeThreadContent(post.url, delay, userAgent);
252
+ if (body) {
253
+ post.post_text = truncate(body);
254
+ post.sentiment_score = round3(sentimentScore(body));
255
+ post.ticker_mentions = extractTickerMentions(body, ticker);
256
+ post.is_rumor = isRumor(body);
257
+ }
258
+ }
259
+ }
260
+ // De-duplicate by URL + date + author
261
+ const seen = new Set();
262
+ const uniquePosts = [];
263
+ for (const p of allPosts) {
264
+ const key = `${p.url}|${p.post_date}|${p.post_author}`;
265
+ if (!seen.has(key)) {
266
+ seen.add(key);
267
+ uniquePosts.push(p);
268
+ }
269
+ }
270
+ // Aggregate daily sentiment
271
+ const dailyMap = new Map();
272
+ for (const p of uniquePosts) {
273
+ const existing = dailyMap.get(p.post_date) ?? [];
274
+ existing.push(p);
275
+ dailyMap.set(p.post_date, existing);
276
+ }
277
+ const dailySentiment = [];
278
+ const sortedDates = [...dailyMap.keys()].sort();
279
+ for (const dateStr of sortedDates) {
280
+ const dayPosts = dailyMap.get(dateStr);
281
+ const scores = dayPosts.map((p) => p.sentiment_score);
282
+ const avg = scores.length > 0
283
+ ? scores.reduce((a, b) => a + b, 0) / scores.length
284
+ : 0.0;
285
+ // Notable posts: highest absolute sentiment
286
+ const notable = [...dayPosts]
287
+ .sort((a, b) => Math.abs(b.sentiment_score) - Math.abs(a.sentiment_score))
288
+ .slice(0, 3);
289
+ dailySentiment.push({
290
+ date: dateStr,
291
+ post_count: dayPosts.length,
292
+ avg_sentiment: round3(avg),
293
+ notable_posts: notable.map((n) => ({
294
+ title: n.thread_title,
295
+ sentiment: n.sentiment_score,
296
+ url: n.url,
297
+ })),
298
+ });
299
+ }
300
+ // Flagged rumors
301
+ const flaggedRumors = uniquePosts.filter((p) => p.is_rumor);
302
+ // Overall sentiment
303
+ const allScores = uniquePosts.map((p) => p.sentiment_score);
304
+ const overall = allScores.length > 0
305
+ ? round3(allScores.reduce((a, b) => a + b, 0) / allScores.length)
306
+ : 0.0;
307
+ return {
308
+ ticker,
309
+ scraped_at: isoNow(),
310
+ period: `${days} days`,
311
+ total_posts: uniquePosts.length,
312
+ posts: uniquePosts,
313
+ daily_sentiment: dailySentiment,
314
+ flagged_rumors: flaggedRumors,
315
+ overall_sentiment: overall,
316
+ };
317
+ }
318
+ //# sourceMappingURL=hotcopper-scraper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hotcopper-scraper.js","sourceRoot":"","sources":["../../src/investigation-tools/hotcopper-scraper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,SAAS,EACT,SAAS,EACT,cAAc,EACd,OAAO,EACP,MAAM,GAEP,MAAM,aAAa,CAAC;AAErB,mEAAmE;AAEnE,MAAM,QAAQ,GAAG,0BAA0B,CAAC;AAC5C,MAAM,cAAc,GAAG,QAAQ,GAAG,2BAA2B,CAAC;AAC9D,MAAM,iBAAiB,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEjD,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,8EAA8E;AAC9E,MAAM,SAAS,GAAG,4CAA4C,CAAC;AAE/D,4EAA4E;AAC5E,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IAC1B,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC9D,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAChE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;IAChE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;IAC7D,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EA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AC,CAAC,GAAG;aACX,CAAC,CAAC;SACJ,CAAC,CAAC;IACL,CAAC;IAED,iBAAiB;IACjB,MAAM,aAAa,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAE5D,oBAAoB;IACpB,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC;QAClC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC;QACjE,CAAC,CAAC,GAAG,CAAC;IAER,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM,EAAE;QACpB,MAAM,EAAE,GAAG,IAAI,OAAO;QACtB,WAAW,EAAE,WAAW,CAAC,MAAM;QAC/B,KAAK,EAAE,WAAW;QAClB,eAAe,EAAE,cAAc;QAC/B,cAAc,EAAE,aAAa;QAC7B,iBAAiB,EAAE,OAAO;KAC3B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ export * as shared from "./shared.js";
2
+ export * as entityResolver from "./entity-resolver.js";
3
+ export * as insiderSuspicionScorer from "./insider-suspicion-scorer.js";
4
+ export * as timelineLinker from "./timeline-linker.js";
5
+ export * as aphHoldings from "./aph-holdings.js";
6
+ export * as asicOfficerLookup from "./asic-officer-lookup.js";
7
+ export * as asxCalendarFetcher from "./asx-calendar-fetcher.js";
8
+ export * as asxParser from "./asx-parser.js";
9
+ export * as bulkAsxAnnouncements from "./bulk-asx-announcements.js";
10
+ export * as hotcopperScraper from "./hotcopper-scraper.js";
11
+ export * as multiForumScraper from "./multi-forum-scraper.js";
12
+ export * as priceFetcher from "./price-fetcher.js";
13
+ export * as volumeScanner from "./volume-scanner.js";
14
+ export * as insiderGraph from "./insider-graph.js";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/investigation-tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,sBAAsB,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,15 @@
1
+ export * as shared from "./shared.js";
2
+ export * as entityResolver from "./entity-resolver.js";
3
+ export * as insiderSuspicionScorer from "./insider-suspicion-scorer.js";
4
+ export * as timelineLinker from "./timeline-linker.js";
5
+ export * as aphHoldings from "./aph-holdings.js";
6
+ export * as asicOfficerLookup from "./asic-officer-lookup.js";
7
+ export * as asxCalendarFetcher from "./asx-calendar-fetcher.js";
8
+ export * as asxParser from "./asx-parser.js";
9
+ export * as bulkAsxAnnouncements from "./bulk-asx-announcements.js";
10
+ export * as hotcopperScraper from "./hotcopper-scraper.js";
11
+ export * as multiForumScraper from "./multi-forum-scraper.js";
12
+ export * as priceFetcher from "./price-fetcher.js";
13
+ export * as volumeScanner from "./volume-scanner.js";
14
+ export * as insiderGraph from "./insider-graph.js";
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/investigation-tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,sBAAsB,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,173 @@
1
+ /**
2
+ * insider-graph.ts — Entity-event relationship graph builder for insider trading investigations.
3
+ *
4
+ * Builds directed graphs of people, companies, events, and tickers with weighted edges
5
+ * representing relationships (shareholdings, directorships, trades, announcements, etc.).
6
+ * Supports pathfinding (Dijkstra), neighbourhood queries, community detection, and
7
+ * suspicion-path analysis connecting trade events to information sources.
8
+ *
9
+ * Migrated from tools/insider_graph.py — all graph algorithms implemented from scratch
10
+ * with no external dependencies.
11
+ */
12
+ export declare const VALID_NODE_TYPES: Set<string>;
13
+ export declare const EDGE_TYPE_DEFAULTS: Record<string, number>;
14
+ /** Event sub-types treated as "information sources" for suspicion analysis. */
15
+ export declare const INFO_SOURCE_EVENT_SUBTYPES: Set<string>;
16
+ /** Input node definition for graph construction. */
17
+ export interface GraphNode {
18
+ id: string;
19
+ type?: string;
20
+ label?: string;
21
+ subtype?: string;
22
+ properties?: Record<string, unknown>;
23
+ }
24
+ /** Input edge definition for graph construction. */
25
+ export interface GraphEdge {
26
+ source: string;
27
+ target: string;
28
+ type?: string;
29
+ weight?: number;
30
+ properties?: Record<string, unknown>;
31
+ }
32
+ /** Canonical input schema containing nodes and edges. */
33
+ export interface GraphData {
34
+ nodes?: GraphNode[];
35
+ edges?: GraphEdge[];
36
+ }
37
+ /** Detail about a single edge along a path. */
38
+ export interface EdgeDetail {
39
+ from: string;
40
+ to: string;
41
+ type?: string;
42
+ weight?: number;
43
+ }
44
+ /** Result of a shortest-path query. */
45
+ export interface PathResult {
46
+ found: boolean;
47
+ source: string;
48
+ target: string;
49
+ path: string[];
50
+ length: number | null;
51
+ edges?: EdgeDetail[];
52
+ error?: string;
53
+ }
54
+ /** Single connection entry in a neighbourhood query. */
55
+ export interface ConnectionEntry {
56
+ id: string;
57
+ type?: string;
58
+ label: string;
59
+ distance: number;
60
+ }
61
+ /** Result of a neighbourhood / connections query. */
62
+ export interface ConnectionsResult {
63
+ node: string;
64
+ depth?: number;
65
+ total?: number;
66
+ connections: ConnectionEntry[];
67
+ error?: string;
68
+ }
69
+ /** A member of a cluster (connected component). */
70
+ export interface ClusterMember {
71
+ id: string;
72
+ type?: string;
73
+ label: string;
74
+ }
75
+ /** A single cluster (connected component). */
76
+ export interface Cluster {
77
+ cluster_id: number;
78
+ size: number;
79
+ members: ClusterMember[];
80
+ }
81
+ /** Result of a connected-component / cluster query. */
82
+ export interface ClusterResult {
83
+ total_clusters: number;
84
+ clusters: Cluster[];
85
+ }
86
+ /** A node with high betweenness centrality. */
87
+ export interface CentralNode {
88
+ id: string;
89
+ label: string;
90
+ type?: string;
91
+ centrality: number;
92
+ }
93
+ /** Summary statistics for the graph. */
94
+ export interface StatsResult {
95
+ total_nodes: number;
96
+ total_edges: number;
97
+ node_types: Record<string, number>;
98
+ edge_types: Record<string, number>;
99
+ density: number;
100
+ connected_components: number;
101
+ diameter: number | null;
102
+ key_central_nodes: CentralNode[];
103
+ }
104
+ /** A single suspicion path from trade event to information source. */
105
+ export interface SuspicionPath {
106
+ info_source: string;
107
+ info_source_label: string;
108
+ path: string[];
109
+ length: number;
110
+ edges: EdgeDetail[];
111
+ }
112
+ /** Result of a suspicion-analysis query. */
113
+ export interface SuspicionResult {
114
+ trade_event: string;
115
+ total_paths?: number;
116
+ paths?: SuspicionPath[];
117
+ error?: string;
118
+ }
119
+ /**
120
+ * Lightweight directed graph with adjacency-list storage.
121
+ *
122
+ * Stores node attributes and edge attributes. Supports both directed
123
+ * and undirected-view operations required for insider-graph analysis.
124
+ */
125
+ export declare class DiGraph {
126
+ private _nodes;
127
+ private _adj;
128
+ private _pred;
129
+ /** Add a node (or update its attributes if it already exists). */
130
+ addNode(id: string, attrs?: Record<string, unknown>): void;
131
+ /** Add a directed edge (or update its attributes if it already exists). */
132
+ addEdge(source: string, target: string, attrs?: Record<string, unknown>): void;
133
+ hasNode(id: string): boolean;
134
+ getNodeData(id: string): Record<string, unknown> | undefined;
135
+ getEdgeData(u: string, v: string): Record<string, unknown> | undefined;
136
+ numberOfNodes(): number;
137
+ numberOfEdges(): number;
138
+ /** All node IDs. */
139
+ nodeIds(): string[];
140
+ /** Iterate over nodes with their attribute dicts. */
141
+ nodesWithData(): Array<[string, Record<string, unknown>]>;
142
+ /** Iterate over edges as [source, target, attrs] triples. */
143
+ edgesWithData(): Array<[string, string, Record<string, unknown>]>;
144
+ /** Outgoing neighbours (directed). */
145
+ successors(node: string): string[];
146
+ /** Incoming neighbours (directed). */
147
+ predecessors(node: string): string[];
148
+ /** All neighbours (undirected view — union of successors and predecessors). */
149
+ undirectedNeighbors(node: string): string[];
150
+ }
151
+ /** Construct a DiGraph from the canonical input JSON schema. */
152
+ export declare function buildGraph(data: GraphData): DiGraph;
153
+ /** Dijkstra shortest path between source and target (undirected view). */
154
+ export declare function findShortestPath(G: DiGraph, source: string, target: string): PathResult;
155
+ /** All nodes reachable within `depth` hops (undirected neighbourhood, BFS). */
156
+ export declare function findConnections(G: DiGraph, node: string, depth?: number): ConnectionsResult;
157
+ /** Connected components (on the undirected projection) as clusters. */
158
+ export declare function findClusters(G: DiGraph): ClusterResult;
159
+ /**
160
+ * Find paths connecting a trade event to any information-source event
161
+ * (announcement, report, meeting). Highlights how an insider may have
162
+ * received material non-public information before executing a trade.
163
+ */
164
+ export declare function suspicionAnalysis(G: DiGraph, tradeEventId: string): SuspicionResult;
165
+ /** Compute summary statistics for the graph. */
166
+ export declare function graphStats(G: DiGraph): StatsResult;
167
+ /** Node-link JSON suitable for D3.js force-directed graphs. */
168
+ export declare function exportJson(G: DiGraph): string;
169
+ /** GraphML format for Gephi / yEd. */
170
+ export declare function exportGraphml(G: DiGraph): string;
171
+ /** Map of export format names to their exporter functions. */
172
+ export declare const EXPORTERS: Record<string, (G: DiGraph) => string>;
173
+ //# sourceMappingURL=insider-graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insider-graph.d.ts","sourceRoot":"","sources":["../../src/investigation-tools/insider-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,eAAO,MAAM,gBAAgB,aAAoD,CAAC;AAElF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CASrD,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,0BAA0B,aAIrC,CAAC;AAIH,oDAAoD;AACpD,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAA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