@r_masseater/msch 0.40.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -50,10 +50,10 @@ const overrideProblem = (located) => (report) => {
50
50
  return Option.none();
51
51
  };
52
52
  // src/shared/lib/text-position.ts
53
- const START$15 = 0;
53
+ const START$16 = 0;
54
54
  const FIRST_COLUMN$4 = 1;
55
55
  const positionOf = (source) => (index) => {
56
- const before = pipe(source, String$1.slice(START$15, index), String$1.split("\n"));
56
+ const before = pipe(source, String$1.slice(START$16, index), String$1.split("\n"));
57
57
  return {
58
58
  line: before.length,
59
59
  column: pipe(Array.last(before), Option.match({
@@ -359,55 +359,55 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, problemsIn) {
359
359
  // src/features/check-overrides/model/git-subpath.ts
360
360
  const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
361
361
  const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
362
- const RULE$42 = "git-subpath-dependency";
362
+ const RULE$43 = "git-subpath-dependency";
363
363
  const WHOLE_MATCH$3 = 0;
364
364
  const problemAt$8 = ({ file }, source) => (found) => ({
365
365
  file,
366
366
  ...positionOf(source)(found.index ?? WHOLE_MATCH$3),
367
- rule: RULE$42,
367
+ rule: RULE$43,
368
368
  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$3])}\`.`
369
369
  });
370
- const problemsIn$15 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$8(entry, source)));
370
+ const problemsIn$16 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$8(entry, source)));
371
371
  const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
372
372
  /** @internal */
373
373
  const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
374
374
  const listed = yield* listedFiles(root);
375
- return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$15);
375
+ return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$16);
376
376
  });
377
377
  // src/features/check-overrides/model/restricted-rules.ts
378
- const RULE$41 = "unnamed-restriction";
378
+ const RULE$42 = "unnamed-restriction";
379
379
  const WHOLE_MATCH$2 = 0;
380
380
  const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
381
- const problemsIn$14 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
381
+ const problemsIn$15 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
382
382
  file: entry.file,
383
383
  ...positionOf(source)(found.index ?? WHOLE_MATCH$2),
384
- rule: RULE$41,
384
+ rule: RULE$42,
385
385
  message: `${found[WHOLE_MATCH$2]} 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.`
386
386
  })));
387
387
  /** @internal */
388
388
  const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRestrictedRules(root) {
389
389
  const listed = yield* listedFiles(root);
390
- return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$14);
390
+ return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$15);
391
391
  });
392
392
  // src/features/check-overrides/model/package-registry.ts
393
- const RULE$40 = "package-registry";
393
+ const RULE$41 = "package-registry";
394
394
  const REGISTRY = "https://npm.flatt.tech/";
395
395
  const TRAILING_SLASH = /\/$/u;
396
396
  const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
397
397
  const NPMRC = /(?:^|\/)\.npmrc$/u;
398
398
  const WORKSPACE_REGISTRY = /^registry:/mu;
399
399
  const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
400
- const START$14 = 0;
400
+ const START$15 = 0;
401
401
  const REASON = `Installs go through Takumi Guard (${REGISTRY}), which blocks known-malicious packages before they are installed.`;
402
402
  const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
403
403
  const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
404
404
  const withoutSlash = String$1.replace(TRAILING_SLASH, "");
405
405
  const isGuarded = (registry) => withoutSlash(registry) === withoutSlash(REGISTRY);
406
- const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$14));
406
+ const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$15));
407
407
  const workspaceProblem = (file, source, registry) => ({
408
408
  file,
409
409
  ...positionOf(source)(offsetIn(WORKSPACE_REGISTRY.exec(source))),
410
- rule: RULE$40,
410
+ rule: RULE$41,
411
411
  message: Option.match(registry, {
412
412
  onNone: () => `${REASON} Set \`registry: ${REGISTRY}\` in ${WORKSPACE_FILE$4}.`,
413
413
  onSome: (value) => `${REASON} \`registry\` is ${value}. Set it to ${REGISTRY}.`
@@ -415,9 +415,9 @@ const workspaceProblem = (file, source, registry) => ({
415
415
  });
416
416
  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) => ({
417
417
  file: entry.file,
418
- ...positionOf(source)(found.index ?? START$14),
419
- rule: RULE$40,
420
- message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$14])}\`. Remove the line.`
418
+ ...positionOf(source)(found.index ?? START$15),
419
+ rule: RULE$41,
420
+ message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$15])}\`. Remove the line.`
421
421
  })));
422
422
  const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
423
423
  const files = yield* RepositoryFiles;
@@ -436,7 +436,7 @@ const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPa
436
436
  return [...yield* checkWorkspace(root), ...overrides];
437
437
  });
438
438
  // src/features/check-placement/model/colocated-git-patterns.ts
439
- const RULE$39 = "colocated-git-patterns";
439
+ const RULE$40 = "colocated-git-patterns";
440
440
  const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
441
441
  const ROOT$2 = ".";
442
442
  const SEPARATOR$22 = "/";
@@ -489,7 +489,7 @@ const problemAt$7 = (entry, message) => ({
489
489
  file: entry.file,
490
490
  line: entry.line,
491
491
  column: FIRST$20,
492
- rule: RULE$39,
492
+ rule: RULE$40,
493
493
  message
494
494
  });
495
495
  const misplacedMessage = (kind, workspaces) => {
@@ -551,7 +551,7 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
551
551
  return Array.getSomes([...misplacedFound, ...repeatedFound]);
552
552
  });
553
553
  // src/features/check-placement/model/colocated-tests.ts
554
- const RULE$38 = "colocated-test";
554
+ const RULE$39 = "colocated-test";
555
555
  const FIRST$19 = 1;
556
556
  const READ_CONCURRENCY$25 = 64;
557
557
  const ROOT_SUBPATH = ".";
@@ -566,20 +566,20 @@ const SPEC_FILE = /\.spec\.[cm]?[jt]sx?$/u;
566
566
  const RELATIVE_REFERENCE = /["'`]\.\/(?<name>[^/"'`]+)/gu;
567
567
  const DIRNAME_REFERENCE = /import\.meta\.dirname\s*,\s*["'](?<name>[^/"']+)["']/gu;
568
568
  const MODULE_SPECIFIER = /(?:\bfrom\s+|\bimport\s*\(\s*|\bimport\s+|\bvi\.mock\(\s*)["'](?<specifier>[^"'.#][^"']*)["']/gu;
569
- const EXCLUDED$4 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
569
+ const EXCLUDED$5 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
570
570
  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.";
571
571
  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>.";
572
- const Manifest$3 = Schema.Struct({
572
+ const Manifest$4 = Schema.Struct({
573
573
  name: Schema.optional(Schema.String),
574
574
  exports: Schema.optional(Schema.Unknown)
575
575
  });
576
- const decodeManifest$6 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$3));
576
+ const decodeManifest$7 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$4));
577
577
  const byLength$2 = Order.mapInput(Order.Number, (directory) => directory.length);
578
578
  const problemFor$6 = (test, message) => ({
579
579
  file: test.file,
580
580
  line: FIRST$19,
581
581
  column: FIRST$19,
582
- rule: RULE$38,
582
+ rule: RULE$39,
583
583
  message: `${test.base} ${message}`
584
584
  });
585
585
  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);
@@ -599,7 +599,7 @@ const ownSpecifiers = Effect.fn("ownSpecifiers")(function* ownSpecifiers(context
599
599
  if (Option.isNone(owner)) return [];
600
600
  const text = yield* files.readFile(files.join(context.root, owner.value, MANIFEST_FILE$1));
601
601
  const join = (target) => files.join(context.root, owner.value, target);
602
- return pipe(text, Option.flatMap(decodeManifest$6), Option.map(specifiersBeside({
602
+ return pipe(text, Option.flatMap(decodeManifest$7), Option.map(specifiersBeside({
603
603
  join,
604
604
  dirname: files.dirname,
605
605
  directory: test.directory
@@ -627,7 +627,7 @@ const problemIn$6 = Effect.fn("problemIn")(function* problemIn(context, test) {
627
627
  /** @internal */
628
628
  const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColocatedTests(root) {
629
629
  const files = yield* RepositoryFiles;
630
- const listed = yield* files.matchingFiles(root, EXCLUDED$4);
630
+ const listed = yield* files.matchingFiles(root, EXCLUDED$5);
631
631
  const names = pipe(listed, Array.filter(String$1.isNonEmpty));
632
632
  const context = {
633
633
  root,
@@ -662,7 +662,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
662
662
  // src/features/check-placement/model/agent-docs-length.ts
663
663
  const RECOMMENDED_LINES = 200;
664
664
  const FIRST$18 = 1;
665
- const RULE$37 = "agent-docs-length";
665
+ const RULE$38 = "agent-docs-length";
666
666
  const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
667
667
  const problemFor$5 = (file) => (lines) => {
668
668
  if (lines <= RECOMMENDED_LINES) return Option.none();
@@ -670,14 +670,14 @@ const problemFor$5 = (file) => (lines) => {
670
670
  file,
671
671
  line: 201,
672
672
  column: FIRST$18,
673
- rule: RULE$37,
673
+ rule: RULE$38,
674
674
  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.`
675
675
  });
676
676
  };
677
677
  /** @internal */
678
678
  const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$5(file)(lineCount(source)));
679
679
  // src/features/check-placement/model/dangling-links.ts
680
- const RULE$36 = "dangling-link";
680
+ const RULE$37 = "dangling-link";
681
681
  const SEPARATOR$21 = "/";
682
682
  const FIRST$17 = 1;
683
683
  const READ_CONCURRENCY$23 = 16;
@@ -693,7 +693,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
693
693
  file,
694
694
  line: FIRST$17,
695
695
  column: FIRST$17,
696
- rule: RULE$36,
696
+ rule: RULE$37,
697
697
  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.`
698
698
  })));
699
699
  });
@@ -701,7 +701,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
701
701
  return Array.getSomes(found);
702
702
  });
703
703
  // src/features/check-placement/model/nested-docs.ts
704
- const RULE$35 = "nested-docs";
704
+ const RULE$36 = "nested-docs";
705
705
  const CONFIG_FILE$6 = "vite.config.ts";
706
706
  const SEPARATOR$20 = "/";
707
707
  const FIRST$16 = 1;
@@ -717,7 +717,7 @@ const problemFor$4 = (file, message) => ({
717
717
  file,
718
718
  line: FIRST$16,
719
719
  column: FIRST$16,
720
- rule: RULE$35,
720
+ rule: RULE$36,
721
721
  message
722
722
  });
723
723
  const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
@@ -768,7 +768,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
768
768
  return Array.getSomes(found);
769
769
  });
770
770
  // src/features/check-placement/model/published-readme.ts
771
- const RULE$34 = "published-readme";
771
+ const RULE$35 = "published-readme";
772
772
  const README_FILE = "README.md";
773
773
  const READ_CONCURRENCY$21 = 16;
774
774
  const MESSAGE$11 = "contains Japanese. This package is published to npm, so write its README in English.";
@@ -782,7 +782,7 @@ const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, { directory
782
782
  file,
783
783
  line,
784
784
  column,
785
- rule: RULE$34,
785
+ rule: RULE$35,
786
786
  message: MESSAGE$11
787
787
  };
788
788
  }))));
@@ -794,7 +794,7 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
794
794
  return Array.getSomes(found);
795
795
  });
796
796
  // src/features/check-placement/model/root-docs.ts
797
- const RULE$33 = "root-docs";
797
+ const RULE$34 = "root-docs";
798
798
  const SEPARATOR$19 = "/";
799
799
  const FIRST$15 = 1;
800
800
  const MARKDOWN$1 = /\.(?:md|mdx|markdown)$/iu;
@@ -809,15 +809,15 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
809
809
  file: files.join(root, name),
810
810
  line: FIRST$15,
811
811
  column: FIRST$15,
812
- rule: RULE$33,
812
+ rule: RULE$34,
813
813
  message: `${name} ${MESSAGE$10}`
814
814
  })));
815
815
  });
816
816
  // src/features/check-placement/model/root-readme.ts
817
- const RULE$32 = "root-readme";
817
+ const RULE$33 = "root-readme";
818
818
  const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
819
819
  const READ_CONCURRENCY$20 = 16;
820
- const START$13 = 0;
820
+ const START$14 = 0;
821
821
  const CHECK_POLICY = "@r_masseater/msch";
822
822
  const MARKETPLACE = ".claude-plugin/marketplace.json";
823
823
  const RELATIVE$1 = /^\.\//u;
@@ -856,14 +856,14 @@ const patternFor = (plugins) => ({ directory, names }) => patternOf$1(Option.mat
856
856
  onNone: () => ownNames(plugins, names),
857
857
  onSome: () => [directory]
858
858
  }));
859
- const problemsIn$13 = (file, source, plugins) => (workspace) => {
859
+ const problemsIn$14 = (file, source, plugins) => (workspace) => {
860
860
  const message = messageFor(workspace.directory);
861
861
  const at = positionOf(source);
862
862
  const pattern = patternFor(plugins)(workspace);
863
863
  return pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((found) => ({
864
864
  file,
865
- ...at(found.index ?? START$13),
866
- rule: RULE$32,
865
+ ...at(found.index ?? START$14),
866
+ rule: RULE$33,
867
867
  message
868
868
  })));
869
869
  };
@@ -871,7 +871,7 @@ const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadm
871
871
  const text = yield* (yield* RepositoryFiles).readFile(file);
872
872
  return pipe(text, Option.match({
873
873
  onNone: () => [],
874
- onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$13(file, source, plugins)))
874
+ onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$14(file, source, plugins)))
875
875
  }));
876
876
  });
877
877
  /** @internal */
@@ -899,7 +899,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
899
899
  return Array.flatten(found);
900
900
  });
901
901
  // src/features/check-placement/model/docs-mirror.ts
902
- const RULE$31 = "docs-mirror";
902
+ const RULE$32 = "docs-mirror";
903
903
  const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
904
904
  const MIRROR_LIMIT = 3;
905
905
  const READ_CONCURRENCY$19 = 16;
@@ -924,7 +924,7 @@ const problemFor$3 = (file, source, mentions) => pipe(Array.head(mentions), Opti
924
924
  file,
925
925
  line,
926
926
  column,
927
- rule: RULE$31,
927
+ rule: RULE$32,
928
928
  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.`
929
929
  };
930
930
  }), Option.toArray);
@@ -956,7 +956,7 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
956
956
  return Array.flatten(found);
957
957
  });
958
958
  // src/features/check-placement/model/ignored-sources.ts
959
- const RULE$30 = "ignored-sources";
959
+ const RULE$31 = "ignored-sources";
960
960
  const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
961
961
  const FIRST$14 = 1;
962
962
  const MESSAGE$9 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
@@ -968,7 +968,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
968
968
  file: files.join(root, file),
969
969
  line: FIRST$14,
970
970
  column: FIRST$14,
971
- rule: RULE$30,
971
+ rule: RULE$31,
972
972
  message: MESSAGE$9
973
973
  })));
974
974
  });
@@ -976,7 +976,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
976
976
  const ROOT_WORKSPACE$1 = ".";
977
977
  const FIRST$13 = 1;
978
978
  const SEPARATOR$17 = "/";
979
- const EXCLUDED$3 = [
979
+ const EXCLUDED$4 = [
980
980
  ":(exclude,attr:linguist-vendored)",
981
981
  ":(exclude,attr:linguist-generated)",
982
982
  ":(exclude,attr:linguist-documentation)"
@@ -989,7 +989,7 @@ const memberSources = Effect.fn("memberSources")(function* memberSources(root) {
989
989
  const files = yield* RepositoryFiles;
990
990
  return {
991
991
  workspaces: yield* memberWorkspaces(root),
992
- listed: yield* files.matchingFiles(root, EXCLUDED$3)
992
+ listed: yield* files.matchingFiles(root, EXCLUDED$4)
993
993
  };
994
994
  });
995
995
  const byLength$1 = Order.mapInput(Order.Number, (directory) => directory.length);
@@ -9790,7 +9790,7 @@ const LAYER_ITEMS = [
9790
9790
  "inner_attribute_item"
9791
9791
  ];
9792
9792
  const READ_CONCURRENCY$18 = 64;
9793
- const EXCLUDED$2 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
9793
+ const EXCLUDED$3 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
9794
9794
  const NONE$2 = [];
9795
9795
  const OUTSIDE_MESSAGE = "sits outside src/. Put every module of a crate under src/ in an FSD layer; only build.rs and benches/ may stay outside.";
9796
9796
  const LAYER_MESSAGE = `is not an FSD layer. A crate's src/ holds only lib.rs, main.rs, bin/ and the layers ${Array.join(LAYERS, ", ")}.`;
@@ -9883,7 +9883,7 @@ const isRead = ({ inner }) => {
9883
9883
  };
9884
9884
  const rustSources = Effect.fn("rustSources")(function* rustSources(root) {
9885
9885
  const files = yield* RepositoryFiles;
9886
- const listed = yield* files.matchingFiles(root, EXCLUDED$2);
9886
+ const listed = yield* files.matchingFiles(root, EXCLUDED$3);
9887
9887
  const owner = crateOf(crateDirectories(listed));
9888
9888
  return pipe(listed, Array.filter((name) => RUST_FILE.test(name)), Array.flatMap((name) => Option.toArray(Option.map(owner(name), (owned) => ({
9889
9889
  ...owned,
@@ -9911,8 +9911,8 @@ const SOURCE_ALIAS = "#/*";
9911
9911
  const SOURCE_TARGET = "./src/*";
9912
9912
  const SOURCE_PREFIX = /^\.\/src(?:\/|$)/u;
9913
9913
  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.`;
9914
- const Manifest$2 = Schema.Struct({ imports: Schema.optional(Schema.Unknown) });
9915
- const decodeManifest$5 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$2));
9914
+ const Manifest$3 = Schema.Struct({ imports: Schema.optional(Schema.Unknown) });
9915
+ const decodeManifest$6 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$3));
9916
9916
  const problemAt$6 = (file, rule, message) => ({
9917
9917
  file,
9918
9918
  line: FIRST$12,
@@ -9930,7 +9930,7 @@ const aliasProblems = Effect.fn("aliasProblems")(function* aliasProblems(root, w
9930
9930
  const files = yield* RepositoryFiles;
9931
9931
  const manifest = files.join(root, workspace, MANIFEST_FILE$1);
9932
9932
  const text = yield* files.readFile(manifest);
9933
- return pipe(text, Option.flatMap(decodeManifest$5), Option.flatMap(({ imports }) => Option.liftPredicate(imports, Predicate.isObject)), Option.map((imports) => Record.toEntries(imports)), Option.getOrElse(() => Array.empty()), Array.filter(intoSource), Array.map(([key]) => problemAt$6(manifest, ALIAS_RULE, `"${key}" ${ALIAS_MESSAGE}`)));
9933
+ return pipe(text, Option.flatMap(decodeManifest$6), Option.flatMap(({ imports }) => Option.liftPredicate(imports, Predicate.isObject)), Option.map((imports) => Record.toEntries(imports)), Option.getOrElse(() => Array.empty()), Array.filter(intoSource), Array.map(([key]) => problemAt$6(manifest, ALIAS_RULE, `"${key}" ${ALIAS_MESSAGE}`)));
9934
9934
  });
9935
9935
  /** @internal */
9936
9936
  const checkSourceAliases = Effect.fn("checkSourceAliases")(function* checkSourceAliases(root) {
@@ -9968,13 +9968,13 @@ const FIRST$11 = 1;
9968
9968
  const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
9969
9969
  const COMMAND = /^bin\/[^/]+\.[cm]?ts$/u;
9970
9970
  const NOT_COMMAND = /\.(?:test|d|test\.support)\.[cm]?ts$/u;
9971
- const Manifest$1 = Schema.Struct({
9971
+ const Manifest$2 = Schema.Struct({
9972
9972
  bin: Schema.optional(Schema.Unknown),
9973
9973
  main: Schema.optional(Schema.Unknown),
9974
9974
  exports: Schema.optional(Schema.Unknown)
9975
9975
  });
9976
9976
  const TargetMap = Schema.Record(Schema.String, Schema.Unknown);
9977
- const decodeManifest$4 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$1));
9977
+ const decodeManifest$5 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$2));
9978
9978
  const decodeTarget = Schema.decodeUnknownOption(Schema.String);
9979
9979
  const decodeTargetMap = Schema.decodeUnknownOption(TargetMap);
9980
9980
  const NO_ENTRIES = {
@@ -10001,7 +10001,7 @@ const entriesOf$2 = (manifest) => {
10001
10001
  const declaredEntries = Effect.fn("declaredEntries")(function* declaredEntries(root, directory) {
10002
10002
  const files = yield* RepositoryFiles;
10003
10003
  const text = yield* files.readFile(files.join(root, directory, MANIFEST_FILE$1));
10004
- return pipe(text, Option.flatMap(decodeManifest$4), Option.map(entriesOf$2), Option.getOrElse(() => NO_ENTRIES));
10004
+ return pipe(text, Option.flatMap(decodeManifest$5), Option.map(entriesOf$2), Option.getOrElse(() => NO_ENTRIES));
10005
10005
  });
10006
10006
  const isCommand$1 = (path) => COMMAND.test(path) && !NOT_COMMAND.test(path);
10007
10007
  const commandFilesIn = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
@@ -10024,7 +10024,7 @@ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array.fi
10024
10024
  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.`
10025
10025
  })));
10026
10026
  const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array.flatMap(stringsIn), Array.flatMap(runsIn));
10027
- const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
10027
+ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
10028
10028
  const files = yield* RepositoryFiles;
10029
10029
  const config = yield* workspaceConfigOf(root, directory);
10030
10030
  const entries = yield* declaredEntries(root, directory);
@@ -10063,12 +10063,12 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
10063
10063
  const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
10064
10064
  const all = ["", ...yield* workspaceDirectories(root)];
10065
10065
  const workflows = yield* workflowText(root);
10066
- const found = yield* Effect.forEach(all, (directory) => problemsIn$12(root, directory, workflows), { concurrency: READ_CONCURRENCY$17 });
10066
+ const found = yield* Effect.forEach(all, (directory) => problemsIn$13(root, directory, workflows), { concurrency: READ_CONCURRENCY$17 });
10067
10067
  const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$17 });
10068
10068
  return [...Array.flatten(found), ...Array.getSomes(scripts)];
10069
10069
  });
10070
10070
  // src/features/check-repository-layout/model/crates.ts
10071
- const RULE$29 = "unverified-crate";
10071
+ const RULE$30 = "unverified-crate";
10072
10072
  const CARGO_FILE = "Cargo.toml";
10073
10073
  const CONFIG_FILE$5 = "vite.config.ts";
10074
10074
  const SEPARATOR$12 = "/";
@@ -10106,7 +10106,7 @@ const problemFor$2 = (crate, message) => ({
10106
10106
  file: crate.manifest,
10107
10107
  line: FIRST$10,
10108
10108
  column: FIRST$10,
10109
- rule: RULE$29,
10109
+ rule: RULE$30,
10110
10110
  message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
10111
10111
  });
10112
10112
  const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
@@ -10126,7 +10126,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
10126
10126
  return Array.getSomes(found);
10127
10127
  });
10128
10128
  // src/features/check-repository-layout/model/deploy-entry-patterns.ts
10129
- const RULE$28 = "deploy-entry-pattern";
10129
+ const RULE$29 = "deploy-entry-pattern";
10130
10130
  const FALLOW_KEYS = [
10131
10131
  "entry",
10132
10132
  "entryPoints",
@@ -10181,7 +10181,7 @@ const patternsOf = Effect.fn("patternsOf")(function* patternsOf(file, text, kind
10181
10181
  const parsed = yield* Effect.promise(() => parse(`${file}.ts`, kind.sourceOf(text), { lang: "ts" }));
10182
10182
  return pipe(patternsIn(kind.keys)(parsed.program), Array.filter(({ text: pattern }) => !String$1.startsWith(NEGATED)(pattern)));
10183
10183
  });
10184
- const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn(request) {
10184
+ const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(request) {
10185
10185
  const { root, file, kind, workspaces, entries } = request;
10186
10186
  const files = yield* RepositoryFiles;
10187
10187
  const path = files.join(root, file);
@@ -10197,7 +10197,7 @@ const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn(request) {
10197
10197
  return pipe(Array.getSomes(flagged), Array.map(({ text: pattern, start }) => ({
10198
10198
  file: path,
10199
10199
  ...positionOf(text.value)(start - kind.offset),
10200
- rule: RULE$28,
10200
+ rule: RULE$29,
10201
10201
  message: `${pattern} ${MESSAGE$8}`
10202
10202
  })));
10203
10203
  });
@@ -10220,7 +10220,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
10220
10220
  }];
10221
10221
  return [];
10222
10222
  }));
10223
- const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$11({
10223
+ const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$12({
10224
10224
  root,
10225
10225
  file,
10226
10226
  kind,
@@ -10230,7 +10230,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
10230
10230
  return Array.flatten(found);
10231
10231
  });
10232
10232
  // src/features/check-repository-layout/model/fallow-entries.ts
10233
- const RULE$27 = "listed-entry";
10233
+ const RULE$28 = "listed-entry";
10234
10234
  const ENTRY_KEYS = [
10235
10235
  "entry",
10236
10236
  "entryPoints",
@@ -10251,7 +10251,7 @@ const entryPatternsIn = (node) => {
10251
10251
  return pipe(childrenOf$2(node), Array.flatMap(entryPatternsIn));
10252
10252
  };
10253
10253
  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);
10254
- const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
10254
+ const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
10255
10255
  const files = yield* RepositoryFiles;
10256
10256
  const path = files.join(root, file);
10257
10257
  const text = yield* files.readFile(path);
@@ -10260,7 +10260,7 @@ const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
10260
10260
  return pipe(entryPatternsIn(parsed.program), Array.filter(namesOneFile(directories)), Array.map(({ text: pattern, start }) => ({
10261
10261
  file: path,
10262
10262
  ...positionOf(text.value)(start),
10263
- rule: RULE$27,
10263
+ rule: RULE$28,
10264
10264
  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.`
10265
10265
  })));
10266
10266
  });
@@ -10268,11 +10268,11 @@ const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
10268
10268
  const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
10269
10269
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
10270
10270
  const directories = yield* workspaceDirectories(root);
10271
- const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$10(root, file, directories), { concurrency: READ_CONCURRENCY$14 });
10271
+ const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$11(root, file, directories), { concurrency: READ_CONCURRENCY$14 });
10272
10272
  return Array.flatten(found);
10273
10273
  });
10274
10274
  // src/features/check-repository-layout/model/hidden-verify.ts
10275
- const RULE$26 = "hidden-verify";
10275
+ const RULE$27 = "hidden-verify";
10276
10276
  const CONFIG_FILE$4 = "vite.config.ts";
10277
10277
  const FIRST$9 = 1;
10278
10278
  const READ_CONCURRENCY$13 = 8;
@@ -10286,7 +10286,7 @@ const problemIn$1 = Effect.fn("problemIn")(function* problemIn(root, directory)
10286
10286
  file,
10287
10287
  line: FIRST$9,
10288
10288
  column: FIRST$9,
10289
- rule: RULE$26,
10289
+ rule: RULE$27,
10290
10290
  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}.`
10291
10291
  }).pipe(Option.filter(() => verified));
10292
10292
  });
@@ -10297,7 +10297,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
10297
10297
  return Array.getSomes(found);
10298
10298
  });
10299
10299
  // src/features/check-repository-layout/model/root-workspace-paths.ts
10300
- const RULE$25 = "root-workspace-path";
10300
+ const RULE$26 = "root-workspace-path";
10301
10301
  const CONFIG_FILE$3 = "vite.config.ts";
10302
10302
  const PATH_CHARACTER = /[\w.@/-]/u;
10303
10303
  const NAME_CHARACTER = /[\w.@-]/u;
@@ -10313,10 +10313,10 @@ const mentions$1 = (directory) => (text) => {
10313
10313
  return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
10314
10314
  }));
10315
10315
  };
10316
- const problemsIn$9 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions$1(directory)(found.text)), Array.map((directory) => ({
10316
+ const problemsIn$10 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions$1(directory)(found.text)), Array.map((directory) => ({
10317
10317
  file,
10318
10318
  ...positionOf(source)(found.start),
10319
- rule: RULE$25,
10319
+ rule: RULE$26,
10320
10320
  message: `${directory} is a workspace. The root ${CONFIG_FILE$3} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$3}: msch.lint, msch.devDependencies or its verify task.`
10321
10321
  })));
10322
10322
  /** @internal */
@@ -10327,10 +10327,10 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
10327
10327
  if (Option.isNone(source)) return [];
10328
10328
  const directories = yield* workspaceDirectories(root);
10329
10329
  const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
10330
- return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$9(file, source.value, directories)));
10330
+ return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$10(file, source.value, directories)));
10331
10331
  });
10332
10332
  // src/features/check-repository-layout/model/shared-uncached-tasks.ts
10333
- const RULE$24 = "shared-uncached-task";
10333
+ const RULE$25 = "shared-uncached-task";
10334
10334
  const READ_CONCURRENCY$12 = 8;
10335
10335
  const SHARED = 2;
10336
10336
  const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
@@ -10373,7 +10373,7 @@ const problemsOf$2 = (definitions) => {
10373
10373
  return pipe(definitions, Array.map(({ file, position, name, command }) => ({
10374
10374
  file,
10375
10375
  ...position,
10376
- rule: RULE$24,
10376
+ rule: RULE$25,
10377
10377
  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.`
10378
10378
  })));
10379
10379
  };
@@ -10519,7 +10519,7 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
10519
10519
  /** @internal */
10520
10520
  const producedPaths = (source) => pipe(jobsOf(source), Array.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array.flatMap(outputPathsOf));
10521
10521
  // src/features/check-repository-layout/model/workflow-paths.ts
10522
- const RULE$23 = "workflow-path";
10522
+ const RULE$24 = "workflow-path";
10523
10523
  const WORKFLOW_DIRECTORY = ".github/workflows/";
10524
10524
  const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
10525
10525
  const READ_CONCURRENCY$11 = 8;
@@ -10585,10 +10585,10 @@ const isMissing = Effect.fn("isMissing")(function* isMissing(root, produced, fou
10585
10585
  const problemOf$8 = (file, source) => (found) => ({
10586
10586
  file,
10587
10587
  ...positionOf(source)(found.offset),
10588
- rule: RULE$23,
10588
+ rule: RULE$24,
10589
10589
  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.`
10590
10590
  });
10591
- const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
10591
+ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
10592
10592
  const files = yield* RepositoryFiles;
10593
10593
  const file = files.join(root, workflow);
10594
10594
  const source = yield* files.readFile(file);
@@ -10600,7 +10600,7 @@ const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, workflow
10600
10600
  /** @internal */
10601
10601
  const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
10602
10602
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
10603
- const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$8(root, workflow), { concurrency: READ_CONCURRENCY$11 });
10603
+ const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$9(root, workflow), { concurrency: READ_CONCURRENCY$11 });
10604
10604
  return Array.flatten(found);
10605
10605
  });
10606
10606
  // src/features/check-repository-layout/model/workflow-scale.ts
@@ -10611,7 +10611,7 @@ const ACTION = /^\.github\/actions\/(?<name>[^/]+)\/action\.ya?ml$/u;
10611
10611
  const FILTER_KEYS = ["paths", "paths-ignore"];
10612
10612
  const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
10613
10613
  const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
10614
- const START$12 = 0;
10614
+ const START$13 = 0;
10615
10615
  const READ_CONCURRENCY$10 = 8;
10616
10616
  const SEPARATOR$8 = "/";
10617
10617
  const WORD_SEPARATORS = /[-_]/gu;
@@ -10642,7 +10642,7 @@ const namesIn = (name, source) => {
10642
10642
  return [
10643
10643
  {
10644
10644
  text: name,
10645
- offset: START$12
10645
+ offset: START$13
10646
10646
  },
10647
10647
  ...Option.toArray(stringOf(childOf("name")(root))),
10648
10648
  ...keysOf$1(childOf("jobs")(root))
@@ -10713,7 +10713,7 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
10713
10713
  return Array.flatten(found);
10714
10714
  });
10715
10715
  // src/features/check-typescript-generation/model/typescript-generation.ts
10716
- const RULE$22 = "legacy-typescript";
10716
+ const RULE$23 = "legacy-typescript";
10717
10717
  const LOCKFILE = "pnpm-lock.yaml";
10718
10718
  const COMPILER = "typescript";
10719
10719
  const CURRENT_MAJOR = 7;
@@ -10744,7 +10744,7 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
10744
10744
  file,
10745
10745
  line: lineOf$2(source)(legacy.id),
10746
10746
  column: FIRST$6,
10747
- rule: RULE$22,
10747
+ rule: RULE$23,
10748
10748
  message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
10749
10749
  })));
10750
10750
  });
@@ -11131,7 +11131,7 @@ const projectInputs = ({ workspace: { compiler, root }, listed }) => (configPath
11131
11131
  const RELATIVE = /^\.\.?(?:\/|$)/u;
11132
11132
  const SUBPATH_IMPORT = "#";
11133
11133
  const WILDCARD$1 = "*";
11134
- const SCOPE$1 = "@";
11134
+ const SCOPE$2 = "@";
11135
11135
  const SEPARATOR$6 = "/";
11136
11136
  const SOURCE_SUFFIXES = [
11137
11137
  "",
@@ -11145,7 +11145,7 @@ const ImportsField = Schema.Struct({ imports: Schema.optional(Schema.Record(Sche
11145
11145
  const decodeImports = Schema.decodeOption(Schema.fromJsonString(ImportsField));
11146
11146
  const packageNameOf = (specifier) => {
11147
11147
  const segments = String$1.split(specifier, SEPARATOR$6);
11148
- if (String$1.startsWith(SCOPE$1)(specifier)) return pipe(segments, Array.take(SCOPED_SEGMENTS), Array.join(SEPARATOR$6));
11148
+ if (String$1.startsWith(SCOPE$2)(specifier)) return pipe(segments, Array.take(SCOPED_SEGMENTS), Array.join(SEPARATOR$6));
11149
11149
  return pipe(segments, Array.take(PLAIN_SEGMENTS), Array.join(SEPARATOR$6));
11150
11150
  };
11151
11151
  const literalText = (specifier) => pipe(Option.liftPredicate(specifier, isStringLiteral), Option.map((literal) => literal.text));
@@ -11241,7 +11241,7 @@ const InstalledManifest = Schema.Struct({
11241
11241
  peerDependencies: DependencyMap,
11242
11242
  peerDependenciesMeta: PeerMeta
11243
11243
  });
11244
- const decodeManifest$3 = Schema.decodeOption(Schema.fromJsonString(InstalledManifest));
11244
+ const decodeManifest$4 = Schema.decodeOption(Schema.fromJsonString(InstalledManifest));
11245
11245
  const keysOf = (map) => pipe(Option.fromUndefinedOr(map), Option.map(Record.keys), Option.getOrElse(() => []));
11246
11246
  const isOptionalPeer = (manifest, name) => pipe(Option.fromUndefinedOr(manifest.peerDependenciesMeta), Option.flatMap(Record.get(name)), Option.exists((meta) => meta.optional === true));
11247
11247
  const installedNames = (manifest) => [
@@ -11252,7 +11252,7 @@ const installedNames = (manifest) => [
11252
11252
  const childrenOf$1 = Effect.fn("childrenOf")(function* childrenOf(directory) {
11253
11253
  const files = yield* RepositoryFiles;
11254
11254
  const text = yield* files.readFile(files.join(directory, MANIFEST_FILE$1));
11255
- return pipe(text, Option.flatMap(decodeManifest$3), Option.map(installedNames), Option.getOrElse(() => []), Array.map((child) => [directory, child]));
11255
+ return pipe(text, Option.flatMap(decodeManifest$4), Option.map(installedNames), Option.getOrElse(() => []), Array.map((child) => [directory, child]));
11256
11256
  });
11257
11257
  const resolveFrom = (from, name) => Effect.gen(function* resolvePackage() {
11258
11258
  const files = yield* RepositoryFiles;
@@ -11314,11 +11314,11 @@ const LISTED_LARGEST = 5;
11314
11314
  const SIZE_CONCURRENCY = 32;
11315
11315
  const MEGABYTE = 1e6;
11316
11316
  const MEGABYTE_DIGITS = 1;
11317
- const START$11 = 0;
11317
+ const START$12 = 0;
11318
11318
  const SINGLE_ENTRY = 1;
11319
11319
  const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
11320
11320
  const usageHint = (dependency, entryCount) => {
11321
- if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$11 && dependency.entries.length < entryCount)) return "";
11321
+ if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$12 && dependency.entries.length < entryCount)) return "";
11322
11322
  return ` (imported only from ${Array.join(dependency.entries, ", ")})`;
11323
11323
  };
11324
11324
  const listed = ({ largest, entryCount }) => pipe(largest, Array.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array.join(", "));
@@ -11327,7 +11327,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
11327
11327
  const { workspace, total } = overrun;
11328
11328
  const config = yield* files.readFile(workspace.configFile);
11329
11329
  const source = Option.getOrElse(config, () => "");
11330
- const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$11);
11330
+ const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$12);
11331
11331
  return {
11332
11332
  file: workspace.configFile,
11333
11333
  ...positionOf(source)(index),
@@ -11344,7 +11344,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
11344
11344
  const everything = pipe(closures, Array.flatMap(([, packages]) => Array.fromIterable(packages)), HashSet.fromIterable);
11345
11345
  const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
11346
11346
  const sizes = HashMap.fromIterable(measured);
11347
- const sizeOf = (packages) => Number$1.sumAll(pipe(Array.fromIterable(packages), Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$11))));
11347
+ const sizeOf = (packages) => Number$1.sumAll(pipe(Array.fromIterable(packages), Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$12))));
11348
11348
  return {
11349
11349
  closures,
11350
11350
  sizeOf,
@@ -11377,11 +11377,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
11377
11377
  })];
11378
11378
  });
11379
11379
  const stackProblems = (file, source, dependencies) => {
11380
- const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(source), () => START$11);
11380
+ const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(source), () => START$12);
11381
11381
  const rest = String$1.slice(section)(source);
11382
11382
  return pipe(Record.toEntries(dependencies), Array.filter(([, specifier]) => specifier === STACK_CATALOG), Array.map(([name]) => ({
11383
11383
  file,
11384
- ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$11)),
11384
+ ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$12)),
11385
11385
  rule: STACK_DEPENDENCY,
11386
11386
  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.`
11387
11387
  })));
@@ -12035,7 +12035,7 @@ const duplicateProblems = (relative) => (sites) => {
12035
12035
  }))));
12036
12036
  };
12037
12037
  // src/features/check-value-owners/model/name-lists.ts
12038
- const RULE$21 = "hand-written-names";
12038
+ const RULE$22 = "hand-written-names";
12039
12039
  const TEST_FILE = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
12040
12040
  const nameListOf = (site) => {
12041
12041
  if (TEST_FILE.test(site.file) || site.values.length < 2) return Option.none();
@@ -12050,7 +12050,7 @@ const problemOf$7 = ({ list, reason }) => ({
12050
12050
  file: list.site.file,
12051
12051
  line: list.site.line,
12052
12052
  column: list.site.column,
12053
- rule: RULE$21,
12053
+ rule: RULE$22,
12054
12054
  message: `The names ${formatValues(list.names)} are listed by hand, but ${reason}`
12055
12055
  });
12056
12056
  // src/features/check-value-owners/model/declared-names.ts
@@ -12159,13 +12159,13 @@ const MANIFEST$2 = "package.json";
12159
12159
  const SEPARATOR$4 = "/";
12160
12160
  const FIRST_SEGMENT = 1;
12161
12161
  const ManifestJson = Schema.fromJsonString(Schema.Struct({ name: Schema.optionalKey(Schema.String) }));
12162
- const decodeManifest$2 = Schema.decodeUnknownOption(ManifestJson);
12162
+ const decodeManifest$3 = Schema.decodeUnknownOption(ManifestJson);
12163
12163
  const prefixesOf = (file) => {
12164
12164
  const segments = pipe(file, String$1.split(SEPARATOR$4));
12165
12165
  return pipe(Array.range(FIRST_SEGMENT, segments.length), Array.map((count) => pipe(Array.take(segments, count), Array.join(SEPARATOR$4))));
12166
12166
  };
12167
12167
  const directoriesOf$1 = (file) => pipe(prefixesOf(file), Array.dropRight(FIRST_SEGMENT));
12168
- const nameOf = (text) => pipe(text, Option.flatMap(decodeManifest$2), Option.flatMap((parsed) => Option.fromUndefinedOr(parsed.name)));
12168
+ const nameOf = (text) => pipe(text, Option.flatMap(decodeManifest$3), Option.flatMap((parsed) => Option.fromUndefinedOr(parsed.name)));
12169
12169
  const repositoryNamesOf = Effect.fn("repositoryNamesOf")(function* repositoryNamesOf(root) {
12170
12170
  const files = yield* RepositoryFiles;
12171
12171
  const listed = yield* files.listedFiles(root);
@@ -12277,7 +12277,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
12277
12277
  return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
12278
12278
  }, Effect.scoped);
12279
12279
  // src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
12280
- const RULE$20 = "namespace-destructuring";
12280
+ const RULE$21 = "namespace-destructuring";
12281
12281
  const LOCAL = /^[.#/]/u;
12282
12282
  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.`;
12283
12283
  const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
@@ -12293,7 +12293,7 @@ const destructuredName = (declaration) => {
12293
12293
  return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
12294
12294
  };
12295
12295
  const problemOf$6 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$9({
12296
- rule: RULE$20,
12296
+ rule: RULE$21,
12297
12297
  message: messageOf$1(name)
12298
12298
  })), Option.map((report) => report(declaration)));
12299
12299
  const namespaceDestructuringIn = () => (sourceFile) => {
@@ -12301,7 +12301,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
12301
12301
  return pipe(descendantsOf(sourceFile), Array.filter(isVariableDeclaration), Array.map(problemOf$6(names)), Array.getSomes);
12302
12302
  };
12303
12303
  // src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
12304
- const RULE$19 = "pass-through-wrapper";
12304
+ const RULE$20 = "pass-through-wrapper";
12305
12305
  const SINGLE_STATEMENT = 1;
12306
12306
  const SINGLE_DECLARATION = 1;
12307
12307
  const THIS_PARAMETER = "this";
@@ -12398,7 +12398,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
12398
12398
  const problemOf$5 = (checker) => (candidate) => {
12399
12399
  if (changesTheCall(candidate.wrapper)) return Option.none();
12400
12400
  return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$9({
12401
- rule: RULE$19,
12401
+ rule: RULE$20,
12402
12402
  message: messageOf(forward.callee.getText())
12403
12403
  })(candidate.name)));
12404
12404
  };
@@ -12407,20 +12407,20 @@ const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(so
12407
12407
  /** @internal */
12408
12408
  const checkSources = (root) => checkRepository(root, [passThroughWrappersIn, namespaceDestructuringIn]);
12409
12409
  // src/features/check-agent-settings/model/missing-hooks.ts
12410
- const RULE$18 = "missing-hook";
12410
+ const RULE$19 = "missing-hook";
12411
12411
  const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
12412
12412
  const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
12413
12413
  const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
12414
12414
  const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
12415
12415
  const PLUGIN_ROOT = "..";
12416
12416
  const READ_CONCURRENCY$9 = 16;
12417
- const START$10 = 0;
12417
+ const START$11 = 0;
12418
12418
  const referenceOf$1 = (found) => pipe(groupOf$2("path")(found), Option.filter(() => Option.isNone(groupOf$2("optional")(found))), Option.map((path) => ({
12419
12419
  path,
12420
- index: found.index ?? START$10
12420
+ index: found.index ?? START$11
12421
12421
  })), Option.toArray);
12422
12422
  const referencesIn$1 = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap(referenceOf$1));
12423
- const problemsIn$7 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
12423
+ const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
12424
12424
  const files = yield* RepositoryFiles;
12425
12425
  const text = yield* files.readFile(file);
12426
12426
  if (Option.isNone(text)) return [];
@@ -12432,7 +12432,7 @@ const problemsIn$7 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
12432
12432
  return pipe(missing, Array.map(({ path, index }) => ({
12433
12433
  file,
12434
12434
  ...positionOf(source)(index),
12435
- rule: RULE$18,
12435
+ rule: RULE$19,
12436
12436
  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.`
12437
12437
  })));
12438
12438
  });
@@ -12456,14 +12456,14 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
12456
12456
  }];
12457
12457
  return [];
12458
12458
  }));
12459
- const found = yield* Effect.forEach(hookFiles, problemsIn$7, { concurrency: READ_CONCURRENCY$9 });
12459
+ const found = yield* Effect.forEach(hookFiles, problemsIn$8, { concurrency: READ_CONCURRENCY$9 });
12460
12460
  return Array.flatten(found);
12461
12461
  });
12462
12462
  // src/features/check-markdown/model/markdown.ts
12463
12463
  const taggedError$4 = Schema.TaggedError;
12464
12464
  var MarkdownConfigUnreadable = class extends taggedError$4()("MarkdownConfigUnreadable", { file: Schema.String }) {};
12465
12465
  const CONFIG_FILE$2 = "vite.config.ts";
12466
- const RULE$17 = "markdown";
12466
+ const RULE$18 = "markdown";
12467
12467
  const FIRST$5 = 1;
12468
12468
  const sectionAt = Effect.fn("markdownSection")(function* sectionAt(file) {
12469
12469
  if (!(yield* (yield* RepositoryFiles).exists(file))) return Option.none();
@@ -12477,14 +12477,14 @@ const problemOf$4 = (root, join) => (diagnostic) => ({
12477
12477
  file: join(root, diagnostic.path),
12478
12478
  line: diagnostic.line,
12479
12479
  column: diagnostic.column ?? FIRST$5,
12480
- rule: RULE$17,
12480
+ rule: RULE$18,
12481
12481
  message: `${diagnostic.rule} ${diagnostic.message}${diagnosticDetail(diagnostic)}`
12482
12482
  });
12483
12483
  const failureAt = (file, message) => [{
12484
12484
  file,
12485
12485
  line: FIRST$5,
12486
12486
  column: FIRST$5,
12487
- rule: RULE$17,
12487
+ rule: RULE$18,
12488
12488
  message
12489
12489
  }];
12490
12490
  const checkMarkdown = Effect.fn("checkMarkdown")(function* checkMarkdown(root) {
@@ -12507,7 +12507,7 @@ const EXTENSION = /\.[^./]+$/u;
12507
12507
  const SETTINGS_FILE = ".claude/settings.json";
12508
12508
  const READ_CONCURRENCY$8 = 64;
12509
12509
  const FIRST$4 = 1;
12510
- const RULE$16 = "shell-script";
12510
+ const RULE$17 = "shell-script";
12511
12511
  const MESSAGE$7 = "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.";
12512
12512
  const HookSchema = Schema.Struct({
12513
12513
  command: Schema.optional(Schema.String),
@@ -12530,7 +12530,7 @@ const problemFor$1 = (file) => ({
12530
12530
  file,
12531
12531
  line: FIRST$4,
12532
12532
  column: FIRST$4,
12533
- rule: RULE$16,
12533
+ rule: RULE$17,
12534
12534
  message: MESSAGE$7
12535
12535
  });
12536
12536
  /** @internal */
@@ -12567,8 +12567,8 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
12567
12567
  });
12568
12568
  // src/shared/lib/workflow-run.ts
12569
12569
  const RUN_KEY = "run";
12570
- const START$9 = 0;
12571
- const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$9));
12570
+ const START$10 = 0;
12571
+ const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$10));
12572
12572
  const runScriptsOf = (source) => {
12573
12573
  const found = [];
12574
12574
  visit(parseDocument(source), { Pair: (_key, pair) => {
@@ -12583,7 +12583,7 @@ const runScriptsOf = (source) => {
12583
12583
  const COMMAND_CHAIN = /&&|\|\||;|\|/u;
12584
12584
  const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
12585
12585
  const COMMENT = "#";
12586
- const RULE$15 = "workflow-script";
12586
+ const RULE$16 = "workflow-script";
12587
12587
  const ONE_COMMAND = 1;
12588
12588
  const MESSAGE$6 = "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.";
12589
12589
  const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
@@ -12592,19 +12592,19 @@ const runsMoreThanOneCommand = ({ text }) => {
12592
12592
  const lines = pipe(String$1.split("\n")(text), Array.map(String$1.trim), Array.filter(isCommand));
12593
12593
  return lines.length > ONE_COMMAND || pipe(lines, Array.some(chainsCommands));
12594
12594
  };
12595
- const problemsIn$6 = (file) => (source) => {
12595
+ const problemsIn$7 = (file) => (source) => {
12596
12596
  const at = positionOf(source);
12597
12597
  return pipe(runScriptsOf(source), Array.filter(runsMoreThanOneCommand), Array.map(({ start }) => ({
12598
12598
  file,
12599
12599
  ...at(start),
12600
- rule: RULE$15,
12600
+ rule: RULE$16,
12601
12601
  message: MESSAGE$6
12602
12602
  })));
12603
12603
  };
12604
12604
  /** @internal */
12605
12605
  const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
12606
12606
  const workflows = yield* readWorkflows(root);
12607
- return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$6(file)(source)));
12607
+ return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$7(file)(source)));
12608
12608
  });
12609
12609
  // src/features/check-scripts/model/script-checks.ts
12610
12610
  /** @internal */
@@ -12701,24 +12701,24 @@ const docSources = (file) => (source) => {
12701
12701
  const ROOT_DIRECTORY = ".";
12702
12702
  const COMMAND_KEY = "command";
12703
12703
  const ARGUMENTS_KEY = "args";
12704
- const EXCLUDED$1 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
12705
- const MANIFESTS = [`:(glob)**/${MANIFEST_FILE$1}`, ...EXCLUDED$1];
12704
+ const EXCLUDED$2 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
12705
+ const MANIFESTS = [`:(glob)**/${MANIFEST_FILE$1}`, ...EXCLUDED$2];
12706
12706
  const STEP_FILES = [
12707
12707
  ":(glob).github/workflows/*.yml",
12708
12708
  ":(glob).github/workflows/*.yaml",
12709
12709
  ":(glob)**/action.yml",
12710
12710
  ":(glob)**/action.yaml",
12711
- ...EXCLUDED$1
12711
+ ...EXCLUDED$2
12712
12712
  ];
12713
12713
  const HOOK_FILES = [":(glob).vite-hooks/*"];
12714
12714
  const AGENT_FILES = [".claude/settings.json", ".mcp.json"];
12715
12715
  const AGENT_DOCS = [
12716
12716
  ":(glob)**/AGENTS.md",
12717
12717
  ":(glob)**/CLAUDE.md",
12718
- ...EXCLUDED$1
12718
+ ...EXCLUDED$2
12719
12719
  ];
12720
12720
  const READ_CONCURRENCY$6 = 16;
12721
- const START$8 = 0;
12721
+ const START$9 = 0;
12722
12722
  const FIRST$3 = 1;
12723
12723
  const LINE = "\n";
12724
12724
  const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
@@ -12728,7 +12728,7 @@ const decodeScripts = Schema.decodeUnknownOption(Schema.fromJsonString(Scripts))
12728
12728
  const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
12729
12729
  const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
12730
12730
  const NO_SOURCES = [];
12731
- const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$8));
12731
+ const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$9));
12732
12732
  const scriptSources = (file) => (source) => pipe(decodeScripts(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array.map(([name, text]) => {
12733
12733
  const offset = offsetOf$2(source, `"${name}"`);
12734
12734
  return {
@@ -12824,7 +12824,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
12824
12824
  return Array.flatten(found);
12825
12825
  });
12826
12826
  // src/features/check-vite-plus/model/package-scripts.ts
12827
- const RULE$14 = "package-script";
12827
+ const RULE$15 = "package-script";
12828
12828
  const LIFECYCLE = [
12829
12829
  "preinstall",
12830
12830
  "install",
@@ -12847,12 +12847,12 @@ const LIFECYCLE = [
12847
12847
  const problemOf$3 = ({ file, position, name }) => ({
12848
12848
  file,
12849
12849
  ...position,
12850
- rule: RULE$14,
12850
+ rule: RULE$15,
12851
12851
  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.`
12852
12852
  });
12853
12853
  const packageScriptProblems = (sources) => pipe(sources, Array.filter(({ kind, name }) => kind === "script" && !Array.contains(LIFECYCLE, name)), Array.map(problemOf$3));
12854
12854
  // src/features/check-vite-plus/model/vite-plus-block.ts
12855
- const RULE$13 = "vite-plus-block";
12855
+ const RULE$14 = "vite-plus-block";
12856
12856
  const MARKER = Array.join([
12857
12857
  "<!--",
12858
12858
  "VITE PLUS START",
@@ -12865,7 +12865,7 @@ const problemIn = (file) => (source) => {
12865
12865
  return Option.some({
12866
12866
  file,
12867
12867
  ...positionOf(source)(index.value),
12868
- rule: RULE$13,
12868
+ rule: RULE$14,
12869
12869
  message: MESSAGE$5
12870
12870
  });
12871
12871
  };
@@ -12910,17 +12910,17 @@ const workflowCheck = ({ rule, message, offsetsOf }) => Effect.fn(rule)(function
12910
12910
  // src/features/check-workflows/model/full-history-checkout.ts
12911
12911
  const DEPTH_KEY = "fetch-depth";
12912
12912
  const WHOLE_HISTORY = "0";
12913
- const RULE$12 = "full-history-checkout";
12913
+ const RULE$13 = "full-history-checkout";
12914
12914
  const MESSAGE$4 = "fetches the whole history with `fetch-depth: 0`. Fetch only the commits the job reads.";
12915
12915
  const fullHistoryOffsetsOf = (source) => pipe(pairsNamed(DEPTH_KEY)(source), Array.filter(({ value }) => isScalar(value) && String(value.value) === WHOLE_HISTORY), Array.flatMap(({ key }) => pipe(Option.liftPredicate(key, isScalar), Option.flatMap((scalar) => Option.fromNullishOr(scalar.range)), Option.map(([start]) => start), Option.toArray)));
12916
12916
  /** @internal */
12917
12917
  const checkFullHistoryCheckout = workflowCheck({
12918
- rule: RULE$12,
12918
+ rule: RULE$13,
12919
12919
  message: MESSAGE$4,
12920
12920
  offsetsOf: fullHistoryOffsetsOf
12921
12921
  });
12922
12922
  // src/features/check-workflows/model/release-pr-auto-merge.ts
12923
- const RULE$11 = "release-pr-auto-merge";
12923
+ const RULE$12 = "release-pr-auto-merge";
12924
12924
  const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
12925
12925
  const AUTO_MERGE = /\bgh\s+pr\s+merge\b[^\n]*--auto\b/u;
12926
12926
  const MESSAGE$3 = "opens a release PR with release-please but no later step in the job turns on its auto-merge. The merge queue only moves PRs with auto-merge, so the release PR falls behind main and waits for someone. Add a step after it that runs `gh pr merge --auto --squash` on the PR from the action's `pr` output with the token that opened it.";
@@ -12938,24 +12938,24 @@ const unqueuedOffsetsOf = (steps) => pipe(steps, Array.flatMap((step, index) =>
12938
12938
  const releasePrOffsetsOf = (source) => pipe(pairsNamed("steps")(source), Array.flatMap(({ value }) => unqueuedOffsetsOf(stepsOf(value))));
12939
12939
  /** @internal */
12940
12940
  const checkReleasePrAutoMerge = workflowCheck({
12941
- rule: RULE$11,
12941
+ rule: RULE$12,
12942
12942
  message: MESSAGE$3,
12943
12943
  offsetsOf: releasePrOffsetsOf
12944
12944
  });
12945
12945
  // src/features/check-workflows/model/workflow-queue.ts
12946
12946
  const CONCURRENCY_KEY = "concurrency";
12947
12947
  const QUEUE_KEY = "queue";
12948
- const RULE$10 = "workflow-queue";
12948
+ const RULE$11 = "workflow-queue";
12949
12949
  const MESSAGE$2 = "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.";
12950
12950
  const queueOffsetsOf = (source) => pipe(pairsNamed(CONCURRENCY_KEY)(source), Array.flatMap((pair) => Option.toArray(keyOffsetIn(QUEUE_KEY)(pair.value))));
12951
12951
  /** @internal */
12952
12952
  const checkWorkflowQueues = workflowCheck({
12953
- rule: RULE$10,
12953
+ rule: RULE$11,
12954
12954
  message: MESSAGE$2,
12955
12955
  offsetsOf: queueOffsetsOf
12956
12956
  });
12957
12957
  // src/features/check-workflows/model/workflow-commits.ts
12958
- const RULE$9 = "workflow-commit";
12958
+ const RULE$10 = "workflow-commit";
12959
12959
  const GIT_WRITE = /\bgit\s+(?:-{1,2}\S+\s+(?:\S+\s+)?)*(?:commit|push)\b/u;
12960
12960
  const COMMIT_ACTION = /^[^@/]+\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;
12961
12961
  const MESSAGE$1 = "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.";
@@ -12963,7 +12963,7 @@ const offsetsWhere = (name, pattern) => (source) => pipe(pairsNamed(name)(source
12963
12963
  const commitOffsetsOf = (source) => [...offsetsWhere("run", GIT_WRITE)(source), ...offsetsWhere("uses", COMMIT_ACTION)(source)];
12964
12964
  /** @internal */
12965
12965
  const checkWorkflowCommits = workflowCheck({
12966
- rule: RULE$9,
12966
+ rule: RULE$10,
12967
12967
  message: MESSAGE$1,
12968
12968
  offsetsOf: commitOffsetsOf
12969
12969
  });
@@ -13073,7 +13073,7 @@ const COMMENT_NODES = [
13073
13073
  "block_comment",
13074
13074
  "multiline_comment"
13075
13075
  ];
13076
- const START$7 = 0;
13076
+ const START$8 = 0;
13077
13077
  const NEXT = 1;
13078
13078
  const NONE$1 = [];
13079
13079
  const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
@@ -13126,7 +13126,7 @@ const markupComment = (source) => (node) => {
13126
13126
  }];
13127
13127
  };
13128
13128
  const textComments = (grammars, grammar) => (text) => {
13129
- const shift = shifted(text.startIndex ?? START$7);
13129
+ const shift = shifted(text.startIndex ?? START$8);
13130
13130
  return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array.map(shift)));
13131
13131
  };
13132
13132
  const embeddedComments = (grammars) => (node) => {
@@ -13162,11 +13162,11 @@ const commentsWith = (grammars) => (reader, source) => {
13162
13162
  }[reader](source);
13163
13163
  };
13164
13164
  // src/features/ban-comments/model/comments.ts
13165
- const RULE$8 = "comment";
13165
+ const RULE$9 = "comment";
13166
13166
  const CONFIG_FILE$1 = "vite.config.ts";
13167
13167
  const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
13168
13168
  const READ_CONCURRENCY$5 = 64;
13169
- const START$6 = 0;
13169
+ const START$7 = 0;
13170
13170
  const FIRST_LINE$4 = 1;
13171
13171
  const FIRST_COLUMN$3 = 1;
13172
13172
  const READERS$1 = [
@@ -13223,23 +13223,23 @@ const shebangReader = (source) => {
13223
13223
  const readerOf = (name, source) => pipe(READERS$1, Array.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
13224
13224
  const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
13225
13225
  const lineBefore = (source, index) => {
13226
- const lines = pipe(source, String$1.slice(START$6, index), String$1.split("\n"));
13226
+ const lines = pipe(source, String$1.slice(START$7, index), String$1.split("\n"));
13227
13227
  return Option.getOrElse(Array.last(lines), () => "");
13228
13228
  };
13229
13229
  const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
13230
- const isShebang = ({ index, text }) => index === START$6 && String$1.startsWith(SHEBANG)(text);
13230
+ const isShebang = ({ index, text }) => index === START$7 && String$1.startsWith(SHEBANG)(text);
13231
13231
  const isAllowed = (source, directives) => (comment) => isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment);
13232
13232
  const problemOf$2 = (file, source) => ({ index }) => ({
13233
13233
  file,
13234
13234
  ...positionOf(source)(index),
13235
- rule: RULE$8,
13235
+ rule: RULE$9,
13236
13236
  message: MESSAGE
13237
13237
  });
13238
13238
  const unreadableProblem = (file, message) => ({
13239
13239
  file,
13240
13240
  line: FIRST_LINE$4,
13241
13241
  column: FIRST_COLUMN$3,
13242
- rule: RULE$8,
13242
+ rule: RULE$9,
13243
13243
  message: `msch could not read the comments in this file: ${message}`
13244
13244
  });
13245
13245
  const settingsOf = ({ msch, lint }) => ({
@@ -13389,7 +13389,7 @@ const UNUSED_RULE = "unused-catalog-entry";
13389
13389
  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.";
13390
13390
  const UNUSED_MESSAGE = "is a catalog entry no package refers to. Remove it, so the catalog holds only versions in use.";
13391
13391
  const FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);
13392
- const decodeManifest$1 = Schema.decodeUnknownOption(Schema.fromJsonString(FieldsSchema));
13392
+ const decodeManifest$2 = Schema.decodeUnknownOption(Schema.fromJsonString(FieldsSchema));
13393
13393
  const decodeFields$1 = Schema.decodeUnknownOption(FieldsSchema);
13394
13394
  const decodeString$1 = Schema.decodeUnknownOption(Schema.String);
13395
13395
  const decodeStrings = Schema.decodeUnknownOption(Schema.Array(Schema.String));
@@ -13418,7 +13418,7 @@ const usedReferences = Effect.fn("usedReferences")(function* usedReferences(root
13418
13418
  const files = yield* RepositoryFiles;
13419
13419
  const listed = yield* files.listedFiles(root);
13420
13420
  const manifests = yield* Effect.forEach(pipe(listed, Array.filter((name) => MANIFEST$1.test(name))), (name) => files.readFile(files.join(root, name)), { concurrency: READ_CONCURRENCY$4 });
13421
- const fromManifests = pipe(Array.getSomes(manifests), Array.flatMap((text) => Option.toArray(decodeManifest$1(text))), Array.flatMap(referencesIn));
13421
+ const fromManifests = pipe(Array.getSomes(manifests), Array.flatMap((text) => Option.toArray(decodeManifest$2(text))), Array.flatMap(referencesIn));
13422
13422
  const fromOverrides = pipe(fieldsOf$1(settings["overrides"]), Record.toEntries, Array.flatMap(referenceOf));
13423
13423
  return /* @__PURE__ */ new Set([...fromManifests, ...fromOverrides]);
13424
13424
  });
@@ -13460,93 +13460,6 @@ const checkCatalogEntries = Effect.fn("checkCatalogEntries")(function* checkCata
13460
13460
  onSome: (settings) => findingsIn(root, files.join(root, WORKSPACE_FILE$3), fieldsOf$1(settings))
13461
13461
  });
13462
13462
  });
13463
- // src/features/check-runtime-version/model/node-version.ts
13464
- const RULE$7 = "node-version";
13465
- const MINIMUM = 26;
13466
- const SUPPORTED = `Node.js ${String(MINIMUM)} or later is the only supported runtime.`;
13467
- const MANIFEST = /(?:^|\/)package\.json$/u;
13468
- const VERSION_FILE = /(?:^|\/)(?:\.node-version|\.nvmrc)$/u;
13469
- const DOCKERFILE = /(?:^|\/)(?:Dockerfile|Containerfile)[^/]*$/u;
13470
- const STEP_FILE = /^\.github\/.*\.ya?ml$|(?:^|\/)action\.ya?ml$/u;
13471
- const PINNED_VERSION = /^\s*v?(?<major>\d+)/u;
13472
- const BASE_IMAGE = /^FROM[ \t]+(?:--\S+[ \t]+)*(?:[\w.-]+(?::\d+)?\/)*node:(?<major>\d+)/gimu;
13473
- const SETUP_INPUT = /\bnode-version:[ \t]*["']?v?(?<major>\d+)/gu;
13474
- const TOOL_VERSION = /^[ \t]*["']?(?:node|nodejs)["']?[ \t]*(?:=[ \t]*["']?|[ \t]+)v?(?<major>\d+)/gmu;
13475
- const RANGE_FLOOR = /^(?:>=|\^|~|=)?[ \t]*v?(?<major>\d+)/u;
13476
- const ALTERNATIVE = "||";
13477
- const ENGINES_KEY = "\"engines\"";
13478
- const START$5 = 0;
13479
- const EXCLUDED = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
13480
- const Engines = Schema.Struct({ node: Schema.optional(Schema.String) });
13481
- const Manifest = Schema.Struct({
13482
- private: Schema.optional(Schema.Boolean),
13483
- publishConfig: Schema.optional(Schema.Unknown),
13484
- engines: Schema.optional(Engines)
13485
- });
13486
- const decodeManifest = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest));
13487
- const majorOf = (found) => pipe(groupOf$2("major")(found), Option.map(Number));
13488
- const isOld = (major) => major < MINIMUM;
13489
- const floorOf = (alternative) => majorOf(RANGE_FLOOR.exec(String$1.trim(alternative)));
13490
- const floorIsOld = (alternative) => pipe(floorOf(alternative), Option.match({
13491
- onNone: () => true,
13492
- onSome: isOld
13493
- }));
13494
- const admitsOld = (range) => pipe(String$1.split(range, ALTERNATIVE), Array.some(floorIsOld));
13495
- const problemAt$3 = ({ entry, source, index }, message) => ({
13496
- file: entry.file,
13497
- ...positionOf(source)(index),
13498
- rule: RULE$7,
13499
- message
13500
- });
13501
- const offsetOf$1 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$5));
13502
- const unstatedProblem = (entry, source) => problemAt$3({
13503
- entry,
13504
- source,
13505
- index: START$5
13506
- }, `${SUPPORTED} This package is published without engines.node, so its users cannot tell. Set engines.node to ">=${String(MINIMUM)}".`);
13507
- const rangeProblem = (entry, source) => (range) => problemAt$3({
13508
- entry,
13509
- source,
13510
- index: offsetOf$1(source, ENGINES_KEY)
13511
- }, `${SUPPORTED} engines.node is "${range}", which admits an older one. Set it to ">=${String(MINIMUM)}".`);
13512
- const isPublished = (manifest) => manifest.private !== true && Predicate.isNotUndefined(manifest.publishConfig);
13513
- const rangeOf$1 = (manifest) => pipe(Option.fromUndefinedOr(manifest.engines), Option.flatMap(({ node }) => Option.fromUndefinedOr(node)));
13514
- const manifestProblems = (entry, source) => {
13515
- const manifest = decodeManifest(source);
13516
- if (Option.isNone(manifest)) return [];
13517
- const range = rangeOf$1(manifest.value);
13518
- if (Option.isNone(range) && isPublished(manifest.value)) return [unstatedProblem(entry, source)];
13519
- return pipe(range, Option.filter(admitsOld), Option.map(rangeProblem(entry, source)), Option.toArray);
13520
- };
13521
- const pinnedProblems = (pattern) => (entry, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.filter((found) => Option.exists(majorOf(found), isOld)), Array.map((found) => problemAt$3({
13522
- entry,
13523
- source,
13524
- index: found.index ?? START$5
13525
- }, `${SUPPORTED} \`${String$1.trim(found[START$5])}\` pins an older one. Raise it to ${String(MINIMUM)} or later.`)));
13526
- const versionFileProblems = (entry, source) => pipe(majorOf(PINNED_VERSION.exec(source)), Option.filter(isOld), Option.map((major) => problemAt$3({
13527
- entry,
13528
- source,
13529
- index: START$5
13530
- }, `${SUPPORTED} This file pins ${String(major)}. Raise it to ${String(MINIMUM)} or later.`)), Option.toArray);
13531
- const problemsIn$5 = (entry, source) => {
13532
- if (MANIFEST.test(entry.name)) return manifestProblems(entry, source);
13533
- if (VERSION_FILE.test(entry.name)) return versionFileProblems(entry, source);
13534
- if (DOCKERFILE.test(entry.name)) return pinnedProblems(BASE_IMAGE)(entry, source);
13535
- if (isToolVersions(entry)) return pinnedProblems(TOOL_VERSION)(entry, source);
13536
- return pinnedProblems(SETUP_INPUT)(entry, source);
13537
- };
13538
- const isVersionSource = (entry) => VERSION_FILE.test(entry.name) || DOCKERFILE.test(entry.name) || STEP_FILE.test(entry.name) || isToolVersions(entry);
13539
- /** @internal */
13540
- const checkNodeVersion = Effect.fn("checkNodeVersion")(function* checkNodeVersion(root) {
13541
- const files = yield* RepositoryFiles;
13542
- const listed = yield* listedFiles(root);
13543
- const manifests = yield* files.matchingFiles(root, [`:(glob)**/${MANIFEST_FILE$1}`, ...EXCLUDED]);
13544
- const sources = [...pipe(listed, Array.filter(isVersionSource)), ...pipe(manifests, Array.map((name) => ({
13545
- name,
13546
- file: files.join(root, name)
13547
- })))];
13548
- return yield* scanText(sources, problemsIn$5);
13549
- });
13550
13463
  // src/features/check-skills/model/skill-entry.ts
13551
13464
  const ENTRY_RULE = "unlocked-skill";
13552
13465
  const VISIBLE_RULE = "skill-source-visible";
@@ -13554,7 +13467,7 @@ const CONFIG_FILE = "vite.config.ts";
13554
13467
  const RENOVATE_FILE$1 = "renovate.json";
13555
13468
  const SOURCE = "masseater/skills";
13556
13469
  const PRESET = "github>masseater/masseater.dev//libs/vite-plus-adopt/renovate";
13557
- const START$4 = 0;
13470
+ const START$6 = 0;
13558
13471
  const LOCAL_PREFIX = "./";
13559
13472
  const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
13560
13473
  const Source = Schema.Struct({
@@ -13565,9 +13478,9 @@ const SkillsConfig = Schema.Struct({ skills: Schema.Record(Schema.String, Source
13565
13478
  const decodeSkills = Schema.decodeUnknownOption(SkillsConfig);
13566
13479
  const taggedError$1 = Schema.TaggedError;
13567
13480
  var SkillsConfigUnreadable = class extends taggedError$1()("SkillsConfigUnreadable", { file: Schema.String }) {};
13568
- const problemAt$2 = (rule, file, text) => (anchor, message) => ({
13481
+ const problemAt$3 = (rule, file, text) => (anchor, message) => ({
13569
13482
  file,
13570
- ...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$4))),
13483
+ ...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$6))),
13571
13484
  rule,
13572
13485
  message
13573
13486
  });
@@ -13587,20 +13500,20 @@ const declaredSkills = Effect.fn("declaredSkills")(function* declaredSkills(root
13587
13500
  })));
13588
13501
  });
13589
13502
  const entryProblems = ({ file, text, sources }) => {
13590
- const at = problemAt$2(ENTRY_RULE, file, text);
13503
+ const at = problemAt$3(ENTRY_RULE, file, text);
13591
13504
  return pipe(Record.get(sources, SOURCE), Option.match({
13592
13505
  onNone: () => [at("skills", `does not install ${SOURCE}. Add "${SOURCE}": { commit, root: "plugins/masseater-skills/skills", skills: "all" } to skills.`)],
13593
13506
  onSome: (source) => pipe(Option.liftPredicate(source, ({ skills }) => skills !== "all"), Option.map(() => at(`"${SOURCE}"`, `picks skills from ${SOURCE} by name. Write skills: "all", so every repository gets each new skill with the next digest update.`)), Option.toArray)
13594
13507
  }));
13595
13508
  };
13596
13509
  const literalPattern = (repository, commit) => new RegExp(`"${String$1.replaceAll(REGEX_SPECIAL, String.raw`\$&`)(repository)}": \\{\\s*commit: "${commit}"`, "u");
13597
- const visibleProblems = ({ file, text, sources }) => pipe(Record.toEntries(sources), Array.filter(([repository]) => !String$1.startsWith(LOCAL_PREFIX)(repository)), Array.filter(([repository, { commit }]) => !literalPattern(repository, commit ?? "").test(text)), Array.map(([repository]) => problemAt$2(VISIBLE_RULE, file, text)(repository, `declares ${repository} in a form the Renovate preset cannot read. Write "${repository}": { commit: "<sha>", ... } with commit first and as a string literal.`)));
13510
+ const visibleProblems = ({ file, text, sources }) => pipe(Record.toEntries(sources), Array.filter(([repository]) => !String$1.startsWith(LOCAL_PREFIX)(repository)), Array.filter(([repository, { commit }]) => !literalPattern(repository, commit ?? "").test(text)), Array.map(([repository]) => problemAt$3(VISIBLE_RULE, file, text)(repository, `declares ${repository} in a form the Renovate preset cannot read. Write "${repository}": { commit: "<sha>", ... } with commit first and as a string literal.`)));
13598
13511
  const presetProblems = Effect.fn("presetProblems")(function* presetProblems(root) {
13599
13512
  const files = yield* RepositoryFiles;
13600
13513
  const file = files.join(root, RENOVATE_FILE$1);
13601
13514
  const text = yield* files.readFile(file);
13602
13515
  if (pipe(text, Option.exists(String$1.includes(`"${PRESET}"`)))) return [];
13603
- return [problemAt$2(VISIBLE_RULE, file, Option.getOrElse(text, () => ""))("extends", `does not extend ${PRESET}, so Renovate never updates the commits in the skills section of ${CONFIG_FILE}.`)];
13516
+ return [problemAt$3(VISIBLE_RULE, file, Option.getOrElse(text, () => ""))("extends", `does not extend ${PRESET}, so Renovate never updates the commits in the skills section of ${CONFIG_FILE}.`)];
13604
13517
  });
13605
13518
  /** @internal */
13606
13519
  const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(root) {
@@ -13614,7 +13527,7 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
13614
13527
  ];
13615
13528
  });
13616
13529
  // src/features/check-skills/model/published-skills.ts
13617
- const RULE$6 = "published-skills";
13530
+ const RULE$8 = "published-skills";
13618
13531
  const KEYWORD = "tanstack-intent";
13619
13532
  const SKILLS = "skills";
13620
13533
  const MANIFEST_FILE = "package.json";
@@ -13623,11 +13536,11 @@ const FIRST$2 = 1;
13623
13536
  const SUCCEEDED = 0;
13624
13537
  const SYNC = "Run vp exec intent maintainer sync in the repository root.";
13625
13538
  const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
13626
- const problemAt$1 = (file, message) => ({
13539
+ const problemAt$2 = (file, message) => ({
13627
13540
  file,
13628
13541
  line: FIRST$2,
13629
13542
  column: FIRST$2,
13630
- rule: RULE$6,
13543
+ rule: RULE$8,
13631
13544
  message
13632
13545
  });
13633
13546
  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))));
@@ -13650,30 +13563,30 @@ const validationOf = Effect.fn("validationOf")(function* validationOf(directory)
13650
13563
  const [output, status] = yield* Effect.all([handle.all.pipe(Stream.decodeText(), Stream.mkString), handle.exitCode], { concurrency: "unbounded" });
13651
13564
  return Option.liftPredicate(String$1.trim(output), () => Number(status) !== SUCCEEDED);
13652
13565
  }, Effect.scoped);
13653
- const problemsIn$4 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
13566
+ const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
13654
13567
  const files = yield* RepositoryFiles;
13655
13568
  const directory = files.join(root, project.directory);
13656
13569
  const manifest = files.join(directory, MANIFEST_FILE);
13657
13570
  const skills = skillDirectoriesIn(files, directory);
13658
- if (!Array.isReadonlyArrayNonEmpty(skills)) return [problemAt$1(manifest, `is published without TanStack Intent skills. Write the tasks an agent needs for this package as ${SKILLS}/<task>/${SKILL_FILE$1} with vp exec intent maintainer add, so agents in the repositories that install it load guidance for the installed version.`)];
13571
+ if (!Array.isReadonlyArrayNonEmpty(skills)) return [problemAt$2(manifest, `is published without TanStack Intent skills. Write the tasks an agent needs for this package as ${SKILLS}/<task>/${SKILL_FILE$1} with vp exec intent maintainer add, so agents in the repositories that install it load guidance for the installed version.`)];
13659
13572
  const validation = yield* validationOf(directory).pipe(Effect.orElseSucceed(() => Option.none()));
13660
- return [...pipe(packagingMessages(project, skills), Array.map((message) => problemAt$1(manifest, message))), ...pipe(validation, Option.map((output) => problemAt$1(files.join(directory, SKILLS), `fails intent validate:\n${output}`)), Option.toArray)];
13573
+ return [...pipe(packagingMessages(project, skills), Array.map((message) => problemAt$2(manifest, message))), ...pipe(validation, Option.map((output) => problemAt$2(files.join(directory, SKILLS), `fails intent validate:\n${output}`)), Option.toArray)];
13661
13574
  });
13662
13575
  /** @internal */
13663
13576
  const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPublishedSkills(root) {
13664
13577
  const projects = yield* publishedProjects(root);
13665
- const problems = yield* Effect.forEach(projects, (project) => problemsIn$4(root, project), { concurrency: 1 });
13578
+ const problems = yield* Effect.forEach(projects, (project) => problemsIn$6(root, project), { concurrency: 1 });
13666
13579
  return Array.flatten(problems);
13667
13580
  });
13668
13581
  // src/features/check-skills/model/skill-files.ts
13669
- const RULE$5 = "skill-file";
13582
+ const RULE$7 = "skill-file";
13670
13583
  const SKILL_FILE = /(?:^|\/)SKILL\.md$/u;
13671
13584
  const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
13672
13585
  const MARKDOWN = ".md";
13673
13586
  const LICENSE_FILE = /^LICEN[CS]E(?:\.[^/]+)?$/iu;
13674
13587
  const FRONTMATTER = /^---\n(?<yaml>[\s\S]*?)\n---\n/u;
13675
13588
  const HEADING = /^# (?<title>.+)$/mu;
13676
- const NAME_KEY = /^name:/mu;
13589
+ const NAME_KEY$1 = /^name:/mu;
13677
13590
  const LICENSE_KEY = /^license:/mu;
13678
13591
  const CODE = /```[\s\S]*?```|`[^`\n]*`/gu;
13679
13592
  const LINK = /\]\((?<target>[^)\s]+)\)/gu;
@@ -13683,7 +13596,7 @@ const GITHUB = "https://github.com/";
13683
13596
  const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
13684
13597
  const BLANK = /\s+/u;
13685
13598
  const SEPARATOR$2 = "/";
13686
- const START$3 = 0;
13599
+ const START$5 = 0;
13687
13600
  const FIRST$1 = 1;
13688
13601
  const READ_CONCURRENCY$3 = 16;
13689
13602
  const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
@@ -13693,50 +13606,50 @@ const Frontmatter = Schema.Struct({
13693
13606
  metadata: Schema.optional(Metadata)
13694
13607
  });
13695
13608
  const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
13696
- const offsetOf = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$3));
13609
+ const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$5));
13697
13610
  const frontmatterOf = (source) => pipe(groupOf$2("yaml")(FRONTMATTER.exec(source)), Option.flatMap((yaml) => decodeFrontmatter(parse$2(yaml))));
13698
- const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$3].length), Option.getOrElse(() => START$3));
13611
+ const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$5].length), Option.getOrElse(() => START$5));
13699
13612
  const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
13700
13613
  const nameProblems = ({ source, directory }, name, folder) => {
13701
13614
  const bodyStart = bodyStartOf(source);
13702
13615
  const body = String$1.slice(bodyStart)(source);
13703
13616
  const heading = groupOf$2("title")(HEADING.exec(body));
13704
13617
  return [...pipe(Option.liftPredicate(name, (found) => found !== folder), Option.map((found) => ({
13705
- index: offsetOf(source, NAME_KEY),
13618
+ index: offsetOf$1(source, NAME_KEY$1),
13706
13619
  message: `The frontmatter name "${found}" differs from the directory ${directory}. Give the skill the name of its directory.`
13707
13620
  })), Option.toArray), ...pipe(Option.liftPredicate(heading, (found) => !Option.contains(found, name)), Option.map((found) => ({
13708
- index: bodyStart + offsetOf(body, HEADING),
13621
+ index: bodyStart + offsetOf$1(body, HEADING),
13709
13622
  message: `The first heading is ${headingText(found)}. Start the body with "# ${name}", the frontmatter name.`
13710
13623
  })), Option.toArray)];
13711
13624
  };
13712
13625
  const derivedProblems = (source, derived) => pipe(String$1.split(String$1.trim(derived), BLANK), Array.filter((url) => String$1.startsWith(GITHUB)(url) && !COMMIT_LINK.test(url)), Array.map((url) => ({
13713
- index: offsetOf(source, url),
13626
+ index: offsetOf$1(source, url),
13714
13627
  message: `metadata.derived-from holds ${url}, which does not name a commit, so what it shows changes. Write a permalink: ${GITHUB}<owner>/<repo>/blob/<commit>/<path>.`
13715
13628
  })));
13716
13629
  const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source), Option.map((frontmatter) => [
13717
13630
  ...pipe(Option.fromUndefinedOr(frontmatter.name), Option.map((name) => nameProblems(skill, name, folder)), Option.getOrElse(() => [])),
13718
13631
  ...pipe(Option.fromUndefinedOr(frontmatter.license), Option.map(() => ({
13719
- index: offsetOf(skill.source, LICENSE_KEY),
13632
+ index: offsetOf$1(skill.source, LICENSE_KEY),
13720
13633
  message: "The frontmatter has license. Skills here carry neither a license field nor a LICENSE file. Remove it."
13721
13634
  })), Option.toArray),
13722
13635
  ...pipe(Option.fromUndefinedOr(frontmatter.metadata), Option.flatMap((metadata) => Option.fromUndefinedOr(metadata["derived-from"])), Option.map((derived) => derivedProblems(skill.source, derived)), Option.getOrElse(() => []))
13723
13636
  ]), Option.getOrElse(() => []), Array.map(({ index, message }) => ({
13724
13637
  file: skill.file,
13725
13638
  ...positionOf(skill.source)(index),
13726
- rule: RULE$5,
13639
+ rule: RULE$7,
13727
13640
  message
13728
13641
  })));
13729
13642
  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) => ({
13730
13643
  target,
13731
- index: found.index ?? START$3
13644
+ index: found.index ?? START$5
13732
13645
  })), Option.toArray);
13733
- const rangeOf = (found) => {
13734
- const start = found.index ?? START$3;
13735
- return [start, start + found[START$3].length];
13646
+ const rangeOf$1 = (found) => {
13647
+ const start = found.index ?? START$5;
13648
+ return [start, start + found[START$5].length];
13736
13649
  };
13737
13650
  const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array.some(([start, end]) => index >= start && index < end));
13738
13651
  const linksIn = (source) => {
13739
- const code = pipe(Array.fromIterable(String$1.matchAll(CODE)(source)), Array.map(rangeOf));
13652
+ const code = pipe(Array.fromIterable(String$1.matchAll(CODE)(source)), Array.map(rangeOf$1));
13740
13653
  return pipe(Array.fromIterable(String$1.matchAll(LINK)(source)), Array.flatMap(linkOf), Array.filter(isOutside(code)));
13741
13654
  };
13742
13655
  const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
@@ -13750,11 +13663,11 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
13750
13663
  return pipe(missing, Array.map(({ target, index }) => ({
13751
13664
  file,
13752
13665
  ...positionOf(source)(index),
13753
- rule: RULE$5,
13666
+ rule: RULE$7,
13754
13667
  message: `links to ${target}, which does not exist. Fix the path or remove the link.`
13755
13668
  })));
13756
13669
  });
13757
- const problemsIn$3 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
13670
+ const problemsIn$5 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
13758
13671
  const files = yield* RepositoryFiles;
13759
13672
  const file = files.join(root, name);
13760
13673
  const directory = files.dirname(name);
@@ -13766,7 +13679,7 @@ const problemsIn$3 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
13766
13679
  file: files.join(root, entry),
13767
13680
  line: FIRST$1,
13768
13681
  column: FIRST$1,
13769
- rule: RULE$5,
13682
+ rule: RULE$7,
13770
13683
  message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
13771
13684
  })));
13772
13685
  return [
@@ -13783,7 +13696,7 @@ const problemsIn$3 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
13783
13696
  const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
13784
13697
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
13785
13698
  const skills = pipe(listed, Array.filter((name) => SKILL_FILE.test(name) && !INSTALLED.test(name)));
13786
- const found = yield* Effect.forEach(skills, (name) => problemsIn$3(root, listed, name), { concurrency: READ_CONCURRENCY$3 });
13699
+ const found = yield* Effect.forEach(skills, (name) => problemsIn$5(root, listed, name), { concurrency: READ_CONCURRENCY$3 });
13787
13700
  return Array.flatten(found);
13788
13701
  });
13789
13702
  // src/features/check-version-downgrades/model/version-entries.ts
@@ -13846,7 +13759,7 @@ const cargoEntries = (text) => {
13846
13759
  };
13847
13760
  const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
13848
13761
  // src/features/check-version-downgrades/model/version-downgrade.ts
13849
- const RULE$4 = "version-downgrade";
13762
+ const RULE$6 = "version-downgrade";
13850
13763
  const DEFAULT_BASE = "origin/main";
13851
13764
  const READ_CONCURRENCY$2 = 16;
13852
13765
  const READERS = [
@@ -13872,7 +13785,7 @@ const downgradesIn = ({ file, text, before, after }) => {
13872
13785
  file,
13873
13786
  line: lineOf(text, entry),
13874
13787
  column: FIRST_LINE$1,
13875
- rule: RULE$4,
13788
+ rule: RULE$6,
13876
13789
  message: message(old, entry)
13877
13790
  })), Option.toArray)));
13878
13791
  };
@@ -13911,7 +13824,7 @@ const READ_CONCURRENCY$1 = 16;
13911
13824
  const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
13912
13825
  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.";
13913
13826
  const offsetsOf = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap((match) => Option.toArray(Option.fromUndefinedOr(match.index))));
13914
- const problemsIn$2 = (file, source) => {
13827
+ const problemsIn$4 = (file, source) => {
13915
13828
  const at = positionOf(source);
13916
13829
  const found = (pattern, rule, message) => pipe(offsetsOf(pattern, source), Array.map((offset) => ({
13917
13830
  file,
@@ -13929,7 +13842,7 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
13929
13842
  const file = files.join(root, name);
13930
13843
  return files.readFile(file).pipe(Effect.map(Option.match({
13931
13844
  onNone: () => [],
13932
- onSome: (source) => problemsIn$2(file, source)
13845
+ onSome: (source) => problemsIn$4(file, source)
13933
13846
  })));
13934
13847
  }, { concurrency: READ_CONCURRENCY$1 });
13935
13848
  return Array.flatten(found);
@@ -13937,22 +13850,22 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
13937
13850
  // src/features/find-invisible-characters/model/hidden-unicode.ts
13938
13851
  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;
13939
13852
  const NUL = "\0";
13940
- const START$2 = 0;
13853
+ const START$4 = 0;
13941
13854
  const HEX = 16;
13942
13855
  const CODE_POINT_WIDTH = 4;
13943
13856
  const READ_CONCURRENCY = 64;
13944
- const RULE$3 = "hidden-unicode";
13945
- const hexOf = (character) => pipe(String$1.codePointAt(START$2)(character), Option.getOrElse(() => START$2), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
13857
+ const RULE$5 = "hidden-unicode";
13858
+ const hexOf = (character) => pipe(String$1.codePointAt(START$4)(character), Option.getOrElse(() => START$4), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
13946
13859
  const problemOf$1 = (file, source) => (found) => {
13947
- const hex = hexOf(found[START$2]);
13860
+ const hex = hexOf(found[START$4]);
13948
13861
  return {
13949
13862
  file,
13950
- ...positionOf(source)(found.index ?? START$2),
13951
- rule: RULE$3,
13863
+ ...positionOf(source)(found.index ?? START$4),
13864
+ rule: RULE$5,
13952
13865
  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}.`
13953
13866
  };
13954
13867
  };
13955
- const problemsIn$1 = (file, source) => {
13868
+ const problemsIn$3 = (file, source) => {
13956
13869
  if (String$1.includes(NUL)(source)) return [];
13957
13870
  return pipe(Array.fromIterable(String$1.matchAll(HIDDEN)(source)), Array.map(problemOf$1(file, source)));
13958
13871
  };
@@ -13964,25 +13877,25 @@ const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHidden
13964
13877
  const file = files.join(root, name);
13965
13878
  return files.readFile(file).pipe(Effect.map(Option.match({
13966
13879
  onNone: () => [],
13967
- onSome: (source) => problemsIn$1(file, source)
13880
+ onSome: (source) => problemsIn$3(file, source)
13968
13881
  })));
13969
13882
  }, { concurrency: READ_CONCURRENCY });
13970
13883
  return Array.flatten(found);
13971
13884
  });
13972
13885
  // src/features/find-unneeded-files/model/alchemy-patch.ts
13973
- const RULE$2 = "alchemy-patch";
13886
+ const RULE$4 = "alchemy-patch";
13974
13887
  const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
13975
13888
  const ALCHEMY$1 = /^(?:alchemy|@alchemy\.run\/[^@]+)(?:@.*)?$/u;
13976
- const START$1 = 0;
13889
+ const START$3 = 0;
13977
13890
  const problemOf = (file, position, name) => ({
13978
13891
  file,
13979
13892
  ...position,
13980
- rule: RULE$2,
13893
+ rule: RULE$4,
13981
13894
  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.`
13982
13895
  });
13983
- const problemsIn = (file, patched) => (source) => {
13896
+ const problemsIn$2 = (file, patched) => (source) => {
13984
13897
  const at = positionOf(source);
13985
- const offsetOf = (name) => pipe(String$1.indexOf(name)(source), Option.getOrElse(() => START$1));
13898
+ const offsetOf = (name) => pipe(String$1.indexOf(name)(source), Option.getOrElse(() => START$3));
13986
13899
  return pipe(patched, Array.filter((name) => ALCHEMY$1.test(name)), Array.map((name) => problemOf(file, at(offsetOf(name)), name)));
13987
13900
  };
13988
13901
  /** @internal */
@@ -13992,12 +13905,12 @@ const checkAlchemyPatch = Effect.fn("checkAlchemyPatch")(function* checkAlchemyP
13992
13905
  const text = yield* files.readFile(file);
13993
13906
  const manifest = yield* workspaceManifest(root);
13994
13907
  const patched = pipe(manifest, Option.flatMap(({ patchedDependencies }) => Option.fromUndefinedOr(patchedDependencies)), Option.map(Record.keys), Option.getOrElse(() => []));
13995
- return pipe(text, Option.map(problemsIn(file, patched)), Option.getOrElse(() => []));
13908
+ return pipe(text, Option.map(problemsIn$2(file, patched)), Option.getOrElse(() => []));
13996
13909
  });
13997
13910
  // src/features/find-unneeded-files/model/applied-packages.ts
13998
13911
  const MSCH = "@r_masseater/msch";
13999
- const SCOPE = "@r_masseater/";
14000
- const RULE$1 = "applied-package";
13912
+ const SCOPE$1 = "@r_masseater/";
13913
+ const RULE$3 = "applied-package";
14001
13914
  const WORKSPACE_FILE$1 = "pnpm-workspace.yaml";
14002
13915
  const NOT_FOUND = -1;
14003
13916
  const SEPARATOR$1 = "/";
@@ -14036,18 +13949,18 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
14036
13949
  onNone: () => Effect.succeed(Option.none()),
14037
13950
  onSome: (file) => readManifest(files.dirname(file))
14038
13951
  }));
14039
- const names = pipe(manifest, Option.flatMap(({ dependencies }) => Option.fromUndefinedOr(dependencies)), Option.map(Record.keys), Option.getOrElse(() => []), Array.filter(String$1.startsWith(SCOPE)));
13952
+ const names = pipe(manifest, Option.flatMap(({ dependencies }) => Option.fromUndefinedOr(dependencies)), Option.map(Record.keys), Option.getOrElse(() => []), Array.filter(String$1.startsWith(SCOPE$1)));
14040
13953
  return yield* Effect.forEach(names, installedPackage, { concurrency: 1 });
14041
13954
  });
14042
- const problemAt = (file, source) => (index, name) => ({
13955
+ const problemAt$1 = (file, source) => (index, name) => ({
14043
13956
  file,
14044
13957
  ...positionOf(source)(index),
14045
- rule: RULE$1,
13958
+ rule: RULE$3,
14046
13959
  message: `msch applies ${name}. Remove this use and let msch apply it.`
14047
13960
  });
14048
13961
  const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped(name)}(?=["'\`/])`, "gu");
14049
13962
  const binPattern = (bin) => new RegExp(`(?<![\\w./@:-])${escaped(bin)}(?=[ \\t"'\`]|$)`, "gmu");
14050
- const usesIn = (applied) => ({ file }, source) => pipe(applied, Array.flatMap((entry) => pipe([specifierPattern(entry), ...pipe(entry.bins, Array.map(binPattern))], Array.flatMap((pattern) => Array.fromIterable(String$1.matchAll(pattern)(source))), Array.map((found) => problemAt(file, source)(found.index ?? NOT_FOUND, entry.name)))));
13963
+ const usesIn = (applied) => ({ file }, source) => pipe(applied, Array.flatMap((entry) => pipe([specifierPattern(entry), ...pipe(entry.bins, Array.map(binPattern))], Array.flatMap((pattern) => Array.fromIterable(String$1.matchAll(pattern)(source))), Array.map((found) => problemAt$1(file, source)(found.index ?? NOT_FOUND, entry.name)))));
14051
13964
  const ownerOf = (directories) => (name) => pipe(directories, Array.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$1}`)(name)), Array.match({
14052
13965
  onEmpty: () => "",
14053
13966
  onNonEmpty: Array.max(BY_LENGTH)
@@ -14067,7 +13980,7 @@ const manifestUses = Effect.fn("manifestUses")(function* manifestUses(root, appl
14067
13980
  declared: manifest
14068
13981
  }), Option.match({
14069
13982
  onNone: () => [],
14070
- onSome: ({ source, declared }) => pipe(declaredNames(declared), Array.filter((name) => Array.contains(appliedNames, name)), Array.flatMap((name) => pipe(String$1.indexOf(`"${name}"`)(source), Option.map((index) => problemAt(file, source)(index, name)), Option.toArray)))
13983
+ onSome: ({ source, declared }) => pipe(declaredNames(declared), Array.filter((name) => Array.contains(appliedNames, name)), Array.flatMap((name) => pipe(String$1.indexOf(`"${name}"`)(source), Option.map((index) => problemAt$1(file, source)(index, name)), Option.toArray)))
14071
13984
  }));
14072
13985
  });
14073
13986
  const sourceUses = Effect.fn("sourceUses")(function* sourceUses({ root, applied, directories, consumers }) {
@@ -14097,7 +14010,7 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
14097
14010
  return yield* appliedPackageProblems(root, applied);
14098
14011
  });
14099
14012
  // src/features/find-unneeded-files/model/replaced-tools.ts
14100
- const RULE = "replaced-tool";
14013
+ const RULE$2 = "replaced-tool";
14101
14014
  const FIRST = 1;
14102
14015
  const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
14103
14016
  const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
@@ -14178,7 +14091,7 @@ const problemFor = ({ name, file }) => pipe(REPLACED, Array.findFirst(({ pattern
14178
14091
  file,
14179
14092
  line: FIRST,
14180
14093
  column: FIRST,
14181
- rule: RULE,
14094
+ rule: RULE$2,
14182
14095
  message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
14183
14096
  })));
14184
14097
  /** @internal */
@@ -14207,7 +14120,7 @@ const SETUP_PATTERNS = [
14207
14120
  ];
14208
14121
  const INSTALL_PATTERNS = [/(?<![\w./@-])cargo[ \t]+b?install\b/gu];
14209
14122
  const TOOL_PATTERNS = [/^[ \t]*["']?(?:rust|rustup)["']?[ \t]*(?:=|[ \t]+\S)/gmu];
14210
- const START = 0;
14123
+ const START$2 = 0;
14211
14124
  const LAST_SEGMENT = 1;
14212
14125
  const FIRST_LINE = 1;
14213
14126
  const FIRST_COLUMN = 1;
@@ -14277,7 +14190,7 @@ const cargoWorkspaces = Effect.fn("cargoWorkspaces")(function* cargoWorkspaces(m
14277
14190
  const roots = yield* pipe(manifests, Effect.filter(({ file }) => files.readFile(file).pipe(Effect.map(isWorkspaceManifest))));
14278
14191
  return directoriesOf(roots);
14279
14192
  });
14280
- const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START), (end) => String$1.slice(START, end)(name));
14193
+ const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$2), (end) => String$1.slice(START$2, end)(name));
14281
14194
  const pnpmOutputs = (present) => pipe(present, Array.filter(isPnpmOutput), Array.dedupeWith((left, right) => pnpmDirectoryOf(left) === pnpmDirectoryOf(right)), Array.map(pnpmOutput));
14282
14195
  const byDepth = Order.mapInput(Order.Number, ({ name }) => String$1.split(name, "/").length);
14283
14196
  const cargoProblems = (present, enabled) => {
@@ -14312,6 +14225,128 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
14312
14225
  if (Option.isNone(workspace)) return [];
14313
14226
  return yield* unneededIn(root, cargoEnabled(workspace.value));
14314
14227
  });
14228
+ // src/features/check-package-scope/model/package-scope.ts
14229
+ const RULE$1 = "package-scope";
14230
+ const SCOPE = "@r_masseater/";
14231
+ const NAME_KEY = "\"name\"";
14232
+ const START$1 = 0;
14233
+ const EXCLUDED$1 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
14234
+ const Manifest$1 = Schema.Struct({
14235
+ name: Schema.optional(Schema.String),
14236
+ private: Schema.optional(Schema.Boolean),
14237
+ publishConfig: Schema.optional(Schema.Unknown)
14238
+ });
14239
+ const decodeManifest$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$1));
14240
+ const isPublished$1 = (manifest) => manifest.private !== true && Predicate.isNotUndefined(manifest.publishConfig);
14241
+ const unscopedName = (manifest) => pipe(Option.fromUndefinedOr(manifest.name), Option.filter((name) => !String$1.startsWith(SCOPE)(name)));
14242
+ const problemsIn$1 = (entry, source) => pipe(decodeManifest$1(source), Option.filter(isPublished$1), Option.flatMap(unscopedName), Option.map((name) => ({
14243
+ file: entry.file,
14244
+ ...positionOf(source)(pipe(String$1.indexOf(NAME_KEY)(source), Option.getOrElse(() => START$1))),
14245
+ rule: RULE$1,
14246
+ message: `Packages are published only under the ${SCOPE} scope. Rename "${name}" to "${SCOPE}${String$1.replace(/^@[^/]+\//u, "")(name)}".`
14247
+ })), Option.toArray);
14248
+ /** @internal */
14249
+ const checkPackageScope = Effect.fn("checkPackageScope")(function* checkPackageScope(root) {
14250
+ const files = yield* RepositoryFiles;
14251
+ const manifests = yield* files.matchingFiles(root, [`:(glob)**/${MANIFEST_FILE$1}`, ...EXCLUDED$1]);
14252
+ return yield* scanText(pipe(manifests, Array.map((name) => ({
14253
+ name,
14254
+ file: files.join(root, name)
14255
+ }))), problemsIn$1);
14256
+ });
14257
+ // src/features/check-runtime-version/model/node-version.ts
14258
+ const RULE = "node-version";
14259
+ const MINIMUM = 26;
14260
+ const SUPPORTED = `Node.js ${String(MINIMUM)} or later is the only supported runtime.`;
14261
+ const MANIFEST = /(?:^|\/)package\.json$/u;
14262
+ const VERSION_FILE = /(?:^|\/)(?:\.node-version|\.nvmrc)$/u;
14263
+ const DOCKERFILE = /(?:^|\/)(?:Dockerfile|Containerfile)[^/]*$/u;
14264
+ const STEP_FILE = /^\.github\/.*\.ya?ml$|(?:^|\/)action\.ya?ml$/u;
14265
+ const PINNED_VERSION = /^\s*v?(?<major>\d+)/u;
14266
+ const BASE_IMAGE = /^FROM[ \t]+(?:--\S+[ \t]+)*(?:[\w.-]+(?::\d+)?\/)*node:(?<major>\d+)/gimu;
14267
+ const SETUP_INPUT = /\bnode-version:[ \t]*["']?v?(?<major>\d+)/gu;
14268
+ const TOOL_VERSION = /^[ \t]*["']?(?:node|nodejs)["']?[ \t]*(?:=[ \t]*["']?|[ \t]+)v?(?<major>\d+)/gmu;
14269
+ const RANGE_FLOOR = /^(?:>=|\^|~|=)?[ \t]*v?(?<major>\d+)/u;
14270
+ const ALTERNATIVE = "||";
14271
+ const ENGINES_KEY = "\"engines\"";
14272
+ const START = 0;
14273
+ const EXCLUDED = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
14274
+ const Engines = Schema.Struct({ node: Schema.optional(Schema.String) });
14275
+ const Manifest = Schema.Struct({
14276
+ private: Schema.optional(Schema.Boolean),
14277
+ publishConfig: Schema.optional(Schema.Unknown),
14278
+ engines: Schema.optional(Engines)
14279
+ });
14280
+ const decodeManifest = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest));
14281
+ const majorOf = (found) => pipe(groupOf$2("major")(found), Option.map(Number));
14282
+ const isOld = (major) => major < MINIMUM;
14283
+ const floorOf = (alternative) => majorOf(RANGE_FLOOR.exec(String$1.trim(alternative)));
14284
+ const floorIsOld = (alternative) => pipe(floorOf(alternative), Option.match({
14285
+ onNone: () => true,
14286
+ onSome: isOld
14287
+ }));
14288
+ const admitsOld = (range) => pipe(String$1.split(range, ALTERNATIVE), Array.some(floorIsOld));
14289
+ const problemAt = ({ entry, source, index }, message) => ({
14290
+ file: entry.file,
14291
+ ...positionOf(source)(index),
14292
+ rule: RULE,
14293
+ message
14294
+ });
14295
+ const offsetOf = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START));
14296
+ const unstatedProblem = (entry, source) => problemAt({
14297
+ entry,
14298
+ source,
14299
+ index: START
14300
+ }, `${SUPPORTED} This package is published without engines.node, so its users cannot tell. Set engines.node to ">=${String(MINIMUM)}".`);
14301
+ const rangeProblem = (entry, source) => (range) => problemAt({
14302
+ entry,
14303
+ source,
14304
+ index: offsetOf(source, ENGINES_KEY)
14305
+ }, `${SUPPORTED} engines.node is "${range}", which admits an older one. Set it to ">=${String(MINIMUM)}".`);
14306
+ const isPublished = (manifest) => manifest.private !== true && Predicate.isNotUndefined(manifest.publishConfig);
14307
+ const rangeOf = (manifest) => pipe(Option.fromUndefinedOr(manifest.engines), Option.flatMap(({ node }) => Option.fromUndefinedOr(node)));
14308
+ const manifestProblems = (entry, source) => {
14309
+ const manifest = decodeManifest(source);
14310
+ if (Option.isNone(manifest)) return [];
14311
+ const range = rangeOf(manifest.value);
14312
+ if (Option.isNone(range) && isPublished(manifest.value)) return [unstatedProblem(entry, source)];
14313
+ return pipe(range, Option.filter(admitsOld), Option.map(rangeProblem(entry, source)), Option.toArray);
14314
+ };
14315
+ const pinnedProblems = (pattern) => (entry, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.filter((found) => Option.exists(majorOf(found), isOld)), Array.map((found) => problemAt({
14316
+ entry,
14317
+ source,
14318
+ index: found.index ?? START
14319
+ }, `${SUPPORTED} \`${String$1.trim(found[START])}\` pins an older one. Raise it to ${String(MINIMUM)} or later.`)));
14320
+ const versionFileProblems = (entry, source) => pipe(majorOf(PINNED_VERSION.exec(source)), Option.filter(isOld), Option.map((major) => problemAt({
14321
+ entry,
14322
+ source,
14323
+ index: START
14324
+ }, `${SUPPORTED} This file pins ${String(major)}. Raise it to ${String(MINIMUM)} or later.`)), Option.toArray);
14325
+ const problemsIn = (entry, source) => {
14326
+ if (MANIFEST.test(entry.name)) return manifestProblems(entry, source);
14327
+ if (VERSION_FILE.test(entry.name)) return versionFileProblems(entry, source);
14328
+ if (DOCKERFILE.test(entry.name)) return pinnedProblems(BASE_IMAGE)(entry, source);
14329
+ if (isToolVersions(entry)) return pinnedProblems(TOOL_VERSION)(entry, source);
14330
+ return pinnedProblems(SETUP_INPUT)(entry, source);
14331
+ };
14332
+ const isVersionSource = (entry) => VERSION_FILE.test(entry.name) || DOCKERFILE.test(entry.name) || STEP_FILE.test(entry.name) || isToolVersions(entry);
14333
+ /** @internal */
14334
+ const checkNodeVersion = Effect.fn("checkNodeVersion")(function* checkNodeVersion(root) {
14335
+ const files = yield* RepositoryFiles;
14336
+ const listed = yield* listedFiles(root);
14337
+ const manifests = yield* files.matchingFiles(root, [`:(glob)**/${MANIFEST_FILE$1}`, ...EXCLUDED]);
14338
+ const sources = [...pipe(listed, Array.filter(isVersionSource)), ...pipe(manifests, Array.map((name) => ({
14339
+ name,
14340
+ file: files.join(root, name)
14341
+ })))];
14342
+ return yield* scanText(sources, problemsIn);
14343
+ });
14344
+ // src/app/manifest-checks.ts
14345
+ /** @internal */
14346
+ const checkManifests = Effect.fn("checkManifests")(function* checkManifests(root) {
14347
+ const found = yield* Effect.all([checkNodeVersion(root), checkPackageScope(root)], { concurrency: "unbounded" });
14348
+ return Array.flatten(found);
14349
+ });
14315
14350
  // src/app/tracked-text.ts
14316
14351
  /** @internal */
14317
14352
  const checkTrackedText = Effect.fn("checkTrackedText")(function* checkTrackedText(root) {
@@ -14322,7 +14357,7 @@ const checkTrackedText = Effect.fn("checkTrackedText")(function* checkTrackedTex
14322
14357
  checkUnneededFiles(root),
14323
14358
  checkReplacedTools(root),
14324
14359
  checkAlchemyPatch(root),
14325
- checkNodeVersion(root),
14360
+ checkManifests(root),
14326
14361
  checkSkillFiles(root),
14327
14362
  checkSkillEntry(root),
14328
14363
  checkPublishedSkills(root),