@r_masseater/msch 0.47.0 → 0.48.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +1 -0
  2. package/dist/cargo-inputs.mjs +2 -2
  3. package/dist/changed.mjs +4 -4
  4. package/dist/check-upstream-exits-22kQ5juG.mjs +499 -0
  5. package/dist/check-upstream-exits-22kQ5juG.mjs.map +1 -0
  6. package/dist/cli-contract-D7btWrEu.mjs +5 -0
  7. package/dist/cli-contract-D7btWrEu.mjs.map +1 -0
  8. package/dist/cli.mjs +477 -384
  9. package/dist/cli.mjs.map +1 -1
  10. package/dist/{comment-directives-5-f_qs1E.mjs → comment-directives-CRAU6yNZ.mjs} +2 -1
  11. package/dist/comment-directives-CRAU6yNZ.mjs.map +1 -0
  12. package/dist/config.mjs +5 -1
  13. package/dist/config.mjs.map +1 -1
  14. package/dist/decision-rules.mjs +1 -1
  15. package/dist/{define-lint-preset-CxzPzVuB.mjs → define-lint-preset-BhT4RpHs.mjs} +2 -2
  16. package/dist/{define-lint-preset-CxzPzVuB.mjs.map → define-lint-preset-BhT4RpHs.mjs.map} +1 -1
  17. package/dist/{dependencies-v59cxwTD.mjs → dependencies-Bh625TQu.mjs} +15 -11
  18. package/dist/dependencies-Bh625TQu.mjs.map +1 -0
  19. package/dist/exits.d.mts +1 -0
  20. package/dist/exits.mjs +58 -0
  21. package/dist/exits.mjs.map +1 -0
  22. package/dist/{ignored-directories-thSB0IAT.mjs → ignored-directories-BrwYtwZw.mjs} +2 -2
  23. package/dist/{ignored-directories-thSB0IAT.mjs.map → ignored-directories-BrwYtwZw.mjs.map} +1 -1
  24. package/dist/lint.mjs +1 -1
  25. package/dist/oxlint.mjs +3 -2
  26. package/dist/oxlint.mjs.map +1 -1
  27. package/dist/{package-Bdv6W97F.mjs → package-M3y-ZOGZ.mjs} +3 -3
  28. package/dist/{package-Bdv6W97F.mjs.map → package-M3y-ZOGZ.mjs.map} +1 -1
  29. package/dist/{cli-contract-BY7vwgKc.mjs → problem-DHWbumiO.mjs} +3 -5
  30. package/dist/problem-DHWbumiO.mjs.map +1 -0
  31. package/dist/{project-DeQcAglt.mjs → project-DmUvZQEd.mjs} +4 -4
  32. package/dist/{project-DeQcAglt.mjs.map → project-DmUvZQEd.mjs.map} +1 -1
  33. package/dist/publish.mjs +41 -11
  34. package/dist/publish.mjs.map +1 -1
  35. package/dist/{repository-files-aXwrITdF.mjs → repository-files-CEaXCw-J.mjs} +4 -3
  36. package/dist/repository-files-CEaXCw-J.mjs.map +1 -0
  37. package/dist/{runtime-GbrDfB8K.mjs → runtime-Calown4W.mjs} +3 -3
  38. package/dist/{runtime-GbrDfB8K.mjs.map → runtime-Calown4W.mjs.map} +1 -1
  39. package/dist/{syntax-ct2fFLtv.mjs → syntax-P4jlh7LM.mjs} +2 -2
  40. package/dist/{syntax-ct2fFLtv.mjs.map → syntax-P4jlh7LM.mjs.map} +1 -1
  41. package/dist/workspace-settings.mjs +4 -4
  42. package/package.json +5 -4
  43. package/skills/msch-checks/SKILL.md +9 -0
  44. package/dist/cli-contract-BY7vwgKc.mjs.map +0 -1
  45. package/dist/comment-directives-5-f_qs1E.mjs.map +0 -1
  46. package/dist/dependencies-v59cxwTD.mjs.map +0 -1
  47. package/dist/repository-files-aXwrITdF.mjs.map +0 -1
package/dist/cli.mjs CHANGED
@@ -1,13 +1,15 @@
1
1
  #!/usr/bin/env node
2
- import { B as stringsIn, E as hasVerifyTask, F as childrenOf$2, I as keyName, L as literalOf, N as workspaceConfigOf, P as KeySchema, R as nestedValues, S as RUN_TASKS, T as definesTask, _ as publishedProjects, a as cratesIn, b as runTasksOf, c as workspaceLinks, d as deployEntries, f as namedWorkspaces, h as shadcnUiOf, l as lockedGraph, o as owningWorkspace, p as patternOf$1, r as readManifest, t as MANIFEST_FILE$3, u as lockedPackages, v as workspaceDirectories, w as VERIFY_TASK, y as workspaceManifest, z as propertyValue } from "./dependencies-v59cxwTD.mjs";
3
- import { C as valueKey, S as schemaTypeOf, _ as formatValues, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as recordsIn, l as mentions$1, m as isObjectType, n as contentKey, o as projectInputs, p as describeLibraryType, r as keepOnly, t as implementationFingerprint, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./project-DeQcAglt.mjs";
4
- import { a as groupOf$2, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-aXwrITdF.mjs";
5
- import { a as publicEntriesOf, i as EntryManifestJson, r as publishedWorkspaces } from "./package-Bdv6W97F.mjs";
6
- import { n as JAPANESE, t as COMMENT_DIRECTIVES } from "./comment-directives-5-f_qs1E.mjs";
2
+ import { B as propertyValue, C as RUN_TASKS, D as hasVerifyTask, E as definesTask, F as KeySchema, I as childrenOf$1, L as keyName, P as workspaceConfigOf, R as literalOf, T as VERIFY_TASK, V as stringsIn, _ as publishedProjects, a as cratesIn, b as workspaceManifest, c as workspaceLinks, d as deployEntries, f as namedWorkspaces, h as shadcnUiOf, l as lockedGraph, o as owningWorkspace, p as patternOf$1, r as readManifest, t as MANIFEST_FILE$3, u as lockedPackages, v as workspaceDirectories, x as runTasksOf, y as workspaceProjects, z as nestedValues } from "./dependencies-Bh625TQu.mjs";
3
+ import { C as valueKey, S as schemaTypeOf, _ as formatValues, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as recordsIn, l as mentions$1, m as isObjectType, n as contentKey, o as projectInputs, p as describeLibraryType, r as keepOnly, t as implementationFingerprint, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./project-DmUvZQEd.mjs";
4
+ import { a as groupOf$2, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-CEaXCw-J.mjs";
5
+ import { a as isRecord, c as isScannedText, d as presentFiles, f as scanText, i as collectNodes, l as isToolVersions, n as checkUpstreamExits, o as tomlSourceComments, p as positionOf, s as yamlSourceComments, t as checkScatteredDeviations, u as listedFiles } from "./check-upstream-exits-22kQ5juG.mjs";
6
+ import { a as publicEntriesOf, i as EntryManifestJson, r as publishedWorkspaces } from "./package-M3y-ZOGZ.mjs";
7
+ import { n as JAPANESE, t as COMMENT_DIRECTIVES } from "./comment-directives-CRAU6yNZ.mjs";
7
8
  import { t as startedOnce } from "./started-once-CkTooI_o.mjs";
8
- import { $ as isSpreadElement, A as isBlock, B as isInterfaceDeclaration, C as getJSDocTags, D as isArrayLiteralExpression, E as getTextOfJSDocComment, F as isExportDeclaration, G as isObjectLiteralExpression, H as isModuleDeclaration, I as isFunctionDeclaration, J as isPropertyAssignment, K as isParenthesizedExpression, L as isFunctionExpression, M as isClassDeclaration, N as isElementAccessExpression, O as isArrowFunction, P as isEnumDeclaration, Q as isSourceFile, R as isIdentifier, S as SyntaxKind, T as getNameOfDeclaration, U as isNewExpression, V as isModuleBlock, W as isNumericLiteral, X as isSatisfiesExpression, Y as isReturnStatement, Z as isSignatureDeclaration, _ as uniqueByReference, a as descendantsOf, at as isVariableDeclaration, c as isGenericDeclaration, d as lineOf$3, et as isStringLiteral, f as packageOf$1, g as symbolAt, i as declarationsOf, it as isUnionTypeNode, j as isCallExpression, k as isBinaryExpression, l as isInsideAny, m as referencedSymbols, n as columnOf, nt as isTypeLiteralNode, o as importedModulesOf, ot as isVariableDeclarationList, p as propertyNamesOf, q as isPropertyAccessExpression, r as contains, rt as isTypeReferenceNode, s as isExternalDeclaration, st as isVariableStatement, t as childrenOf$3, tt as isTypeAliasDeclaration, u as isTypeDeclaration, x as SignatureKind, z as isImportDeclaration } from "./syntax-ct2fFLtv.mjs";
9
- import { a as problemAt$9, i as formatProblem, n as ProblemList, o as sortProblems } from "./cli-contract-BY7vwgKc.mjs";
10
- import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-GbrDfB8K.mjs";
9
+ import { $ as isSpreadElement, A as isBlock, B as isInterfaceDeclaration, C as getJSDocTags, D as isArrayLiteralExpression, E as getTextOfJSDocComment, F as isExportDeclaration, G as isObjectLiteralExpression, H as isModuleDeclaration, I as isFunctionDeclaration, J as isPropertyAssignment, K as isParenthesizedExpression, L as isFunctionExpression, M as isClassDeclaration, N as isElementAccessExpression, O as isArrowFunction, P as isEnumDeclaration, Q as isSourceFile, R as isIdentifier, S as SyntaxKind, T as getNameOfDeclaration, U as isNewExpression, V as isModuleBlock, W as isNumericLiteral, X as isSatisfiesExpression, Y as isReturnStatement, Z as isSignatureDeclaration, _ as uniqueByReference, a as descendantsOf, at as isVariableDeclaration, c as isGenericDeclaration, d as lineOf$3, et as isStringLiteral, f as packageOf$1, g as symbolAt, i as declarationsOf, it as isUnionTypeNode, j as isCallExpression, k as isBinaryExpression, l as isInsideAny, m as referencedSymbols, n as columnOf, nt as isTypeLiteralNode, o as importedModulesOf, ot as isVariableDeclarationList, p as propertyNamesOf, q as isPropertyAccessExpression, r as contains, rt as isTypeReferenceNode, s as isExternalDeclaration, st as isVariableStatement, t as childrenOf$2, tt as isTypeAliasDeclaration, u as isTypeDeclaration, x as SignatureKind, z as isImportDeclaration } from "./syntax-P4jlh7LM.mjs";
10
+ import { a as sortProblems, i as problemAt$9, r as formatProblem, t as ProblemList } from "./problem-DHWbumiO.mjs";
11
+ import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-Calown4W.mjs";
12
+ import "./cli-contract-D7btWrEu.mjs";
11
13
  import { VpToolsError, runVpa } from "@r_masseater/vite-plus-adopt";
12
14
  import { Array, Config, Effect, FileSystem, HashMap, HashSet, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Schema, Stdio, Stream, String as String$1, pipe } from "effect";
13
15
  import { updateWorkspaceManifest } from "@pnpm/workspace.workspace-manifest-writer";
@@ -16,7 +18,7 @@ import { parse, resolveConfigFromFile } from "vite-plus";
16
18
  import { parse as parse$1 } from "@pnpm/deps.path";
17
19
  import { fileURLToPath } from "node:url";
18
20
  import treeSitter from "@vscode/tree-sitter-wasm";
19
- import { Parser, isMap, isPair, isScalar, isSeq, parse as parse$2, parseDocument, visit } from "yaml";
21
+ import { isMap, isPair, isScalar, isSeq, parse as parse$2, parseDocument, visit } from "yaml";
20
22
  import semver from "semver";
21
23
  import { diagnosticDetail, lint, markdownPathspecs, y8Section } from "@r_masseater/y8";
22
24
  import { lint as lint$1, wismPathspecs, wismSection } from "@r_masseater/wism";
@@ -78,19 +80,6 @@ const unlessPassed = Effect.fn("unlessPassed")(function* unlessPassed(root, inpu
78
80
  if (Array.isReadonlyArrayEmpty(problems)) yield* keepOnly(records, [key]);
79
81
  return problems;
80
82
  });
81
- // src/shared/lib/text-position.ts
82
- const START$19 = 0;
83
- const FIRST_COLUMN$4 = 1;
84
- const positionOf = (source) => (index) => {
85
- const before = pipe(source, String$1.slice(START$19, index), String$1.split("\n"));
86
- return {
87
- line: before.length,
88
- column: pipe(Array.last(before), Option.match({
89
- onNone: () => FIRST_COLUMN$4,
90
- onSome: (last) => last.length + FIRST_COLUMN$4
91
- }))
92
- };
93
- };
94
83
  // src/features/check-overrides/model/override-resolution.ts
95
84
  const VerdictSchema = Schema.Literals([
96
85
  "unused",
@@ -356,88 +345,58 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
356
345
  overrides
357
346
  }, keys));
358
347
  });
359
- // src/shared/lib/scanned-files.ts
360
- const SCANNED_FILE = /(?:\.(?:[cm]?[jt]sx?|jsonc?|toml|ya?ml|sh|bash|zsh|fish|rs|cs|go|mk)|(?:^|\/)(?:(?:Dockerfile|Containerfile)[^/]*|Makefile|justfile|\.tool-versions|[^./][^./]*))$/u;
361
- const LOCKFILE$1 = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
362
- const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
363
- const READ_CONCURRENCY$30 = 64;
364
- const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE$1.test(name);
365
- const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
366
- /** @internal */
367
- const listedFiles = Effect.fn("listedFiles")(function* listedFiles(root) {
368
- const files = yield* RepositoryFiles;
369
- const names = yield* files.ownedFiles(root);
370
- return pipe(names, Array.map((name) => ({
371
- name,
372
- file: files.join(root, name)
373
- })));
374
- });
375
- /** @internal */
376
- const presentFiles = Effect.fn("presentFiles")(function* presentFiles(listed) {
377
- const files = yield* RepositoryFiles;
378
- return yield* pipe(listed, Effect.filter(({ file }) => files.exists(file)));
379
- });
380
- /** @internal */
381
- const scanText = Effect.fn("scanText")(function* scanText(listed, problemsIn) {
382
- const files = yield* RepositoryFiles;
383
- const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
384
- onNone: () => [],
385
- onSome: (source) => problemsIn(entry, source)
386
- }))), { concurrency: READ_CONCURRENCY$30 });
387
- return Array.flatten(found);
388
- });
389
348
  // src/features/check-overrides/model/git-subpath.ts
390
349
  const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
391
350
  const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
392
- const RULE$49 = "git-subpath-dependency";
351
+ const RULE$52 = "git-subpath-dependency";
393
352
  const WHOLE_MATCH$3 = 0;
394
353
  const problemAt$8 = ({ file }, source) => (found) => ({
395
354
  file,
396
355
  ...positionOf(source)(found.index ?? WHOLE_MATCH$3),
397
- rule: RULE$49,
356
+ rule: RULE$52,
398
357
  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])}\`.`
399
358
  });
400
- const problemsIn$16 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$8(entry, source)));
359
+ const problemsIn$17 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$8(entry, source)));
401
360
  const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
402
361
  /** @internal */
403
362
  const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
404
363
  const listed = yield* listedFiles(root);
405
- return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$16);
364
+ return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$17);
406
365
  });
407
366
  // src/features/check-overrides/model/restricted-rules.ts
408
- const RULE$48 = "unnamed-restriction";
367
+ const RULE$51 = "unnamed-restriction";
409
368
  const WHOLE_MATCH$2 = 0;
410
369
  const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
411
- const problemsIn$15 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
370
+ const problemsIn$16 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
412
371
  file: entry.file,
413
372
  ...positionOf(source)(found.index ?? WHOLE_MATCH$2),
414
- rule: RULE$48,
373
+ rule: RULE$51,
415
374
  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.`
416
375
  })));
417
376
  /** @internal */
418
377
  const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRestrictedRules(root) {
419
378
  const listed = yield* listedFiles(root);
420
- return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$15);
379
+ return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$16);
421
380
  });
422
381
  // src/features/check-overrides/model/package-registry.ts
423
- const RULE$47 = "package-registry";
382
+ const RULE$50 = "package-registry";
424
383
  const REGISTRY = "https://npm.flatt.tech/";
425
384
  const TRAILING_SLASH = /\/$/u;
426
385
  const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
427
386
  const NPMRC = /(?:^|\/)\.npmrc$/u;
428
387
  const WORKSPACE_REGISTRY = /^registry:/mu;
429
388
  const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
430
- const START$18 = 0;
389
+ const START$19 = 0;
431
390
  const REASON = `Installs go through Takumi Guard (${REGISTRY}), which blocks known-malicious packages before they are installed.`;
432
391
  const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
433
392
  const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
434
393
  const withoutSlash = String$1.replace(TRAILING_SLASH, "");
435
394
  const isGuarded = (registry) => withoutSlash(registry) === withoutSlash(REGISTRY);
436
- const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$18));
395
+ const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$19));
437
396
  const workspaceProblem = (file, source, registry) => ({
438
397
  file,
439
398
  ...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
440
- rule: RULE$47,
399
+ rule: RULE$50,
441
400
  message: Option.match(registry, {
442
401
  onNone: () => `${REASON} Set \`registry: ${REGISTRY}\` in ${WORKSPACE_FILE$5}.`,
443
402
  onSome: (value) => `${REASON} \`registry\` is ${value}. Set it to ${REGISTRY}.`
@@ -445,9 +404,9 @@ const workspaceProblem = (file, source, registry) => ({
445
404
  });
446
405
  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) => ({
447
406
  file: entry.file,
448
- ...positionOf(source)(found.index ?? START$18),
449
- rule: RULE$47,
450
- message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$18])}\`. Remove the line.`
407
+ ...positionOf(source)(found.index ?? START$19),
408
+ rule: RULE$50,
409
+ message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$19])}\`. Remove the line.`
451
410
  })));
452
411
  const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
453
412
  const files = yield* RepositoryFiles;
@@ -466,7 +425,7 @@ const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPa
466
425
  return [...yield* checkWorkspace(root), ...overrides];
467
426
  });
468
427
  // src/features/check-placement/model/colocated-git-patterns.ts
469
- const RULE$46 = "colocated-git-patterns";
428
+ const RULE$49 = "colocated-git-patterns";
470
429
  const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
471
430
  const ROOT$2 = ".";
472
431
  const SEPARATOR$21 = "/";
@@ -477,7 +436,7 @@ const FLOATING_PREFIX = `${ANY_DEPTH}${SEPARATOR$21}`;
477
436
  const LEADING_SLASHES = /^\/+/u;
478
437
  const TRAILING_SLASHES = /\/+$/u;
479
438
  const SPACES = /\s+/u;
480
- const FIRST$24 = 1;
439
+ const FIRST$26 = 1;
481
440
  const READ_CONCURRENCY$29 = 16;
482
441
  const isInside = (directory) => (inner) => inner !== directory && (directory === ROOT$2 || String$1.startsWith(`${directory}${SEPARATOR$21}`)(inner));
483
442
  const withoutPrefix = (prefix, text) => {
@@ -503,7 +462,7 @@ const entryOf$1 = (file, kind, directory) => (line, index) => {
503
462
  file,
504
463
  kind,
505
464
  directory,
506
- line: index + FIRST$24,
465
+ line: index + FIRST$26,
507
466
  pattern,
508
467
  values: Array.join(values, " ")
509
468
  });
@@ -518,12 +477,12 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
518
477
  const problemAt$7 = (entry, message) => ({
519
478
  file: entry.file,
520
479
  line: entry.line,
521
- column: FIRST$24,
522
- rule: RULE$46,
480
+ column: FIRST$26,
481
+ rule: RULE$49,
523
482
  message
524
483
  });
525
484
  const misplacedMessage = (kind, workspaces) => {
526
- if (workspaces.length === FIRST$24) {
485
+ if (workspaces.length === FIRST$26) {
527
486
  const workspace = Array.join(workspaces, "");
528
487
  return `matches only paths inside the workspace ${workspace}. Move it to ${workspace}/${kind} and write it relative to that directory.`;
529
488
  }
@@ -581,8 +540,8 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
581
540
  return Array.getSomes([...misplacedFound, ...repeatedFound]);
582
541
  });
583
542
  // src/features/check-placement/model/colocated-tests.ts
584
- const RULE$45 = "colocated-test";
585
- const FIRST$23 = 1;
543
+ const RULE$48 = "colocated-test";
544
+ const FIRST$25 = 1;
586
545
  const READ_CONCURRENCY$28 = 64;
587
546
  const ROOT_SUBPATH = ".";
588
547
  const NAME_GROUP = "name";
@@ -596,7 +555,7 @@ const SPEC_FILE = /\.spec\.[cm]?[jt]sx?$/u;
596
555
  const RELATIVE_REFERENCE = /["'`]\.\/(?<name>[^/"'`]+)/gu;
597
556
  const DIRNAME_REFERENCE = /import\.meta\.dirname\s*,\s*["'](?<name>[^/"']+)["']/gu;
598
557
  const MODULE_SPECIFIER = /(?:\bfrom\s+|\bimport\s*\(\s*|\bimport\s+|\bvi\.mock\(\s*)["'](?<specifier>[^"'.#][^"']*)["']/gu;
599
- const EXCLUDED$6 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
558
+ const EXCLUDED$7 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
600
559
  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.";
601
560
  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>.";
602
561
  const Manifest$5 = Schema.Struct({
@@ -607,14 +566,14 @@ const decodeManifest$9 = Schema.decodeUnknownOption(Schema.fromJsonString(Manife
607
566
  const byLength$2 = Order.mapInput(Order.Number, (directory) => directory.length);
608
567
  const problemFor$7 = (test, message) => ({
609
568
  file: test.file,
610
- line: FIRST$23,
611
- column: FIRST$23,
612
- rule: RULE$45,
569
+ line: FIRST$25,
570
+ column: FIRST$25,
571
+ rule: RULE$48,
613
572
  message: `${test.base} ${message}`
614
573
  });
615
574
  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);
616
575
  const namesSibling = (source) => pipe([...groupsOf$1(source, RELATIVE_REFERENCE, NAME_GROUP), ...groupsOf$1(source, DIRNAME_REFERENCE, NAME_GROUP)], Array.some((name) => !TEST_FILE$2.test(name)));
617
- const ownerOf$4 = (packages, name) => {
576
+ const ownerOf$5 = (packages, name) => {
618
577
  const owners = pipe(packages, Array.filter((directory) => String$1.startsWith(directory)(name)));
619
578
  return Array.last(Array.sort(owners, byLength$2));
620
579
  };
@@ -625,7 +584,7 @@ const specifiersBeside = ({ join, dirname, directory }) => (manifest) => pipe(Op
625
584
  }), Array.filter(({ source }) => dirname(source) === directory), Array.map(({ label }) => String$1.replace(ROOT_SUBPATH, name)(label)))), Option.getOrElse(() => []));
626
585
  const ownSpecifiers = Effect.fn("ownSpecifiers")(function* ownSpecifiers(context, test) {
627
586
  const files = yield* RepositoryFiles;
628
- const owner = ownerOf$4(context.packages, test.name);
587
+ const owner = ownerOf$5(context.packages, test.name);
629
588
  if (Option.isNone(owner)) return [];
630
589
  const text = yield* files.readFile(files.join(context.root, owner.value, MANIFEST_FILE$3));
631
590
  const join = (target) => files.join(context.root, owner.value, target);
@@ -657,7 +616,7 @@ const problemIn$6 = Effect.fn("problemIn")(function* problemIn(context, test) {
657
616
  /** @internal */
658
617
  const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColocatedTests(root) {
659
618
  const files = yield* RepositoryFiles;
660
- const listed = yield* files.matchingFiles(root, EXCLUDED$6);
619
+ const listed = yield* files.matchingFiles(root, EXCLUDED$7);
661
620
  const names = pipe(listed, Array.filter(String$1.isNonEmpty));
662
621
  const context = {
663
622
  root,
@@ -691,28 +650,28 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
691
650
  });
692
651
  // src/features/check-placement/model/agent-docs-length.ts
693
652
  const RECOMMENDED_LINES = 200;
694
- const FIRST$22 = 1;
695
- const RULE$44 = "agent-docs-length";
653
+ const FIRST$24 = 1;
654
+ const RULE$47 = "agent-docs-length";
696
655
  const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
697
656
  const problemFor$6 = (file) => (lines) => {
698
657
  if (lines <= RECOMMENDED_LINES) return Option.none();
699
658
  return Option.some({
700
659
  file,
701
660
  line: 201,
702
- column: FIRST$22,
703
- rule: RULE$44,
661
+ column: FIRST$24,
662
+ rule: RULE$47,
704
663
  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.`
705
664
  });
706
665
  };
707
666
  /** @internal */
708
667
  const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$6(file)(lineCount(source)));
709
668
  // src/features/check-placement/model/claude-link.ts
710
- const RULE$43 = "claude-md-link";
669
+ const RULE$46 = "claude-md-link";
711
670
  const CLAUDE = "CLAUDE.md";
712
671
  const AGENTS = "AGENTS.md";
713
- const FIRST$21 = 1;
672
+ const FIRST$23 = 1;
714
673
  const READ_CONCURRENCY$26 = 16;
715
- const MESSAGE$15 = "CLAUDE.md must be a symbolic link to AGENTS.md";
674
+ const MESSAGE$16 = "CLAUDE.md must be a symbolic link to AGENTS.md";
716
675
  /** @internal */
717
676
  const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
718
677
  const files = yield* RepositoryFiles;
@@ -724,10 +683,10 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
724
683
  const pointsElsewhere = pipe(target, Option.exists((value) => value !== AGENTS));
725
684
  return pipe(Option.liftPredicate(file, () => !isLink || pointsElsewhere), Option.map((path) => ({
726
685
  file: path,
727
- line: FIRST$21,
728
- column: FIRST$21,
729
- rule: RULE$43,
730
- message: MESSAGE$15
686
+ line: FIRST$23,
687
+ column: FIRST$23,
688
+ rule: RULE$46,
689
+ message: MESSAGE$16
731
690
  })));
732
691
  });
733
692
  const claude = pipe(listed, Array.filter((name) => files.basename(name) === CLAUDE));
@@ -735,9 +694,9 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
735
694
  return Array.getSomes(found);
736
695
  });
737
696
  // src/features/check-placement/model/dangling-links.ts
738
- const RULE$42 = "dangling-link";
697
+ const RULE$45 = "dangling-link";
739
698
  const SEPARATOR$20 = "/";
740
- const FIRST$20 = 1;
699
+ const FIRST$22 = 1;
741
700
  const READ_CONCURRENCY$25 = 16;
742
701
  const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$20}`)(name);
743
702
  /** @internal */
@@ -749,9 +708,9 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
749
708
  const link = yield* files.readLink(file);
750
709
  return pipe(link, Option.map((target) => files.relative(root, files.resolve(files.dirname(file), target))), Option.filter((target) => !pipe(listed, Array.some(holds(target)))), Option.map((target) => ({
751
710
  file,
752
- line: FIRST$20,
753
- column: FIRST$20,
754
- rule: RULE$42,
711
+ line: FIRST$22,
712
+ column: FIRST$22,
713
+ rule: RULE$45,
755
714
  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.`
756
715
  })));
757
716
  });
@@ -759,10 +718,10 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
759
718
  return Array.getSomes(found);
760
719
  });
761
720
  // src/features/check-placement/model/nested-docs.ts
762
- const RULE$41 = "nested-docs";
721
+ const RULE$44 = "nested-docs";
763
722
  const CONFIG_FILE$6 = "vite.config.ts";
764
723
  const SEPARATOR$19 = "/";
765
- const FIRST$19 = 1;
724
+ const FIRST$21 = 1;
766
725
  const READ_CONCURRENCY$24 = 64;
767
726
  const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
768
727
  const WORKSPACE_AGENT_DOC = "AGENTS.md";
@@ -773,9 +732,9 @@ var RootConfigUnreadable = class extends taggedError$5()("RootConfigUnreadable",
773
732
  const isNested = (name) => String$1.includes(SEPARATOR$19)(name);
774
733
  const problemFor$5 = (file, message) => ({
775
734
  file,
776
- line: FIRST$19,
777
- column: FIRST$19,
778
- rule: RULE$41,
735
+ line: FIRST$21,
736
+ column: FIRST$21,
737
+ rule: RULE$44,
779
738
  message
780
739
  });
781
740
  const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
@@ -826,10 +785,10 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
826
785
  return Array.getSomes(found);
827
786
  });
828
787
  // src/features/check-placement/model/published-readme.ts
829
- const RULE$40 = "published-readme";
788
+ const RULE$43 = "published-readme";
830
789
  const README_FILE = "README.md";
831
790
  const READ_CONCURRENCY$23 = 16;
832
- const MESSAGE$14 = "contains Japanese. This package is published to npm, so write its README in English.";
791
+ const MESSAGE$15 = "contains Japanese. This package is published to npm, so write its README in English.";
833
792
  const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
834
793
  const FILE_START$1 = 1;
835
794
  const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
@@ -840,7 +799,7 @@ const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, { directory
840
799
  file,
841
800
  line: FILE_START$1,
842
801
  column: FILE_START$1,
843
- rule: RULE$40,
802
+ rule: RULE$43,
844
803
  message: MISSING_MESSAGE
845
804
  });
846
805
  return pipe(text, Option.flatMap((source) => pipe(Option.fromNullishOr(JAPANESE.exec(source)), Option.map((found) => {
@@ -849,8 +808,8 @@ const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, { directory
849
808
  file,
850
809
  line,
851
810
  column,
852
- rule: RULE$40,
853
- message: MESSAGE$14
811
+ rule: RULE$43,
812
+ message: MESSAGE$15
854
813
  };
855
814
  }))));
856
815
  });
@@ -861,11 +820,11 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
861
820
  return Array.getSomes(found);
862
821
  });
863
822
  // src/features/check-placement/model/published-tests.ts
864
- const RULE$39 = "published-tests";
823
+ const RULE$42 = "published-tests";
865
824
  const MANIFEST_FILE$2 = "package.json";
866
825
  const FILE_START = 1;
867
826
  const TEST_FILE$1 = /\.test\.[cm]?[jt]sx?$/u;
868
- const MESSAGE$13 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
827
+ const MESSAGE$14 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
869
828
  const testedIn = (listed) => (prefix) => pipe(listed, Array.some((file) => String$1.startsWith(prefix)(file) && TEST_FILE$1.test(file)));
870
829
  const problemFor$4 = Effect.fn("problemFor")(function* problemFor(root, listed, { directory }) {
871
830
  const files = yield* RepositoryFiles;
@@ -876,8 +835,8 @@ const problemFor$4 = Effect.fn("problemFor")(function* problemFor(root, listed,
876
835
  file: files.join(absolute, MANIFEST_FILE$2),
877
836
  line: FILE_START,
878
837
  column: FILE_START,
879
- rule: RULE$39,
880
- message: MESSAGE$13
838
+ rule: RULE$42,
839
+ message: MESSAGE$14
881
840
  });
882
841
  });
883
842
  /** @internal */
@@ -890,12 +849,12 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
890
849
  return Array.getSomes(found);
891
850
  });
892
851
  // src/features/check-placement/model/root-docs.ts
893
- const RULE$38 = "root-docs";
852
+ const RULE$41 = "root-docs";
894
853
  const SEPARATOR$18 = "/";
895
- const FIRST$18 = 1;
854
+ const FIRST$20 = 1;
896
855
  const MARKDOWN$1 = /\.(?:md|mdx|markdown)$/iu;
897
856
  const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
898
- const MESSAGE$12 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
857
+ const MESSAGE$13 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
899
858
  const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$18)(name) && MARKDOWN$1.test(name) && !ALLOWED.test(name);
900
859
  /** @internal */
901
860
  const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
@@ -903,17 +862,17 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
903
862
  const names = yield* files.listedFiles(root);
904
863
  return pipe(names, Array.filter(isStrayRootDoc), Array.map((name) => ({
905
864
  file: files.join(root, name),
906
- line: FIRST$18,
907
- column: FIRST$18,
908
- rule: RULE$38,
909
- message: `${name} ${MESSAGE$12}`
865
+ line: FIRST$20,
866
+ column: FIRST$20,
867
+ rule: RULE$41,
868
+ message: `${name} ${MESSAGE$13}`
910
869
  })));
911
870
  });
912
871
  // src/features/check-placement/model/root-readme.ts
913
- const RULE$37 = "root-readme";
872
+ const RULE$40 = "root-readme";
914
873
  const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
915
874
  const READ_CONCURRENCY$22 = 16;
916
- const START$17 = 0;
875
+ const START$18 = 0;
917
876
  const CHECK_POLICY = "@r_masseater/msch";
918
877
  const MARKETPLACE = ".claude-plugin/marketplace.json";
919
878
  const RELATIVE$1 = /^\.\//u;
@@ -922,7 +881,7 @@ const MarketplacePlugin = Schema.Struct({
922
881
  name: Schema.optional(Schema.String),
923
882
  source: Schema.Unknown
924
883
  });
925
- const Marketplace = Schema.fromJsonString(Schema.Struct({ plugins: Schema.Array(MarketplacePlugin) }));
884
+ const Marketplace$1 = Schema.fromJsonString(Schema.Struct({ plugins: Schema.Array(MarketplacePlugin) }));
926
885
  const NO_PLUGINS = {
927
886
  directories: [],
928
887
  names: []
@@ -941,7 +900,7 @@ const pluginsOf = (plugins) => {
941
900
  const marketplacePlugins = Effect.fn("marketplacePlugins")(function* marketplacePlugins(root) {
942
901
  const files = yield* RepositoryFiles;
943
902
  const text = yield* files.readFile(files.join(root, MARKETPLACE));
944
- return pipe(text, Option.flatMap(Schema.decodeOption(Marketplace)), Option.map(({ plugins }) => pluginsOf(plugins)), Option.getOrElse(() => NO_PLUGINS));
903
+ return pipe(text, Option.flatMap(Schema.decodeOption(Marketplace$1)), Option.map(({ plugins }) => pluginsOf(plugins)), Option.getOrElse(() => NO_PLUGINS));
945
904
  });
946
905
  const isPluginName = (plugins) => (name) => Array.contains(plugins.names, name);
947
906
  const ownNames = (plugins, names) => {
@@ -952,14 +911,14 @@ const patternFor = (plugins) => ({ directory, names }) => patternOf$1(Option.mat
952
911
  onNone: () => ownNames(plugins, names),
953
912
  onSome: () => [directory]
954
913
  }));
955
- const problemsIn$14 = (file, source, plugins) => (workspace) => {
914
+ const problemsIn$15 = (file, source, plugins) => (workspace) => {
956
915
  const message = messageFor(workspace.directory);
957
916
  const at = positionOf(source);
958
917
  const pattern = patternFor(plugins)(workspace);
959
918
  return pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((found) => ({
960
919
  file,
961
- ...at(found.index ?? START$17),
962
- rule: RULE$37,
920
+ ...at(found.index ?? START$18),
921
+ rule: RULE$40,
963
922
  message
964
923
  })));
965
924
  };
@@ -967,7 +926,7 @@ const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadm
967
926
  const text = yield* (yield* RepositoryFiles).readFile(file);
968
927
  return pipe(text, Option.match({
969
928
  onNone: () => [],
970
- onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$14(file, source, plugins)))
929
+ onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$15(file, source, plugins)))
971
930
  }));
972
931
  });
973
932
  /** @internal */
@@ -997,7 +956,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
997
956
  return Array.flatten(found);
998
957
  });
999
958
  // src/features/check-placement/model/docs-mirror.ts
1000
- const RULE$36 = "docs-mirror";
959
+ const RULE$39 = "docs-mirror";
1001
960
  const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
1002
961
  const MIRROR_LIMIT = 3;
1003
962
  const READ_CONCURRENCY$21 = 16;
@@ -1014,7 +973,7 @@ const firstMention = (source, workspace) => {
1014
973
  const mentions = pipe(workspace.names, Array.flatMap(mentionOf(source, workspace.directory)));
1015
974
  return Array.head(Array.sort(mentions, byOffset));
1016
975
  };
1017
- const ownerOf$3 = (doc) => (workspace) => String$1.startsWith(`${workspace.directory}/`)(doc);
976
+ const ownerOf$4 = (doc) => (workspace) => String$1.startsWith(`${workspace.directory}/`)(doc);
1018
977
  const describe = (mentions) => pipe(mentions, Array.map(({ directory }) => `\`${directory}\``), Array.join(", "));
1019
978
  const problemFor$3 = (file, source, mentions) => pipe(Array.head(mentions), Option.filter(() => mentions.length >= MIRROR_LIMIT), Option.map(({ offset }) => {
1020
979
  const { line, column } = positionOf(source)(offset);
@@ -1022,11 +981,11 @@ const problemFor$3 = (file, source, mentions) => pipe(Array.head(mentions), Opti
1022
981
  file,
1023
982
  line,
1024
983
  column,
1025
- rule: RULE$36,
984
+ rule: RULE$39,
1026
985
  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.`
1027
986
  };
1028
987
  }), Option.toArray);
1029
- const othersIn = (doc, workspaces) => pipe(workspaces, Array.filter((workspace) => !ownerOf$3(doc)(workspace)));
988
+ const othersIn = (doc, workspaces) => pipe(workspaces, Array.filter((workspace) => !ownerOf$4(doc)(workspace)));
1030
989
  const problemIn$3 = (workspaces) => (doc, file, source) => {
1031
990
  const mentions = pipe(othersIn(doc, workspaces), Array.flatMap((workspace) => Option.toArray(firstMention(source, workspace))));
1032
991
  return problemFor$3(file, source, Array.sort(mentions, byOffset));
@@ -1054,27 +1013,27 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
1054
1013
  return Array.flatten(found);
1055
1014
  });
1056
1015
  // src/features/check-placement/model/ignored-sources.ts
1057
- const RULE$35 = "ignored-sources";
1016
+ const RULE$38 = "ignored-sources";
1058
1017
  const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
1059
- const FIRST$17 = 1;
1060
- const MESSAGE$11 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
1018
+ const FIRST$19 = 1;
1019
+ const MESSAGE$12 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
1061
1020
  /** @internal */
1062
1021
  const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
1063
1022
  const files = yield* RepositoryFiles;
1064
1023
  const ignored = yield* files.ignoredFiles(root, SOURCES);
1065
1024
  return pipe(ignored, Array.map((file) => ({
1066
1025
  file: files.join(root, file),
1067
- line: FIRST$17,
1068
- column: FIRST$17,
1069
- rule: RULE$35,
1070
- message: MESSAGE$11
1026
+ line: FIRST$19,
1027
+ column: FIRST$19,
1028
+ rule: RULE$38,
1029
+ message: MESSAGE$12
1071
1030
  })));
1072
1031
  });
1073
1032
  // src/features/check-placement/model/member-sources.ts
1074
1033
  const ROOT_WORKSPACE$1 = ".";
1075
- const FIRST$16 = 1;
1034
+ const FIRST$18 = 1;
1076
1035
  const SEPARATOR$16 = "/";
1077
- const EXCLUDED$5 = [
1036
+ const EXCLUDED$6 = [
1078
1037
  ":(exclude,attr:linguist-vendored)",
1079
1038
  ":(exclude,attr:linguist-generated)",
1080
1039
  ":(exclude,attr:linguist-documentation)"
@@ -1087,18 +1046,18 @@ const memberSources = Effect.fn("memberSources")(function* memberSources(root) {
1087
1046
  const files = yield* RepositoryFiles;
1088
1047
  return {
1089
1048
  workspaces: yield* memberWorkspaces(root),
1090
- listed: yield* files.matchingFiles(root, EXCLUDED$5)
1049
+ listed: yield* files.matchingFiles(root, EXCLUDED$6)
1091
1050
  };
1092
1051
  });
1093
1052
  const byLength$1 = Order.mapInput(Order.Number, (directory) => directory.length);
1094
1053
  const fileProblem$1 = ({ file, rule, message }) => ({
1095
1054
  file,
1096
- line: FIRST$16,
1097
- column: FIRST$16,
1055
+ line: FIRST$18,
1056
+ column: FIRST$18,
1098
1057
  rule,
1099
1058
  message
1100
1059
  });
1101
- const ownerOf$2 = (workspaces) => (name) => pipe(workspaces, Array.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$16}`)(name)), (owners) => Array.last(Array.sort(owners, byLength$1)), Option.map((workspace) => ({
1060
+ const ownerOf$3 = (workspaces) => (name) => pipe(workspaces, Array.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$16}`)(name)), (owners) => Array.last(Array.sort(owners, byLength$1)), Option.map((workspace) => ({
1102
1061
  workspace,
1103
1062
  inner: String$1.slice(workspace.length + 1)(name)
1104
1063
  })));
@@ -9705,7 +9664,7 @@ const deployNamed = ({ workspace, inner }) => {
9705
9664
  const checkSourceNames = Effect.fn("checkSourceNames")(function* checkSourceNames(root) {
9706
9665
  const files = yield* RepositoryFiles;
9707
9666
  const { workspaces, listed } = yield* memberSources(root);
9708
- const owned = pipe(listed, Array.map(ownerOf$2(workspaces)), Array.getSomes);
9667
+ const owned = pipe(listed, Array.map(ownerOf$3(workspaces)), Array.getSomes);
9709
9668
  const report = (rule, message) => (found) => pipe(Array.dedupe(found), Array.map((name) => fileProblem$1({
9710
9669
  file: files.join(root, name),
9711
9670
  rule,
@@ -9735,7 +9694,7 @@ const LAYER_ITEMS = [
9735
9694
  "inner_attribute_item"
9736
9695
  ];
9737
9696
  const READ_CONCURRENCY$20 = 64;
9738
- const EXCLUDED$4 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
9697
+ const EXCLUDED$5 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
9739
9698
  const NONE$2 = [];
9740
9699
  const ROOT_MESSAGE = "defines code in the crate root. Keep lib.rs and main.rs to mod declarations of layers, use, pub use and fn main, and put the code in a layer.";
9741
9700
  const LAYER_INDEX_MESSAGE = "defines code in a layer module. A layer module holds only mod declarations of its slices and use; put the code in a slice.";
@@ -9802,7 +9761,7 @@ const isRead = ({ inner }) => {
9802
9761
  };
9803
9762
  const rustSources = Effect.fn("rustSources")(function* rustSources(root) {
9804
9763
  const files = yield* RepositoryFiles;
9805
- const listed = yield* files.matchingFiles(root, EXCLUDED$4);
9764
+ const listed = yield* files.matchingFiles(root, EXCLUDED$5);
9806
9765
  const owner = crateOf(crateDirectories(listed));
9807
9766
  return pipe(listed, Array.filter((name) => RUST_FILE.test(name)), Array.flatMap((name) => Option.toArray(Option.map(owner(name), (owned) => ({
9808
9767
  ...owned,
@@ -9820,13 +9779,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
9820
9779
  return [...sliceNameProblems(root, files.join, sources), ...Array.flatMap(Array.getSomes(read), problemsOf$4)];
9821
9780
  });
9822
9781
  // src/features/check-placement/model/shadcn-ui-alias.ts
9823
- const RULE$34 = "shadcn-ui-alias";
9824
- const FIRST$15 = 1;
9782
+ const RULE$37 = "shadcn-ui-alias";
9783
+ const FIRST$17 = 1;
9825
9784
  const problemOf$8 = (directory, { file, alias }) => ({
9826
9785
  file,
9827
- line: FIRST$15,
9828
- column: FIRST$15,
9829
- rule: RULE$34,
9786
+ line: FIRST$17,
9787
+ column: FIRST$17,
9788
+ rule: RULE$37,
9830
9789
  message: `aliases.ui "${alias}" in ${directory}/components.json does not resolve to a directory through the imports of ${directory}/package.json. shadcn lint and msch then cannot tell which files are the design-system components. Point the alias at a "#/" import, such as "#/shared/ui", and map "#/*" to "./src/*".`
9831
9790
  });
9832
9791
  /** @internal */
@@ -9842,7 +9801,7 @@ const shadcnAliasProblems = Effect.fn("shadcnAliasProblems")(function* shadcnAli
9842
9801
  });
9843
9802
  // src/features/check-placement/model/source-aliases.ts
9844
9803
  const ALIAS_RULE = "source-alias";
9845
- const FIRST$14 = 1;
9804
+ const FIRST$16 = 1;
9846
9805
  const SOURCE_ALIAS = "#/*";
9847
9806
  const SOURCE_TARGET = "./src/*";
9848
9807
  const SOURCE_PREFIX = /^\.\/src(?:\/|$)/u;
@@ -9851,8 +9810,8 @@ const Manifest$4 = Schema.Struct({ imports: Schema.optional(Schema.Unknown) });
9851
9810
  const decodeManifest$8 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$4));
9852
9811
  const problemAt$6 = (file, rule, message) => ({
9853
9812
  file,
9854
- line: FIRST$14,
9855
- column: FIRST$14,
9813
+ line: FIRST$16,
9814
+ column: FIRST$16,
9856
9815
  rule,
9857
9816
  message
9858
9817
  });
@@ -9900,7 +9859,7 @@ const WORKFLOW_DIRECTORY$1 = ".github/";
9900
9859
  const SEPARATOR$13 = "/";
9901
9860
  const CURRENT = "./";
9902
9861
  const READ_CONCURRENCY$19 = 8;
9903
- const FIRST$13 = 1;
9862
+ const FIRST$15 = 1;
9904
9863
  const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
9905
9864
  const COMMAND = /^bin\/[^/]+\.[cm]?ts$/u;
9906
9865
  const NOT_COMMAND = /\.(?:test|d|test\.support)\.[cm]?ts$/u;
@@ -9960,7 +9919,7 @@ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array.fi
9960
9919
  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.`
9961
9920
  })));
9962
9921
  const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array.flatMap(stringsIn), Array.flatMap(runsIn));
9963
- const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
9922
+ const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
9964
9923
  const files = yield* RepositoryFiles;
9965
9924
  const config = yield* workspaceConfigOf(root, directory);
9966
9925
  const entries = yield* declaredEntries(root, directory);
@@ -9976,8 +9935,8 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(root, directo
9976
9935
  const isRun = (path) => Array.contains(runPaths, path) || Array.contains(entries.bins, path) || String$1.includes(workspacePath(directory, path))(workflows);
9977
9936
  const unrun = pipe(commands, Array.filter((path) => !isRun(path)), Array.map((path) => ({
9978
9937
  file: files.join(root, directory, path),
9979
- line: FIRST$13,
9980
- column: FIRST$13,
9938
+ line: FIRST$15,
9939
+ column: FIRST$15,
9981
9940
  rule: UNRUN,
9982
9941
  message: `No task, package.json bin or workflow runs ${workspacePath(directory, path)}. Files in ${BIN}/ are entry points for fallow, so an unused one is never reported. Run it from a task or delete it.`
9983
9942
  })));
@@ -9989,8 +9948,8 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
9989
9948
  const isDirectory = yield* files.isDirectory(file);
9990
9949
  return pipe(isDirectory, Option.filter(Boolean), Option.map(() => ({
9991
9950
  file,
9992
- line: FIRST$13,
9993
- column: FIRST$13,
9951
+ line: FIRST$15,
9952
+ column: FIRST$15,
9994
9953
  rule: SCRIPTS,
9995
9954
  message: `${workspacePath(directory, SCRIPTS_DIRECTORY)} is a scripts directory. Put each command at ${BIN}/<name>.ts and the code that it shares in the package's own source, so that every workspace runs its commands the same way.`
9996
9955
  })));
@@ -9999,26 +9958,26 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
9999
9958
  const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
10000
9959
  const all = ["", ...yield* workspaceDirectories(root)];
10001
9960
  const workflows = yield* workflowText(root);
10002
- const found = yield* Effect.forEach(all, (directory) => problemsIn$13(root, directory, workflows), { concurrency: READ_CONCURRENCY$19 });
9961
+ const found = yield* Effect.forEach(all, (directory) => problemsIn$14(root, directory, workflows), { concurrency: READ_CONCURRENCY$19 });
10003
9962
  const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$19 });
10004
9963
  return [...Array.flatten(found), ...Array.getSomes(scripts)];
10005
9964
  });
10006
9965
  // src/features/check-repository-layout/model/crates.ts
10007
- const RULE$33 = "unverified-crate";
9966
+ const RULE$36 = "unverified-crate";
10008
9967
  const VERSION_RULE = "release-version";
10009
9968
  const MANIFEST_FILE$1 = "package.json";
10010
9969
  const APP_DIRECTORIES = ["", "src-tauri"];
10011
9970
  const CARGO_FILE$1 = "Cargo.toml";
10012
9971
  const CONFIG_FILE$5 = "vite.config.ts";
10013
9972
  const SEPARATOR$12 = "/";
10014
- const FIRST$12 = 1;
9973
+ const FIRST$14 = 1;
10015
9974
  const READ_CONCURRENCY$18 = 8;
10016
9975
  const PackageVersion = Schema.fromJsonString(Schema.Struct({ version: Schema.String }));
10017
9976
  const problemFor$2 = (crate, message) => ({
10018
9977
  file: crate.manifest,
10019
- line: FIRST$12,
10020
- column: FIRST$12,
10021
- rule: RULE$33,
9978
+ line: FIRST$14,
9979
+ column: FIRST$14,
9980
+ rule: RULE$36,
10022
9981
  message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
10023
9982
  });
10024
9983
  const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
@@ -10038,8 +9997,8 @@ const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemI
10038
9997
  if (Option.isNone(version) || version.value === crate.version) return Option.none();
10039
9998
  return Option.some({
10040
9999
  file: crate.manifest,
10041
- line: FIRST$12,
10042
- column: FIRST$12,
10000
+ line: FIRST$14,
10001
+ column: FIRST$14,
10043
10002
  rule: VERSION_RULE,
10044
10003
  message: `crate ${crate.name} is version ${crate.version} but ${workspace.value}/${MANIFEST_FILE$1} is ${version.value}. msch-publish releases the version in package.json, so bump both in the same PR.`
10045
10004
  });
@@ -10054,7 +10013,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
10054
10013
  return Array.getSomes(Array.flatten(found));
10055
10014
  });
10056
10015
  // src/features/check-repository-layout/model/deploy-entry-patterns.ts
10057
- const RULE$32 = "deploy-entry-pattern";
10016
+ const RULE$35 = "deploy-entry-pattern";
10058
10017
  const FALLOW_KEYS = [
10059
10018
  "entry",
10060
10019
  "entryPoints",
@@ -10073,7 +10032,7 @@ const ROOT_WORKSPACE = ".";
10073
10032
  const WRAP_OFFSET$1 = 1;
10074
10033
  const NO_OFFSET = 0;
10075
10034
  const READ_CONCURRENCY$17 = 8;
10076
- const MESSAGE$10 = "selects deploy entries by their name or location. A deploy entry is the file that an Alchemy resource names in main, and its name and place change with the code. Use workspaceSettings().lint.deployEntries in lint settings; fallow reads main from the stack by itself.";
10035
+ const MESSAGE$11 = "selects deploy entries by their name or location. A deploy entry is the file that an Alchemy resource names in main, and its name and place change with the code. Use workspaceSettings().lint.deployEntries in lint settings; fallow reads main from the stack by itself.";
10077
10036
  const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
10078
10037
  const FALLOW = {
10079
10038
  keys: FALLOW_KEYS,
@@ -10090,7 +10049,7 @@ const VITE = {
10090
10049
  const isPatternProperty = (keys) => (node) => node["type"] === "Property" && pipe(decodeKey$1(node["key"]), Option.exists((key) => Array.contains(keys, keyName(key))));
10091
10050
  const patternsIn = (keys) => (node) => {
10092
10051
  if (Predicate.isReadonlyObject(node) && isPatternProperty(keys)(node)) return stringsIn(node["value"]);
10093
- return pipe(childrenOf$2(node), Array.flatMap(patternsIn(keys)));
10052
+ return pipe(childrenOf$1(node), Array.flatMap(patternsIn(keys)));
10094
10053
  };
10095
10054
  const choicesOf = ([literal = "", options]) => pipe(Option.fromUndefinedOr(options), Option.map(String$1.split(OPTION_SEPARATOR)), Option.getOrElse(() => [""]), Array.map((option) => `${literal}${option}`));
10096
10055
  const combined = (chunks) => Array.matchLeft(chunks, {
@@ -10109,7 +10068,7 @@ const patternsOf = Effect.fn("patternsOf")(function* patternsOf(file, text, kind
10109
10068
  const parsed = yield* Effect.promise(() => parse(`${file}.ts`, kind.sourceOf(text), { lang: "ts" }));
10110
10069
  return pipe(patternsIn(kind.keys)(parsed.program), Array.filter(({ text: pattern }) => !String$1.startsWith(NEGATED)(pattern)));
10111
10070
  });
10112
- const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(request) {
10071
+ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(request) {
10113
10072
  const { root, file, kind, workspaces, entries } = request;
10114
10073
  const files = yield* RepositoryFiles;
10115
10074
  const path = files.join(root, file);
@@ -10125,8 +10084,8 @@ const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(request) {
10125
10084
  return pipe(Array.getSomes(flagged), Array.map(({ text: pattern, start }) => ({
10126
10085
  file: path,
10127
10086
  ...positionOf(text.value)(start - kind.offset),
10128
- rule: RULE$32,
10129
- message: `${pattern} ${MESSAGE$10}`
10087
+ rule: RULE$35,
10088
+ message: `${pattern} ${MESSAGE$11}`
10130
10089
  })));
10131
10090
  });
10132
10091
  /** @internal */
@@ -10148,7 +10107,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
10148
10107
  }];
10149
10108
  return [];
10150
10109
  }));
10151
- const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$12({
10110
+ const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$13({
10152
10111
  root,
10153
10112
  file,
10154
10113
  kind,
@@ -10158,7 +10117,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
10158
10117
  return Array.flatten(found);
10159
10118
  });
10160
10119
  // src/features/check-repository-layout/model/fallow-entries.ts
10161
- const RULE$31 = "listed-entry";
10120
+ const RULE$34 = "listed-entry";
10162
10121
  const ENTRY_KEYS = [
10163
10122
  "entry",
10164
10123
  "entryPoints",
@@ -10176,10 +10135,10 @@ const entryPatternsIn = (node) => {
10176
10135
  text,
10177
10136
  start: start - WRAP_OFFSET
10178
10137
  })));
10179
- return pipe(childrenOf$2(node), Array.flatMap(entryPatternsIn));
10138
+ return pipe(childrenOf$1(node), Array.flatMap(entryPatternsIn));
10180
10139
  };
10181
10140
  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);
10182
- const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
10141
+ const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
10183
10142
  const files = yield* RepositoryFiles;
10184
10143
  const path = files.join(root, file);
10185
10144
  const text = yield* files.readFile(path);
@@ -10188,7 +10147,7 @@ const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
10188
10147
  return pipe(entryPatternsIn(parsed.program), Array.filter(namesOneFile(directories)), Array.map(({ text: pattern, start }) => ({
10189
10148
  file: path,
10190
10149
  ...positionOf(text.value)(start),
10191
- rule: RULE$31,
10150
+ rule: RULE$34,
10192
10151
  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.`
10193
10152
  })));
10194
10153
  });
@@ -10196,15 +10155,15 @@ const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
10196
10155
  const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
10197
10156
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
10198
10157
  const directories = yield* workspaceDirectories(root);
10199
- const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$11(root, file, directories), { concurrency: READ_CONCURRENCY$16 });
10158
+ const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$12(root, file, directories), { concurrency: READ_CONCURRENCY$16 });
10200
10159
  return Array.flatten(found);
10201
10160
  });
10202
10161
  // src/features/check-repository-layout/model/root-workspace-paths.ts
10203
- const RULE$30 = "root-workspace-path";
10162
+ const RULE$33 = "root-workspace-path";
10204
10163
  const CONFIG_FILE$4 = "vite.config.ts";
10205
10164
  const PATH_CHARACTER = /[\w.@/-]/u;
10206
10165
  const NAME_CHARACTER = /[\w.@-]/u;
10207
- const FIRST$11 = 0;
10166
+ const FIRST$13 = 0;
10208
10167
  const NEXT$2 = 1;
10209
10168
  const isBoundary = (character, allowed) => character === "" || !allowed.test(character);
10210
10169
  const mentions = (directory) => (text) => {
@@ -10212,14 +10171,14 @@ const mentions = (directory) => (text) => {
10212
10171
  return pipe(Array.drop(parts, NEXT$2), Array.some((after, index) => {
10213
10172
  const before = parts[index] ?? "";
10214
10173
  const previous = String$1.slice(before.length - NEXT$2)(before);
10215
- const following = String$1.slice(FIRST$11, NEXT$2)(after);
10174
+ const following = String$1.slice(FIRST$13, NEXT$2)(after);
10216
10175
  return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
10217
10176
  }));
10218
10177
  };
10219
- const problemsIn$10 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
10178
+ const problemsIn$11 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
10220
10179
  file,
10221
10180
  ...positionOf(source)(found.start),
10222
- rule: RULE$30,
10181
+ rule: RULE$33,
10223
10182
  message: `${directory} is a workspace. The root ${CONFIG_FILE$4} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$4}: msch.lint, msch.devDependencies or its verify task.`
10224
10183
  })));
10225
10184
  /** @internal */
@@ -10230,12 +10189,12 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
10230
10189
  if (Option.isNone(source)) return [];
10231
10190
  const directories = yield* workspaceDirectories(root);
10232
10191
  const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
10233
- return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$10(file, source.value, directories)));
10192
+ return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$11(file, source.value, directories)));
10234
10193
  });
10235
10194
  // src/features/check-repository-layout/model/hidden-verify.ts
10236
- const RULE$29 = "hidden-verify";
10195
+ const RULE$32 = "hidden-verify";
10237
10196
  const CONFIG_FILE$3 = "vite.config.ts";
10238
- const FIRST$10 = 1;
10197
+ const FIRST$12 = 1;
10239
10198
  const READ_CONCURRENCY$15 = 8;
10240
10199
  const problemIn$1 = Effect.fn("problemIn")(function* problemIn(root, directory) {
10241
10200
  const config = yield* workspaceConfigOf(root, directory);
@@ -10245,9 +10204,9 @@ const problemIn$1 = Effect.fn("problemIn")(function* problemIn(root, directory)
10245
10204
  const verified = yield* hasVerifyTask(file);
10246
10205
  return Option.some({
10247
10206
  file,
10248
- line: FIRST$10,
10249
- column: FIRST$10,
10250
- rule: RULE$29,
10207
+ line: FIRST$12,
10208
+ column: FIRST$12,
10209
+ rule: RULE$32,
10251
10210
  message: `${directory} gets its verify task from code outside ${CONFIG_FILE$3}. The root verify reads ${CONFIG_FILE$3} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$3}.`
10252
10211
  }).pipe(Option.filter(() => verified));
10253
10212
  });
@@ -10258,7 +10217,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
10258
10217
  return Array.getSomes(found);
10259
10218
  });
10260
10219
  // src/features/check-repository-layout/model/shared-uncached-tasks.ts
10261
- const RULE$28 = "shared-uncached-task";
10220
+ const RULE$31 = "shared-uncached-task";
10262
10221
  const READ_CONCURRENCY$14 = 8;
10263
10222
  const SHARED = 2;
10264
10223
  const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
@@ -10301,7 +10260,7 @@ const problemsOf$3 = (definitions) => {
10301
10260
  return pipe(definitions, Array.map(({ file, position, name, command }) => ({
10302
10261
  file,
10303
10262
  ...position,
10304
- rule: RULE$28,
10263
+ rule: RULE$31,
10305
10264
  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.`
10306
10265
  })));
10307
10266
  };
@@ -10312,7 +10271,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
10312
10271
  return pipe(Array.flatten(found), Array.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array.flatMap(problemsOf$3));
10313
10272
  });
10314
10273
  // src/features/check-repository-layout/model/unlocked-tasks.ts
10315
- const RULE$27 = "unlocked-task";
10274
+ const RULE$30 = "unlocked-task";
10316
10275
  const READ_CONCURRENCY$13 = 8;
10317
10276
  const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
10318
10277
  const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
@@ -10324,7 +10283,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
10324
10283
  const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array.filter(tracksLockfiles), Array.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
10325
10284
  file,
10326
10285
  ...positionOf(source)(task.start),
10327
- rule: RULE$27,
10286
+ rule: RULE$30,
10328
10287
  message: `The task ${keyName(task.key)} runs ${command} with inputs written by hand. It then reruns after every lockfile change, and it does not rerun when a dependency of a dependency moves. Set cache to LOCKED from @r_masseater/msch/locked-inputs.`
10329
10288
  })), Option.toArray)));
10330
10289
  /** @internal */
@@ -10479,13 +10438,13 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
10479
10438
  /** @internal */
10480
10439
  const producedPaths = (source) => pipe(jobsOf(source), Array.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array.flatMap(outputPathsOf));
10481
10440
  // src/features/check-repository-layout/model/workflow-paths.ts
10482
- const RULE$26 = "workflow-path";
10441
+ const RULE$29 = "workflow-path";
10483
10442
  const WORKFLOW_DIRECTORY = ".github/workflows/";
10484
10443
  const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
10485
10444
  const READ_CONCURRENCY$12 = 8;
10486
10445
  const WILDCARD$2 = /[*?[]/u;
10487
10446
  const SEPARATOR$9 = "/";
10488
- const FIRST$9 = 0;
10447
+ const FIRST$11 = 0;
10489
10448
  const EXPECTED = {
10490
10449
  action: "a directory with action.yml",
10491
10450
  directory: "a directory",
@@ -10526,7 +10485,7 @@ const RESOLVERS = {
10526
10485
  };
10527
10486
  const staticPrefix = (path) => {
10528
10487
  const prefix = Array.headNonEmpty(String$1.split(path, WILDCARD$2));
10529
- if (String$1.endsWith(SEPARATOR$9)(prefix)) return String$1.slice(FIRST$9, -1)(prefix);
10488
+ if (String$1.endsWith(SEPARATOR$9)(prefix)) return String$1.slice(FIRST$11, -1)(prefix);
10530
10489
  return prefix;
10531
10490
  };
10532
10491
  const isIgnored$1 = Effect.fn("isIgnored")(function* isIgnored(root, path) {
@@ -10545,10 +10504,10 @@ const isMissing = Effect.fn("isMissing")(function* isMissing(root, produced, fou
10545
10504
  const problemOf$7 = (file, source) => (found) => ({
10546
10505
  file,
10547
10506
  ...positionOf(source)(found.offset),
10548
- rule: RULE$26,
10507
+ rule: RULE$29,
10549
10508
  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.`
10550
10509
  });
10551
- const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
10510
+ const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
10552
10511
  const files = yield* RepositoryFiles;
10553
10512
  const file = files.join(root, workflow);
10554
10513
  const source = yield* files.readFile(file);
@@ -10560,7 +10519,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, workflow
10560
10519
  /** @internal */
10561
10520
  const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
10562
10521
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
10563
- const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$9(root, workflow), { concurrency: READ_CONCURRENCY$12 });
10522
+ const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$10(root, workflow), { concurrency: READ_CONCURRENCY$12 });
10564
10523
  return Array.flatten(found);
10565
10524
  });
10566
10525
  // src/features/check-repository-layout/model/workflow-scale.ts
@@ -10571,7 +10530,7 @@ const ACTION = /^\.github\/actions\/(?<name>[^/]+)\/action\.ya?ml$/u;
10571
10530
  const FILTER_KEYS = ["paths", "paths-ignore"];
10572
10531
  const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
10573
10532
  const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
10574
- const START$16 = 0;
10533
+ const START$17 = 0;
10575
10534
  const READ_CONCURRENCY$11 = 8;
10576
10535
  const SEPARATOR$8 = "/";
10577
10536
  const WORD_SEPARATORS = /[-_]/gu;
@@ -10602,7 +10561,7 @@ const namesIn = (name, source) => {
10602
10561
  return [
10603
10562
  {
10604
10563
  text: name,
10605
- offset: START$16
10564
+ offset: START$17
10606
10565
  },
10607
10566
  ...Option.toArray(stringOf(childOf("name")(root))),
10608
10567
  ...keysOf$1(childOf("jobs")(root))
@@ -10672,12 +10631,12 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
10672
10631
  return Array.flatten(found);
10673
10632
  });
10674
10633
  // src/features/check-typescript-generation/model/typescript-generation.ts
10675
- const RULE$25 = "legacy-typescript";
10634
+ const RULE$28 = "legacy-typescript";
10676
10635
  const LOCKFILE = "pnpm-lock.yaml";
10677
10636
  const COMPILER = "typescript";
10678
10637
  const CURRENT_MAJOR = 7;
10679
10638
  const LEGACY_COMPILER_PACKAGE = /^@typescript\/typescript\d+$/u;
10680
- const FIRST$8 = 1;
10639
+ const FIRST$10 = 1;
10681
10640
  const legacyOf = (id) => {
10682
10641
  const { name, version } = parse$1(id);
10683
10642
  const isOldCompiler = name === COMPILER && pipe(Option.fromNullishOr(version), Option.flatMap((found) => Option.fromNullishOr(semver.coerce(found))), Option.exists((found) => found.major < CURRENT_MAJOR));
@@ -10688,8 +10647,8 @@ const legacyOf = (id) => {
10688
10647
  };
10689
10648
  const dependentsOf = (nodes) => (id) => pipe(nodes, Array.filter(({ dependencies }) => Array.contains(dependencies, id)), Array.map((node) => `\`${node.id}\``));
10690
10649
  const lineOf$2 = (source) => (id) => pipe(String$1.split(source, "\n"), Array.findFirstIndex((line) => String$1.replaceAll("'", "")(String$1.trim(line)) === `${id}:`), Option.match({
10691
- onNone: () => FIRST$8,
10692
- onSome: (index) => index + FIRST$8
10650
+ onNone: () => FIRST$10,
10651
+ onSome: (index) => index + FIRST$10
10693
10652
  }));
10694
10653
  const messageOf$2 = (legacy, dependents) => `\`${legacy.id}\` is installed, pulled in by ${Array.join(dependents, ", ")}. Only TypeScript ${String(CURRENT_MAJOR)} or newer is used: remove the dependency that needs the old compiler, move it to the TypeScript ${String(CURRENT_MAJOR)} API, or bundle or port it. Do not install an old compiler beside TypeScript ${String(CURRENT_MAJOR)}.`;
10695
10654
  /** @internal */
@@ -10702,8 +10661,8 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
10702
10661
  return pipe(Option.getOrElse(nodes, () => []), Array.flatMap(({ id }) => Option.toArray(legacyOf(id))), Array.map((legacy) => ({
10703
10662
  file,
10704
10663
  line: lineOf$2(source)(legacy.id),
10705
- column: FIRST$8,
10706
- rule: RULE$25,
10664
+ column: FIRST$10,
10665
+ rule: RULE$28,
10707
10666
  message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
10708
10667
  })));
10709
10668
  });
@@ -10829,7 +10788,7 @@ const installedNames = (manifest) => [
10829
10788
  ...keysOf(manifest.optionalDependencies),
10830
10789
  ...pipe(keysOf(manifest.peerDependencies), Array.filter((name) => !isOptionalPeer(manifest, name)))
10831
10790
  ];
10832
- const childrenOf$1 = Effect.fn("childrenOf")(function* childrenOf(directory) {
10791
+ const childrenOf = Effect.fn("childrenOf")(function* childrenOf(directory) {
10833
10792
  const files = yield* RepositoryFiles;
10834
10793
  const text = yield* files.readFile(files.join(directory, MANIFEST_FILE$3));
10835
10794
  return pipe(text, Option.flatMap(decodeManifest$6), Option.map(installedNames), Option.getOrElse(() => []), Array.map((child) => [directory, child]));
@@ -10858,7 +10817,7 @@ const closureOf = (provided, collect) => Array.match(collect.pending, {
10858
10817
  ...collect,
10859
10818
  pending: rest
10860
10819
  });
10861
- return childrenOf$1(resolved.value).pipe(Effect.flatMap((children) => closureOf(provided, {
10820
+ return childrenOf(resolved.value).pipe(Effect.flatMap((children) => closureOf(provided, {
10862
10821
  pending: [...rest, ...children],
10863
10822
  seen: HashSet.add(collect.seen, resolved.value)
10864
10823
  })));
@@ -10894,11 +10853,11 @@ const LISTED_LARGEST = 5;
10894
10853
  const SIZE_CONCURRENCY = 32;
10895
10854
  const MEGABYTE = 1e6;
10896
10855
  const MEGABYTE_DIGITS = 1;
10897
- const START$15 = 0;
10856
+ const START$16 = 0;
10898
10857
  const SINGLE_ENTRY = 1;
10899
10858
  const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
10900
10859
  const usageHint = (dependency, entryCount) => {
10901
- if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$15 && dependency.entries.length < entryCount)) return "";
10860
+ if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$16 && dependency.entries.length < entryCount)) return "";
10902
10861
  return ` (imported only from ${Array.join(dependency.entries, ", ")})`;
10903
10862
  };
10904
10863
  const listed = ({ largest, entryCount }) => pipe(largest, Array.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array.join(", "));
@@ -10907,7 +10866,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
10907
10866
  const { workspace, total } = overrun;
10908
10867
  const config = yield* files.readFile(workspace.configFile);
10909
10868
  const source = Option.getOrElse(config, () => "");
10910
- const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$15);
10869
+ const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$16);
10911
10870
  return {
10912
10871
  file: workspace.configFile,
10913
10872
  ...positionOf(source)(index),
@@ -10924,7 +10883,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
10924
10883
  const everything = pipe(closures, Array.flatMap(([, packages]) => Array.fromIterable(packages)), HashSet.fromIterable);
10925
10884
  const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
10926
10885
  const sizes = HashMap.fromIterable(measured);
10927
- const sizeOf = (packages) => Number$1.sumAll(pipe(Array.fromIterable(packages), Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$15))));
10886
+ const sizeOf = (packages) => Number$1.sumAll(pipe(Array.fromIterable(packages), Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$16))));
10928
10887
  return {
10929
10888
  closures,
10930
10889
  sizeOf,
@@ -10957,11 +10916,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
10957
10916
  })];
10958
10917
  });
10959
10918
  const stackProblems = (file, source, dependencies) => {
10960
- const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(source), () => START$15);
10919
+ const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(source), () => START$16);
10961
10920
  const rest = String$1.slice(section)(source);
10962
10921
  return pipe(Record.toEntries(dependencies), Array.filter(([, specifier]) => specifier === STACK_CATALOG), Array.map(([name]) => ({
10963
10922
  file,
10964
- ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$15)),
10923
+ ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$16)),
10965
10924
  rule: STACK_DEPENDENCY,
10966
10925
  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.`
10967
10926
  })));
@@ -11128,7 +11087,7 @@ const scanned = (owners, problems) => ({
11128
11087
  owners,
11129
11088
  problems
11130
11089
  });
11131
- const ownerOf$1 = (project) => (annotated) => {
11090
+ const ownerOf$2 = (project) => (annotated) => {
11132
11091
  const { node, conceptId } = annotated;
11133
11092
  if (!isModuleConst(node)) return scanned([], [annotationProblem(`@${OWNER_TAG} registers an owner only on a module-scope const.`)(node)]);
11134
11093
  if (conceptId === "") return scanned([], [annotationProblem(`@${OWNER_TAG} needs a concept id.`)(node)]);
@@ -11162,7 +11121,7 @@ const conflictProblems = (owners) => pipe(owners, Array.flatMap((owner, index) =
11162
11121
  return [...pipe(Array.take(sameConcept, FIRST_OWNER_COUNT), Array.map(() => ownerProblem(`The concept ${owner.conceptId} already has an owner.`)(owner))), ...pipe(Array.take(sameSet, FIRST_OWNER_COUNT), Array.map((other) => ownerProblem(`The values ${formatValues(owner.values)} are already owned by ${other.conceptId}.`)(owner)))];
11163
11122
  }));
11164
11123
  const ownersIn = (project) => {
11165
- const results = pipe(project.sourceFiles, Array.flatMap((sourceFile) => pipe(annotatedIn(sourceFile), Array.map((annotated) => ownerOf$1(project)(annotated)))));
11124
+ const results = pipe(project.sourceFiles, Array.flatMap((sourceFile) => pipe(annotatedIn(sourceFile), Array.map((annotated) => ownerOf$2(project)(annotated)))));
11166
11125
  return scanned(pipe(results, Array.flatMap((result) => result.owners)), pipe(results, Array.flatMap((result) => result.problems)));
11167
11126
  };
11168
11127
  const combineOwnerScans = (scans) => {
@@ -11328,7 +11287,7 @@ const derivationScopeOf = (node) => {
11328
11287
  };
11329
11288
  const sourcesOf = (checker) => (node) => pipe(referencedSymbols(checker)(derivationScopeOf(node)), Array.filter((symbol) => Option.isSome(namedValuesOf(checker)(symbol))));
11330
11289
  const sitesUnder = (checker) => (node) => {
11331
- const nested = pipe(childrenOf$3(node), Array.flatMap((child) => sitesUnder(checker)(child)));
11290
+ const nested = pipe(childrenOf$2(node), Array.flatMap((child) => sitesUnder(checker)(child)));
11332
11291
  if (Array.isReadonlyArrayNonEmpty(nested)) return nested;
11333
11292
  return siteValuesOf(checker)(node).pipe(Option.map((values) => ({
11334
11293
  node,
@@ -11617,7 +11576,7 @@ const duplicateProblems = (relative) => (sites) => {
11617
11576
  }))));
11618
11577
  };
11619
11578
  // src/features/check-value-owners/model/name-lists.ts
11620
- const RULE$24 = "hand-written-names";
11579
+ const RULE$27 = "hand-written-names";
11621
11580
  const TEST_FILE = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
11622
11581
  const nameListOf = (site) => {
11623
11582
  if (TEST_FILE.test(site.file) || site.values.length < 2) return Option.none();
@@ -11632,7 +11591,7 @@ const problemOf$6 = ({ list, reason }) => ({
11632
11591
  file: list.site.file,
11633
11592
  line: list.site.line,
11634
11593
  column: list.site.column,
11635
- rule: RULE$24,
11594
+ rule: RULE$27,
11636
11595
  message: `The names ${formatValues(list.names)} are listed by hand, but ${reason}`
11637
11596
  });
11638
11597
  // src/features/check-value-owners/model/declared-names.ts
@@ -11859,7 +11818,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
11859
11818
  return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
11860
11819
  }, Effect.scoped);
11861
11820
  // src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
11862
- const RULE$23 = "namespace-destructuring";
11821
+ const RULE$26 = "namespace-destructuring";
11863
11822
  const LOCAL = /^[.#/]/u;
11864
11823
  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.`;
11865
11824
  const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
@@ -11875,7 +11834,7 @@ const destructuredName = (declaration) => {
11875
11834
  return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
11876
11835
  };
11877
11836
  const problemOf$5 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$9({
11878
- rule: RULE$23,
11837
+ rule: RULE$26,
11879
11838
  message: messageOf$1(name)
11880
11839
  })), Option.map((report) => report(declaration)));
11881
11840
  const namespaceDestructuringIn = () => (sourceFile) => {
@@ -11883,7 +11842,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
11883
11842
  return pipe(descendantsOf(sourceFile), Array.filter(isVariableDeclaration), Array.map(problemOf$5(names)), Array.getSomes);
11884
11843
  };
11885
11844
  // src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
11886
- const RULE$22 = "pass-through-wrapper";
11845
+ const RULE$25 = "pass-through-wrapper";
11887
11846
  const SINGLE_STATEMENT = 1;
11888
11847
  const SINGLE_DECLARATION = 1;
11889
11848
  const THIS_PARAMETER = "this";
@@ -11980,7 +11939,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
11980
11939
  const problemOf$4 = (checker) => (candidate) => {
11981
11940
  if (changesTheCall(candidate.wrapper)) return Option.none();
11982
11941
  return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$9({
11983
- rule: RULE$22,
11942
+ rule: RULE$25,
11984
11943
  message: messageOf(forward.callee.getText())
11985
11944
  })(candidate.name)));
11986
11945
  };
@@ -11989,20 +11948,20 @@ const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(so
11989
11948
  /** @internal */
11990
11949
  const checkSources = (root) => checkRepository(root, [passThroughWrappersIn, namespaceDestructuringIn]);
11991
11950
  // src/features/check-agent-settings/model/missing-hooks.ts
11992
- const RULE$21 = "missing-hook";
11951
+ const RULE$24 = "missing-hook";
11993
11952
  const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
11994
11953
  const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
11995
11954
  const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
11996
11955
  const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
11997
11956
  const PLUGIN_ROOT = "..";
11998
11957
  const READ_CONCURRENCY$10 = 16;
11999
- const START$14 = 0;
11958
+ const START$15 = 0;
12000
11959
  const referenceOf$1 = (found) => pipe(groupOf$2("path")(found), Option.filter(() => Option.isNone(groupOf$2("optional")(found))), Option.map((path) => ({
12001
11960
  path,
12002
- index: found.index ?? START$14
11961
+ index: found.index ?? START$15
12003
11962
  })), Option.toArray);
12004
11963
  const referencesIn$1 = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap(referenceOf$1));
12005
- const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
11964
+ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
12006
11965
  const files = yield* RepositoryFiles;
12007
11966
  const text = yield* files.readFile(file);
12008
11967
  if (Option.isNone(text)) return [];
@@ -12014,7 +11973,7 @@ const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
12014
11973
  return pipe(missing, Array.map(({ path, index }) => ({
12015
11974
  file,
12016
11975
  ...positionOf(source)(index),
12017
- rule: RULE$21,
11976
+ rule: RULE$24,
12018
11977
  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.`
12019
11978
  })));
12020
11979
  });
@@ -12038,14 +11997,14 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
12038
11997
  }];
12039
11998
  return [];
12040
11999
  }));
12041
- const found = yield* Effect.forEach(hookFiles, problemsIn$8, { concurrency: READ_CONCURRENCY$10 });
12000
+ const found = yield* Effect.forEach(hookFiles, problemsIn$9, { concurrency: READ_CONCURRENCY$10 });
12042
12001
  return Array.flatten(found);
12043
12002
  });
12044
12003
  // src/shared/lib/section-check.ts
12045
12004
  const taggedError$3 = Schema.TaggedError;
12046
12005
  var SectionConfigUnreadable = class extends taggedError$3()("SectionConfigUnreadable", { file: Schema.String }) {};
12047
12006
  const CONFIG_FILE$2 = "vite.config.ts";
12048
- const FIRST$7 = 1;
12007
+ const FIRST$9 = 1;
12049
12008
  const sectionAt = (file, pick) => Effect.gen(function* readSection() {
12050
12009
  if (!(yield* (yield* RepositoryFiles).exists(file))) return Option.none();
12051
12010
  const config = yield* Effect.tryPromise({
@@ -12056,8 +12015,8 @@ const sectionAt = (file, pick) => Effect.gen(function* readSection() {
12056
12015
  });
12057
12016
  const failureAt = (file, rule, message) => [{
12058
12017
  file,
12059
- line: FIRST$7,
12060
- column: FIRST$7,
12018
+ line: FIRST$9,
12019
+ column: FIRST$9,
12061
12020
  rule,
12062
12021
  message
12063
12022
  }];
@@ -12079,7 +12038,7 @@ const checkSection = (check) => (root) => Effect.gen(function* runSection() {
12079
12038
  onSuccess: (found) => pipe(found, Array.filter(({ severity }) => severity === "error"), Array.map((diagnostic) => ({
12080
12039
  file: files.join(root, diagnostic.path),
12081
12040
  line: diagnostic.line,
12082
- column: diagnostic.column ?? FIRST$7,
12041
+ column: diagnostic.column ?? FIRST$9,
12083
12042
  rule: check.rule,
12084
12043
  message: `${diagnostic.rule} ${diagnostic.message}${check.detail(diagnostic)}`
12085
12044
  })))
@@ -12100,9 +12059,9 @@ const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|
12100
12059
  const EXTENSION = /\.[^./]+$/u;
12101
12060
  const SETTINGS_FILE = ".claude/settings.json";
12102
12061
  const READ_CONCURRENCY$9 = 64;
12103
- const FIRST$6 = 1;
12104
- const RULE$20 = "shell-script";
12105
- const MESSAGE$9 = "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.";
12062
+ const FIRST$8 = 1;
12063
+ const RULE$23 = "shell-script";
12064
+ const MESSAGE$10 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only the SessionStart hook in .claude/settings.json, which installs the toolchain before TypeScript can run, stays a shell script.";
12106
12065
  const HookSchema = Schema.Struct({
12107
12066
  command: Schema.optional(Schema.String),
12108
12067
  args: Schema.optional(Schema.Array(Schema.String))
@@ -12122,10 +12081,10 @@ const baseName = (name) => pipe(String$1.split("/")(name), Array.last, Option.ge
12122
12081
  const hasExtension = (name) => EXTENSION.test(baseName(name));
12123
12082
  const problemFor$1 = (file) => ({
12124
12083
  file,
12125
- line: FIRST$6,
12126
- column: FIRST$6,
12127
- rule: RULE$20,
12128
- message: MESSAGE$9
12084
+ line: FIRST$8,
12085
+ column: FIRST$8,
12086
+ rule: RULE$23,
12087
+ message: MESSAGE$10
12129
12088
  });
12130
12089
  /** @internal */
12131
12090
  const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScripts(root) {
@@ -12161,8 +12120,8 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
12161
12120
  });
12162
12121
  // src/shared/lib/workflow-run.ts
12163
12122
  const RUN_KEY = "run";
12164
- const START$13 = 0;
12165
- const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$13));
12123
+ const START$14 = 0;
12124
+ const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$14));
12166
12125
  const runScriptsOf = (source) => {
12167
12126
  const found = [];
12168
12127
  visit(parseDocument(source), { Pair: (_key, pair) => {
@@ -12177,28 +12136,28 @@ const runScriptsOf = (source) => {
12177
12136
  const COMMAND_CHAIN = /&&|\|\||;|\|/u;
12178
12137
  const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
12179
12138
  const COMMENT = "#";
12180
- const RULE$19 = "workflow-script";
12139
+ const RULE$22 = "workflow-script";
12181
12140
  const ONE_COMMAND = 1;
12182
- const MESSAGE$8 = "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.";
12141
+ const MESSAGE$9 = "runs more than one command. Keep a step to one command, `vp run <task>` or `vp exec <bin>`, and put the logic in a Vite+ task in TypeScript.";
12183
12142
  const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
12184
12143
  const chainsCommands = (line) => COMMAND_CHAIN.test(String$1.replaceAll(QUOTED$1, "")(line));
12185
12144
  const runsMoreThanOneCommand = ({ text }) => {
12186
12145
  const lines = pipe(String$1.split("\n")(text), Array.map(String$1.trim), Array.filter(isCommand));
12187
12146
  return lines.length > ONE_COMMAND || pipe(lines, Array.some(chainsCommands));
12188
12147
  };
12189
- const problemsIn$7 = (file) => (source) => {
12148
+ const problemsIn$8 = (file) => (source) => {
12190
12149
  const at = positionOf(source);
12191
12150
  return pipe(runScriptsOf(source), Array.filter(runsMoreThanOneCommand), Array.map(({ start }) => ({
12192
12151
  file,
12193
12152
  ...at(start),
12194
- rule: RULE$19,
12195
- message: MESSAGE$8
12153
+ rule: RULE$22,
12154
+ message: MESSAGE$9
12196
12155
  })));
12197
12156
  };
12198
12157
  /** @internal */
12199
12158
  const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
12200
12159
  const workflows = yield* readWorkflows(root);
12201
- return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$7(file)(source)));
12160
+ return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$8(file)(source)));
12202
12161
  });
12203
12162
  // src/features/check-scripts/model/script-checks.ts
12204
12163
  /** @internal */
@@ -12304,25 +12263,25 @@ const docSources = (file) => (source) => {
12304
12263
  const ROOT_DIRECTORY$1 = ".";
12305
12264
  const COMMAND_KEY = "command";
12306
12265
  const ARGUMENTS_KEY = "args";
12307
- const EXCLUDED$3 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
12308
- const MANIFESTS = [`:(glob)**/${MANIFEST_FILE$3}`, ...EXCLUDED$3];
12266
+ const EXCLUDED$4 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
12267
+ const MANIFESTS = [`:(glob)**/${MANIFEST_FILE$3}`, ...EXCLUDED$4];
12309
12268
  const STEP_FILES = [
12310
12269
  ":(glob).github/workflows/*.yml",
12311
12270
  ":(glob).github/workflows/*.yaml",
12312
12271
  ":(glob)**/action.yml",
12313
12272
  ":(glob)**/action.yaml",
12314
- ...EXCLUDED$3
12273
+ ...EXCLUDED$4
12315
12274
  ];
12316
12275
  const HOOK_FILES = [":(glob).vite-hooks/*"];
12317
12276
  const AGENT_FILES = [".claude/settings.json", ".mcp.json"];
12318
12277
  const AGENT_DOCS = [
12319
12278
  ":(glob)**/AGENTS.md",
12320
12279
  ":(glob)**/CLAUDE.md",
12321
- ...EXCLUDED$3
12280
+ ...EXCLUDED$4
12322
12281
  ];
12323
12282
  const READ_CONCURRENCY$7 = 16;
12324
- const START$12 = 0;
12325
- const FIRST$5 = 1;
12283
+ const START$13 = 0;
12284
+ const FIRST$7 = 1;
12326
12285
  const LINE = "\n";
12327
12286
  const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
12328
12287
  const decodeCommandText = Schema.decodeUnknownOption(CommandText);
@@ -12331,7 +12290,7 @@ const decodeScripts = Schema.decodeUnknownOption(Schema.fromJsonString(Scripts))
12331
12290
  const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
12332
12291
  const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
12333
12292
  const NO_SOURCES = [];
12334
- const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$12));
12293
+ const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$13));
12335
12294
  const scriptSources = (file) => (source) => pipe(decodeScripts(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array.map(([name, text]) => {
12336
12295
  const offset = offsetOf$2(source, `"${name}"`);
12337
12296
  return {
@@ -12353,8 +12312,8 @@ const hookSources = (file, name) => (source) => pipe(String$1.split(source, LINE
12353
12312
  kind: "hook",
12354
12313
  file,
12355
12314
  position: {
12356
- line: index + FIRST$5,
12357
- column: FIRST$5
12315
+ line: index + FIRST$7,
12316
+ column: FIRST$7
12358
12317
  },
12359
12318
  name,
12360
12319
  text
@@ -12364,7 +12323,7 @@ const commandIn = (node) => {
12364
12323
  const record = node;
12365
12324
  return pipe(Option.fromUndefinedOr(record[COMMAND_KEY]), Option.filter(Predicate.isString), Option.map((command) => pipe(decodeArguments(record[ARGUMENTS_KEY]), Option.getOrElse(() => []), Array.prepend(command), Array.join(" "))));
12366
12325
  };
12367
- const commandsIn = (node) => [...Option.toArray(commandIn(node)), ...pipe(childrenOf$2(node), Array.flatMap(commandsIn))];
12326
+ const commandsIn = (node) => [...Option.toArray(commandIn(node)), ...pipe(childrenOf$1(node), Array.flatMap(commandsIn))];
12368
12327
  const agentSources = (file) => (source) => pipe(decodeJson$1(source), Option.map(commandsIn), Option.getOrElse(() => []), Array.map((text) => {
12369
12328
  const program = Array.headNonEmpty(String$1.split(text, " "));
12370
12329
  const offset = offsetOf$2(source, `"${program}"`);
@@ -12427,7 +12386,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
12427
12386
  return Array.flatten(found);
12428
12387
  });
12429
12388
  // src/features/check-vite-plus/model/package-scripts.ts
12430
- const RULE$18 = "package-script";
12389
+ const RULE$21 = "package-script";
12431
12390
  const LIFECYCLE = [
12432
12391
  "preinstall",
12433
12392
  "install",
@@ -12450,26 +12409,26 @@ const LIFECYCLE = [
12450
12409
  const problemOf$3 = ({ file, position, name }) => ({
12451
12410
  file,
12452
12411
  ...position,
12453
- rule: RULE$18,
12412
+ rule: RULE$21,
12454
12413
  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.`
12455
12414
  });
12456
12415
  const packageScriptProblems = (sources) => pipe(sources, Array.filter(({ kind, name }) => kind === "script" && !Array.contains(LIFECYCLE, name)), Array.map(problemOf$3));
12457
12416
  // src/features/check-vite-plus/model/vite-plus-block.ts
12458
- const RULE$17 = "vite-plus-block";
12417
+ const RULE$20 = "vite-plus-block";
12459
12418
  const MARKER = Array.join([
12460
12419
  "<!--",
12461
12420
  "VITE PLUS START",
12462
12421
  "-->"
12463
12422
  ], "");
12464
- const MESSAGE$7 = "holds the Vite+ block that `vp create --agent` and `vp migrate --agent` write, and every `vp config` rewrites it. Delete the block with its markers. The vite-plus skill reads the same guidance from node_modules/vite-plus/AGENTS.md.";
12423
+ const MESSAGE$8 = "holds the Vite+ block that `vp create --agent` and `vp migrate --agent` write, and every `vp config` rewrites it. Delete the block with its markers. The vite-plus skill reads the same guidance from node_modules/vite-plus/AGENTS.md.";
12465
12424
  const problemIn = (file) => (source) => {
12466
12425
  const index = String$1.indexOf(MARKER)(source);
12467
12426
  if (Option.isNone(index)) return Option.none();
12468
12427
  return Option.some({
12469
12428
  file,
12470
12429
  ...positionOf(source)(index.value),
12471
- rule: RULE$17,
12472
- message: MESSAGE$7
12430
+ rule: RULE$20,
12431
+ message: MESSAGE$8
12473
12432
  });
12474
12433
  };
12475
12434
  /** @internal */
@@ -12524,11 +12483,11 @@ const checkFullHistoryCheckout = workflowCheck({
12524
12483
  })
12525
12484
  });
12526
12485
  // src/features/check-workflows/model/publish-trigger.ts
12527
- const RULE$15 = "publish-trigger";
12486
+ const RULE$18 = "publish-trigger";
12528
12487
  const PUBLISH = /\bmsch-publish\b/u;
12529
12488
  const MANUAL = "workflow_dispatch";
12530
12489
  const TRIGGER_KEY = "on";
12531
- const MESSAGE$5 = "publishes with `msch-publish` from a trigger other than `workflow_dispatch`. Publishing is manual: bump the version in a PR, then dispatch the workflow for the workspace.";
12490
+ const MESSAGE$6 = "publishes with `msch-publish` from a trigger other than `workflow_dispatch`. Publishing is manual: bump the version in a PR, then dispatch the workflow for the workspace.";
12532
12491
  const triggersOf = (node) => {
12533
12492
  if (isScalar(node)) return [String(node.value)];
12534
12493
  if (isSeq(node)) return pipe(node.items, Array.filter(isScalar), Array.map((item) => String(item.value)));
@@ -12544,19 +12503,19 @@ const publishTriggerOffsetsOf = (source) => {
12544
12503
  };
12545
12504
  /** @internal */
12546
12505
  const checkPublishTrigger = workflowCheck({
12547
- rule: RULE$15,
12548
- message: MESSAGE$5,
12506
+ rule: RULE$18,
12507
+ message: MESSAGE$6,
12549
12508
  offsetsOf: publishTriggerOffsetsOf
12550
12509
  });
12551
12510
  // src/features/check-workflows/model/release-please.ts
12552
- const RULE$14 = "release-please";
12511
+ const RULE$17 = "release-please";
12553
12512
  const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
12554
12513
  const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
12555
- const FIRST$4 = 1;
12556
- const MESSAGE$4 = "releases with release-please. Releases are manual: bump the version in a PR, then run the publish workflow, which runs `msch-publish` for the workspace.";
12514
+ const FIRST$6 = 1;
12515
+ const MESSAGE$5 = "releases with release-please. Releases are manual: bump the version in a PR, then run the publish workflow, which runs `msch-publish` for the workspace.";
12557
12516
  const checkReleasePleaseSteps = workflowCheck({
12558
- rule: RULE$14,
12559
- message: MESSAGE$4,
12517
+ rule: RULE$17,
12518
+ message: MESSAGE$5,
12560
12519
  offsetsOf: scalarKeyOffsets({
12561
12520
  name: "uses",
12562
12521
  matches: (value) => RELEASE_PLEASE.test(value)
@@ -12567,10 +12526,10 @@ const checkReleasePleaseFiles = Effect.fn("checkReleasePleaseFiles")(function* c
12567
12526
  const names = yield* files.listedFiles(root);
12568
12527
  return pipe(names, Array.filter((name) => RELEASE_PLEASE_FILE.test(name)), Array.map((name) => ({
12569
12528
  file: files.join(root, name),
12570
- line: FIRST$4,
12571
- column: FIRST$4,
12572
- rule: RULE$14,
12573
- message: MESSAGE$4
12529
+ line: FIRST$6,
12530
+ column: FIRST$6,
12531
+ rule: RULE$17,
12532
+ message: MESSAGE$5
12574
12533
  })));
12575
12534
  });
12576
12535
  /** @internal */
@@ -12581,26 +12540,26 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
12581
12540
  // src/features/check-workflows/model/workflow-queue.ts
12582
12541
  const CONCURRENCY_KEY = "concurrency";
12583
12542
  const QUEUE_KEY = "queue";
12584
- const RULE$13 = "workflow-queue";
12585
- const MESSAGE$3 = "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.";
12543
+ const RULE$16 = "workflow-queue";
12544
+ const MESSAGE$4 = "queues runs with `queue`. A queued group runs every old push one by one, so a long run holds back the newest commit for hours. Drop `queue`: a job that later pushes redo gets `cancel-in-progress: true`, and a deploy or release job keeps the default, which lets the running one finish and replaces the waiting one with the newest run.";
12586
12545
  const queueOffsetsOf = (source) => pipe(pairsNamed(CONCURRENCY_KEY)(source), Array.flatMap((pair) => Option.toArray(keyOffsetIn(QUEUE_KEY)(pair.value))));
12587
12546
  /** @internal */
12588
12547
  const checkWorkflowQueues = workflowCheck({
12589
- rule: RULE$13,
12590
- message: MESSAGE$3,
12548
+ rule: RULE$16,
12549
+ message: MESSAGE$4,
12591
12550
  offsetsOf: queueOffsetsOf
12592
12551
  });
12593
12552
  // src/features/check-workflows/model/workflow-commits.ts
12594
- const RULE$12 = "workflow-commit";
12553
+ const RULE$15 = "workflow-commit";
12595
12554
  const GIT_WRITE = /\bgit\s+(?:-{1,2}\S+\s+(?:\S+\s+)?)*(?:commit|push)\b/u;
12596
12555
  const COMMIT_ACTION = /^[^@/]+\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;
12597
- const MESSAGE$2 = "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.";
12556
+ const MESSAGE$3 = "commits or pushes from a workflow. A bot commit leaves generated files out of review and races the next push. Regenerate the files in a commit hook (for example `.vite-hooks/pre-commit`) so they land in the author's commit, and let CI only check that they are current.";
12598
12557
  const offsetsWhere = (name, pattern) => (source) => pipe(pairsNamed(name)(source), Array.filter(({ value }) => isScalar(value) && typeof value.value === "string" && pattern.test(value.value)), Array.flatMap(({ key }) => pipe(Option.liftPredicate(key, isScalar), Option.flatMap(({ range }) => Option.fromNullishOr(range)), Option.map(([start]) => start), Option.toArray)));
12599
12558
  const commitOffsetsOf = (source) => [...offsetsWhere("run", GIT_WRITE)(source), ...offsetsWhere("uses", COMMIT_ACTION)(source)];
12600
12559
  /** @internal */
12601
12560
  const checkWorkflowCommits = workflowCheck({
12602
- rule: RULE$12,
12603
- message: MESSAGE$2,
12561
+ rule: RULE$15,
12562
+ message: MESSAGE$3,
12604
12563
  offsetsOf: commitOffsetsOf
12605
12564
  });
12606
12565
  // src/features/check-workflows/model/workflow-lint.ts
@@ -12647,29 +12606,12 @@ const trimmed = ({ index, text }) => ({
12647
12606
  });
12648
12607
  // src/features/ban-comments/model/config-comments.ts
12649
12608
  const NEXT$1 = 1;
12650
- const isRecord = (value) => typeof value === "object" && value !== null;
12651
- const childrenOf = (value) => {
12652
- if (Array.isArray(value)) return value;
12653
- if (isRecord(value)) return Record.values(value);
12654
- return [];
12655
- };
12656
- const collect = (isItem) => (value) => {
12657
- if (isItem(value)) return [value];
12658
- return pipe(childrenOf(value), Array.flatMap(collect(isItem)));
12659
- };
12660
- const isYamlComment = (value) => isRecord(value) && value["type"] === "comment" && typeof value["offset"] === "number" && typeof value["source"] === "string";
12661
12609
  const yamlComments = (source) => Effect.try({
12662
- try: () => pipe(Array.fromIterable(new Parser().parse(source)), Array.flatMap(collect(isYamlComment)), Array.map((token) => trimmed({
12663
- index: token.offset,
12664
- text: token.source
12665
- }))),
12610
+ try: () => pipe(yamlSourceComments(source), Array.map(trimmed)),
12666
12611
  catch: unreadable("yaml")
12667
12612
  });
12668
12613
  const tomlComments = (source) => Effect.try({
12669
- try: () => pipe(parseTOML(source).comments, Array.map(({ range: [start, end] }) => trimmed({
12670
- index: start,
12671
- text: String$1.slice(start, end)(source)
12672
- }))),
12614
+ try: () => pipe(tomlSourceComments(source), Array.map(trimmed)),
12673
12615
  catch: unreadable("toml")
12674
12616
  });
12675
12617
  const isSqlComment = (value) => isRecord(value) && (value["type"] === "line_comment" || value["type"] === "block_comment") && typeof value["text"] === "string" && Array.isArray(value["range"]);
@@ -12681,7 +12623,7 @@ const sqlComments = (source) => Effect.try({
12681
12623
  includeRange: true,
12682
12624
  paramTypes: []
12683
12625
  });
12684
- return pipe(collect(isSqlComment)(program), Array.map(({ range: [start], text }) => trimmed({
12626
+ return pipe(collectNodes(isSqlComment)(program), Array.map(({ range: [start], text }) => trimmed({
12685
12627
  index: start,
12686
12628
  text
12687
12629
  })));
@@ -12721,7 +12663,7 @@ const COMMENT_NODES = [
12721
12663
  "block_comment",
12722
12664
  "multiline_comment"
12723
12665
  ];
12724
- const START$11 = 0;
12666
+ const START$12 = 0;
12725
12667
  const NEXT = 1;
12726
12668
  const NONE$1 = [];
12727
12669
  const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
@@ -12774,7 +12716,7 @@ const markupComment = (source) => (node) => {
12774
12716
  }];
12775
12717
  };
12776
12718
  const textComments = (grammars, grammar) => (text) => {
12777
- const shift = shifted(text.startIndex ?? START$11);
12719
+ const shift = shifted(text.startIndex ?? START$12);
12778
12720
  return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array.map(shift)));
12779
12721
  };
12780
12722
  const embeddedComments = (grammars) => (node) => {
@@ -12810,11 +12752,11 @@ const commentsWith = (grammars) => (reader, source) => {
12810
12752
  }[reader](source);
12811
12753
  };
12812
12754
  // src/features/ban-comments/model/comments.ts
12813
- const RULE$11 = "comment";
12755
+ const RULE$14 = "comment";
12814
12756
  const CONFIG_FILE$1 = "vite.config.ts";
12815
12757
  const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
12816
12758
  const READ_CONCURRENCY$6 = 64;
12817
- const START$10 = 0;
12759
+ const START$11 = 0;
12818
12760
  const FIRST_LINE$4 = 1;
12819
12761
  const FIRST_COLUMN$3 = 1;
12820
12762
  const READERS$1 = [
@@ -12848,7 +12790,7 @@ const SHEBANG = "#!";
12848
12790
  const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
12849
12791
  const VERSION = /^\s?v?\d[\w.+-]*$/u;
12850
12792
  const DELIMITERS = /^(?:\/\/|\/\*|<!--|<#|#|--)|(?:\*\/|-->|#>)$/gu;
12851
- const MESSAGE$1 = "Comments are not written in this repository. Say it with names and types in the code, put the reason in the commit message, and delete the comment.";
12793
+ const MESSAGE$2 = "Comments are not written in this repository. Say it with names and types in the code, put the reason in the commit message, and delete the comment.";
12852
12794
  const Patterns = Schema.Array(Schema.String);
12853
12795
  const CommentSettings = Schema.Struct({ allow: Patterns });
12854
12796
  const MschSettings = Schema.Struct({ comments: Schema.optional(CommentSettings) });
@@ -12871,23 +12813,23 @@ const shebangReader = (source) => {
12871
12813
  const readerOf = (name, source) => pipe(READERS$1, Array.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
12872
12814
  const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
12873
12815
  const lineBefore = (source, index) => {
12874
- const lines = pipe(source, String$1.slice(START$10, index), String$1.split("\n"));
12816
+ const lines = pipe(source, String$1.slice(START$11, index), String$1.split("\n"));
12875
12817
  return Option.getOrElse(Array.last(lines), () => "");
12876
12818
  };
12877
12819
  const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
12878
- const isShebang = ({ index, text }) => index === START$10 && String$1.startsWith(SHEBANG)(text);
12820
+ const isShebang = ({ index, text }) => index === START$11 && String$1.startsWith(SHEBANG)(text);
12879
12821
  const isAllowed = (source, directives) => (comment) => isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment);
12880
12822
  const problemOf$2 = (file, source) => ({ index }) => ({
12881
12823
  file,
12882
12824
  ...positionOf(source)(index),
12883
- rule: RULE$11,
12884
- message: MESSAGE$1
12825
+ rule: RULE$14,
12826
+ message: MESSAGE$2
12885
12827
  });
12886
12828
  const unreadableProblem = (file, message) => ({
12887
12829
  file,
12888
12830
  line: FIRST_LINE$4,
12889
12831
  column: FIRST_COLUMN$3,
12890
- rule: RULE$11,
12832
+ rule: RULE$14,
12891
12833
  message: `msch could not read the comments in this file: ${message}`
12892
12834
  });
12893
12835
  const settingsOf = ({ msch, lint }) => ({
@@ -13126,7 +13068,7 @@ const CONFIG_FILE = "vite.config.ts";
13126
13068
  const RENOVATE_FILE$1 = "renovate.json";
13127
13069
  const SOURCE = "masseater/skills";
13128
13070
  const PRESET$1 = "github>masseater/masseater.dev//libs/vite-plus-adopt/renovate";
13129
- const START$9 = 0;
13071
+ const START$10 = 0;
13130
13072
  const LOCAL_PREFIX = "./";
13131
13073
  const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
13132
13074
  const Source = Schema.Struct({
@@ -13139,7 +13081,7 @@ const taggedError = Schema.TaggedError;
13139
13081
  var SkillsConfigUnreadable = class extends taggedError()("SkillsConfigUnreadable", { file: Schema.String }) {};
13140
13082
  const problemAt$3 = (rule, file, text) => (anchor, message) => ({
13141
13083
  file,
13142
- ...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$9))),
13084
+ ...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$10))),
13143
13085
  rule,
13144
13086
  message
13145
13087
  });
@@ -13186,20 +13128,20 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
13186
13128
  ];
13187
13129
  });
13188
13130
  // src/features/check-skills/model/published-skills.ts
13189
- const RULE$10 = "published-skills";
13131
+ const RULE$13 = "published-skills";
13190
13132
  const KEYWORD = "tanstack-intent";
13191
13133
  const SKILLS = "skills";
13192
13134
  const MANIFEST_FILE = "package.json";
13193
13135
  const SKILL_FILE$1 = "SKILL.md";
13194
- const FIRST$3 = 1;
13136
+ const FIRST$5 = 1;
13195
13137
  const SUCCEEDED = 0;
13196
13138
  const SYNC = "Run vp exec intent maintainer sync in the repository root.";
13197
13139
  const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
13198
13140
  const problemAt$2 = (file, message) => ({
13199
13141
  file,
13200
- line: FIRST$3,
13201
- column: FIRST$3,
13202
- rule: RULE$10,
13142
+ line: FIRST$5,
13143
+ column: FIRST$5,
13144
+ rule: RULE$13,
13203
13145
  message
13204
13146
  });
13205
13147
  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))));
@@ -13222,7 +13164,7 @@ const validationOf = Effect.fn("validationOf")(function* validationOf(directory)
13222
13164
  const [output, status] = yield* Effect.all([handle.all.pipe(Stream.decodeText(), Stream.mkString), handle.exitCode], { concurrency: "unbounded" });
13223
13165
  return Option.liftPredicate(String$1.trim(output), () => Number(status) !== SUCCEEDED);
13224
13166
  }, Effect.scoped);
13225
- const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
13167
+ const problemsIn$7 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
13226
13168
  const files = yield* RepositoryFiles;
13227
13169
  const directory = files.join(root, project.directory);
13228
13170
  const manifest = files.join(directory, MANIFEST_FILE);
@@ -13234,11 +13176,11 @@ const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, project)
13234
13176
  /** @internal */
13235
13177
  const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPublishedSkills(root) {
13236
13178
  const projects = yield* publishedProjects(root);
13237
- const problems = yield* Effect.forEach(projects, (project) => problemsIn$6(root, project), { concurrency: 1 });
13179
+ const problems = yield* Effect.forEach(projects, (project) => problemsIn$7(root, project), { concurrency: 1 });
13238
13180
  return Array.flatten(problems);
13239
13181
  });
13240
13182
  // src/features/check-skills/model/skill-files.ts
13241
- const RULE$9 = "skill-file";
13183
+ const RULE$12 = "skill-file";
13242
13184
  const SKILL_FILE = /(?:^|\/)SKILL\.md$/u;
13243
13185
  const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
13244
13186
  const MARKDOWN = ".md";
@@ -13255,8 +13197,8 @@ const GITHUB = "https://github.com/";
13255
13197
  const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
13256
13198
  const BLANK = /\s+/u;
13257
13199
  const SEPARATOR$3 = "/";
13258
- const START$8 = 0;
13259
- const FIRST$2 = 1;
13200
+ const START$9 = 0;
13201
+ const FIRST$4 = 1;
13260
13202
  const READ_CONCURRENCY$4 = 16;
13261
13203
  const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
13262
13204
  const Frontmatter = Schema.Struct({
@@ -13265,9 +13207,9 @@ const Frontmatter = Schema.Struct({
13265
13207
  metadata: Schema.optional(Metadata)
13266
13208
  });
13267
13209
  const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
13268
- const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$8));
13210
+ const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$9));
13269
13211
  const frontmatterOf = (source) => pipe(groupOf$2("yaml")(FRONTMATTER.exec(source)), Option.flatMap((yaml) => decodeFrontmatter(parse$2(yaml))));
13270
- const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$8].length), Option.getOrElse(() => START$8));
13212
+ const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$9].length), Option.getOrElse(() => START$9));
13271
13213
  const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
13272
13214
  const nameProblems = ({ source, directory }, name, folder) => {
13273
13215
  const bodyStart = bodyStartOf(source);
@@ -13295,16 +13237,16 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
13295
13237
  ]), Option.getOrElse(() => []), Array.map(({ index, message }) => ({
13296
13238
  file: skill.file,
13297
13239
  ...positionOf(skill.source)(index),
13298
- rule: RULE$9,
13240
+ rule: RULE$12,
13299
13241
  message
13300
13242
  })));
13301
13243
  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) => ({
13302
13244
  target,
13303
- index: found.index ?? START$8
13245
+ index: found.index ?? START$9
13304
13246
  })), Option.toArray);
13305
13247
  const rangeOf$1 = (found) => {
13306
- const start = found.index ?? START$8;
13307
- return [start, start + found[START$8].length];
13248
+ const start = found.index ?? START$9;
13249
+ return [start, start + found[START$9].length];
13308
13250
  };
13309
13251
  const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array.some(([start, end]) => index >= start && index < end));
13310
13252
  const linksIn = (source) => {
@@ -13322,11 +13264,11 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
13322
13264
  return pipe(missing, Array.map(({ target, index }) => ({
13323
13265
  file,
13324
13266
  ...positionOf(source)(index),
13325
- rule: RULE$9,
13267
+ rule: RULE$12,
13326
13268
  message: `links to ${target}, which does not exist. Fix the path or remove the link.`
13327
13269
  })));
13328
13270
  });
13329
- const problemsIn$5 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
13271
+ const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
13330
13272
  const files = yield* RepositoryFiles;
13331
13273
  const file = files.join(root, name);
13332
13274
  const directory = files.dirname(name);
@@ -13336,9 +13278,9 @@ const problemsIn$5 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
13336
13278
  const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$4 });
13337
13279
  const licenses = pipe(inside, Array.filter((entry) => files.dirname(entry) === directory), Array.filter((entry) => LICENSE_FILE.test(files.basename(entry))), Array.map((entry) => ({
13338
13280
  file: files.join(root, entry),
13339
- line: FIRST$2,
13340
- column: FIRST$2,
13341
- rule: RULE$9,
13281
+ line: FIRST$4,
13282
+ column: FIRST$4,
13283
+ rule: RULE$12,
13342
13284
  message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
13343
13285
  })));
13344
13286
  return [
@@ -13355,7 +13297,7 @@ const problemsIn$5 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
13355
13297
  const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
13356
13298
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
13357
13299
  const skills = pipe(listed, Array.filter((name) => SKILL_FILE.test(name) && !INSTALLED.test(name)));
13358
- const found = yield* Effect.forEach(skills, (name) => problemsIn$5(root, listed, name), { concurrency: READ_CONCURRENCY$4 });
13300
+ const found = yield* Effect.forEach(skills, (name) => problemsIn$6(root, listed, name), { concurrency: READ_CONCURRENCY$4 });
13359
13301
  return Array.flatten(found);
13360
13302
  });
13361
13303
  // src/features/check-version-downgrades/model/version-entries.ts
@@ -13418,7 +13360,7 @@ const cargoEntries = (text) => {
13418
13360
  };
13419
13361
  const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
13420
13362
  // src/features/check-version-downgrades/model/version-downgrade.ts
13421
- const RULE$8 = "version-downgrade";
13363
+ const RULE$11 = "version-downgrade";
13422
13364
  const DEFAULT_BASE = "origin/main";
13423
13365
  const READ_CONCURRENCY$3 = 16;
13424
13366
  const READERS = [
@@ -13444,7 +13386,7 @@ const downgradesIn = ({ file, text, before, after }) => {
13444
13386
  file,
13445
13387
  line: lineOf(text, entry),
13446
13388
  column: FIRST_LINE$1,
13447
- rule: RULE$8,
13389
+ rule: RULE$11,
13448
13390
  message: message(old, entry)
13449
13391
  })), Option.toArray)));
13450
13392
  };
@@ -13481,13 +13423,13 @@ const AUTOMERGE_RULE = "renovate-platform-automerge";
13481
13423
  const CAP_RULE = "renovate-version-cap";
13482
13424
  const PRESET_RULE = "renovate-msch-preset";
13483
13425
  const PRESET = "github>masseater/masseater.dev//libs/msch/renovate";
13484
- const START$7 = 0;
13426
+ const START$8 = 0;
13485
13427
  const READ_CONCURRENCY$2 = 16;
13486
13428
  const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
13487
13429
  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.";
13488
13430
  const PRESET_MESSAGE = `does not extend \`${PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
13489
13431
  const offsetsOf = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap((match) => Option.toArray(Option.fromUndefinedOr(match.index))));
13490
- const problemsIn$4 = (file, source) => {
13432
+ const problemsIn$5 = (file, source) => {
13491
13433
  const at = positionOf(source);
13492
13434
  const found = (pattern, rule, message) => pipe(offsetsOf(pattern, source), Array.map((offset) => ({
13493
13435
  file,
@@ -13500,7 +13442,7 @@ const problemsIn$4 = (file, source) => {
13500
13442
  ...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
13501
13443
  ...pipe([{
13502
13444
  file,
13503
- ...at(START$7),
13445
+ ...at(START$8),
13504
13446
  rule: PRESET_RULE,
13505
13447
  message: PRESET_MESSAGE
13506
13448
  }], Array.filter(() => !String$1.includes(`"${PRESET}"`)(source)))
@@ -13514,7 +13456,7 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
13514
13456
  const file = files.join(root, name);
13515
13457
  return files.readFile(file).pipe(Effect.map(Option.match({
13516
13458
  onNone: () => [],
13517
- onSome: (source) => problemsIn$4(file, source)
13459
+ onSome: (source) => problemsIn$5(file, source)
13518
13460
  })));
13519
13461
  }, { concurrency: READ_CONCURRENCY$2 });
13520
13462
  return Array.flatten(found);
@@ -13522,22 +13464,22 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
13522
13464
  // src/features/find-invisible-characters/model/hidden-unicode.ts
13523
13465
  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;
13524
13466
  const NUL = "\0";
13525
- const START$6 = 0;
13467
+ const START$7 = 0;
13526
13468
  const HEX = 16;
13527
13469
  const CODE_POINT_WIDTH = 4;
13528
13470
  const READ_CONCURRENCY$1 = 64;
13529
- const RULE$7 = "hidden-unicode";
13530
- const hexOf = (character) => pipe(String$1.codePointAt(START$6)(character), Option.getOrElse(() => START$6), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
13471
+ const RULE$10 = "hidden-unicode";
13472
+ const hexOf = (character) => pipe(String$1.codePointAt(START$7)(character), Option.getOrElse(() => START$7), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
13531
13473
  const problemOf$1 = (file, source) => (found) => {
13532
- const hex = hexOf(found[START$6]);
13474
+ const hex = hexOf(found[START$7]);
13533
13475
  return {
13534
13476
  file,
13535
- ...positionOf(source)(found.index ?? START$6),
13536
- rule: RULE$7,
13477
+ ...positionOf(source)(found.index ?? START$7),
13478
+ rule: RULE$10,
13537
13479
  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}.`
13538
13480
  };
13539
13481
  };
13540
- const problemsIn$3 = (file, source) => {
13482
+ const problemsIn$4 = (file, source) => {
13541
13483
  if (String$1.includes(NUL)(source)) return [];
13542
13484
  return pipe(Array.fromIterable(String$1.matchAll(HIDDEN)(source)), Array.map(problemOf$1(file, source)));
13543
13485
  };
@@ -13549,25 +13491,25 @@ const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHidden
13549
13491
  const file = files.join(root, name);
13550
13492
  return files.readFile(file).pipe(Effect.map(Option.match({
13551
13493
  onNone: () => [],
13552
- onSome: (source) => problemsIn$3(file, source)
13494
+ onSome: (source) => problemsIn$4(file, source)
13553
13495
  })));
13554
13496
  }, { concurrency: READ_CONCURRENCY$1 });
13555
13497
  return Array.flatten(found);
13556
13498
  });
13557
13499
  // src/features/find-unneeded-files/model/alchemy-patch.ts
13558
- const RULE$6 = "alchemy-patch";
13500
+ const RULE$9 = "alchemy-patch";
13559
13501
  const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
13560
13502
  const ALCHEMY$1 = /^(?:alchemy|@alchemy\.run\/[^@]+)(?:@.*)?$/u;
13561
- const START$5 = 0;
13503
+ const START$6 = 0;
13562
13504
  const problemOf = (file, position, name) => ({
13563
13505
  file,
13564
13506
  ...position,
13565
- rule: RULE$6,
13507
+ rule: RULE$9,
13566
13508
  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.`
13567
13509
  });
13568
- const problemsIn$2 = (file, patched) => (source) => {
13510
+ const problemsIn$3 = (file, patched) => (source) => {
13569
13511
  const at = positionOf(source);
13570
- const offsetOf = (name) => pipe(String$1.indexOf(name)(source), Option.getOrElse(() => START$5));
13512
+ const offsetOf = (name) => pipe(String$1.indexOf(name)(source), Option.getOrElse(() => START$6));
13571
13513
  return pipe(patched, Array.filter((name) => ALCHEMY$1.test(name)), Array.map((name) => problemOf(file, at(offsetOf(name)), name)));
13572
13514
  };
13573
13515
  /** @internal */
@@ -13577,12 +13519,12 @@ const checkAlchemyPatch = Effect.fn("checkAlchemyPatch")(function* checkAlchemyP
13577
13519
  const text = yield* files.readFile(file);
13578
13520
  const manifest = yield* workspaceManifest(root);
13579
13521
  const patched = pipe(manifest, Option.flatMap(({ patchedDependencies }) => Option.fromUndefinedOr(patchedDependencies)), Option.map(Record.keys), Option.getOrElse(() => []));
13580
- return pipe(text, Option.map(problemsIn$2(file, patched)), Option.getOrElse(() => []));
13522
+ return pipe(text, Option.map(problemsIn$3(file, patched)), Option.getOrElse(() => []));
13581
13523
  });
13582
13524
  // src/features/find-unneeded-files/model/applied-packages.ts
13583
13525
  const MSCH = "@r_masseater/msch";
13584
13526
  const SCOPE$1 = "@r_masseater/";
13585
- const RULE$5 = "applied-package";
13527
+ const RULE$8 = "applied-package";
13586
13528
  const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
13587
13529
  const NOT_FOUND = -1;
13588
13530
  const SEPARATOR$2 = "/";
@@ -13627,13 +13569,13 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
13627
13569
  const problemAt$1 = (file, source) => (index, name) => ({
13628
13570
  file,
13629
13571
  ...positionOf(source)(index),
13630
- rule: RULE$5,
13572
+ rule: RULE$8,
13631
13573
  message: `msch applies ${name}. Remove this use and let msch apply it.`
13632
13574
  });
13633
13575
  const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped(name)}(?=["'\`/])`, "gu");
13634
13576
  const binPattern = (bin) => new RegExp(`(?<![\\w./@:-])${escaped(bin)}(?=[ \\t"'\`]|$)`, "gmu");
13635
13577
  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)))));
13636
- const ownerOf = (directories) => (name) => pipe(directories, Array.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$2}`)(name)), Array.match({
13578
+ const ownerOf$1 = (directories) => (name) => pipe(directories, Array.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$2}`)(name)), Array.match({
13637
13579
  onEmpty: () => "",
13638
13580
  onNonEmpty: Array.max(BY_LENGTH)
13639
13581
  }));
@@ -13656,7 +13598,7 @@ const manifestUses = Effect.fn("manifestUses")(function* manifestUses(root, appl
13656
13598
  }));
13657
13599
  });
13658
13600
  const sourceUses = Effect.fn("sourceUses")(function* sourceUses({ root, applied, directories, consumers }) {
13659
- const owner = ownerOf(directories);
13601
+ const owner = ownerOf$1(directories);
13660
13602
  const listed = yield* listedFiles(root);
13661
13603
  const sources = pipe(listed, Array.filter((entry) => isScannedSource(entry) && Array.contains(consumers, owner(entry.name))));
13662
13604
  return yield* scanText(sources, usesIn(applied));
@@ -13682,8 +13624,8 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
13682
13624
  return yield* appliedPackageProblems(root, applied);
13683
13625
  });
13684
13626
  // src/features/find-unneeded-files/model/replaced-tools.ts
13685
- const RULE$4 = "replaced-tool";
13686
- const FIRST$1 = 1;
13627
+ const RULE$7 = "replaced-tool";
13628
+ const FIRST$3 = 1;
13687
13629
  const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
13688
13630
  const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
13689
13631
  const ALCHEMY = "the Alchemy stack in alchemy.run.ts";
@@ -13761,9 +13703,9 @@ const REPLACED = [
13761
13703
  ];
13762
13704
  const problemFor = ({ name, file }) => pipe(REPLACED, Array.findFirst(({ pattern }) => pattern.test(name)), Option.map(({ tool, replacement }) => ({
13763
13705
  file,
13764
- line: FIRST$1,
13765
- column: FIRST$1,
13766
- rule: RULE$4,
13706
+ line: FIRST$3,
13707
+ column: FIRST$3,
13708
+ rule: RULE$7,
13767
13709
  message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
13768
13710
  })));
13769
13711
  /** @internal */
@@ -13792,7 +13734,7 @@ const SETUP_PATTERNS = [
13792
13734
  ];
13793
13735
  const INSTALL_PATTERNS = [/(?<![\w./@-])cargo[ \t]+b?install\b/gu];
13794
13736
  const TOOL_PATTERNS = [/^[ \t]*["']?(?:rust|rustup)["']?[ \t]*(?:=|[ \t]+\S)/gmu];
13795
- const START$4 = 0;
13737
+ const START$5 = 0;
13796
13738
  const LAST_SEGMENT = 1;
13797
13739
  const FIRST_LINE = 1;
13798
13740
  const FIRST_COLUMN = 1;
@@ -13862,7 +13804,7 @@ const cargoWorkspaces = Effect.fn("cargoWorkspaces")(function* cargoWorkspaces(m
13862
13804
  const roots = yield* pipe(manifests, Effect.filter(({ file }) => files.readFile(file).pipe(Effect.map(isWorkspaceManifest))));
13863
13805
  return directoriesOf(roots);
13864
13806
  });
13865
- const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$4), (end) => String$1.slice(START$4, end)(name));
13807
+ const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$5), (end) => String$1.slice(START$5, end)(name));
13866
13808
  const pnpmOutputs = (present) => pipe(present, Array.filter(isPnpmOutput), Array.dedupeWith((left, right) => pnpmDirectoryOf(left) === pnpmDirectoryOf(right)), Array.map(pnpmOutput));
13867
13809
  const byDepth = Order.mapInput(Order.Number, ({ name }) => String$1.split(name, "/").length);
13868
13810
  const cargoProblems = (present, enabled) => {
@@ -13897,8 +13839,39 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
13897
13839
  if (Option.isNone(workspace)) return [];
13898
13840
  return yield* unneededIn(root, cargoEnabled(workspace.value));
13899
13841
  });
13842
+ // src/features/check-effect-diagnostics/model/effect-diagnostics.ts
13843
+ const RULE$6 = "effect-diagnostics-once";
13844
+ const PLUGIN = "@effect/language-service";
13845
+ const CONFIG_PATHSPEC = ":(glob)**/tsconfig*.json";
13846
+ const EXCLUDED$3 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
13847
+ const START$4 = 0;
13848
+ const Plugin = Schema.Struct({
13849
+ name: Schema.optional(Schema.String),
13850
+ diagnostics: Schema.optional(Schema.Unknown)
13851
+ });
13852
+ const Plugins = Schema.Array(Plugin);
13853
+ const CompilerOptions = Schema.Struct({ plugins: Schema.optional(Plugins) });
13854
+ const Config$1 = Schema.Struct({ compilerOptions: Schema.optional(CompilerOptions) });
13855
+ const decodeConfig = Schema.decodeUnknownOption(Schema.fromJsonString(Config$1));
13856
+ const MESSAGE$1 = `The \`${PLUGIN}\` plugin reports the Effect diagnostics during the type check, and the \`effecttsgo\` lint rules that msch enables report the same ones again. Set \`"diagnostics": false\` on the plugin so that each finding is reported once, by the lint rules, with the severity msch sets.`;
13857
+ const reportsDiagnostics = (plugin) => plugin.name === PLUGIN && plugin.diagnostics !== false;
13858
+ const problemsIn$2 = (entry, source) => pipe(decodeConfig(source), Option.flatMap(({ compilerOptions }) => Option.fromUndefinedOr(compilerOptions)), Option.flatMap(({ plugins }) => Option.fromUndefinedOr(plugins)), Option.filter(Array.some(reportsDiagnostics)), Option.map(() => ({
13859
+ file: entry.file,
13860
+ ...positionOf(source)(pipe(String$1.indexOf(`"${PLUGIN}"`)(source), Option.getOrElse(() => START$4))),
13861
+ rule: RULE$6,
13862
+ message: MESSAGE$1
13863
+ })), Option.toArray);
13864
+ /** @internal */
13865
+ const checkEffectDiagnostics = Effect.fn("checkEffectDiagnostics")(function* checkEffectDiagnostics(root) {
13866
+ const files = yield* RepositoryFiles;
13867
+ const configs = yield* files.matchingFiles(root, [CONFIG_PATHSPEC, ...EXCLUDED$3]);
13868
+ return yield* scanText(pipe(configs, Array.map((name) => ({
13869
+ name,
13870
+ file: files.join(root, name)
13871
+ }))), problemsIn$2);
13872
+ });
13900
13873
  // src/features/check-exact-versions/model/exact-versions.ts
13901
- const RULE$3 = "version-range";
13874
+ const RULE$5 = "version-range";
13902
13875
  const WORKSPACE_FILE = "pnpm-workspace.yaml";
13903
13876
  const ALIAS = /^npm:(?:@[^/@]+\/)?[^@]+@(?<version>.+)$/u;
13904
13877
  const PROTOCOL = /^[a-z+]+:/u;
@@ -13931,7 +13904,7 @@ const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec
13931
13904
  const problemsFor = (file, source, pattern) => (found) => pipe(found, Array.filter(({ specifier }) => isRange(specifier)), Array.map((range) => ({
13932
13905
  file,
13933
13906
  ...positionOf(source)(offsetIn(source)(pattern(range))),
13934
- rule: RULE$3,
13907
+ rule: RULE$5,
13935
13908
  message: `\`${range.name}\` \`${range.specifier}\` ${MESSAGE}`
13936
13909
  })));
13937
13910
  const manifestPattern = ({ name, specifier }) => new RegExp(`"${quoted(name)}"\\s*:\\s*"${quoted(specifier)}"`, "u");
@@ -13961,7 +13934,7 @@ const checkExactVersions = Effect.fn("checkExactVersions")(function* checkExactV
13961
13934
  return [...fromManifests, ...fromCatalogs];
13962
13935
  });
13963
13936
  // src/features/check-package-scope/model/package-scope.ts
13964
- const RULE$2 = "package-scope";
13937
+ const RULE$4 = "package-scope";
13965
13938
  const SCOPE = "@r_masseater/";
13966
13939
  const NAME_KEY = "\"name\"";
13967
13940
  const START$2 = 0;
@@ -13977,7 +13950,7 @@ const unscopedName = (manifest) => pipe(Option.fromUndefinedOr(manifest.name), O
13977
13950
  const problemsIn$1 = (entry, source) => pipe(decodeManifest$2(source), Option.filter(isPublished$1), Option.flatMap(unscopedName), Option.map((name) => ({
13978
13951
  file: entry.file,
13979
13952
  ...positionOf(source)(pipe(String$1.indexOf(NAME_KEY)(source), Option.getOrElse(() => START$2))),
13980
- rule: RULE$2,
13953
+ rule: RULE$4,
13981
13954
  message: `Packages are published only under the ${SCOPE} scope. Rename "${name}" to "${SCOPE}${String$1.replace(/^@[^/]+\//u, "")(name)}".`
13982
13955
  })), Option.toArray);
13983
13956
  /** @internal */
@@ -13989,8 +13962,108 @@ const checkPackageScope = Effect.fn("checkPackageScope")(function* checkPackageS
13989
13962
  file: files.join(root, name)
13990
13963
  }))), problemsIn$1);
13991
13964
  });
13965
+ // src/features/check-plugin-marketplace/model/plugin-marketplace.ts
13966
+ const RULE$3 = "plugin-marketplace";
13967
+ const PLUGIN_DIRECTORY = ".claude-plugin";
13968
+ const PLUGIN_FILE = `${PLUGIN_DIRECTORY}/plugin.json`;
13969
+ const MARKETPLACE_FILE = `${PLUGIN_DIRECTORY}/marketplace.json`;
13970
+ const FIRST$2 = 1;
13971
+ const INDENT = 2;
13972
+ const OwnerSchema = Schema.Struct({
13973
+ name: Schema.String,
13974
+ url: Schema.optionalKey(Schema.String)
13975
+ });
13976
+ const Person = Schema.Union([Schema.String, OwnerSchema]);
13977
+ const RootManifest = Schema.fromJsonString(Schema.Struct({
13978
+ name: Schema.String,
13979
+ author: Schema.optionalKey(Person)
13980
+ }));
13981
+ const PluginManifest = Schema.fromJsonString(Schema.Struct({ name: Schema.String }));
13982
+ const NpmSource = Schema.Struct({
13983
+ source: Schema.Literal("npm"),
13984
+ package: Schema.String
13985
+ });
13986
+ const PluginSchema = Schema.Struct({
13987
+ name: Schema.String,
13988
+ source: Schema.Union([Schema.String, NpmSource]),
13989
+ description: Schema.String
13990
+ });
13991
+ const Marketplace = Schema.fromJsonString(Schema.Struct({
13992
+ name: Schema.String,
13993
+ owner: OwnerSchema,
13994
+ plugins: Schema.Array(PluginSchema)
13995
+ }), { space: INDENT });
13996
+ const decodeRoot = Schema.decodeUnknownOption(RootManifest);
13997
+ const decodePlugin = Schema.decodeUnknownOption(PluginManifest);
13998
+ const encodeMarketplace = Schema.encodeEffect(Marketplace);
13999
+ const marketplaceName = (packageName) => pipe(String$1.toLowerCase(packageName), String$1.replace(/^@/u, ""), String$1.replaceAll(/[^a-z0-9]+/gu, "-"), String$1.replaceAll(/^-+|-+$/gu, ""));
14000
+ const ownerOf = (author) => {
14001
+ if (Predicate.isString(author)) return { name: author };
14002
+ return author;
14003
+ };
14004
+ const sourceOf = (project) => pipe(project.packageName, Option.filter(() => project.published), Option.match({
14005
+ onNone: () => `./${project.directory}`,
14006
+ onSome: (name) => ({
14007
+ source: "npm",
14008
+ package: name
14009
+ })
14010
+ }));
14011
+ const pluginIn = Effect.fn("pluginIn")(function* pluginIn(root, project) {
14012
+ const files = yield* RepositoryFiles;
14013
+ const text = yield* files.readFile(files.join(root, project.directory, PLUGIN_FILE));
14014
+ return pipe(text, Option.flatMap(decodePlugin), Option.map(({ name }) => ({
14015
+ name,
14016
+ source: sourceOf(project),
14017
+ description: Option.getOrElse(project.description, () => "")
14018
+ })));
14019
+ });
14020
+ const problem = (file, message) => ({
14021
+ file,
14022
+ line: FIRST$2,
14023
+ column: FIRST$2,
14024
+ rule: RULE$3,
14025
+ message
14026
+ });
14027
+ const pluginsIn = Effect.fn("pluginsIn")(function* pluginsIn(root) {
14028
+ const projects = yield* workspaceProjects(root);
14029
+ const found = yield* Effect.forEach(projects, (project) => pluginIn(root, project), { concurrency: "unbounded" });
14030
+ return Array.getSomes(found);
14031
+ });
14032
+ const ownerIn = Effect.fn("ownerIn")(function* ownerIn(root) {
14033
+ const files = yield* RepositoryFiles;
14034
+ const text = yield* files.readFile(files.join(root, MANIFEST_FILE$3));
14035
+ return pipe(text, Option.flatMap(decodeRoot), Option.flatMap(({ name, author }) => pipe(Option.fromUndefinedOr(author), Option.map((found) => ({
14036
+ name: marketplaceName(name),
14037
+ owner: ownerOf(found)
14038
+ })))));
14039
+ });
14040
+ const rewrite = Effect.fn("rewrite")(function* rewrite(file, expected) {
14041
+ const files = yield* RepositoryFiles;
14042
+ const written = yield* files.readFile(file);
14043
+ if (Option.exists(written, (text) => text === expected)) return [];
14044
+ yield* files.writeFile(file, expected);
14045
+ return [problem(file, `${MARKETPLACE_FILE} is generated from the workspaces that have ${PLUGIN_FILE}. msch rewrote it; commit the result.`)];
14046
+ });
14047
+ const withoutPlugins = Effect.fn("withoutPlugins")(function* withoutPlugins(file) {
14048
+ if (!(yield* (yield* RepositoryFiles).exists(file))) return [];
14049
+ return [problem(file, `No workspace has ${PLUGIN_FILE}. Delete ${MARKETPLACE_FILE}.`)];
14050
+ });
14051
+ /** @internal */
14052
+ const checkPluginMarketplace = Effect.fn("checkPluginMarketplace")(function* checkPluginMarketplace(root) {
14053
+ const files = yield* RepositoryFiles;
14054
+ const file = files.join(root, MARKETPLACE_FILE);
14055
+ const plugins = yield* pluginsIn(root);
14056
+ if (!Array.isReadonlyArrayNonEmpty(plugins)) return yield* withoutPlugins(file);
14057
+ const header = yield* ownerIn(root);
14058
+ if (Option.isNone(header)) return [problem(files.join(root, MANIFEST_FILE$3), `Workspaces ship Claude Code plugins, so ${MARKETPLACE_FILE} lists them. Add "author" to the root ${MANIFEST_FILE$3}; it becomes the marketplace owner.`)];
14059
+ const text = yield* encodeMarketplace({
14060
+ ...header.value,
14061
+ plugins
14062
+ });
14063
+ return yield* rewrite(file, `${text}\n`);
14064
+ });
13992
14065
  // src/features/check-runtime-version/model/node-version.ts
13993
- const RULE$1 = "node-version";
14066
+ const RULE$2 = "node-version";
13994
14067
  const MINIMUM = 26;
13995
14068
  const SUPPORTED = `Node.js ${String(MINIMUM)} or later is the only supported runtime.`;
13996
14069
  const MANIFEST = /(?:^|\/)package\.json$/u;
@@ -14024,7 +14097,7 @@ const admitsOld = (range) => pipe(String$1.split(range, ALTERNATIVE), Array.some
14024
14097
  const problemAt = ({ entry, source, index }, message) => ({
14025
14098
  file: entry.file,
14026
14099
  ...positionOf(source)(index),
14027
- rule: RULE$1,
14100
+ rule: RULE$2,
14028
14101
  message
14029
14102
  });
14030
14103
  const offsetOf = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$1));
@@ -14077,13 +14150,13 @@ const checkNodeVersion = Effect.fn("checkNodeVersion")(function* checkNodeVersio
14077
14150
  return yield* scanText(sources, problemsIn);
14078
14151
  });
14079
14152
  // src/features/check-unused-workspaces/model/unused-workspaces.ts
14080
- const RULE = "unused-workspace";
14153
+ const RULE$1 = "unused-workspace";
14081
14154
  const CARGO_FILE = "Cargo.toml";
14082
14155
  const ROOT_DIRECTORY = "";
14083
14156
  const TASK_SEPARATOR = "#";
14084
14157
  const SEPARATOR = "/";
14085
14158
  const START = 0;
14086
- const FIRST = 1;
14159
+ const FIRST$1 = 1;
14087
14160
  const READ_CONCURRENCY = 8;
14088
14161
  const LIBRARY_KINDS = [
14089
14162
  "lib",
@@ -14181,11 +14254,26 @@ const checkUnusedWorkspaces = Effect.fn("checkUnusedWorkspaces")(function* check
14181
14254
  ...tasks
14182
14255
  ];
14183
14256
  return pipe(members, Array.filter(({ library, entry }) => library && !entry), Array.filter((member) => !isDependedOn(links)(member)), Array.map(({ directory }) => ({
14257
+ file: files.join(root, directory, MANIFEST_FILE$3),
14258
+ line: FIRST$1,
14259
+ column: FIRST$1,
14260
+ rule: RULE$1,
14261
+ message: `${directory} is a private library, and no other workspace depends on it through package.json, a Cargo path dependency or a task. Delete it, or depend on it from the code that uses it.`
14262
+ })));
14263
+ });
14264
+ // src/features/check-workspace-descriptions/model/workspace-descriptions.ts
14265
+ const RULE = "workspace-description";
14266
+ const FIRST = 1;
14267
+ /** @internal */
14268
+ const checkWorkspaceDescriptions = Effect.fn("checkWorkspaceDescriptions")(function* checkWorkspaceDescriptions(root) {
14269
+ const files = yield* RepositoryFiles;
14270
+ const projects = yield* workspaceProjects(root);
14271
+ return pipe(projects, Array.filter(({ description }) => Option.isNone(description)), Array.map(({ directory }) => ({
14184
14272
  file: files.join(root, directory, MANIFEST_FILE$3),
14185
14273
  line: FIRST,
14186
14274
  column: FIRST,
14187
14275
  rule: RULE,
14188
- message: `${directory} is a private library, and no other workspace depends on it through package.json, a Cargo path dependency or a task. Delete it, or depend on it from the code that uses it.`
14276
+ message: "Add a one-line \"description\" that says what this workspace is for. Agents find existing tools by these descriptions, so a workspace without one is invisible to them."
14189
14277
  })));
14190
14278
  });
14191
14279
  // src/app/manifest-checks.ts
@@ -14195,7 +14283,12 @@ const checkManifests = Effect.fn("checkManifests")(function* checkManifests(root
14195
14283
  checkNodeVersion(root),
14196
14284
  checkPackageScope(root),
14197
14285
  checkUnusedWorkspaces(root),
14198
- checkExactVersions(root)
14286
+ checkExactVersions(root),
14287
+ checkUpstreamExits(root),
14288
+ checkScatteredDeviations(root),
14289
+ checkEffectDiagnostics(root),
14290
+ checkWorkspaceDescriptions(root),
14291
+ checkPluginMarketplace(root)
14199
14292
  ], { concurrency: "unbounded" });
14200
14293
  return Array.flatten(found);
14201
14294
  });