@r_masseater/h56m 0.1.0 → 0.3.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/README.md +74 -6
- package/THIRD-PARTY-NOTICES.txt +2 -1248
- package/dist/cli-DTqDhoxm.mjs +38 -0
- package/dist/cli-DTqDhoxm.mjs.map +1 -0
- package/dist/cli.mjs +3 -35
- package/dist/cli.mjs.map +1 -1
- package/dist/{index-DiF7IoP4.d.mts → index-C3x2L0fZ.d.mts} +2 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/presets.d.mts +2 -0
- package/dist/presets.mjs +6 -0
- package/dist/presets.mjs.map +1 -0
- package/dist/{section-AeJ2zzPN.mjs → section-DHEBsrR8.mjs} +14 -6
- package/dist/section-DHEBsrR8.mjs.map +1 -0
- package/dist/vite.d.mts +1 -1
- package/logo.svg +7 -0
- package/package.json +30 -21
- package/presets/betterleaks.toml +12236 -0
- package/skills/scan-secrets/SKILL.md +4 -4
- package/skills/use-h56m-presets/SKILL.md +44 -0
- package/dist/section-AeJ2zzPN.mjs.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { a as failedWith, n as format, o as runTool, r as makeDetector, t as h56mSection } from "./section-DHEBsrR8.mjs";
|
|
2
|
+
import { Array, Boolean, Effect } from "effect";
|
|
3
|
+
// src/app/cli.ts
|
|
4
|
+
const STAGED = "--staged";
|
|
5
|
+
const BASES = [
|
|
6
|
+
"origin/HEAD",
|
|
7
|
+
"origin/main",
|
|
8
|
+
"origin/master"
|
|
9
|
+
];
|
|
10
|
+
const HEAD = "HEAD";
|
|
11
|
+
const candidatesOf = (requested) => Array.match(requested, {
|
|
12
|
+
onEmpty: () => BASES,
|
|
13
|
+
onNonEmpty: (given) => given
|
|
14
|
+
});
|
|
15
|
+
const sourceOf = (requested) => Boolean.match(Array.contains(requested, STAGED), {
|
|
16
|
+
onTrue: () => ({ type: "staged" }),
|
|
17
|
+
onFalse: () => ({
|
|
18
|
+
type: "history",
|
|
19
|
+
bases: candidatesOf(requested),
|
|
20
|
+
head: HEAD
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
const scan = ({ root, config, args }) => makeDetector(config).pipe(Effect.flatMap((detector) => detector.scanGit({
|
|
24
|
+
root,
|
|
25
|
+
source: sourceOf(args)
|
|
26
|
+
})));
|
|
27
|
+
const runCli = () => {
|
|
28
|
+
runTool({
|
|
29
|
+
name: "h56m",
|
|
30
|
+
section: h56mSection,
|
|
31
|
+
failWith: failedWith,
|
|
32
|
+
scan,
|
|
33
|
+
format
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
export { runCli };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=cli-DTqDhoxm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-DTqDhoxm.mjs","names":["Arr","Bool"],"sources":["../src/app/cli.ts"],"sourcesContent":["import { runTool } from \"@masseater.dev/lint-host\";\nimport type { ToolCall } from \"@masseater.dev/lint-host\";\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 = (requested: readonly string[]): GitSource =>\n Bool.match(Arr.contains(requested, STAGED), {\n onTrue: (): GitSource => ({ type: \"staged\" }),\n onFalse: (): GitSource => ({ type: \"history\", bases: candidatesOf(requested), head: HEAD }),\n });\n\nconst scan = ({\n root,\n config,\n args,\n}: ToolCall<H56mConfig>): Effect.Effect<readonly Finding[], H56mError> =>\n makeDetector(config).pipe(\n Effect.flatMap((detector) => detector.scanGit({ root, source: sourceOf(args) })),\n );\n\nexport const runCli = (): void => {\n runTool({ name: \"h56m\", section: h56mSection, failWith: failedWith, scan, format });\n};\n"],"mappings":";;;AAYA,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,cAChBC,QAAK,MAAMD,MAAI,SAAS,WAAW,MAAM,GAAG;CAC1C,eAA0B,EAAE,MAAM,SAAS;CAC3C,gBAA2B;EAAE,MAAM;EAAW,OAAO,aAAa,SAAS;EAAG,MAAM;CAAK;AAC3F,CAAC;AAEH,MAAM,QAAQ,EACZ,MACA,QACA,WAEA,aAAa,MAAM,CAAC,CAAC,KACnB,OAAO,SAAS,aAAa,SAAS,QAAQ;CAAE;CAAM,QAAQ,SAAS,IAAI;AAAE,CAAC,CAAC,CACjF;AAEF,MAAa,eAAqB;CAChC,QAAQ;EAAE,MAAM;EAAQ,SAAS;EAAa,UAAU;EAAY;EAAM;CAAO,CAAC;AACpF"}
|
package/dist/cli.mjs
CHANGED
|
@@ -1,40 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { Array, Boolean, Effect } from "effect";
|
|
4
|
-
// src/app/cli.ts
|
|
5
|
-
const STAGED = "--staged";
|
|
6
|
-
const BASES = [
|
|
7
|
-
"origin/HEAD",
|
|
8
|
-
"origin/main",
|
|
9
|
-
"origin/master"
|
|
10
|
-
];
|
|
11
|
-
const HEAD = "HEAD";
|
|
12
|
-
const candidatesOf = (requested) => Array.match(requested, {
|
|
13
|
-
onEmpty: () => BASES,
|
|
14
|
-
onNonEmpty: (given) => given
|
|
15
|
-
});
|
|
16
|
-
const sourceOf = (requested) => Boolean.match(Array.contains(requested, STAGED), {
|
|
17
|
-
onTrue: () => ({ type: "staged" }),
|
|
18
|
-
onFalse: () => ({
|
|
19
|
-
type: "history",
|
|
20
|
-
bases: candidatesOf(requested),
|
|
21
|
-
head: HEAD
|
|
22
|
-
})
|
|
23
|
-
});
|
|
24
|
-
const scan = ({ root, config, args }) => makeDetector(config).pipe(Effect.flatMap((detector) => detector.scanGit({
|
|
25
|
-
root,
|
|
26
|
-
source: sourceOf(args)
|
|
27
|
-
})));
|
|
28
|
-
const runCli = () => {
|
|
29
|
-
runTool({
|
|
30
|
-
name: "h56m",
|
|
31
|
-
section: h56mSection,
|
|
32
|
-
failWith: failedWith,
|
|
33
|
-
scan,
|
|
34
|
-
format
|
|
35
|
-
});
|
|
36
|
-
};
|
|
2
|
+
import { enableCompileCache } from "node:module";
|
|
37
3
|
// bin/h56m.ts
|
|
4
|
+
enableCompileCache();
|
|
5
|
+
const { runCli } = await import("./cli-DTqDhoxm.mjs");
|
|
38
6
|
runCli();
|
|
39
7
|
export {};
|
|
40
8
|
|
package/dist/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","names":[
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":[],"sources":["../bin/h56m.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { enableCompileCache } from \"node:module\";\n\nenableCompileCache();\n\nconst { runCli } = await import(\"#/app/cli.ts\");\n\nrunCli();\n"],"mappings":";;;AAGA,mBAAmB;AAEnB,MAAM,EAAE,WAAW,MAAM,OAAO;AAEhC,OAAO"}
|
|
@@ -18,6 +18,7 @@ interface H56mExtend {
|
|
|
18
18
|
}
|
|
19
19
|
interface H56mConfig {
|
|
20
20
|
readonly extend?: H56mExtend;
|
|
21
|
+
readonly maxDecodeDepth?: number;
|
|
21
22
|
readonly prefilter?: string;
|
|
22
23
|
readonly filter?: string;
|
|
23
24
|
readonly rules?: readonly H56mRule[];
|
|
@@ -49,4 +50,4 @@ type GitSource = {
|
|
|
49
50
|
readonly revision: string;
|
|
50
51
|
};
|
|
51
52
|
export { H56mRule as a, H56mExtend as i, GitSource as n, H56mConfig as r, Finding as t };
|
|
52
|
-
//# sourceMappingURL=index-
|
|
53
|
+
//# sourceMappingURL=index-C3x2L0fZ.d.mts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as H56mRule, i as H56mExtend, n as GitSource, r as H56mConfig, t as Finding } from "./index-
|
|
1
|
+
import { a as H56mRule, i as H56mExtend, n as GitSource, r as H56mConfig, t as Finding } from "./index-C3x2L0fZ.mjs";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
declare const H56mError_base: Schema.Class<H56mError, Schema.TaggedStruct<"H56mError", {
|
|
4
4
|
readonly message: Schema.String;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { i as H56mError, n as format, t as h56mSection, r as makeDetector } from "./section-
|
|
1
|
+
export { i as H56mError, n as format, t as h56mSection, r as makeDetector } from "./section-DHEBsrR8.mjs";
|
package/dist/presets.mjs
ADDED
|
@@ -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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { Array, Boolean, Console, Effect, FileSystem, Function, Layer, Match, Option, Order, Path, Predicate, Record, Schema, String as String$1, pipe } from "effect";
|
|
3
|
-
import { NodeServices } from "@effect/platform-node";
|
|
4
3
|
import { runMain } from "@effect/platform-node/NodeRuntime";
|
|
4
|
+
import { layer } from "@effect/platform-node/NodeServices";
|
|
5
5
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
6
6
|
import { FetchHttpClient } from "effect/http";
|
|
7
7
|
import { Otlp, OtlpSerialization } from "effect/observability";
|
|
@@ -100,7 +100,7 @@ const toolMainOf = (tool) => Effect.gen(function* main() {
|
|
|
100
100
|
yield* failWhen(Array.isReadonlyArrayNonEmpty(found));
|
|
101
101
|
});
|
|
102
102
|
const runTraced = (name, program) => {
|
|
103
|
-
const services = Otlp.layerFromConfig({ resource: { serviceName: name } }).pipe(Layer.provide(OtlpSerialization.layerJson), Layer.provide(FetchHttpClient.layer), Layer.provideMerge(
|
|
103
|
+
const services = Otlp.layerFromConfig({ resource: { serviceName: name } }).pipe(Layer.provide(OtlpSerialization.layerJson), Layer.provide(FetchHttpClient.layer), Layer.provideMerge(layer));
|
|
104
104
|
runMain(program.pipe(Effect.provide(services)));
|
|
105
105
|
};
|
|
106
106
|
const runTool = (tool) => {
|
|
@@ -113,12 +113,18 @@ Function.dual(2, (value, build) => Option.match(value, {
|
|
|
113
113
|
// ../lint-host/src/shared/lib/trace.ts
|
|
114
114
|
const SAMPLED = "01";
|
|
115
115
|
const NOT_SAMPLED = "00";
|
|
116
|
+
const LINE_START = 0;
|
|
116
117
|
const flagsOf = (sampled) => Boolean.match(sampled, {
|
|
117
118
|
onFalse: () => NOT_SAMPLED,
|
|
118
119
|
onTrue: () => SAMPLED
|
|
119
120
|
});
|
|
120
121
|
const traceparent = Effect.currentSpan.pipe(Effect.map((span) => `00-${span.traceId}-${span.spanId}-${flagsOf(span.sampled)}`), Effect.option);
|
|
121
|
-
Order.combine(Order.mapInput(Order.String, (found) => found.path), Order.mapInput(Order.Number, (found) => found.line));
|
|
122
|
+
Order.combine(Order.mapInput(Order.String, (found) => found.path), Order.combine(Order.mapInput(Order.Number, (found) => found.line), Order.mapInput(Order.Number, (found) => found.column ?? LINE_START)));
|
|
123
|
+
// ../lint-host/src/shared/lib/section.ts
|
|
124
|
+
const sectionOf = ({ name, fallback, prepare = Function.identity }) => {
|
|
125
|
+
const hasSection = (value) => Predicate.hasProperty(value, name) && Predicate.isObject(value[name]);
|
|
126
|
+
return (config) => pipe(Option.liftPredicate(config, hasSection), Option.flatMapNullishOr((value) => value[name]), Option.map(prepare), Option.getOrElse(() => fallback));
|
|
127
|
+
};
|
|
122
128
|
// src/shared/config/types.ts
|
|
123
129
|
const FindingSchema = Schema.Struct({
|
|
124
130
|
rule: Schema.String,
|
|
@@ -202,8 +208,10 @@ const SHORT_COMMIT = 12;
|
|
|
202
208
|
const commitOf = (finding) => pipe(Option.fromNullishOr(finding.commit), Option.map((commit) => ` (${String$1.slice(START, SHORT_COMMIT)(commit)})`), Option.getOrElse(() => ""));
|
|
203
209
|
const format = (finding) => `${finding.path}:${String(finding.line)}:${String(finding.column)} ${finding.rule} ${finding.description} sha256:${finding.digest}${commitOf(finding)}`;
|
|
204
210
|
// src/app/section.ts
|
|
205
|
-
const
|
|
206
|
-
|
|
211
|
+
const h56mSection = sectionOf({
|
|
212
|
+
name: "h56m",
|
|
213
|
+
fallback: {}
|
|
214
|
+
});
|
|
207
215
|
export { failedWith as a, H56mError as i, format as n, runTool as o, makeDetector as r, h56mSection as t };
|
|
208
216
|
|
|
209
|
-
//# sourceMappingURL=section-
|
|
217
|
+
//# sourceMappingURL=section-DHEBsrR8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-DHEBsrR8.mjs","names":["taggedError","Rec","Str","DATA_FIRST_ARITY","Arr","Fn","nodeServices","Fn","Bool","Fn","Str"],"sources":["../../lint-host/src/shared/lib/target.ts","../../lint-host/src/features/build-addon/model/build.ts","../../lint-host/src/features/load-addon/model/load.ts","../../lint-host/src/features/run-cli/model/cli.ts","../../lint-host/src/shared/lib/present.ts","../../lint-host/src/shared/lib/trace.ts","../../lint-host/src/shared/lib/section.ts","../src/shared/config/types.ts","../src/shared/lib/errors.ts","../src/shared/native/index.ts","../src/app/detector.ts","../src/app/format.ts","../src/app/section.ts"],"sourcesContent":["import { Match } from \"effect\";\n\nconst abiOf = (platform: string): string =>\n Match.value(platform).pipe(\n Match.when(\"linux\", () => \"-gnu\"),\n Match.when(\"win32\", () => \"-msvc\"),\n Match.orElse(() => \"\"),\n );\n\nexport const platformTarget = `${process.platform}-${process.arch}${abiOf(process.platform)}`;\n\nexport const addonFileOf = (binary: string): string => `${binary}.${platformTarget}.node`;\n","import { runMain } from \"@effect/platform-node/NodeRuntime\";\nimport { layer as nodeServices } from \"@effect/platform-node/NodeServices\";\nimport { Effect, FileSystem, Path, Record as Rec, Schema, String as Str } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport { addonFileOf } from \"#/shared/lib/target.ts\";\n\nconst taggedError = Schema.TaggedError;\n\nclass AddonBuildFailed extends taggedError<AddonBuildFailed, { readonly brand: unique symbol }>()(\n \"AddonBuildFailed\",\n { message: Schema.String },\n) {}\n\nconst LIBRARY: Readonly<Record<string, (name: string) => string>> = {\n linux: (name) => `lib${name}.so`,\n darwin: (name) => `lib${name}.dylib`,\n win32: (name) => `${name}.dll`,\n};\n\nconst SUCCESS = 0;\n\nexport interface AddonBuild {\n readonly crate: string;\n readonly binary: string;\n readonly packageDir: string;\n readonly workspaceDir: string;\n}\n\nconst cargo = Effect.fn(\"cargo\")(function* cargo(crate: string, workspace: string) {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const exitCode = yield* spawner.exitCode(\n ChildProcess.make(\"cargo\", [\"build\", \"--release\", \"--locked\", \"-p\", crate], {\n cwd: workspace,\n stdout: \"inherit\",\n stderr: \"inherit\",\n }),\n );\n const failure = AddonBuildFailed.make({ message: `cargo exited with ${String(exitCode)}` });\n yield* Effect.when(\n Effect.fail(failure),\n Effect.sync(() => Number(exitCode) !== SUCCESS),\n );\n});\n\nconst build = Effect.fn(\"buildAddon\")(function* build(options: AddonBuild) {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const library = yield* Effect.fromOption(Rec.get(LIBRARY, process.platform)).pipe(\n Effect.mapError(() =>\n AddonBuildFailed.make({ message: `no native build for ${process.platform}` }),\n ),\n );\n yield* cargo(options.crate, options.workspaceDir);\n const output = path.join(options.packageDir, \"native\");\n yield* fileSystem.makeDirectory(output, { recursive: true });\n const built = library(Str.replaceAll(\"-\", \"_\")(options.crate));\n yield* fileSystem.copyFile(\n path.join(options.workspaceDir, \"target\", \"release\", built),\n path.join(output, addonFileOf(options.binary)),\n );\n});\n\nexport const buildAddon = (options: AddonBuild): void => {\n runMain(build(options).pipe(Effect.provide(nodeServices)));\n};\n","import { createRequire } from \"node:module\";\n\nimport { Effect } from \"effect\";\n\nimport type { FailWith } from \"#/shared/lib/fail.ts\";\nimport { addonFileOf, platformTarget } from \"#/shared/lib/target.ts\";\n\nexport interface AddonSource<Addon, Failure> {\n readonly packageName: string;\n readonly binary: string;\n readonly from: string;\n readonly isAddon: (value: unknown) => value is Addon;\n readonly failWith: FailWith<Failure>;\n}\n\nexport const loadAddon = <Addon, Failure>({\n packageName,\n binary,\n from,\n isAddon,\n failWith,\n}: AddonSource<Addon, Failure>): Effect.Effect<Addon, Failure> => {\n const requireFrom = createRequire(from);\n const loadFrom = (specifier: string): Effect.Effect<unknown, Failure> =>\n Effect.try({\n try: (): unknown => requireFrom(specifier),\n catch: failWith(`could not load ${specifier}`),\n });\n return loadFrom(`${packageName}-${platformTarget}`).pipe(\n Effect.catchCause(() => loadFrom(`${packageName}/native/${addonFileOf(binary)}`)),\n Effect.filterOrFail(isAddon, (found) =>\n failWith(`no ${binary} addon for ${platformTarget}`)(found),\n ),\n );\n};\n\nexport interface Telemetered {\n readonly flushTelemetry: () => Promise<void>;\n}\n\nexport interface AddonCall<Addon extends Telemetered, Result, Failure> {\n readonly addon: Effect.Effect<Addon, Failure>;\n readonly name: string;\n readonly files: number;\n readonly call: (addon: Addon) => Result;\n readonly failWith: FailWith<Failure>;\n}\n\nexport const callAddon = <Addon extends Telemetered, Result, Failure>({\n addon,\n name,\n files,\n call,\n failWith,\n}: AddonCall<Addon, Result, Failure>): Effect.Effect<Result, Failure> =>\n addon.pipe(\n Effect.flatMap((loaded) =>\n Effect.try({ try: () => call(loaded), catch: failWith(`${name} could not lint`) }).pipe(\n Effect.tap(() => Effect.promise(() => loaded.flushTelemetry())),\n ),\n ),\n Effect.withSpan(`${name}.native`, { attributes: { [`${name}.files`]: files } }),\n );\n","import { runMain } from \"@effect/platform-node/NodeRuntime\";\nimport { layer as nodeServices } from \"@effect/platform-node/NodeServices\";\nimport {\n Array as Arr,\n Console,\n Effect,\n FileSystem,\n Function as Fn,\n Layer,\n Option,\n Path,\n String as Str,\n pipe,\n} from \"effect\";\nimport { FetchHttpClient } from \"effect/http\";\nimport { Otlp, OtlpSerialization } from \"effect/observability\";\nimport type { PlatformError } from \"effect/PlatformError\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\nimport { resolveConfigFromFile } from \"vite-plus\";\n\nimport type { FailWith } from \"#/shared/lib/fail.ts\";\n\nconst CONFIG_FILES = [\"vite.config.ts\", \"vite.config.mts\", \"vite.config.js\", \"vite.config.mjs\"];\nconst FAILED = 1;\nconst DATA_FIRST_ARITY = 2;\nconst ARGUMENTS_START = 2;\n\nexport interface Reported {\n readonly severity: string;\n}\n\nexport interface LintCall<Config, Failure> {\n readonly root: string;\n readonly files: readonly string[];\n readonly projectFiles: readonly string[];\n readonly config: Config;\n readonly read: (file: string) => Effect.Effect<string, Failure>;\n}\n\nexport interface PathspecRequest<Config> {\n readonly config: Config;\n readonly patterns?: readonly string[];\n}\n\nexport interface SectionSource<Config, Failure> {\n readonly name: string;\n readonly section: (config: unknown) => Config;\n readonly failWith: FailWith<Failure>;\n}\n\nexport interface Cli<Config, Found extends Reported, Failure> extends SectionSource<\n Config,\n Failure\n> {\n readonly pathspecs: (request: PathspecRequest<Config>) => readonly string[];\n readonly lint: (call: LintCall<Config, Failure>) => Effect.Effect<readonly Found[], Failure>;\n readonly format: (found: Found) => string;\n}\n\nexport interface ToolCall<Config> {\n readonly root: string;\n readonly config: Config;\n readonly args: readonly string[];\n}\n\nexport interface Tool<Config, Found, Failure> extends SectionSource<Config, Failure> {\n readonly scan: (call: ToolCall<Config>) => Effect.Effect<readonly Found[], Failure>;\n readonly format: (found: Found) => string;\n}\n\ntype CliServices = FileSystem.FileSystem | Path.Path | ChildProcessSpawner.ChildProcessSpawner;\n\nconst readSectionIn = <Config, Failure>(\n source: SectionSource<Config, Failure>,\n root: string,\n): Effect.Effect<Config, Failure, FileSystem.FileSystem | Path.Path> =>\n Effect.gen(function* readConfig() {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const found = yield* pipe(\n CONFIG_FILES,\n Arr.map((name) => path.join(root, name)),\n Effect.filter((file) => fileSystem.exists(file).pipe(Effect.orElseSucceed(() => false))),\n );\n const loaded = yield* Option.match(Arr.head(found), {\n onNone: () => Effect.succeed<unknown>({}),\n onSome: (file) =>\n Effect.tryPromise({\n try: () => resolveConfigFromFile(file),\n catch: source.failWith(`could not load ${file}`),\n }),\n });\n return source.section(loaded);\n }).pipe(Effect.withSpan(`${source.name}.config`));\n\n/** @internal */\nexport const readSection: {\n (\n root: string,\n ): <Config, Failure>(\n source: SectionSource<Config, Failure>,\n ) => Effect.Effect<Config, Failure, FileSystem.FileSystem | Path.Path>;\n <Config, Failure>(\n source: SectionSource<Config, Failure>,\n root: string,\n ): Effect.Effect<Config, Failure, FileSystem.FileSystem | Path.Path>;\n} = Fn.dual(DATA_FIRST_ARITY, readSectionIn);\n\nconst trackedFiles = (\n root: string,\n pathspecs: readonly string[],\n): Effect.Effect<readonly string[], PlatformError, ChildProcessSpawner.ChildProcessSpawner> =>\n Effect.gen(function* listFiles() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const output = yield* spawner.string(\n ChildProcess.make(\n \"git\",\n [\"ls-files\", \"-co\", \"--exclude-standard\", \"-z\", \"--\", ...pathspecs],\n { cwd: root },\n ),\n );\n return pipe(Str.split(output, \"\\0\"), Arr.filter(Str.isNonEmpty));\n });\n\nconst requestOf = <Config>(config: Config, patterns: readonly string[]): PathspecRequest<Config> =>\n Arr.match(patterns, {\n onEmpty: () => ({ config }),\n onNonEmpty: (given) => ({ config, patterns: given }),\n });\n\nconst hasError = (found: readonly Reported[]): boolean =>\n pipe(\n found,\n Arr.some(({ severity }) => severity === \"error\"),\n );\n\nconst failWhen = (failed: boolean): Effect.Effect<void> =>\n Effect.when(\n Effect.sync(() => {\n process.exitCode = FAILED;\n }),\n Effect.succeed(failed),\n ).pipe(Effect.asVoid);\n\nconst printAll = <Found>(\n found: readonly Found[],\n format: (found: Found) => string,\n): Effect.Effect<void> =>\n Arr.match(found, {\n onEmpty: () => Effect.void,\n onNonEmpty: (all) => Console.log(pipe(all, Arr.map(format), Arr.join(\"\\n\"))),\n });\n\nconst readerIn = <Failure>(\n root: string,\n failWith: FailWith<Failure>,\n): Effect.Effect<\n (file: string) => Effect.Effect<string, Failure>,\n never,\n FileSystem.FileSystem | Path.Path\n> =>\n Effect.gen(function* reader() {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n return (file: string): Effect.Effect<string, Failure> =>\n fileSystem\n .readFileString(path.resolve(root, file))\n .pipe(Effect.mapError(failWith(`could not read ${file}`)));\n });\n\nconst mainOf = <Config, Found extends Reported, Failure>(\n cli: Cli<Config, Found, Failure>,\n): Effect.Effect<void, Failure | PlatformError, CliServices> =>\n Effect.gen(function* main() {\n const root = process.cwd();\n const config = yield* readSectionIn(cli, root);\n const patterns = process.argv.slice(ARGUMENTS_START);\n const pathspecs = cli.pathspecs(requestOf(config, patterns));\n const { files, projectFiles } = yield* Effect.all(\n {\n files: trackedFiles(root, pathspecs).pipe(Effect.withSpan(`${cli.name}.files`)),\n projectFiles: trackedFiles(root, []).pipe(Effect.withSpan(`${cli.name}.project`)),\n },\n { concurrency: \"unbounded\" },\n );\n const read = yield* readerIn(root, cli.failWith);\n const found = yield* cli.lint({ root, files, projectFiles, config, read });\n yield* printAll(found, cli.format);\n yield* failWhen(hasError(found));\n });\n\nconst toolMainOf = <Config, Found, Failure>(\n tool: Tool<Config, Found, Failure>,\n): Effect.Effect<void, Failure | PlatformError, CliServices> =>\n Effect.gen(function* main() {\n const root = process.cwd();\n const config = yield* readSectionIn(tool, root);\n const found = yield* tool.scan({ root, config, args: process.argv.slice(ARGUMENTS_START) });\n yield* printAll(found, tool.format);\n yield* failWhen(Arr.isReadonlyArrayNonEmpty(found));\n });\n\nconst runTraced = <Failure>(\n name: string,\n program: Effect.Effect<void, Failure, CliServices>,\n): void => {\n const services = Otlp.layerFromConfig({ resource: { serviceName: name } }).pipe(\n Layer.provide(OtlpSerialization.layerJson),\n Layer.provide(FetchHttpClient.layer),\n Layer.provideMerge(nodeServices),\n );\n runMain(program.pipe(Effect.provide(services)));\n};\n\nexport const runCli = <Config, Found extends Reported, Failure>(\n cli: Cli<Config, Found, Failure>,\n): void => {\n runTraced(cli.name, mainOf(cli));\n};\n\nexport const runTool = <Config, Found, Failure>(tool: Tool<Config, Found, Failure>): void => {\n runTraced(tool.name, toolMainOf(tool));\n};\n","import { Function as Fn, Option } from \"effect\";\n\nconst DATA_FIRST_ARITY = 2;\n\nexport const present: {\n <Value, Fields extends object>(\n build: (value: Value) => Fields,\n ): (value: Option.Option<Value>) => Partial<Fields>;\n <Value, Fields extends object>(\n value: Option.Option<Value>,\n build: (value: Value) => Fields,\n ): Partial<Fields>;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n <Value, Fields extends object>(\n value: Option.Option<Value>,\n build: (value: Value) => Fields,\n ): Partial<Fields> => Option.match(value, { onNone: (): Partial<Fields> => ({}), onSome: build }),\n);\n","import { Array as Arr, Boolean as Bool, Effect, Order } from \"effect\";\nimport type { Option } from \"effect\";\n\nconst SAMPLED = \"01\";\nconst NOT_SAMPLED = \"00\";\n\nexport interface Positioned {\n readonly path: string;\n readonly line: number;\n readonly column?: number;\n}\n\nconst LINE_START = 0;\n\nconst flagsOf = (sampled: boolean): string =>\n Bool.match(sampled, { onFalse: () => NOT_SAMPLED, onTrue: () => SAMPLED });\n\nexport const traceparent: Effect.Effect<Option.Option<string>> = Effect.currentSpan.pipe(\n Effect.map((span) => `00-${span.traceId}-${span.spanId}-${flagsOf(span.sampled)}`),\n Effect.option,\n);\n\nconst byPosition: Order.Order<Positioned> = Order.combine(\n Order.mapInput(Order.String, (found: Positioned) => found.path),\n Order.combine(\n Order.mapInput(Order.Number, (found: Positioned) => found.line),\n Order.mapInput(Order.Number, (found: Positioned) => found.column ?? LINE_START),\n ),\n);\n\nexport const sortByPosition = <Found extends Positioned>(found: readonly Found[]): Found[] =>\n Arr.sort(found, byPosition);\n","import { Array as Arr, Function as Fn, Option, Predicate, pipe } from \"effect\";\n\nexport interface SectionRequest<Config extends object> {\n readonly name: string;\n readonly fallback: Config;\n readonly prepare?: (section: Config) => Config;\n}\n\nexport const sectionOf = <Config extends object>({\n name,\n fallback,\n prepare = Fn.identity,\n}: SectionRequest<Config>): ((config: unknown) => Config) => {\n const hasSection = (value: unknown): value is Readonly<Record<string, Config>> =>\n Predicate.hasProperty(value, name) && Predicate.isObject(value[name]);\n return (config) =>\n pipe(\n Option.liftPredicate(config, hasSection),\n Option.flatMapNullishOr((value) => value[name]),\n Option.map(prepare),\n Option.getOrElse(() => fallback),\n );\n};\n\nexport interface Ignoring {\n readonly ignores?: readonly string[] | undefined;\n}\n\nexport interface Pathspecs {\n readonly defaults: readonly string[];\n readonly unowned?: readonly string[];\n}\n\nexport const pathspecsOf =\n ({ defaults, unowned = [] }: Pathspecs) =>\n ({\n config,\n patterns = [],\n }: {\n readonly config: Ignoring;\n readonly patterns?: readonly string[];\n }): readonly string[] => [\n ...Arr.match(patterns, { onEmpty: () => defaults, onNonEmpty: Fn.identity }),\n ...unowned,\n ...pipe(\n config.ignores ?? [],\n Arr.map((glob) => `:(glob,exclude)${glob}`),\n ),\n ];\n","import { Schema } from \"effect\";\n\nexport interface H56mRule {\n readonly id: string;\n readonly description?: string;\n readonly keywords?: readonly string[];\n readonly regex?: string;\n readonly path?: string;\n readonly valueGroup?: number;\n readonly specificity?: number;\n readonly tags?: readonly string[];\n readonly skipReport?: boolean;\n readonly filter?: string;\n readonly confidence?: \"low\" | \"medium\" | \"high\";\n}\n\nexport interface H56mExtend {\n readonly path?: string;\n readonly disabledRules?: readonly string[];\n}\n\nexport interface H56mConfig {\n readonly extend?: H56mExtend;\n readonly maxDecodeDepth?: number;\n readonly prefilter?: string;\n readonly filter?: string;\n readonly rules?: readonly H56mRule[];\n readonly ignoredSecrets?: readonly string[];\n}\n\nexport const FindingSchema = Schema.Struct({\n rule: Schema.String,\n description: Schema.String,\n confidence: Schema.Literals([\"low\", \"medium\", \"high\"]),\n path: Schema.String,\n line: Schema.Int,\n column: Schema.Int,\n endLine: Schema.Int,\n endColumn: Schema.Int,\n secret: Schema.String,\n digest: Schema.String,\n commit: Schema.optionalKey(Schema.String),\n encoded: Schema.Boolean,\n});\n\nexport type Finding = typeof FindingSchema.Type;\n\nexport type GitSource =\n | { readonly type: \"history\"; readonly bases?: readonly string[]; readonly head: string }\n | { readonly type: \"staged\" }\n | { readonly type: \"snapshot\"; readonly revision: string };\n","import { Schema } from \"effect\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class H56mError extends taggedError<H56mError, { readonly brand: unique symbol }>()(\n \"H56mError\",\n { message: Schema.String },\n) {}\n\nexport const failedWith =\n (message: string) =>\n (cause: unknown): H56mError =>\n H56mError.make({ message: `${message}: ${String(cause)}` });\n","import { loadAddon } from \"@masseater.dev/lint-host\";\nimport { Predicate } from \"effect\";\nimport type { Effect } from \"effect\";\n\nimport type { H56mConfig } from \"#/shared/config/index.ts\";\nimport { failedWith } from \"#/shared/lib/errors.ts\";\nimport type { H56mError } from \"#/shared/lib/errors.ts\";\n\nexport interface DetectorInput {\n readonly config: Omit<H56mConfig, \"ignoredSecrets\">;\n readonly ignored: readonly string[];\n readonly traceparent?: string;\n}\n\nexport interface TextInput {\n readonly path: string;\n readonly text: string;\n readonly traceparent?: string;\n}\n\nexport interface GitInput {\n readonly root: string;\n readonly source: unknown;\n readonly traceparent?: string;\n}\n\nexport interface NativeDetector {\n readonly scan: (input: TextInput) => unknown;\n readonly scanGit: (input: GitInput) => unknown;\n}\n\nexport interface Native {\n readonly SecretDetector: new (input: DetectorInput) => NativeDetector;\n readonly flushTelemetry: () => Promise<void>;\n}\n\nconst isNative = (value: unknown): value is Native =>\n Predicate.hasProperty(value, \"SecretDetector\") &&\n Predicate.isFunction(value.SecretDetector) &&\n Predicate.hasProperty(value, \"flushTelemetry\") &&\n Predicate.isFunction(value.flushTelemetry);\n\nexport const native: Effect.Effect<Native, H56mError> = loadAddon({\n packageName: \"@r_masseater/h56m\",\n binary: \"h56m\",\n from: import.meta.url,\n isAddon: isNative,\n failWith: failedWith,\n});\n","import { callAddon, traceparent } from \"@masseater.dev/lint-host\";\nimport { Effect, Option, Schema } from \"effect\";\n\nimport { FindingSchema } from \"#/shared/config/index.ts\";\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\";\nimport { native } from \"#/shared/native/index.ts\";\nimport type { NativeDetector } from \"#/shared/native/index.ts\";\n\nconst ONE_FILE = 1;\nconst WHOLE_REPOSITORY = 0;\n\nconst decodeFindings = Schema.decodeUnknownEffect(Schema.Array(FindingSchema));\n\nexport interface TextScan {\n readonly path: string;\n readonly text: string;\n}\n\nexport interface GitScan {\n readonly root: string;\n readonly source: GitSource;\n}\n\nexport interface Detector {\n readonly scanText: (scan: TextScan) => Effect.Effect<readonly Finding[], H56mError>;\n readonly scanGit: (scan: GitScan) => Effect.Effect<readonly Finding[], H56mError>;\n}\n\ntype Traced<Input> = Input | (Input & { readonly traceparent: string });\n\nconst withParent = <Input extends object>(input: Input): Effect.Effect<Traced<Input>> =>\n traceparent.pipe(\n Effect.map(\n Option.match({\n onNone: (): Traced<Input> => input,\n onSome: (value): Traced<Input> => ({ ...input, traceparent: value }),\n }),\n ),\n );\n\ninterface NativeScan {\n readonly name: string;\n readonly files: number;\n readonly call: () => unknown;\n}\n\nconst run = ({ name, files, call }: NativeScan): Effect.Effect<readonly Finding[], H56mError> =>\n callAddon({ addon: native, name, files, call, failWith: failedWith }).pipe(\n Effect.flatMap((found) =>\n decodeFindings(found).pipe(Effect.mapError(failedWith(\"h56m returned an unknown shape\"))),\n ),\n );\n\nconst scannerOf = (detector: NativeDetector): Detector => ({\n scanText: (scan) =>\n withParent(scan).pipe(\n Effect.flatMap((input) =>\n run({ name: \"h56m.text\", files: ONE_FILE, call: () => detector.scan(input) }),\n ),\n Effect.withSpan(\"h56m.scan_text\"),\n ),\n scanGit: (scan) =>\n withParent(scan).pipe(\n Effect.flatMap((input) =>\n run({ name: \"h56m.git\", files: WHOLE_REPOSITORY, call: () => detector.scanGit(input) }),\n ),\n Effect.withSpan(\"h56m.scan_git\", { attributes: { \"h56m.source\": scan.source.type } }),\n ),\n});\n\nexport const makeDetector = Effect.fn(\"h56m.detector\")(function* makeDetector(\n config: H56mConfig = {},\n) {\n const { ignoredSecrets = [], ...rest } = config;\n const input = yield* withParent({ config: rest, ignored: ignoredSecrets });\n const detector = yield* callAddon({\n addon: native,\n name: \"h56m\",\n files: WHOLE_REPOSITORY,\n call: (addon) => new addon.SecretDetector(input),\n failWith: failedWith,\n });\n return scannerOf(detector);\n});\n","import { Option, String as Str, pipe } from \"effect\";\n\nimport type { Finding } from \"#/shared/config/index.ts\";\n\nconst START = 0;\nconst SHORT_COMMIT = 12;\n\nconst commitOf = (finding: Finding): string =>\n pipe(\n Option.fromNullishOr(finding.commit),\n Option.map((commit) => ` (${Str.slice(START, SHORT_COMMIT)(commit)})`),\n Option.getOrElse(() => \"\"),\n );\n\nexport const format = (finding: Finding): string =>\n `${finding.path}:${String(finding.line)}:${String(finding.column)} ${finding.rule} ${finding.description} sha256:${finding.digest}${commitOf(finding)}`;\n","import { sectionOf } from \"@masseater.dev/lint-host\";\n\nimport type { H56mConfig } from \"#/shared/config/index.ts\";\n\nexport const h56mSection = sectionOf<H56mConfig>({ name: \"h56m\", fallback: {} });\n"],"mappings":";;;;;;;;;AAEA,MAAM,SAAS,aACb,MAAM,MAAM,QAAQ,CAAC,CAAC,KACpB,MAAM,KAAK,eAAe,MAAM,GAChC,MAAM,KAAK,eAAe,OAAO,GACjC,MAAM,aAAa,EAAE,CACvB;AAEF,MAAa,iBAAiB,GAAG,QAAQ,SAAS,GAAG,QAAQ,OAAO,MAAM,QAAQ,QAAQ;AAE1F,MAAa,eAAe,WAA2B,GAAG,OAAO,GAAG,eAAe;;ACJnF,MAAMA,gBAAc,OAAO;AAE3B,IAAM,mBAAN,cAA+BA,cAAiE,CAAC,CAC/F,oBACA,EAAE,SAAS,OAAO,OAAO,CAC3B,CAAC,CAAC,CAAC;AAEH,MAAM,UAA8D;CAClE,QAAQ,SAAS,MAAM,KAAK;CAC5B,SAAS,SAAS,MAAM,KAAK;CAC7B,QAAQ,SAAS,GAAG,KAAK;AAC3B;AAEA,MAAM,UAAU;AAShB,MAAM,QAAQ,OAAO,GAAG,OAAO,CAAC,CAAC,UAAU,MAAM,OAAe,WAAmB;CAEjF,MAAM,WAAW,QAAO,OADD,oBAAoB,oBAAA,CACX,SAC9B,aAAa,KAAK,SAAS;EAAC;EAAS;EAAa;EAAY;EAAM;CAAK,GAAG;EAC1E,KAAK;EACL,QAAQ;EACR,QAAQ;CACV,CAAC,CACH;CACA,MAAM,UAAU,iBAAiB,KAAK,EAAE,SAAS,qBAAqB,OAAO,QAAQ,IAAI,CAAC;CAC1F,OAAO,OAAO,KACZ,OAAO,KAAK,OAAO,GACnB,OAAO,WAAW,OAAO,QAAQ,MAAM,OAAO,CAChD;AACF,CAAC;AAEa,OAAO,GAAG,YAAY,CAAC,CAAC,UAAU,MAAM,SAAqB;CACzE,MAAM,aAAa,OAAO,W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CAAC,MAAM,EAAE,EAAE,GACrE,OAAO,gBAAgB,EAAE,CAC3B;AAEF,MAAa,UAAU,YACrB,GAAG,QAAQ,KAAK,GAAG,OAAO,QAAQ,IAAI,EAAE,GAAG,OAAO,QAAQ,MAAM,EAAE,GAAG,QAAQ,KAAK,GAAG,QAAQ,YAAY,UAAU,QAAQ,SAAS,SAAS,OAAO;;ACXtJ,MAAa,cAAc,UAAsB;CAAE,MAAM;CAAQ,UAAU,CAAC;AAAE,CAAC"}
|
package/dist/vite.d.mts
CHANGED
package/logo.svg
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="68 70 384 384">
|
|
2
|
+
<rect width="512" height="512" fill="#1C2440"/>
|
|
3
|
+
<circle cx="324" cy="160" r="84" fill="#F6F1E4"/>
|
|
4
|
+
<path d="M28 296 C 112 206, 206 352, 300 292 C 204 384, 120 300, 46 384 Z" fill="#EE8FB5"/>
|
|
5
|
+
<path d="M300 292 C 362 244, 420 232, 484 132 L 492 214 C 440 284, 380 306, 300 292 Z" fill="#F7C3D7"/>
|
|
6
|
+
<path d="M60 456 C 160 384, 244 474, 340 400 C 398 356, 440 364, 486 312 L 490 344 C 444 390, 404 384, 352 424 C 252 500, 170 416, 60 456 Z" fill="#9FD8E6"/>
|
|
7
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@r_masseater/h56m",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"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.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"betterleaks",
|
|
7
7
|
"gitleaks",
|
|
8
|
+
"preset",
|
|
8
9
|
"secrets",
|
|
9
10
|
"security",
|
|
10
11
|
"tanstack-intent",
|
|
11
12
|
"vite-plus"
|
|
12
13
|
],
|
|
13
|
-
"homepage": "https://github.com/masseater/
|
|
14
|
+
"homepage": "https://github.com/masseater/ecosystems/tree/main/libs/h56m#readme",
|
|
14
15
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/masseater/
|
|
16
|
+
"url": "https://github.com/masseater/ecosystems/issues"
|
|
16
17
|
},
|
|
17
|
-
"license": "MIT AND
|
|
18
|
+
"license": "MIT AND CC-BY-SA-4.0",
|
|
18
19
|
"repository": {
|
|
19
20
|
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/masseater/
|
|
21
|
+
"url": "git+https://github.com/masseater/ecosystems.git",
|
|
21
22
|
"directory": "libs/h56m"
|
|
22
23
|
},
|
|
23
24
|
"bin": {
|
|
@@ -27,9 +28,13 @@
|
|
|
27
28
|
"LICENSE",
|
|
28
29
|
"THIRD-PARTY-NOTICES.txt",
|
|
29
30
|
"dist",
|
|
30
|
-
"
|
|
31
|
+
"logo.svg",
|
|
32
|
+
"presets",
|
|
33
|
+
"skills/scan-secrets",
|
|
34
|
+
"skills/use-h56m-presets"
|
|
31
35
|
],
|
|
32
36
|
"type": "module",
|
|
37
|
+
"sideEffects": false,
|
|
33
38
|
"imports": {
|
|
34
39
|
"#/*": "./src/*"
|
|
35
40
|
},
|
|
@@ -38,43 +43,47 @@
|
|
|
38
43
|
"types": "./dist/index.d.mts",
|
|
39
44
|
"default": "./dist/index.mjs"
|
|
40
45
|
},
|
|
46
|
+
"./presets": {
|
|
47
|
+
"types": "./dist/presets.d.mts",
|
|
48
|
+
"default": "./dist/presets.mjs"
|
|
49
|
+
},
|
|
41
50
|
"./vite": {
|
|
42
51
|
"types": "./dist/vite.d.mts",
|
|
43
52
|
"default": "./dist/vite.mjs"
|
|
44
53
|
},
|
|
45
|
-
"./package.json": "./package.json"
|
|
54
|
+
"./package.json": "./package.json",
|
|
55
|
+
"./presets/*": "./presets/*"
|
|
46
56
|
},
|
|
47
57
|
"publishConfig": {
|
|
48
58
|
"access": "public",
|
|
49
59
|
"provenance": true
|
|
50
60
|
},
|
|
51
61
|
"dependencies": {
|
|
52
|
-
"@effect/platform-node": "^4.1.
|
|
62
|
+
"@effect/platform-node": "^4.1.5"
|
|
53
63
|
},
|
|
54
64
|
"devDependencies": {
|
|
55
|
-
"@effect/vitest": "4.1.
|
|
65
|
+
"@effect/vitest": "4.1.5",
|
|
56
66
|
"@masseater.dev/lint-host": "0.0.0",
|
|
57
|
-
"@r_masseater/vitest-otlp": "0.2.
|
|
67
|
+
"@r_masseater/vitest-otlp": "0.2.2",
|
|
58
68
|
"@types/node": "26.6.6",
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
69
|
+
"betterleaks": "github:betterleaks/betterleaks#e07e69ba6a441313529b3e72be43ffdcc62bdf86",
|
|
70
|
+
"effect": "4.1.5",
|
|
71
|
+
"smol-toml": "1.9.1",
|
|
72
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@8.3.8001",
|
|
73
|
+
"vite-plus": "1.8.0"
|
|
62
74
|
},
|
|
63
75
|
"peerDependencies": {
|
|
64
|
-
"effect": "^4.1.
|
|
76
|
+
"effect": "^4.1.0",
|
|
65
77
|
"vite": "*",
|
|
66
|
-
"vite-plus": ">=1.
|
|
78
|
+
"vite-plus": ">=1.8.0"
|
|
67
79
|
},
|
|
68
80
|
"peerDependenciesMeta": {
|
|
69
81
|
"vite": {
|
|
70
82
|
"optional": true
|
|
71
|
-
},
|
|
72
|
-
"vite-plus": {
|
|
73
|
-
"optional": true
|
|
74
83
|
}
|
|
75
84
|
},
|
|
76
85
|
"engines": {
|
|
77
|
-
"node": ">=26"
|
|
86
|
+
"node": ">=26.13.1"
|
|
78
87
|
},
|
|
79
88
|
"native": {
|
|
80
89
|
"binary": "h56m",
|
|
@@ -84,8 +93,8 @@
|
|
|
84
93
|
]
|
|
85
94
|
},
|
|
86
95
|
"optionalDependencies": {
|
|
87
|
-
"@r_masseater/h56m-linux-x64-gnu": "0.
|
|
88
|
-
"@r_masseater/h56m-win32-x64-msvc": "0.
|
|
96
|
+
"@r_masseater/h56m-linux-x64-gnu": "0.3.0",
|
|
97
|
+
"@r_masseater/h56m-win32-x64-msvc": "0.3.0"
|
|
89
98
|
},
|
|
90
99
|
"scripts": {}
|
|
91
100
|
}
|