openplanter 0.1.3 → 0.2.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/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +5 -0
- package/dist/engine.js.map +1 -1
- package/dist/investigation-tools/advanced-analytics.d.ts +130 -0
- package/dist/investigation-tools/advanced-analytics.d.ts.map +1 -0
- package/dist/investigation-tools/advanced-analytics.js +340 -0
- package/dist/investigation-tools/advanced-analytics.js.map +1 -0
- package/dist/investigation-tools/blockchain-scanner.d.ts +83 -0
- package/dist/investigation-tools/blockchain-scanner.d.ts.map +1 -0
- package/dist/investigation-tools/blockchain-scanner.js +194 -0
- package/dist/investigation-tools/blockchain-scanner.js.map +1 -0
- package/dist/investigation-tools/crypto-ecosystem.d.ts +83 -0
- package/dist/investigation-tools/crypto-ecosystem.d.ts.map +1 -0
- package/dist/investigation-tools/crypto-ecosystem.js +124 -0
- package/dist/investigation-tools/crypto-ecosystem.js.map +1 -0
- package/dist/investigation-tools/dexscreener-pairs.d.ts +41 -0
- package/dist/investigation-tools/dexscreener-pairs.d.ts.map +1 -0
- package/dist/investigation-tools/dexscreener-pairs.js +60 -0
- package/dist/investigation-tools/dexscreener-pairs.js.map +1 -0
- package/dist/investigation-tools/document-processing.d.ts +78 -0
- package/dist/investigation-tools/document-processing.d.ts.map +1 -0
- package/dist/investigation-tools/document-processing.js +252 -0
- package/dist/investigation-tools/document-processing.js.map +1 -0
- package/dist/investigation-tools/dune-analytics.d.ts +47 -0
- package/dist/investigation-tools/dune-analytics.d.ts.map +1 -0
- package/dist/investigation-tools/dune-analytics.js +160 -0
- package/dist/investigation-tools/dune-analytics.js.map +1 -0
- package/dist/investigation-tools/global-registries.d.ts +86 -0
- package/dist/investigation-tools/global-registries.d.ts.map +1 -0
- package/dist/investigation-tools/global-registries.js +212 -0
- package/dist/investigation-tools/global-registries.js.map +1 -0
- package/dist/investigation-tools/government-records.d.ts +85 -0
- package/dist/investigation-tools/government-records.d.ts.map +1 -0
- package/dist/investigation-tools/government-records.js +170 -0
- package/dist/investigation-tools/government-records.js.map +1 -0
- package/dist/investigation-tools/index.d.ts +18 -0
- package/dist/investigation-tools/index.d.ts.map +1 -1
- package/dist/investigation-tools/index.js +19 -0
- package/dist/investigation-tools/index.js.map +1 -1
- package/dist/investigation-tools/investigation-automation.d.ts +144 -0
- package/dist/investigation-tools/investigation-automation.d.ts.map +1 -0
- package/dist/investigation-tools/investigation-automation.js +345 -0
- package/dist/investigation-tools/investigation-automation.js.map +1 -0
- package/dist/investigation-tools/monitoring-tools.d.ts +102 -0
- package/dist/investigation-tools/monitoring-tools.d.ts.map +1 -0
- package/dist/investigation-tools/monitoring-tools.js +214 -0
- package/dist/investigation-tools/monitoring-tools.js.map +1 -0
- package/dist/investigation-tools/political-finance.d.ts +114 -0
- package/dist/investigation-tools/political-finance.d.ts.map +1 -0
- package/dist/investigation-tools/political-finance.js +205 -0
- package/dist/investigation-tools/political-finance.js.map +1 -0
- package/dist/investigation-tools/polymarket-markets.d.ts +137 -0
- package/dist/investigation-tools/polymarket-markets.d.ts.map +1 -0
- package/dist/investigation-tools/polymarket-markets.js +303 -0
- package/dist/investigation-tools/polymarket-markets.js.map +1 -0
- package/dist/investigation-tools/prediction-markets.d.ts +52 -0
- package/dist/investigation-tools/prediction-markets.d.ts.map +1 -0
- package/dist/investigation-tools/prediction-markets.js +116 -0
- package/dist/investigation-tools/prediction-markets.js.map +1 -0
- package/dist/investigation-tools/sec-tools.d.ts +75 -0
- package/dist/investigation-tools/sec-tools.d.ts.map +1 -0
- package/dist/investigation-tools/sec-tools.js +192 -0
- package/dist/investigation-tools/sec-tools.js.map +1 -0
- package/dist/investigation-tools/shared-crypto.d.ts +50 -0
- package/dist/investigation-tools/shared-crypto.d.ts.map +1 -0
- package/dist/investigation-tools/shared-crypto.js +122 -0
- package/dist/investigation-tools/shared-crypto.js.map +1 -0
- package/dist/investigation-tools/social-intelligence.d.ts +91 -0
- package/dist/investigation-tools/social-intelligence.d.ts.map +1 -0
- package/dist/investigation-tools/social-intelligence.js +302 -0
- package/dist/investigation-tools/social-intelligence.js.map +1 -0
- package/dist/investigation-tools/tool-registry.d.ts +12 -0
- package/dist/investigation-tools/tool-registry.d.ts.map +1 -0
- package/dist/investigation-tools/tool-registry.js +399 -0
- package/dist/investigation-tools/tool-registry.js.map +1 -0
- package/dist/investigation-tools/wallet-clusterer.d.ts +28 -0
- package/dist/investigation-tools/wallet-clusterer.d.ts.map +1 -0
- package/dist/investigation-tools/wallet-clusterer.js +179 -0
- package/dist/investigation-tools/wallet-clusterer.js.map +1 -0
- package/dist/tool-defs.d.ts.map +1 -1
- package/dist/tool-defs.js +301 -0
- package/dist/tool-defs.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* investigation-automation.ts — Cross-reference engine, insider network expansion,
|
|
3
|
+
* compliance risk reports, global entity resolver, and jurisdiction risk scoring.
|
|
4
|
+
*
|
|
5
|
+
* Tools: cross_reference_engine, insider_network_expander, compliance_risk_report,
|
|
6
|
+
* global_entity_resolver, jurisdiction_risk_scorer
|
|
7
|
+
*/
|
|
8
|
+
import { type Provenance, type ConfidenceScore } from "./shared-crypto.js";
|
|
9
|
+
export interface CrossReference {
|
|
10
|
+
entityA: {
|
|
11
|
+
name: string;
|
|
12
|
+
source: string;
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
entityB: {
|
|
16
|
+
name: string;
|
|
17
|
+
source: string;
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
matchScore: number;
|
|
21
|
+
matchType: "exact" | "fuzzy" | "alias" | "structural";
|
|
22
|
+
evidence: string[];
|
|
23
|
+
confidence: ConfidenceScore;
|
|
24
|
+
}
|
|
25
|
+
export interface CrossReferenceResult {
|
|
26
|
+
matches: CrossReference[];
|
|
27
|
+
totalEntitiesA: number;
|
|
28
|
+
totalEntitiesB: number;
|
|
29
|
+
provenance: Provenance;
|
|
30
|
+
}
|
|
31
|
+
export interface ExpandedConnection {
|
|
32
|
+
fromEntity: string;
|
|
33
|
+
toEntity: string;
|
|
34
|
+
connectionType: string;
|
|
35
|
+
depth: number;
|
|
36
|
+
pathDescription: string;
|
|
37
|
+
confidence: ConfidenceScore;
|
|
38
|
+
sources: string[];
|
|
39
|
+
}
|
|
40
|
+
export interface NetworkExpansionResult {
|
|
41
|
+
newConnections: ExpandedConnection[];
|
|
42
|
+
originalNodes: number;
|
|
43
|
+
expandedNodes: number;
|
|
44
|
+
provenance: Provenance;
|
|
45
|
+
}
|
|
46
|
+
export interface RiskFactor {
|
|
47
|
+
category: string;
|
|
48
|
+
description: string;
|
|
49
|
+
severity: "low" | "medium" | "high" | "critical";
|
|
50
|
+
score: number;
|
|
51
|
+
evidence: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ComplianceReport {
|
|
54
|
+
subject: string;
|
|
55
|
+
overallRisk: "low" | "medium" | "high" | "critical";
|
|
56
|
+
overallScore: number;
|
|
57
|
+
riskFactors: RiskFactor[];
|
|
58
|
+
recommendations: string[];
|
|
59
|
+
generatedAt: string;
|
|
60
|
+
provenance: Provenance;
|
|
61
|
+
}
|
|
62
|
+
export interface ResolvedEntity {
|
|
63
|
+
canonicalName: string;
|
|
64
|
+
type: string;
|
|
65
|
+
jurisdiction: string;
|
|
66
|
+
aliases: string[];
|
|
67
|
+
identifiers: Record<string, string>;
|
|
68
|
+
confidence: ConfidenceScore;
|
|
69
|
+
sources: string[];
|
|
70
|
+
}
|
|
71
|
+
export interface GlobalEntityResult {
|
|
72
|
+
resolved: ResolvedEntity[];
|
|
73
|
+
unresolved: string[];
|
|
74
|
+
provenance: Provenance;
|
|
75
|
+
}
|
|
76
|
+
export interface JurisdictionRisk {
|
|
77
|
+
jurisdiction: string;
|
|
78
|
+
country: string;
|
|
79
|
+
riskScore: number;
|
|
80
|
+
riskLevel: "low" | "medium" | "high" | "critical";
|
|
81
|
+
factors: Array<{
|
|
82
|
+
factor: string;
|
|
83
|
+
score: number;
|
|
84
|
+
}>;
|
|
85
|
+
cpiScore: number | null;
|
|
86
|
+
fatfStatus: string;
|
|
87
|
+
taxHaven: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface JurisdictionRiskResult {
|
|
90
|
+
assessments: JurisdictionRisk[];
|
|
91
|
+
provenance: Provenance;
|
|
92
|
+
}
|
|
93
|
+
export interface EntityInput {
|
|
94
|
+
name: string;
|
|
95
|
+
source: string;
|
|
96
|
+
type: string;
|
|
97
|
+
properties?: Record<string, string>;
|
|
98
|
+
}
|
|
99
|
+
export declare function crossReferenceEntities(opts: {
|
|
100
|
+
entitiesA: EntityInput[];
|
|
101
|
+
entitiesB: EntityInput[];
|
|
102
|
+
threshold?: number;
|
|
103
|
+
test?: boolean;
|
|
104
|
+
}): CrossReferenceResult;
|
|
105
|
+
export declare function expandInsiderNetwork(opts: {
|
|
106
|
+
entities: Array<{
|
|
107
|
+
name: string;
|
|
108
|
+
type: string;
|
|
109
|
+
connections?: string[];
|
|
110
|
+
}>;
|
|
111
|
+
knownConnections: Array<{
|
|
112
|
+
from: string;
|
|
113
|
+
to: string;
|
|
114
|
+
type: string;
|
|
115
|
+
}>;
|
|
116
|
+
maxDepth?: number;
|
|
117
|
+
test?: boolean;
|
|
118
|
+
}): NetworkExpansionResult;
|
|
119
|
+
export declare function generateComplianceReport(opts: {
|
|
120
|
+
subject: string;
|
|
121
|
+
findings: Array<{
|
|
122
|
+
category: string;
|
|
123
|
+
description: string;
|
|
124
|
+
severity: "low" | "medium" | "high" | "critical";
|
|
125
|
+
evidence: string;
|
|
126
|
+
}>;
|
|
127
|
+
test?: boolean;
|
|
128
|
+
}): ComplianceReport;
|
|
129
|
+
export declare function resolveGlobalEntities(opts: {
|
|
130
|
+
entities: Array<{
|
|
131
|
+
name: string;
|
|
132
|
+
type: string;
|
|
133
|
+
source: string;
|
|
134
|
+
jurisdiction?: string;
|
|
135
|
+
identifiers?: Record<string, string>;
|
|
136
|
+
}>;
|
|
137
|
+
threshold?: number;
|
|
138
|
+
test?: boolean;
|
|
139
|
+
}): GlobalEntityResult;
|
|
140
|
+
export declare function scoreJurisdictionRisk(opts: {
|
|
141
|
+
jurisdictions: string[];
|
|
142
|
+
test?: boolean;
|
|
143
|
+
}): JurisdictionRiskResult;
|
|
144
|
+
//# sourceMappingURL=investigation-automation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"investigation-automation.d.ts","sourceRoot":"","sources":["../../src/investigation-tools/investigation-automation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAI5B,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,YAAY,CAAC;IACtD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,eAAe,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACx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CAAC;CAChB,GAAG,sBAAsB,CA4DzB;AAID,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;QACjD,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,GAAG,gBAAgB,CA4CnB;AAID,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC,CAAC;IAC7H,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,GAAG,kBAAkB,CA0ErB;AAID,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,GAAG,sBAAsB,CA0BzB"}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* investigation-automation.ts — Cross-reference engine, insider network expansion,
|
|
3
|
+
* compliance risk reports, global entity resolver, and jurisdiction risk scoring.
|
|
4
|
+
*
|
|
5
|
+
* Tools: cross_reference_engine, insider_network_expander, compliance_risk_report,
|
|
6
|
+
* global_entity_resolver, jurisdiction_risk_scorer
|
|
7
|
+
*/
|
|
8
|
+
import { isoNow, tokenSortRatio, normalizePerson, normalizeCompany } from "./shared.js";
|
|
9
|
+
import { makeProvenance, computeConfidence, } from "./shared-crypto.js";
|
|
10
|
+
// ── Mock Data ────────────────────────────────────────────────────
|
|
11
|
+
const MOCK_XREF = {
|
|
12
|
+
matches: [
|
|
13
|
+
{
|
|
14
|
+
entityA: { name: "John C. Smith", source: "SEC Form 4", type: "person" },
|
|
15
|
+
entityB: { name: "SMITH, John Charles", source: "APH Register", type: "person" },
|
|
16
|
+
matchScore: 88, matchType: "fuzzy",
|
|
17
|
+
evidence: ["Name fuzzy match 88%", "Same employer: TechCorp"],
|
|
18
|
+
confidence: { score: 85, factors: ["name_match", "employer_match"] },
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
totalEntitiesA: 10, totalEntitiesB: 15,
|
|
22
|
+
provenance: makeProvenance("cross_reference_engine", "test://mock", ["test_mode"]),
|
|
23
|
+
};
|
|
24
|
+
const MOCK_EXPANSION = {
|
|
25
|
+
newConnections: [
|
|
26
|
+
{
|
|
27
|
+
fromEntity: "John Smith", toEntity: "Crypto PAC",
|
|
28
|
+
connectionType: "political_donation", depth: 2,
|
|
29
|
+
pathDescription: "John Smith -> TechCorp Inc -> Crypto PAC (via FEC donation)",
|
|
30
|
+
confidence: { score: 78, factors: ["fec_record", "employer_match"] },
|
|
31
|
+
sources: ["FEC API", "OpenCorporates"],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
originalNodes: 5, expandedNodes: 12,
|
|
35
|
+
provenance: makeProvenance("insider_network_expander", "test://mock", ["test_mode"]),
|
|
36
|
+
};
|
|
37
|
+
const MOCK_COMPLIANCE = {
|
|
38
|
+
subject: "TechCorp Inc Investigation",
|
|
39
|
+
overallRisk: "high",
|
|
40
|
+
overallScore: 78,
|
|
41
|
+
riskFactors: [
|
|
42
|
+
{ category: "Insider Trading", description: "CEO sold shares 7 days before negative earnings", severity: "critical", score: 95, evidence: "SEC Form 4 filing + earnings date correlation" },
|
|
43
|
+
{ category: "Political Connection", description: "Congress member purchased shares during committee oversight", severity: "high", score: 82, evidence: "House stock disclosure + committee membership" },
|
|
44
|
+
],
|
|
45
|
+
recommendations: [
|
|
46
|
+
"File SEC whistleblower tip regarding CEO share sale timing",
|
|
47
|
+
"Cross-reference congressional committee schedule with trade dates",
|
|
48
|
+
"Monitor for additional insider transactions in 30-day window",
|
|
49
|
+
],
|
|
50
|
+
generatedAt: isoNow(),
|
|
51
|
+
provenance: makeProvenance("compliance_risk_report", "test://mock", ["test_mode"]),
|
|
52
|
+
};
|
|
53
|
+
const MOCK_GLOBAL_ENTITY = {
|
|
54
|
+
resolved: [
|
|
55
|
+
{
|
|
56
|
+
canonicalName: "JOHN CHARLES SMITH",
|
|
57
|
+
type: "person",
|
|
58
|
+
jurisdiction: "US,AU",
|
|
59
|
+
aliases: ["John C. Smith", "SMITH, John Charles", "J.C. Smith"],
|
|
60
|
+
identifiers: { sec_cik: "0001234567", aph_member_id: "AU-12345" },
|
|
61
|
+
confidence: { score: 90, factors: ["name_match", "cross_source", "identifier_link"] },
|
|
62
|
+
sources: ["SEC EDGAR", "APH Register", "OpenCorporates"],
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
unresolved: [],
|
|
66
|
+
provenance: makeProvenance("global_entity_resolver", "test://mock", ["test_mode"]),
|
|
67
|
+
};
|
|
68
|
+
const JURISDICTION_RISK_DB = {
|
|
69
|
+
us: { jurisdiction: "US", country: "United States", riskScore: 20, riskLevel: "low", cpiScore: 69, fatfStatus: "Member", taxHaven: false },
|
|
70
|
+
au: { jurisdiction: "AU", country: "Australia", riskScore: 18, riskLevel: "low", cpiScore: 73, fatfStatus: "Member", taxHaven: false },
|
|
71
|
+
gb: { jurisdiction: "GB", country: "United Kingdom", riskScore: 22, riskLevel: "low", cpiScore: 71, fatfStatus: "Member", taxHaven: false },
|
|
72
|
+
sg: { jurisdiction: "SG", country: "Singapore", riskScore: 25, riskLevel: "low", cpiScore: 83, fatfStatus: "Member", taxHaven: false },
|
|
73
|
+
ch: { jurisdiction: "CH", country: "Switzerland", riskScore: 35, riskLevel: "medium", cpiScore: 82, fatfStatus: "Member", taxHaven: true },
|
|
74
|
+
ky: { jurisdiction: "KY", country: "Cayman Islands", riskScore: 72, riskLevel: "high", cpiScore: null, fatfStatus: "Non-Member", taxHaven: true },
|
|
75
|
+
pa: { jurisdiction: "PA", country: "Panama", riskScore: 78, riskLevel: "high", cpiScore: 36, fatfStatus: "Grey List", taxHaven: true },
|
|
76
|
+
vg: { jurisdiction: "VG", country: "British Virgin Islands", riskScore: 80, riskLevel: "critical", cpiScore: null, fatfStatus: "Non-Member", taxHaven: true },
|
|
77
|
+
sc: { jurisdiction: "SC", country: "Seychelles", riskScore: 75, riskLevel: "high", cpiScore: 70, fatfStatus: "Non-Member", taxHaven: true },
|
|
78
|
+
ae: { jurisdiction: "AE", country: "United Arab Emirates", riskScore: 55, riskLevel: "medium", cpiScore: 67, fatfStatus: "Grey List", taxHaven: false },
|
|
79
|
+
};
|
|
80
|
+
export function crossReferenceEntities(opts) {
|
|
81
|
+
if (opts.test)
|
|
82
|
+
return MOCK_XREF;
|
|
83
|
+
const threshold = opts.threshold ?? 75;
|
|
84
|
+
const matches = [];
|
|
85
|
+
for (const a of opts.entitiesA) {
|
|
86
|
+
for (const b of opts.entitiesB) {
|
|
87
|
+
if (a.type !== b.type)
|
|
88
|
+
continue;
|
|
89
|
+
const normalizer = a.type === "person" ? normalizePerson : normalizeCompany;
|
|
90
|
+
const normA = normalizer(a.name);
|
|
91
|
+
const normB = normalizer(b.name);
|
|
92
|
+
const exactMatch = normA.toUpperCase() === normB.toUpperCase();
|
|
93
|
+
const fuzzy = tokenSortRatio(normA, normB);
|
|
94
|
+
if (!exactMatch && fuzzy < threshold)
|
|
95
|
+
continue;
|
|
96
|
+
const evidence = [];
|
|
97
|
+
const factors = [];
|
|
98
|
+
if (exactMatch) {
|
|
99
|
+
evidence.push("Exact name match after normalization");
|
|
100
|
+
factors.push(["exact_match", 50]);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
evidence.push(`Name fuzzy match ${fuzzy}%`);
|
|
104
|
+
factors.push(["fuzzy_match", fuzzy / 2]);
|
|
105
|
+
}
|
|
106
|
+
if (a.properties && b.properties) {
|
|
107
|
+
for (const [key, valA] of Object.entries(a.properties)) {
|
|
108
|
+
const valB = b.properties[key];
|
|
109
|
+
if (valB && valA.toLowerCase() === valB.toLowerCase()) {
|
|
110
|
+
evidence.push(`Shared property ${key}: ${valA}`);
|
|
111
|
+
factors.push([`${key}_match`, 20]);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
matches.push({
|
|
116
|
+
entityA: { name: a.name, source: a.source, type: a.type },
|
|
117
|
+
entityB: { name: b.name, source: b.source, type: b.type },
|
|
118
|
+
matchScore: exactMatch ? 100 : fuzzy,
|
|
119
|
+
matchType: exactMatch ? "exact" : "fuzzy",
|
|
120
|
+
evidence,
|
|
121
|
+
confidence: computeConfidence(factors),
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
matches.sort((a, b) => b.matchScore - a.matchScore);
|
|
126
|
+
return {
|
|
127
|
+
matches,
|
|
128
|
+
totalEntitiesA: opts.entitiesA.length,
|
|
129
|
+
totalEntitiesB: opts.entitiesB.length,
|
|
130
|
+
provenance: makeProvenance("cross_reference_engine"),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
// ── insider_network_expander ─────────────────────────────────────
|
|
134
|
+
export function expandInsiderNetwork(opts) {
|
|
135
|
+
if (opts.test)
|
|
136
|
+
return MOCK_EXPANSION;
|
|
137
|
+
const maxDepth = opts.maxDepth ?? 2;
|
|
138
|
+
const entityMap = new Map(opts.entities.map((e) => [e.name, e]));
|
|
139
|
+
const adj = new Map();
|
|
140
|
+
for (const conn of opts.knownConnections) {
|
|
141
|
+
if (!adj.has(conn.from))
|
|
142
|
+
adj.set(conn.from, new Set());
|
|
143
|
+
if (!adj.has(conn.to))
|
|
144
|
+
adj.set(conn.to, new Set());
|
|
145
|
+
adj.get(conn.from).add(conn.to);
|
|
146
|
+
adj.get(conn.to).add(conn.from);
|
|
147
|
+
}
|
|
148
|
+
const newConnections = [];
|
|
149
|
+
const originalNames = new Set(opts.entities.map((e) => e.name));
|
|
150
|
+
const allNodes = new Set(originalNames);
|
|
151
|
+
for (const entity of opts.entities) {
|
|
152
|
+
if (!entity.connections)
|
|
153
|
+
continue;
|
|
154
|
+
for (const conn of entity.connections) {
|
|
155
|
+
if (originalNames.has(conn))
|
|
156
|
+
continue;
|
|
157
|
+
allNodes.add(conn);
|
|
158
|
+
newConnections.push({
|
|
159
|
+
fromEntity: entity.name,
|
|
160
|
+
toEntity: conn,
|
|
161
|
+
connectionType: "expanded_connection",
|
|
162
|
+
depth: 1,
|
|
163
|
+
pathDescription: `${entity.name} -> ${conn} (via entity metadata)`,
|
|
164
|
+
confidence: computeConfidence([["metadata_link", 60]]),
|
|
165
|
+
sources: ["entity_metadata"],
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
for (const conn of opts.knownConnections) {
|
|
170
|
+
const neighbors1 = adj.get(conn.to) ?? new Set();
|
|
171
|
+
for (const hop2 of neighbors1) {
|
|
172
|
+
if (originalNames.has(hop2) || hop2 === conn.from)
|
|
173
|
+
continue;
|
|
174
|
+
allNodes.add(hop2);
|
|
175
|
+
newConnections.push({
|
|
176
|
+
fromEntity: conn.from,
|
|
177
|
+
toEntity: hop2,
|
|
178
|
+
connectionType: `indirect_via_${conn.to}`,
|
|
179
|
+
depth: 2,
|
|
180
|
+
pathDescription: `${conn.from} -> ${conn.to} -> ${hop2}`,
|
|
181
|
+
confidence: computeConfidence([["graph_path", 40], ["known_connection", 30]]),
|
|
182
|
+
sources: ["graph_traversal"],
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
newConnections,
|
|
188
|
+
originalNodes: originalNames.size,
|
|
189
|
+
expandedNodes: allNodes.size,
|
|
190
|
+
provenance: makeProvenance("insider_network_expander"),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
// ── compliance_risk_report ───────────────────────────────────────
|
|
194
|
+
export function generateComplianceReport(opts) {
|
|
195
|
+
if (opts.test)
|
|
196
|
+
return MOCK_COMPLIANCE;
|
|
197
|
+
const severityScores = { low: 20, medium: 50, high: 75, critical: 95 };
|
|
198
|
+
const riskFactors = opts.findings.map((f) => ({
|
|
199
|
+
...f,
|
|
200
|
+
score: severityScores[f.severity],
|
|
201
|
+
}));
|
|
202
|
+
const overallScore = riskFactors.length > 0
|
|
203
|
+
? Math.round(riskFactors.reduce((sum, f) => sum + f.score, 0) / riskFactors.length)
|
|
204
|
+
: 0;
|
|
205
|
+
let overallRisk;
|
|
206
|
+
if (overallScore >= 80)
|
|
207
|
+
overallRisk = "critical";
|
|
208
|
+
else if (overallScore >= 60)
|
|
209
|
+
overallRisk = "high";
|
|
210
|
+
else if (overallScore >= 40)
|
|
211
|
+
overallRisk = "medium";
|
|
212
|
+
else
|
|
213
|
+
overallRisk = "low";
|
|
214
|
+
const recommendations = [];
|
|
215
|
+
for (const f of riskFactors) {
|
|
216
|
+
if (f.severity === "critical") {
|
|
217
|
+
recommendations.push(`URGENT: Investigate ${f.category} — ${f.description}`);
|
|
218
|
+
}
|
|
219
|
+
else if (f.severity === "high") {
|
|
220
|
+
recommendations.push(`Review ${f.category} findings and gather additional evidence`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (riskFactors.some((f) => f.category.toLowerCase().includes("insider"))) {
|
|
224
|
+
recommendations.push("Consider filing SEC whistleblower tip");
|
|
225
|
+
}
|
|
226
|
+
if (riskFactors.some((f) => f.category.toLowerCase().includes("politic"))) {
|
|
227
|
+
recommendations.push("Cross-reference congressional committee schedules");
|
|
228
|
+
}
|
|
229
|
+
return {
|
|
230
|
+
subject: opts.subject,
|
|
231
|
+
overallRisk,
|
|
232
|
+
overallScore,
|
|
233
|
+
riskFactors,
|
|
234
|
+
recommendations,
|
|
235
|
+
generatedAt: isoNow(),
|
|
236
|
+
provenance: makeProvenance("compliance_risk_report"),
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
// ── global_entity_resolver ───────────────────────────────────────
|
|
240
|
+
export function resolveGlobalEntities(opts) {
|
|
241
|
+
if (opts.test)
|
|
242
|
+
return MOCK_GLOBAL_ENTITY;
|
|
243
|
+
const threshold = opts.threshold ?? 80;
|
|
244
|
+
const n = opts.entities.length;
|
|
245
|
+
const parent = Array.from({ length: n }, (_, i) => i);
|
|
246
|
+
function find(x) {
|
|
247
|
+
while (parent[x] !== x) {
|
|
248
|
+
parent[x] = parent[parent[x]];
|
|
249
|
+
x = parent[x];
|
|
250
|
+
}
|
|
251
|
+
return x;
|
|
252
|
+
}
|
|
253
|
+
function union(a, b) {
|
|
254
|
+
const ra = find(a), rb = find(b);
|
|
255
|
+
if (ra !== rb)
|
|
256
|
+
parent[rb] = ra;
|
|
257
|
+
}
|
|
258
|
+
for (let i = 0; i < n; i++) {
|
|
259
|
+
for (let j = i + 1; j < n; j++) {
|
|
260
|
+
const a = opts.entities[i], b = opts.entities[j];
|
|
261
|
+
if (a.type !== b.type)
|
|
262
|
+
continue;
|
|
263
|
+
const normalizer = a.type === "person" ? normalizePerson : normalizeCompany;
|
|
264
|
+
const score = tokenSortRatio(normalizer(a.name), normalizer(b.name));
|
|
265
|
+
let idMatch = false;
|
|
266
|
+
if (a.identifiers && b.identifiers) {
|
|
267
|
+
for (const [key, val] of Object.entries(a.identifiers)) {
|
|
268
|
+
if (b.identifiers[key] === val) {
|
|
269
|
+
idMatch = true;
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (score >= threshold || idMatch)
|
|
275
|
+
union(i, j);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
const clusters = new Map();
|
|
279
|
+
for (let i = 0; i < n; i++) {
|
|
280
|
+
const root = find(i);
|
|
281
|
+
const members = clusters.get(root) ?? [];
|
|
282
|
+
members.push(i);
|
|
283
|
+
clusters.set(root, members);
|
|
284
|
+
}
|
|
285
|
+
const resolved = [];
|
|
286
|
+
for (const [root, members] of clusters) {
|
|
287
|
+
const primary = opts.entities[root];
|
|
288
|
+
const normalizer = primary.type === "person" ? normalizePerson : normalizeCompany;
|
|
289
|
+
const allNames = members.map((m) => opts.entities[m].name);
|
|
290
|
+
const allSources = [...new Set(members.map((m) => opts.entities[m].source))];
|
|
291
|
+
const allJurisdictions = [...new Set(members.map((m) => opts.entities[m].jurisdiction).filter(Boolean))];
|
|
292
|
+
const mergedIds = {};
|
|
293
|
+
for (const m of members) {
|
|
294
|
+
const ids = opts.entities[m].identifiers;
|
|
295
|
+
if (ids)
|
|
296
|
+
Object.assign(mergedIds, ids);
|
|
297
|
+
}
|
|
298
|
+
const factors = [["name_match", 40]];
|
|
299
|
+
if (allSources.length > 1)
|
|
300
|
+
factors.push(["cross_source", 30]);
|
|
301
|
+
if (Object.keys(mergedIds).length > 0)
|
|
302
|
+
factors.push(["identifier_link", 20]);
|
|
303
|
+
resolved.push({
|
|
304
|
+
canonicalName: normalizer(primary.name),
|
|
305
|
+
type: primary.type,
|
|
306
|
+
jurisdiction: allJurisdictions.join(","),
|
|
307
|
+
aliases: [...new Set(allNames)],
|
|
308
|
+
identifiers: mergedIds,
|
|
309
|
+
confidence: computeConfidence(factors),
|
|
310
|
+
sources: allSources,
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
return { resolved, unresolved: [], provenance: makeProvenance("global_entity_resolver") };
|
|
314
|
+
}
|
|
315
|
+
// ── jurisdiction_risk_scorer ─────────────────────────────────────
|
|
316
|
+
export function scoreJurisdictionRisk(opts) {
|
|
317
|
+
const assessments = opts.jurisdictions.map((j) => {
|
|
318
|
+
const code = j.toLowerCase().trim();
|
|
319
|
+
const data = JURISDICTION_RISK_DB[code];
|
|
320
|
+
if (data) {
|
|
321
|
+
const factors = [];
|
|
322
|
+
if (data.taxHaven)
|
|
323
|
+
factors.push({ factor: "Tax haven jurisdiction", score: 30 });
|
|
324
|
+
if (data.fatfStatus === "Grey List")
|
|
325
|
+
factors.push({ factor: "FATF grey list", score: 25 });
|
|
326
|
+
if (data.fatfStatus === "Non-Member")
|
|
327
|
+
factors.push({ factor: "Not FATF member", score: 20 });
|
|
328
|
+
if (data.cpiScore !== null && data.cpiScore < 50)
|
|
329
|
+
factors.push({ factor: `Low CPI score (${data.cpiScore})`, score: 15 });
|
|
330
|
+
return { ...data, factors };
|
|
331
|
+
}
|
|
332
|
+
return {
|
|
333
|
+
jurisdiction: j.toUpperCase(),
|
|
334
|
+
country: j,
|
|
335
|
+
riskScore: 50,
|
|
336
|
+
riskLevel: "medium",
|
|
337
|
+
factors: [{ factor: "Unknown jurisdiction", score: 50 }],
|
|
338
|
+
cpiScore: null,
|
|
339
|
+
fatfStatus: "Unknown",
|
|
340
|
+
taxHaven: false,
|
|
341
|
+
};
|
|
342
|
+
});
|
|
343
|
+
return { assessments, provenance: makeProvenance("jurisdiction_risk_scorer") };
|
|
344
|
+
}
|
|
345
|
+
//# sourceMappingURL=investigation-automation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"investigation-automation.js","sourceRoot":"","sources":["../../src/investigation-tools/investigation-automation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAc,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EACL,cAAc,EACd,iBAAiB,GAGlB,MAAM,oBAAoB,CAAC;AAuF5B,oEAAoE;AAEpE,MAAM,SAAS,GAAyB;IACtC,OAAO,EAAE;QACP;YACE,OAAO,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxE,OAAO,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ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@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* monitoring-tools.ts — Real-time monitoring for whale alerts, dark pool activity,
|
|
3
|
+
* corporate filings, and real estate records.
|
|
4
|
+
*
|
|
5
|
+
* Tools: whale_alert_monitor, dark_pool_activity, corporate_filings_monitor, real_estate_records
|
|
6
|
+
*/
|
|
7
|
+
import { type Provenance } from "./shared-crypto.js";
|
|
8
|
+
export interface WhaleTransaction {
|
|
9
|
+
blockchain: string;
|
|
10
|
+
txHash: string;
|
|
11
|
+
timestamp: string;
|
|
12
|
+
from: {
|
|
13
|
+
address: string;
|
|
14
|
+
label: string;
|
|
15
|
+
};
|
|
16
|
+
to: {
|
|
17
|
+
address: string;
|
|
18
|
+
label: string;
|
|
19
|
+
};
|
|
20
|
+
amount: number;
|
|
21
|
+
amountUsd: number;
|
|
22
|
+
symbol: string;
|
|
23
|
+
transactionType: string;
|
|
24
|
+
}
|
|
25
|
+
export interface WhaleAlertResult {
|
|
26
|
+
transactions: WhaleTransaction[];
|
|
27
|
+
total: number;
|
|
28
|
+
provenance: Provenance;
|
|
29
|
+
}
|
|
30
|
+
export interface DarkPoolTrade {
|
|
31
|
+
symbol: string;
|
|
32
|
+
date: string;
|
|
33
|
+
volume: number;
|
|
34
|
+
avgPrice: number;
|
|
35
|
+
totalValue: number;
|
|
36
|
+
darkPoolPct: number;
|
|
37
|
+
exchange: string;
|
|
38
|
+
shortVolume: number;
|
|
39
|
+
shortPct: number;
|
|
40
|
+
}
|
|
41
|
+
export interface DarkPoolResult {
|
|
42
|
+
trades: DarkPoolTrade[];
|
|
43
|
+
total: number;
|
|
44
|
+
provenance: Provenance;
|
|
45
|
+
}
|
|
46
|
+
export interface FilingAlert {
|
|
47
|
+
company: string;
|
|
48
|
+
ticker: string;
|
|
49
|
+
filingType: string;
|
|
50
|
+
filingDate: string;
|
|
51
|
+
description: string;
|
|
52
|
+
url: string;
|
|
53
|
+
significance: "routine" | "notable" | "urgent";
|
|
54
|
+
}
|
|
55
|
+
export interface FilingMonitorResult {
|
|
56
|
+
alerts: FilingAlert[];
|
|
57
|
+
total: number;
|
|
58
|
+
provenance: Provenance;
|
|
59
|
+
}
|
|
60
|
+
export interface PropertyRecord {
|
|
61
|
+
address: string;
|
|
62
|
+
ownerName: string;
|
|
63
|
+
ownerType: string;
|
|
64
|
+
assessedValue: number;
|
|
65
|
+
salePrice: number | null;
|
|
66
|
+
saleDate: string | null;
|
|
67
|
+
propertyType: string;
|
|
68
|
+
county: string;
|
|
69
|
+
state: string;
|
|
70
|
+
parcellId: string;
|
|
71
|
+
}
|
|
72
|
+
export interface PropertyResult {
|
|
73
|
+
records: PropertyRecord[];
|
|
74
|
+
total: number;
|
|
75
|
+
provenance: Provenance;
|
|
76
|
+
}
|
|
77
|
+
export declare function monitorWhaleAlerts(opts: {
|
|
78
|
+
minUsd?: number;
|
|
79
|
+
blockchain?: string;
|
|
80
|
+
symbol?: string;
|
|
81
|
+
limit?: number;
|
|
82
|
+
apiKey?: string;
|
|
83
|
+
test?: boolean;
|
|
84
|
+
}): Promise<WhaleAlertResult>;
|
|
85
|
+
export declare function fetchDarkPoolActivity(opts: {
|
|
86
|
+
ticker: string;
|
|
87
|
+
daysBack?: number;
|
|
88
|
+
test?: boolean;
|
|
89
|
+
}): Promise<DarkPoolResult>;
|
|
90
|
+
export declare function monitorCorporateFilings(opts: {
|
|
91
|
+
tickers: string[];
|
|
92
|
+
formTypes?: string[];
|
|
93
|
+
daysBack?: number;
|
|
94
|
+
test?: boolean;
|
|
95
|
+
}): Promise<FilingMonitorResult>;
|
|
96
|
+
export declare function searchPropertyRecords(opts: {
|
|
97
|
+
ownerName?: string;
|
|
98
|
+
address?: string;
|
|
99
|
+
state?: string;
|
|
100
|
+
test?: boolean;
|
|
101
|
+
}): Promise<PropertyResult>;
|
|
102
|
+
//# sourceMappingURL=monitoring-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitoring-tools.d.ts","sourceR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