@r_masseater/msch 0.60.1 → 0.61.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.
Files changed (44) hide show
  1. package/README.md +1 -0
  2. package/dist/{app-DcgzLzb0.mjs → app-BwjhFdKD.mjs} +2 -2
  3. package/dist/{app-DcgzLzb0.mjs.map → app-BwjhFdKD.mjs.map} +1 -1
  4. package/dist/cargo-inputs.mjs +1 -1
  5. package/dist/changed.mjs +1 -1
  6. package/dist/cli.mjs +427 -590
  7. package/dist/cli.mjs.map +1 -1
  8. package/dist/{comment-directives-CXgB6xpE.mjs → comment-directives-BD6WGsC7.mjs} +2 -1
  9. package/dist/comment-directives-BD6WGsC7.mjs.map +1 -0
  10. package/dist/config.mjs +1 -1
  11. package/dist/decision-rules.mjs +1 -1
  12. package/dist/{define-lint-preset-Dn9tIflj.mjs → define-lint-preset-liXFQE1C.mjs} +7 -5
  13. package/dist/define-lint-preset-liXFQE1C.mjs.map +1 -0
  14. package/dist/exits.mjs +1 -1
  15. package/dist/fix.d.mts +1 -0
  16. package/dist/fix.mjs +96 -0
  17. package/dist/fix.mjs.map +1 -0
  18. package/dist/lint-rules.mjs +3 -5
  19. package/dist/lint-rules.mjs.map +1 -1
  20. package/dist/lint.mjs +1 -1
  21. package/dist/oxlint.mjs +1 -1
  22. package/dist/pack-settings-FN4-vi6J.mjs +225 -0
  23. package/dist/pack-settings-FN4-vi6J.mjs.map +1 -0
  24. package/dist/{pass-records-BCT1Ls9c.mjs → pass-records-CFIrQmB5.mjs} +2 -2
  25. package/dist/{pass-records-BCT1Ls9c.mjs.map → pass-records-CFIrQmB5.mjs.map} +1 -1
  26. package/dist/{problem-BoHYLMQT.mjs → problem-D2HKNIVq.mjs} +2 -2
  27. package/dist/{problem-BoHYLMQT.mjs.map → problem-D2HKNIVq.mjs.map} +1 -1
  28. package/dist/publish.mjs +73 -64
  29. package/dist/publish.mjs.map +1 -1
  30. package/dist/{published-D87PrlyG.mjs → published-BIexKvdJ.mjs} +2 -2
  31. package/dist/{published-D87PrlyG.mjs.map → published-BIexKvdJ.mjs.map} +1 -1
  32. package/dist/{syntax-CTiXR0EJ.mjs → syntax-C0ddqOHc.mjs} +4 -3
  33. package/dist/syntax-C0ddqOHc.mjs.map +1 -0
  34. package/dist/text-position-DrvZ7k2Y.mjs +17 -0
  35. package/dist/text-position-DrvZ7k2Y.mjs.map +1 -0
  36. package/dist/{upstream-exits-DitN-yYH.mjs → upstream-exits-DgkAyuu-.mjs} +3 -15
  37. package/dist/upstream-exits-DgkAyuu-.mjs.map +1 -0
  38. package/dist/workspace-settings.mjs +1 -1
  39. package/package.json +3 -2
  40. package/skills/msch-checks/SKILL.md +10 -0
  41. package/dist/comment-directives-CXgB6xpE.mjs.map +0 -1
  42. package/dist/define-lint-preset-Dn9tIflj.mjs.map +0 -1
  43. package/dist/syntax-CTiXR0EJ.mjs.map +0 -1
  44. package/dist/upstream-exits-DitN-yYH.mjs.map +0 -1
package/dist/cli.mjs CHANGED
@@ -1,14 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import { B as stringsIn, C as VERIFY_TASK, F as childrenOf$1, I as keyName, L as literalOf, N as workspaceConfigOf, P as KeySchema, R as nestedValues, S as RUN_TASKS, T as hasVerifyTask, _ as deployEntries, a as EntryManifestJson, c as publicEntriesOf, d as workspaceLinks, g as bundledEntries, i as publishedWorkspaces, l as targetsIn, m as lockedPackages, o as entryNameOf, p as lockedGraph, r as packedWorkspaces, s as isBinEntry, w as definesTask, y as shadcnUiOf, z as propertyValue } from "./published-D87PrlyG.mjs";
2
+ import { B as stringsIn, C as VERIFY_TASK, F as childrenOf$1, I as keyName, L as literalOf, N as workspaceConfigOf, P as KeySchema, R as nestedValues, S as RUN_TASKS, T as hasVerifyTask, _ as deployEntries, a as EntryManifestJson, c as publicEntriesOf, d as workspaceLinks, g as bundledEntries, i as publishedWorkspaces, l as targetsIn, m as lockedPackages, o as entryNameOf, p as lockedGraph, r as packedWorkspaces, s as isBinEntry, w as definesTask, y as shadcnUiOf, z as propertyValue } from "./published-BIexKvdJ.mjs";
3
3
  import { a as publishedProjects, c as workspaceManifest, o as workspaceDirectories, r as readManifest, s as workspaceProjects, t as MANIFEST_FILE$3 } from "./dependencies-B6p7x90y.mjs";
4
- import { C as valueKey, S as schemaTypeOf, _ as formatValues, a as nearestManifestDirectory, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as installedPackages, l as mentions$1, m as isObjectType, n as keepOnly, o as projectInputs, p as describeLibraryType, r as recordsIn, t as contentKey, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./pass-records-BCT1Ls9c.mjs";
4
+ import { C as valueKey, S as schemaTypeOf, _ as formatValues, a as nearestManifestDirectory, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as installedPackages, l as mentions$1, m as isObjectType, n as keepOnly, o as projectInputs, p as describeLibraryType, r as recordsIn, t as contentKey, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./pass-records-CFIrQmB5.mjs";
5
5
  import { a as groupOf$2, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-B5sRbxlz.mjs";
6
- import { a as workspaceDeviations, c as tomlSourceComments, i as cargoDeviations, l as yamlSourceComments, o as collectNodes, r as WORKSPACE_SECTIONS, s as isRecord, t as checkUpstreamExits, u as positionOf } from "./upstream-exits-DitN-yYH.mjs";
7
- import { a as join, n as baseName, o as parent, r as isInside, t as matcher } from "./app-DcgzLzb0.mjs";
8
- import { a as problemAtPosition, i as problemAt$8, o as problemInFile, r as formatProblem, s as sortProblems, t as ProblemList } from "./problem-BoHYLMQT.mjs";
9
- import { n as JAPANESE, t as COMMENT_DIRECTIVES } from "./comment-directives-CXgB6xpE.mjs";
6
+ import { t as positionOf } from "./text-position-DrvZ7k2Y.mjs";
7
+ import { a as join, n as baseName, o as parent, r as isInside, t as matcher } from "./app-BwjhFdKD.mjs";
8
+ import { a as problemAtPosition, i as problemAt$8, o as problemInFile, r as formatProblem, s as sortProblems, t as ProblemList } from "./problem-D2HKNIVq.mjs";
9
+ import { n as JAPANESE, t as COMMENT_DIRECTIVES } from "./comment-directives-BD6WGsC7.mjs";
10
10
  import { t as startedOnce } from "./started-once-muJbvD_I.mjs";
11
- import { $ as isPropertyAssignment, A as getTextOfJSDocComment, B as isExpressionStatement, D as getJSDocTags, E as SyntaxKind, F as isCallExpression, G as isInterfaceDeclaration, H as isFunctionExpression, I as isClassDeclaration, J as isNewExpression, K as isModuleBlock, L as isElementAccessExpression, M as isArrowFunction, N as isBinaryExpression, P as isBlock, Q as isPropertyAccessExpression, R as isEnumDeclaration, T as SymbolFlags, U as isIdentifier, V as isFunctionDeclaration, W as isImportDeclaration, X as isObjectLiteralExpression, Y as isNumericLiteral, Z as isParenthesizedExpression, _ as referencedSymbols, a as declarationsOf, at as isStringLiteral, b as uniqueByReference, c as importedModulesOf, ct as isTypeReferenceNode, d as isInsideAny, dt as isVariableDeclarationList, et as isReturnStatement, f as isOutsideDeclaration, ft as isVariableStatement, g as propertyNamesOf, h as packageOf$1, i as contains, it as isSpreadElement, j as isArrayLiteralExpression, k as getNameOfDeclaration, l as isExternalDeclaration, lt as isUnionTypeNode, m as lineOf$3, n as childrenOf$2, nt as isSignatureDeclaration, o as declaresAType, ot as isTypeAliasDeclaration, p as isTypeDeclaration, q as isModuleDeclaration, r as columnOf, rt as isSourceFile, s as descendantsOf, st as isTypeLiteralNode, t as carriesTag, tt as isSatisfiesExpression, u as isGenericDeclaration, ut as isVariableDeclaration, w as SignatureKind, y as symbolAt, z as isExportDeclaration } from "./syntax-CTiXR0EJ.mjs";
11
+ import { $ as isPropertyAccessExpression, A as getNameOfDeclaration, B as isExportDeclaration, D as SyntaxKind, E as SymbolFlags, F as isBlock, G as isImportDeclaration, H as isFunctionDeclaration, I as isCallExpression, J as isModuleDeclaration, K as isInterfaceDeclaration, L as isClassDeclaration, M as isArrayLiteralExpression, N as isArrowFunction, O as getJSDocTags, P as isBinaryExpression, Q as isParenthesizedExpression, R as isElementAccessExpression, T as SignatureKind, U as isFunctionExpression, V as isExpressionStatement, W as isIdentifier, X as isNumericLiteral, Y as isNewExpression, Z as isObjectLiteralExpression, _ as referencedSymbols, a as declarationsOf, at as isSpreadElement, b as symbolAtLocation, c as importedModulesOf, ct as isTypeLiteralNode, d as isInsideAny, dt as isVariableDeclaration, et as isPropertyAssignment, f as isOutsideDeclaration, ft as isVariableDeclarationList, g as propertyNamesOf, h as packageOf$1, i as contains, it as isSourceFile, j as getTextOfJSDocComment, l as isExternalDeclaration, lt as isTypeReferenceNode, m as lineOf$3, n as childrenOf$2, nt as isSatisfiesExpression, o as declaresAType, ot as isStringLiteral, p as isTypeDeclaration, pt as isVariableStatement, q as isModuleBlock, r as columnOf, rt as isSignatureDeclaration, s as descendantsOf, st as isTypeAliasDeclaration, t as carriesTag, tt as isReturnStatement, u as isGenericDeclaration, ut as isUnionTypeNode, x as uniqueByReference, y as symbolAt, z as isEnumDeclaration } from "./syntax-C0ddqOHc.mjs";
12
+ import { _ as presentFiles, c as manifestPattern, d as offsetIn$1, f as quoted$1, g as listedFiles, h as isToolVersions, i as uncatalogedDependencies, l as manifestSpecifiers, m as isScannedText, o as decodeManifest$9, p as specifiedIn, s as fieldsOf, t as checkPackSettings, u as namedCatalogsOf, v as scanText } from "./pack-settings-FN4-vi6J.mjs";
13
+ import { a as workspaceDeviations, c as tomlSourceComments, i as cargoDeviations, l as yamlSourceComments, o as collectNodes, r as WORKSPACE_SECTIONS, s as isRecord, t as checkUpstreamExits } from "./upstream-exits-DgkAyuu-.mjs";
12
14
  import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-A2p57njU.mjs";
13
15
  import "./cli-contract-D7btWrEu.mjs";
14
16
  import { builtinModules } from "node:module";
@@ -85,7 +87,7 @@ const namedWorkspaces = Effect.fn("namedWorkspaces")(function* namedWorkspaces(r
85
87
  return pipe(projects, Array.map(namedIn((directory) => files.basename(directory))));
86
88
  });
87
89
  // src/entities/workspace/model/cargo-crates.ts
88
- const SEPARATOR$21 = "/";
90
+ const SEPARATOR$20 = "/";
89
91
  const CrateTarget = Schema.Struct({ kind: Schema.Array(Schema.String) });
90
92
  const CrateDependency = Schema.Struct({ path: Schema.optional(Schema.String) });
91
93
  const CrateEntry = Schema.Struct({
@@ -122,7 +124,7 @@ const cratesIn = Effect.fn("cratesIn")(function* cratesIn(root) {
122
124
  }, Effect.scoped);
123
125
  /** @internal */
124
126
  const owningWorkspace = (directories) => (directory) => {
125
- const owners = pipe(directories, Array.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$21}`)(directory)));
127
+ const owners = pipe(directories, Array.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$20}`)(directory)));
126
128
  return Array.last(Array.sort(owners, String$1.Order));
127
129
  };
128
130
  // src/features/check-overrides/model/override-findings.ts
@@ -371,8 +373,8 @@ const RESOLUTION_FILES = [
371
373
  ];
372
374
  const RESOLUTION_CONCURRENCY = 2;
373
375
  const SUCCEEDED$1 = 0;
374
- const taggedError$8 = Schema.TaggedError;
375
- var OverrideResolutionFailed = class extends taggedError$8()("OverrideResolutionFailed", {
376
+ const taggedError$7 = Schema.TaggedError;
377
+ var OverrideResolutionFailed = class extends taggedError$7()("OverrideResolutionFailed", {
376
378
  override: Schema.String,
377
379
  output: Schema.String
378
380
  }) {};
@@ -490,103 +492,73 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
490
492
  overrides
491
493
  }, keys));
492
494
  });
493
- // src/shared/lib/scanned-files.ts
494
- const SCANNED_FILE = /(?:\.(?:[cm]?[jt]sx?|jsonc?|toml|ya?ml|sh|bash|zsh|fish|rs|cs|go|mk)|(?:^|\/)(?:(?:Dockerfile|Containerfile)[^/]*|Makefile|justfile|\.tool-versions|[^./][^./]*))$/u;
495
- const LOCKFILE$1 = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
496
- const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
497
- const READ_CONCURRENCY$33 = 64;
498
- const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE$1.test(name);
499
- const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
500
- /** @internal */
501
- const listedFiles = Effect.fn("listedFiles")(function* listedFiles(root) {
502
- const files = yield* RepositoryFiles;
503
- const names = yield* files.ownedFiles(root);
504
- return pipe(names, Array.map((name) => ({
505
- name,
506
- file: files.join(root, name)
507
- })));
508
- });
509
- /** @internal */
510
- const presentFiles = Effect.fn("presentFiles")(function* presentFiles(listed) {
511
- const files = yield* RepositoryFiles;
512
- return yield* pipe(listed, Effect.filter(({ file }) => files.exists(file)));
513
- });
514
- /** @internal */
515
- const scanText = Effect.fn("scanText")(function* scanText(listed, problemsIn) {
516
- const files = yield* RepositoryFiles;
517
- const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
518
- onNone: () => [],
519
- onSome: (source) => problemsIn(entry, source)
520
- }))), { concurrency: READ_CONCURRENCY$33 });
521
- return Array.flatten(found);
522
- });
523
495
  // src/features/check-overrides/model/git-subpath.ts
524
496
  const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
525
497
  const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
526
- const RULE$64 = "git-subpath-dependency";
498
+ const RULE$62 = "git-subpath-dependency";
527
499
  const WHOLE_MATCH$4 = 0;
528
500
  const problemAt$7 = ({ file }, source) => (found) => ({
529
501
  file,
530
502
  ...positionOf(source)(found.index ?? WHOLE_MATCH$4),
531
- rule: RULE$64,
503
+ rule: RULE$62,
532
504
  message: `Git subpath dependencies are banned. Publish the package to npm and depend on a released version instead of \`${String$1.trim(found[WHOLE_MATCH$4])}\`.`
533
505
  });
534
- const problemsIn$23 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$7(entry, source)));
506
+ const problemsIn$21 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$7(entry, source)));
535
507
  const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
536
508
  /** @internal */
537
509
  const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
538
510
  const listed = yield* listedFiles(root);
539
- return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$23);
511
+ return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$21);
540
512
  });
541
513
  // src/features/check-overrides/model/restricted-rules.ts
542
- const RULE$63 = "unnamed-restriction";
514
+ const RULE$61 = "unnamed-restriction";
543
515
  const WHOLE_MATCH$3 = 0;
544
516
  const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
545
- const problemsIn$22 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
517
+ const problemsIn$20 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
546
518
  file: entry.file,
547
519
  ...positionOf(source)(found.index ?? WHOLE_MATCH$3),
548
- rule: RULE$63,
520
+ rule: RULE$61,
549
521
  message: `${found[WHOLE_MATCH$3]} is not used in this repository, because its name does not say what an entry protects. Ban a package in dependencyRules.banned, and write any other restriction as a rule in msch-lint whose name states the intent.`
550
522
  })));
551
523
  /** @internal */
552
524
  const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRestrictedRules(root) {
553
525
  const listed = yield* listedFiles(root);
554
- return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$22);
526
+ return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$20);
555
527
  });
556
528
  // src/features/check-overrides/model/type-exemptions.ts
557
- const RULE$62 = "named-type-exemption";
529
+ const RULE$60 = "named-type-exemption";
558
530
  const WHOLE_MATCH$2 = 0;
559
531
  const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
560
- const problemsIn$21 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array.map((found) => ({
532
+ const problemsIn$19 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array.map((found) => ({
561
533
  file: entry.file,
562
534
  ...positionOf(source)(found.index ?? WHOLE_MATCH$2),
563
- rule: RULE$62,
535
+ rule: RULE$60,
564
536
  message: "exempts a type from a lint rule by its name. Such a list is written by hand for every dependency and only grows. msch-lint/readonly-parameters reads where each type is declared and exempts the types of packages and of the language by itself, so remove the entry. For another rule, add a rule to msch-lint that reads the declaration."
565
537
  })));
566
538
  /** @internal */
567
539
  const checkTypeExemptions = Effect.fn("checkTypeExemptions")(function* checkTypeExemptions(root) {
568
540
  const listed = yield* listedFiles(root);
569
- return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$21);
541
+ return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$19);
570
542
  });
571
543
  // src/features/check-overrides/model/package-registry.ts
572
- const RULE$61 = "package-registry";
544
+ const RULE$59 = "package-registry";
573
545
  const REGISTRY = "https://npm.flatt.tech/";
574
546
  const TRAILING_SLASH = /\/$/u;
575
547
  const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
576
548
  const NPMRC = /(?:^|\/)\.npmrc$/u;
577
549
  const WORKSPACE_REGISTRY = /^registry:/mu;
578
550
  const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
579
- const START$24 = 0;
551
+ const START$22 = 0;
580
552
  const REASON = `Installs go through Takumi Guard (${REGISTRY}), which blocks known-malicious packages before they are installed.`;
581
553
  const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
582
554
  const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
583
555
  const withoutSlash = String$1.replace(TRAILING_SLASH, "");
584
556
  const isGuarded = (registry) => withoutSlash(registry) === withoutSlash(REGISTRY);
585
- const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$24));
557
+ const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$22));
586
558
  const workspaceProblem = (file, source, registry) => ({
587
559
  file,
588
- ...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
589
- rule: RULE$61,
560
+ ...positionOf(source)(offsetIn(WORKSPACE_REGISTRY.exec(source))),
561
+ rule: RULE$59,
590
562
  message: Option.match(registry, {
591
563
  onNone: () => `${REASON} Set \`registry: ${REGISTRY}\` in ${WORKSPACE_FILE$5}.`,
592
564
  onSome: (value) => `${REASON} \`registry\` is ${value}. Set it to ${REGISTRY}.`
@@ -594,9 +566,9 @@ const workspaceProblem = (file, source, registry) => ({
594
566
  });
595
567
  const npmrcProblems = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array.filter((found) => !Option.exists(groupOf$2("value")(found), isGuarded)), Array.map((found) => ({
596
568
  file: entry.file,
597
- ...positionOf(source)(found.index ?? START$24),
598
- rule: RULE$61,
599
- message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$24])}\`. Remove the line.`
569
+ ...positionOf(source)(found.index ?? START$22),
570
+ rule: RULE$59,
571
+ message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$22])}\`. Remove the line.`
600
572
  })));
601
573
  const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
602
574
  const files = yield* RepositoryFiles;
@@ -614,34 +586,8 @@ const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPa
614
586
  const overrides = yield* scanText(pipe(listed, Array.filter(({ name }) => NPMRC.test(name))), npmrcProblems);
615
587
  return [...yield* checkWorkspace(root), ...overrides];
616
588
  });
617
- // src/entities/package/model/specifiers.ts
618
- const START$23 = 0;
619
- const FieldsSchema$1 = Schema.Record(Schema.String, Schema.Unknown);
620
- const decodeFields$2 = Schema.decodeUnknownOption(FieldsSchema$1);
621
- const decodeJson$2 = Schema.decodeUnknownOption(Schema.fromJsonString(FieldsSchema$1));
622
- const decodeString$2 = Schema.decodeUnknownOption(Schema.String);
623
- /** @internal */
624
- const fieldsOf$2 = (value) => Option.getOrElse(decodeFields$2(value), () => ({}));
625
- /** @internal */
626
- const specifiedIn = (held) => pipe(fieldsOf$2(held), Record.toEntries, Array.flatMap(([name, value]) => pipe(decodeString$2(value), Option.map((specifier) => ({
627
- name,
628
- specifier
629
- })), Option.toArray)));
630
- /** @internal */
631
- const quoted$1 = (text) => String$1.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.raw`\$&`)(text);
632
- /** @internal */
633
- const manifestPattern = ({ name, specifier }) => new RegExp(`"${quoted$1(name)}"\\s*:\\s*"${quoted$1(specifier)}"`, "u");
634
- /** @internal */
635
- const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$23));
636
- const SECTIONS = [
637
- "dependencies",
638
- "devDependencies",
639
- "optionalDependencies"
640
- ];
641
- /** @internal */
642
- const manifestSpecifiers = (source) => pipe(decodeJson$2(source), Option.map((manifest) => pipe(SECTIONS, Array.flatMap((section) => specifiedIn(manifest[section])))), Option.getOrElse(() => []));
643
589
  // src/features/check-placement/model/colocated-git-patterns.ts
644
- const RULE$60 = "colocated-git-patterns";
590
+ const RULE$58 = "colocated-git-patterns";
645
591
  const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
646
592
  const ROOT$3 = ".";
647
593
  const NEGATION$1 = "!";
@@ -652,7 +598,7 @@ const LEADING_SLASHES = /^\/+/u;
652
598
  const TRAILING_SLASHES = /\/+$/u;
653
599
  const SPACES = /\s+/u;
654
600
  const FIRST$22 = 1;
655
- const READ_CONCURRENCY$32 = 16;
601
+ const READ_CONCURRENCY$31 = 16;
656
602
  const withoutPrefix = (prefix, text) => {
657
603
  if (String$1.startsWith(prefix)(text)) return String$1.slice(prefix.length)(text);
658
604
  return text;
@@ -688,7 +634,7 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
688
634
  const toEntry = entryOf$1(absolute, files.basename(file), files.dirname(file));
689
635
  return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array.map(toEntry), Array.getSomes);
690
636
  });
691
- const patternProblem = (entry, message) => problemAtPosition(RULE$60)(entry.file, {
637
+ const patternProblem = (entry, message) => problemAtPosition(RULE$58)(entry.file, {
692
638
  line: entry.line,
693
639
  column: FIRST$22
694
640
  }, message);
@@ -743,17 +689,17 @@ const repeated = (entries) => (entry) => {
743
689
  /** @internal */
744
690
  const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(function* checkColocatedGitPatterns(root) {
745
691
  const patternFiles = yield* (yield* RepositoryFiles).matchingFiles(root, PATTERN_FILES);
746
- const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$1(root, file), { concurrency: READ_CONCURRENCY$32 });
692
+ const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$1(root, file), { concurrency: READ_CONCURRENCY$31 });
747
693
  const entries = Array.flatten(read);
748
694
  const workspaces = yield* workspaceDirectories(root);
749
- const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$32 });
695
+ const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$31 });
750
696
  const repeatedFound = pipe(entries, Array.map(repeated(entries)));
751
697
  return Array.getSomes([...misplacedFound, ...repeatedFound]);
752
698
  });
753
699
  // src/features/check-placement/model/colocated-tests.ts
754
- const RULE$59 = "colocated-test";
700
+ const RULE$57 = "colocated-test";
755
701
  const FIRST$21 = 1;
756
- const READ_CONCURRENCY$31 = 64;
702
+ const READ_CONCURRENCY$30 = 64;
757
703
  const ROOT_SUBPATH = ".";
758
704
  const NAME_GROUP = "name";
759
705
  const SPECIFIER_GROUP = "specifier";
@@ -766,20 +712,20 @@ const SPEC_FILE = /\.spec\.[cm]?[jt]sx?$/u;
766
712
  const RELATIVE_REFERENCE = /["'`]\.\/(?<name>[^/"'`]+)/gu;
767
713
  const DIRNAME_REFERENCE = /import\.meta\.dirname\s*,\s*["'](?<name>[^/"']+)["']/gu;
768
714
  const MODULE_SPECIFIER = /(?:\bfrom\s+|\bimport\s*\(\s*|\bimport\s+|\bvi\.mock\(\s*)["'](?<specifier>[^"'.#][^"']*)["']/gu;
769
- const EXCLUDED$8 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
715
+ const EXCLUDED$7 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
770
716
  const DIRECTORY_MESSAGE = "sits in a separate test directory. Put each test next to the module it tests, and test-only helpers next to the tests as <name>.test.support.ts.";
771
717
  const SIBLING_MESSAGE = "refers to nothing in its own directory. Move the test next to the module it tests and import that module, or a helper beside it, with ./<name>.";
772
- const Manifest$8 = Schema.Struct({
718
+ const Manifest$7 = Schema.Struct({
773
719
  name: Schema.optional(Schema.String),
774
720
  exports: Schema.optional(Schema.Unknown)
775
721
  });
776
- const decodeManifest$10 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$8));
722
+ const decodeManifest$8 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$7));
777
723
  const byLength$2 = Order.mapInput(Order.Number, (directory) => directory.length);
778
- const problemFor$9 = (test, message) => ({
724
+ const problemFor$8 = (test, message) => ({
779
725
  file: test.file,
780
726
  line: FIRST$21,
781
727
  column: FIRST$21,
782
- rule: RULE$59,
728
+ rule: RULE$57,
783
729
  message: `${test.base} ${message}`
784
730
  });
785
731
  const groupsOf$1 = (source, pattern, group) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array.getSomes);
@@ -799,7 +745,7 @@ const ownSpecifiers = Effect.fn("ownSpecifiers")(function* ownSpecifiers(context
799
745
  if (Option.isNone(owner)) return [];
800
746
  const text = yield* files.readFile(files.join(context.root, owner.value, MANIFEST_FILE$3));
801
747
  const join = (target) => files.join(context.root, owner.value, target);
802
- return pipe(text, Option.flatMap(decodeManifest$10), Option.map(specifiersBeside({
748
+ return pipe(text, Option.flatMap(decodeManifest$8), Option.map(specifiersBeside({
803
749
  join,
804
750
  dirname: files.dirname,
805
751
  directory: test.directory
@@ -819,15 +765,15 @@ const refersIn = Effect.fn("refersIn")(function* refersIn(context, test) {
819
765
  });
820
766
  const inSeparateTestDirectory = (name) => SEPARATE_TEST_DIRECTORY.test(name) || SPEC_DIRECTORY.test(name) && SPEC_FILE.test(name);
821
767
  const problemIn$8 = Effect.fn("problemIn")(function* problemIn(context, test) {
822
- if (inSeparateTestDirectory(test.name)) return Option.some(problemFor$9(test, DIRECTORY_MESSAGE));
768
+ if (inSeparateTestDirectory(test.name)) return Option.some(problemFor$8(test, DIRECTORY_MESSAGE));
823
769
  if (!TEST_FILE$2.test(test.name)) return Option.none();
824
770
  if (yield* refersIn(context, test)) return Option.none();
825
- return Option.some(problemFor$9(test, SIBLING_MESSAGE));
771
+ return Option.some(problemFor$8(test, SIBLING_MESSAGE));
826
772
  });
827
773
  /** @internal */
828
774
  const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColocatedTests(root) {
829
775
  const files = yield* RepositoryFiles;
830
- const listed = yield* files.matchingFiles(root, EXCLUDED$8);
776
+ const listed = yield* files.matchingFiles(root, EXCLUDED$7);
831
777
  const names = pipe(listed, Array.filter(String$1.isNonEmpty));
832
778
  const context = {
833
779
  root,
@@ -842,12 +788,12 @@ const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColo
842
788
  directory: files.dirname(file)
843
789
  };
844
790
  }));
845
- const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$31 });
791
+ const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$30 });
846
792
  return Array.getSomes(found);
847
793
  });
848
794
  // src/shared/lib/agent-docs.ts
849
795
  const AGENT_DOC = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
850
- const READ_CONCURRENCY$30 = 16;
796
+ const READ_CONCURRENCY$29 = 16;
851
797
  const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblems(root, problemIn) {
852
798
  const files = yield* RepositoryFiles;
853
799
  const listed = yield* files.listedFiles(root);
@@ -856,33 +802,33 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
856
802
  const file = files.join(root, name);
857
803
  const problemOf = Option.flatMap(problemIn(file));
858
804
  return files.readFile(file).pipe(Effect.map(problemOf));
859
- }, { concurrency: READ_CONCURRENCY$30 });
805
+ }, { concurrency: READ_CONCURRENCY$29 });
860
806
  return Array.getSomes(found);
861
807
  });
862
808
  // src/features/check-placement/model/agent-docs-length.ts
863
809
  const RECOMMENDED_LINES = 200;
864
810
  const FIRST$20 = 1;
865
- const RULE$58 = "agent-docs-length";
811
+ const RULE$56 = "agent-docs-length";
866
812
  const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
867
- const problemFor$8 = (file) => (lines) => {
813
+ const problemFor$7 = (file) => (lines) => {
868
814
  if (lines <= RECOMMENDED_LINES) return Option.none();
869
815
  return Option.some({
870
816
  file,
871
817
  line: 201,
872
818
  column: FIRST$20,
873
- rule: RULE$58,
819
+ rule: RULE$56,
874
820
  message: `has ${String(lines)} lines. Claude Code recommends under ${String(RECOMMENDED_LINES)} lines per file: longer files cost context and are followed less reliably. Cut what the code already tells, and move rules shared across repositories into skills.`
875
821
  });
876
822
  };
877
823
  /** @internal */
878
- const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$8(file)(lineCount(source)));
824
+ const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$7(file)(lineCount(source)));
879
825
  // src/features/check-placement/model/claude-link.ts
880
- const RULE$57 = "claude-md-link";
826
+ const RULE$55 = "claude-md-link";
881
827
  const CLAUDE = "CLAUDE.md";
882
828
  const AGENTS = "AGENTS.md";
883
829
  const FIRST$19 = 1;
884
- const READ_CONCURRENCY$29 = 16;
885
- const MESSAGE$17 = "CLAUDE.md must be a symbolic link to AGENTS.md";
830
+ const READ_CONCURRENCY$28 = 16;
831
+ const MESSAGE$16 = "CLAUDE.md must be a symbolic link to AGENTS.md";
886
832
  /** @internal */
887
833
  const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
888
834
  const files = yield* RepositoryFiles;
@@ -896,20 +842,20 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
896
842
  file: path,
897
843
  line: FIRST$19,
898
844
  column: FIRST$19,
899
- rule: RULE$57,
900
- message: MESSAGE$17
845
+ rule: RULE$55,
846
+ message: MESSAGE$16
901
847
  })));
902
848
  });
903
849
  const claude = pipe(listed, Array.filter((name) => files.basename(name) === CLAUDE));
904
- const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$29 });
850
+ const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$28 });
905
851
  return Array.getSomes(found);
906
852
  });
907
853
  // src/features/check-placement/model/dangling-links.ts
908
- const RULE$56 = "dangling-link";
909
- const SEPARATOR$20 = "/";
854
+ const RULE$54 = "dangling-link";
855
+ const SEPARATOR$19 = "/";
910
856
  const FIRST$18 = 1;
911
- const READ_CONCURRENCY$28 = 16;
912
- const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$20}`)(name);
857
+ const READ_CONCURRENCY$27 = 16;
858
+ const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$19}`)(name);
913
859
  /** @internal */
914
860
  const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
915
861
  const files = yield* RepositoryFiles;
@@ -921,18 +867,18 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
921
867
  file,
922
868
  line: FIRST$18,
923
869
  column: FIRST$18,
924
- rule: RULE$56,
870
+ rule: RULE$54,
925
871
  message: `is a link to ${target}, where no file is tracked. A fresh checkout gets a link to nothing, and GitHub Actions fails to load the repository's actions. Track a file there, such as .gitkeep, or delete the link.`
926
872
  })));
927
873
  });
928
- const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$28 });
874
+ const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$27 });
929
875
  return Array.getSomes(found);
930
876
  });
931
877
  // src/features/check-placement/model/member-sources.ts
932
878
  const ROOT_WORKSPACE$1 = ".";
933
879
  const FIRST$17 = 1;
934
- const SEPARATOR$19 = "/";
935
- const EXCLUDED$7 = [
880
+ const SEPARATOR$18 = "/";
881
+ const EXCLUDED$6 = [
936
882
  ":(exclude,attr:linguist-vendored)",
937
883
  ":(exclude,attr:linguist-generated)",
938
884
  ":(exclude,attr:linguist-documentation)"
@@ -945,7 +891,7 @@ const memberSources = Effect.fn("memberSources")(function* memberSources(root) {
945
891
  const files = yield* RepositoryFiles;
946
892
  return {
947
893
  workspaces: yield* memberWorkspaces(root),
948
- listed: yield* files.matchingFiles(root, EXCLUDED$7)
894
+ listed: yield* files.matchingFiles(root, EXCLUDED$6)
949
895
  };
950
896
  });
951
897
  const byLength$1 = Order.mapInput(Order.Number, (directory) => directory.length);
@@ -956,7 +902,7 @@ const fileProblem$1 = ({ file, rule, message }) => ({
956
902
  rule,
957
903
  message
958
904
  });
959
- const ownerOf$4 = (workspaces) => (name) => pipe(workspaces, Array.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$19}`)(name)), (owners) => Array.last(Array.sort(owners, byLength$1)), Option.map((workspace) => ({
905
+ const ownerOf$4 = (workspaces) => (name) => pipe(workspaces, Array.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$18}`)(name)), (owners) => Array.last(Array.sort(owners, byLength$1)), Option.map((workspace) => ({
960
906
  workspace,
961
907
  inner: String$1.slice(workspace.length + 1)(name)
962
908
  })));
@@ -979,9 +925,9 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
979
925
  }));
980
926
  });
981
927
  // src/features/check-placement/model/deployed-readme.ts
982
- const RULE$55 = "deployed-readme";
983
- const ROOT_DIRECTORY$3 = "";
984
- const READ_CONCURRENCY$27 = 16;
928
+ const RULE$53 = "deployed-readme";
929
+ const ROOT_DIRECTORY$2 = "";
930
+ const READ_CONCURRENCY$26 = 16;
985
931
  const MISSING_MESSAGE$2 = "is missing. This workspace has an Alchemy stack that serves an address, so give it a README.md that says what it is and links its URL.";
986
932
  const NO_URL_MESSAGE = "has no https:// URL. This workspace has an Alchemy stack that serves an address, so link the URL it is served at.";
987
933
  const ADDRESS_KEYS = [
@@ -1019,14 +965,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
1019
965
  const readme = yield* readReadme({
1020
966
  root,
1021
967
  directory,
1022
- rule: RULE$55,
968
+ rule: RULE$53,
1023
969
  missingMessage: MISSING_MESSAGE$2
1024
970
  });
1025
971
  return Result.match(readme, {
1026
972
  onFailure: Option.some,
1027
973
  onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
1028
974
  file,
1029
- rule: RULE$55,
975
+ rule: RULE$53,
1030
976
  message: NO_URL_MESSAGE
1031
977
  })))
1032
978
  });
@@ -1037,38 +983,38 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
1037
983
  const listed = yield* files.listedFiles(root);
1038
984
  const directories = yield* workspaceDirectories(root);
1039
985
  const candidates = pipe(listed, Array.filter((file) => STACK_FILE.test(file)));
1040
- const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$27 });
1041
- const owners = pipe(deploying, Array.map((file) => pipe(owningWorkspace(directories)(files.dirname(file)), Option.getOrElse(() => ROOT_DIRECTORY$3))), Array.dedupe);
1042
- const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$27 });
986
+ const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$26 });
987
+ const owners = pipe(deploying, Array.map((file) => pipe(owningWorkspace(directories)(files.dirname(file)), Option.getOrElse(() => ROOT_DIRECTORY$2))), Array.dedupe);
988
+ const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$26 });
1043
989
  return Array.getSomes(found);
1044
990
  });
1045
991
  // src/features/check-placement/model/nested-docs.ts
1046
- const RULE$54 = "nested-docs";
1047
- const CONFIG_FILE$7 = "vite.config.ts";
1048
- const SEPARATOR$18 = "/";
1049
- const READ_CONCURRENCY$26 = 64;
992
+ const RULE$52 = "nested-docs";
993
+ const CONFIG_FILE$6 = "vite.config.ts";
994
+ const SEPARATOR$17 = "/";
995
+ const READ_CONCURRENCY$25 = 64;
1050
996
  const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
1051
997
  const WORKSPACE_AGENT_DOC = "AGENTS.md";
1052
998
  const README = /^README(?:\.[^/]+)?$/iu;
1053
999
  const MANIFEST$5 = "package.json";
1054
1000
  const MISSING_RULE = "workspace-agents-md";
1055
1001
  const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
1056
- const taggedError$7 = Schema.TaggedError;
1057
- var RootConfigUnreadable = class extends taggedError$7()("RootConfigUnreadable", { file: Schema.String }) {};
1058
- const isNested = (name) => String$1.includes(SEPARATOR$18)(name);
1059
- const problemFor$7 = problemInFile(RULE$54);
1002
+ const taggedError$6 = Schema.TaggedError;
1003
+ var RootConfigUnreadable = class extends taggedError$6()("RootConfigUnreadable", { file: Schema.String }) {};
1004
+ const isNested = (name) => String$1.includes(SEPARATOR$17)(name);
1005
+ const problemFor$6 = problemInFile(RULE$52);
1060
1006
  const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
1061
1007
  const WORKSPACE_AGENT_DOCS_MESSAGE = "belongs only at the repository root or as AGENTS.md directly in a workspace, the directory that holds its package.json. Move what agents need there and delete this file.";
1062
1008
  const MISSING_MESSAGE$1 = "has no AGENTS.md next to it. This repository sets msch.workspaceAgentsMd, so every workspace describes what it is for and the rules that apply only there in its own AGENTS.md.";
1063
1009
  const README_MESSAGE = "is allowed below the root only in a workspace, the directory that holds its package.json. Move it into the workspace it describes.";
1064
1010
  const agentDocProblem = ({ file, base, directory }, allowed) => {
1065
- if (!allowed.workspaceAgentDocs) return Option.some(problemFor$7(file, `${base} ${AGENT_DOCS_MESSAGE}`));
1011
+ if (!allowed.workspaceAgentDocs) return Option.some(problemFor$6(file, `${base} ${AGENT_DOCS_MESSAGE}`));
1066
1012
  if (base === WORKSPACE_AGENT_DOC && HashSet.has(allowed.workspaces, directory)) return Option.none();
1067
- return Option.some(problemFor$7(file, `${base} ${WORKSPACE_AGENT_DOCS_MESSAGE}`));
1013
+ return Option.some(problemFor$6(file, `${base} ${WORKSPACE_AGENT_DOCS_MESSAGE}`));
1068
1014
  };
1069
1015
  const readmeProblem = ({ file, base, directory }, allowed) => {
1070
1016
  if (!README.test(base) || HashSet.has(allowed.workspaces, directory)) return Option.none();
1071
- return Option.some(problemFor$7(file, `${base} ${README_MESSAGE}`));
1017
+ return Option.some(problemFor$6(file, `${base} ${README_MESSAGE}`));
1072
1018
  };
1073
1019
  const missingProblems = ({ required, directories, present, join }) => pipe(directories, Array.filter((directory) => required && !HashSet.has(present, join(directory, WORKSPACE_AGENT_DOC))), Array.map((directory) => problemInFile(MISSING_RULE)(join(directory, MANIFEST$5), MISSING_MESSAGE$1)));
1074
1020
  const problemIn$6 = Effect.fn("problemIn")(function* problemIn(root, allowed, name) {
@@ -1084,7 +1030,7 @@ const problemIn$6 = Effect.fn("problemIn")(function* problemIn(root, allowed, na
1084
1030
  });
1085
1031
  const allowsWorkspaceAgentDocs = Effect.fn("allowsWorkspaceAgentDocs")(function* allowsWorkspaceAgentDocs(root) {
1086
1032
  const files = yield* RepositoryFiles;
1087
- const file = files.join(root, CONFIG_FILE$7);
1033
+ const file = files.join(root, CONFIG_FILE$6);
1088
1034
  if (!(yield* files.exists(file))) return false;
1089
1035
  const config = yield* Effect.tryPromise({
1090
1036
  try: () => resolveConfigFromFile(file),
@@ -1103,7 +1049,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
1103
1049
  workspaces: pipe(directories, Array.map((directory) => files.join(root, directory)), HashSet.fromIterable),
1104
1050
  workspaceAgentDocs
1105
1051
  };
1106
- const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$26 });
1052
+ const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$25 });
1107
1053
  const missing = missingProblems({
1108
1054
  required: workspaceAgentDocs,
1109
1055
  directories: pipe(directories, Array.map((directory) => files.join(root, directory))),
@@ -1113,15 +1059,15 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
1113
1059
  return [...Array.getSomes(found), ...missing];
1114
1060
  });
1115
1061
  // src/features/check-placement/model/published-readme.ts
1116
- const RULE$53 = "published-readme";
1117
- const READ_CONCURRENCY$25 = 16;
1118
- const MESSAGE$16 = "contains Japanese. This package is published to npm, so write its README in English.";
1062
+ const RULE$51 = "published-readme";
1063
+ const READ_CONCURRENCY$24 = 16;
1064
+ const MESSAGE$15 = "contains Japanese. This package is published to npm, so write its README in English.";
1119
1065
  const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
1120
1066
  const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
1121
1067
  const readme = yield* readReadme({
1122
1068
  root,
1123
1069
  directory,
1124
- rule: RULE$53,
1070
+ rule: RULE$51,
1125
1071
  missingMessage: MISSING_MESSAGE
1126
1072
  });
1127
1073
  return Result.match(readme, {
@@ -1132,8 +1078,8 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
1132
1078
  file,
1133
1079
  line,
1134
1080
  column,
1135
- rule: RULE$53,
1136
- message: MESSAGE$16
1081
+ rule: RULE$51,
1082
+ message: MESSAGE$15
1137
1083
  };
1138
1084
  }))
1139
1085
  });
@@ -1141,17 +1087,17 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
1141
1087
  /** @internal */
1142
1088
  const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPublishedReadme(root) {
1143
1089
  const projects = yield* publishedProjects(root);
1144
- const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$25 });
1090
+ const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$24 });
1145
1091
  return Array.getSomes(found);
1146
1092
  });
1147
1093
  // src/features/check-placement/model/published-tests.ts
1148
- const RULE$52 = "published-tests";
1094
+ const RULE$50 = "published-tests";
1149
1095
  const MANIFEST_FILE$2 = "package.json";
1150
1096
  const FILE_START = 1;
1151
1097
  const TEST_FILE$1 = /\.test\.[cm]?[jt]sx?$/u;
1152
- const MESSAGE$15 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
1098
+ const MESSAGE$14 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
1153
1099
  const testedIn = (listed) => (prefix) => pipe(listed, Array.some((file) => String$1.startsWith(prefix)(file) && TEST_FILE$1.test(file)));
1154
- const problemFor$6 = Effect.fn("problemFor")(function* problemFor(root, listed, { directory }) {
1100
+ const problemFor$5 = Effect.fn("problemFor")(function* problemFor(root, listed, { directory }) {
1155
1101
  const files = yield* RepositoryFiles;
1156
1102
  const absolute = files.join(root, directory);
1157
1103
  const prefix = `${absolute}/`;
@@ -1160,8 +1106,8 @@ const problemFor$6 = Effect.fn("problemFor")(function* problemFor(root, listed,
1160
1106
  file: files.join(absolute, MANIFEST_FILE$2),
1161
1107
  line: FILE_START,
1162
1108
  column: FILE_START,
1163
- rule: RULE$52,
1164
- message: MESSAGE$15
1109
+ rule: RULE$50,
1110
+ message: MESSAGE$14
1165
1111
  });
1166
1112
  });
1167
1113
  /** @internal */
@@ -1170,17 +1116,17 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
1170
1116
  const projects = yield* publishedProjects(root);
1171
1117
  const listed = yield* files.listedFiles(root);
1172
1118
  const absolute = pipe(listed, Array.map((file) => files.join(root, file)));
1173
- const found = yield* Effect.forEach(projects, (project) => problemFor$6(root, absolute, project), { concurrency: 1 });
1119
+ const found = yield* Effect.forEach(projects, (project) => problemFor$5(root, absolute, project), { concurrency: 1 });
1174
1120
  return Array.getSomes(found);
1175
1121
  });
1176
1122
  // src/features/check-placement/model/root-docs.ts
1177
- const RULE$51 = "root-docs";
1178
- const SEPARATOR$17 = "/";
1123
+ const RULE$49 = "root-docs";
1124
+ const SEPARATOR$16 = "/";
1179
1125
  const FIRST$16 = 1;
1180
1126
  const MARKDOWN$1 = /\.(?:md|mdx|markdown)$/iu;
1181
1127
  const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
1182
- const MESSAGE$14 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
1183
- const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$17)(name) && MARKDOWN$1.test(name) && !ALLOWED.test(name);
1128
+ const MESSAGE$13 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
1129
+ const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$16)(name) && MARKDOWN$1.test(name) && !ALLOWED.test(name);
1184
1130
  /** @internal */
1185
1131
  const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
1186
1132
  const files = yield* RepositoryFiles;
@@ -1189,19 +1135,18 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
1189
1135
  file: files.join(root, name),
1190
1136
  line: FIRST$16,
1191
1137
  column: FIRST$16,
1192
- rule: RULE$51,
1193
- message: `${name} ${MESSAGE$14}`
1138
+ rule: RULE$49,
1139
+ message: `${name} ${MESSAGE$13}`
1194
1140
  })));
1195
1141
  });
1196
1142
  // src/features/check-placement/model/root-readme.ts
1197
- const RULE$50 = "root-readme";
1143
+ const RULE$48 = "root-readme";
1198
1144
  const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
1199
- const READ_CONCURRENCY$24 = 16;
1200
- const START$22 = 0;
1145
+ const READ_CONCURRENCY$23 = 16;
1146
+ const START$21 = 0;
1201
1147
  const CHECK_POLICY = "@r_masseater/msch";
1202
1148
  const MARKETPLACE$1 = ".claude-plugin/marketplace.json";
1203
1149
  const RELATIVE$1 = /^\.\//u;
1204
- const SEPARATOR$16 = "/";
1205
1150
  const MarketplacePlugin = Schema.Struct({
1206
1151
  name: Schema.optional(Schema.String),
1207
1152
  source: Schema.Unknown
@@ -1213,10 +1158,9 @@ const NO_PLUGINS = {
1213
1158
  };
1214
1159
  const isCheckPolicy = ({ packageName }) => Option.contains(packageName, CHECK_POLICY);
1215
1160
  const messageFor = (directory) => `names the workspace ${directory}. The root README, AGENTS.md and CLAUDE.md describe the repository as a whole. Write what belongs to the workspace in ${directory}/README.md, or for agents in ${directory}/AGENTS.md.`;
1216
- const lastSegment = (directory) => pipe(String$1.split(SEPARATOR$16)(directory), Array.last, Option.getOrElse(() => directory));
1217
1161
  const pluginsOf = (plugins) => {
1218
1162
  const directories = pipe(plugins, Array.map(({ source }) => source), Array.filter(Predicate.isString), Array.map(String$1.replace(RELATIVE$1, "")));
1219
- const segments = pipe(directories, Array.map(lastSegment));
1163
+ const segments = pipe(directories, Array.map(baseName));
1220
1164
  return {
1221
1165
  directories,
1222
1166
  names: pipe(plugins, Array.map(({ name }) => name), Array.filter(Predicate.isString), Array.appendAll(segments), Array.dedupe)
@@ -1236,17 +1180,17 @@ const patternFor = (plugins) => ({ directory, names }) => patternOf$1(Option.mat
1236
1180
  onNone: () => ownNames(plugins, names),
1237
1181
  onSome: () => [directory]
1238
1182
  }));
1239
- const problemsIn$20 = (file, source, plugins) => (workspace) => {
1183
+ const problemsIn$18 = (file, source, plugins) => (workspace) => {
1240
1184
  const message = messageFor(workspace.directory);
1241
1185
  const at = positionOf(source);
1242
1186
  const pattern = patternFor(plugins)(workspace);
1243
- return pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((found) => problemAtPosition(RULE$50)(file, at(found.index ?? START$22), message)));
1187
+ return pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((found) => problemAtPosition(RULE$48)(file, at(found.index ?? START$21), message)));
1244
1188
  };
1245
1189
  const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
1246
1190
  const text = yield* (yield* RepositoryFiles).readFile(file);
1247
1191
  return pipe(text, Option.match({
1248
1192
  onNone: () => [],
1249
- onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$20(file, source, plugins)))
1193
+ onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$18(file, source, plugins)))
1250
1194
  }));
1251
1195
  });
1252
1196
  /** @internal */
@@ -1257,7 +1201,7 @@ const checkRootReadme = Effect.fn("checkRootReadme")(function* checkRootReadme(r
1257
1201
  const named = yield* namedWorkspaces(root);
1258
1202
  const workspaces = pipe(named, Array.filter((workspace) => !isCheckPolicy(workspace)));
1259
1203
  const plugins = yield* marketplacePlugins(root);
1260
- const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$24 });
1204
+ const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$23 });
1261
1205
  return Array.flatten(found);
1262
1206
  });
1263
1207
  // src/features/check-placement/model/doc-placement.ts
@@ -1277,10 +1221,10 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
1277
1221
  return Array.flatten(found);
1278
1222
  });
1279
1223
  // src/features/check-placement/model/docs-mirror.ts
1280
- const RULE$49 = "docs-mirror";
1224
+ const RULE$47 = "docs-mirror";
1281
1225
  const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
1282
1226
  const MIRROR_LIMIT = 3;
1283
- const READ_CONCURRENCY$23 = 16;
1227
+ const READ_CONCURRENCY$22 = 16;
1284
1228
  const SPECIAL = /[$()*+.?[\\\]^{|}]/gu;
1285
1229
  const BEFORE = String.raw`(?<![\w@/.-])`;
1286
1230
  const AFTER = String.raw`(?![\w@.-])`;
@@ -1296,20 +1240,20 @@ const firstMention = (source, workspace) => {
1296
1240
  };
1297
1241
  const ownerOf$3 = (doc) => (workspace) => String$1.startsWith(`${workspace.directory}/`)(doc);
1298
1242
  const describe = (mentions) => pipe(mentions, Array.map(({ directory }) => `\`${directory}\``), Array.join(", "));
1299
- const problemFor$5 = (file, source, mentions) => pipe(Array.head(mentions), Option.filter(() => mentions.length >= MIRROR_LIMIT), Option.map(({ offset }) => {
1243
+ const problemFor$4 = (file, source, mentions) => pipe(Array.head(mentions), Option.filter(() => mentions.length >= MIRROR_LIMIT), Option.map(({ offset }) => {
1300
1244
  const { line, column } = positionOf(source)(offset);
1301
1245
  return {
1302
1246
  file,
1303
1247
  line,
1304
1248
  column,
1305
- rule: RULE$49,
1249
+ rule: RULE$47,
1306
1250
  message: `names ${String(mentions.length)} other workspaces (${describe(mentions)}). The workspace list and each package.json already declare them, so this copy goes stale. Point at the declaration instead of listing it.`
1307
1251
  };
1308
1252
  }), Option.toArray);
1309
1253
  const othersIn = (doc, workspaces) => pipe(workspaces, Array.filter((workspace) => !ownerOf$3(doc)(workspace)));
1310
1254
  const problemIn$4 = (workspaces) => (doc, file, source) => {
1311
1255
  const mentions = pipe(othersIn(doc, workspaces), Array.flatMap((workspace) => Option.toArray(firstMention(source, workspace))));
1312
- return problemFor$5(file, source, Array.sort(mentions, byOffset));
1256
+ return problemFor$4(file, source, Array.sort(mentions, byOffset));
1313
1257
  };
1314
1258
  const workspacesOf = Effect.fn("workspacesOf")(function* workspacesOf(root) {
1315
1259
  const files = yield* RepositoryFiles;
@@ -1317,7 +1261,7 @@ const workspacesOf = Effect.fn("workspacesOf")(function* workspacesOf(root) {
1317
1261
  return yield* Effect.forEach(directories, (directory) => readManifest(files.join(root, directory)).pipe(Effect.map((manifest) => ({
1318
1262
  directory,
1319
1263
  names: [directory, ...pipe(manifest, Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.toArray)]
1320
- }))), { concurrency: READ_CONCURRENCY$23 });
1264
+ }))), { concurrency: READ_CONCURRENCY$22 });
1321
1265
  });
1322
1266
  /** @internal */
1323
1267
  const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(root) {
@@ -1330,14 +1274,14 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
1330
1274
  onNone: () => [],
1331
1275
  onSome: (text) => problemIn$4(workspaces)(doc, file, text)
1332
1276
  })));
1333
- }, { concurrency: READ_CONCURRENCY$23 });
1277
+ }, { concurrency: READ_CONCURRENCY$22 });
1334
1278
  return Array.flatten(found);
1335
1279
  });
1336
1280
  // src/features/check-placement/model/ignored-sources.ts
1337
- const RULE$48 = "ignored-sources";
1281
+ const RULE$46 = "ignored-sources";
1338
1282
  const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
1339
1283
  const FIRST$15 = 1;
1340
- const MESSAGE$13 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
1284
+ const MESSAGE$12 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
1341
1285
  /** @internal */
1342
1286
  const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
1343
1287
  const files = yield* RepositoryFiles;
@@ -1346,8 +1290,8 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
1346
1290
  file: files.join(root, file),
1347
1291
  line: FIRST$15,
1348
1292
  column: FIRST$15,
1349
- rule: RULE$48,
1350
- message: MESSAGE$13
1293
+ rule: RULE$46,
1294
+ message: MESSAGE$12
1351
1295
  })));
1352
1296
  });
1353
1297
  // src/features/check-placement/model/public-entries.ts
@@ -1377,8 +1321,8 @@ const checkPublicEntries = Effect.fn("checkPublicEntries")(function* checkPublic
1377
1321
  return Array.flatten(entries);
1378
1322
  });
1379
1323
  // src/shared/lib/tree-sitter.ts
1380
- const taggedError$6 = Schema.TaggedError;
1381
- var GrammarUnreadable = class extends taggedError$6()("GrammarUnreadable", {
1324
+ const taggedError$5 = Schema.TaggedError;
1325
+ var GrammarUnreadable = class extends taggedError$5()("GrammarUnreadable", {
1382
1326
  grammar: Schema.String,
1383
1327
  message: Schema.String
1384
1328
  }) {};
@@ -10024,8 +9968,8 @@ const LAYER_ITEMS = [
10024
9968
  "attribute_item",
10025
9969
  "inner_attribute_item"
10026
9970
  ];
10027
- const READ_CONCURRENCY$22 = 64;
10028
- const EXCLUDED$6 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
9971
+ const READ_CONCURRENCY$21 = 64;
9972
+ const EXCLUDED$5 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
10029
9973
  const NONE$2 = [];
10030
9974
  const ROOT_MESSAGE = "defines code in the crate root. Keep lib.rs and main.rs to mod declarations of layers, use, pub use and fn main, and put the code in a layer.";
10031
9975
  const LAYER_INDEX_MESSAGE = "defines code in a layer module. A layer module holds only mod declarations of its slices and use; put the code in a slice.";
@@ -10086,7 +10030,7 @@ const isRead = ({ inner }) => {
10086
10030
  };
10087
10031
  const rustSources = Effect.fn("rustSources")(function* rustSources(root) {
10088
10032
  const files = yield* RepositoryFiles;
10089
- const listed = yield* files.matchingFiles(root, EXCLUDED$6);
10033
+ const listed = yield* files.matchingFiles(root, EXCLUDED$5);
10090
10034
  const owner = crateOf(crateDirectories(listed));
10091
10035
  return pipe(listed, Array.filter((name) => RUST_FILE.test(name)), Array.flatMap((name) => Option.toArray(Option.map(owner(name), (owned) => ({
10092
10036
  ...owned,
@@ -10100,17 +10044,17 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
10100
10044
  if (!Array.isReadonlyArrayNonEmpty(sources)) return NONE$2;
10101
10045
  const language = yield* loadLanguage(GRAMMAR).pipe(Effect.orDie);
10102
10046
  const parse = parsedWith(language);
10103
- const read = yield* Effect.forEach(pipe(sources, Array.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$22 });
10047
+ const read = yield* Effect.forEach(pipe(sources, Array.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$21 });
10104
10048
  return [...sliceNameProblems(root, files.join, sources), ...Array.flatMap(Array.getSomes(read), problemsOf$4)];
10105
10049
  });
10106
10050
  // src/features/check-placement/model/shadcn-ui-alias.ts
10107
- const RULE$47 = "shadcn-ui-alias";
10051
+ const RULE$45 = "shadcn-ui-alias";
10108
10052
  const FIRST$14 = 1;
10109
10053
  const problemOf$9 = (directory, { file, alias }) => ({
10110
10054
  file,
10111
10055
  line: FIRST$14,
10112
10056
  column: FIRST$14,
10113
- rule: RULE$47,
10057
+ rule: RULE$45,
10114
10058
  message: `aliases.ui "${alias}" in ${directory}/components.json does not resolve to a directory through the imports of ${directory}/package.json. shadcn lint and msch then cannot tell which files are the design-system components. Point the alias at a "#/" import, such as "#/shared/ui", and map "#/*" to "./src/*".`
10115
10059
  });
10116
10060
  /** @internal */
@@ -10130,8 +10074,8 @@ const SOURCE_ALIAS = "#/*";
10130
10074
  const SOURCE_TARGET = "./src/*";
10131
10075
  const SOURCE_PREFIX = /^\.\/src(?:\/|$)/u;
10132
10076
  const ALIAS_MESSAGE = `points into src/ under its own name. Import source through "${SOURCE_ALIAS}": "${SOURCE_TARGET}" only, so an import names the layer and slice it uses instead of a folder alias.`;
10133
- const Manifest$7 = Schema.Struct({ imports: Schema.optional(Schema.Unknown) });
10134
- const decodeManifest$9 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$7));
10077
+ const Manifest$6 = Schema.Struct({ imports: Schema.optional(Schema.Unknown) });
10078
+ const decodeManifest$7 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$6));
10135
10079
  const targetsOf = (target) => {
10136
10080
  if (Predicate.isString(target)) return [target];
10137
10081
  if (Predicate.isObject(target)) return pipe(Record.values(target), Array.flatMap(targetsOf));
@@ -10142,7 +10086,7 @@ const aliasProblems = Effect.fn("aliasProblems")(function* aliasProblems(root, w
10142
10086
  const files = yield* RepositoryFiles;
10143
10087
  const manifest = files.join(root, workspace, MANIFEST_FILE$3);
10144
10088
  const text = yield* files.readFile(manifest);
10145
- return pipe(text, Option.flatMap(decodeManifest$9), Option.flatMap(({ imports }) => Option.liftPredicate(imports, Predicate.isObject)), Option.map((imports) => Record.toEntries(imports)), Option.getOrElse(() => Array.empty()), Array.filter(intoSource), Array.map(([key]) => problemInFile(ALIAS_RULE)(manifest, `"${key}" ${ALIAS_MESSAGE}`)));
10089
+ return pipe(text, Option.flatMap(decodeManifest$7), Option.flatMap(({ imports }) => Option.liftPredicate(imports, Predicate.isObject)), Option.map((imports) => Record.toEntries(imports)), Option.getOrElse(() => Array.empty()), Array.filter(intoSource), Array.map(([key]) => problemInFile(ALIAS_RULE)(manifest, `"${key}" ${ALIAS_MESSAGE}`)));
10146
10090
  });
10147
10091
  /** @internal */
10148
10092
  const checkSourceAliases = Effect.fn("checkSourceAliases")(function* checkSourceAliases(root) {
@@ -10175,17 +10119,17 @@ const SCRIPTS_DIRECTORY = "scripts";
10175
10119
  const WORKFLOW_DIRECTORY$1 = ".github/";
10176
10120
  const SEPARATOR$13 = "/";
10177
10121
  const CURRENT = "./";
10178
- const READ_CONCURRENCY$21 = 8;
10122
+ const READ_CONCURRENCY$20 = 8;
10179
10123
  const FIRST$13 = 1;
10180
10124
  const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
10181
10125
  const COMMAND$1 = /^bin\/[^/]+\.[cm]?ts$/u;
10182
10126
  const NOT_COMMAND = /\.(?:test|d|test\.support)\.[cm]?ts$/u;
10183
- const Manifest$6 = Schema.Struct({
10127
+ const Manifest$5 = Schema.Struct({
10184
10128
  bin: Schema.optional(Schema.Unknown),
10185
10129
  main: Schema.optional(Schema.Unknown),
10186
10130
  exports: Schema.optional(Schema.Unknown)
10187
10131
  });
10188
- const decodeManifest$8 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$6));
10132
+ const decodeManifest$6 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$5));
10189
10133
  const NO_ENTRIES = {
10190
10134
  all: [],
10191
10135
  bins: []
@@ -10210,7 +10154,7 @@ const entriesOf$2 = (manifest) => {
10210
10154
  const declaredEntries = Effect.fn("declaredEntries")(function* declaredEntries(root, directory) {
10211
10155
  const files = yield* RepositoryFiles;
10212
10156
  const text = yield* files.readFile(files.join(root, directory, MANIFEST_FILE$3));
10213
- return pipe(text, Option.flatMap(decodeManifest$8), Option.map(entriesOf$2), Option.getOrElse(() => NO_ENTRIES));
10157
+ return pipe(text, Option.flatMap(decodeManifest$6), Option.map(entriesOf$2), Option.getOrElse(() => NO_ENTRIES));
10214
10158
  });
10215
10159
  const isCommand$1 = (path) => COMMAND$1.test(path) && !NOT_COMMAND.test(path);
10216
10160
  const commandFilesIn = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
@@ -10222,7 +10166,7 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
10222
10166
  const files = yield* RepositoryFiles;
10223
10167
  const listed = yield* files.listedFiles(root);
10224
10168
  const workflows = pipe(listed, Array.filter(String$1.startsWith(WORKFLOW_DIRECTORY$1)));
10225
- const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$21 });
10169
+ const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$20 });
10226
10170
  return pipe(Array.getSomes(texts), Array.join("\n"));
10227
10171
  });
10228
10172
  const workspacePath = (directory, path) => pipe([directory, path], Array.filter(String$1.isNonEmpty), Array.join(SEPARATOR$13));
@@ -10233,7 +10177,7 @@ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array.fi
10233
10177
  message: `A task runs ${path}. Put each file that a task runs at ${BIN}/<name>.ts, the one place where every workspace keeps its commands, so that fallow and the other tools find it without a list of files.`
10234
10178
  })));
10235
10179
  const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array.flatMap(stringsIn), Array.flatMap(runsIn));
10236
- const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
10180
+ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
10237
10181
  const files = yield* RepositoryFiles;
10238
10182
  const config = yield* workspaceConfigOf(root, directory);
10239
10183
  const entries = yield* declaredEntries(root, directory);
@@ -10272,34 +10216,34 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
10272
10216
  const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
10273
10217
  const all = ["", ...yield* workspaceDirectories(root)];
10274
10218
  const workflows = yield* workflowText(root);
10275
- const found = yield* Effect.forEach(all, (directory) => problemsIn$19(root, directory, workflows), { concurrency: READ_CONCURRENCY$21 });
10276
- const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$21 });
10219
+ const found = yield* Effect.forEach(all, (directory) => problemsIn$17(root, directory, workflows), { concurrency: READ_CONCURRENCY$20 });
10220
+ const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$20 });
10277
10221
  return [...Array.flatten(found), ...Array.getSomes(scripts)];
10278
10222
  });
10279
10223
  // src/features/check-repository-layout/model/crates.ts
10280
- const RULE$46 = "unverified-crate";
10224
+ const RULE$44 = "unverified-crate";
10281
10225
  const VERSION_RULE = "release-version";
10282
10226
  const MANIFEST_FILE$1 = "package.json";
10283
10227
  const APP_DIRECTORIES = ["", "src-tauri"];
10284
10228
  const CARGO_FILE$1 = "Cargo.toml";
10285
- const CONFIG_FILE$6 = "vite.config.ts";
10229
+ const CONFIG_FILE$5 = "vite.config.ts";
10286
10230
  const SEPARATOR$12 = "/";
10287
10231
  const FIRST$12 = 1;
10288
- const READ_CONCURRENCY$20 = 8;
10232
+ const READ_CONCURRENCY$19 = 8;
10289
10233
  const PackageVersion = Schema.fromJsonString(Schema.Struct({ version: Schema.String }));
10290
- const problemFor$4 = (crate, message) => ({
10234
+ const problemFor$3 = (crate, message) => ({
10291
10235
  file: crate.manifest,
10292
10236
  line: FIRST$12,
10293
10237
  column: FIRST$12,
10294
- rule: RULE$46,
10238
+ rule: RULE$44,
10295
10239
  message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
10296
10240
  });
10297
10241
  const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
10298
10242
  const files = yield* RepositoryFiles;
10299
10243
  const workspace = owningWorkspace(directories)(files.relative(root, files.dirname(crate.manifest)));
10300
- if (Option.isNone(workspace)) return Option.some(problemFor$4(crate, "is outside every workspace package"));
10301
- if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$6))) return Option.none();
10302
- return Option.some(problemFor$4(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$6} has no verify task`));
10244
+ if (Option.isNone(workspace)) return Option.some(problemFor$3(crate, "is outside every workspace package"));
10245
+ if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$5))) return Option.none();
10246
+ return Option.some(problemFor$3(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$5} has no verify task`));
10303
10247
  });
10304
10248
  const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemIn(root, directories, crate) {
10305
10249
  const files = yield* RepositoryFiles;
@@ -10323,11 +10267,11 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
10323
10267
  if (!(yield* files.exists(files.join(root, CARGO_FILE$1)))) return [];
10324
10268
  const directories = yield* workspaceDirectories(root);
10325
10269
  const crates = yield* cratesIn(root);
10326
- const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$3(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$20 });
10270
+ const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$3(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$19 });
10327
10271
  return Array.getSomes(Array.flatten(found));
10328
10272
  });
10329
10273
  // src/features/check-repository-layout/model/deploy-entry-patterns.ts
10330
- const RULE$45 = "deploy-entry-pattern";
10274
+ const RULE$43 = "deploy-entry-pattern";
10331
10275
  const FALLOW_KEYS = [
10332
10276
  "entry",
10333
10277
  "entryPoints",
@@ -10345,8 +10289,8 @@ const NEGATED = "!";
10345
10289
  const ROOT_WORKSPACE = ".";
10346
10290
  const WRAP_OFFSET$1 = 1;
10347
10291
  const NO_OFFSET = 0;
10348
- const READ_CONCURRENCY$19 = 8;
10349
- const MESSAGE$12 = "selects deploy entries by their name or location. A deploy entry is the file that an Alchemy resource names in main, and its name and place change with the code. Use workspaceSettings().lint.deployEntries in lint settings; fallow reads main from the stack by itself.";
10292
+ const READ_CONCURRENCY$18 = 8;
10293
+ const MESSAGE$11 = "selects deploy entries by their name or location. A deploy entry is the file that an Alchemy resource names in main, and its name and place change with the code. Use workspaceSettings().lint.deployEntries in lint settings; fallow reads main from the stack by itself.";
10350
10294
  const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
10351
10295
  const FALLOW = {
10352
10296
  keys: FALLOW_KEYS,
@@ -10382,7 +10326,7 @@ const patternsOf = Effect.fn("patternsOf")(function* patternsOf(file, text, kind
10382
10326
  const parsed = yield* Effect.promise(() => parse(`${file}.ts`, kind.sourceOf(text), { lang: "ts" }));
10383
10327
  return pipe(patternsIn(kind.keys)(parsed.program), Array.filter(({ text: pattern }) => !String$1.startsWith(NEGATED)(pattern)));
10384
10328
  });
10385
- const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
10329
+ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(request) {
10386
10330
  const { root, file, kind, workspaces, entries } = request;
10387
10331
  const files = yield* RepositoryFiles;
10388
10332
  const path = files.join(root, file);
@@ -10398,8 +10342,8 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
10398
10342
  return pipe(Array.getSomes(flagged), Array.map(({ text: pattern, start }) => ({
10399
10343
  file: path,
10400
10344
  ...positionOf(text.value)(start - kind.offset),
10401
- rule: RULE$45,
10402
- message: `${pattern} ${MESSAGE$12}`
10345
+ rule: RULE$43,
10346
+ message: `${pattern} ${MESSAGE$11}`
10403
10347
  })));
10404
10348
  });
10405
10349
  /** @internal */
@@ -10421,17 +10365,17 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
10421
10365
  }];
10422
10366
  return [];
10423
10367
  }));
10424
- const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$18({
10368
+ const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$16({
10425
10369
  root,
10426
10370
  file,
10427
10371
  kind,
10428
10372
  workspaces,
10429
10373
  entries
10430
- }), { concurrency: READ_CONCURRENCY$19 });
10374
+ }), { concurrency: READ_CONCURRENCY$18 });
10431
10375
  return Array.flatten(found);
10432
10376
  });
10433
10377
  // src/features/check-repository-layout/model/fallow-entries.ts
10434
- const RULE$44 = "listed-entry";
10378
+ const RULE$42 = "listed-entry";
10435
10379
  const ENTRY_KEYS = [
10436
10380
  "entry",
10437
10381
  "entryPoints",
@@ -10441,7 +10385,7 @@ const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?
10441
10385
  const WILDCARD$3 = /[*?{[]/u;
10442
10386
  const SEPARATOR$11 = "/";
10443
10387
  const WRAP_OFFSET = 1;
10444
- const READ_CONCURRENCY$18 = 8;
10388
+ const READ_CONCURRENCY$17 = 8;
10445
10389
  const decodeKey = Schema.decodeUnknownOption(KeySchema);
10446
10390
  const isEntryProperty = (node) => node["type"] === "Property" && pipe(decodeKey(node["key"]), Option.exists((key) => Array.contains(ENTRY_KEYS, keyName(key))));
10447
10391
  const entryPatternsIn = (node) => {
@@ -10452,7 +10396,7 @@ const entryPatternsIn = (node) => {
10452
10396
  return pipe(childrenOf$1(node), Array.flatMap(entryPatternsIn));
10453
10397
  };
10454
10398
  const namesOneFile = (directories) => ({ text }) => pipe(directories, Array.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$11}`)(text))) || String$1.includes(SEPARATOR$11)(text) && !WILDCARD$3.test(text);
10455
- const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
10399
+ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
10456
10400
  const files = yield* RepositoryFiles;
10457
10401
  const path = files.join(root, file);
10458
10402
  const text = yield* files.readFile(path);
@@ -10461,7 +10405,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
10461
10405
  return pipe(entryPatternsIn(parsed.program), Array.filter(namesOneFile(directories)), Array.map(({ text: pattern, start }) => ({
10462
10406
  file: path,
10463
10407
  ...positionOf(text.value)(start),
10464
- rule: RULE$44,
10408
+ rule: RULE$42,
10465
10409
  message: `${pattern} names files one by one. Let fallow find the file through what declares it: package.json bin and exports, a tool's config file, or the main of the Alchemy resource that deploys it.`
10466
10410
  })));
10467
10411
  });
@@ -10469,12 +10413,12 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
10469
10413
  const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
10470
10414
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
10471
10415
  const directories = yield* workspaceDirectories(root);
10472
- const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$17(root, file, directories), { concurrency: READ_CONCURRENCY$18 });
10416
+ const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$15(root, file, directories), { concurrency: READ_CONCURRENCY$17 });
10473
10417
  return Array.flatten(found);
10474
10418
  });
10475
10419
  // src/features/check-repository-layout/model/root-workspace-paths.ts
10476
- const RULE$43 = "root-workspace-path";
10477
- const CONFIG_FILE$5 = "vite.config.ts";
10420
+ const RULE$41 = "root-workspace-path";
10421
+ const CONFIG_FILE$4 = "vite.config.ts";
10478
10422
  const PATH_CHARACTER = /[\w.@/-]/u;
10479
10423
  const NAME_CHARACTER = /[\w.@-]/u;
10480
10424
  const FIRST$11 = 0;
@@ -10489,27 +10433,27 @@ const mentions = (directory) => (text) => {
10489
10433
  return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
10490
10434
  }));
10491
10435
  };
10492
- const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
10436
+ const problemsIn$14 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
10493
10437
  file,
10494
10438
  ...positionOf(source)(found.start),
10495
- rule: RULE$43,
10496
- message: `${directory} is a workspace. The root ${CONFIG_FILE$5} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$5}: msch.lint, msch.devDependencies or its verify task.`
10439
+ rule: RULE$41,
10440
+ message: `${directory} is a workspace. The root ${CONFIG_FILE$4} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$4}: msch.lint, msch.devDependencies or its verify task.`
10497
10441
  })));
10498
10442
  /** @internal */
10499
10443
  const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* checkRootWorkspacePaths(root) {
10500
10444
  const files = yield* RepositoryFiles;
10501
- const file = files.join(root, CONFIG_FILE$5);
10445
+ const file = files.join(root, CONFIG_FILE$4);
10502
10446
  const source = yield* files.readFile(file);
10503
10447
  if (Option.isNone(source)) return [];
10504
10448
  const directories = yield* workspaceDirectories(root);
10505
10449
  const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
10506
- return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$16(file, source.value, directories)));
10450
+ return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$14(file, source.value, directories)));
10507
10451
  });
10508
10452
  // src/features/check-repository-layout/model/hidden-verify.ts
10509
- const RULE$42 = "hidden-verify";
10510
- const CONFIG_FILE$4 = "vite.config.ts";
10453
+ const RULE$40 = "hidden-verify";
10454
+ const CONFIG_FILE$3 = "vite.config.ts";
10511
10455
  const FIRST$10 = 1;
10512
- const READ_CONCURRENCY$17 = 8;
10456
+ const READ_CONCURRENCY$16 = 8;
10513
10457
  const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
10514
10458
  const config = yield* workspaceConfigOf(root, directory);
10515
10459
  if (Option.isNone(config)) return Option.none();
@@ -10520,19 +10464,19 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
10520
10464
  file,
10521
10465
  line: FIRST$10,
10522
10466
  column: FIRST$10,
10523
- rule: RULE$42,
10524
- message: `${directory} gets its verify task from code outside ${CONFIG_FILE$4}. The root verify reads ${CONFIG_FILE$4} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$4}.`
10467
+ rule: RULE$40,
10468
+ message: `${directory} gets its verify task from code outside ${CONFIG_FILE$3}. The root verify reads ${CONFIG_FILE$3} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$3}.`
10525
10469
  }).pipe(Option.filter(() => verified));
10526
10470
  });
10527
10471
  /** @internal */
10528
10472
  const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
10529
10473
  const directories = yield* workspaceDirectories(root);
10530
- const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$17 });
10474
+ const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$16 });
10531
10475
  return Array.getSomes(found);
10532
10476
  });
10533
10477
  // src/features/check-repository-layout/model/shared-uncached-tasks.ts
10534
- const RULE$41 = "shared-uncached-task";
10535
- const READ_CONCURRENCY$16 = 8;
10478
+ const RULE$39 = "shared-uncached-task";
10479
+ const READ_CONCURRENCY$15 = 8;
10536
10480
  const SHARED = 2;
10537
10481
  const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
10538
10482
  const UncachedTask = Schema.Struct({
@@ -10574,19 +10518,19 @@ const problemsOf$3 = (definitions) => {
10574
10518
  return pipe(definitions, Array.map(({ file, position, name, command }) => ({
10575
10519
  file,
10576
10520
  ...position,
10577
- rule: RULE$41,
10521
+ rule: RULE$39,
10578
10522
  message: `The uncached task ${name} (${command}) is written the same way in ${Array.join(directories, ", ")}. Write it once in a shared helper and spread it into each run.tasks, so that a change to it reaches every workspace.`
10579
10523
  })));
10580
10524
  };
10581
10525
  /** @internal */
10582
10526
  const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function* checkSharedUncachedTasks(root) {
10583
10527
  const directories = yield* workspaceDirectories(root);
10584
- const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$16 });
10528
+ const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$15 });
10585
10529
  return pipe(Array.flatten(found), Array.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array.flatMap(problemsOf$3));
10586
10530
  });
10587
10531
  // src/features/check-repository-layout/model/unlocked-tasks.ts
10588
- const RULE$40 = "unlocked-task";
10589
- const READ_CONCURRENCY$15 = 8;
10532
+ const RULE$38 = "unlocked-task";
10533
+ const READ_CONCURRENCY$14 = 8;
10590
10534
  const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
10591
10535
  const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
10592
10536
  const commandOf = (task) => pipe(propertyValue("command")(task.value), Option.getOrElse(() => task.value), literalOf, Option.flatMap(decodeCommand), Option.flatMap((command) => Array.findFirst(Array.ensure(command), (line) => READS_DEPENDENCIES.test(line))));
@@ -10597,13 +10541,13 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
10597
10541
  const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array.filter(tracksLockfiles), Array.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
10598
10542
  file,
10599
10543
  ...positionOf(source)(task.start),
10600
- rule: RULE$40,
10544
+ rule: RULE$38,
10601
10545
  message: `The task ${keyName(task.key)} runs ${command} with inputs written by hand. It then reruns after every lockfile change, and it does not rerun when a dependency of a dependency moves. Set cache to LOCKED from @r_masseater/msch/locked-inputs.`
10602
10546
  })), Option.toArray)));
10603
10547
  /** @internal */
10604
10548
  const checkUnlockedTasks = Effect.fn("checkUnlockedTasks")(function* checkUnlockedTasks(root) {
10605
10549
  const directories = yield* workspaceDirectories(root);
10606
- const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$15 });
10550
+ const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$14 });
10607
10551
  return pipe(Array.getSomes(found), Array.flatMap(problemsOf$2));
10608
10552
  });
10609
10553
  // src/features/check-repository-layout/model/task-checks.ts
@@ -10752,10 +10696,10 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
10752
10696
  /** @internal */
10753
10697
  const producedPaths = (source) => pipe(jobsOf(source), Array.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array.flatMap(outputPathsOf));
10754
10698
  // src/features/check-repository-layout/model/workflow-paths.ts
10755
- const RULE$39 = "workflow-path";
10699
+ const RULE$37 = "workflow-path";
10756
10700
  const WORKFLOW_DIRECTORY = ".github/workflows/";
10757
10701
  const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
10758
- const READ_CONCURRENCY$14 = 8;
10702
+ const READ_CONCURRENCY$13 = 8;
10759
10703
  const WILDCARD$2 = /[*?[]/u;
10760
10704
  const SEPARATOR$9 = "/";
10761
10705
  const FIRST$9 = 0;
@@ -10818,10 +10762,10 @@ const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, f
10818
10762
  const problemOf$8 = (file, source) => (found) => ({
10819
10763
  file,
10820
10764
  ...positionOf(source)(found.offset),
10821
- rule: RULE$39,
10765
+ rule: RULE$37,
10822
10766
  message: `${found.field} names ${found.path}, which is not ${EXPECTED[found.kind]} in this repository. Point it at a path that exists or remove it.`
10823
10767
  });
10824
- const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
10768
+ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
10825
10769
  const files = yield* RepositoryFiles;
10826
10770
  const file = files.join(root, workflow);
10827
10771
  const source = yield* files.readFile(file);
@@ -10833,7 +10777,7 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, workflo
10833
10777
  /** @internal */
10834
10778
  const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
10835
10779
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
10836
- const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$15(root, workflow), { concurrency: READ_CONCURRENCY$14 });
10780
+ const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$13(root, workflow), { concurrency: READ_CONCURRENCY$13 });
10837
10781
  return Array.flatten(found);
10838
10782
  });
10839
10783
  // src/features/check-repository-layout/model/workflow-scale.ts
@@ -10844,8 +10788,8 @@ const ACTION = /^\.github\/actions\/(?<name>[^/]+)\/action\.ya?ml$/u;
10844
10788
  const FILTER_KEYS = ["paths", "paths-ignore"];
10845
10789
  const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
10846
10790
  const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
10847
- const START$21 = 0;
10848
- const READ_CONCURRENCY$13 = 8;
10791
+ const START$20 = 0;
10792
+ const READ_CONCURRENCY$12 = 8;
10849
10793
  const SEPARATOR$8 = "/";
10850
10794
  const WORD_SEPARATORS = /[-_]/gu;
10851
10795
  const SPACE = " ";
@@ -10875,7 +10819,7 @@ const namesIn$1 = (name, source) => {
10875
10819
  return [
10876
10820
  {
10877
10821
  text: name,
10878
- offset: START$21
10822
+ offset: START$20
10879
10823
  },
10880
10824
  ...Option.toArray(stringOf(childOf("name")(root))),
10881
10825
  ...keysOf$1(childOf("jobs")(root))
@@ -10925,7 +10869,7 @@ const checkWorkflowScale = Effect.fn("checkWorkflowScale")(function* checkWorkfl
10925
10869
  name: stem,
10926
10870
  source: text
10927
10871
  })]), Option.getOrElse(() => []));
10928
- }), { concurrency: READ_CONCURRENCY$13 });
10872
+ }), { concurrency: READ_CONCURRENCY$12 });
10929
10873
  const actions = pipe(listed, Array.flatMap((name) => pipe(groupOf$1(ACTION, name), Option.map((action) => actionProblems(workspaces, files.join(root, name), action)), Option.getOrElse(() => []))));
10930
10874
  return [...Array.flatten(found), ...actions];
10931
10875
  });
@@ -11059,7 +11003,7 @@ const InstalledManifest = Schema.Struct({
11059
11003
  peerDependencies: DependencyMap,
11060
11004
  peerDependenciesMeta: PeerMeta
11061
11005
  });
11062
- const decodeManifest$7 = Schema.decodeOption(Schema.fromJsonString(InstalledManifest));
11006
+ const decodeManifest$5 = Schema.decodeOption(Schema.fromJsonString(InstalledManifest));
11063
11007
  const keysOf = (map) => pipe(Option.fromUndefinedOr(map), Option.map(Record.keys), Option.getOrElse(() => []));
11064
11008
  const isOptionalPeer = (manifest, name) => pipe(Option.fromUndefinedOr(manifest.peerDependenciesMeta), Option.flatMap(Record.get(name)), Option.exists((meta) => meta.optional === true));
11065
11009
  const installedNames = (manifest) => [
@@ -11070,7 +11014,7 @@ const installedNames = (manifest) => [
11070
11014
  const childrenOf = Effect.fn("childrenOf")(function* childrenOf(directory) {
11071
11015
  const files = yield* RepositoryFiles;
11072
11016
  const text = yield* files.readFile(files.join(directory, MANIFEST_FILE$3));
11073
- return pipe(text, Option.flatMap(decodeManifest$7), Option.map(installedNames), Option.getOrElse(() => []), Array.map((child) => [directory, child]));
11017
+ return pipe(text, Option.flatMap(decodeManifest$5), Option.map(installedNames), Option.getOrElse(() => []), Array.map((child) => [directory, child]));
11074
11018
  });
11075
11019
  const resolveFrom = (from, name) => Effect.gen(function* resolvePackage() {
11076
11020
  const files = yield* RepositoryFiles;
@@ -11132,11 +11076,11 @@ const LISTED_LARGEST = 5;
11132
11076
  const SIZE_CONCURRENCY = 32;
11133
11077
  const MEGABYTE = 1e6;
11134
11078
  const MEGABYTE_DIGITS = 1;
11135
- const START$20 = 0;
11079
+ const START$19 = 0;
11136
11080
  const SINGLE_ENTRY = 1;
11137
11081
  const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
11138
11082
  const usageHint = (dependency, entryCount) => {
11139
- if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$20 && dependency.entries.length < entryCount)) return "";
11083
+ if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$19 && dependency.entries.length < entryCount)) return "";
11140
11084
  return ` (imported only from ${Array.join(dependency.entries, ", ")})`;
11141
11085
  };
11142
11086
  const listed$1 = ({ largest, entryCount }) => pipe(largest, Array.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array.join(", "));
@@ -11145,7 +11089,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
11145
11089
  const { workspace, total } = overrun;
11146
11090
  const config = yield* files.readFile(workspace.configFile);
11147
11091
  const source = Option.getOrElse(config, () => "");
11148
- const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$20);
11092
+ const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$19);
11149
11093
  return {
11150
11094
  file: workspace.configFile,
11151
11095
  ...positionOf(source)(index),
@@ -11162,7 +11106,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
11162
11106
  const everything = pipe(closures, Array.flatMap(([, packages]) => Array.fromIterable(packages)), HashSet.fromIterable);
11163
11107
  const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
11164
11108
  const sizes = HashMap.fromIterable(measured);
11165
- const sizeOf = (packages) => packages.pipe(Array.fromIterable, Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$20)), Number$1.sumAll);
11109
+ const sizeOf = (packages) => packages.pipe(Array.fromIterable, Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$19)), Number$1.sumAll);
11166
11110
  return {
11167
11111
  closures,
11168
11112
  sizeOf,
@@ -11195,11 +11139,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
11195
11139
  })];
11196
11140
  });
11197
11141
  const stackProblems = (file, source, dependencies) => {
11198
- const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$20);
11142
+ const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$19);
11199
11143
  const rest = String$1.slice(section)(source);
11200
11144
  return pipe(Record.toEntries(dependencies), Array.filter(([, specifier]) => specifier === STACK_CATALOG), Array.map(([name]) => ({
11201
11145
  file,
11202
- ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$20)),
11146
+ ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$19)),
11203
11147
  rule: STACK_DEPENDENCY,
11204
11148
  message: `${name} comes from the stack catalog, so every project that installs this package already has it. Move it to peerDependencies and keep it in devDependencies, so the installing project shares one copy.`
11205
11149
  })));
@@ -11271,8 +11215,8 @@ const quote = (text) => pipe(Schema.encodeOption(Quoted)(text), Option.getOrElse
11271
11215
  const builtins = new Set(builtinModules);
11272
11216
  const always = () => true;
11273
11217
  const never = () => false;
11274
- const taggedError$5 = Schema.TaggedError;
11275
- var BundleFailed = class extends taggedError$5()("BundleFailed", { detail: Schema.String }) {};
11218
+ const taggedError$4 = Schema.TaggedError;
11219
+ var BundleFailed = class extends taggedError$4()("BundleFailed", { detail: Schema.String }) {};
11276
11220
  const failed = (error) => BundleFailed.make({ detail: bundleErrorDetail(error) });
11277
11221
  const isBare = (specifier) => !String$1.startsWith(RELATIVE_PREFIX)(specifier) && !String$1.startsWith(SUBPATH_IMPORT)(specifier) && !ABSOLUTE.test(specifier) && !String$1.startsWith(VIRTUAL_PREFIX)(specifier);
11278
11222
  const isBuiltin = (specifier) => String$1.startsWith(NODE_PROTOCOL)(specifier) || builtins.has(packageNameOf(specifier));
@@ -11334,14 +11278,14 @@ const exportNamesOf = Effect.fn("exportNamesOf")(function* exportNamesOf(scope,
11334
11278
  return pipe(chunks, Array.flatMap((chunk) => chunk.exports), Array.dedupe);
11335
11279
  });
11336
11280
  // src/features/check-tree-shaking/model/manifest.ts
11337
- const Manifest$5 = Schema.Struct({
11281
+ const Manifest$4 = Schema.Struct({
11338
11282
  name: Schema.optional(Schema.String),
11339
11283
  exports: Schema.optional(Schema.Unknown),
11340
11284
  bin: Schema.optional(Schema.Unknown),
11341
11285
  sideEffects: Schema.optional(Schema.Unknown),
11342
11286
  dependencies: Schema.optional(Schema.Record(Schema.String, Schema.String))
11343
11287
  });
11344
- const decode = Schema.decodeOption(Schema.fromJsonString(Manifest$5));
11288
+ const decode = Schema.decodeOption(Schema.fromJsonString(Manifest$4));
11345
11289
  const manifestOf$1 = (text) => decode(text);
11346
11290
  const dependencyNames = (manifest) => pipe(Option.fromUndefinedOr(manifest.dependencies), Option.map(Record.keys), Option.getOrElse(() => []));
11347
11291
  const isFileList = Schema.is(Schema.Array(Schema.String));
@@ -11369,19 +11313,19 @@ const declaredBy$1 = ({ declared, locator }) => {
11369
11313
  };
11370
11314
  };
11371
11315
  // src/features/check-tree-shaking/model/optional-peers.ts
11372
- const RULE$38 = "optional-peer";
11373
- const START$19 = 0;
11316
+ const RULE$36 = "optional-peer";
11317
+ const START$18 = 0;
11374
11318
  const SINGLE = 1;
11375
11319
  const DEPENDENCIES_KEY = "\"dependencies\"";
11376
11320
  const importsPackage = (name) => ({ packages }) => Array.contains(packages, name);
11377
11321
  const labelsOf = (importers) => pipe(importers, Array.map(({ entry }) => `\`${entry.label}\``), Array.dedupe, Array.join(", "));
11378
- const problemFor$3 = (located, name, importers) => {
11379
- const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(located.source), () => START$19);
11322
+ const problemFor$2 = (located, name, importers) => {
11323
+ const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(located.source), () => START$18);
11380
11324
  const rest = String$1.slice(section)(located.source);
11381
11325
  return {
11382
11326
  file: located.file,
11383
- ...positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$19)),
11384
- rule: RULE$38,
11327
+ ...positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$18)),
11328
+ rule: RULE$36,
11385
11329
  message: `${name} is imported only from ${labelsOf(importers)}, so installing the other entries must not require it. Move it to peerDependencies, mark it optional in peerDependenciesMeta and keep it in devDependencies.`
11386
11330
  };
11387
11331
  };
@@ -11392,14 +11336,14 @@ const optionalPeerProblems = ({ located, dependencies, used }) => {
11392
11336
  return pipe(dependencies, Array.flatMap((name) => {
11393
11337
  const importers = pipe(libraries, Array.filter(importsPackage(name)));
11394
11338
  const neededByBin = pipe(bins, Array.some(importsPackage(name)));
11395
- if (!(importers.length > START$19 && importers.length < libraries.length) || neededByBin) return [];
11396
- return [problemFor$3(located, name, importers)];
11339
+ if (!(importers.length > START$18 && importers.length < libraries.length) || neededByBin) return [];
11340
+ return [problemFor$2(located, name, importers)];
11397
11341
  }));
11398
11342
  };
11399
11343
  // src/features/check-tree-shaking/model/side-effects.ts
11400
- const RULE$37 = "side-effects";
11344
+ const RULE$35 = "side-effects";
11401
11345
  const BUNDLE_CONCURRENCY$2 = 4;
11402
- const START$18 = 0;
11346
+ const START$17 = 0;
11403
11347
  const FIRST$8 = 1;
11404
11348
  const LISTED_PACKAGES = 4;
11405
11349
  const SIDE_EFFECTS_KEY = "\"sideEffects\"";
@@ -11423,7 +11367,7 @@ const memberExcess = Effect.fn("memberExcess")(function* memberExcess({ scope, e
11423
11367
  label: entry.label,
11424
11368
  member,
11425
11369
  ...extra
11426
- }, ({ modules }) => modules > START$18);
11370
+ }, ({ modules }) => modules > START$17);
11427
11371
  });
11428
11372
  const excessOf = Effect.fn("excessOf")(function* excessOf(subject) {
11429
11373
  const names = yield* exportNamesOf(subject.scope, subject.entry.source);
@@ -11445,17 +11389,17 @@ const othersOf = (total) => {
11445
11389
  };
11446
11390
  const messageOf$4 = (worst, total) => `importing \`${worst.member}\` from \`${worst.label}\` also bundles ${String(worst.modules)} modules${importsOf(worst.packages)}, which it does not use.${othersOf(total)} Declare "sideEffects": false in package.json so that a bundler drops what nothing imports, and keep a module that must run for its effect out of the package.`;
11447
11391
  const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
11448
- const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$18));
11392
+ const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$17));
11449
11393
  const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array.sortBy(largest), Array.head, Option.map((worst) => ({
11450
11394
  file,
11451
11395
  ...positionOf(source)(keyIndex$1(source)),
11452
- rule: RULE$37,
11396
+ rule: RULE$35,
11453
11397
  message: messageOf$4(worst, excesses.length)
11454
11398
  })), Option.toArray);
11455
11399
  // src/features/check-tree-shaking/model/top-level-effects.ts
11456
- const RULE$36 = "top-level-effect";
11400
+ const RULE$34 = "top-level-effect";
11457
11401
  const CODE$1 = /\.[cm]?[jt]sx?$/u;
11458
- const READ_CONCURRENCY$12 = 16;
11402
+ const READ_CONCURRENCY$11 = 16;
11459
11403
  const IMPORT_MESSAGE = "imports a module only for its effect, but sideEffects in package.json does not list this file, so a bundler drops the import. Import what the module exports, or list the entry that exists for its effect in sideEffects.";
11460
11404
  const STATEMENT_MESSAGE = "runs a statement at the top level for its effect, but sideEffects in package.json does not list this file, so a bundler drops the module when nothing it exports is used. Move the statement into a function that the caller runs, or list the entry that exists for its effect in sideEffects.";
11461
11405
  const isEffect = (statement) => {
@@ -11466,10 +11410,10 @@ const messageOf$3 = (statement) => {
11466
11410
  if (isImportDeclaration(statement)) return IMPORT_MESSAGE;
11467
11411
  return STATEMENT_MESSAGE;
11468
11412
  };
11469
- const problemsIn$14 = (api) => (file) => (source) => {
11413
+ const problemsIn$12 = (api) => (file) => (source) => {
11470
11414
  const retained = api.createSourceFile(file, source);
11471
11415
  const problems = pipe(retained.sourceFile.statements, Array.fromIterable, Array.filter(isEffect), Array.map((statement) => problemAt$8({
11472
- rule: RULE$36,
11416
+ rule: RULE$34,
11473
11417
  message: messageOf$3(statement)
11474
11418
  })(statement)));
11475
11419
  retained.dispose();
@@ -11482,7 +11426,7 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
11482
11426
  const names = yield* files.ownedFiles(root);
11483
11427
  const owned = new Set(pipe(names, Array.map((name) => files.join(root, name))));
11484
11428
  const sources = pipe(modules, Array.filter((file) => owned.has(file) && CODE$1.test(file)));
11485
- const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$14(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$12 });
11429
+ const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$12(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$11 });
11486
11430
  return Array.flatten(found);
11487
11431
  }, Effect.scoped);
11488
11432
  // src/features/check-tree-shaking/model/usage.ts
@@ -11593,7 +11537,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
11593
11537
  return Array.flatten(found);
11594
11538
  });
11595
11539
  // src/features/check-typescript-generation/model/typescript-generation.ts
11596
- const RULE$35 = "legacy-typescript";
11540
+ const RULE$33 = "legacy-typescript";
11597
11541
  const LOCKFILE = "pnpm-lock.yaml";
11598
11542
  const COMPILER = "typescript";
11599
11543
  const CURRENT_MAJOR = 7;
@@ -11624,12 +11568,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
11624
11568
  file,
11625
11569
  line: lineOf$2(source)(legacy.id),
11626
11570
  column: FIRST$7,
11627
- rule: RULE$35,
11571
+ rule: RULE$33,
11628
11572
  message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
11629
11573
  })));
11630
11574
  });
11631
11575
  // src/features/check-worker-bundles/model/worker-bundles.ts
11632
- const RULE$34 = "worker-bundle";
11576
+ const RULE$32 = "worker-bundle";
11633
11577
  const BUNDLE_CONCURRENCY = 4;
11634
11578
  const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
11635
11579
  const CONDITIONS = [
@@ -11640,8 +11584,8 @@ const CONDITIONS = [
11640
11584
  "module",
11641
11585
  "default"
11642
11586
  ];
11643
- const problemFor$2 = problemInFile(RULE$34);
11644
- const problemOf$7 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
11587
+ const problemFor$1 = problemInFile(RULE$32);
11588
+ const problemOf$7 = (file, detail) => problemFor$1(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
11645
11589
  const bundleProblem = (file) => Effect.gen(function* bundle() {
11646
11590
  const built = yield* Effect.tryPromise({
11647
11591
  try: () => rolldown({
@@ -11754,7 +11698,7 @@ const specifierOf$1 = (statement) => {
11754
11698
  if (!isImportDeclaration(statement) && !isExportDeclaration(statement)) return Option.none();
11755
11699
  return Option.fromUndefinedOr(statement.moduleSpecifier).pipe(Option.filter(isStringLiteral));
11756
11700
  };
11757
- const importedFilesOf = (checker) => (sourceFile) => pipe(sourceFile.statements, Array.map(specifierOf$1), Array.getSomes, Array.flatMap((specifier) => pipe(Option.fromUndefinedOr(checker.getSymbolAtLocation(specifier)), Option.flatMap((symbol) => Array.head(declarationsOf(symbol))), Option.map((declaration) => declaration.getSourceFile().fileName), Option.toArray)), Array.dedupe);
11701
+ const importedFilesOf = (checker) => (sourceFile) => pipe(sourceFile.statements, Array.map(specifierOf$1), Array.getSomes, Array.flatMap((specifier) => pipe(symbolAtLocation(checker)(specifier), Option.flatMap((symbol) => Array.head(declarationsOf(symbol))), Option.map((declaration) => declaration.getSourceFile().fileName), Option.toArray)), Array.dedupe);
11758
11702
  const freeLiteralsIn = (checker) => (sourceFile, excluded) => pipe(descendantsOf(sourceFile), Array.filter((node) => isStringLiteral(node)), Array.filter((node) => NAME.test(node.text)), Array.filter(isDefinition), Array.filter((node) => !isModuleSpecifier(node)), Array.filter((node) => !isInsideAny(excluded)(node) && !isTyped(checker)(node)), Array.map((node) => node.text), Array.dedupe);
11759
11703
  const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Array.map((sourceFile) => ({
11760
11704
  file: sourceFile.fileName,
@@ -11762,7 +11706,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
11762
11706
  imports: importedFilesOf(checker)(sourceFile)
11763
11707
  })), Array.filter((facts) => Array.isReadonlyArrayNonEmpty(facts.values) || Array.isReadonlyArrayNonEmpty(facts.imports)));
11764
11708
  // src/features/check-value-owners/model/name-lists.ts
11765
- const RULE$33 = "hand-written-names";
11709
+ const RULE$31 = "hand-written-names";
11766
11710
  const TEST_FILE = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
11767
11711
  const nameListOf = (site) => {
11768
11712
  if (TEST_FILE.test(site.file) || site.values.length < 2) return Option.none();
@@ -11777,7 +11721,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
11777
11721
  file,
11778
11722
  line,
11779
11723
  column,
11780
- rule: RULE$33,
11724
+ rule: RULE$31,
11781
11725
  message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
11782
11726
  });
11783
11727
  const problemOf$6 = ({ list, reason }) => listedProblem({
@@ -11953,10 +11897,9 @@ const shapeSitesIn = (checker) => (sourceFile) => Array.getSomes(pipe(descendant
11953
11897
  }))))));
11954
11898
  const isIndexedDeclaration = (node) => isTypeDeclaration(node) || isVariableDeclaration(node);
11955
11899
  const declarationAt = (program) => (location) => Option.fromUndefinedOr(program.getSourceFile(location.file)).pipe(Option.flatMap((sourceFile) => Array.findFirst(descendantsOf(sourceFile), (node) => node.pos === location.pos && node.kind === location.kind && isIndexedDeclaration(node))));
11956
- const symbolOfDeclaration = (checker) => (declaration) => Option.fromUndefinedOr(checker.getSymbolAtLocation(declaration.name));
11957
11900
  const shapeTypeOf = (context) => (shape) => {
11958
11901
  const { checker } = context;
11959
- return declarationAt(context.program)(shape.declaration).pipe(Option.flatMap((declaration) => symbolOfDeclaration(checker)(declaration).pipe(Option.flatMap((symbol) => {
11902
+ return declarationAt(context.program)(shape.declaration).pipe(Option.flatMap((declaration) => symbolAtLocation(checker)(declaration.name).pipe(Option.flatMap((symbol) => {
11960
11903
  if (shape.form === "declared") return Option.some(checker.getDeclaredTypeOfSymbol(symbol));
11961
11904
  return schemaTypeOf(checker)(checker.getTypeOfSymbolAtLocation(symbol, declaration));
11962
11905
  }))));
@@ -12035,7 +11978,7 @@ const selectsKeys = (checker) => (node, values) => {
12035
11978
  return pipe(typeArguments, Array.filter((argument) => argument !== node), Array.some((argument) => isSubsetOf(values, propertyNamesOf(checker)(checker.getTypeFromTypeNode(argument)))));
12036
11979
  };
12037
11980
  const FILTERED_TYPE = 0;
12038
- const isConditionalAlias = (checker) => (reference) => isTypeReferenceNode(reference) && Option.fromUndefinedOr(checker.getSymbolAtLocation(reference.typeName)).pipe(Option.map(declarationsOf), Option.exists(Array.some((declaration) => isTypeAliasDeclaration(declaration) && declaration.type.kind === SyntaxKind.ConditionalType)));
11981
+ const isConditionalAlias = (checker) => (reference) => isTypeReferenceNode(reference) && symbolAtLocation(checker)(reference.typeName).pipe(Option.map(declarationsOf), Option.exists(Array.some((declaration) => isTypeAliasDeclaration(declaration) && declaration.type.kind === SyntaxKind.ConditionalType)));
12039
11982
  const filtersBy = (checker) => (node) => {
12040
11983
  const { parent } = node;
12041
11984
  if (isTypeReferenceNode(parent)) {
@@ -12461,13 +12404,13 @@ const MANIFEST$3 = "package.json";
12461
12404
  const SEPARATOR$5 = "/";
12462
12405
  const FIRST_SEGMENT = 1;
12463
12406
  const ManifestJson = Schema.fromJsonString(Schema.Struct({ name: Schema.optionalKey(Schema.String) }));
12464
- const decodeManifest$6 = Schema.decodeUnknownOption(ManifestJson);
12407
+ const decodeManifest$4 = Schema.decodeUnknownOption(ManifestJson);
12465
12408
  const prefixesOf = (file) => {
12466
12409
  const segments = pipe(file, String$1.split(SEPARATOR$5));
12467
12410
  return pipe(Array.range(FIRST_SEGMENT, segments.length), Array.map((count) => pipe(Array.take(segments, count), Array.join(SEPARATOR$5))));
12468
12411
  };
12469
12412
  const directoriesOf$1 = (file) => pipe(prefixesOf(file), Array.dropRight(FIRST_SEGMENT));
12470
- const nameOf = (text) => pipe(text, Option.flatMap(decodeManifest$6), Option.flatMap((parsed) => Option.fromUndefinedOr(parsed.name)));
12413
+ const nameOf = (text) => pipe(text, Option.flatMap(decodeManifest$4), Option.flatMap((parsed) => Option.fromUndefinedOr(parsed.name)));
12471
12414
  const repositoryNamesOf = Effect.fn("repositoryNamesOf")(function* repositoryNamesOf(root) {
12472
12415
  const files = yield* RepositoryFiles;
12473
12416
  const listed = yield* files.listedFiles(root);
@@ -12579,7 +12522,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
12579
12522
  return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
12580
12523
  }, Effect.scoped);
12581
12524
  // src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
12582
- const RULE$32 = "namespace-destructuring";
12525
+ const RULE$30 = "namespace-destructuring";
12583
12526
  const LOCAL = /^[.#/]/u;
12584
12527
  const messageOf$1 = (name) => `Destructuring ${name}, which comes from a package, makes the bundler keep everything ${name} exports. Write ${name}.<member> where it is used.`;
12585
12528
  const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
@@ -12595,7 +12538,7 @@ const destructuredName = (declaration) => {
12595
12538
  return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
12596
12539
  };
12597
12540
  const problemOf$5 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$8({
12598
- rule: RULE$32,
12541
+ rule: RULE$30,
12599
12542
  message: messageOf$1(name)
12600
12543
  })), Option.map((report) => report(declaration)));
12601
12544
  const namespaceDestructuringIn = () => (sourceFile) => {
@@ -12603,7 +12546,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
12603
12546
  return pipe(descendantsOf(sourceFile), Array.filter(isVariableDeclaration), Array.map(problemOf$5(names)), Array.getSomes);
12604
12547
  };
12605
12548
  // src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
12606
- const RULE$31 = "pass-through-wrapper";
12549
+ const RULE$29 = "pass-through-wrapper";
12607
12550
  const SINGLE_STATEMENT = 1;
12608
12551
  const SINGLE_DECLARATION = 1;
12609
12552
  const THIS_PARAMETER = "this";
@@ -12689,7 +12632,7 @@ const keepsTheReturnType = (checker) => (wrapper, forward) => Option.match(Optio
12689
12632
  onNone: () => true,
12690
12633
  onSome: (type) => checker.getTypeAtLocation(type).id === checker.getTypeAtLocation(forward.node).id
12691
12634
  });
12692
- const isOverloaded = (checker) => (name) => Option.exists(Option.fromUndefinedOr(checker.getSymbolAtLocation(name)), (symbol) => symbol.declarations.length > SINGLE_DECLARATION);
12635
+ const isOverloaded = (checker) => (name) => Option.exists(symbolAtLocation(checker)(name), (symbol) => symbol.declarations.length > SINGLE_DECLARATION);
12693
12636
  const callsAnotherFunction = ({ name }, forward, names) => Option.exists(rootOf(forward.callee), (root) => root.text !== name.text && !names.includes(root.text));
12694
12637
  const isPassThrough = (checker) => (candidate) => (forward) => {
12695
12638
  const { wrapper, name } = candidate;
@@ -12700,7 +12643,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
12700
12643
  const problemOf$4 = (checker) => (candidate) => {
12701
12644
  if (changesTheCall(candidate.wrapper)) return Option.none();
12702
12645
  return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$8({
12703
- rule: RULE$31,
12646
+ rule: RULE$29,
12704
12647
  message: messageOf(forward.callee.getText())
12705
12648
  })(candidate.name)));
12706
12649
  };
@@ -12726,7 +12669,7 @@ var plugins = [{
12726
12669
  "description": "CLI for watashi (watashi.masseater.dev). Sends Claude Code transcripts from a Stop hook after masking secrets locally with h56m, and manages login and API tokens."
12727
12670
  }];
12728
12671
  // src/features/check-agent-settings/model/known-plugins.ts
12729
- const RULE$30 = "known-plugins";
12672
+ const RULE$28 = "known-plugins";
12730
12673
  const SETTINGS_FILE$2 = ".claude/settings.json";
12731
12674
  const GITHUB$2 = "github";
12732
12675
  const Source$1 = Schema.Struct({
@@ -12744,7 +12687,7 @@ const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Settin
12744
12687
  const REPOSITORY_NAME = "masseater/masseater.dev";
12745
12688
  const MARKETPLACE = name;
12746
12689
  const PLUGINS = pipe(plugins, Array.map(({ name }) => `${name}@${MARKETPLACE}`));
12747
- const problem$1 = problemInFile(RULE$30);
12690
+ const problem$1 = problemInFile(RULE$28);
12748
12691
  const fromGithub = ({ source }) => source.source === GITHUB$2 && source.repo === REPOSITORY_NAME;
12749
12692
  const marketplaceKnown = (settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(MARKETPLACE)), Option.exists(fromGithub));
12750
12693
  const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
@@ -12765,20 +12708,20 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
12765
12708
  return [...marketplaceProblems(file, settings), ...pluginProblems(file, settings)];
12766
12709
  });
12767
12710
  // src/features/check-agent-settings/model/missing-hooks.ts
12768
- const RULE$29 = "missing-hook";
12711
+ const RULE$27 = "missing-hook";
12769
12712
  const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
12770
12713
  const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
12771
12714
  const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
12772
12715
  const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
12773
12716
  const PLUGIN_ROOT = "..";
12774
- const READ_CONCURRENCY$11 = 16;
12775
- const START$17 = 0;
12717
+ const READ_CONCURRENCY$10 = 16;
12718
+ const START$16 = 0;
12776
12719
  const referenceOf$1 = (found) => pipe(groupOf$2("path")(found), Option.filter(() => Option.isNone(groupOf$2("optional")(found))), Option.map((path) => ({
12777
12720
  path,
12778
- index: found.index ?? START$17
12721
+ index: found.index ?? START$16
12779
12722
  })), Option.toArray);
12780
12723
  const referencesIn$1 = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap(referenceOf$1));
12781
- const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
12724
+ const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
12782
12725
  const files = yield* RepositoryFiles;
12783
12726
  const text = yield* files.readFile(file);
12784
12727
  if (Option.isNone(text)) return [];
@@ -12790,7 +12733,7 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
12790
12733
  return pipe(missing, Array.map(({ path, index }) => ({
12791
12734
  file,
12792
12735
  ...positionOf(source)(index),
12793
- rule: RULE$29,
12736
+ rule: RULE$27,
12794
12737
  message: `runs ${path}, which does not exist. The hook fails every time it fires. Point it at a file that exists or remove the hook.`
12795
12738
  })));
12796
12739
  });
@@ -12814,7 +12757,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
12814
12757
  }];
12815
12758
  return [];
12816
12759
  }));
12817
- const found = yield* Effect.forEach(hookFiles, problemsIn$13, { concurrency: READ_CONCURRENCY$11 });
12760
+ const found = yield* Effect.forEach(hookFiles, problemsIn$11, { concurrency: READ_CONCURRENCY$10 });
12818
12761
  return Array.flatten(found);
12819
12762
  });
12820
12763
  // src/features/check-documented-commands/model/task-graph.ts
@@ -12843,7 +12786,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
12843
12786
  }, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
12844
12787
  const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
12845
12788
  // src/features/check-documented-commands/model/commands.ts
12846
- const RULE$28 = "documented-commands";
12789
+ const RULE$26 = "documented-commands";
12847
12790
  const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
12848
12791
  const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
12849
12792
  const COMMAND = /`vp run (?<args>[^`]+)`/gu;
@@ -12862,7 +12805,7 @@ const FILTER_ASSIGNMENT = "--filter=";
12862
12805
  const RECURSIVE_FLAGS = /* @__PURE__ */ new Set(["-r", "--recursive"]);
12863
12806
  const ROOT_FLAGS = /* @__PURE__ */ new Set(["-w", "--workspace-root"]);
12864
12807
  const ONE$1 = 1;
12865
- const START$16 = 0;
12808
+ const START$15 = 0;
12866
12809
  const optionsOf = (args) => pipe(String$1.split(String$1.trim(args), WHITESPACE), Array.takeWhile((token) => token !== END_OF_OPTIONS));
12867
12810
  const filterOf = (tokens) => pipe(tokens, Array.findFirstIndex((token) => FILTER_FLAGS.has(token)), Option.flatMap((index) => Array.get(tokens, index + ONE$1)), Option.orElse(() => pipe(tokens, Array.findFirst(String$1.startsWith(FILTER_ASSIGNMENT)), Option.map(String$1.slice(9)))));
12868
12811
  const follows = (tokens) => (index) => pipe(Array.get(tokens, index - ONE$1), Option.exists((previous) => FILTER_FLAGS.has(previous)));
@@ -12918,11 +12861,11 @@ const whereOf = (scope, file) => {
12918
12861
  return `the package that holds ${file}`;
12919
12862
  };
12920
12863
  const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph, file)(scope), Array.some(hasTask(graph, task)));
12921
- const problemsIn$12 = (graph, absolute, { file, text }) => pipe(Array.fromIterable(String$1.matchAll(COMMAND)(text)), Array.flatMap((match) => pipe(Option.fromNullishOr(match.groups), Option.flatMap(Record.get(ARGS)), Option.flatMap(parsed), Option.filter(isMissing(graph, file)), Option.map(({ task, scope }) => ({
12864
+ const problemsIn$10 = (graph, absolute, { file, text }) => pipe(Array.fromIterable(String$1.matchAll(COMMAND)(text)), Array.flatMap((match) => pipe(Option.fromNullishOr(match.groups), Option.flatMap(Record.get(ARGS)), Option.flatMap(parsed), Option.filter(isMissing(graph, file)), Option.map(({ task, scope }) => ({
12922
12865
  file: absolute(file),
12923
- ...positionOf(text)(match.index ?? START$16),
12924
- rule: RULE$28,
12925
- message: `${match[START$16]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
12866
+ ...positionOf(text)(match.index ?? START$15),
12867
+ rule: RULE$26,
12868
+ message: `${match[START$15]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
12926
12869
  })), Option.toArray)));
12927
12870
  const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$4), Array.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
12928
12871
  /** @internal */
@@ -12946,14 +12889,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
12946
12889
  file: absolute(Array.headNonEmpty(commanded).file),
12947
12890
  line: ONE$1,
12948
12891
  column: ONE$1,
12949
- rule: RULE$28,
12892
+ rule: RULE$26,
12950
12893
  message: "msch could not list the tasks with `vp run --json`"
12951
12894
  }],
12952
- onSome: (found) => pipe(commanded, Array.flatMap((document) => problemsIn$12(found, absolute, document)))
12895
+ onSome: (found) => pipe(commanded, Array.flatMap((document) => problemsIn$10(found, absolute, document)))
12953
12896
  });
12954
12897
  });
12955
12898
  // src/features/check-legacy-web/model/legacy-web.ts
12956
- const RULE$27 = "legacy-web";
12899
+ const RULE$25 = "legacy-web";
12957
12900
  const FIRST_COLUMN$3 = 1;
12958
12901
  const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
12959
12902
  const Finding = Schema.Struct({
@@ -12992,15 +12935,15 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
12992
12935
  file: files.join(root, file),
12993
12936
  line,
12994
12937
  column: FIRST_COLUMN$3,
12995
- rule: RULE$27,
12938
+ rule: RULE$25,
12996
12939
  message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
12997
12940
  });
12998
12941
  return pipe(scan.guides, Array.flatMap(({ guideId, rules }) => pipe(rules, Array.flatMap(({ ruleId, findings }) => pipe(findings, Array.map(problemOf(guideId, ruleId)))))));
12999
12942
  });
13000
12943
  // src/shared/lib/section-check.ts
13001
- const taggedError$4 = Schema.TaggedError;
13002
- var SectionConfigUnreadable = class extends taggedError$4()("SectionConfigUnreadable", { file: Schema.String }) {};
13003
- const CONFIG_FILE$3 = "vite.config.ts";
12944
+ const taggedError$3 = Schema.TaggedError;
12945
+ var SectionConfigUnreadable = class extends taggedError$3()("SectionConfigUnreadable", { file: Schema.String }) {};
12946
+ const CONFIG_FILE$2 = "vite.config.ts";
13004
12947
  const FIRST$6 = 1;
13005
12948
  const ONE = 1;
13006
12949
  const diagnostics = Metric.counter("lint.diagnostics", { description: "Diagnostics that each lint rule reported, before msch keeps only the errors" });
@@ -13022,7 +12965,7 @@ const sectionAt = (file, pick) => Effect.gen(function* readSection() {
13022
12965
  });
13023
12966
  const checkSection = (check) => (root) => Effect.gen(function* runSection() {
13024
12967
  const files = yield* RepositoryFiles;
13025
- const configFile = files.join(root, CONFIG_FILE$3);
12968
+ const configFile = files.join(root, CONFIG_FILE$2);
13026
12969
  const section = yield* sectionAt(configFile, check.pick);
13027
12970
  if (Option.isNone(section)) return [];
13028
12971
  const config = section.value;
@@ -13062,9 +13005,9 @@ const SHELL_FILE = /\.(?:sh|bash|zsh|ksh|fish|command)$/u;
13062
13005
  const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|^#!\S*fish\b/u;
13063
13006
  const EXTENSION = /\.[^./]+$/u;
13064
13007
  const SETTINGS_FILE = ".claude/settings.json";
13065
- const READ_CONCURRENCY$10 = 64;
13066
- const RULE$26 = "shell-script";
13067
- const MESSAGE$11 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only the SessionStart hook in .claude/settings.json, which installs the toolchain before TypeScript can run, stays a shell script.";
13008
+ const READ_CONCURRENCY$9 = 64;
13009
+ const RULE$24 = "shell-script";
13010
+ const MESSAGE$10 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only the SessionStart hook in .claude/settings.json, which installs the toolchain before TypeScript can run, stays a shell script.";
13068
13011
  const HookSchema = Schema.Struct({
13069
13012
  command: Schema.optional(Schema.String),
13070
13013
  args: Schema.String.pipe(Schema.Array, Schema.optional)
@@ -13095,12 +13038,12 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
13095
13038
  return files.readFile(file).pipe(Effect.map(Option.exists((source) => SHELL_SHEBANG.test(source))));
13096
13039
  };
13097
13040
  const candidates = pipe(names, Array.filter((name) => !isSessionStartHook(name)));
13098
- const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$10 });
13099
- return pipe(shell, Array.map((name) => problemInFile(RULE$26)(files.join(root, name), MESSAGE$11)));
13041
+ const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$9 });
13042
+ return pipe(shell, Array.map((name) => problemInFile(RULE$24)(files.join(root, name), MESSAGE$10)));
13100
13043
  });
13101
13044
  // src/shared/lib/workflow-files.ts
13102
13045
  const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
13103
- const READ_CONCURRENCY$9 = 16;
13046
+ const READ_CONCURRENCY$8 = 16;
13104
13047
  const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
13105
13048
  const files = yield* RepositoryFiles;
13106
13049
  const names = yield* files.listedFiles(root);
@@ -13110,13 +13053,13 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
13110
13053
  file,
13111
13054
  source
13112
13055
  }))));
13113
- }, { concurrency: READ_CONCURRENCY$9 });
13056
+ }, { concurrency: READ_CONCURRENCY$8 });
13114
13057
  return Array.getSomes(found);
13115
13058
  });
13116
13059
  // src/shared/lib/workflow-run.ts
13117
13060
  const RUN_KEY = "run";
13118
- const START$15 = 0;
13119
- const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$15));
13061
+ const START$14 = 0;
13062
+ const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$14));
13120
13063
  const runScriptsOf = (source) => {
13121
13064
  const found = [];
13122
13065
  visit(parseDocument(source), { Pair: (_key, pair) => {
@@ -13131,23 +13074,23 @@ const runScriptsOf = (source) => {
13131
13074
  const COMMAND_CHAIN = /&&|\|\||;|\|/u;
13132
13075
  const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
13133
13076
  const COMMENT = "#";
13134
- const RULE$25 = "workflow-script";
13077
+ const RULE$23 = "workflow-script";
13135
13078
  const ONE_COMMAND = 1;
13136
- const MESSAGE$10 = "runs more than one command. Keep a step to one command, `vp run <task>` or `vp exec <bin>`, and put the logic in a Vite+ task in TypeScript.";
13079
+ const MESSAGE$9 = "runs more than one command. Keep a step to one command, `vp run <task>` or `vp exec <bin>`, and put the logic in a Vite+ task in TypeScript.";
13137
13080
  const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
13138
13081
  const chainsCommands = (line) => COMMAND_CHAIN.test(String$1.replaceAll(QUOTED$1, "")(line));
13139
13082
  const runsMoreThanOneCommand = ({ text }) => {
13140
13083
  const lines = pipe(String$1.split("\n")(text), Array.map(String$1.trim), Array.filter(isCommand));
13141
13084
  return lines.length > ONE_COMMAND || pipe(lines, Array.some(chainsCommands));
13142
13085
  };
13143
- const problemsIn$11 = (file) => (source) => {
13086
+ const problemsIn$9 = (file) => (source) => {
13144
13087
  const at = positionOf(source);
13145
- return pipe(runScriptsOf(source), Array.filter(runsMoreThanOneCommand), Array.map(({ start }) => problemAtPosition(RULE$25)(file, at(start), MESSAGE$10)));
13088
+ return pipe(runScriptsOf(source), Array.filter(runsMoreThanOneCommand), Array.map(({ start }) => problemAtPosition(RULE$23)(file, at(start), MESSAGE$9)));
13146
13089
  };
13147
13090
  /** @internal */
13148
13091
  const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
13149
13092
  const workflows = yield* readWorkflows(root);
13150
- return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$11(file)(source)));
13093
+ return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$9(file)(source)));
13151
13094
  });
13152
13095
  // src/features/check-scripts/model/script-checks.ts
13153
13096
  /** @internal */
@@ -13257,27 +13200,27 @@ const docSources = (file) => (source) => {
13257
13200
  })));
13258
13201
  };
13259
13202
  // src/features/check-vite-plus/model/command-sources.ts
13260
- const ROOT_DIRECTORY$2 = ".";
13203
+ const ROOT_DIRECTORY$1 = ".";
13261
13204
  const COMMAND_KEY = "command";
13262
13205
  const ARGUMENTS_KEY = "args";
13263
- const EXCLUDED$5 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
13264
- const MANIFESTS = [`:(glob)**/${MANIFEST_FILE$3}`, ...EXCLUDED$5];
13206
+ const EXCLUDED$4 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
13207
+ const MANIFESTS = [`:(glob)**/${MANIFEST_FILE$3}`, ...EXCLUDED$4];
13265
13208
  const STEP_FILES = [
13266
13209
  ":(glob).github/workflows/*.yml",
13267
13210
  ":(glob).github/workflows/*.yaml",
13268
13211
  ":(glob)**/action.yml",
13269
13212
  ":(glob)**/action.yaml",
13270
- ...EXCLUDED$5
13213
+ ...EXCLUDED$4
13271
13214
  ];
13272
13215
  const HOOK_FILES = [":(glob).vite-hooks/*"];
13273
13216
  const AGENT_FILES = [".claude/settings.json", ".mcp.json"];
13274
13217
  const AGENT_DOCS = [
13275
13218
  ":(glob)**/AGENTS.md",
13276
13219
  ":(glob)**/CLAUDE.md",
13277
- ...EXCLUDED$5
13220
+ ...EXCLUDED$4
13278
13221
  ];
13279
- const READ_CONCURRENCY$8 = 16;
13280
- const START$14 = 0;
13222
+ const READ_CONCURRENCY$7 = 16;
13223
+ const START$13 = 0;
13281
13224
  const FIRST$5 = 1;
13282
13225
  const LINE = "\n";
13283
13226
  const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
@@ -13287,7 +13230,7 @@ const decodeScripts = Schema.decodeUnknownOption(Schema.fromJsonString(Scripts))
13287
13230
  const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
13288
13231
  const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
13289
13232
  const NO_SOURCES = [];
13290
- const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$14));
13233
+ const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$13));
13291
13234
  const scriptSources = (file) => (source) => pipe(decodeScripts(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array.map(([name, text]) => {
13292
13235
  const offset = offsetOf$2(source, `"${name}"`);
13293
13236
  return {
@@ -13347,7 +13290,7 @@ const taskSources = Effect.fn("taskSources")(function* taskSources(root, directo
13347
13290
  return pipe(tasks, Array.flatMap((task) => Option.toArray(taskSource(file, source)(task))));
13348
13291
  });
13349
13292
  const workspaceTasks = Effect.fn("workspaceTasks")(function* workspaceTasks(root, directories) {
13350
- const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$8 });
13293
+ const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$7 });
13351
13294
  return Array.flatten(found);
13352
13295
  });
13353
13296
  const readSources = Effect.fn("readSources")(function* readSources(root, names, sourcesOf) {
@@ -13359,7 +13302,7 @@ const readSources = Effect.fn("readSources")(function* readSources(root, names,
13359
13302
  onSome: sourcesOf(file, name)
13360
13303
  });
13361
13304
  return files.readFile(file).pipe(Effect.map(sourcesIn));
13362
- }, { concurrency: READ_CONCURRENCY$8 });
13305
+ }, { concurrency: READ_CONCURRENCY$7 });
13363
13306
  return Array.flatten(found);
13364
13307
  });
13365
13308
  /** @internal */
@@ -13378,12 +13321,12 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
13378
13321
  readSources(root, hooks, hookSources),
13379
13322
  readSources(root, AGENT_FILES, agentSources),
13380
13323
  readSources(root, docs, docSources),
13381
- workspaceTasks(root, Array.dedupe([ROOT_DIRECTORY$2, ...workspaces]))
13324
+ workspaceTasks(root, Array.dedupe([ROOT_DIRECTORY$1, ...workspaces]))
13382
13325
  ], { concurrency: "unbounded" });
13383
13326
  return Array.flatten(found);
13384
13327
  });
13385
13328
  // src/features/check-vite-plus/model/package-scripts.ts
13386
- const RULE$24 = "package-script";
13329
+ const RULE$22 = "package-script";
13387
13330
  const LIFECYCLE = [
13388
13331
  "preinstall",
13389
13332
  "install",
@@ -13406,26 +13349,26 @@ const LIFECYCLE = [
13406
13349
  const problemOf$3 = ({ file, position, name }) => ({
13407
13350
  file,
13408
13351
  ...position,
13409
- rule: RULE$24,
13352
+ rule: RULE$22,
13410
13353
  message: `The script ${name} is not a lifecycle script. package.json scripts hold only the scripts the package manager runs by itself, such as prepare and prepack. Write ${name} as a task in run.tasks of this package's vite.config.ts, where its shape is type-checked.`
13411
13354
  });
13412
13355
  const packageScriptProblems = (sources) => pipe(sources, Array.filter(({ kind, name }) => kind === "script" && !Array.contains(LIFECYCLE, name)), Array.map(problemOf$3));
13413
13356
  // src/features/check-vite-plus/model/vite-plus-block.ts
13414
- const RULE$23 = "vite-plus-block";
13357
+ const RULE$21 = "vite-plus-block";
13415
13358
  const MARKER = Array.join([
13416
13359
  "<!--",
13417
13360
  "VITE PLUS START",
13418
13361
  "-->"
13419
13362
  ], "");
13420
- const MESSAGE$9 = "holds the Vite+ block that `vp create --agent` and `vp migrate --agent` write, and every `vp config` rewrites it. Delete the block with its markers. The vite-plus skill reads the same guidance from node_modules/vite-plus/AGENTS.md.";
13363
+ const MESSAGE$8 = "holds the Vite+ block that `vp create --agent` and `vp migrate --agent` write, and every `vp config` rewrites it. Delete the block with its markers. The vite-plus skill reads the same guidance from node_modules/vite-plus/AGENTS.md.";
13421
13364
  const problemIn = (file) => (source) => {
13422
13365
  const index = String$1.indexOf(MARKER)(source);
13423
13366
  if (Option.isNone(index)) return Option.none();
13424
13367
  return Option.some({
13425
13368
  file,
13426
13369
  ...positionOf(source)(index.value),
13427
- rule: RULE$23,
13428
- message: MESSAGE$9
13370
+ rule: RULE$21,
13371
+ message: MESSAGE$8
13429
13372
  });
13430
13373
  };
13431
13374
  /** @internal */
@@ -13480,11 +13423,11 @@ const checkFullHistoryCheckout = workflowCheck({
13480
13423
  })
13481
13424
  });
13482
13425
  // src/features/check-workflows/model/publish-trigger.ts
13483
- const RULE$21 = "publish-trigger";
13426
+ const RULE$19 = "publish-trigger";
13484
13427
  const PUBLISH = /\bmsch-publish\s+(?:plan|npm|release)\b/u;
13485
13428
  const MANUAL = "workflow_dispatch";
13486
13429
  const TRIGGER_KEY = "on";
13487
- const MESSAGE$7 = "publishes with `msch-publish plan`, `npm` or `release` from a trigger other than `workflow_dispatch`. Publishing is manual: bump the version in a PR, then dispatch the workflow for the workspace.";
13430
+ const MESSAGE$6 = "publishes with `msch-publish plan`, `npm` or `release` from a trigger other than `workflow_dispatch`. Publishing is manual: bump the version in a PR, then dispatch the workflow for the workspace.";
13488
13431
  const triggersOf = (node) => {
13489
13432
  if (isScalar(node)) return [String(node.value)];
13490
13433
  if (isSeq(node)) return pipe(node.items, Array.filter(isScalar), Array.map((item) => String(item.value)));
@@ -13500,19 +13443,19 @@ const publishTriggerOffsetsOf = (source) => {
13500
13443
  };
13501
13444
  /** @internal */
13502
13445
  const checkPublishTrigger = workflowCheck({
13503
- rule: RULE$21,
13504
- message: MESSAGE$7,
13446
+ rule: RULE$19,
13447
+ message: MESSAGE$6,
13505
13448
  offsetsOf: publishTriggerOffsetsOf
13506
13449
  });
13507
13450
  // src/features/check-workflows/model/release-please.ts
13508
- const RULE$20 = "release-please";
13451
+ const RULE$18 = "release-please";
13509
13452
  const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
13510
13453
  const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
13511
13454
  const FIRST$4 = 1;
13512
- const MESSAGE$6 = "releases with release-please. Releases are manual: bump the version in a PR, then run the publish workflow, which runs `msch-publish` for the workspace.";
13455
+ const MESSAGE$5 = "releases with release-please. Releases are manual: bump the version in a PR, then run the publish workflow, which runs `msch-publish` for the workspace.";
13513
13456
  const checkReleasePleaseSteps = workflowCheck({
13514
- rule: RULE$20,
13515
- message: MESSAGE$6,
13457
+ rule: RULE$18,
13458
+ message: MESSAGE$5,
13516
13459
  offsetsOf: scalarKeyOffsets({
13517
13460
  name: "uses",
13518
13461
  matches: (value) => RELEASE_PLEASE.test(value)
@@ -13525,8 +13468,8 @@ const checkReleasePleaseFiles = Effect.fn("checkReleasePleaseFiles")(function* c
13525
13468
  file: files.join(root, name),
13526
13469
  line: FIRST$4,
13527
13470
  column: FIRST$4,
13528
- rule: RULE$20,
13529
- message: MESSAGE$6
13471
+ rule: RULE$18,
13472
+ message: MESSAGE$5
13530
13473
  })));
13531
13474
  });
13532
13475
  /** @internal */
@@ -13537,26 +13480,26 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
13537
13480
  // src/features/check-workflows/model/workflow-queue.ts
13538
13481
  const CONCURRENCY_KEY = "concurrency";
13539
13482
  const QUEUE_KEY = "queue";
13540
- const RULE$19 = "workflow-queue";
13541
- const MESSAGE$5 = "queues runs with `queue`. A queued group runs every old push one by one, so a long run holds back the newest commit for hours. Drop `queue`: a job that later pushes redo gets `cancel-in-progress: true`, and a deploy or release job keeps the default, which lets the running one finish and replaces the waiting one with the newest run.";
13483
+ const RULE$17 = "workflow-queue";
13484
+ const MESSAGE$4 = "queues runs with `queue`. A queued group runs every old push one by one, so a long run holds back the newest commit for hours. Drop `queue`: a job that later pushes redo gets `cancel-in-progress: true`, and a deploy or release job keeps the default, which lets the running one finish and replaces the waiting one with the newest run.";
13542
13485
  const queueOffsetsOf = (source) => pipe(pairsNamed(CONCURRENCY_KEY)(source), Array.flatMap((pair) => Option.toArray(keyOffsetIn(QUEUE_KEY)(pair.value))));
13543
13486
  /** @internal */
13544
13487
  const checkWorkflowQueues = workflowCheck({
13545
- rule: RULE$19,
13546
- message: MESSAGE$5,
13488
+ rule: RULE$17,
13489
+ message: MESSAGE$4,
13547
13490
  offsetsOf: queueOffsetsOf
13548
13491
  });
13549
13492
  // src/features/check-workflows/model/workflow-commits.ts
13550
- const RULE$18 = "workflow-commit";
13493
+ const RULE$16 = "workflow-commit";
13551
13494
  const GIT_WRITE = /\bgit\s+(?:-{1,2}\S+\s+(?:\S+\s+)?)*(?:commit|push)\b/u;
13552
13495
  const COMMIT_ACTION = /^[^@/]+\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;
13553
- const MESSAGE$4 = "commits or pushes from a workflow. A bot commit leaves generated files out of review and races the next push. Regenerate the files in a commit hook (for example `.vite-hooks/pre-commit`) so they land in the author's commit, and let CI only check that they are current.";
13496
+ const MESSAGE$3 = "commits or pushes from a workflow. A bot commit leaves generated files out of review and races the next push. Regenerate the files in a commit hook (for example `.vite-hooks/pre-commit`) so they land in the author's commit, and let CI only check that they are current.";
13554
13497
  const offsetsWhere = (name, pattern) => (source) => pipe(pairsNamed(name)(source), Array.filter(({ value }) => isScalar(value) && typeof value.value === "string" && pattern.test(value.value)), Array.flatMap(({ key }) => pipe(Option.liftPredicate(key, isScalar), Option.flatMap(({ range }) => Option.fromNullishOr(range)), Option.map(([start]) => start), Option.toArray)));
13555
13498
  const commitOffsetsOf = (source) => [...offsetsWhere("run", GIT_WRITE)(source), ...offsetsWhere("uses", COMMIT_ACTION)(source)];
13556
13499
  /** @internal */
13557
13500
  const checkWorkflowCommits = workflowCheck({
13558
- rule: RULE$18,
13559
- message: MESSAGE$4,
13501
+ rule: RULE$16,
13502
+ message: MESSAGE$3,
13560
13503
  offsetsOf: commitOffsetsOf
13561
13504
  });
13562
13505
  // src/features/check-workflows/model/workflow-lint.ts
@@ -13592,8 +13535,8 @@ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
13592
13535
  return Array.flatten(found);
13593
13536
  });
13594
13537
  // src/features/ban-comments/model/found-comment.ts
13595
- const taggedError$3 = Schema.TaggedError;
13596
- var CommentsUnreadable = class extends taggedError$3()("CommentsUnreadable", {
13538
+ const taggedError$2 = Schema.TaggedError;
13539
+ var CommentsUnreadable = class extends taggedError$2()("CommentsUnreadable", {
13597
13540
  reader: Schema.String,
13598
13541
  message: Schema.String
13599
13542
  }) {};
@@ -13656,7 +13599,7 @@ const COMMENT_NODES = [
13656
13599
  "block_comment",
13657
13600
  "multiline_comment"
13658
13601
  ];
13659
- const START$13 = 0;
13602
+ const START$12 = 0;
13660
13603
  const NEXT = 1;
13661
13604
  const NONE$1 = [];
13662
13605
  const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
@@ -13706,7 +13649,7 @@ const markupComment = (source) => (node) => {
13706
13649
  }];
13707
13650
  };
13708
13651
  const textComments = (grammars, grammar) => (text) => {
13709
- const shift = shifted(text.startIndex ?? START$13);
13652
+ const shift = shifted(text.startIndex ?? START$12);
13710
13653
  return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array.map(shift)));
13711
13654
  };
13712
13655
  const embeddedComments = (grammars) => (node) => {
@@ -13742,11 +13685,11 @@ const commentsWith = (grammars) => (reader, source) => {
13742
13685
  }[reader](source);
13743
13686
  };
13744
13687
  // src/features/ban-comments/model/comments.ts
13745
- const RULE$17 = "comment";
13746
- const CONFIG_FILE$2 = "vite.config.ts";
13688
+ const RULE$15 = "comment";
13689
+ const CONFIG_FILE$1 = "vite.config.ts";
13747
13690
  const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
13748
- const READ_CONCURRENCY$7 = 64;
13749
- const START$12 = 0;
13691
+ const READ_CONCURRENCY$6 = 64;
13692
+ const START$11 = 0;
13750
13693
  const READERS$1 = [
13751
13694
  [/\.(?:[cm]?jsx?)$/u, "javascript"],
13752
13695
  [/\.(?:[cm]?ts)$/u, "typescript"],
@@ -13778,7 +13721,7 @@ const SHEBANG = "#!";
13778
13721
  const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
13779
13722
  const VERSION = /^\s?v?\d[\w.+-]*$/u;
13780
13723
  const DELIMITERS = /^(?:\/\/|\/\*|<!--|<#|#|--)|(?:\*\/|-->|#>)$/gu;
13781
- const MESSAGE$3 = "Comments are not written in this repository. Say it with names and types in the code, put the reason in the commit message, and delete the comment.";
13724
+ const MESSAGE$2 = "Comments are not written in this repository. Say it with names and types in the code, put the reason in the commit message, and delete the comment.";
13782
13725
  const Patterns = Schema.Array(Schema.String);
13783
13726
  const CommentSettings = Schema.Struct({ allow: Patterns });
13784
13727
  const MschSettings = Schema.Struct({ comments: Schema.optional(CommentSettings) });
@@ -13792,8 +13735,8 @@ const NO_SETTINGS = {
13792
13735
  ignorePatterns: []
13793
13736
  };
13794
13737
  const NONE = [];
13795
- const taggedError$2 = Schema.TaggedError;
13796
- var CommentConfigUnreadable = class extends taggedError$2()("CommentConfigUnreadable", { file: Schema.String }) {};
13738
+ const taggedError$1 = Schema.TaggedError;
13739
+ var CommentConfigUnreadable = class extends taggedError$1()("CommentConfigUnreadable", { file: Schema.String }) {};
13797
13740
  const shebangReader = (source) => {
13798
13741
  if (!String$1.startsWith(SHEBANG)(source)) return Option.none();
13799
13742
  return pipe(SHEBANG_READERS, Array.findFirst(([pattern]) => pattern.test(source)));
@@ -13801,17 +13744,17 @@ const shebangReader = (source) => {
13801
13744
  const readerOf = (name, source) => pipe(READERS$1, Array.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
13802
13745
  const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
13803
13746
  const lineBefore = (source, index) => {
13804
- const lines = pipe(source, String$1.slice(START$12, index), String$1.split("\n"));
13747
+ const lines = pipe(source, String$1.slice(START$11, index), String$1.split("\n"));
13805
13748
  return Option.getOrElse(Array.last(lines), () => "");
13806
13749
  };
13807
13750
  const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
13808
- const isShebang = ({ index, text }) => index === START$12 && String$1.startsWith(SHEBANG)(text);
13751
+ const isShebang = ({ index, text }) => index === START$11 && String$1.startsWith(SHEBANG)(text);
13809
13752
  const isAllowed = (source, directives) => (comment) => isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment);
13810
13753
  const problemOf$2 = (file, source) => ({ index }) => ({
13811
13754
  file,
13812
13755
  ...positionOf(source)(index),
13813
- rule: RULE$17,
13814
- message: MESSAGE$3
13756
+ rule: RULE$15,
13757
+ message: MESSAGE$2
13815
13758
  });
13816
13759
  const settingsOf = ({ msch, lint }) => ({
13817
13760
  allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
@@ -13822,7 +13765,7 @@ const settingsOf = ({ msch, lint }) => ({
13822
13765
  });
13823
13766
  const rootSettings = Effect.fn("rootSettings")(function* rootSettings(root) {
13824
13767
  const files = yield* RepositoryFiles;
13825
- const file = files.join(root, CONFIG_FILE$2);
13768
+ const file = files.join(root, CONFIG_FILE$1);
13826
13769
  if (!(yield* files.exists(file))) return NO_SETTINGS;
13827
13770
  const config = yield* Effect.tryPromise({
13828
13771
  try: () => resolveConfigFromFile(file),
@@ -13859,13 +13802,13 @@ const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
13859
13802
  const toProblem = problemOf$2(file, source);
13860
13803
  return Option.match(readerOf(name, source), {
13861
13804
  onNone: () => Effect.succeed(NONE),
13862
- onSome: (reader) => comments(reader, source).pipe(Effect.map(Array.filter(kept)), Effect.map(Array.map(toProblem)), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed([problemInFile(RULE$17)(file, `msch could not read the comments in this file: ${message}`)])))
13805
+ onSome: (reader) => comments(reader, source).pipe(Effect.map(Array.filter(kept)), Effect.map(Array.map(toProblem)), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed([problemInFile(RULE$15)(file, `msch could not read the comments in this file: ${message}`)])))
13863
13806
  });
13864
13807
  };
13865
13808
  const found = yield* Effect.forEach(scanned, (entry) => files.readFile(entry.file).pipe(Effect.flatMap(Option.match({
13866
13809
  onNone: () => Effect.succeed(NONE),
13867
13810
  onSome: (source) => problemsIn(entry, source)
13868
- }))), { concurrency: READ_CONCURRENCY$7 });
13811
+ }))), { concurrency: READ_CONCURRENCY$6 });
13869
13812
  return Array.flatten(found);
13870
13813
  });
13871
13814
  // src/features/ban-tools/model/banned-tool.ts
@@ -13956,38 +13899,6 @@ const PYTHON = {
13956
13899
  };
13957
13900
  /** @internal */
13958
13901
  const checkPython = (root) => checkBannedTool(root, PYTHON);
13959
- // src/features/check-catalog-entries/model/uncataloged-dependencies.ts
13960
- const RULE$16 = "uncataloged-dependency";
13961
- const OWNED_ELSEWHERE = [
13962
- "catalog:",
13963
- "workspace:",
13964
- "link:",
13965
- "file:"
13966
- ];
13967
- const ROOT_DIRECTORY$1 = ".";
13968
- const PLUGIN_MANIFEST$1 = ".claude-plugin/plugin.json";
13969
- const MESSAGE$2 = "is a version written in this package.json. Add it to the catalog in pnpm-workspace.yaml and write `catalog:` here, so that one entry owns the version and every package that uses the dependency moves together.";
13970
- const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array.some((protocol) => String$1.startsWith(protocol)(specifier)));
13971
- const problemsIn$10 = (entry, source) => pipe(manifestSpecifiers(source), Array.filter((found) => !isOwnedElsewhere(found)), Array.map((found) => ({
13972
- file: entry.file,
13973
- ...positionOf(source)(offsetIn(source)(manifestPattern(found))),
13974
- rule: RULE$16,
13975
- message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$2}`
13976
- })));
13977
- /** @internal */
13978
- const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* uncatalogedDependencies(root) {
13979
- const files = yield* RepositoryFiles;
13980
- const directories = yield* workspaceDirectories(root);
13981
- const installed = yield* pipe(directories, Effect.filter((directory) => files.exists(files.join(root, directory, PLUGIN_MANIFEST$1)).pipe(Effect.map((found) => !found))));
13982
- const listed = pipe([ROOT_DIRECTORY$1, ...installed], Array.map((directory) => {
13983
- const name = files.join(directory, MANIFEST_FILE$3);
13984
- return {
13985
- name,
13986
- file: files.join(root, name)
13987
- };
13988
- }));
13989
- return yield* scanText(listed, problemsIn$10);
13990
- });
13991
13902
  // src/features/check-catalog-entries/model/catalog-entries.ts
13992
13903
  const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
13993
13904
  const MANIFEST$2 = /(?:^|\/)package\.json$/u;
@@ -13998,28 +13909,25 @@ const WILDCARD = "*";
13998
13909
  const FIRST_LINE$2 = 1;
13999
13910
  const FIRST_COLUMN$1 = 1;
14000
13911
  const SCOPED_NAME = /^(?<name>@?[^@]+)(?:@(?<versions>.+))?$/u;
14001
- const READ_CONCURRENCY$6 = 16;
13912
+ const READ_CONCURRENCY$5 = 16;
14002
13913
  const STALE_RULE = "stale-release-age-exclude";
14003
13914
  const UNUSED_RULE = "unused-catalog-entry";
14004
13915
  const STALE_MESSAGE = "excludes a version from `minimumReleaseAge` that the lockfile no longer resolves. Remove the entry: it only exempted that one version while it was new.";
14005
13916
  const UNUSED_MESSAGE = "is a catalog entry no package refers to. Remove it, so the catalog holds only versions in use.";
14006
- const FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);
14007
- const decodeManifest$5 = Schema.decodeUnknownOption(Schema.fromJsonString(FieldsSchema));
14008
- const decodeFields$1 = Schema.decodeUnknownOption(FieldsSchema);
14009
13917
  const decodeString$1 = Schema.decodeUnknownOption(Schema.String);
14010
13918
  const decodeStrings = Schema.decodeUnknownOption(Schema.Array(Schema.String));
14011
- const fieldsOf$1 = (value) => Option.getOrElse(decodeFields$1(value), () => ({}));
14012
- const entriesOf = (catalog) => (held) => pipe(Record.keys(fieldsOf$1(held)), Array.map((name) => ({
13919
+ const entriesOf = (catalog) => (held) => pipe(Record.keys(fieldsOf(held)), Array.map((name) => ({
14013
13920
  catalog,
14014
13921
  name
14015
13922
  })));
14016
- const catalogEntries = (settings) => [...entriesOf(DEFAULT_CATALOG)(settings["catalog"]), ...pipe(Record.toEntries(fieldsOf$1(settings["catalogs"])), Array.flatMap(([catalog, held]) => entriesOf(catalog)(held)))];
13923
+ const catalogEntries = (settings) => [...entriesOf(DEFAULT_CATALOG)(settings["catalog"]), ...pipe(namedCatalogsOf(settings), Array.flatMap(([catalog, held]) => entriesOf(catalog)(held)))];
14017
13924
  const catalogOf = (specifier) => pipe(Option.liftPredicate(specifier, String$1.startsWith(CATALOG_PROTOCOL)), Option.map(String$1.slice(8)), Option.map((name) => Option.getOrElse(Option.liftPredicate(name, String$1.isNonEmpty), () => DEFAULT_CATALOG)));
14018
13925
  const referenceOf = ([name, specifier]) => pipe(decodeString$1(specifier), Option.flatMap(catalogOf), Option.map((catalog) => `${catalog}:${name}`), Option.toArray);
14019
- const referencesIn = (manifest) => pipe(Record.values(manifest), Array.flatMap((section) => pipe(fieldsOf$1(section), Record.toEntries, Array.flatMap(referenceOf))));
13926
+ const referencesIn = (manifest) => pipe(Record.values(manifest), Array.flatMap((section) => pipe(fieldsOf(section), Record.toEntries, Array.flatMap(referenceOf))));
14020
13927
  const versionsOf = (raw) => pipe(Option.fromUndefinedOr(raw), Option.map((listed) => pipe(String$1.split(listed, VERSION_SEPARATOR), Array.map(String$1.trim))), Option.getOrElse(() => []));
14021
- const isLocked = (keys) => (resolved) => pipe(keys, Array.some((key) => key === resolved || String$1.startsWith(`${resolved}(`)(key)));
14022
- const hasPackage = (keys) => (name) => pipe(keys, Array.some(String$1.startsWith(`${name}@`)));
13928
+ const hasKeyWith = (keys) => (prefix) => pipe(keys, Array.some(String$1.startsWith(prefix)));
13929
+ const isLocked = (keys) => (resolved) => Array.contains(keys, resolved) || hasKeyWith(keys)(`${resolved}(`);
13930
+ const hasPackage = (keys) => (name) => hasKeyWith(keys)(`${name}@`);
14023
13931
  const lockedVersion = (keys, name) => (version) => isLocked(keys)(`${name}@${version}`);
14024
13932
  const resolvedIn = (keys) => (entry) => String$1.includes(WILDCARD)(entry) || pipe(Option.fromNullishOr(SCOPED_NAME.exec(entry)), Option.flatMap(({ groups }) => Option.fromUndefinedOr(groups)), Option.match({
14025
13933
  onNone: () => true,
@@ -14032,9 +13940,9 @@ const lockedKeys = (root) => lockedPackages(root).pipe(Effect.orElseSucceed(() =
14032
13940
  const usedReferences = Effect.fn("usedReferences")(function* usedReferences(root, settings) {
14033
13941
  const files = yield* RepositoryFiles;
14034
13942
  const listed = yield* files.listedFiles(root);
14035
- const manifests = yield* Effect.forEach(pipe(listed, Array.filter((name) => MANIFEST$2.test(name))), (name) => files.readFile(files.join(root, name)), { concurrency: READ_CONCURRENCY$6 });
14036
- const fromManifests = pipe(Array.getSomes(manifests), Array.flatMap((text) => Option.toArray(decodeManifest$5(text))), Array.flatMap(referencesIn));
14037
- const fromOverrides = pipe(fieldsOf$1(settings["overrides"]), Record.toEntries, Array.flatMap(referenceOf));
13943
+ const manifests = yield* Effect.forEach(pipe(listed, Array.filter((name) => MANIFEST$2.test(name))), (name) => files.readFile(files.join(root, name)), { concurrency: READ_CONCURRENCY$5 });
13944
+ const fromManifests = pipe(Array.getSomes(manifests), Array.flatMap((text) => Option.toArray(decodeManifest$9(text))), Array.flatMap(referencesIn));
13945
+ const fromOverrides = pipe(fieldsOf(settings["overrides"]), Record.toEntries, Array.flatMap(referenceOf));
14038
13946
  return /* @__PURE__ */ new Set([...fromManifests, ...fromOverrides]);
14039
13947
  });
14040
13948
  const lineOf$1 = (source) => (needle) => pipe(String$1.split(source, "\n"), Array.findFirstIndex((line) => needle.test(line)), Option.match({
@@ -14072,7 +13980,7 @@ const checkCatalogEntries = Effect.fn("checkCatalogEntries")(function* checkCata
14072
13980
  const manifest = yield* workspaceManifest(root);
14073
13981
  const catalogs = yield* Option.match(manifest, {
14074
13982
  onNone: () => Effect.succeed([]),
14075
- onSome: (settings) => findingsIn(root, files.join(root, WORKSPACE_FILE$4), fieldsOf$1(settings))
13983
+ onSome: (settings) => findingsIn(root, files.join(root, WORKSPACE_FILE$4), fieldsOf(settings))
14076
13984
  });
14077
13985
  const uncataloged = yield* Option.match(manifest, {
14078
13986
  onNone: () => Effect.succeed([]),
@@ -14083,11 +13991,11 @@ const checkCatalogEntries = Effect.fn("checkCatalogEntries")(function* checkCata
14083
13991
  // src/features/check-skills/model/skill-entry.ts
14084
13992
  const ENTRY_RULE = "unlocked-skill";
14085
13993
  const VISIBLE_RULE = "skill-source-visible";
14086
- const CONFIG_FILE$1 = "vite.config.ts";
13994
+ const CONFIG_FILE = "vite.config.ts";
14087
13995
  const RENOVATE_FILE$1 = "renovate.json";
14088
13996
  const SOURCE = "masseater/skills";
14089
13997
  const PRESET$1 = "github>masseater/ecosystems//libs/vite-plus-adopt/renovate";
14090
- const START$11 = 0;
13998
+ const START$10 = 0;
14091
13999
  const LOCAL_PREFIX = "./";
14092
14000
  const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
14093
14001
  const Source = Schema.Struct({
@@ -14096,17 +14004,17 @@ const Source = Schema.Struct({
14096
14004
  });
14097
14005
  const SkillsConfig = Schema.Struct({ skills: Schema.Record(Schema.String, Source) });
14098
14006
  const decodeSkills = Schema.decodeUnknownOption(SkillsConfig);
14099
- const taggedError$1 = Schema.TaggedError;
14100
- var SkillsConfigUnreadable = class extends taggedError$1()("SkillsConfigUnreadable", { file: Schema.String }) {};
14007
+ const taggedError = Schema.TaggedError;
14008
+ var SkillsConfigUnreadable = class extends taggedError()("SkillsConfigUnreadable", { file: Schema.String }) {};
14101
14009
  const problemAt$4 = (rule, file, text) => (anchor, message) => ({
14102
14010
  file,
14103
- ...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$11))),
14011
+ ...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$10))),
14104
14012
  rule,
14105
14013
  message
14106
14014
  });
14107
14015
  const declaredSkills = Effect.fn("declaredSkills")(function* declaredSkills(root) {
14108
14016
  const files = yield* RepositoryFiles;
14109
- const file = files.join(root, CONFIG_FILE$1);
14017
+ const file = files.join(root, CONFIG_FILE);
14110
14018
  const text = yield* files.readFile(file);
14111
14019
  if (Option.isNone(text)) return Option.none();
14112
14020
  const config = yield* Effect.tryPromise({
@@ -14133,7 +14041,7 @@ const presetProblems = Effect.fn("presetProblems")(function* presetProblems(root
14133
14041
  const file = files.join(root, RENOVATE_FILE$1);
14134
14042
  const text = yield* files.readFile(file);
14135
14043
  if (pipe(text, Option.exists(String$1.includes(`"${PRESET$1}"`)))) return [];
14136
- return [problemAt$4(VISIBLE_RULE, file, Option.getOrElse(text, () => ""))("extends", `does not extend ${PRESET$1}, so Renovate never updates the commits in the skills section of ${CONFIG_FILE$1}.`)];
14044
+ return [problemAt$4(VISIBLE_RULE, file, Option.getOrElse(text, () => ""))("extends", `does not extend ${PRESET$1}, so Renovate never updates the commits in the skills section of ${CONFIG_FILE}.`)];
14137
14045
  });
14138
14046
  /** @internal */
14139
14047
  const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(root) {
@@ -14147,14 +14055,14 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
14147
14055
  ];
14148
14056
  });
14149
14057
  // src/features/check-skills/model/published-skills.ts
14150
- const RULE$15 = "published-skills";
14058
+ const RULE$14 = "published-skills";
14151
14059
  const KEYWORD = "tanstack-intent";
14152
14060
  const SKILLS = "skills";
14153
14061
  const MANIFEST_FILE = "package.json";
14154
14062
  const SKILL_FILE$1 = "SKILL.md";
14155
14063
  const SUCCEEDED = 0;
14156
14064
  const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
14157
- const problemAt$3 = problemInFile(RULE$15);
14065
+ const problemAt$3 = problemInFile(RULE$14);
14158
14066
  const skillDirectoriesIn = (files, directory) => pipe(findSkillFiles(files.join(directory, SKILLS)), Array.filter((file) => files.basename(file) === SKILL_FILE$1), Array.map((file) => files.relative(directory, files.dirname(file))));
14159
14067
  const isShipped = (listed) => (skill) => Array.contains(listed, SKILLS) || Array.contains(listed, skill);
14160
14068
  const packagingMessages = ({ keywords, files }, skills) => {
@@ -14175,7 +14083,7 @@ const validationOf = Effect.fn("validationOf")(function* validationOf(directory)
14175
14083
  const [output, status] = yield* Effect.all([handle.all.pipe(Stream.decodeText(), Stream.mkString), handle.exitCode], { concurrency: "unbounded" });
14176
14084
  return Option.liftPredicate(String$1.trim(output), () => Number(status) !== SUCCEEDED);
14177
14085
  }, Effect.scoped);
14178
- const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
14086
+ const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
14179
14087
  const files = yield* RepositoryFiles;
14180
14088
  const directory = files.join(root, project.directory);
14181
14089
  const manifest = files.join(directory, MANIFEST_FILE);
@@ -14187,11 +14095,11 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, project)
14187
14095
  /** @internal */
14188
14096
  const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPublishedSkills(root) {
14189
14097
  const projects = yield* publishedProjects(root);
14190
- const problems = yield* Effect.forEach(projects, (project) => problemsIn$9(root, project), { concurrency: 1 });
14098
+ const problems = yield* Effect.forEach(projects, (project) => problemsIn$8(root, project), { concurrency: 1 });
14191
14099
  return Array.flatten(problems);
14192
14100
  });
14193
14101
  // src/features/check-skills/model/skill-files.ts
14194
- const RULE$14 = "skill-file";
14102
+ const RULE$13 = "skill-file";
14195
14103
  const SKILL_FILE = /(?:^|\/)SKILL\.md$/u;
14196
14104
  const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
14197
14105
  const MARKDOWN = ".md";
@@ -14208,9 +14116,9 @@ const GITHUB = "https://github.com/";
14208
14116
  const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
14209
14117
  const BLANK = /\s+/u;
14210
14118
  const SEPARATOR$2 = "/";
14211
- const START$10 = 0;
14119
+ const START$9 = 0;
14212
14120
  const FIRST$3 = 1;
14213
- const READ_CONCURRENCY$5 = 16;
14121
+ const READ_CONCURRENCY$4 = 16;
14214
14122
  const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
14215
14123
  const Frontmatter = Schema.Struct({
14216
14124
  name: Schema.optional(Schema.String),
@@ -14218,9 +14126,9 @@ const Frontmatter = Schema.Struct({
14218
14126
  metadata: Schema.optional(Metadata)
14219
14127
  });
14220
14128
  const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
14221
- const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$10));
14129
+ const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$9));
14222
14130
  const frontmatterOf = (source) => pipe(groupOf$2("yaml")(FRONTMATTER.exec(source)), Option.flatMap((yaml) => decodeFrontmatter(parse$2(yaml))));
14223
- const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$10].length), Option.getOrElse(() => START$10));
14131
+ const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$9].length), Option.getOrElse(() => START$9));
14224
14132
  const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
14225
14133
  const nameProblems = ({ source, directory }, name, folder) => {
14226
14134
  const bodyStart = bodyStartOf(source);
@@ -14248,16 +14156,16 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
14248
14156
  ]), Option.getOrElse(() => []), Array.map(({ index, message }) => ({
14249
14157
  file: skill.file,
14250
14158
  ...positionOf(skill.source)(index),
14251
- rule: RULE$14,
14159
+ rule: RULE$13,
14252
14160
  message
14253
14161
  })));
14254
14162
  const linkOf = (found) => pipe(groupOf$2("target")(found), Option.filter((target) => !EXTERNAL.test(target)), Option.map((target) => String$1.replace(FRAGMENT, "")(target)), Option.filter(String$1.isNonEmpty), Option.map((target) => ({
14255
14163
  target,
14256
- index: found.index ?? START$10
14164
+ index: found.index ?? START$9
14257
14165
  })), Option.toArray);
14258
14166
  const rangeOf$1 = (found) => {
14259
- const start = found.index ?? START$10;
14260
- return [start, start + found[START$10].length];
14167
+ const start = found.index ?? START$9;
14168
+ return [start, start + found[START$9].length];
14261
14169
  };
14262
14170
  const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array.some(([start, end]) => index >= start && index < end));
14263
14171
  const linksIn = (source) => {
@@ -14275,23 +14183,23 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
14275
14183
  return pipe(missing, Array.map(({ target, index }) => ({
14276
14184
  file,
14277
14185
  ...positionOf(source)(index),
14278
- rule: RULE$14,
14186
+ rule: RULE$13,
14279
14187
  message: `links to ${target}, which does not exist. Fix the path or remove the link.`
14280
14188
  })));
14281
14189
  });
14282
- const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
14190
+ const problemsIn$7 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
14283
14191
  const files = yield* RepositoryFiles;
14284
14192
  const file = files.join(root, name);
14285
14193
  const directory = files.dirname(name);
14286
14194
  const inside = pipe(listed, Array.filter(String$1.startsWith(`${directory}${SEPARATOR$2}`)));
14287
14195
  const text = yield* files.readFile(file);
14288
14196
  const documents = pipe(inside, Array.filter(String$1.endsWith(MARKDOWN)), Array.map((entry) => files.join(root, entry)));
14289
- const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$5 });
14197
+ const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$4 });
14290
14198
  const licenses = pipe(inside, Array.filter((entry) => files.dirname(entry) === directory), Array.filter((entry) => LICENSE_FILE.test(files.basename(entry))), Array.map((entry) => ({
14291
14199
  file: files.join(root, entry),
14292
14200
  line: FIRST$3,
14293
14201
  column: FIRST$3,
14294
- rule: RULE$14,
14202
+ rule: RULE$13,
14295
14203
  message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
14296
14204
  })));
14297
14205
  return [
@@ -14308,7 +14216,7 @@ const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
14308
14216
  const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
14309
14217
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
14310
14218
  const skills = pipe(listed, Array.filter((name) => SKILL_FILE.test(name) && !INSTALLED.test(name)));
14311
- const found = yield* Effect.forEach(skills, (name) => problemsIn$8(root, listed, name), { concurrency: READ_CONCURRENCY$5 });
14219
+ const found = yield* Effect.forEach(skills, (name) => problemsIn$7(root, listed, name), { concurrency: READ_CONCURRENCY$4 });
14312
14220
  return Array.flatten(found);
14313
14221
  });
14314
14222
  // src/features/check-version-downgrades/model/version-entries.ts
@@ -14323,14 +14231,12 @@ const CARGO_SECTIONS = [
14323
14231
  "dev-dependencies",
14324
14232
  "build-dependencies"
14325
14233
  ];
14326
- const decodeFields = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
14327
14234
  const decodeJson = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
14328
14235
  const decodeString = Schema.decodeUnknownOption(Schema.String);
14329
14236
  const decodeVersioned = Schema.decodeUnknownOption(Schema.Struct({ version: Schema.String }));
14330
14237
  const decodeSpec = (value) => Option.orElse(decodeString(value), () => Option.map(decodeVersioned(value), ({ version }) => version));
14331
14238
  const PackageManager = Schema.String.check(Schema.isPattern(/^[^@]+@[^+]+/u));
14332
14239
  const decodePackageManager = Schema.decodeUnknownOption(PackageManager);
14333
- const fieldsOf = (value) => Option.getOrElse(decodeFields(value), () => ({}));
14334
14240
  const fieldOf = (name) => (value) => fieldsOf(value)[name];
14335
14241
  const entriesIn = (section) => (held) => pipe(Record.toEntries(fieldsOf(held)), Array.flatMap(([name, value]) => pipe(decodeSpec(value), Option.map((spec) => ({
14336
14242
  key: `${section}:${name}`,
@@ -14350,10 +14256,10 @@ const manifestEntries = (text) => {
14350
14256
  const manifest = decodeJson(text).pipe(Option.getOrUndefined, fieldsOf);
14351
14257
  return [...sectionsIn(MANIFEST_SECTIONS)(manifest), ...packageManagerOf(manifest["packageManager"])];
14352
14258
  };
14353
- const catalogsIn = (held) => pipe(Record.toEntries(fieldsOf(held)), Array.flatMap(([name, catalog]) => entriesIn(`catalogs.${name}`)(catalog)));
14259
+ const catalogsIn = (settings) => pipe(namedCatalogsOf(settings), Array.flatMap(([name, catalog]) => entriesIn(`catalogs.${name}`)(catalog)));
14354
14260
  const workspaceEntries = (text) => {
14355
14261
  const settings = Option.liftThrowable(() => parse$2(text))().pipe(Option.getOrUndefined, fieldsOf);
14356
- return [...sectionsIn(["catalog", "overrides"])(settings), ...catalogsIn(settings["catalogs"])];
14262
+ return [...sectionsIn(["catalog", "overrides"])(settings), ...catalogsIn(settings)];
14357
14263
  };
14358
14264
  const parseToml = (text) => pipe(Option.liftThrowable(() => getStaticTOMLValue(parseTOML(text)))(), Option.map(fieldsOf), Option.getOrElse(() => ({})));
14359
14265
  const singleEntry = (key, value) => pipe(decodeSpec(value), Option.map((spec) => ({
@@ -14371,9 +14277,9 @@ const cargoEntries = (text) => {
14371
14277
  };
14372
14278
  const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
14373
14279
  // src/features/check-version-downgrades/model/version-downgrade.ts
14374
- const RULE$13 = "version-downgrade";
14280
+ const RULE$12 = "version-downgrade";
14375
14281
  const DEFAULT_BASE = "origin/main";
14376
- const READ_CONCURRENCY$4 = 16;
14282
+ const READ_CONCURRENCY$3 = 16;
14377
14283
  const READERS = [
14378
14284
  [/(?:^|\/)package\.json$/u, manifestEntries],
14379
14285
  [/^pnpm-workspace\.yaml$/u, workspaceEntries],
@@ -14397,7 +14303,7 @@ const downgradesIn = ({ file, text, before, after }) => {
14397
14303
  file,
14398
14304
  line: lineOf(text, entry),
14399
14305
  column: FIRST_LINE$1,
14400
- rule: RULE$13,
14306
+ rule: RULE$12,
14401
14307
  message: message(old, entry)
14402
14308
  })), Option.toArray)));
14403
14309
  };
@@ -14423,7 +14329,7 @@ const checkDowngrades = Effect.fn("checkDowngrades")(function* checkDowngrades(r
14423
14329
  before: read(before),
14424
14330
  after: read(after)
14425
14331
  })), Option.getOrElse(() => []));
14426
- }), { concurrency: READ_CONCURRENCY$4 });
14332
+ }), { concurrency: READ_CONCURRENCY$3 });
14427
14333
  return Array.flatten(found);
14428
14334
  });
14429
14335
  // src/features/check-version-downgrades/model/renovate-settings.ts
@@ -14434,13 +14340,13 @@ const AUTOMERGE_RULE = "renovate-platform-automerge";
14434
14340
  const CAP_RULE = "renovate-version-cap";
14435
14341
  const PRESET_RULE = "renovate-msch-preset";
14436
14342
  const PRESET = "github>masseater/ecosystems//libs/msch/renovate";
14437
- const START$9 = 0;
14438
- const READ_CONCURRENCY$3 = 16;
14343
+ const START$8 = 0;
14344
+ const READ_CONCURRENCY$2 = 16;
14439
14345
  const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
14440
14346
  const CAP_MESSAGE = "caps a dependency below a version with `allowedVersions`. A cap holds the dependency on an old version, which is a downgrade that never ends: fix what breaks on the new version instead.";
14441
14347
  const PRESET_MESSAGE = `does not extend \`${PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
14442
14348
  const offsetsOf = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap((match) => Option.toArray(Option.fromUndefinedOr(match.index))));
14443
- const problemsIn$7 = (file, source) => {
14349
+ const problemsIn$6 = (file, source) => {
14444
14350
  const at = positionOf(source);
14445
14351
  const found = (pattern, rule, message) => pipe(offsetsOf(pattern, source), Array.map((offset) => ({
14446
14352
  file,
@@ -14453,7 +14359,7 @@ const problemsIn$7 = (file, source) => {
14453
14359
  ...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
14454
14360
  ...pipe([{
14455
14361
  file,
14456
- ...at(START$9),
14362
+ ...at(START$8),
14457
14363
  rule: PRESET_RULE,
14458
14364
  message: PRESET_MESSAGE
14459
14365
  }], Array.filter(() => !String$1.includes(`"${PRESET}"`)(source)))
@@ -14467,30 +14373,30 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
14467
14373
  const file = files.join(root, name);
14468
14374
  return files.readFile(file).pipe(Effect.map(Option.match({
14469
14375
  onNone: () => [],
14470
- onSome: (source) => problemsIn$7(file, source)
14376
+ onSome: (source) => problemsIn$6(file, source)
14471
14377
  })));
14472
- }, { concurrency: READ_CONCURRENCY$3 });
14378
+ }, { concurrency: READ_CONCURRENCY$2 });
14473
14379
  return Array.flatten(found);
14474
14380
  });
14475
14381
  // src/features/find-invisible-characters/model/hidden-unicode.ts
14476
14382
  const HIDDEN = /[\u00AD\u180E\u200B\u200C\u200E\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]|(?<![\p{Extended_Pictographic}\p{Emoji_Modifier}\uFE0F])\u200D|\u200D(?!\p{Extended_Pictographic})|[\u{E0000}-\u{E007F}]/gu;
14477
14383
  const NUL = "\0";
14478
- const START$8 = 0;
14384
+ const START$7 = 0;
14479
14385
  const HEX = 16;
14480
14386
  const CODE_POINT_WIDTH = 4;
14481
- const READ_CONCURRENCY$2 = 64;
14482
- const RULE$12 = "hidden-unicode";
14483
- const hexOf = (character) => pipe(String$1.codePointAt(START$8)(character), Option.getOrElse(() => START$8), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
14387
+ const READ_CONCURRENCY$1 = 64;
14388
+ const RULE$11 = "hidden-unicode";
14389
+ const hexOf = (character) => pipe(String$1.codePointAt(START$7)(character), Option.getOrElse(() => START$7), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
14484
14390
  const problemOf$1 = (file, source) => (found) => {
14485
- const hex = hexOf(found[START$8]);
14391
+ const hex = hexOf(found[START$7]);
14486
14392
  return {
14487
14393
  file,
14488
- ...positionOf(source)(found.index ?? START$8),
14489
- rule: RULE$12,
14394
+ ...positionOf(source)(found.index ?? START$7),
14395
+ rule: RULE$11,
14490
14396
  message: `U+${hex} is invisible in editors and reviews and can change what the text means. Remove it, or write it as the escape \\u${hex}.`
14491
14397
  };
14492
14398
  };
14493
- const problemsIn$6 = (file, source) => {
14399
+ const problemsIn$5 = (file, source) => {
14494
14400
  if (String$1.includes(NUL)(source)) return [];
14495
14401
  return pipe(Array.fromIterable(String$1.matchAll(HIDDEN)(source)), Array.map(problemOf$1(file, source)));
14496
14402
  };
@@ -14502,25 +14408,25 @@ const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHidden
14502
14408
  const file = files.join(root, name);
14503
14409
  return files.readFile(file).pipe(Effect.map(Option.match({
14504
14410
  onNone: () => [],
14505
- onSome: (source) => problemsIn$6(file, source)
14411
+ onSome: (source) => problemsIn$5(file, source)
14506
14412
  })));
14507
- }, { concurrency: READ_CONCURRENCY$2 });
14413
+ }, { concurrency: READ_CONCURRENCY$1 });
14508
14414
  return Array.flatten(found);
14509
14415
  });
14510
14416
  // src/features/find-unneeded-files/model/alchemy-patch.ts
14511
- const RULE$11 = "alchemy-patch";
14417
+ const RULE$10 = "alchemy-patch";
14512
14418
  const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
14513
14419
  const ALCHEMY$1 = /^(?:alchemy|@alchemy\.run\/[^@]+)(?:@.*)?$/u;
14514
- const START$7 = 0;
14420
+ const START$6 = 0;
14515
14421
  const problemOf = (file, position, name) => ({
14516
14422
  file,
14517
14423
  ...position,
14518
- rule: RULE$11,
14424
+ rule: RULE$10,
14519
14425
  message: `patches ${name}. A patch breaks on every Alchemy release. Define the missing setting as a custom resource in the stack and delete the patch.`
14520
14426
  });
14521
- const problemsIn$5 = (file, patched) => (source) => {
14427
+ const problemsIn$4 = (file, patched) => (source) => {
14522
14428
  const at = positionOf(source);
14523
- const offsetOf = (name) => pipe(String$1.indexOf(name)(source), Option.getOrElse(() => START$7));
14429
+ const offsetOf = (name) => pipe(String$1.indexOf(name)(source), Option.getOrElse(() => START$6));
14524
14430
  return pipe(patched, Array.filter((name) => ALCHEMY$1.test(name)), Array.map((name) => problemOf(file, at(offsetOf(name)), name)));
14525
14431
  };
14526
14432
  /** @internal */
@@ -14530,12 +14436,12 @@ const checkAlchemyPatch = Effect.fn("checkAlchemyPatch")(function* checkAlchemyP
14530
14436
  const text = yield* files.readFile(file);
14531
14437
  const manifest = yield* workspaceManifest(root);
14532
14438
  const patched = pipe(manifest, Option.flatMap(({ patchedDependencies }) => Option.fromUndefinedOr(patchedDependencies)), Option.map(Record.keys), Option.getOrElse(() => []));
14533
- return pipe(text, Option.map(problemsIn$5(file, patched)), Option.getOrElse(() => []));
14439
+ return pipe(text, Option.map(problemsIn$4(file, patched)), Option.getOrElse(() => []));
14534
14440
  });
14535
14441
  // src/features/find-unneeded-files/model/applied-packages.ts
14536
14442
  const MSCH = "@r_masseater/msch";
14537
14443
  const SCOPE$1 = "@r_masseater/";
14538
- const RULE$10 = "applied-package";
14444
+ const RULE$9 = "applied-package";
14539
14445
  const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
14540
14446
  const NOT_FOUND = -1;
14541
14447
  const SEPARATOR$1 = "/";
@@ -14580,7 +14486,7 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
14580
14486
  const problemAt$2 = (file, source) => (index, name) => ({
14581
14487
  file,
14582
14488
  ...positionOf(source)(index),
14583
- rule: RULE$10,
14489
+ rule: RULE$9,
14584
14490
  message: `msch applies ${name}. Remove this use and let msch apply it.`
14585
14491
  });
14586
14492
  const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped(name)}(?=["'\`/])`, "gu");
@@ -14635,7 +14541,7 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
14635
14541
  return yield* appliedPackageProblems(root, applied);
14636
14542
  });
14637
14543
  // src/features/find-unneeded-files/model/replaced-tools.ts
14638
- const RULE$9 = "replaced-tool";
14544
+ const RULE$8 = "replaced-tool";
14639
14545
  const FIRST$2 = 1;
14640
14546
  const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
14641
14547
  const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
@@ -14712,18 +14618,18 @@ const REPLACED = [
14712
14618
  replacement: "the root AGENTS.md and the skills in masseater/skills"
14713
14619
  }
14714
14620
  ];
14715
- const problemFor$1 = ({ name, file }) => pipe(REPLACED, Array.findFirst(({ pattern }) => pattern.test(name)), Option.map(({ tool, replacement }) => ({
14621
+ const problemFor = ({ name, file }) => pipe(REPLACED, Array.findFirst(({ pattern }) => pattern.test(name)), Option.map(({ tool, replacement }) => ({
14716
14622
  file,
14717
14623
  line: FIRST$2,
14718
14624
  column: FIRST$2,
14719
- rule: RULE$9,
14625
+ rule: RULE$8,
14720
14626
  message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
14721
14627
  })));
14722
14628
  /** @internal */
14723
14629
  const checkReplacedTools = Effect.fn("checkReplacedTools")(function* checkReplacedTools(root) {
14724
14630
  const listed = yield* listedFiles(root);
14725
- const present = yield* presentFiles(pipe(listed, Array.filter((entry) => Option.isSome(problemFor$1(entry)))));
14726
- return pipe(present, Array.flatMap((entry) => Option.toArray(problemFor$1(entry))));
14631
+ const present = yield* presentFiles(pipe(listed, Array.filter((entry) => Option.isSome(problemFor(entry)))));
14632
+ return pipe(present, Array.flatMap((entry) => Option.toArray(problemFor(entry))));
14727
14633
  });
14728
14634
  // src/features/find-unneeded-files/model/lockfiles.ts
14729
14635
  const FOREIGN_LOCKFILE = /(?:^|\/)(?:package-lock\.json|npm-shrinkwrap\.json|yarn\.lock|bun\.lockb?)$/u;
@@ -14750,7 +14656,7 @@ const SETUP_PATTERNS = [
14750
14656
  ];
14751
14657
  const INSTALL_PATTERNS = [/(?<![\w./@-])cargo[ \t]+b?install\b/gu];
14752
14658
  const TOOL_PATTERNS = [/^[ \t]*["']?(?:rust|rustup)["']?[ \t]*(?:=|[ \t]+\S)/gmu];
14753
- const START$6 = 0;
14659
+ const START$5 = 0;
14754
14660
  const LAST_SEGMENT = 1;
14755
14661
  const FIRST_LINE = 1;
14756
14662
  const FIRST_COLUMN = 1;
@@ -14819,7 +14725,7 @@ const cargoWorkspaces = Effect.fn("cargoWorkspaces")(function* cargoWorkspaces(m
14819
14725
  const roots = yield* pipe(manifests, Effect.filter(({ file }) => files.readFile(file).pipe(Effect.map(isWorkspaceManifest))));
14820
14726
  return directoriesOf(roots);
14821
14727
  });
14822
- const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$6), (end) => String$1.slice(START$6, end)(name));
14728
+ const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$5), (end) => String$1.slice(START$5, end)(name));
14823
14729
  const pnpmOutputs = (present) => pipe(present, Array.filter(isPnpmOutput), Array.dedupeWith((left, right) => pnpmDirectoryOf(left) === pnpmDirectoryOf(right)), Array.map(pnpmOutput));
14824
14730
  const byDepth = Order.mapInput(Order.Number, ({ name }) => String$1.split(name, "/").length);
14825
14731
  const cargoProblems = (present, enabled) => {
@@ -14855,11 +14761,11 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
14855
14761
  return yield* unneededIn(root, cargoEnabled(workspace.value));
14856
14762
  });
14857
14763
  // src/features/check-effect-diagnostics/model/effect-diagnostics.ts
14858
- const RULE$8 = "effect-diagnostics-once";
14764
+ const RULE$7 = "effect-diagnostics-once";
14859
14765
  const PLUGIN = "@effect/language-service";
14860
14766
  const CONFIG_PATHSPEC = ":(glob)**/tsconfig*.json";
14861
- const EXCLUDED$4 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
14862
- const START$5 = 0;
14767
+ const EXCLUDED$3 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
14768
+ const START$4 = 0;
14863
14769
  const Plugin = Schema.Struct({
14864
14770
  name: Schema.optional(Schema.String),
14865
14771
  diagnostics: Schema.optional(Schema.Unknown)
@@ -14870,28 +14776,28 @@ const Config$1 = Schema.Struct({ compilerOptions: Schema.optional(CompilerOption
14870
14776
  const decodeConfig = Schema.decodeUnknownOption(Schema.fromJsonString(Config$1));
14871
14777
  const MESSAGE$1 = `The \`${PLUGIN}\` plugin reports the Effect diagnostics during the type check, and the \`effecttsgo\` lint rules that msch enables report the same ones again. Set \`"diagnostics": false\` on the plugin so that each finding is reported once, by the lint rules, with the severity msch sets.`;
14872
14778
  const reportsDiagnostics = (plugin) => plugin.name === PLUGIN && plugin.diagnostics !== false;
14873
- const problemsIn$4 = (entry, source) => pipe(decodeConfig(source), Option.flatMap(({ compilerOptions }) => Option.fromUndefinedOr(compilerOptions)), Option.flatMap(({ plugins }) => Option.fromUndefinedOr(plugins)), Option.filter(Array.some(reportsDiagnostics)), Option.map(() => ({
14779
+ const problemsIn$3 = (entry, source) => pipe(decodeConfig(source), Option.flatMap(({ compilerOptions }) => Option.fromUndefinedOr(compilerOptions)), Option.flatMap(({ plugins }) => Option.fromUndefinedOr(plugins)), Option.filter(Array.some(reportsDiagnostics)), Option.map(() => ({
14874
14780
  file: entry.file,
14875
- ...positionOf(source)(pipe(String$1.indexOf(`"${PLUGIN}"`)(source), Option.getOrElse(() => START$5))),
14876
- rule: RULE$8,
14781
+ ...positionOf(source)(pipe(String$1.indexOf(`"${PLUGIN}"`)(source), Option.getOrElse(() => START$4))),
14782
+ rule: RULE$7,
14877
14783
  message: MESSAGE$1
14878
14784
  })), Option.toArray);
14879
14785
  /** @internal */
14880
14786
  const checkEffectDiagnostics = Effect.fn("checkEffectDiagnostics")(function* checkEffectDiagnostics(root) {
14881
14787
  const files = yield* RepositoryFiles;
14882
- const configs = yield* files.matchingFiles(root, [CONFIG_PATHSPEC, ...EXCLUDED$4]);
14788
+ const configs = yield* files.matchingFiles(root, [CONFIG_PATHSPEC, ...EXCLUDED$3]);
14883
14789
  return yield* scanText(pipe(configs, Array.map((name) => ({
14884
14790
  name,
14885
14791
  file: files.join(root, name)
14886
- }))), problemsIn$4);
14792
+ }))), problemsIn$3);
14887
14793
  });
14888
14794
  // src/features/check-exact-versions/model/exact-versions.ts
14889
- const RULE$7 = "version-range";
14795
+ const RULE$6 = "version-range";
14890
14796
  const WORKSPACE_FILE = "pnpm-workspace.yaml";
14891
14797
  const ALIAS = /^npm:(?:@[^/@]+\/)?[^@]+@(?<version>.+)$/u;
14892
14798
  const PROTOCOL = /^[a-z+]+:/u;
14893
14799
  const PATH_LIKE = "/";
14894
- const EXCLUDED$3 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
14800
+ const EXCLUDED$2 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
14895
14801
  const MESSAGE = "is a range. The lockfile decides the version anyway, so a range only lets the next install move it without a diff. Write the exact version the lockfile resolves; `msch-publish` widens `dependencies` and `peerDependencies` to `^` in the published package.";
14896
14802
  const versionOf = (specifier) => Option.getOrElse(groupOf$2("version")(ALIAS.exec(specifier)), () => specifier);
14897
14803
  /** @internal */
@@ -14901,13 +14807,13 @@ const isRange = (specifier) => {
14901
14807
  };
14902
14808
  const problemsFor = (file, source, pattern) => (found) => pipe(found, Array.filter(({ specifier }) => isRange(specifier)), Array.map((range) => ({
14903
14809
  file,
14904
- ...positionOf(source)(offsetIn(source)(pattern(range))),
14905
- rule: RULE$7,
14810
+ ...positionOf(source)(offsetIn$1(source)(pattern(range))),
14811
+ rule: RULE$6,
14906
14812
  message: `\`${range.name}\` \`${range.specifier}\` ${MESSAGE}`
14907
14813
  })));
14908
14814
  const catalogPattern = ({ name }) => new RegExp(`^\\s+["']?${quoted$1(name)}["']?:`, "mu");
14909
14815
  const manifestProblems$2 = (entry, source) => problemsFor(entry.file, source, manifestPattern)(manifestSpecifiers(source));
14910
- const catalogSpecifiers = (settings) => [...specifiedIn(settings["catalog"]), ...pipe(fieldsOf$2(settings["catalogs"]), Record.values, Array.flatMap(specifiedIn))];
14816
+ const catalogSpecifiers = (settings) => [...specifiedIn(settings["catalog"]), ...pipe(fieldsOf(settings["catalogs"]), Record.values, Array.flatMap(specifiedIn))];
14911
14817
  const catalogProblems = Effect.fn("catalogProblems")(function* catalogProblems(root) {
14912
14818
  const files = yield* RepositoryFiles;
14913
14819
  const file = files.join(root, WORKSPACE_FILE);
@@ -14916,12 +14822,12 @@ const catalogProblems = Effect.fn("catalogProblems")(function* catalogProblems(r
14916
14822
  return pipe(Option.all({
14917
14823
  settings,
14918
14824
  source
14919
- }), Option.map(({ settings: held, source: text }) => problemsFor(file, text, catalogPattern)(catalogSpecifiers(fieldsOf$2(held)))), Option.getOrElse(() => []));
14825
+ }), Option.map(({ settings: held, source: text }) => problemsFor(file, text, catalogPattern)(catalogSpecifiers(fieldsOf(held)))), Option.getOrElse(() => []));
14920
14826
  });
14921
14827
  /** @internal */
14922
14828
  const checkExactVersions = Effect.fn("checkExactVersions")(function* checkExactVersions(root) {
14923
14829
  const files = yield* RepositoryFiles;
14924
- const manifests = yield* files.matchingFiles(root, [`:(glob)**/${MANIFEST_FILE$3}`, ...EXCLUDED$3]);
14830
+ const manifests = yield* files.matchingFiles(root, [`:(glob)**/${MANIFEST_FILE$3}`, ...EXCLUDED$2]);
14925
14831
  const listed = pipe(manifests, Array.map((name) => ({
14926
14832
  name,
14927
14833
  file: files.join(root, name)
@@ -14930,75 +14836,6 @@ const checkExactVersions = Effect.fn("checkExactVersions")(function* checkExactV
14930
14836
  const fromCatalogs = yield* catalogProblems(root);
14931
14837
  return [...fromManifests, ...fromCatalogs];
14932
14838
  });
14933
- // src/features/check-pack-settings/model/pack-settings.ts
14934
- const RULE$6 = "pack-publint";
14935
- const PREPUBLISH_RULE = "prepublish-script";
14936
- const PREPUBLISH_SCRIPT = "prepublishOnly";
14937
- const PREPUBLISH_COMMAND = "vp exec msch-publish prepublish .";
14938
- const CONFIG_FILE = "vite.config.ts";
14939
- const PACK_KEY = "pack:";
14940
- const START$4 = 0;
14941
- const READ_CONCURRENCY$1 = 16;
14942
- const EXCLUDED$2 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
14943
- const Manifest$4 = Schema.Struct({
14944
- private: Schema.optional(Schema.Boolean),
14945
- publishConfig: Schema.optional(Schema.Unknown),
14946
- scripts: Schema.optional(Schema.Record(Schema.String, Schema.String))
14947
- });
14948
- const decodeManifest$4 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$4));
14949
- const StrictPack = Schema.Struct({ publint: Schema.Struct({ strict: Schema.Literal(true) }) });
14950
- const isStrict = Schema.is(StrictPack);
14951
- const PackConfig = Schema.Struct({ pack: Schema.optional(Schema.Unknown) });
14952
- const decodePackConfig = Schema.decodeUnknownOption(PackConfig);
14953
- const taggedError = Schema.TaggedError;
14954
- var PackConfigUnreadable = class extends taggedError()("PackConfigUnreadable", { file: Schema.String }) {};
14955
- const isPublished$2 = (manifest) => manifest.private !== true && Predicate.isNotUndefined(manifest.publishConfig);
14956
- const runsStrictPublint = (config) => pipe(decodePackConfig(config), Option.flatMap(({ pack }) => Option.fromUndefinedOr(pack)), Option.map((pack) => Array.ensure(pack)), Option.exists(Array.some(isStrict)));
14957
- const problemFor = (file, source) => ({
14958
- file,
14959
- ...positionOf(source)(Option.getOrElse(String$1.indexOf(PACK_KEY)(source), () => START$4)),
14960
- rule: RULE$6,
14961
- message: "This package is published, so its pack must run publint with `publint: { strict: true }`. Without it, publishConfig can point at files vp pack never writes, and the published package fails to import."
14962
- });
14963
- const publishedManifest = (source) => pipe(source, Option.flatMap(decodeManifest$4), Option.filter(isPublished$2));
14964
- const prepublishProblems = (file, source, manifest) => {
14965
- const declared = pipe(Option.fromUndefinedOr(manifest.scripts), Option.flatMap(Record.get(PREPUBLISH_SCRIPT)));
14966
- if (Option.contains(declared, PREPUBLISH_COMMAND)) return [];
14967
- return [{
14968
- file,
14969
- ...positionOf(source)(Option.getOrElse(String$1.indexOf(`"${PREPUBLISH_SCRIPT}"`)(source), () => START$4)),
14970
- rule: PREPUBLISH_RULE,
14971
- message: `This package is published, so its ${PREPUBLISH_SCRIPT} script must be exactly \`${PREPUBLISH_COMMAND}\`. That one command refuses npm publish, which leaves catalog: in dependencies, and builds the package. Writing the guard in each package leaves some packages without it.`
14972
- }];
14973
- };
14974
- const strictPublintIn = Effect.fn("strictPublintIn")(function* strictPublintIn(configFile) {
14975
- const config = yield* Effect.tryPromise({
14976
- try: () => resolveConfigFromFile(configFile),
14977
- catch: () => PackConfigUnreadable.make({ file: configFile })
14978
- }).pipe(Effect.option);
14979
- return Option.exists(config, runsStrictPublint);
14980
- });
14981
- const configProblems = Effect.fn("configProblems")(function* configProblems(configFile) {
14982
- const source = yield* (yield* RepositoryFiles).readFile(configFile);
14983
- if (Option.isNone(source)) return [];
14984
- if (yield* strictPublintIn(configFile)) return [];
14985
- return [problemFor(configFile, source.value)];
14986
- });
14987
- const problemsIn$3 = Effect.fn("problemsIn")(function* problemsIn(root, manifestName) {
14988
- const files = yield* RepositoryFiles;
14989
- const manifestFile = files.join(root, manifestName);
14990
- const source = yield* files.readFile(manifestFile);
14991
- const manifest = publishedManifest(source);
14992
- if (Option.isNone(manifest) || Option.isNone(source)) return [];
14993
- const config = yield* configProblems(files.join(root, files.dirname(manifestName), CONFIG_FILE));
14994
- return [...prepublishProblems(manifestFile, source.value, manifest.value), ...config];
14995
- });
14996
- /** @internal */
14997
- const checkPackSettings = Effect.fn("checkPackSettings")(function* checkPackSettings(root) {
14998
- const manifests = yield* (yield* RepositoryFiles).matchingFiles(root, [`:(glob)**/${MANIFEST_FILE$3}`, ...EXCLUDED$2]);
14999
- const found = yield* Effect.forEach(manifests, (name) => problemsIn$3(root, name), { concurrency: READ_CONCURRENCY$1 });
15000
- return Array.flatten(found);
15001
- });
15002
14839
  // src/features/check-package-scope/model/package-scope.ts
15003
14840
  const RULE$5 = "package-scope";
15004
14841
  const SCOPE = "@r_masseater/";