@r_masseater/h56m 0.2.0 → 0.3.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/README.md CHANGED
@@ -7,13 +7,13 @@ A secret scanner written in Rust and configured from `vite.config.ts`.
7
7
  Its matching engine follows [Betterleaks](https://github.com/betterleaks/betterleaks)
8
8
  and reads settings in the Betterleaks format, including filters, components and
9
9
  decoding of base64, hex, percent and unicode text. It has no rules of its own: extend
10
- a preset from [@r_masseater/h56m-presets](https://www.npmjs.com/package/@r_masseater/h56m-presets)
10
+ a preset from the `@r_masseater/h56m/presets` subpath
11
11
  or a TOML file of your own. It scans the commits a branch adds, the staged changes, a
12
12
  tree, or any text. It does not call the services the secrets belong to.
13
13
 
14
14
  ```ts
15
15
  import "@r_masseater/h56m/vite";
16
- import { betterleaks } from "@r_masseater/h56m-presets";
16
+ import { betterleaks } from "@r_masseater/h56m/presets";
17
17
  import { defineConfig } from "vite-plus";
18
18
 
19
19
  export default defineConfig({
@@ -36,9 +36,30 @@ findings; `src/app/fixtures/` holds them.
36
36
 
37
37
  The engine ports code from Betterleaks, which is under MIT, and embeds its word list, which is under CC-BY-SA-4.0. `THIRD-PARTY-NOTICES.txt` holds their notices.
38
38
 
39
+ ## Presets
40
+
41
+ | Export | Rules |
42
+ | ------------- | ---------------------------------------------------------------------------------------------------------- |
43
+ | `betterleaks` | The default configuration of [Betterleaks](https://github.com/betterleaks/betterleaks), at a pinned commit |
44
+
45
+ ```ts
46
+ import "@r_masseater/h56m/vite";
47
+ import { betterleaks } from "@r_masseater/h56m/presets";
48
+ import { defineConfig } from "vite-plus";
49
+
50
+ export default defineConfig({
51
+ h56m: { extend: { path: betterleaks, disabledRules: ["generic-api-key"] } },
52
+ });
53
+ ```
54
+
55
+ Each export is the absolute path of a TOML file in the Betterleaks format. The files are plain data,
56
+ so they need no native build of their own.
57
+
58
+ The Betterleaks rules are under the MIT license. `THIRD-PARTY-NOTICES.txt` holds the notice.
59
+
39
60
  ## Comparison
40
61
 
41
- Measured on 2026-11-19 on linux x64, 4 CPUs with [lint-bench](https://github.com/masseater/masseater.dev/tree/main/tools/lint-bench), which keeps the full results in [results.md](https://github.com/masseater/masseater.dev/blob/main/tools/lint-bench/results/results.md). Cold runs drop the page cache and the tools' caches first. "Same as ours", "Only ours" and "Only theirs" compare findings by file, line and rule where both tools use the same rules.
62
+ Measured on 2026-11-19 on linux x64, 4 CPUs with [lint-bench](https://github.com/masseater/ecosystems/tree/main/tools/lint-bench), which keeps the full results in [results.md](https://github.com/masseater/ecosystems/blob/main/tools/lint-bench/results/results.md). Cold runs drop the page cache and the tools' caches first. "Same as ours", "Only ours" and "Only theirs" compare findings by file, line and rule where both tools use the same rules.
42
63
 
43
64
  h56m uses the Betterleaks rules and, like Betterleaks, scans only the lines each commit adds. Its findings match Betterleaks on both repositories. It runs 2 to 3 times slower than Betterleaks.
44
65
 
@@ -76,4 +97,4 @@ h56m uses the Betterleaks rules and, like Betterleaks, scans only the lines each
76
97
 
77
98
  ## Agent skills
78
99
 
79
- The package ships TanStack Intent skills for coding agents. Load one with `vp exec intent load @r_masseater/h56m#<skill>`.
100
+ The package ships agent skills in `skills/`. Add `permissions: { "@r_masseater/h56m": { skills: true } }` to `pnpm-workspace.yaml` and `vp install` links them into the skill directories of your agents.
@@ -1,11 +1,4 @@
1
- h56m third-party notices
2
-
3
- The matching engine in native/core ports the scanner, expression functions, search
4
- windows and decoders of Betterleaks, and embeds its word list
5
- (native/core/assets/words.txt.gz), which derives from wordfreq data.
6
-
7
- ===== Betterleaks (MIT) =====
8
-
1
+ Betterleaks (MIT)
9
2
  https://github.com/betterleaks/betterleaks/blob/e07e69ba6a441313529b3e72be43ffdcc62bdf86/LICENSE
10
3
 
11
4
  MIT License
@@ -29,503 +22,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
22
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
23
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
24
  SOFTWARE.
32
-
33
- ===== Betterleaks wordfreq-derived wordlist data (CC-BY-SA-4.0) =====
34
-
35
- https://raw.githubusercontent.com/rspeer/wordfreq/912caf64b657478d1dff1138efdc078947d54bb1/NOTICE.md
36
-
37
- wordfreq
38
- Copyright 2022 Robyn Speer
39
-
40
- # Attribution notes
41
-
42
- Robyn Speer must be credited as Robyn Speer, which is her maiden name, used on academic work.
43
- Crediting her as Elia Robyn Lake (her married name) will make the credit less effective, as it will
44
- not line up with other work.
45
-
46
- Crediting Robyn Speer by a different name than one of the above is a serious violation of the license,
47
- in which case you do not have permission to use, copy, or redistribute wordfreq.
48
-
49
- If you use wordfreq in academic work, you must cite it. See "Citing wordfreq" in README.md.
50
-
51
- # Included licenses
52
-
53
- `wordfreq` is freely redistributable under the Apache license (see
54
- `LICENSE.txt`), and it includes data files that may be
55
- redistributed under a Creative Commons Attribution-ShareAlike 4.0
56
- license (<https://creativecommons.org/licenses/by-sa/4.0/>).
57
-
58
- `wordfreq` contains data extracted from Google Books Ngrams
59
- (<http://books.google.com/ngrams>) and Google Books Syntactic Ngrams
60
- (<http://commondatastorage.googleapis.com/books/syntactic-ngrams/index.html>).
61
- The terms of use of this data are:
62
-
63
- Ngram Viewer graphs and data may be freely used for any purpose, although
64
- acknowledgement of Google Books Ngram Viewer as the source, and inclusion
65
- of a link to http://books.google.com/ngrams, would be appreciated.
66
-
67
- `wordfreq` also contains data derived from the following Creative Commons-licensed
68
- sources:
69
-
70
- - The Leeds Internet Corpus, from the University of Leeds Centre for Translation
71
- Studies (<http://corpus.leeds.ac.uk/list.html>)
72
-
73
- - Wikipedia, the free encyclopedia (<http://www.wikipedia.org>)
74
-
75
- - ParaCrawl, a multilingual Web crawl (<https://paracrawl.eu>)
76
-
77
- It contains data from OPUS OpenSubtitles 2018
78
- (<http://opus.nlpl.eu/OpenSubtitles.php>), whose data originates from the
79
- OpenSubtitles project (<http://www.opensubtitles.org/>) and may be used with
80
- attribution to OpenSubtitles.
81
-
82
- It contains data from various SUBTLEX word lists: SUBTLEX-US, SUBTLEX-UK,
83
- SUBTLEX-CH, SUBTLEX-DE, and SUBTLEX-NL, created by Marc Brysbaert et al.
84
- (see citations below) and available at
85
- <http://crr.ugent.be/programs-data/subtitle-frequencies>.
86
-
87
- I (Robyn Speer) have obtained permission by e-mail from Marc Brysbaert to
88
- distribute these wordlists in wordfreq, to be used for any purpose, not just
89
- for academic use, under these conditions:
90
-
91
- - Wordfreq and code derived from it must credit the SUBTLEX authors.
92
- - It must remain clear that SUBTLEX is freely available data.
93
-
94
- These terms are similar to the Creative Commons Attribution-ShareAlike license.
95
-
96
- Some additional data was collected by a custom application that watched the
97
- streaming Twitter API, in accordance with Twitter's Developer Agreement &
98
- Policy. This software gives statistics about words that were commonly used on
99
- Twitter; it does not display or republish any Twitter content, and does not
100
- contain any content from after Twitter's sale.
101
-
102
-
103
- https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt
104
-
105
- Attribution-ShareAlike 4.0 International
106
-
107
- =======================================================================
108
-
109
- Creative Commons Corporation ("Creative Commons") is not a law firm and
110
- does not provide legal services or legal advice. Distribution of
111
- Creative Commons public licenses does not create a lawyer-client or
112
- other relationship. Creative Commons makes its licenses and related
113
- information available on an "as-is" basis. Creative Commons gives no
114
- warranties regarding its licenses, any material licensed under their
115
- terms and conditions, or any related information. Creative Commons
116
- disclaims all liability for damages resulting from their use to the
117
- fullest extent possible.
118
-
119
- Using Creative Commons Public Licenses
120
-
121
- Creative Commons public licenses provide a standard set of terms and
122
- conditions that creators and other rights holders may use to share
123
- original works of authorship and other material subject to copyright
124
- and certain other rights specified in the public license below. The
125
- following considerations are for informational purposes only, are not
126
- exhaustive, and do not form part of our licenses.
127
-
128
- Considerations for licensors: Our public licenses are
129
- intended for use by those authorized to give the public
130
- permission to use material in ways otherwise restricted by
131
- copyright and certain other rights. Our licenses are
132
- irrevocable. Licensors should read and understand the terms
133
- and conditions of the license they choose before applying it.
134
- Licensors should also secure all rights necessary before
135
- applying our licenses so that the public can reuse the
136
- material as expected. Licensors should clearly mark any
137
- material not subject to the license. This includes other CC-
138
- licensed material, or material used under an exception or
139
- limitation to copyright. More considerations for licensors:
140
- wiki.creativecommons.org/Considerations_for_licensors
141
-
142
- Considerations for the public: By using one of our public
143
- licenses, a licensor grants the public permission to use the
144
- licensed material under specified terms and conditions. If
145
- the licensor's permission is not necessary for any reason--for
146
- example, because of any applicable exception or limitation to
147
- copyright--then that use is not regulated by the license. Our
148
- licenses grant only permissions under copyright and certain
149
- other rights that a licensor has authority to grant. Use of
150
- the licensed material may still be restricted for other
151
- reasons, including because others have copyright or other
152
- rights in the material. A licensor may make special requests,
153
- such as asking that all changes be marked or described.
154
- Although not required by our licenses, you are encouraged to
155
- respect those requests where reasonable. More considerations
156
- for the public:
157
- wiki.creativecommons.org/Considerations_for_licensees
158
-
159
- =======================================================================
160
-
161
- Creative Commons Attribution-ShareAlike 4.0 International Public
162
- License
163
-
164
- By exercising the Licensed Rights (defined below), You accept and agree
165
- to be bound by the terms and conditions of this Creative Commons
166
- Attribution-ShareAlike 4.0 International Public License ("Public
167
- License"). To the extent this Public License may be interpreted as a
168
- contract, You are granted the Licensed Rights in consideration of Your
169
- acceptance of these terms and conditions, and the Licensor grants You
170
- such rights in consideration of benefits the Licensor receives from
171
- making the Licensed Material available under these terms and
172
- conditions.
173
-
174
-
175
- Section 1 -- Definitions.
176
-
177
- a. Adapted Material means material subject to Copyright and Similar
178
- Rights that is derived from or based upon the Licensed Material
179
- and in which the Licensed Material is translated, altered,
180
- arranged, transformed, or otherwise modified in a manner requiring
181
- permission under the Copyright and Similar Rights held by the
182
- Licensor. For purposes of this Public License, where the Licensed
183
- Material is a musical work, performance, or sound recording,
184
- Adapted Material is always produced where the Licensed Material is
185
- synched in timed relation with a moving image.
186
-
187
- b. Adapter's License means the license You apply to Your Copyright
188
- and Similar Rights in Your contributions to Adapted Material in
189
- accordance with the terms and conditions of this Public License.
190
-
191
- c. BY-SA Compatible License means a license listed at
192
- creativecommons.org/compatiblelicenses, approved by Creative
193
- Commons as essentially the equivalent of this Public License.
194
-
195
- d. Copyright and Similar Rights means copyright and/or similar rights
196
- closely related to copyright including, without limitation,
197
- performance, broadcast, sound recording, and Sui Generis Database
198
- Rights, without regard to how the rights are labeled or
199
- categorized. For purposes of this Public License, the rights
200
- specified in Section 2(b)(1)-(2) are not Copyright and Similar
201
- Rights.
202
-
203
- e. Effective Technological Measures means those measures that, in the
204
- absence of proper authority, may not be circumvented under laws
205
- fulfilling obligations under Article 11 of the WIPO Copyright
206
- Treaty adopted on December 20, 1996, and/or similar international
207
- agreements.
208
-
209
- f. Exceptions and Limitations means fair use, fair dealing, and/or
210
- any other exception or limitation to Copyright and Similar Rights
211
- that applies to Your use of the Licensed Material.
212
-
213
- g. License Elements means the license attributes listed in the name
214
- of a Creative Commons Public License. The License Elements of this
215
- Public License are Attribution and ShareAlike.
216
-
217
- h. Licensed Material means the artistic or literary work, database,
218
- or other material to which the Licensor applied this Public
219
- License.
220
-
221
- i. Licensed Rights means the rights granted to You subject to the
222
- terms and conditions of this Public License, which are limited to
223
- all Copyright and Similar Rights that apply to Your use of the
224
- Licensed Material and that the Licensor has authority to license.
225
-
226
- j. Licensor means the individual(s) or entity(ies) granting rights
227
- under this Public License.
228
-
229
- k. Share means to provide material to the public by any means or
230
- process that requires permission under the Licensed Rights, such
231
- as reproduction, public display, public performance, distribution,
232
- dissemination, communication, or importation, and to make material
233
- available to the public including in ways that members of the
234
- public may access the material from a place and at a time
235
- individually chosen by them.
236
-
237
- l. Sui Generis Database Rights means rights other than copyright
238
- resulting from Directive 96/9/EC of the European Parliament and of
239
- the Council of 11 March 1996 on the legal protection of databases,
240
- as amended and/or succeeded, as well as other essentially
241
- equivalent rights anywhere in the world.
242
-
243
- m. You means the individual or entity exercising the Licensed Rights
244
- under this Public License. Your has a corresponding meaning.
245
-
246
-
247
- Section 2 -- Scope.
248
-
249
- a. License grant.
250
-
251
- 1. Subject to the terms and conditions of this Public License,
252
- the Licensor hereby grants You a worldwide, royalty-free,
253
- non-sublicensable, non-exclusive, irrevocable license to
254
- exercise the Licensed Rights in the Licensed Material to:
255
-
256
- a. reproduce and Share the Licensed Material, in whole or
257
- in part; and
258
-
259
- b. produce, reproduce, and Share Adapted Material.
260
-
261
- 2. Exceptions and Limitations. For the avoidance of doubt, where
262
- Exceptions and Limitations apply to Your use, this Public
263
- License does not apply, and You do not need to comply with
264
- its terms and conditions.
265
-
266
- 3. Term. The term of this Public License is specified in Section
267
- 6(a).
268
-
269
- 4. Media and formats; technical modifications allowed. The
270
- Licensor authorizes You to exercise the Licensed Rights in
271
- all media and formats whether now known or hereafter created,
272
- and to make technical modifications necessary to do so. The
273
- Licensor waives and/or agrees not to assert any right or
274
- authority to forbid You from making technical modifications
275
- necessary to exercise the Licensed Rights, including
276
- technical modifications necessary to circumvent Effective
277
- Technological Measures. For purposes of this Public License,
278
- simply making modifications authorized by this Section 2(a)
279
- (4) never produces Adapted Material.
280
-
281
- 5. Downstream recipients.
282
-
283
- a. Offer from the Licensor -- Licensed Material. Every
284
- recipient of the Licensed Material automatically
285
- receives an offer from the Licensor to exercise the
286
- Licensed Rights under the terms and conditions of this
287
- Public License.
288
-
289
- b. Additional offer from the Licensor -- Adapted Material.
290
- Every recipient of Adapted Material from You
291
- automatically receives an offer from the Licensor to
292
- exercise the Licensed Rights in the Adapted Material
293
- under the conditions of the Adapter's License You apply.
294
-
295
- c. No downstream restrictions. You may not offer or impose
296
- any additional or different terms or conditions on, or
297
- apply any Effective Technological Measures to, the
298
- Licensed Material if doing so restricts exercise of the
299
- Licensed Rights by any recipient of the Licensed
300
- Material.
301
-
302
- 6. No endorsement. Nothing in this Public License constitutes or
303
- may be construed as permission to assert or imply that You
304
- are, or that Your use of the Licensed Material is, connected
305
- with, or sponsored, endorsed, or granted official status by,
306
- the Licensor or others designated to receive attribution as
307
- provided in Section 3(a)(1)(A)(i).
308
-
309
- b. Other rights.
310
-
311
- 1. Moral rights, such as the right of integrity, are not
312
- licensed under this Public License, nor are publicity,
313
- privacy, and/or other similar personality rights; however, to
314
- the extent possible, the Licensor waives and/or agrees not to
315
- assert any such rights held by the Licensor to the limited
316
- extent necessary to allow You to exercise the Licensed
317
- Rights, but not otherwise.
318
-
319
- 2. Patent and trademark rights are not licensed under this
320
- Public License.
321
-
322
- 3. To the extent possible, the Licensor waives any right to
323
- collect royalties from You for the exercise of the Licensed
324
- Rights, whether directly or through a collecting society
325
- under any voluntary or waivable statutory or compulsory
326
- licensing scheme. In all other cases the Licensor expressly
327
- reserves any right to collect such royalties.
328
-
329
-
330
- Section 3 -- License Conditions.
331
-
332
- Your exercise of the Licensed Rights is expressly made subject to the
333
- following conditions.
334
-
335
- a. Attribution.
336
-
337
- 1. If You Share the Licensed Material (including in modified
338
- form), You must:
339
-
340
- a. retain the following if it is supplied by the Licensor
341
- with the Licensed Material:
342
-
343
- i. identification of the creator(s) of the Licensed
344
- Material and any others designated to receive
345
- attribution, in any reasonable manner requested by
346
- the Licensor (including by pseudonym if
347
- designated);
348
-
349
- ii. a copyright notice;
350
-
351
- iii. a notice that refers to this Public License;
352
-
353
- iv. a notice that refers to the disclaimer of
354
- warranties;
355
-
356
- v. a URI or hyperlink to the Licensed Material to the
357
- extent reasonably practicable;
358
-
359
- b. indicate if You modified the Licensed Material and
360
- retain an indication of any previous modifications; and
361
-
362
- c. indicate the Licensed Material is licensed under this
363
- Public License, and include the text of, or the URI or
364
- hyperlink to, this Public License.
365
-
366
- 2. You may satisfy the conditions in Section 3(a)(1) in any
367
- reasonable manner based on the medium, means, and context in
368
- which You Share the Licensed Material. For example, it may be
369
- reasonable to satisfy the conditions by providing a URI or
370
- hyperlink to a resource that includes the required
371
- information.
372
-
373
- 3. If requested by the Licensor, You must remove any of the
374
- information required by Section 3(a)(1)(A) to the extent
375
- reasonably practicable.
376
-
377
- b. ShareAlike.
378
-
379
- In addition to the conditions in Section 3(a), if You Share
380
- Adapted Material You produce, the following conditions also apply.
381
-
382
- 1. The Adapter's License You apply must be a Creative Commons
383
- license with the same License Elements, this version or
384
- later, or a BY-SA Compatible License.
385
-
386
- 2. You must include the text of, or the URI or hyperlink to, the
387
- Adapter's License You apply. You may satisfy this condition
388
- in any reasonable manner based on the medium, means, and
389
- context in which You Share Adapted Material.
390
-
391
- 3. You may not offer or impose any additional or different terms
392
- or conditions on, or apply any Effective Technological
393
- Measures to, Adapted Material that restrict exercise of the
394
- rights granted under the Adapter's License You apply.
395
-
396
-
397
- Section 4 -- Sui Generis Database Rights.
398
-
399
- Where the Licensed Rights include Sui Generis Database Rights that
400
- apply to Your use of the Licensed Material:
401
-
402
- a. for the avoidance of doubt, Section 2(a)(1) grants You the right
403
- to extract, reuse, reproduce, and Share all or a substantial
404
- portion of the contents of the database;
405
-
406
- b. if You include all or a substantial portion of the database
407
- contents in a database in which You have Sui Generis Database
408
- Rights, then the database in which You have Sui Generis Database
409
- Rights (but not its individual contents) is Adapted Material,
410
- including for purposes of Section 3(b); and
411
-
412
- c. You must comply with the conditions in Section 3(a) if You Share
413
- all or a substantial portion of the contents of the database.
414
-
415
- For the avoidance of doubt, this Section 4 supplements and does not
416
- replace Your obligations under this Public License where the Licensed
417
- Rights include other Copyright and Similar Rights.
418
-
419
-
420
- Section 5 -- Disclaimer of Warranties and Limitation of Liability.
421
-
422
- a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
423
- EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
424
- AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
425
- ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
426
- IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
427
- WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
428
- PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
429
- ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
430
- KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
431
- ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
432
-
433
- b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
434
- TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
435
- NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
436
- INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
437
- COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
438
- USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
439
- ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
440
- DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
441
- IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
442
-
443
- c. The disclaimer of warranties and limitation of liability provided
444
- above shall be interpreted in a manner that, to the extent
445
- possible, most closely approximates an absolute disclaimer and
446
- waiver of all liability.
447
-
448
-
449
- Section 6 -- Term and Termination.
450
-
451
- a. This Public License applies for the term of the Copyright and
452
- Similar Rights licensed here. However, if You fail to comply with
453
- this Public License, then Your rights under this Public License
454
- terminate automatically.
455
-
456
- b. Where Your right to use the Licensed Material has terminated under
457
- Section 6(a), it reinstates:
458
-
459
- 1. automatically as of the date the violation is cured, provided
460
- it is cured within 30 days of Your discovery of the
461
- violation; or
462
-
463
- 2. upon express reinstatement by the Licensor.
464
-
465
- For the avoidance of doubt, this Section 6(b) does not affect any
466
- right the Licensor may have to seek remedies for Your violations
467
- of this Public License.
468
-
469
- c. For the avoidance of doubt, the Licensor may also offer the
470
- Licensed Material under separate terms or conditions or stop
471
- distributing the Licensed Material at any time; however, doing so
472
- will not terminate this Public License.
473
-
474
- d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
475
- License.
476
-
477
-
478
- Section 7 -- Other Terms and Conditions.
479
-
480
- a. The Licensor shall not be bound by any additional or different
481
- terms or conditions communicated by You unless expressly agreed.
482
-
483
- b. Any arrangements, understandings, or agreements regarding the
484
- Licensed Material not stated herein are separate from and
485
- independent of the terms and conditions of this Public License.
486
-
487
-
488
- Section 8 -- Interpretation.
489
-
490
- a. For the avoidance of doubt, this Public License does not, and
491
- shall not be interpreted to, reduce, limit, restrict, or impose
492
- conditions on any use of the Licensed Material that could lawfully
493
- be made without permission under this Public License.
494
-
495
- b. To the extent possible, if any provision of this Public License is
496
- deemed unenforceable, it shall be automatically reformed to the
497
- minimum extent necessary to make it enforceable. If the provision
498
- cannot be reformed, it shall be severed from this Public License
499
- without affecting the enforceability of the remaining terms and
500
- conditions.
501
-
502
- c. No term or condition of this Public License will be waived and no
503
- failure to comply consented to unless expressly agreed to by the
504
- Licensor.
505
-
506
- d. Nothing in this Public License constitutes or may be interpreted
507
- as a limitation upon, or waiver of, any privileges and immunities
508
- that apply to the Licensor or You, including from the legal
509
- processes of any jurisdiction or authority.
510
-
511
-
512
- =======================================================================
513
-
514
- Creative Commons is not a party to its public
515
- licenses. Notwithstanding, Creative Commons may elect to apply one of
516
- its public licenses to material it publishes and in those instances
517
- will be considered the “Licensor.” The text of the Creative Commons
518
- public licenses is dedicated to the public domain under the CC0 Public
519
- Domain Dedication. Except for the limited purpose of indicating that
520
- material is shared under a Creative Commons public license or as
521
- otherwise permitted by the Creative Commons policies published at
522
- creativecommons.org/policies, Creative Commons does not authorize the
523
- use of the trademark "Creative Commons" or any other trademark or logo
524
- of Creative Commons without its prior written consent including,
525
- without limitation, in connection with any unauthorized modifications
526
- to any of its public licenses or any other arrangements,
527
- understandings, or agreements concerning use of licensed material. For
528
- the avoidance of doubt, this paragraph does not form part of the
529
- public licenses.
530
-
531
- Creative Commons may be contacted at creativecommons.org.
@@ -0,0 +1,51 @@
1
+ import { a as failedWith, n as format, o as runTool, r as makeDetector, t as h56mSection } from "./section-Bnbx6uOH.mjs";
2
+ import { Array, Boolean, Effect } from "effect";
3
+ // package.json
4
+ var version = "0.3.1";
5
+ var description = "A secret scanner engine written in Rust that scans git history, the staged changes or any text with Betterleaks-format rules from a preset, configured from vite.config.ts.";
6
+ // src/app/cli.ts
7
+ const STAGED = "staged";
8
+ const BASES = [
9
+ "origin/HEAD",
10
+ "origin/main",
11
+ "origin/master"
12
+ ];
13
+ const HEAD = "HEAD";
14
+ const candidatesOf = (requested) => Array.match(requested, {
15
+ onEmpty: () => BASES,
16
+ onNonEmpty: (given) => given
17
+ });
18
+ const sourceOf = ({ flags, args }) => Boolean.match(flags.has(STAGED), {
19
+ onTrue: () => ({ type: "staged" }),
20
+ onFalse: () => ({
21
+ type: "history",
22
+ bases: candidatesOf(args),
23
+ head: HEAD
24
+ })
25
+ });
26
+ const scan = ({ root, config, input }) => makeDetector(config).pipe(Effect.flatMap((detector) => detector.scanGit({
27
+ root,
28
+ source: sourceOf(input)
29
+ })));
30
+ const runCli = () => {
31
+ runTool({
32
+ name: "h56m",
33
+ version,
34
+ description,
35
+ flags: [{
36
+ name: STAGED,
37
+ description: "Scan the staged changes instead of the history"
38
+ }],
39
+ argument: {
40
+ name: "base",
41
+ description: "Refs to scan the history from, the first one that exists winning (default: origin/HEAD, origin/main, origin/master)"
42
+ },
43
+ section: h56mSection,
44
+ failWith: failedWith,
45
+ scan,
46
+ format
47
+ });
48
+ };
49
+ export { runCli };
50
+
51
+ //# sourceMappingURL=cli-Ckk5Jwbk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-Ckk5Jwbk.mjs","names":["Arr","Bool","manifest.version","manifest.description"],"sources":["../package.json","../src/app/cli.ts"],"sourcesContent":["","import { runTool } from \"@masseater.dev/lint-host\";\nimport type { ToolCall, ToolInput } from \"@masseater.dev/lint-host\";\nimport manifest from \"@r_masseater/h56m/package.json\" with { type: \"json\" };\nimport { Array as Arr, Boolean as Bool, Effect } from \"effect\";\n\nimport type { Finding, GitSource, H56mConfig } from \"#/shared/config/index.ts\";\nimport { failedWith } from \"#/shared/lib/errors.ts\";\nimport type { H56mError } from \"#/shared/lib/errors.ts\";\n\nimport { makeDetector } from \"./detector.ts\";\nimport { format } from \"./format.ts\";\nimport { h56mSection } from \"./section.ts\";\n\nconst STAGED = \"staged\";\nconst BASES = [\"origin/HEAD\", \"origin/main\", \"origin/master\"];\nconst HEAD = \"HEAD\";\n\nconst candidatesOf = (requested: readonly string[]): readonly string[] =>\n Arr.match(requested, { onEmpty: () => BASES, onNonEmpty: (given) => given });\n\nconst sourceOf = ({ flags, args }: ToolInput): GitSource =>\n Bool.match(flags.has(STAGED), {\n onTrue: (): GitSource => ({ type: \"staged\" }),\n onFalse: (): GitSource => ({ type: \"history\", bases: candidatesOf(args), head: HEAD }),\n });\n\nconst scan = ({\n root,\n config,\n input,\n}: ToolCall<H56mConfig>): Effect.Effect<readonly Finding[], H56mError> =>\n makeDetector(config).pipe(\n Effect.flatMap((detector) => detector.scanGit({ root, source: sourceOf(input) })),\n );\n\nexport const runCli = (): void => {\n runTool({\n name: \"h56m\",\n version: manifest.version,\n description: manifest.description,\n flags: [{ name: STAGED, description: \"Scan the staged changes instead of the history\" }],\n argument: {\n name: \"base\",\n description:\n \"Refs to scan the history from, the first one that exists winning (default: origin/HEAD, origin/main, origin/master)\",\n },\n section: h56mSection,\n failWith: failedWith,\n scan,\n format,\n });\n};\n"],"mappings":";;;;;;ACaA,MAAM,SAAS;AACf,MAAM,QAAQ;CAAC;CAAe;CAAe;AAAe;AAC5D,MAAM,OAAO;AAEb,MAAM,gBAAgB,cACpBA,MAAI,MAAM,WAAW;CAAE,eAAe;CAAO,aAAa,UAAU;AAAM,CAAC;AAE7E,MAAM,YAAY,EAAE,OAAO,WACzBC,QAAK,MAAM,MAAM,IAAI,MAAM,GAAG;CAC5B,eAA0B,EAAE,MAAM,SAAS;CAC3C,gBAA2B;EAAE,MAAM;EAAW,OAAO,aAAa,IAAI;EAAG,MAAM;CAAK;AACtF,CAAC;AAEH,MAAM,QAAQ,EACZ,MACA,QACA,YAEA,aAAa,MAAM,CAAC,CAAC,KACnB,OAAO,SAAS,aAAa,SAAS,QAAQ;CAAE;CAAM,QAAQ,SAAS,KAAK;AAAE,CAAC,CAAC,CAClF;AAEF,MAAa,eAAqB;CAChC,QAAQ;EACN,MAAM;EACGC;EACIC;EACb,OAAO,CAAC;GAAE,MAAM;GAAQ,aAAa;EAAiD,CAAC;EACvF,UAAU;GACR,MAAM;GACN,aACE;EACJ;EACA,SAAS;EACT,UAAU;EACV;EACA;CACF,CAAC;AACH"}
package/dist/cli.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import { enableCompileCache } from "node:module";
3
3
  // bin/h56m.ts
4
4
  enableCompileCache();
5
- const { runCli } = await import("./cli-DK1xNWFT.mjs");
5
+ const { runCli } = await import("./cli-Ckk5Jwbk.mjs");
6
6
  runCli();
7
7
  export {};
8
8
 
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { i as H56mError, n as format, t as h56mSection, r as makeDetector } from "./section-CRZpQXpe.mjs";
1
+ export { i as H56mError, n as format, t as h56mSection, r as makeDetector } from "./section-Bnbx6uOH.mjs";
@@ -0,0 +1,2 @@
1
+ export declare const betterleaks: string;
2
+ //# sourceMappingURL=presets.d.mts.map
@@ -0,0 +1,6 @@
1
+ import { fileURLToPath } from "node:url";
2
+ // src/app/presets.ts
3
+ const betterleaks = fileURLToPath(import.meta.resolve("@r_masseater/h56m/presets/betterleaks.toml"));
4
+ export { betterleaks };
5
+
6
+ //# sourceMappingURL=presets.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presets.mjs","names":[],"sources":["../src/app/presets.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\n\nexport const betterleaks: string = fileURLToPath(\n import.meta.resolve(\"@r_masseater/h56m/presets/betterleaks.toml\"),\n);\n"],"mappings":";;AAEA,MAAa,cAAsB,cACjC,YAAY,QAAQ,4CAA4C,CAClE"}