brainblast 0.6.4 → 0.7.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.
package/dist/index.js CHANGED
@@ -1,37 +1,76 @@
1
+ import {
2
+ checkDrift,
3
+ renderDriftText,
4
+ seedPackages
5
+ } from "./chunk-EAKU3L7F.js";
6
+ import {
7
+ KNOWN_PROGRAMS,
8
+ analyzeInstructions,
9
+ decodeTransaction,
10
+ inspectTransaction,
11
+ parseCpiPrograms,
12
+ renderFirewallText
13
+ } from "./chunk-HL7NVANZ.js";
14
+ import {
15
+ gradeAtLeast,
16
+ gradeForScore,
17
+ renderScoreText,
18
+ scoreFromProgram,
19
+ scoreProgram
20
+ } from "./chunk-UWE6HAGS.js";
21
+ import {
22
+ parseMintAccount,
23
+ pumpPreflight,
24
+ renderPreflightText
25
+ } from "./chunk-WX3IR7LK.js";
26
+ import {
27
+ batchScan,
28
+ parseMintList,
29
+ renderBatchText
30
+ } from "./chunk-QC27GNQ7.js";
31
+ import {
32
+ analyzeToken,
33
+ deployerFlagsFrom,
34
+ renderRicoText
35
+ } from "./chunk-FQA5BYWW.js";
36
+ import {
37
+ verifyTokenIdentity
38
+ } from "./chunk-VI2JBH2T.js";
1
39
  import {
2
40
  DEFAULT_REGISTRY_URL,
3
- DEFAULT_TTL_HOURS,
4
41
  analyzeCosts,
5
42
  applyDiffToFile,
6
- base58Decode,
7
- base58Encode,
8
- buildTrustGraph,
9
- cacheSize,
10
- defaultCachePath,
11
- getCacheEntry,
12
- getCacheEntryMeta,
13
43
  getRepoHash,
14
44
  getUserHash,
15
45
  initPack,
16
- isEntryExpired,
17
46
  isTelemetryEnabled,
18
- isValidSolanaAddress,
19
47
  lamportsToSol,
20
- loadDirectory,
21
- loadProgramCache,
22
48
  parseDiff,
23
- putCacheEntry,
24
49
  recordGraduationEvents,
25
50
  renderCostReportMd,
26
- renderTrustGraphMd,
27
51
  rentExemptMinimum,
28
52
  runIncrementalScan,
29
- saveProgramCache,
30
53
  startWatch,
31
54
  submitTelemetry,
32
55
  telemetryFilePath,
33
56
  validatePack
34
- } from "./chunk-HXQNNGSC.js";
57
+ } from "./chunk-34VXOLJF.js";
58
+ import {
59
+ renderTrustGraphMd
60
+ } from "./chunk-2UZGWXIX.js";
61
+ import {
62
+ DEFAULT_TTL_HOURS,
63
+ buildTrustGraph,
64
+ cacheSize,
65
+ defaultCachePath,
66
+ getCacheEntry,
67
+ getCacheEntryMeta,
68
+ isEntryExpired,
69
+ loadDirectory,
70
+ loadProgramCache,
71
+ putCacheEntry,
72
+ saveProgramCache
73
+ } from "./chunk-SVSVVW6U.js";
35
74
  import {
36
75
  PACK_MANIFEST_FILE,
37
76
  audit,
@@ -52,7 +91,21 @@ import {
52
91
  runChecker,
53
92
  testKinds,
54
93
  validatePackManifest
55
- } from "./chunk-2Y6UILTZ.js";
94
+ } from "./chunk-CRYFCQYM.js";
95
+ import {
96
+ CANONICAL_BY_MINT,
97
+ CANONICAL_MINTS,
98
+ canonicalMintForSymbol,
99
+ isCanonicalMint
100
+ } from "./chunk-2XJORJPQ.js";
101
+ import {
102
+ buildConstraintParams,
103
+ generateRulesFromIdl,
104
+ idlProgramName,
105
+ parseIdl,
106
+ renderRulesYaml,
107
+ toSnakeCase
108
+ } from "./chunk-O5Z4ZJHC.js";
56
109
  import {
57
110
  diffVersions,
58
111
  queryOsv,
@@ -61,24 +114,16 @@ import {
61
114
  riskScore
62
115
  } from "./chunk-SC6RNNDW.js";
63
116
  import {
64
- checkDrift,
65
- renderDriftText,
66
- seedPackages
67
- } from "./chunk-EAKU3L7F.js";
117
+ initialChainWatchState,
118
+ pollChainOnce,
119
+ startChainWatch
120
+ } from "./chunk-DQ4KAYKQ.js";
121
+ import "./chunk-XSVQSK53.js";
68
122
  import {
69
- analyzeToken,
70
- deployerFlagsFrom,
71
- renderRicoText
72
- } from "./chunk-FQA5BYWW.js";
73
- import {
74
- verifyTokenIdentity
75
- } from "./chunk-VI2JBH2T.js";
76
- import {
77
- CANONICAL_BY_MINT,
78
- CANONICAL_MINTS,
79
- canonicalMintForSymbol,
80
- isCanonicalMint
81
- } from "./chunk-2XJORJPQ.js";
123
+ base58Decode,
124
+ base58Encode,
125
+ isValidSolanaAddress
126
+ } from "./chunk-VG5FMOLW.js";
82
127
  import "./chunk-3RG5ZIWI.js";
83
128
 
84
129
  // src/generate.ts
@@ -99,26 +144,32 @@ export {
99
144
  CANONICAL_MINTS,
100
145
  DEFAULT_REGISTRY_URL,
101
146
  DEFAULT_TTL_HOURS,
147
+ KNOWN_PROGRAMS,
102
148
  PACK_MANIFEST_FILE,
103
149
  analyzeCosts,
150
+ analyzeInstructions,
104
151
  analyzeToken,
105
152
  applyDiffToFile,
106
153
  audit,
107
154
  auditWithRule,
108
155
  base58Decode,
109
156
  base58Encode,
157
+ batchScan,
158
+ buildConstraintParams,
110
159
  buildTrustGraph,
111
160
  rules as bundledRules,
112
161
  cacheSize,
113
162
  canonicalMintForSymbol,
114
163
  checkDrift,
115
164
  checkerKinds,
165
+ decodeTransaction,
116
166
  defaultCachePath,
117
167
  deployerFlagsFrom,
118
168
  diffVersions,
119
169
  fileChanged,
120
170
  findCandidates,
121
171
  findConfigCandidates,
172
+ generateRulesFromIdl,
122
173
  generateTestForResult,
123
174
  getCacheEntry,
124
175
  getCacheEntryMeta,
@@ -126,7 +177,12 @@ export {
126
177
  getRepoHash,
127
178
  getUserHash,
128
179
  getWorkingTreeChanges,
180
+ gradeAtLeast,
181
+ gradeForScore,
182
+ idlProgramName,
129
183
  initPack,
184
+ initialChainWatchState,
185
+ inspectTransaction,
130
186
  isCanonicalMint,
131
187
  isEntryExpired,
132
188
  isTelemetryEnabled,
@@ -137,16 +193,27 @@ export {
137
193
  loadPacksFromDir,
138
194
  loadProgramCache,
139
195
  loadRules,
196
+ parseCpiPrograms,
140
197
  parseDiff,
198
+ parseIdl,
199
+ parseMintAccount,
200
+ parseMintList,
201
+ pollChainOnce,
202
+ pumpPreflight,
141
203
  putCacheEntry,
142
204
  queryOsv,
143
205
  rangeChanged,
144
206
  recordGraduationEvents,
207
+ renderBatchText,
145
208
  renderCostReportMd,
146
209
  renderDiffMd,
147
210
  renderDiffText,
148
211
  renderDriftText,
212
+ renderFirewallText,
213
+ renderPreflightText,
149
214
  renderRicoText,
215
+ renderRulesYaml,
216
+ renderScoreText,
150
217
  renderTest,
151
218
  renderTrustGraphMd,
152
219
  rentExemptMinimum,
@@ -155,11 +222,15 @@ export {
155
222
  runChecker,
156
223
  runIncrementalScan,
157
224
  saveProgramCache,
225
+ scoreFromProgram,
226
+ scoreProgram,
158
227
  seedPackages,
228
+ startChainWatch,
159
229
  startWatch,
160
230
  submitTelemetry,
161
231
  telemetryFilePath,
162
232
  testKinds,
233
+ toSnakeCase,
163
234
  validatePack,
164
235
  validatePackManifest,
165
236
  verifyTokenIdentity
@@ -1,12 +1,13 @@
1
1
  import {
2
2
  audit,
3
3
  resolveRules
4
- } from "./chunk-2Y6UILTZ.js";
4
+ } from "./chunk-CRYFCQYM.js";
5
+ import "./chunk-2XJORJPQ.js";
6
+ import "./chunk-O5Z4ZJHC.js";
5
7
  import {
6
8
  diffVersions,
7
9
  queryOsv
8
10
  } from "./chunk-SC6RNNDW.js";
9
- import "./chunk-2XJORJPQ.js";
10
11
  import "./chunk-3RG5ZIWI.js";
11
12
 
12
13
  // src/mcp.ts
@@ -0,0 +1,16 @@
1
+ import {
2
+ parseMintAccount,
3
+ pumpPreflight,
4
+ renderPreflightText
5
+ } from "./chunk-WX3IR7LK.js";
6
+ import "./chunk-FQA5BYWW.js";
7
+ import "./chunk-VI2JBH2T.js";
8
+ import "./chunk-2XJORJPQ.js";
9
+ import "./chunk-XSVQSK53.js";
10
+ import "./chunk-VG5FMOLW.js";
11
+ import "./chunk-3RG5ZIWI.js";
12
+ export {
13
+ parseMintAccount,
14
+ pumpPreflight,
15
+ renderPreflightText
16
+ };
@@ -0,0 +1,18 @@
1
+ import {
2
+ BPF_LOADER_2,
3
+ BPF_UPGRADEABLE_LOADER,
4
+ DEFAULT_RPC,
5
+ NATIVE_LOADER,
6
+ getAccountInfo,
7
+ probeUpgradeAuthority
8
+ } from "./chunk-XSVQSK53.js";
9
+ import "./chunk-VG5FMOLW.js";
10
+ import "./chunk-3RG5ZIWI.js";
11
+ export {
12
+ BPF_LOADER_2,
13
+ BPF_UPGRADEABLE_LOADER,
14
+ DEFAULT_RPC,
15
+ NATIVE_LOADER,
16
+ getAccountInfo,
17
+ probeUpgradeAuthority
18
+ };
@@ -0,0 +1,18 @@
1
+ import {
2
+ gradeAtLeast,
3
+ gradeForScore,
4
+ renderScoreText,
5
+ scoreFromProgram,
6
+ scoreProgram
7
+ } from "./chunk-UWE6HAGS.js";
8
+ import "./chunk-SVSVVW6U.js";
9
+ import "./chunk-XSVQSK53.js";
10
+ import "./chunk-VG5FMOLW.js";
11
+ import "./chunk-3RG5ZIWI.js";
12
+ export {
13
+ gradeAtLeast,
14
+ gradeForScore,
15
+ renderScoreText,
16
+ scoreFromProgram,
17
+ scoreProgram
18
+ };
@@ -0,0 +1,49 @@
1
+ import {
2
+ renderProgram,
3
+ renderTrustGraphMd
4
+ } from "./chunk-2UZGWXIX.js";
5
+ import {
6
+ DEFAULT_TTL_HOURS,
7
+ buildTrustGraph,
8
+ cacheSize,
9
+ defaultCachePath,
10
+ getCacheEntry,
11
+ getCacheEntryMeta,
12
+ isEntryExpired,
13
+ loadDirectory,
14
+ loadProgramCache,
15
+ putCacheEntry,
16
+ saveProgramCache
17
+ } from "./chunk-SVSVVW6U.js";
18
+ import {
19
+ DEFAULT_RPC,
20
+ getAccountInfo,
21
+ probeUpgradeAuthority
22
+ } from "./chunk-XSVQSK53.js";
23
+ import {
24
+ base58Decode,
25
+ base58Encode,
26
+ isValidSolanaAddress
27
+ } from "./chunk-VG5FMOLW.js";
28
+ import "./chunk-3RG5ZIWI.js";
29
+ export {
30
+ DEFAULT_RPC,
31
+ DEFAULT_TTL_HOURS,
32
+ base58Decode,
33
+ base58Encode,
34
+ buildTrustGraph,
35
+ cacheSize,
36
+ defaultCachePath,
37
+ getAccountInfo,
38
+ getCacheEntry,
39
+ getCacheEntryMeta,
40
+ isEntryExpired,
41
+ isValidSolanaAddress,
42
+ loadDirectory,
43
+ loadProgramCache,
44
+ probeUpgradeAuthority,
45
+ putCacheEntry,
46
+ renderProgram,
47
+ renderTrustGraphMd,
48
+ saveProgramCache
49
+ };
@@ -0,0 +1,13 @@
1
+ import {
2
+ initialChainWatchState,
3
+ pollChainOnce,
4
+ startChainWatch
5
+ } from "./chunk-DQ4KAYKQ.js";
6
+ import "./chunk-XSVQSK53.js";
7
+ import "./chunk-VG5FMOLW.js";
8
+ import "./chunk-3RG5ZIWI.js";
9
+ export {
10
+ initialChainWatchState,
11
+ pollChainOnce,
12
+ startChainWatch
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brainblast",
3
- "version": "0.6.4",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "description": "Deterministic auditor for catastrophic AI-integration bugs: scan a repo, find the silent money/auth traps, and generate the behavioral test that proves they're fixed.",
6
6
  "keywords": [
@@ -72,6 +72,7 @@
72
72
  "devDependencies": {
73
73
  "@metaplex-foundation/mpl-token-metadata": "^3.4.0",
74
74
  "@solana/spl-token": "^0.4.14",
75
+ "@solana/web3.js": "^1.98.4",
75
76
  "@types/node": "^22",
76
77
  "@vitest/coverage-v8": "^2",
77
78
  "jose": "^5",