@r_masseater/i68 0.2.1 → 0.2.2
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/{app-D-q1EAoS.mjs → app-CS-xLSmb.mjs} +2 -2
- package/dist/{app-D-q1EAoS.mjs.map → app-CS-xLSmb.mjs.map} +1 -1
- package/dist/{cli-5PPi51Wt.mjs → cli-BsA_dteW.mjs} +3 -3
- package/dist/{cli-5PPi51Wt.mjs.map → cli-BsA_dteW.mjs.map} +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/presets.mjs +1 -1
- package/dist/{section-C_cbbf7V.mjs → section-nUBg-T7E.mjs} +4 -11
- package/dist/section-nUBg-T7E.mjs.map +1 -0
- package/package.json +3 -2
- package/dist/section-C_cbbf7V.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./section-
|
|
1
|
+
import "./section-nUBg-T7E.mjs";
|
|
2
2
|
// src/entities/rule/model/define.ts
|
|
3
3
|
const defineRule = (rule) => rule;
|
|
4
4
|
const definePlugin = (plugin) => plugin;
|
|
5
5
|
export { defineRule as n, definePlugin as t };
|
|
6
6
|
|
|
7
|
-
//# sourceMappingURL=app-
|
|
7
|
+
//# sourceMappingURL=app-CS-xLSmb.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-
|
|
1
|
+
{"version":3,"file":"app-CS-xLSmb.mjs","names":[],"sources":["../src/entities/rule/model/define.ts"],"sourcesContent":["import type { Plugin, Rule } from \"#/shared/config/index.ts\";\n\nexport const defineRule = (rule: Rule): Rule => rule;\n\nexport const definePlugin = (plugin: Plugin): Plugin => plugin;\n"],"mappings":";;AAEA,MAAa,cAAc,SAAqB;AAEhD,MAAa,gBAAgB,WAA2B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as runCli$1, n as songPathspecs, o as failedWith, r as lint, s as formatDiagnostic, t as i68Section } from "./section-
|
|
1
|
+
import { c as runCli$1, n as songPathspecs, o as failedWith, r as lint, s as formatDiagnostic, t as i68Section } from "./section-nUBg-T7E.mjs";
|
|
2
2
|
// package.json
|
|
3
|
-
var version = "0.2.
|
|
3
|
+
var version = "0.2.2";
|
|
4
4
|
var description = "A linter for .fumx songs that checks musical rules such as notes outside the key, part ranges, voicing clashes and parallel fifths, configured from vite.config.ts with rules written in TypeScript.";
|
|
5
5
|
// src/app/cli.ts
|
|
6
6
|
const runCli = () => {
|
|
@@ -17,4 +17,4 @@ const runCli = () => {
|
|
|
17
17
|
};
|
|
18
18
|
export { runCli };
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=cli-
|
|
20
|
+
//# sourceMappingURL=cli-BsA_dteW.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-
|
|
1
|
+
{"version":3,"file":"cli-BsA_dteW.mjs","names":["manifest.version","manifest.description"],"sources":["../package.json","../src/app/cli.ts"],"sourcesContent":["","import { formatDiagnostic, runCli as runLinter } from \"@masseater.dev/lint-host\";\nimport manifest from \"@r_masseater/i68/package.json\" with { type: \"json\" };\n\nimport { failedWith } from \"#/shared/lib/errors.ts\";\n\nimport { lint } from \"./lint.ts\";\nimport { i68Section, songPathspecs } from \"./section.ts\";\n\nexport const runCli = (): void => {\n runLinter({\n name: \"i68\",\n version: manifest.version,\n description: manifest.description,\n section: i68Section,\n pathspecs: songPathspecs,\n lint,\n format: formatDiagnostic,\n failWith: failedWith,\n });\n};\n"],"mappings":";;;;;ACQA,MAAa,eAAqB;CAChC,SAAU;EACR,MAAM;EACGA;EACIC;EACb,SAAS;EACT,WAAW;EACX;EACA,QAAQ;EACR,UAAU;CACZ,CAAC;AACH"}
|
package/dist/cli.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as defineRule, t as definePlugin } from "./app-
|
|
2
|
-
import { a as I68Error, i as lintText, n as songPathspecs, r as lint, s as formatDiagnostic, t as i68Section } from "./section-
|
|
1
|
+
import { n as defineRule, t as definePlugin } from "./app-CS-xLSmb.mjs";
|
|
2
|
+
import { a as I68Error, i as lintText, n as songPathspecs, r as lint, s as formatDiagnostic, t as i68Section } from "./section-nUBg-T7E.mjs";
|
|
3
3
|
export { I68Error, definePlugin, defineRule, formatDiagnostic as format, i68Section, lint, lintText, songPathspecs };
|
package/dist/presets.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as defineRule, t as definePlugin } from "./app-
|
|
1
|
+
import { n as defineRule, t as definePlugin } from "./app-CS-xLSmb.mjs";
|
|
2
2
|
import { A as tracksOf, C as neighborsOf, D as sortByPitch, E as reporterOf, O as soundingAt, S as lowest, T as overlappingPairs, _ as pitchClassOf, a as StyleRulesSchema, b as highest, c as mixKeyOf, d as bach_chorales_default, f as progressionOf, g as nameOf, h as midiOf, i as HABIT_KINDS, k as topLineOf, m as keysOf, n as placeIn, p as keyAt, r as trackKeyOf, s as subjectKeyOf, t as mixFactsOf, u as longestContext, v as MELODIC, w as onsetsOf, x as isPitched, y as hasRole } from "./mix-facts-fJHVIUfj.mjs";
|
|
3
3
|
import { Array, Match, Number, Option, Order, Predicate, Record, String as String$1, pipe } from "effect";
|
|
4
4
|
import { TICKS_PER_WHOLE } from "@r_masseater/song-format";
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { Array, Boolean, Console, Effect, FileSystem, Function,
|
|
2
|
-
import { runMain } from "@
|
|
3
|
-
import { layer } from "@effect/platform-node/NodeServices";
|
|
1
|
+
import { Array, Boolean, Console, Effect, FileSystem, Function, Match, Option, Order, Path, Predicate, Record, Result, Schema, String as String$1, pipe } from "effect";
|
|
2
|
+
import { runMain } from "@r_masseater/node-main";
|
|
4
3
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
5
4
|
import { Argument, Command } from "effect/cli";
|
|
6
|
-
import { FetchHttpClient } from "effect/http";
|
|
7
|
-
import { Otlp, OtlpSerialization } from "effect/observability";
|
|
8
5
|
import { resolveConfigFromFile } from "vite-plus";
|
|
9
6
|
import { readSong } from "@r_masseater/song-format";
|
|
10
7
|
import { soundingsOf } from "@r_masseater/song-format/analysis";
|
|
@@ -150,10 +147,6 @@ const mainOf = (cli, patterns) => Effect.gen(function* main() {
|
|
|
150
147
|
yield* printAll(found, cli.format);
|
|
151
148
|
yield* failWhen(hasError(found));
|
|
152
149
|
});
|
|
153
|
-
const runTraced = (name, program) => {
|
|
154
|
-
const services = Otlp.layerFromConfig({ resource: { serviceName: name } }).pipe(Layer.provide(OtlpSerialization.layerJson), Layer.provide(FetchHttpClient.layer), Layer.provideMerge(layer));
|
|
155
|
-
runMain(program.pipe(Effect.provide(services)));
|
|
156
|
-
};
|
|
157
150
|
const variadicOf = ({ name, description }) => Argument.String(name).pipe(Argument.withDescription(description), Argument.variadic());
|
|
158
151
|
const pathspecArgument = () => variadicOf({
|
|
159
152
|
name: "pathspec",
|
|
@@ -161,7 +154,7 @@ const pathspecArgument = () => variadicOf({
|
|
|
161
154
|
});
|
|
162
155
|
const runCli = (cli) => {
|
|
163
156
|
const command = Command.make(cli.name, { pathspecs: pathspecArgument() }, ({ pathspecs }) => mainOf(cli, pathspecs)).pipe(Command.withDescription(cli.description));
|
|
164
|
-
|
|
157
|
+
runMain(cli.name)(Command.run(command, { version: cli.version }));
|
|
165
158
|
};
|
|
166
159
|
const present = Function.dual(2, (value, build) => Option.match(value, {
|
|
167
160
|
onNone: () => ({}),
|
|
@@ -423,4 +416,4 @@ const i68Section = sectionOf({
|
|
|
423
416
|
const songPathspecs = pathspecsOf({ defaults: ["*.fumx"] });
|
|
424
417
|
export { I68Error as a, runCli as c, lintText as i, songPathspecs as n, failedWith as o, lint as r, formatDiagnostic as s, i68Section as t };
|
|
425
418
|
|
|
426
|
-
//# sourceMappingURL=section-
|
|
419
|
+
//# sourceMappingURL=section-nUBg-T7E.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-nUBg-T7E.mjs","names":["Arr","Rec","taggedError","Rec","Str","taggedError","DATA_FIRST_ARITY","Arr","Fn","Str","Fn","LINE_START","Bool","Arr","Arr","Rec","Arr","Fn","Arr","Arr","SEPARATOR","Str","rulesOf","Rec","Arr","Str","rulesOf","Arr","Arr","Arr"],"sources":["../../lint-host/src/entities/rule/model/setting.ts","../../lint-host/src/entities/rule/model/severity.ts","../../lint-host/src/shared/lib/target.ts","../../lint-host/src/features/build-addon/model/build.ts","../../lint-host/src/shared/lib/fail.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/layers.ts","../../lint-host/src/shared/lib/diagnostic.ts","../../lint-host/src/shared/lib/section.ts","../src/entities/rule/model/extend.ts","../src/entities/rule/model/resolve.ts","../src/features/read-songs/model/read.ts","../src/shared/lib/errors.ts","../src/features/run-rules/model/suppressions.ts","../src/features/run-rules/model/run.ts","../src/app/lint.ts","../src/app/section.ts"],"sourcesContent":["import { Array as Arr, Match, Option, Record as Rec, pipe } from \"effect\";\n\nexport type Severity = \"off\" | \"warn\" | \"error\";\n\nexport type RuleOptions = Readonly<Record<string, unknown>>;\n\nexport type RuleEntry = Severity | readonly [Severity] | readonly [Severity, RuleOptions];\n\nexport interface Setting {\n readonly severity: Severity;\n readonly options: RuleOptions;\n}\n\nconst NO_OPTIONS: RuleOptions = {};\n\nexport const settingOf = (entry: RuleEntry): Setting =>\n Match.value(entry).pipe(\n Match.when(Match.string, (severity): Setting => ({ severity, options: NO_OPTIONS })),\n Match.orElse(([severity, options]): Setting => ({\n severity,\n options: options ?? NO_OPTIONS,\n })),\n );\n\nconst optionsOf = (entry: RuleEntry): Option.Option<RuleOptions> =>\n Match.value(entry).pipe(\n Match.when(Match.string, () => Option.none()),\n Match.orElse(([, options]) => Option.fromUndefinedOr(options)),\n );\n\nconst overridden = (earlier: RuleEntry, later: RuleEntry): RuleEntry =>\n pipe(\n optionsOf(later),\n Option.orElse(() => optionsOf(earlier)),\n Option.match({\n onNone: () => later,\n onSome: (options): RuleEntry => [settingOf(later).severity, options],\n }),\n );\n\nexport const mergedRules = (\n layers: readonly (Readonly<Record<string, RuleEntry>> | undefined)[],\n): Readonly<Record<string, RuleEntry>> => {\n const merged: Record<string, RuleEntry> = {};\n for (const [name, later] of pipe(\n layers,\n Arr.flatMap((layer) => Rec.toEntries(layer ?? {})),\n )) {\n merged[name] = pipe(\n Rec.get(merged, name),\n Option.match({\n onNone: () => later,\n onSome: (earlier) => overridden(earlier, later),\n }),\n );\n }\n return merged;\n};\n","import { Match } from \"effect\";\n\nimport type { Setting, Severity } from \"./setting.ts\";\n\nexport const reportedSeverity = (setting: Setting): Exclude<Severity, \"off\"> =>\n Match.value(setting.severity).pipe(\n Match.when(\"warn\", (): Exclude<Severity, \"off\"> => \"warn\"),\n Match.orElse((): Exclude<Severity, \"off\"> => \"error\"),\n );\n","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 \"@r_masseater/node-main\";\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(`${options.binary}-build`)(build(options));\n};\n","import { Schema } from \"effect\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class NotUtf8Error extends taggedError<NotUtf8Error, { readonly brand: unique symbol }>()(\n \"NotUtf8Error\",\n { path: Schema.String },\n) {}\n\nexport type FailWith<Failure> = (message: string) => (cause: unknown) => Failure;\n","import { runMain } from \"@r_masseater/node-main\";\nimport {\n Array as Arr,\n Console,\n Effect,\n FileSystem,\n Function as Fn,\n Option,\n Path,\n Record as Rec,\n String as Str,\n pipe,\n} from \"effect\";\nimport { Argument, Command, Flag } from \"effect/cli\";\nimport type { PlatformError } from \"effect/PlatformError\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\nimport { resolveConfigFromFile } from \"vite-plus\";\n\nimport { NotUtf8Error } from \"#/shared/lib/fail.ts\";\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 STRICT_UTF8 = new TextDecoder(\"utf-8\", { fatal: true });\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 | NotUtf8Error>;\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 version: string;\n readonly description: 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 ToolParameter {\n readonly name: string;\n readonly description: string;\n}\n\nexport interface ToolInput {\n readonly flags: ReadonlySet<string>;\n readonly args: readonly string[];\n}\n\nexport interface ToolCall<Config> {\n readonly root: string;\n readonly config: Config;\n readonly input: ToolInput;\n}\n\nexport interface Tool<Config, Found, Failure> extends SectionSource<Config, Failure> {\n readonly flags: readonly ToolParameter[];\n readonly argument: ToolParameter;\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 | NotUtf8Error>,\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 | NotUtf8Error> =>\n fileSystem.readFile(path.resolve(root, file)).pipe(\n Effect.mapError(failWith(`could not read ${file}`)),\n Effect.flatMap((bytes) =>\n Effect.try({\n try: () => STRICT_UTF8.decode(bytes),\n catch: () => NotUtf8Error.make({ path: file }),\n }),\n ),\n );\n });\n\nconst mainOf = <Config, Found extends Reported, Failure>(\n cli: Cli<Config, Found, Failure>,\n patterns: readonly string[],\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 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 =\n <Config, Found, Failure>(tool: Tool<Config, Found, Failure>) =>\n (input: ToolInput): 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, input });\n yield* printAll(found, tool.format);\n yield* failWhen(Arr.isReadonlyArrayNonEmpty(found));\n });\n\nconst variadicOf = ({ name, description }: ToolParameter): Argument.Argument<readonly string[]> =>\n Argument.String(name).pipe(Argument.withDescription(description), Argument.variadic());\n\nconst flagsOf = (flags: readonly ToolParameter[]): Readonly<Record<string, Flag.Flag<boolean>>> =>\n Rec.fromEntries(\n pipe(\n flags,\n Arr.map(({ name, description }) => [\n name,\n Flag.Boolean(name).pipe(Flag.withDescription(description), Flag.withDefault(false)),\n ]),\n ),\n );\n\nconst setFlags = (values: Readonly<Record<string, boolean>>): ReadonlySet<string> =>\n new Set(pipe(values, Rec.filter(Fn.identity), Rec.keys));\n\nexport const runTool = <Config, Found, Failure>(tool: Tool<Config, Found, Failure>): void => {\n const command = Command.make(\n tool.name,\n { args: variadicOf(tool.argument), flags: flagsOf(tool.flags) },\n ({ args, flags }) => toolMainOf(tool)({ args, flags: setFlags(flags) }),\n ).pipe(Command.withDescription(tool.description));\n runMain(tool.name)(Command.run(command, { version: tool.version }));\n};\n\nconst pathspecArgument = (): Argument.Argument<readonly string[]> =>\n variadicOf({\n name: \"pathspec\",\n description: \"Git pathspecs of the files to lint, in place of the configured ones\",\n });\n\nexport const runCli = <Config, Found extends Reported, Failure>(\n cli: Cli<Config, Found, Failure>,\n): void => {\n const command = Command.make(cli.name, { pathspecs: pathspecArgument() }, ({ pathspecs }) =>\n mainOf(cli, pathspecs),\n ).pipe(Command.withDescription(cli.description));\n runMain(cli.name)(Command.run(command, { version: cli.version }));\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, Record as Rec, pipe } from \"effect\";\n\nexport interface Layer<Plugin, Entry, Override> {\n readonly plugins?: Readonly<Record<string, Plugin>>;\n readonly rules?: Readonly<Record<string, Entry>>;\n readonly ignores?: readonly string[];\n readonly overrides?: readonly Override[];\n}\n\nexport interface Merged<Plugin, Entry, Override> {\n readonly plugins: Readonly<Record<string, Plugin>>;\n readonly rules: Readonly<Record<string, Entry>>;\n readonly ignores: readonly string[];\n readonly overrides: readonly Override[];\n}\n\nexport const mergedRecords = <Value>(\n records: readonly (Readonly<Record<string, Value>> | undefined)[],\n): Readonly<Record<string, Value>> =>\n pipe(\n records,\n Arr.flatMap((record) => Rec.toEntries(record ?? {})),\n Rec.fromEntries,\n );\n\nexport const layersOf = <Config extends { readonly extends?: readonly Config[] }>(\n config: Config,\n): readonly Omit<Config, \"extends\">[] => {\n const { extends: bases = [], ...own } = config;\n return [...pipe(bases, Arr.flatMap(layersOf)), own];\n};\n\nexport const mergedLayers = <Plugin, Entry, Override>(\n layers: readonly Layer<Plugin, Entry, Override>[],\n): Merged<Plugin, Entry, Override> => ({\n plugins: mergedRecords(\n pipe(\n layers,\n Arr.map((layer) => layer.plugins),\n ),\n ),\n rules: mergedRecords(\n pipe(\n layers,\n Arr.map((layer) => layer.rules),\n ),\n ),\n ignores: pipe(\n layers,\n Arr.flatMap((layer) => layer.ignores ?? []),\n ),\n overrides: pipe(\n layers,\n Arr.flatMap((layer) => layer.overrides ?? []),\n ),\n});\n","import { Array as Arr, Option, pipe } from \"effect\";\n\nexport interface Reportable {\n readonly path: string;\n readonly line: number;\n readonly column?: number | undefined;\n readonly rule: string;\n readonly message: string;\n readonly detail?: string | undefined;\n readonly context?: string | undefined;\n readonly severity: string;\n}\n\nexport const diagnosticDetail = (diagnostic: Reportable): string =>\n pipe(\n [diagnostic.detail, diagnostic.context],\n Arr.flatMap((part) => Option.toArray(Option.fromNullishOr(part))),\n Arr.filter((part) => part !== \"\"),\n Arr.map((part) => ` [${part}]`),\n Arr.join(\"\"),\n );\n\nexport const formatDiagnostic = (diagnostic: Reportable): string => {\n const column = pipe(\n Option.fromNullishOr(diagnostic.column),\n Option.map((value) => `:${String(value)}`),\n Option.getOrElse(() => \"\"),\n );\n return `${diagnostic.path}:${String(diagnostic.line)}${column} ${diagnostic.severity} ${diagnostic.rule} ${diagnostic.message}${diagnosticDetail(diagnostic)}`;\n};\n\nexport interface NotUtf8 {\n readonly path: string;\n readonly line: number;\n readonly column: number;\n readonly rule: string;\n readonly message: string;\n readonly severity: \"error\";\n}\n\nexport const notUtf8 =\n (tool: string) =>\n (path: string): NotUtf8 => ({\n path,\n line: 1,\n column: 1,\n rule: \"utf8\",\n message: `The file is not valid UTF-8, so ${tool} cannot read it`,\n severity: \"error\",\n });\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 { layersOf, mergedLayers, mergedRules } from \"@masseater.dev/lint-host\";\nimport { Array as Arr, pipe } from \"effect\";\n\nimport type { I68Config } from \"#/shared/config/index.ts\";\n\nexport const flattenConfig = (config: I68Config): I68Config => {\n const layers = layersOf(config);\n const { plugins, ignores } = mergedLayers(layers);\n const rules = mergedRules(\n pipe(\n layers,\n Arr.map((layer) => layer.rules),\n ),\n );\n return { plugins, rules, ignores };\n};\n","import { settingOf } from \"@masseater.dev/lint-host\";\nimport type { Setting } from \"@masseater.dev/lint-host\";\nimport { Array as Arr, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport type { I68Config, Plugin, Rule } from \"#/shared/config/index.ts\";\n\nconst SEPARATOR = \"/\";\nconst START = 0;\nconst ENABLED: Setting = settingOf(\"error\");\n\nexport interface ResolvedRule {\n readonly id: string;\n readonly rule: Rule;\n readonly setting: Setting;\n}\n\ntype PluginEntry = readonly [string, Plugin];\n\nconst idOf = (plugin: string, name: string): string => `${plugin}${SEPARATOR}${name}`;\n\nconst pluginOf = (id: string): string =>\n pipe(\n Str.indexOf(SEPARATOR)(id),\n Option.match({\n onNone: () => id,\n onSome: (slash) => Str.slice(START, slash)(id),\n }),\n );\n\nconst rulesOf =\n (config: I68Config) =>\n ([plugin, value]: PluginEntry): readonly ResolvedRule[] =>\n pipe(\n Rec.toEntries(value.rules),\n Arr.map(([name, rule]): ResolvedRule => {\n const id = idOf(plugin, name);\n return {\n id,\n rule,\n setting: pipe(\n config.rules ?? {},\n Rec.get(id),\n Option.map(settingOf),\n Option.getOrElse(() => ENABLED),\n ),\n };\n }),\n Arr.filter(({ setting }) => setting.severity !== \"off\"),\n );\n\nexport const resolve = (config: I68Config): readonly ResolvedRule[] =>\n pipe(Rec.toEntries(config.plugins ?? {}), Arr.flatMap(rulesOf(config)));\n\nexport const unknownPlugins = (config: I68Config): readonly string[] =>\n pipe(\n Rec.keys(config.rules ?? {}),\n Arr.map(pluginOf),\n Arr.filter((plugin) => !Rec.has(config.plugins ?? {}, plugin)),\n Arr.dedupe,\n );\n\nconst ruleNameOf = (id: string): string =>\n pipe(\n Str.indexOf(SEPARATOR)(id),\n Option.match({\n onNone: () => \"\",\n onSome: (slash) => Str.slice(slash + SEPARATOR.length)(id),\n }),\n );\n\nconst isKnownRule =\n (config: I68Config) =>\n (id: string): boolean =>\n pipe(\n Rec.get(config.plugins ?? {}, pluginOf(id)),\n Option.match({\n onNone: () => true,\n onSome: (plugin) => Rec.has(plugin.rules, ruleNameOf(id)),\n }),\n );\n\nexport const unknownRules = (config: I68Config): readonly string[] =>\n pipe(\n Rec.keys(config.rules ?? {}),\n Arr.filter((id) => !isKnownRule(config)(id)),\n );\n","import type { NotUtf8Error } from \"@masseater.dev/lint-host\";\nimport { readSong } from \"@r_masseater/song-format\";\nimport type { SongSource } from \"@r_masseater/song-format\";\nimport { Effect } from \"effect\";\n\nimport type { I68Error } from \"#/shared/lib/errors.ts\";\n\nconst SEPARATOR = \"/\";\n\nexport interface SongFile {\n readonly file: string;\n readonly source: SongSource;\n}\n\nexport type Read = (path: string) => Effect.Effect<string, I68Error | NotUtf8Error>;\n\nexport interface ReadInput {\n readonly root: string;\n readonly file: string;\n readonly read: Read;\n}\n\nexport const pathOf = (input: Omit<ReadInput, \"read\">): string =>\n `${input.root}${SEPARATOR}${input.file}`;\n\nexport const readSongFile = Effect.fn(\"i68.read\")(function* readSongFile(input: ReadInput) {\n const source = yield* readSong({ path: pathOf(input), read: input.read });\n return { file: input.file, source } satisfies SongFile;\n});\n","import { Schema } from \"effect\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class I68Error extends taggedError<I68Error, { readonly brand: unique symbol }>()(\n \"I68Error\",\n { message: Schema.String },\n) {}\n\nexport const failedWith =\n (message: string) =>\n (cause: unknown): I68Error =>\n I68Error.make({ message: `${message}: ${String(cause)}` });\n","import type { SourceComment } from \"@r_masseater/song-format\";\nimport { Array as Arr, Match, Option, String as Str, pipe } from \"effect\";\n\nconst DIRECTIVE =\n /^i68-(?<kind>ignore-next-line|ignore-file|ignore|disable|enable)(?:\\s(?<rest>[\\s\\S]*))?$/u;\nconst REASON = /\\s-{2,}(?:\\s|$)/u;\nconst LINE_MARK = \"//\";\nconst BLOCK_START = \"/*\";\nconst BLOCK_END = \"*/\";\nconst LIST = \",\";\nconst NEXT = 1;\nconst LINE_START = 0;\n\ntype Kind = \"ignore\" | \"ignore-next-line\" | \"ignore-file\" | \"disable\" | \"enable\";\n\ninterface Directive {\n readonly line: number;\n readonly column: number;\n readonly kind: Kind;\n readonly rules: readonly string[];\n}\n\nexport interface Suppressed {\n readonly line: number;\n readonly column?: number;\n readonly rule: string;\n}\n\nconst kindOf = (text: string): Kind =>\n Match.value(text).pipe(\n Match.when(\"ignore-file\", (): Kind => \"ignore-file\"),\n Match.when(\"ignore-next-line\", (): Kind => \"ignore-next-line\"),\n Match.when(\"disable\", (): Kind => \"disable\"),\n Match.when(\"enable\", (): Kind => \"enable\"),\n Match.orElse((): Kind => \"ignore\"),\n );\n\nconst bodyOf = (text: string): string => {\n if (Str.startsWith(BLOCK_START)(text)) {\n return pipe(text, Str.slice(BLOCK_START.length), Str.replace(BLOCK_END, \"\"), Str.trim);\n }\n return pipe(text, Str.slice(LINE_MARK.length), Str.trim);\n};\n\nconst rulesOf = (rest: string): readonly string[] =>\n pipe(\n Str.split(` ${rest}`, REASON),\n Arr.head,\n Option.getOrElse(() => \"\"),\n Str.split(LIST),\n Arr.map(Str.trim),\n Arr.filter(Str.isNonEmpty),\n );\n\nconst groupsOf = (text: string): Option.Option<Partial<Record<string, string>>> =>\n pipe(\n Option.fromNullishOr(DIRECTIVE.exec(text)),\n Option.flatMap((found) => Option.fromNullishOr(found.groups)),\n );\n\nconst directiveOf = (comment: SourceComment): Option.Option<Directive> =>\n pipe(\n groupsOf(bodyOf(comment.text)),\n Option.map((groups) => ({\n line: comment.line,\n column: comment.column,\n kind: kindOf(groups[\"kind\"] ?? \"\"),\n rules: rulesOf(groups[\"rest\"] ?? \"\"),\n })),\n );\n\nconst names =\n (rule: string) =>\n (directive: Directive): boolean =>\n !Arr.isReadonlyArrayNonEmpty(directive.rules) || Arr.contains(directive.rules, rule);\n\nconst isRange = (directive: Directive): boolean =>\n directive.kind === \"disable\" || directive.kind === \"enable\";\n\nconst coversLine =\n (found: Suppressed) =>\n (directive: Directive): boolean =>\n names(found.rule)(directive) &&\n Match.value(directive.kind).pipe(\n Match.when(\"ignore-file\", () => true),\n Match.when(\"ignore-next-line\", () => directive.line + NEXT === found.line),\n Match.when(\"ignore\", () => directive.line === found.line),\n Match.orElse(() => false),\n );\n\nconst isAfter =\n (found: Suppressed) =>\n (directive: Directive): boolean =>\n directive.line < found.line ||\n (directive.line === found.line && directive.column <= (found.column ?? LINE_START));\n\nconst insideRange =\n (directives: readonly Directive[]) =>\n (found: Suppressed): boolean =>\n pipe(\n directives,\n Arr.filter(\n (directive) =>\n isRange(directive) && isAfter(found)(directive) && names(found.rule)(directive),\n ),\n Arr.last,\n Option.exists((directive) => directive.kind === \"disable\"),\n );\n\nexport const suppressionsOf = (\n comments: readonly SourceComment[],\n): ((found: Suppressed) => boolean) => {\n const directives = pipe(comments, Arr.map(directiveOf), Arr.getSomes);\n return (found) => pipe(directives, Arr.some(coversLine(found))) || insideRange(directives)(found);\n};\n","import { present, reportedSeverity } from \"@masseater.dev/lint-host\";\nimport type { Song, SourceComment } from \"@r_masseater/song-format\";\nimport { soundingsOf } from \"@r_masseater/song-format/analysis\";\nimport type { Sounding } from \"@r_masseater/song-format/analysis\";\nimport { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport type { ResolvedRule } from \"#/entities/rule/index.ts\";\nimport type { Diagnostic, Report } from \"#/shared/config/index.ts\";\nimport { failedWith } from \"#/shared/lib/errors.ts\";\nimport type { I68Error } from \"#/shared/lib/errors.ts\";\n\nimport { suppressionsOf } from \"./suppressions.ts\";\n\nexport interface RunInput {\n readonly path: string;\n readonly comments: readonly SourceComment[];\n readonly song: Song;\n readonly rules: readonly ResolvedRule[];\n}\n\nconst diagnosticOf =\n (path: string, rule: ResolvedRule) =>\n (report: Report): Diagnostic => ({\n path,\n line: report.line,\n rule: rule.id,\n message: report.message,\n severity: reportedSeverity(rule.setting),\n ...present(Option.fromNullishOr(report.column), (column) => ({ column })),\n ...present(Option.fromNullishOr(report.detail), (detail) => ({ detail })),\n });\n\nconst runOne = (\n input: RunInput,\n soundings: readonly Sounding[],\n): ((rule: ResolvedRule) => Effect.Effect<readonly Diagnostic[], I68Error>) =>\n Effect.fn(\"i68.rule\")(function* run(rule: ResolvedRule) {\n yield* Effect.annotateCurrentSpan({ \"i68.rule\": rule.id });\n const reports: Report[] = [];\n yield* Effect.try({\n try: () => {\n rule.rule.check({\n filename: input.path,\n song: input.song,\n soundings,\n options: rule.setting.options,\n report: (report) => {\n reports.push(report);\n },\n });\n },\n catch: failedWith(`${rule.id} failed`),\n });\n return pipe(reports, Arr.map(diagnosticOf(input.path, rule)));\n });\n\nexport const runRules = Effect.fn(\"i68.rules\")(function* runRules(input: RunInput) {\n const soundings = soundingsOf(input.song);\n const suppressed = suppressionsOf(input.comments);\n const found = yield* pipe(\n input.rules,\n Effect.forEach(runOne(input, soundings), { concurrency: 1 }),\n );\n return pipe(\n Arr.flatten(found),\n Arr.filter((diagnostic) => !suppressed(diagnostic)),\n );\n});\n","import { NotUtf8Error, notUtf8, sortByPosition } from \"@masseater.dev/lint-host\";\nimport { readSong } from \"@r_masseater/song-format\";\nimport type { SourceIssue } from \"@r_masseater/song-format\";\nimport { Array as Arr, Effect, Result, Schema, pipe } from \"effect\";\n\nimport { flattenConfig, resolve, unknownPlugins, unknownRules } from \"#/entities/rule/index.ts\";\nimport type { ResolvedRule } from \"#/entities/rule/index.ts\";\nimport { pathOf, readSongFile } from \"#/features/read-songs/index.ts\";\nimport type { Read, SongFile } from \"#/features/read-songs/index.ts\";\nimport { runRules } from \"#/features/run-rules/index.ts\";\nimport type { Diagnostic, I68Config } from \"#/shared/config/index.ts\";\nimport { I68Error } from \"#/shared/lib/errors.ts\";\n\nconst PARSE_RULE = \"i68/parse\";\n\nexport interface LintInput {\n readonly root: string;\n readonly files: readonly string[];\n readonly read: Read;\n readonly config?: I68Config;\n}\n\nexport interface TextInput {\n readonly path: string;\n readonly text: string;\n readonly read?: Read;\n readonly config?: I68Config;\n}\n\nconst failIfAny =\n (problem: string) =>\n (names: readonly string[]): Effect.Effect<void, I68Error> =>\n Arr.match(names, {\n onEmpty: () => Effect.void,\n onNonEmpty: (found) =>\n Effect.fail(I68Error.make({ message: `${problem}: ${Arr.join(found, \", \")}` })),\n });\n\nconst UNKNOWN_PLUGINS = failIfAny(\"rules name plugins that are not configured\");\nconst UNKNOWN_RULES = failIfAny(\"rules name rules that their plugins do not have\");\n\nconst checkPlugins = (config: I68Config): Effect.Effect<void, I68Error> => {\n const rules = UNKNOWN_RULES(unknownRules(config));\n return UNKNOWN_PLUGINS(unknownPlugins(config)).pipe(Effect.andThen(rules));\n};\n\nconst rulesOf = (\n config: I68Config | undefined,\n): Effect.Effect<readonly ResolvedRule[], I68Error> => {\n const flat = flattenConfig(config ?? {});\n return checkPlugins(flat).pipe(Effect.as(resolve(flat)));\n};\n\nconst parseDiagnosticsOf =\n (file: string) =>\n (issues: readonly SourceIssue[]): readonly Diagnostic[] =>\n pipe(\n issues,\n Arr.map((issue): Diagnostic => ({\n path: file,\n line: issue.line,\n column: issue.column,\n rule: PARSE_RULE,\n message: issue.message,\n severity: \"error\",\n })),\n );\n\nconst lintFile =\n (rules: readonly ResolvedRule[]) =>\n (song: SongFile): Effect.Effect<readonly Diagnostic[], I68Error> => {\n if (song.source.status === \"invalid\") {\n return Effect.succeed(parseDiagnosticsOf(song.file)(song.source.issues));\n }\n return runRules({\n path: song.file,\n comments: song.source.outline.comments,\n song: song.source.song,\n rules,\n });\n };\n\nconst notFound = (path: string): Effect.Effect<string, I68Error> =>\n Effect.fail(I68Error.make({ message: `could not read ${path}` }));\n\nconst readerOf =\n (input: TextInput): Read =>\n (path) => {\n if (path === input.path) {\n return Effect.succeed(input.text);\n }\n return (input.read ?? notFound)(path);\n };\n\nconst lintTracked = (\n rules: readonly ResolvedRule[],\n input: LintInput,\n): ((file: string) => Effect.Effect<readonly Diagnostic[], I68Error>) =>\n Effect.fnUntraced(function* lintOne(\n file: string,\n ): Effect.fn.Return<readonly Diagnostic[], I68Error> {\n const path = pathOf({ root: input.root, file });\n const read = yield* Effect.result(input.read(path));\n if (Result.isFailure(read) && Schema.is(NotUtf8Error)(read.failure)) {\n return [notUtf8(\"i68\")(file)];\n }\n const reader = Result.match(read, {\n onFailure: () => input.read,\n onSuccess: (text): Read => readerOf({ path, text, read: input.read }),\n });\n const source = yield* readSongFile({ root: input.root, file, read: reader });\n return yield* lintFile(rules)(source);\n });\n\nexport const lint = Effect.fn(\"i68.lint\")(function* lint(input: LintInput) {\n const rules = yield* rulesOf(input.config);\n const found = yield* Effect.forEach(input.files, lintTracked(rules, input), {\n concurrency: \"unbounded\",\n });\n return sortByPosition<Diagnostic>(Arr.flatten(found));\n});\n\nexport const lintText = Effect.fn(\"i68.lintText\")(function* lintText(input: TextInput) {\n const rules = yield* rulesOf(input.config);\n const source = yield* readSong({ path: input.path, read: readerOf(input) });\n const found = yield* lintFile(rules)({ file: input.path, source });\n return sortByPosition<Diagnostic>(found);\n});\n","import { pathspecsOf, sectionOf } from \"@masseater.dev/lint-host\";\nimport type { PathspecRequest } from \"@masseater.dev/lint-host\";\n\nimport { flattenConfig } from \"#/entities/rule/index.ts\";\nimport type { I68Config } from \"#/shared/config/index.ts\";\n\nexport type PathspecInput = PathspecRequest<I68Config>;\n\nexport const i68Section = sectionOf<I68Config>({\n name: \"i68\",\n prepare: flattenConfig,\n fallback: {},\n});\n\nexport const songPathspecs = pathspecsOf({ defaults: [\"*.fumx\"] });\n"],"mappings":";;;;;;;;AAaA,MAAM,aAA0B,CAAC;AAEjC,MAAa,aAAa,UACxB,MAAM,MAAM,KAAK,CAAC,CAAC,KACjB,MAAM,KAAK,MAAM,SAAS,cAAuB;CAAE;CAAU,SAAS;AAAW,EAAE,GACnF,MAAM,QAAQ,CAAC,UAAU,cAAuB;CAC9C;CACA,SAAS,WAAW;AACtB,EAAE,CACJ;AAEF,MAAM,aAAa,UACjB,MAAM,MAAM,KAAK,CAAC,CAAC,KACjB,MAAM,KAAK,MAAM,cAAc,OAAO,KAAK,CAAC,GAC5C,MAAM,QAAQ,GAAG,aAAa,OAAO,gBAAgB,OAAO,CAAC,CAC/D;AAEF,MAAM,cAAc,SAAoB,UACtC,KACE,UAAU,KAAK,GACf,OAAO,aAAa,UAAU,OAAO,CAAC,GACtC,OAAO,MAAM;CACX,cAAc;CACd,SAAS,YAAuB,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU,OAAO;A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S,OAAO,MAAM,MAAM;EAChC,iBAAiB,MAAM;EACvB,YAAY,SAAe,SAAS;GAAE;GAAM;GAAM,MAAM,MAAM;EAAK,CAAC;CACtE,CAAC;CACD,MAAM,SAAS,OAAO,aAAa;EAAE,MAAM,MAAM;EAAM;EAAM,MAAM;CAAO,CAAC;CAC3E,OAAO,OAAO,SAAS,KAAK,CAAC,CAAC,MAAM;AACtC,CAAC;AAEH,MAAa,OAAO,OAAO,GAAG,UAAU,CAAC,CAAC,UAAU,KAAK,OAAkB;CACzE,MAAM,QAAQ,OAAO,QAAQ,MAAM,MAAM;CACzC,MAAM,QAAQ,OAAO,OAAO,QAAQ,MAAM,OAAO,YAAY,OAAO,KAAK,GAAG,EAC1E,aAAa,YACf,CAAC;CACD,OAAO,eAA2BA,MAAI,QAAQ,KAAK,CAAC;AACtD,CAAC;AAED,MAAa,WAAW,OAAO,GAAG,cAAc,CAAC,CAAC,UAAU,SAAS,OAAkB;CACrF,MAAM,QAAQ,OAAO,QAAQ,MAAM,MAAM;CACzC,MAAM,SAAS,OAAO,SAAS;EAAE,MAAM,MAAM;EAAM,MAAM,SAAS,KAAK;CAAE,CAAC;CAC1E,MAAM,QAAQ,OAAO,SAAS,KAAK,CAAC,CAAC;EAAE,MAAM,MAAM;EAAM;CAAO,CAAC;CACjE,OAAO,eAA2B,KAAK;AACzC,CAAC;;ACvHD,MAAa,aAAa,UAAqB;CAC7C,MAAM;CACN,SAAS;CACT,UAAU,CAAC;AACb,CAAC;AAED,MAAa,gBAAgB,YAAY,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@r_masseater/i68",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "A linter for .fumx songs that checks musical rules such as notes outside the key, part ranges, voicing clashes and parallel fifths, configured from vite.config.ts with rules written in TypeScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fumx",
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@effect/platform-node": "^4.1.5",
|
|
64
|
-
"@r_masseater/
|
|
64
|
+
"@r_masseater/node-main": "^0.2.0",
|
|
65
|
+
"@r_masseater/song-format": "^0.2.3"
|
|
65
66
|
},
|
|
66
67
|
"devDependencies": {
|
|
67
68
|
"@effect/vitest": "4.1.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"section-C_cbbf7V.mjs","names":["Arr","Rec","taggedError","Rec","Str","taggedError","DATA_FIRST_ARITY","Arr","Fn","Str","nodeServices","Fn","LINE_START","Bool","Arr","Arr","Rec","Arr","Fn","Arr","Arr","SEPARATOR","Str","rulesOf","Rec","Arr","Str","rulesOf","Arr","Arr","Arr"],"sources":["../../lint-host/src/entities/rule/model/setting.ts","../../lint-host/src/entities/rule/model/severity.ts","../../lint-host/src/shared/lib/target.ts","../../lint-host/src/features/build-addon/model/build.ts","../../lint-host/src/shared/lib/fail.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/layers.ts","../../lint-host/src/shared/lib/diagnostic.ts","../../lint-host/src/shared/lib/section.ts","../src/entities/rule/model/extend.ts","../src/entities/rule/model/resolve.ts","../src/features/read-songs/model/read.ts","../src/shared/lib/errors.ts","../src/features/run-rules/model/suppressions.ts","../src/features/run-rules/model/run.ts","../src/app/lint.ts","../src/app/section.ts"],"sourcesContent":["import { Array as Arr, Match, Option, Record as Rec, pipe } from \"effect\";\n\nexport type Severity = \"off\" | \"warn\" | \"error\";\n\nexport type RuleOptions = Readonly<Record<string, unknown>>;\n\nexport type RuleEntry = Severity | readonly [Severity] | readonly [Severity, RuleOptions];\n\nexport interface Setting {\n readonly severity: Severity;\n readonly options: RuleOptions;\n}\n\nconst NO_OPTIONS: RuleOptions = {};\n\nexport const settingOf = (entry: RuleEntry): Setting =>\n Match.value(entry).pipe(\n Match.when(Match.string, (severity): Setting => ({ severity, options: NO_OPTIONS })),\n Match.orElse(([severity, options]): Setting => ({\n severity,\n options: options ?? NO_OPTIONS,\n })),\n );\n\nconst optionsOf = (entry: RuleEntry): Option.Option<RuleOptions> =>\n Match.value(entry).pipe(\n Match.when(Match.string, () => Option.none()),\n Match.orElse(([, options]) => Option.fromUndefinedOr(options)),\n );\n\nconst overridden = (earlier: RuleEntry, later: RuleEntry): RuleEntry =>\n pipe(\n optionsOf(later),\n Option.orElse(() => optionsOf(earlier)),\n Option.match({\n onNone: () => later,\n onSome: (options): RuleEntry => [settingOf(later).severity, options],\n }),\n );\n\nexport const mergedRules = (\n layers: readonly (Readonly<Record<string, RuleEntry>> | undefined)[],\n): Readonly<Record<string, RuleEntry>> => {\n const merged: Record<string, RuleEntry> = {};\n for (const [name, later] of pipe(\n layers,\n Arr.flatMap((layer) => Rec.toEntries(layer ?? {})),\n )) {\n merged[name] = pipe(\n Rec.get(merged, name),\n Option.match({\n onNone: () => later,\n onSome: (earlier) => overridden(earlier, later),\n }),\n );\n }\n return merged;\n};\n","import { Match } from \"effect\";\n\nimport type { Setting, Severity } from \"./setting.ts\";\n\nexport const reportedSeverity = (setting: Setting): Exclude<Severity, \"off\"> =>\n Match.value(setting.severity).pipe(\n Match.when(\"warn\", (): Exclude<Severity, \"off\"> => \"warn\"),\n Match.orElse((): Exclude<Severity, \"off\"> => \"error\"),\n );\n","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 { Schema } from \"effect\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class NotUtf8Error extends taggedError<NotUtf8Error, { readonly brand: unique symbol }>()(\n \"NotUtf8Error\",\n { path: Schema.String },\n) {}\n\nexport type FailWith<Failure> = (message: string) => (cause: unknown) => Failure;\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 Record as Rec,\n String as Str,\n pipe,\n} from \"effect\";\nimport { Argument, Command, Flag } from \"effect/cli\";\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 { NotUtf8Error } from \"#/shared/lib/fail.ts\";\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 STRICT_UTF8 = new TextDecoder(\"utf-8\", { fatal: true });\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 | NotUtf8Error>;\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 version: string;\n readonly description: 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 ToolParameter {\n readonly name: string;\n readonly description: string;\n}\n\nexport interface ToolInput {\n readonly flags: ReadonlySet<string>;\n readonly args: readonly string[];\n}\n\nexport interface ToolCall<Config> {\n readonly root: string;\n readonly config: Config;\n readonly input: ToolInput;\n}\n\nexport interface Tool<Config, Found, Failure> extends SectionSource<Config, Failure> {\n readonly flags: readonly ToolParameter[];\n readonly argument: ToolParameter;\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 | NotUtf8Error>,\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 | NotUtf8Error> =>\n fileSystem.readFile(path.resolve(root, file)).pipe(\n Effect.mapError(failWith(`could not read ${file}`)),\n Effect.flatMap((bytes) =>\n Effect.try({\n try: () => STRICT_UTF8.decode(bytes),\n catch: () => NotUtf8Error.make({ path: file }),\n }),\n ),\n );\n });\n\nconst mainOf = <Config, Found extends Reported, Failure>(\n cli: Cli<Config, Found, Failure>,\n patterns: readonly string[],\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 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 =\n <Config, Found, Failure>(tool: Tool<Config, Found, Failure>) =>\n (input: ToolInput): 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, input });\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 | Command.Environment>,\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\nconst variadicOf = ({ name, description }: ToolParameter): Argument.Argument<readonly string[]> =>\n Argument.String(name).pipe(Argument.withDescription(description), Argument.variadic());\n\nconst flagsOf = (flags: readonly ToolParameter[]): Readonly<Record<string, Flag.Flag<boolean>>> =>\n Rec.fromEntries(\n pipe(\n flags,\n Arr.map(({ name, description }) => [\n name,\n Flag.Boolean(name).pipe(Flag.withDescription(description), Flag.withDefault(false)),\n ]),\n ),\n );\n\nconst setFlags = (values: Readonly<Record<string, boolean>>): ReadonlySet<string> =>\n new Set(pipe(values, Rec.filter(Fn.identity), Rec.keys));\n\nexport const runTool = <Config, Found, Failure>(tool: Tool<Config, Found, Failure>): void => {\n const command = Command.make(\n tool.name,\n { args: variadicOf(tool.argument), flags: flagsOf(tool.flags) },\n ({ args, flags }) => toolMainOf(tool)({ args, flags: setFlags(flags) }),\n ).pipe(Command.withDescription(tool.description));\n runTraced(tool.name, Command.run(command, { version: tool.version }));\n};\n\nconst pathspecArgument = (): Argument.Argument<readonly string[]> =>\n variadicOf({\n name: \"pathspec\",\n description: \"Git pathspecs of the files to lint, in place of the configured ones\",\n });\n\nexport const runCli = <Config, Found extends Reported, Failure>(\n cli: Cli<Config, Found, Failure>,\n): void => {\n const command = Command.make(cli.name, { pathspecs: pathspecArgument() }, ({ pathspecs }) =>\n mainOf(cli, pathspecs),\n ).pipe(Command.withDescription(cli.description));\n runTraced(cli.name, Command.run(command, { version: cli.version }));\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, Record as Rec, pipe } from \"effect\";\n\nexport interface Layer<Plugin, Entry, Override> {\n readonly plugins?: Readonly<Record<string, Plugin>>;\n readonly rules?: Readonly<Record<string, Entry>>;\n readonly ignores?: readonly string[];\n readonly overrides?: readonly Override[];\n}\n\nexport interface Merged<Plugin, Entry, Override> {\n readonly plugins: Readonly<Record<string, Plugin>>;\n readonly rules: Readonly<Record<string, Entry>>;\n readonly ignores: readonly string[];\n readonly overrides: readonly Override[];\n}\n\nexport const mergedRecords = <Value>(\n records: readonly (Readonly<Record<string, Value>> | undefined)[],\n): Readonly<Record<string, Value>> =>\n pipe(\n records,\n Arr.flatMap((record) => Rec.toEntries(record ?? {})),\n Rec.fromEntries,\n );\n\nexport const layersOf = <Config extends { readonly extends?: readonly Config[] }>(\n config: Config,\n): readonly Omit<Config, \"extends\">[] => {\n const { extends: bases = [], ...own } = config;\n return [...pipe(bases, Arr.flatMap(layersOf)), own];\n};\n\nexport const mergedLayers = <Plugin, Entry, Override>(\n layers: readonly Layer<Plugin, Entry, Override>[],\n): Merged<Plugin, Entry, Override> => ({\n plugins: mergedRecords(\n pipe(\n layers,\n Arr.map((layer) => layer.plugins),\n ),\n ),\n rules: mergedRecords(\n pipe(\n layers,\n Arr.map((layer) => layer.rules),\n ),\n ),\n ignores: pipe(\n layers,\n Arr.flatMap((layer) => layer.ignores ?? []),\n ),\n overrides: pipe(\n layers,\n Arr.flatMap((layer) => layer.overrides ?? []),\n ),\n});\n","import { Array as Arr, Option, pipe } from \"effect\";\n\nexport interface Reportable {\n readonly path: string;\n readonly line: number;\n readonly column?: number | undefined;\n readonly rule: string;\n readonly message: string;\n readonly detail?: string | undefined;\n readonly context?: string | undefined;\n readonly severity: string;\n}\n\nexport const diagnosticDetail = (diagnostic: Reportable): string =>\n pipe(\n [diagnostic.detail, diagnostic.context],\n Arr.flatMap((part) => Option.toArray(Option.fromNullishOr(part))),\n Arr.filter((part) => part !== \"\"),\n Arr.map((part) => ` [${part}]`),\n Arr.join(\"\"),\n );\n\nexport const formatDiagnostic = (diagnostic: Reportable): string => {\n const column = pipe(\n Option.fromNullishOr(diagnostic.column),\n Option.map((value) => `:${String(value)}`),\n Option.getOrElse(() => \"\"),\n );\n return `${diagnostic.path}:${String(diagnostic.line)}${column} ${diagnostic.severity} ${diagnostic.rule} ${diagnostic.message}${diagnosticDetail(diagnostic)}`;\n};\n\nexport interface NotUtf8 {\n readonly path: string;\n readonly line: number;\n readonly column: number;\n readonly rule: string;\n readonly message: string;\n readonly severity: \"error\";\n}\n\nexport const notUtf8 =\n (tool: string) =>\n (path: string): NotUtf8 => ({\n path,\n line: 1,\n column: 1,\n rule: \"utf8\",\n message: `The file is not valid UTF-8, so ${tool} cannot read it`,\n severity: \"error\",\n });\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 { layersOf, mergedLayers, mergedRules } from \"@masseater.dev/lint-host\";\nimport { Array as Arr, pipe } from \"effect\";\n\nimport type { I68Config } from \"#/shared/config/index.ts\";\n\nexport const flattenConfig = (config: I68Config): I68Config => {\n const layers = layersOf(config);\n const { plugins, ignores } = mergedLayers(layers);\n const rules = mergedRules(\n pipe(\n layers,\n Arr.map((layer) => layer.rules),\n ),\n );\n return { plugins, rules, ignores };\n};\n","import { settingOf } from \"@masseater.dev/lint-host\";\nimport type { Setting } from \"@masseater.dev/lint-host\";\nimport { Array as Arr, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport type { I68Config, Plugin, Rule } from \"#/shared/config/index.ts\";\n\nconst SEPARATOR = \"/\";\nconst START = 0;\nconst ENABLED: Setting = settingOf(\"error\");\n\nexport interface ResolvedRule {\n readonly id: string;\n readonly rule: Rule;\n readonly setting: Setting;\n}\n\ntype PluginEntry = readonly [string, Plugin];\n\nconst idOf = (plugin: string, name: string): string => `${plugin}${SEPARATOR}${name}`;\n\nconst pluginOf = (id: string): string =>\n pipe(\n Str.indexOf(SEPARATOR)(id),\n Option.match({\n onNone: () => id,\n onSome: (slash) => Str.slice(START, slash)(id),\n }),\n );\n\nconst rulesOf =\n (config: I68Config) =>\n ([plugin, value]: PluginEntry): readonly ResolvedRule[] =>\n pipe(\n Rec.toEntries(value.rules),\n Arr.map(([name, rule]): ResolvedRule => {\n const id = idOf(plugin, name);\n return {\n id,\n rule,\n setting: pipe(\n config.rules ?? {},\n Rec.get(id),\n Option.map(settingOf),\n Option.getOrElse(() => ENABLED),\n ),\n };\n }),\n Arr.filter(({ setting }) => setting.severity !== \"off\"),\n );\n\nexport const resolve = (config: I68Config): readonly ResolvedRule[] =>\n pipe(Rec.toEntries(config.plugins ?? {}), Arr.flatMap(rulesOf(config)));\n\nexport const unknownPlugins = (config: I68Config): readonly string[] =>\n pipe(\n Rec.keys(config.rules ?? {}),\n Arr.map(pluginOf),\n Arr.filter((plugin) => !Rec.has(config.plugins ?? {}, plugin)),\n Arr.dedupe,\n );\n\nconst ruleNameOf = (id: string): string =>\n pipe(\n Str.indexOf(SEPARATOR)(id),\n Option.match({\n onNone: () => \"\",\n onSome: (slash) => Str.slice(slash + SEPARATOR.length)(id),\n }),\n );\n\nconst isKnownRule =\n (config: I68Config) =>\n (id: string): boolean =>\n pipe(\n Rec.get(config.plugins ?? {}, pluginOf(id)),\n Option.match({\n onNone: () => true,\n onSome: (plugin) => Rec.has(plugin.rules, ruleNameOf(id)),\n }),\n );\n\nexport const unknownRules = (config: I68Config): readonly string[] =>\n pipe(\n Rec.keys(config.rules ?? {}),\n Arr.filter((id) => !isKnownRule(config)(id)),\n );\n","import type { NotUtf8Error } from \"@masseater.dev/lint-host\";\nimport { readSong } from \"@r_masseater/song-format\";\nimport type { SongSource } from \"@r_masseater/song-format\";\nimport { Effect } from \"effect\";\n\nimport type { I68Error } from \"#/shared/lib/errors.ts\";\n\nconst SEPARATOR = \"/\";\n\nexport interface SongFile {\n readonly file: string;\n readonly source: SongSource;\n}\n\nexport type Read = (path: string) => Effect.Effect<string, I68Error | NotUtf8Error>;\n\nexport interface ReadInput {\n readonly root: string;\n readonly file: string;\n readonly read: Read;\n}\n\nexport const pathOf = (input: Omit<ReadInput, \"read\">): string =>\n `${input.root}${SEPARATOR}${input.file}`;\n\nexport const readSongFile = Effect.fn(\"i68.read\")(function* readSongFile(input: ReadInput) {\n const source = yield* readSong({ path: pathOf(input), read: input.read });\n return { file: input.file, source } satisfies SongFile;\n});\n","import { Schema } from \"effect\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class I68Error extends taggedError<I68Error, { readonly brand: unique symbol }>()(\n \"I68Error\",\n { message: Schema.String },\n) {}\n\nexport const failedWith =\n (message: string) =>\n (cause: unknown): I68Error =>\n I68Error.make({ message: `${message}: ${String(cause)}` });\n","import type { SourceComment } from \"@r_masseater/song-format\";\nimport { Array as Arr, Match, Option, String as Str, pipe } from \"effect\";\n\nconst DIRECTIVE =\n /^i68-(?<kind>ignore-next-line|ignore-file|ignore|disable|enable)(?:\\s(?<rest>[\\s\\S]*))?$/u;\nconst REASON = /\\s-{2,}(?:\\s|$)/u;\nconst LINE_MARK = \"//\";\nconst BLOCK_START = \"/*\";\nconst BLOCK_END = \"*/\";\nconst LIST = \",\";\nconst NEXT = 1;\nconst LINE_START = 0;\n\ntype Kind = \"ignore\" | \"ignore-next-line\" | \"ignore-file\" | \"disable\" | \"enable\";\n\ninterface Directive {\n readonly line: number;\n readonly column: number;\n readonly kind: Kind;\n readonly rules: readonly string[];\n}\n\nexport interface Suppressed {\n readonly line: number;\n readonly column?: number;\n readonly rule: string;\n}\n\nconst kindOf = (text: string): Kind =>\n Match.value(text).pipe(\n Match.when(\"ignore-file\", (): Kind => \"ignore-file\"),\n Match.when(\"ignore-next-line\", (): Kind => \"ignore-next-line\"),\n Match.when(\"disable\", (): Kind => \"disable\"),\n Match.when(\"enable\", (): Kind => \"enable\"),\n Match.orElse((): Kind => \"ignore\"),\n );\n\nconst bodyOf = (text: string): string => {\n if (Str.startsWith(BLOCK_START)(text)) {\n return pipe(text, Str.slice(BLOCK_START.length), Str.replace(BLOCK_END, \"\"), Str.trim);\n }\n return pipe(text, Str.slice(LINE_MARK.length), Str.trim);\n};\n\nconst rulesOf = (rest: string): readonly string[] =>\n pipe(\n Str.split(` ${rest}`, REASON),\n Arr.head,\n Option.getOrElse(() => \"\"),\n Str.split(LIST),\n Arr.map(Str.trim),\n Arr.filter(Str.isNonEmpty),\n );\n\nconst groupsOf = (text: string): Option.Option<Partial<Record<string, string>>> =>\n pipe(\n Option.fromNullishOr(DIRECTIVE.exec(text)),\n Option.flatMap((found) => Option.fromNullishOr(found.groups)),\n );\n\nconst directiveOf = (comment: SourceComment): Option.Option<Directive> =>\n pipe(\n groupsOf(bodyOf(comment.text)),\n Option.map((groups) => ({\n line: comment.line,\n column: comment.column,\n kind: kindOf(groups[\"kind\"] ?? \"\"),\n rules: rulesOf(groups[\"rest\"] ?? \"\"),\n })),\n );\n\nconst names =\n (rule: string) =>\n (directive: Directive): boolean =>\n !Arr.isReadonlyArrayNonEmpty(directive.rules) || Arr.contains(directive.rules, rule);\n\nconst isRange = (directive: Directive): boolean =>\n directive.kind === \"disable\" || directive.kind === \"enable\";\n\nconst coversLine =\n (found: Suppressed) =>\n (directive: Directive): boolean =>\n names(found.rule)(directive) &&\n Match.value(directive.kind).pipe(\n Match.when(\"ignore-file\", () => true),\n Match.when(\"ignore-next-line\", () => directive.line + NEXT === found.line),\n Match.when(\"ignore\", () => directive.line === found.line),\n Match.orElse(() => false),\n );\n\nconst isAfter =\n (found: Suppressed) =>\n (directive: Directive): boolean =>\n directive.line < found.line ||\n (directive.line === found.line && directive.column <= (found.column ?? LINE_START));\n\nconst insideRange =\n (directives: readonly Directive[]) =>\n (found: Suppressed): boolean =>\n pipe(\n directives,\n Arr.filter(\n (directive) =>\n isRange(directive) && isAfter(found)(directive) && names(found.rule)(directive),\n ),\n Arr.last,\n Option.exists((directive) => directive.kind === \"disable\"),\n );\n\nexport const suppressionsOf = (\n comments: readonly SourceComment[],\n): ((found: Suppressed) => boolean) => {\n const directives = pipe(comments, Arr.map(directiveOf), Arr.getSomes);\n return (found) => pipe(directives, Arr.some(coversLine(found))) || insideRange(directives)(found);\n};\n","import { present, reportedSeverity } from \"@masseater.dev/lint-host\";\nimport type { Song, SourceComment } from \"@r_masseater/song-format\";\nimport { soundingsOf } from \"@r_masseater/song-format/analysis\";\nimport type { Sounding } from \"@r_masseater/song-format/analysis\";\nimport { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport type { ResolvedRule } from \"#/entities/rule/index.ts\";\nimport type { Diagnostic, Report } from \"#/shared/config/index.ts\";\nimport { failedWith } from \"#/shared/lib/errors.ts\";\nimport type { I68Error } from \"#/shared/lib/errors.ts\";\n\nimport { suppressionsOf } from \"./suppressions.ts\";\n\nexport interface RunInput {\n readonly path: string;\n readonly comments: readonly SourceComment[];\n readonly song: Song;\n readonly rules: readonly ResolvedRule[];\n}\n\nconst diagnosticOf =\n (path: string, rule: ResolvedRule) =>\n (report: Report): Diagnostic => ({\n path,\n line: report.line,\n rule: rule.id,\n message: report.message,\n severity: reportedSeverity(rule.setting),\n ...present(Option.fromNullishOr(report.column), (column) => ({ column })),\n ...present(Option.fromNullishOr(report.detail), (detail) => ({ detail })),\n });\n\nconst runOne = (\n input: RunInput,\n soundings: readonly Sounding[],\n): ((rule: ResolvedRule) => Effect.Effect<readonly Diagnostic[], I68Error>) =>\n Effect.fn(\"i68.rule\")(function* run(rule: ResolvedRule) {\n yield* Effect.annotateCurrentSpan({ \"i68.rule\": rule.id });\n const reports: Report[] = [];\n yield* Effect.try({\n try: () => {\n rule.rule.check({\n filename: input.path,\n song: input.song,\n soundings,\n options: rule.setting.options,\n report: (report) => {\n reports.push(report);\n },\n });\n },\n catch: failedWith(`${rule.id} failed`),\n });\n return pipe(reports, Arr.map(diagnosticOf(input.path, rule)));\n });\n\nexport const runRules = Effect.fn(\"i68.rules\")(function* runRules(input: RunInput) {\n const soundings = soundingsOf(input.song);\n const suppressed = suppressionsOf(input.comments);\n const found = yield* pipe(\n input.rules,\n Effect.forEach(runOne(input, soundings), { concurrency: 1 }),\n );\n return pipe(\n Arr.flatten(found),\n Arr.filter((diagnostic) => !suppressed(diagnostic)),\n );\n});\n","import { NotUtf8Error, notUtf8, sortByPosition } from \"@masseater.dev/lint-host\";\nimport { readSong } from \"@r_masseater/song-format\";\nimport type { SourceIssue } from \"@r_masseater/song-format\";\nimport { Array as Arr, Effect, Result, Schema, pipe } from \"effect\";\n\nimport { flattenConfig, resolve, unknownPlugins, unknownRules } from \"#/entities/rule/index.ts\";\nimport type { ResolvedRule } from \"#/entities/rule/index.ts\";\nimport { pathOf, readSongFile } from \"#/features/read-songs/index.ts\";\nimport type { Read, SongFile } from \"#/features/read-songs/index.ts\";\nimport { runRules } from \"#/features/run-rules/index.ts\";\nimport type { Diagnostic, I68Config } from \"#/shared/config/index.ts\";\nimport { I68Error } from \"#/shared/lib/errors.ts\";\n\nconst PARSE_RULE = \"i68/parse\";\n\nexport interface LintInput {\n readonly root: string;\n readonly files: readonly string[];\n readonly read: Read;\n readonly config?: I68Config;\n}\n\nexport interface TextInput {\n readonly path: string;\n readonly text: string;\n readonly read?: Read;\n readonly config?: I68Config;\n}\n\nconst failIfAny =\n (problem: string) =>\n (names: readonly string[]): Effect.Effect<void, I68Error> =>\n Arr.match(names, {\n onEmpty: () => Effect.void,\n onNonEmpty: (found) =>\n Effect.fail(I68Error.make({ message: `${problem}: ${Arr.join(found, \", \")}` })),\n });\n\nconst UNKNOWN_PLUGINS = failIfAny(\"rules name plugins that are not configured\");\nconst UNKNOWN_RULES = failIfAny(\"rules name rules that their plugins do not have\");\n\nconst checkPlugins = (config: I68Config): Effect.Effect<void, I68Error> => {\n const rules = UNKNOWN_RULES(unknownRules(config));\n return UNKNOWN_PLUGINS(unknownPlugins(config)).pipe(Effect.andThen(rules));\n};\n\nconst rulesOf = (\n config: I68Config | undefined,\n): Effect.Effect<readonly ResolvedRule[], I68Error> => {\n const flat = flattenConfig(config ?? {});\n return checkPlugins(flat).pipe(Effect.as(resolve(flat)));\n};\n\nconst parseDiagnosticsOf =\n (file: string) =>\n (issues: readonly SourceIssue[]): readonly Diagnostic[] =>\n pipe(\n issues,\n Arr.map((issue): Diagnostic => ({\n path: file,\n line: issue.line,\n column: issue.column,\n rule: PARSE_RULE,\n message: issue.message,\n severity: \"error\",\n })),\n );\n\nconst lintFile =\n (rules: readonly ResolvedRule[]) =>\n (song: SongFile): Effect.Effect<readonly Diagnostic[], I68Error> => {\n if (song.source.status === \"invalid\") {\n return Effect.succeed(parseDiagnosticsOf(song.file)(song.source.issues));\n }\n return runRules({\n path: song.file,\n comments: song.source.outline.comments,\n song: song.source.song,\n rules,\n });\n };\n\nconst notFound = (path: string): Effect.Effect<string, I68Error> =>\n Effect.fail(I68Error.make({ message: `could not read ${path}` }));\n\nconst readerOf =\n (input: TextInput): Read =>\n (path) => {\n if (path === input.path) {\n return Effect.succeed(input.text);\n }\n return (input.read ?? notFound)(path);\n };\n\nconst lintTracked = (\n rules: readonly ResolvedRule[],\n input: LintInput,\n): ((file: string) => Effect.Effect<readonly Diagnostic[], I68Error>) =>\n Effect.fnUntraced(function* lintOne(\n file: string,\n ): Effect.fn.Return<readonly Diagnostic[], I68Error> {\n const path = pathOf({ root: input.root, file });\n const read = yield* Effect.result(input.read(path));\n if (Result.isFailure(read) && Schema.is(NotUtf8Error)(read.failure)) {\n return [notUtf8(\"i68\")(file)];\n }\n const reader = Result.match(read, {\n onFailure: () => input.read,\n onSuccess: (text): Read => readerOf({ path, text, read: input.read }),\n });\n const source = yield* readSongFile({ root: input.root, file, read: reader });\n return yield* lintFile(rules)(source);\n });\n\nexport const lint = Effect.fn(\"i68.lint\")(function* lint(input: LintInput) {\n const rules = yield* rulesOf(input.config);\n const found = yield* Effect.forEach(input.files, lintTracked(rules, input), {\n concurrency: \"unbounded\",\n });\n return sortByPosition<Diagnostic>(Arr.flatten(found));\n});\n\nexport const lintText = Effect.fn(\"i68.lintText\")(function* lintText(input: TextInput) {\n const rules = yield* rulesOf(input.config);\n const source = yield* readSong({ path: input.path, read: readerOf(input) });\n const found = yield* lintFile(rules)({ file: input.path, source });\n return sortByPosition<Diagnostic>(found);\n});\n","import { pathspecsOf, sectionOf } from \"@masseater.dev/lint-host\";\nimport type { PathspecRequest } from \"@masseater.dev/lint-host\";\n\nimport { flattenConfig } from \"#/entities/rule/index.ts\";\nimport type { I68Config } from \"#/shared/config/index.ts\";\n\nexport type PathspecInput = PathspecRequest<I68Config>;\n\nexport const i68Section = sectionOf<I68Config>({\n name: \"i68\",\n prepare: flattenConfig,\n fallback: {},\n});\n\nexport const songPathspecs = pathspecsOf({ defaults: [\"*.fumx\"] });\n"],"mappings":";;;;;;;;;;;AAaA,MAAM,aAA0B,CAAC;AAEjC,MAAa,aAAa,UACxB,MAAM,MAAM,KAAK,CAAC,CAAC,KACjB,MAAM,KAAK,MAAM,SAAS,cAAuB;CAAE;CAAU,SAAS;AAAW,EAAE,GACnF,MAAM,QAAQ,CAAC,UAAU,cAAuB;CAC9C;CACA,SAAS,WAAW;AACtB,EAAE,CACJ;AAEF,MAAM,aAAa,UACjB,MAAM,MAAM,KAAK,CAAC,CAAC,KACjB,MAAM,KAAK,MAAM,cAAc,OAAO,KAAK,CAAC,GAC5C,MAAM,QAAQ,GAAG,aAAa,OAAO,gBAAgB,OAAO,CAAC,CAC/D;AAEF,MAAM,cAAc,SAAoB,UACtC,KACE,UAAU,KAAK,GACf,OAAO,aAAa,UAAU,OAAO,CAAC,GACtC,OAAO,MAAM;CACX,cAAc;CACd,SAAS,YAAuB,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU,OAAO;AACrE,CAAC,CACH;AAEF,MAAa,eACX,WACwC;CACxC,MAAM,SAAoC,CAAC;CAC3C,KAAK,MAAM,CAAC,MAAM,UAAU,KAC1B,QACAA,MAAI,SAAS,UAAUC,OAAI,UAAU,SAAS,CAAC,CAAC,CAAC,CACnD,GACE,OAAO,QAAQ,KACbA,OAAI,IAAI,QAAQ,IAAI,GACpB,OAAO,MAAM;EACX,cAAc;EACd,SAAS,YAAY,WAAW,SAAS,KAAK;CAChD,CAAC,CACH;CAEF,OAAO;AACT;;ACrDA,MAAa,oBAAoB,YAC/B,MAAM,MAAM,QAAQ,QAAQ,CAAC,CAAC,KAC5B,MAAM,KAAK,cAAwC,MAAM,GACzD,MAAM,aAAuC,OAAO,CACtD;;ACNF,MAAM,SAAS,aACb,MAAM,MAAM,Q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