@r_masseater/msch 0.94.0 → 0.96.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +1 -1
  2. package/dist/{base-revision-C9RxuIMK.mjs → base-revision-Bl-4nxAd.mjs} +2 -2
  3. package/dist/{base-revision-C9RxuIMK.mjs.map → base-revision-Bl-4nxAd.mjs.map} +1 -1
  4. package/dist/cargo-inputs.mjs +2 -2
  5. package/dist/changed.mjs +5 -5
  6. package/dist/cli.mjs +747 -444
  7. package/dist/cli.mjs.map +1 -1
  8. package/dist/config-BBdsNPSO.mjs.map +1 -1
  9. package/dist/config.d.mts +19 -16
  10. package/dist/config.mjs +23 -161
  11. package/dist/config.mjs.map +1 -1
  12. package/dist/decision-rules.d.mts +1 -1
  13. package/dist/decision-rules.mjs +1 -1
  14. package/dist/{define-lint-preset-GWsBHDRn.mjs → define-lint-preset-B-hC9_df.mjs} +91 -57
  15. package/dist/define-lint-preset-B-hC9_df.mjs.map +1 -0
  16. package/dist/exits.mjs +4 -4
  17. package/dist/{ignored-directories-Ce-45yzO.mjs → ignored-directories-D-7Rm_2X.mjs} +2 -2
  18. package/dist/{ignored-directories-Ce-45yzO.mjs.map → ignored-directories-D-7Rm_2X.mjs.map} +1 -1
  19. package/dist/{index-Bw2kfEek.d.mts → index-CEazCJ_w.d.mts} +38 -11
  20. package/dist/{index-CMyIrsah.d.mts → index-Dm0Gg9wS.d.mts} +2 -2
  21. package/dist/judge.mjs +4 -4
  22. package/dist/lint-rules.mjs +23 -11
  23. package/dist/lint-rules.mjs.map +1 -1
  24. package/dist/lint.d.mts +2 -2
  25. package/dist/lint.mjs +1 -1
  26. package/dist/{lookup-report-DVJg0K4Z.mjs → lookup-report-L5OLXRMf.mjs} +3 -3
  27. package/dist/{lookup-report-DVJg0K4Z.mjs.map → lookup-report-L5OLXRMf.mjs.map} +1 -1
  28. package/dist/{manifest-texts-B69vIp7o.mjs → manifest-texts-DPgsV8kj.mjs} +2 -2
  29. package/dist/{manifest-texts-B69vIp7o.mjs.map → manifest-texts-DPgsV8kj.mjs.map} +1 -1
  30. package/dist/{output-B_YPmKad.mjs → output-DAvdel9H.mjs} +3 -3
  31. package/dist/{output-B_YPmKad.mjs.map → output-DAvdel9H.mjs.map} +1 -1
  32. package/dist/oxlint.mjs +2 -2
  33. package/dist/package-routes-BQWX5ttU.mjs +73 -0
  34. package/dist/package-routes-BQWX5ttU.mjs.map +1 -0
  35. package/dist/{package-versions-PMKDR-bJ.mjs → package-versions-sx15IGwA.mjs} +4 -4
  36. package/dist/{package-versions-PMKDR-bJ.mjs.map → package-versions-sx15IGwA.mjs.map} +1 -1
  37. package/dist/{pass-records-CBvMwfN3.mjs → pass-records-BcAAWgiQ.mjs} +4 -4
  38. package/dist/{pass-records-CBvMwfN3.mjs.map → pass-records-BcAAWgiQ.mjs.map} +1 -1
  39. package/dist/{problem-CUIz4TEI.mjs → problem-DbuTeNvL.mjs} +2 -2
  40. package/dist/{problem-CUIz4TEI.mjs.map → problem-DbuTeNvL.mjs.map} +1 -1
  41. package/dist/publish.mjs +23 -87
  42. package/dist/publish.mjs.map +1 -1
  43. package/dist/{published-B5LA4ZlS.mjs → published-3eokcs_D.mjs} +23 -5
  44. package/dist/published-3eokcs_D.mjs.map +1 -0
  45. package/dist/published.mjs +15 -18
  46. package/dist/published.mjs.map +1 -1
  47. package/dist/refs.mjs +6 -7
  48. package/dist/refs.mjs.map +1 -1
  49. package/dist/registries-DePiYd3D.mjs +11 -0
  50. package/dist/registries-DePiYd3D.mjs.map +1 -0
  51. package/dist/{registry-releases-Dj6jH8Yt.mjs → registry-releases-BBtz4wGE.mjs} +3 -3
  52. package/dist/registry-releases-BBtz4wGE.mjs.map +1 -0
  53. package/dist/{repository-files-B6PEvKWe.mjs → repository-files-DSwKJnrj.mjs} +6 -1
  54. package/dist/repository-files-DSwKJnrj.mjs.map +1 -0
  55. package/dist/repository-text-DGfYd5Wq.mjs +178 -0
  56. package/dist/repository-text-DGfYd5Wq.mjs.map +1 -0
  57. package/dist/{runtime-C8OGDSk9.mjs → runtime-Djm7zMwu.mjs} +2 -2
  58. package/dist/{runtime-C8OGDSk9.mjs.map → runtime-Djm7zMwu.mjs.map} +1 -1
  59. package/dist/unbumped.mjs +5 -5
  60. package/dist/{upstream-exits-nTTh2qcD.mjs → upstream-exits-4bn4gblF.mjs} +6 -7
  61. package/dist/{upstream-exits-nTTh2qcD.mjs.map → upstream-exits-4bn4gblF.mjs.map} +1 -1
  62. package/dist/{upstream-record-DlluH3fY.mjs → upstream-record-DRNGym9S.mjs} +2 -2
  63. package/dist/{upstream-record-DlluH3fY.mjs.map → upstream-record-DRNGym9S.mjs.map} +1 -1
  64. package/dist/upstream.mjs +7 -8
  65. package/dist/upstream.mjs.map +1 -1
  66. package/dist/{workspace-projects-B-vCr6bx.mjs → workspace-projects-MpL8K7Nz.mjs} +2 -2
  67. package/dist/{workspace-projects-B-vCr6bx.mjs.map → workspace-projects-MpL8K7Nz.mjs.map} +1 -1
  68. package/dist/workspace-settings.d.mts +1 -1
  69. package/dist/workspace-settings.mjs +50 -31
  70. package/dist/workspace-settings.mjs.map +1 -1
  71. package/package.json +10 -11
  72. package/skills/msch-checks/SKILL.md +3 -3
  73. package/skills/msch-publishing/SKILL.md +4 -4
  74. package/skills/msch-repository-config/SKILL.md +40 -42
  75. package/skills/msch-workspace-settings/SKILL.md +8 -9
  76. package/src/app/vite.d.ts +4 -37
  77. package/dist/credential-broker-PkIpsaMh.mjs +0 -29
  78. package/dist/credential-broker-PkIpsaMh.mjs.map +0 -1
  79. package/dist/define-lint-preset-GWsBHDRn.mjs.map +0 -1
  80. package/dist/owner-settings-BAh-fFKg.mjs +0 -122
  81. package/dist/owner-settings-BAh-fFKg.mjs.map +0 -1
  82. package/dist/package-routes-DQmhjX07.mjs +0 -82
  83. package/dist/package-routes-DQmhjX07.mjs.map +0 -1
  84. package/dist/published-B5LA4ZlS.mjs.map +0 -1
  85. package/dist/registry-releases-Dj6jH8Yt.mjs.map +0 -1
  86. package/dist/repository-files-B6PEvKWe.mjs.map +0 -1
  87. package/dist/wake.d.mts +0 -1
  88. package/dist/wake.mjs +0 -34
  89. package/dist/wake.mjs.map +0 -1
package/dist/cli.mjs CHANGED
@@ -1,26 +1,29 @@
1
1
  #!/usr/bin/env node
2
- import { C as valueKey, S as schemaTypeOf, _ as formatValues, a as nearestManifestDirectory, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as installedPackages, l as mentions$1, m as isObjectType, n as keepOnly, o as projectInputs, p as describeLibraryType, r as recordsIn, t as contentKey, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./pass-records-CBvMwfN3.mjs";
3
- import { n as NODE_MODULES, o as TOOL_NAME$1, r as RepositoryFiles, s as groupOf, t as MSCH_CACHE } from "./repository-files-B6PEvKWe.mjs";
2
+ import { C as valueKey, S as schemaTypeOf, _ as formatValues, a as nearestManifestDirectory, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as installedPackages, l as mentions$1, m as isObjectType, n as keepOnly, o as projectInputs, p as describeLibraryType, r as recordsIn, t as contentKey, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./pass-records-BcAAWgiQ.mjs";
3
+ import { n as NODE_MODULES, o as TOOL_NAME$1, r as RepositoryFiles, s as groupOf, t as MSCH_CACHE } from "./repository-files-DSwKJnrj.mjs";
4
4
  import { t as workspaceManifest } from "./workspace-manifest-BAVyPzbA.mjs";
5
- import { a as workspaceDeviations, c as tomlSourceComments, d as problemAtIndex, i as cargoDeviations, l as yamlSourceComments, o as collectNodes, r as WORKSPACE_SECTIONS, s as isRecord, t as checkUpstreamExits, u as positionOf } from "./upstream-exits-nTTh2qcD.mjs";
5
+ import { a as workspaceDeviations, c as tomlSourceComments, d as problemAtIndex, i as cargoDeviations, l as yamlSourceComments, o as collectNodes, r as WORKSPACE_SECTIONS, s as isRecord, t as checkUpstreamExits, u as positionOf } from "./upstream-exits-4bn4gblF.mjs";
6
6
  import { a as parent, i as join, n as isInside, t as baseName } from "./path-DUttmo2s.mjs";
7
- import { i as workspaceProjects, n as unmatchedWorkspacePatterns, o as installedManifest, r as workspaceDirectories, s as readManifest, t as publishedProjects } from "./workspace-projects-B-vCr6bx.mjs";
8
- import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$7, it as isNewExpression, k as symbolAtLocation, l as childrenOf$1, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$3, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-CUIz4TEI.mjs";
9
- import { A as keyName, D as workspaceConfigOf, M as nestedValues, N as propertyValue, O as KeySchema, P as stringsIn, _ as VERIFY_TASK, a as entryNameOf, d as deployEntries, g as RUN_TASKS, i as publishedWorkspaces, j as literalOf, k as childrenOf$2, l as workspaceLinks, o as isBinEntry, p as shadcnUiOf, r as packedWorkspaces, s as publicEntriesOf, u as bundledEntries, v as definesTask, y as hasVerifyTask } from "./published-B5LA4ZlS.mjs";
7
+ import { i as workspaceProjects, n as unmatchedWorkspacePatterns, o as installedManifest, r as workspaceDirectories, s as readManifest, t as publishedProjects } from "./workspace-projects-MpL8K7Nz.mjs";
8
+ import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$7, it as isNewExpression, k as symbolAtLocation, l as childrenOf$1, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$3, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-DbuTeNvL.mjs";
9
+ import { C as hasVerifyTask, F as literalOf, I as nestedValues, L as propertyValue, M as KeySchema, N as childrenOf$2, P as keyName, R as stringsIn, S as definesTask, _ as shadcnUiOf, a as workspaceConfigs, b as RUN_TASKS, c as publicEntriesOf, d as splitFrontmatter, h as deployEntries, i as publishedWorkspaces, j as workspaceConfigOf, l as isIndexSkill, m as bundledEntries, o as entryNameOf, p as workspaceLinks, r as packedWorkspaces, s as isBinEntry, u as FRONTMATTER, x as VERIFY_TASK } from "./published-3eokcs_D.mjs";
10
10
  import { r as JAPANESE } from "./config-BBdsNPSO.mjs";
11
- import { a as scopeOfName, i as ownerSettings, n as PUBLIC_REGISTRY, o as withTrailingSlash, r as isPublicRegistry, t as DEFAULT_SETTINGS } from "./owner-settings-BAh-fFKg.mjs";
11
+ import { d as RENOVATE_PRESET, f as SELF_NAME } from "./package-routes-BQWX5ttU.mjs";
12
12
  import { n as readTree, t as loadLanguage } from "./tree-sitter-BfzHNwTR.mjs";
13
- import { n as baseRevision, t as baseName$1 } from "./base-revision-C9RxuIMK.mjs";
14
- import { a as presentFiles, i as listedFiles, n as isScannedText, o as scanText, r as isToolVersions, t as upstreamRecords } from "./upstream-record-DlluH3fY.mjs";
13
+ import { n as baseRevision, t as baseName$1 } from "./base-revision-Bl-4nxAd.mjs";
14
+ import { S as exempt, f as lint$3, h as decisionTestRules, n as MARKDOWN_RULES, t as MARKDOWN_IGNORES } from "./define-lint-preset-B-hC9_df.mjs";
15
+ import { a as MSCH_TASK_COMMANDS, n as builtTextRuleNames, r as secretsOf, t as TEXT_IGNORES } from "./repository-text-DGfYd5Wq.mjs";
16
+ import { a as presentFiles, i as listedFiles, n as isScannedText, o as scanText, r as isToolVersions, t as upstreamRecords } from "./upstream-record-DRNGym9S.mjs";
15
17
  import { a as offsetIn$1, i as namedCatalogsOf, n as manifestPattern, o as quoted$1, r as manifestSpecifiers, s as specifiedIn, t as fieldsOf } from "./specifiers-BrCyPubD.mjs";
16
- import { t as checkPackageVersions } from "./package-versions-PMKDR-bJ.mjs";
17
- import { t as manifestTexts } from "./manifest-texts-B69vIp7o.mjs";
18
- import { i as writeProblems, n as failWhenAny, r as writeJsonProblems } from "./output-B_YPmKad.mjs";
19
- import { t as runCli } from "./runtime-C8OGDSk9.mjs";
18
+ import { i as withTrailingSlash, n as PUBLIC_REGISTRY, r as scopeOfName, t as INSTALL_REGISTRY } from "./registries-DePiYd3D.mjs";
19
+ import { t as checkPackageVersions } from "./package-versions-sx15IGwA.mjs";
20
+ import { t as manifestTexts } from "./manifest-texts-DPgsV8kj.mjs";
21
+ import { i as writeProblems, n as failWhenAny, r as writeJsonProblems } from "./output-DAvdel9H.mjs";
22
+ import { t as runCli } from "./runtime-Djm7zMwu.mjs";
20
23
  import "./cli-contract-D7btWrEu.mjs";
21
24
  import { builtinModules, isBuiltin } from "node:module";
22
25
  import { VpToolsError, findCiDrift, runVpa } from "@r_masseater/vite-plus-adopt";
23
- import { Array as Array$1, Boolean as Boolean$1, Context, Effect, FileSystem, HashMap, HashSet, Match, Metric, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Schema, SchemaTransformation, Stdio, Stream, String as String$1, pipe } from "effect";
26
+ import { Array as Array$1, Boolean as Boolean$1, Context, Effect, Equal, FileSystem, HashMap, HashSet, Match, Metric, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Schema, SchemaTransformation, Stdio, Stream, String as String$1, pipe } from "effect";
24
27
  import { lockedGraph, lockedPackageIds, parseDependencyPath, updateWorkspaceManifest } from "@r_masseater/masseater-utils/kestrion/pnpm";
25
28
  import { ChildProcess } from "effect/process";
26
29
  import { PACKAGE_JSON_FILE, RUNTIME_SECTIONS, binEntriesOf, namesIn, optionalPeerNames, runtimeDependencyNames, targetsIn } from "@r_masseater/masseater-utils/kestrion";
@@ -188,7 +191,7 @@ const namedWorkspaces = Effect.fn("namedWorkspaces")(function* namedWorkspaces(r
188
191
  return pipe(projects, Array$1.map(namedIn((directory) => files.basename(directory))));
189
192
  });
190
193
  // src/entities/workspace/model/cargo-crates.ts
191
- const SEPARATOR$24 = "/";
194
+ const SEPARATOR$25 = "/";
192
195
  const SUCCESS$2 = 0;
193
196
  const CrateTarget = Schema.Struct({ kind: Schema.Array(Schema.String) });
194
197
  const CrateDependency = Schema.Struct({ path: Schema.optional(Schema.String) });
@@ -228,24 +231,15 @@ const cratesIn = Effect.fn("cratesIn")(function* cratesIn(root) {
228
231
  }, Effect.scoped);
229
232
  /** @internal */
230
233
  const owningWorkspace = (directories) => (directory) => {
231
- const owners = pipe(directories, Array$1.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$24}`)(directory)));
234
+ const owners = pipe(directories, Array$1.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$25}`)(directory)));
232
235
  return Array$1.last(Array$1.sort(owners, String$1.Order));
233
236
  };
234
- // src/shared/lib/frontmatter.ts
235
- const FRONTMATTER = /^---\n(?<yaml>[\s\S]*?)\n---\n/u;
236
- const START$30 = 0;
237
- const Fields = Schema.Record(Schema.String, Schema.Unknown);
238
- const decodeFields$1 = Schema.decodeUnknownOption(Fields);
239
- const splitFrontmatter = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.flatMap((found) => pipe(groupOf("yaml")(found), Option.flatMap(Option.liftThrowable((yaml) => parse$1(yaml))), Option.flatMap(decodeFields$1), Option.map((fields) => ({
240
- fields,
241
- body: String$1.slice(found[START$30].length)(source)
242
- })))));
243
237
  // src/entities/workspace/model/plugins.ts
244
238
  const PLUGIN_FILE$3 = ".claude-plugin/plugin.json";
245
239
  const SKILLS_DIRECTORY = "skills";
246
240
  const SKILL_FILE$3 = "SKILL.md";
247
241
  const CONCURRENCY$4 = 16;
248
- const SEPARATOR$23 = "/";
242
+ const SEPARATOR$24 = "/";
249
243
  const PluginManifest$1 = Schema.fromJsonString(Schema.Struct({
250
244
  name: Schema.String,
251
245
  description: Schema.optionalKey(Schema.String),
@@ -261,7 +255,7 @@ const skillIn = Effect.fn("skillIn")(function* skillIn(scan, { plugin, skills },
261
255
  const directory = files.join(skills, name);
262
256
  const file = files.join(directory, SKILL_FILE$3);
263
257
  const source = yield* files.readFile(file);
264
- const prefix = `${files.relative(scan.root, directory)}${SEPARATOR$23}`;
258
+ const prefix = `${files.relative(scan.root, directory)}${SEPARATOR$24}`;
265
259
  const inside = pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map((entry) => files.join(scan.root, entry)));
266
260
  return pipe(source, Option.flatMap((text) => pipe(splitFrontmatter(text), Option.map((frontmatter) => ({
267
261
  plugin,
@@ -274,7 +268,7 @@ const skillIn = Effect.fn("skillIn")(function* skillIn(scan, { plugin, skills },
274
268
  })))));
275
269
  });
276
270
  const filesUnder = Effect.fn("filesUnder")(function* filesUnder(scan, directory) {
277
- const prefix = `${(yield* RepositoryFiles).relative(scan.root, directory)}${SEPARATOR$23}`;
271
+ const prefix = `${(yield* RepositoryFiles).relative(scan.root, directory)}${SEPARATOR$24}`;
278
272
  return pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map(String$1.slice(prefix.length)));
279
273
  });
280
274
  const skillsOf = Effect.fn("skillsOf")(function* skillsOf(scan, plugin, directory) {
@@ -486,8 +480,8 @@ const RESOLUTION_FILES = [
486
480
  ];
487
481
  const RESOLUTION_CONCURRENCY = 2;
488
482
  const SUCCEEDED$1 = 0;
489
- const taggedError$7 = Schema.TaggedError;
490
- var OverrideResolutionFailed = class extends taggedError$7()("OverrideResolutionFailed", {
483
+ const taggedError$8 = Schema.TaggedError;
484
+ var OverrideResolutionFailed = class extends taggedError$8()("OverrideResolutionFailed", {
491
485
  override: Schema.String,
492
486
  output: Schema.String
493
487
  }) {};
@@ -604,12 +598,12 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
604
598
  // src/features/check-overrides/model/git-subpath.ts
605
599
  const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
606
600
  const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
607
- const RULE$77 = "git-subpath-dependency";
601
+ const RULE$79 = "git-subpath-dependency";
608
602
  const WHOLE_MATCH$4 = 0;
609
603
  const problemAt$6 = ({ file }, source) => (found) => ({
610
604
  file,
611
605
  ...positionOf(source)(found.index ?? WHOLE_MATCH$4),
612
- rule: RULE$77,
606
+ rule: RULE$79,
613
607
  message: `Git subpath dependencies are banned. Publish the package to npm and depend on a released version instead of \`${String$1.trim(found[WHOLE_MATCH$4])}\`.`
614
608
  });
615
609
  const problemsIn$25 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$6(entry, source)));
@@ -620,13 +614,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
620
614
  return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$25);
621
615
  });
622
616
  // src/features/check-overrides/model/restricted-rules.ts
623
- const RULE$76 = "unnamed-restriction";
617
+ const RULE$78 = "unnamed-restriction";
624
618
  const WHOLE_MATCH$3 = 0;
625
619
  const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
626
620
  const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
627
621
  file: entry.file,
628
622
  ...positionOf(source)(found.index ?? WHOLE_MATCH$3),
629
- rule: RULE$76,
623
+ rule: RULE$78,
630
624
  message: `${found[WHOLE_MATCH$3]} is not used in this repository, because its name does not say what an entry protects. Ban a package in dependencyRules.banned, and write any other restriction as a rule in msch-lint whose name states the intent.`
631
625
  })));
632
626
  /** @internal */
@@ -635,13 +629,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
635
629
  return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$24);
636
630
  });
637
631
  // src/features/check-overrides/model/type-exemptions.ts
638
- const RULE$75 = "named-type-exemption";
632
+ const RULE$77 = "named-type-exemption";
639
633
  const WHOLE_MATCH$2 = 0;
640
634
  const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
641
635
  const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
642
636
  file: entry.file,
643
637
  ...positionOf(source)(found.index ?? WHOLE_MATCH$2),
644
- rule: RULE$75,
638
+ rule: RULE$77,
645
639
  message: "exempts a type from a lint rule by its name. Such a list is written by hand for every dependency and only grows. msch-lint/readonly-parameters reads where each type is declared and exempts the types of packages and of the language by itself, so remove the entry. For another rule, add a rule to msch-lint that reads the declaration."
646
640
  })));
647
641
  /** @internal */
@@ -650,60 +644,51 @@ const checkTypeExemptions = Effect.fn("checkTypeExemptions")(function* checkType
650
644
  return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
651
645
  });
652
646
  // src/features/check-overrides/model/package-registry.ts
653
- const RULE$74 = "package-registry";
647
+ const RULE$76 = "package-registry";
654
648
  const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
655
649
  const NPMRC = /(?:^|\/)\.npmrc$/u;
656
650
  const WORKSPACE_REGISTRY = /^registry:/mu;
657
651
  const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
658
- const START$29 = 0;
659
- const reasonOf = (registry) => {
660
- if (registry === DEFAULT_SETTINGS.installRegistry) return `Installs go through Takumi Guard (${registry}), which blocks known-malicious packages before they are installed.`;
661
- return `Installs go through ${registry}, the registry msch.installs.registry in the root vite.config.ts names.`;
662
- };
663
- const requiredOf = (registry) => ({
664
- registry,
665
- reason: reasonOf(registry)
666
- });
652
+ const START$31 = 0;
653
+ const REASON$1 = `Installs go through Takumi Guard (${INSTALL_REGISTRY}), which blocks known-malicious packages before they are installed.`;
667
654
  const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
668
655
  const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
669
- const isRequired = ({ registry }) => (found) => withTrailingSlash(found) === registry;
670
- const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$29));
671
- const workspaceProblem = (required, { file, source }, registry) => ({
656
+ const isRequired = (found) => withTrailingSlash(found) === INSTALL_REGISTRY;
657
+ const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$31));
658
+ const workspaceProblem = ({ file, source }, registry) => ({
672
659
  file,
673
660
  ...positionOf(source)(offsetIn(WORKSPACE_REGISTRY.exec(source))),
674
- rule: RULE$74,
661
+ rule: RULE$76,
675
662
  message: Option.match(registry, {
676
- onNone: () => `${required.reason} Set \`registry: ${required.registry}\` in ${WORKSPACE_FILE$6}.`,
677
- onSome: (value) => `${required.reason} \`registry\` is ${value}. Set it to ${required.registry}.`
663
+ onNone: () => `${REASON$1} Set \`registry: ${INSTALL_REGISTRY}\` in ${WORKSPACE_FILE$6}.`,
664
+ onSome: (value) => `${REASON$1} \`registry\` is ${value}. Set it to ${INSTALL_REGISTRY}.`
678
665
  })
679
666
  });
680
- const npmrcProblems = (required) => (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array$1.filter((found) => !Option.exists(groupOf("value")(found), isRequired(required))), Array$1.map((found) => ({
667
+ const npmrcProblems = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array$1.filter((found) => !Option.exists(groupOf("value")(found), isRequired)), Array$1.map((found) => ({
681
668
  file: entry.file,
682
- ...positionOf(source)(found.index ?? START$29),
683
- rule: RULE$74,
684
- message: `${required.reason} This .npmrc overrides it with \`${String$1.trim(found[START$29])}\`. Remove the line.`
669
+ ...positionOf(source)(found.index ?? START$31),
670
+ rule: RULE$76,
671
+ message: `${REASON$1} This .npmrc overrides it with \`${String$1.trim(found[START$31])}\`. Remove the line.`
685
672
  })));
686
- const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root, required) {
673
+ const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
687
674
  const files = yield* RepositoryFiles;
688
675
  const manifest = yield* workspaceManifest(root);
689
676
  const registry = pipe(manifest, Option.flatMap(registryOf));
690
- const guarded = isRequired(required)(Option.getOrElse(registry, () => PUBLIC_REGISTRY));
677
+ const guarded = isRequired(Option.getOrElse(registry, () => PUBLIC_REGISTRY));
691
678
  if (Option.isNone(manifest) || guarded) return [];
692
679
  const file = files.join(root, WORKSPACE_FILE$6);
693
680
  const read = yield* files.readFile(file);
694
681
  const source = Option.getOrElse(read, () => "");
695
- return [workspaceProblem(required, {
682
+ return [workspaceProblem({
696
683
  file,
697
684
  source
698
685
  }, registry)];
699
686
  });
700
687
  /** @internal */
701
688
  const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPackageRegistry(root) {
702
- const { installRegistry } = yield* ownerSettings(root);
703
- const required = requiredOf(installRegistry);
704
689
  const listed = yield* listedFiles(root);
705
- const overrides = yield* scanText(pipe(listed, Array$1.filter(({ name }) => NPMRC.test(name))), npmrcProblems(required));
706
- return [...yield* checkWorkspace(root, required), ...overrides];
690
+ const overrides = yield* scanText(pipe(listed, Array$1.filter(({ name }) => NPMRC.test(name))), npmrcProblems);
691
+ return [...yield* checkWorkspace(root), ...overrides];
707
692
  });
708
693
  // src/entities/package/model/stack-catalog.ts
709
694
  const STACK_CATALOG = "catalog:stack";
@@ -2832,8 +2817,7 @@ const scanPublishedManifests = Effect.fn("scanPublishedManifests")(function* sca
2832
2817
  })), Option.getOrElse(() => [])));
2833
2818
  });
2834
2819
  // src/features/check-overrides/model/removed-peers.ts
2835
- const RULE$73 = "removed-peer";
2836
- const MSCH$1 = "@r_masseater/msch";
2820
+ const RULE$75 = "removed-peer";
2837
2821
  const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
2838
2822
  const REMOVED = "-";
2839
2823
  const PARENT_SEPARATOR = ">";
@@ -2860,7 +2844,7 @@ const problemAt$5 = (file, { key, line, column }) => ({ peer, dependent }) => ({
2860
2844
  file,
2861
2845
  line,
2862
2846
  column,
2863
- rule: RULE$73,
2847
+ rule: RULE$75,
2864
2848
  message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
2865
2849
  });
2866
2850
  const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
@@ -2872,7 +2856,7 @@ const requiredPeersOf = (dependent, manifest) => pipe(Record.keys(manifest.peerD
2872
2856
  })));
2873
2857
  const mschPeers = Effect.fn("mschPeers")(function* mschPeers() {
2874
2858
  const files = yield* RepositoryFiles;
2875
- const own = findPackageJson(MSCH$1, import.meta.url);
2859
+ const own = findPackageJson(SELF_NAME, import.meta.url);
2876
2860
  if (Option.isNone(own)) return [];
2877
2861
  const manifest = yield* readManifest(files.dirname(own.value));
2878
2862
  const dependencies = pipe(manifest, Option.map(({ dependencies: held }) => Record.keys(held ?? {})), Option.getOrElse(() => []));
@@ -2894,7 +2878,7 @@ const checkRemovedPeers = Effect.fn("checkRemovedPeers")(function* checkRemovedP
2894
2878
  });
2895
2879
  });
2896
2880
  // src/features/check-placement/model/colocated-git-patterns.ts
2897
- const RULE$72 = "colocated-git-patterns";
2881
+ const RULE$74 = "colocated-git-patterns";
2898
2882
  const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
2899
2883
  const ROOT$3 = ".";
2900
2884
  const NEGATION$1 = "!";
@@ -2941,7 +2925,7 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
2941
2925
  const toEntry = entryOf$1(absolute, files.basename(file), files.dirname(file));
2942
2926
  return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
2943
2927
  });
2944
- const patternProblem = (entry, message) => problemAtPosition(RULE$72)(entry.file, {
2928
+ const patternProblem = (entry, message) => problemAtPosition(RULE$74)(entry.file, {
2945
2929
  line: entry.line,
2946
2930
  column: FIRST$25
2947
2931
  }, message);
@@ -3004,7 +2988,7 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
3004
2988
  return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
3005
2989
  });
3006
2990
  // src/features/check-placement/model/colocated-tests.ts
3007
- const RULE$71 = "colocated-test";
2991
+ const RULE$73 = "colocated-test";
3008
2992
  const FIRST$24 = 1;
3009
2993
  const READ_CONCURRENCY$32 = 64;
3010
2994
  const ROOT_SUBPATH$1 = ".";
@@ -3027,7 +3011,7 @@ const problemFor$10 = (test, message) => ({
3027
3011
  file: test.file,
3028
3012
  line: FIRST$24,
3029
3013
  column: FIRST$24,
3030
- rule: RULE$71,
3014
+ rule: RULE$73,
3031
3015
  message: `${test.base} ${message}`
3032
3016
  });
3033
3017
  const groupsOf$2 = (source, pattern, group) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array$1.getSomes);
@@ -3110,7 +3094,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
3110
3094
  // src/features/check-placement/model/agent-docs-length.ts
3111
3095
  const RECOMMENDED_LINES = 200;
3112
3096
  const FIRST$23 = 1;
3113
- const RULE$70 = "agent-docs-length";
3097
+ const RULE$72 = "agent-docs-length";
3114
3098
  const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
3115
3099
  const problemFor$9 = (file) => (lines) => {
3116
3100
  if (lines <= RECOMMENDED_LINES) return Option.none();
@@ -3118,14 +3102,14 @@ const problemFor$9 = (file) => (lines) => {
3118
3102
  file,
3119
3103
  line: 201,
3120
3104
  column: FIRST$23,
3121
- rule: RULE$70,
3105
+ rule: RULE$72,
3122
3106
  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.`
3123
3107
  });
3124
3108
  };
3125
3109
  /** @internal */
3126
3110
  const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$9(file)(lineCount(source)));
3127
3111
  // src/features/check-placement/model/claude-link.ts
3128
- const RULE$69 = "claude-md-link";
3112
+ const RULE$71 = "claude-md-link";
3129
3113
  const CLAUDE = "CLAUDE.md";
3130
3114
  const AGENTS = "AGENTS.md";
3131
3115
  const FIRST$22 = 1;
@@ -3144,7 +3128,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
3144
3128
  file: path,
3145
3129
  line: FIRST$22,
3146
3130
  column: FIRST$22,
3147
- rule: RULE$69,
3131
+ rule: RULE$71,
3148
3132
  message: MESSAGE$19
3149
3133
  })));
3150
3134
  });
@@ -3153,11 +3137,11 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
3153
3137
  return Array$1.getSomes(found);
3154
3138
  });
3155
3139
  // src/features/check-placement/model/dangling-links.ts
3156
- const RULE$68 = "dangling-link";
3157
- const SEPARATOR$22 = "/";
3140
+ const RULE$70 = "dangling-link";
3141
+ const SEPARATOR$23 = "/";
3158
3142
  const FIRST$21 = 1;
3159
3143
  const READ_CONCURRENCY$29 = 16;
3160
- const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$22}`)(name);
3144
+ const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$23}`)(name);
3161
3145
  /** @internal */
3162
3146
  const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
3163
3147
  const files = yield* RepositoryFiles;
@@ -3169,7 +3153,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
3169
3153
  file,
3170
3154
  line: FIRST$21,
3171
3155
  column: FIRST$21,
3172
- rule: RULE$68,
3156
+ rule: RULE$70,
3173
3157
  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.`
3174
3158
  })));
3175
3159
  });
@@ -3179,7 +3163,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
3179
3163
  // src/features/check-placement/model/member-sources.ts
3180
3164
  const ROOT_WORKSPACE$1 = ".";
3181
3165
  const FIRST$20 = 1;
3182
- const SEPARATOR$21 = "/";
3166
+ const SEPARATOR$22 = "/";
3183
3167
  const EXCLUDED$6 = [
3184
3168
  ":(exclude,attr:linguist-vendored)",
3185
3169
  ":(exclude,attr:linguist-generated)",
@@ -3204,7 +3188,7 @@ const fileProblem$1 = ({ file, rule, message }) => ({
3204
3188
  rule,
3205
3189
  message
3206
3190
  });
3207
- const ownerOf$4 = (workspaces) => (name) => pipe(workspaces, Array$1.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$21}`)(name)), (owners) => Array$1.last(Array$1.sort(owners, byLength$1)), Option.map((workspace) => ({
3191
+ const ownerOf$4 = (workspaces) => (name) => pipe(workspaces, Array$1.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$22}`)(name)), (owners) => Array$1.last(Array$1.sort(owners, byLength$1)), Option.map((workspace) => ({
3208
3192
  workspace,
3209
3193
  inner: String$1.slice(workspace.length + 1)(name)
3210
3194
  })));
@@ -3227,7 +3211,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
3227
3211
  }));
3228
3212
  });
3229
3213
  // src/features/check-placement/model/deployed-readme.ts
3230
- const RULE$67 = "deployed-readme";
3214
+ const RULE$69 = "deployed-readme";
3231
3215
  const ROOT_DIRECTORY$4 = "";
3232
3216
  const READ_CONCURRENCY$28 = 16;
3233
3217
  const MISSING_MESSAGE$2 = "is missing. This workspace has an Alchemy stack that serves an address, so give it a README.md that says what it is and links its URL.";
@@ -3267,14 +3251,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
3267
3251
  const readme = yield* readReadme({
3268
3252
  root,
3269
3253
  directory,
3270
- rule: RULE$67,
3254
+ rule: RULE$69,
3271
3255
  missingMessage: MISSING_MESSAGE$2
3272
3256
  });
3273
3257
  return Result.match(readme, {
3274
3258
  onFailure: Option.some,
3275
3259
  onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
3276
3260
  file,
3277
- rule: RULE$67,
3261
+ rule: RULE$69,
3278
3262
  message: NO_URL_MESSAGE
3279
3263
  })))
3280
3264
  });
@@ -3291,9 +3275,9 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
3291
3275
  return Array$1.getSomes(found);
3292
3276
  });
3293
3277
  // src/features/check-placement/model/nested-docs.ts
3294
- const RULE$66 = "nested-docs";
3295
- const CONFIG_FILE$7 = "vite.config.ts";
3296
- const SEPARATOR$20 = "/";
3278
+ const RULE$68 = "nested-docs";
3279
+ const CONFIG_FILE$9 = "vite.config.ts";
3280
+ const SEPARATOR$21 = "/";
3297
3281
  const READ_CONCURRENCY$27 = 64;
3298
3282
  const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
3299
3283
  const WORKSPACE_AGENT_DOC = "AGENTS.md";
@@ -3301,10 +3285,10 @@ const README = /^README(?:\.[^/]+)?$/iu;
3301
3285
  const MANIFEST$2 = "package.json";
3302
3286
  const MISSING_RULE = "workspace-agents-md";
3303
3287
  const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
3304
- const taggedError$6 = Schema.TaggedError;
3305
- var RootConfigUnreadable = class extends taggedError$6()("RootConfigUnreadable", { file: Schema.String }) {};
3306
- const isNested = (name) => String$1.includes(SEPARATOR$20)(name);
3307
- const problemFor$8 = problemInFile(RULE$66);
3288
+ const taggedError$7 = Schema.TaggedError;
3289
+ var RootConfigUnreadable = class extends taggedError$7()("RootConfigUnreadable", { file: Schema.String }) {};
3290
+ const isNested = (name) => String$1.includes(SEPARATOR$21)(name);
3291
+ const problemFor$8 = problemInFile(RULE$68);
3308
3292
  const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
3309
3293
  const WORKSPACE_AGENT_DOCS_MESSAGE = "belongs only at the repository root or as AGENTS.md directly in a workspace, the directory that holds its package.json. Move what agents need there and delete this file.";
3310
3294
  const MISSING_MESSAGE$1 = "has no AGENTS.md next to it. This repository sets msch.workspaceAgentsMd, so every workspace describes what it is for and the rules that apply only there in its own AGENTS.md.";
@@ -3332,7 +3316,7 @@ const problemIn$6 = Effect.fn("problemIn")(function* problemIn(root, allowed, na
3332
3316
  });
3333
3317
  const allowsWorkspaceAgentDocs = Effect.fn("allowsWorkspaceAgentDocs")(function* allowsWorkspaceAgentDocs(root) {
3334
3318
  const files = yield* RepositoryFiles;
3335
- const file = files.join(root, CONFIG_FILE$7);
3319
+ const file = files.join(root, CONFIG_FILE$9);
3336
3320
  if (!(yield* files.exists(file))) return false;
3337
3321
  const config = yield* Effect.tryPromise({
3338
3322
  try: () => resolveConfigFromFile(file),
@@ -3361,26 +3345,26 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
3361
3345
  return [...Array$1.getSomes(found), ...missing];
3362
3346
  });
3363
3347
  // src/features/check-placement/model/published-readme.ts
3364
- const RULE$65 = "published-readme";
3348
+ const RULE$67 = "published-readme";
3365
3349
  const READ_CONCURRENCY$26 = 16;
3366
3350
  const MESSAGE$18 = "contains Japanese. This package is published to npm, so write its README in English.";
3367
3351
  const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
3368
- const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, english, { directory }) {
3352
+ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
3369
3353
  const readme = yield* readReadme({
3370
3354
  root,
3371
3355
  directory,
3372
- rule: RULE$65,
3356
+ rule: RULE$67,
3373
3357
  missingMessage: MISSING_MESSAGE
3374
3358
  });
3375
3359
  return Result.match(readme, {
3376
3360
  onFailure: Option.some,
3377
- onSuccess: ({ file, source }) => pipe(Option.fromNullishOr(JAPANESE.exec(source)), Option.filter(() => english), Option.map((found) => {
3361
+ onSuccess: ({ file, source }) => pipe(Option.fromNullishOr(JAPANESE.exec(source)), Option.map((found) => {
3378
3362
  const { line, column } = positionOf(source)(found.index);
3379
3363
  return {
3380
3364
  file,
3381
3365
  line,
3382
3366
  column,
3383
- rule: RULE$65,
3367
+ rule: RULE$67,
3384
3368
  message: MESSAGE$18
3385
3369
  };
3386
3370
  }))
@@ -3389,13 +3373,11 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, english, {
3389
3373
  /** @internal */
3390
3374
  const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPublishedReadme(root) {
3391
3375
  const projects = yield* publishedProjects(root);
3392
- const { publishRegistry } = yield* ownerSettings(root);
3393
- const english = isPublicRegistry(publishRegistry);
3394
- const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, english, project), { concurrency: READ_CONCURRENCY$26 });
3376
+ const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$26 });
3395
3377
  return Array$1.getSomes(found);
3396
3378
  });
3397
3379
  // src/features/check-placement/model/published-tests.ts
3398
- const RULE$64 = "published-tests";
3380
+ const RULE$66 = "published-tests";
3399
3381
  const FILE_START = 1;
3400
3382
  const TEST_FILE$3 = /\.test\.[cm]?[jt]sx?$/u;
3401
3383
  const MESSAGE$17 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
@@ -3409,7 +3391,7 @@ const problemFor$7 = Effect.fn("problemFor")(function* problemFor(root, listed,
3409
3391
  file: files.join(absolute, PACKAGE_JSON_FILE),
3410
3392
  line: FILE_START,
3411
3393
  column: FILE_START,
3412
- rule: RULE$64,
3394
+ rule: RULE$66,
3413
3395
  message: MESSAGE$17
3414
3396
  });
3415
3397
  });
@@ -3423,13 +3405,13 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
3423
3405
  return Array$1.getSomes(found);
3424
3406
  });
3425
3407
  // src/features/check-placement/model/root-docs.ts
3426
- const RULE$63 = "root-docs";
3427
- const SEPARATOR$19 = "/";
3408
+ const RULE$65 = "root-docs";
3409
+ const SEPARATOR$20 = "/";
3428
3410
  const FIRST$19 = 1;
3429
3411
  const MARKDOWN$5 = /\.(?:md|mdx|markdown)$/iu;
3430
3412
  const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
3431
3413
  const MESSAGE$16 = "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.";
3432
- const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$19)(name) && MARKDOWN$5.test(name) && !ALLOWED.test(name);
3414
+ const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$20)(name) && MARKDOWN$5.test(name) && !ALLOWED.test(name);
3433
3415
  /** @internal */
3434
3416
  const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
3435
3417
  const files = yield* RepositoryFiles;
@@ -3438,16 +3420,15 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
3438
3420
  file: files.join(root, name),
3439
3421
  line: FIRST$19,
3440
3422
  column: FIRST$19,
3441
- rule: RULE$63,
3423
+ rule: RULE$65,
3442
3424
  message: `${name} ${MESSAGE$16}`
3443
3425
  })));
3444
3426
  });
3445
3427
  // src/features/check-placement/model/root-readme.ts
3446
- const RULE$62 = "root-readme";
3428
+ const RULE$64 = "root-readme";
3447
3429
  const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
3448
3430
  const READ_CONCURRENCY$25 = 16;
3449
- const START$28 = 0;
3450
- const CHECK_POLICY = "@r_masseater/msch";
3431
+ const START$30 = 0;
3451
3432
  const MARKETPLACE = ".claude-plugin/marketplace.json";
3452
3433
  const RELATIVE$2 = /^\.\//u;
3453
3434
  const MarketplacePlugin = Schema.Struct({
@@ -3459,8 +3440,8 @@ const NO_PLUGINS = {
3459
3440
  directories: [],
3460
3441
  names: []
3461
3442
  };
3462
- const isCheckPolicy = ({ packageName }) => Option.contains(packageName, CHECK_POLICY);
3463
- const messageFor$2 = (directory) => `names the workspace ${directory}. The root README, AGENTS.md and CLAUDE.md describe the repository as a whole. Write what belongs to the workspace in ${directory}/README.md, or for agents in ${directory}/AGENTS.md.`;
3443
+ const isCheckPolicy = ({ packageName }) => Option.contains(packageName, SELF_NAME);
3444
+ const messageFor$3 = (directory) => `names the workspace ${directory}. The root README, AGENTS.md and CLAUDE.md describe the repository as a whole. Write what belongs to the workspace in ${directory}/README.md, or for agents in ${directory}/AGENTS.md.`;
3464
3445
  const pluginsOf = (plugins) => {
3465
3446
  const directories = pipe(plugins, Array$1.map(({ source }) => source), Array$1.filter(Predicate.isString), Array$1.map(String$1.replace(RELATIVE$2, "")));
3466
3447
  const segments = pipe(directories, Array$1.map(baseName));
@@ -3484,10 +3465,10 @@ const patternFor = (plugins) => ({ directory, names }) => patternOf$1(Option.mat
3484
3465
  onSome: () => [directory]
3485
3466
  }));
3486
3467
  const problemsIn$22 = (file, source, plugins) => (workspace) => {
3487
- const message = messageFor$2(workspace.directory);
3468
+ const message = messageFor$3(workspace.directory);
3488
3469
  const at = positionOf(source);
3489
3470
  const pattern = patternFor(plugins)(workspace);
3490
- return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$62)(file, at(found.index ?? START$28), message)));
3471
+ return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$64)(file, at(found.index ?? START$30), message)));
3491
3472
  };
3492
3473
  const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
3493
3474
  const text = yield* (yield* RepositoryFiles).readFile(file);
@@ -3524,7 +3505,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
3524
3505
  return Array$1.flatten(found);
3525
3506
  });
3526
3507
  // src/features/check-placement/model/docs-mirror.ts
3527
- const RULE$61 = "docs-mirror";
3508
+ const RULE$63 = "docs-mirror";
3528
3509
  const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
3529
3510
  const MIRROR_LIMIT = 3;
3530
3511
  const READ_CONCURRENCY$24 = 16;
@@ -3549,7 +3530,7 @@ const problemFor$6 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
3549
3530
  file,
3550
3531
  line,
3551
3532
  column,
3552
- rule: RULE$61,
3533
+ rule: RULE$63,
3553
3534
  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.`
3554
3535
  };
3555
3536
  }), Option.toArray);
@@ -3581,7 +3562,7 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
3581
3562
  return Array$1.flatten(found);
3582
3563
  });
3583
3564
  // src/features/check-placement/model/ignored-sources.ts
3584
- const RULE$60 = "ignored-sources";
3565
+ const RULE$62 = "ignored-sources";
3585
3566
  const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
3586
3567
  const FIRST$18 = 1;
3587
3568
  const MESSAGE$15 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
@@ -3593,7 +3574,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
3593
3574
  file: files.join(root, file),
3594
3575
  line: FIRST$18,
3595
3576
  column: FIRST$18,
3596
- rule: RULE$60,
3577
+ rule: RULE$62,
3597
3578
  message: MESSAGE$15
3598
3579
  })));
3599
3580
  });
@@ -12140,7 +12121,7 @@ var english_verbs_default = [
12140
12121
  const SLICE_RULE$1 = "feature-slice-name";
12141
12122
  const ENTRY_RULE$2 = "deploy-entry-name";
12142
12123
  const SEGMENT_RULE = "slice-segment-name";
12143
- const SEPARATOR$17 = "/";
12124
+ const SEPARATOR$18 = "/";
12144
12125
  const NEXT$3 = 1;
12145
12126
  const WORD_SEPARATOR$1 = "-";
12146
12127
  const MINIMUM_WORDS = 2;
@@ -12166,7 +12147,7 @@ const isVerbObjectBy = (separator) => (slice) => {
12166
12147
  return words.length >= MINIMUM_WORDS && Option.exists(Array$1.head(words), (word) => VERBS.has(word));
12167
12148
  };
12168
12149
  const isVerbObject = isVerbObjectBy(WORD_SEPARATOR$1);
12169
- const misnamedSlice$1 = ({ workspace, inner }) => pipe(Option.liftPredicate(inner, (path) => String$1.startsWith(FEATURES$1)(path) && SCRIPT$1.test(path)), Option.flatMap((path) => Array$1.head(String$1.split(String$1.slice(13)(path), SEPARATOR$17))), Option.filter((slice) => !isVerbObject(slice)), Option.map((slice) => `${workspace}${SEPARATOR$17}${FEATURES$1}${slice}`));
12150
+ const misnamedSlice$1 = ({ workspace, inner }) => pipe(Option.liftPredicate(inner, (path) => String$1.startsWith(FEATURES$1)(path) && SCRIPT$1.test(path)), Option.flatMap((path) => Array$1.head(String$1.split(String$1.slice(13)(path), SEPARATOR$18))), Option.filter((slice) => !isVerbObject(slice)), Option.map((slice) => `${workspace}${SEPARATOR$18}${FEATURES$1}${slice}`));
12170
12151
  const SLICE_LAYERS = [
12171
12152
  "features",
12172
12153
  "entities",
@@ -12174,26 +12155,26 @@ const SLICE_LAYERS = [
12174
12155
  "pages"
12175
12156
  ];
12176
12157
  const SLICE_DEPTHS = [3, 4];
12177
- const pathPrefix = (parts, depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$17);
12158
+ const pathPrefix = (parts, depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$18);
12178
12159
  const isInSliceLayer = (parts) => {
12179
12160
  const [source, layer] = parts;
12180
- return `${source}${SEPARATOR$17}` === SOURCE && Array$1.contains(SLICE_LAYERS, layer ?? "");
12161
+ return `${source}${SEPARATOR$18}` === SOURCE && Array$1.contains(SLICE_LAYERS, layer ?? "");
12181
12162
  };
12182
12163
  const indexedSlice = (owned) => {
12183
- const parts = String$1.split(owned.inner, SEPARATOR$17);
12164
+ const parts = String$1.split(owned.inner, SEPARATOR$18);
12184
12165
  const depth = parts.length - NEXT$3;
12185
- return pipe(Option.liftPredicate(depth, () => isInSliceLayer(parts) && INDEX.test(owned.inner) && Array$1.contains(SLICE_DEPTHS, depth)), Option.map(() => `${owned.workspace}${SEPARATOR$17}${pathPrefix(parts, depth)}`));
12166
+ return pipe(Option.liftPredicate(depth, () => isInSliceLayer(parts) && INDEX.test(owned.inner) && Array$1.contains(SLICE_DEPTHS, depth)), Option.map(() => `${owned.workspace}${SEPARATOR$18}${pathPrefix(parts, depth)}`));
12186
12167
  };
12187
12168
  const misnamedSegment = (slices) => ({ workspace, inner }) => {
12188
- const parts = String$1.split(inner, SEPARATOR$17);
12189
- const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$17}${pathPrefix(parts, depth)}`);
12169
+ const parts = String$1.split(inner, SEPARATOR$18);
12170
+ const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$18}${pathPrefix(parts, depth)}`);
12190
12171
  const isSegmentFolder = (depth) => parts.length > depth + NEXT$3 && SCRIPT$1.test(inner) && !SEGMENTS.has(parts[depth] ?? "");
12191
- return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$17}${pathPrefix(parts, depth + NEXT$3)}`));
12172
+ return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$18}${pathPrefix(parts, depth + NEXT$3)}`));
12192
12173
  };
12193
12174
  const deployNamed = ({ workspace, inner }) => {
12194
12175
  if (!String$1.startsWith(SOURCE)(inner)) return Option.none();
12195
- const segments = String$1.split(inner, SEPARATOR$17);
12196
- return pipe(Array$1.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$17}${Array$1.join(Array$1.take(segments, index + NEXT$3), SEPARATOR$17)}`));
12176
+ const segments = String$1.split(inner, SEPARATOR$18);
12177
+ return pipe(Array$1.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$18}${Array$1.join(Array$1.take(segments, index + NEXT$3), SEPARATOR$18)}`));
12197
12178
  };
12198
12179
  /** @internal */
12199
12180
  const checkSourceNames = Effect.fn("checkSourceNames")(function* checkSourceNames(root) {
@@ -12316,13 +12297,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
12316
12297
  return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
12317
12298
  });
12318
12299
  // src/features/check-placement/model/shadcn-ui-alias.ts
12319
- const RULE$59 = "shadcn-ui-alias";
12300
+ const RULE$61 = "shadcn-ui-alias";
12320
12301
  const FIRST$17 = 1;
12321
12302
  const problemOf$10 = (directory, { file, alias }) => ({
12322
12303
  file,
12323
12304
  line: FIRST$17,
12324
12305
  column: FIRST$17,
12325
- rule: RULE$59,
12306
+ rule: RULE$61,
12326
12307
  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/*".`
12327
12308
  });
12328
12309
  /** @internal */
@@ -12384,7 +12365,7 @@ const CODE_IN_BIN = "code-in-bin";
12384
12365
  const BIN = "bin";
12385
12366
  const SCRIPTS_DIRECTORY = "scripts";
12386
12367
  const WORKFLOW_DIRECTORY$1 = ".github/";
12387
- const SEPARATOR$16 = "/";
12368
+ const SEPARATOR$17 = "/";
12388
12369
  const CURRENT = "./";
12389
12370
  const READ_CONCURRENCY$22 = 8;
12390
12371
  const FIRST$16 = 1;
@@ -12422,7 +12403,7 @@ const isCommand$1 = (path) => COMMAND$1.test(path) && !NOT_COMMAND.test(path);
12422
12403
  const commandFilesIn = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
12423
12404
  const files = yield* RepositoryFiles;
12424
12405
  const names = yield* files.readDirectory(files.join(root, directory, BIN));
12425
- return pipe(names, Array$1.map((name) => `${BIN}${SEPARATOR$16}${name}`), Array$1.filter(isCommand$1));
12406
+ return pipe(names, Array$1.map((name) => `${BIN}${SEPARATOR$17}${name}`), Array$1.filter(isCommand$1));
12426
12407
  });
12427
12408
  const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
12428
12409
  const files = yield* RepositoryFiles;
@@ -12431,7 +12412,7 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
12431
12412
  const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$22 });
12432
12413
  return pipe(Array$1.getSomes(texts), Array$1.join("\n"));
12433
12414
  });
12434
- const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$16));
12415
+ const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$17));
12435
12416
  const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array$1.filter(({ path }) => !COMMAND$1.test(path) && !Array$1.contains(entries.all, path)), Array$1.map(({ path, start }) => ({
12436
12417
  file,
12437
12418
  ...positionOf(source)(start),
@@ -12478,8 +12459,8 @@ const isCommandFile = (path) => isCommand$1(path) || COMMAND_FILE.test(path) &&
12478
12459
  const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProblems(root, directory) {
12479
12460
  const files = yield* RepositoryFiles;
12480
12461
  const listed = yield* files.listedFiles(root);
12481
- const prefix = workspacePath(directory, `${BIN}${SEPARATOR$16}`);
12482
- return pipe(listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.filter((file) => !isCommandFile(`${BIN}${SEPARATOR$16}${String$1.slice(prefix.length)(file)}`)), Array$1.map((file) => ({
12462
+ const prefix = workspacePath(directory, `${BIN}${SEPARATOR$17}`);
12463
+ return pipe(listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.filter((file) => !isCommandFile(`${BIN}${SEPARATOR$17}${String$1.slice(prefix.length)(file)}`)), Array$1.map((file) => ({
12483
12464
  file: files.join(root, file),
12484
12465
  line: FIRST$16,
12485
12466
  column: FIRST$16,
@@ -12501,14 +12482,14 @@ const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkComm
12501
12482
  ];
12502
12483
  });
12503
12484
  // src/features/check-repository-layout/model/path-mention.ts
12504
- const START$27 = 0;
12485
+ const START$29 = 0;
12505
12486
  const QUOTES = ["\"", "'"];
12506
12487
  const firstIndex = (source, needles) => {
12507
12488
  const found = pipe(needles, Array$1.flatMap((needle) => Option.toArray(String$1.indexOf(needle)(source))));
12508
12489
  return Array$1.head(Array$1.sort(found, Order.Number));
12509
12490
  };
12510
12491
  const quoted = (text) => pipe(QUOTES, Array$1.map((quote) => `${quote}${text}${quote}`));
12511
- const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$27));
12492
+ const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$29));
12512
12493
  // src/features/check-repository-layout/model/cargo-paths.ts
12513
12494
  const MEMBER_LISTS = [
12514
12495
  "members",
@@ -12524,14 +12505,14 @@ const WORKSPACE = "workspace";
12524
12505
  const PATCH = "patch";
12525
12506
  const PATCH_DEPTH = 2;
12526
12507
  const WORKSPACE_DEPTH = 1;
12527
- const START$26 = 0;
12508
+ const START$28 = 0;
12528
12509
  const WILDCARD$4 = /[*?[]/u;
12529
12510
  const KEY_SEPARATOR = ".";
12530
12511
  const decodeTable = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
12531
12512
  const decodeStrings = Schema.decodeUnknownOption(Schema.Array(Schema.String));
12532
12513
  const decodePath = Schema.decodeUnknownOption(Schema.Struct({ path: Schema.String }));
12533
- const declaresPath = (trail) => pipe(Array$1.last(trail), Option.exists((name) => Array$1.contains(DEPENDENCY_TABLES, name))) || trail.length === PATCH_DEPTH && Array$1.get(trail, START$26).pipe(Option.exists((name) => name === PATCH));
12534
- const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$26).pipe(Option.exists((name) => name === WORKSPACE)) && Array$1.contains(MEMBER_LISTS, key);
12514
+ const declaresPath = (trail) => pipe(Array$1.last(trail), Option.exists((name) => Array$1.contains(DEPENDENCY_TABLES, name))) || trail.length === PATCH_DEPTH && Array$1.get(trail, START$28).pipe(Option.exists((name) => name === PATCH));
12515
+ const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$28).pipe(Option.exists((name) => name === WORKSPACE)) && Array$1.contains(MEMBER_LISTS, key);
12535
12516
  const namedPaths = (trail, key, value) => {
12536
12517
  const field = Array$1.join([...trail, key], KEY_SEPARATOR);
12537
12518
  if (listsMembers(trail, key)) return pipe(decodeStrings(value), Option.getOrElse(() => []), Array$1.filter((member) => !WILDCARD$4.test(member)), Array$1.map((member) => ({
@@ -12554,7 +12535,7 @@ const cargoMentions = (source) => pipe(Option.liftThrowable(() => getStaticTOMLV
12554
12535
  })));
12555
12536
  // src/features/check-repository-layout/model/path-existence.ts
12556
12537
  const WILDCARD$3 = /[*?[]/u;
12557
- const SEPARATOR$15 = "/";
12538
+ const SEPARATOR$16 = "/";
12558
12539
  const FIRST$15 = 0;
12559
12540
  /** @internal */
12560
12541
  const existsAt = Effect.fn("existsAt")(function* existsAt(root, path) {
@@ -12570,20 +12551,20 @@ const isDirectoryAt = Effect.fn("isDirectoryAt")(function* isDirectoryAt(root, p
12570
12551
  /** @internal */
12571
12552
  const staticPrefix = (path) => {
12572
12553
  const prefix = Array$1.headNonEmpty(String$1.split(path, WILDCARD$3));
12573
- if (String$1.endsWith(SEPARATOR$15)(prefix)) return String$1.slice(FIRST$15, -1)(prefix);
12554
+ if (String$1.endsWith(SEPARATOR$16)(prefix)) return String$1.slice(FIRST$15, -1)(prefix);
12574
12555
  return prefix;
12575
12556
  };
12576
12557
  /** @internal */
12577
12558
  const isIgnored = Effect.fn("isIgnored")(function* isIgnored(root, path) {
12578
12559
  const prefix = staticPrefix(path);
12579
12560
  if (String$1.isEmpty(prefix)) return false;
12580
- const ignored = yield* (yield* RepositoryFiles).ignoredPaths(root, [prefix, `${prefix}${SEPARATOR$15}`]);
12561
+ const ignored = yield* (yield* RepositoryFiles).ignoredPaths(root, [prefix, `${prefix}${SEPARATOR$16}`]);
12581
12562
  return Array$1.isReadonlyArrayNonEmpty(ignored);
12582
12563
  });
12583
12564
  // src/features/check-repository-layout/model/tsconfig-paths.ts
12584
12565
  const WRAP_OFFSET$2 = 1;
12585
12566
  const WILDCARD$2 = /[*?[{]/u;
12586
- const SEPARATOR$14 = "/";
12567
+ const SEPARATOR$15 = "/";
12587
12568
  const RELATIVE$1 = ".";
12588
12569
  const JSON_EXTENSION = ".json";
12589
12570
  const isObject = (node) => Predicate.isReadonlyObject(node) && node["type"] === "ObjectExpression";
@@ -12591,7 +12572,7 @@ const firstObject = (node) => {
12591
12572
  if (isObject(node)) return Option.some(node);
12592
12573
  return pipe(childrenOf$2(node), Array$1.findFirst(firstObject));
12593
12574
  };
12594
- const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$14), Array$1.takeWhile((segment) => !WILDCARD$2.test(segment)), Array$1.join(SEPARATOR$14));
12575
+ const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$15), Array$1.takeWhile((segment) => !WILDCARD$2.test(segment)), Array$1.join(SEPARATOR$15));
12595
12576
  const listed$2 = (root) => (name, candidatesOf, valuesOf = stringsIn) => pipe(propertyValue(name)(root), Option.toArray, Array$1.flatMap(valuesOf), Array$1.map(({ text, start }) => ({
12596
12577
  field: name,
12597
12578
  text,
@@ -12618,7 +12599,7 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
12618
12599
  ])));
12619
12600
  });
12620
12601
  // src/features/check-repository-layout/model/config-paths.ts
12621
- const RULE$58 = "config-path";
12602
+ const RULE$60 = "config-path";
12622
12603
  const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
12623
12604
  const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
12624
12605
  const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
@@ -12637,7 +12618,7 @@ const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
12637
12618
  const problemOf$9 = (file, source) => (mention) => ({
12638
12619
  file,
12639
12620
  ...positionOf(source)(mention.index),
12640
- rule: RULE$58,
12621
+ rule: RULE$60,
12641
12622
  message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
12642
12623
  });
12643
12624
  const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
@@ -12662,7 +12643,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
12662
12643
  return pipe(patterns, Array$1.map((pattern) => ({
12663
12644
  file,
12664
12645
  ...positionOf(source.value)(indexOfText(source.value)(pattern)),
12665
- rule: RULE$58,
12646
+ rule: RULE$60,
12666
12647
  message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
12667
12648
  })));
12668
12649
  });
@@ -12674,32 +12655,32 @@ const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPath
12674
12655
  return [...Array$1.flatten(found), ...patterns];
12675
12656
  });
12676
12657
  // src/features/check-repository-layout/model/crates.ts
12677
- const RULE$57 = "unverified-crate";
12658
+ const RULE$59 = "unverified-crate";
12678
12659
  const VERSION_RULE = "release-version";
12679
12660
  const APP_DIRECTORIES = ["", "src-tauri"];
12680
12661
  const CARGO_FILE$1 = "Cargo.toml";
12681
- const CONFIG_FILE$6 = "vite.config.ts";
12682
- const SEPARATOR$13 = "/";
12662
+ const CONFIG_FILE$8 = "vite.config.ts";
12663
+ const SEPARATOR$14 = "/";
12683
12664
  const FIRST$14 = 1;
12684
12665
  const READ_CONCURRENCY$20 = 8;
12685
12666
  const problemFor$5 = (crate, message) => ({
12686
12667
  file: crate.manifest,
12687
12668
  line: FIRST$14,
12688
12669
  column: FIRST$14,
12689
- rule: RULE$57,
12670
+ rule: RULE$59,
12690
12671
  message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
12691
12672
  });
12692
12673
  const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
12693
12674
  const files = yield* RepositoryFiles;
12694
12675
  const workspace = owningWorkspace(directories)(files.relative(root, files.dirname(crate.manifest)));
12695
12676
  if (Option.isNone(workspace)) return Option.some(problemFor$5(crate, "is outside every workspace package"));
12696
- if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$6))) return Option.none();
12697
- return Option.some(problemFor$5(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$6} has no verify task`));
12677
+ if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$8))) return Option.none();
12678
+ return Option.some(problemFor$5(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$8} has no verify task`));
12698
12679
  });
12699
12680
  const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemIn(root, directories, crate) {
12700
12681
  const files = yield* RepositoryFiles;
12701
12682
  const directory = files.relative(root, files.dirname(crate.manifest));
12702
- const workspace = pipe(directories, Array$1.findFirst((candidate) => pipe(APP_DIRECTORIES, Array$1.map((inner) => pipe([candidate, inner], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$13))), Array$1.contains(directory))));
12683
+ const workspace = pipe(directories, Array$1.findFirst((candidate) => pipe(APP_DIRECTORIES, Array$1.map((inner) => pipe([candidate, inner], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$14))), Array$1.contains(directory))));
12703
12684
  if (Option.isNone(workspace)) return Option.none();
12704
12685
  const text = yield* files.readFile(files.join(root, workspace.value, PACKAGE_JSON_FILE));
12705
12686
  const version = pipe(text, Option.flatMap(decodePackageJson), Option.flatMap(({ version: own }) => Option.fromUndefinedOr(own)));
@@ -12722,7 +12703,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
12722
12703
  return Array$1.getSomes(Array$1.flatten(found));
12723
12704
  });
12724
12705
  // src/features/check-repository-layout/model/deploy-entry-patterns.ts
12725
- const RULE$56 = "deploy-entry-pattern";
12706
+ const RULE$58 = "deploy-entry-pattern";
12726
12707
  const FALLOW_KEYS = [
12727
12708
  "entry",
12728
12709
  "entryPoints",
@@ -12793,7 +12774,7 @@ const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(request) {
12793
12774
  return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
12794
12775
  file: path,
12795
12776
  ...positionOf(text.value)(start - kind.offset),
12796
- rule: RULE$56,
12777
+ rule: RULE$58,
12797
12778
  message: `${pattern} ${MESSAGE$14}`
12798
12779
  })));
12799
12780
  });
@@ -12826,7 +12807,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
12826
12807
  return Array$1.flatten(found);
12827
12808
  });
12828
12809
  // src/features/check-repository-layout/model/fallow-entries.ts
12829
- const RULE$55 = "listed-entry";
12810
+ const RULE$57 = "listed-entry";
12830
12811
  const ENTRY_KEYS = [
12831
12812
  "entry",
12832
12813
  "entryPoints",
@@ -12834,7 +12815,7 @@ const ENTRY_KEYS = [
12834
12815
  ];
12835
12816
  const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?|\.fallow\/plugins\/[^/]+\.jsonc?)$/u;
12836
12817
  const WILDCARD$1 = /[*?{[]/u;
12837
- const SEPARATOR$12 = "/";
12818
+ const SEPARATOR$13 = "/";
12838
12819
  const WRAP_OFFSET = 1;
12839
12820
  const READ_CONCURRENCY$18 = 8;
12840
12821
  const decodeKey = Schema.decodeUnknownOption(KeySchema);
@@ -12846,7 +12827,7 @@ const entryPatternsIn = (node) => {
12846
12827
  })));
12847
12828
  return pipe(childrenOf$2(node), Array$1.flatMap(entryPatternsIn));
12848
12829
  };
12849
- const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$12}`)(text))) || String$1.includes(SEPARATOR$12)(text) && !WILDCARD$1.test(text);
12830
+ const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$13}`)(text))) || String$1.includes(SEPARATOR$13)(text) && !WILDCARD$1.test(text);
12850
12831
  const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
12851
12832
  const files = yield* RepositoryFiles;
12852
12833
  const path = files.join(root, file);
@@ -12856,7 +12837,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
12856
12837
  return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
12857
12838
  file: path,
12858
12839
  ...positionOf(text.value)(start),
12859
- rule: RULE$55,
12840
+ rule: RULE$57,
12860
12841
  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.`
12861
12842
  })));
12862
12843
  });
@@ -12868,8 +12849,8 @@ const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallow
12868
12849
  return Array$1.flatten(found);
12869
12850
  });
12870
12851
  // src/features/check-repository-layout/model/root-workspace-paths.ts
12871
- const RULE$54 = "root-workspace-path";
12872
- const CONFIG_FILE$5 = "vite.config.ts";
12852
+ const RULE$56 = "root-workspace-path";
12853
+ const CONFIG_FILE$7 = "vite.config.ts";
12873
12854
  const PATH_CHARACTER = /[\w.@/-]/u;
12874
12855
  const NAME_CHARACTER = /[\w.@-]/u;
12875
12856
  const FIRST$13 = 0;
@@ -12887,13 +12868,13 @@ const mentions = (directory) => (text) => {
12887
12868
  const problemsIn$17 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
12888
12869
  file,
12889
12870
  ...positionOf(source)(found.start),
12890
- rule: RULE$54,
12891
- message: `${directory} is a workspace. The root ${CONFIG_FILE$5} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$5}: msch.lint, msch.devDependencies or its verify task.`
12871
+ rule: RULE$56,
12872
+ message: `${directory} is a workspace. The root ${CONFIG_FILE$7} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$7}: msch.lint, msch.devDependencies or its verify task.`
12892
12873
  })));
12893
12874
  /** @internal */
12894
12875
  const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* checkRootWorkspacePaths(root) {
12895
12876
  const files = yield* RepositoryFiles;
12896
- const file = files.join(root, CONFIG_FILE$5);
12877
+ const file = files.join(root, CONFIG_FILE$7);
12897
12878
  const source = yield* files.readFile(file);
12898
12879
  if (Option.isNone(source)) return [];
12899
12880
  const directories = yield* workspaceDirectories(root);
@@ -12901,8 +12882,8 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
12901
12882
  return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$17(file, source.value, directories)));
12902
12883
  });
12903
12884
  // src/features/check-repository-layout/model/hidden-verify.ts
12904
- const RULE$53 = "hidden-verify";
12905
- const CONFIG_FILE$4 = "vite.config.ts";
12885
+ const RULE$55 = "hidden-verify";
12886
+ const CONFIG_FILE$6 = "vite.config.ts";
12906
12887
  const FIRST$12 = 1;
12907
12888
  const READ_CONCURRENCY$17 = 8;
12908
12889
  const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
@@ -12915,8 +12896,8 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
12915
12896
  file,
12916
12897
  line: FIRST$12,
12917
12898
  column: FIRST$12,
12918
- rule: RULE$53,
12919
- message: `${directory} gets its verify task from code outside ${CONFIG_FILE$4}. The root verify reads ${CONFIG_FILE$4} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$4}.`
12899
+ rule: RULE$55,
12900
+ message: `${directory} gets its verify task from code outside ${CONFIG_FILE$6}. The root verify reads ${CONFIG_FILE$6} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$6}.`
12920
12901
  }).pipe(Option.filter(() => verified));
12921
12902
  });
12922
12903
  /** @internal */
@@ -12926,7 +12907,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
12926
12907
  return Array$1.getSomes(found);
12927
12908
  });
12928
12909
  // src/features/check-repository-layout/model/shared-uncached-tasks.ts
12929
- const RULE$52 = "shared-uncached-task";
12910
+ const RULE$54 = "shared-uncached-task";
12930
12911
  const READ_CONCURRENCY$16 = 8;
12931
12912
  const SHARED = 2;
12932
12913
  const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
@@ -12969,7 +12950,7 @@ const problemsOf$3 = (definitions) => {
12969
12950
  return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
12970
12951
  file,
12971
12952
  ...position,
12972
- rule: RULE$52,
12953
+ rule: RULE$54,
12973
12954
  message: `The uncached task ${name} (${command}) is written the same way in ${Array$1.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.`
12974
12955
  })));
12975
12956
  };
@@ -12980,7 +12961,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
12980
12961
  return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
12981
12962
  });
12982
12963
  // src/features/check-repository-layout/model/unlocked-tasks.ts
12983
- const RULE$51 = "unlocked-task";
12964
+ const RULE$53 = "unlocked-task";
12984
12965
  const READ_CONCURRENCY$15 = 8;
12985
12966
  const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
12986
12967
  const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
@@ -12992,7 +12973,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
12992
12973
  const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
12993
12974
  file,
12994
12975
  ...positionOf(source)(task.start),
12995
- rule: RULE$51,
12976
+ rule: RULE$53,
12996
12977
  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.`
12997
12978
  })), Option.toArray)));
12998
12979
  /** @internal */
@@ -13047,7 +13028,7 @@ const scalarsIn = (source) => {
13047
13028
  const ROOT$2 = ".";
13048
13029
  const LOCAL$1 = "./";
13049
13030
  const NEGATION = "!";
13050
- const SEPARATOR$11 = "/";
13031
+ const SEPARATOR$12 = "/";
13051
13032
  const LINE$1 = "\n";
13052
13033
  const UNRESOLVED_MARKERS = [
13053
13034
  "${{",
@@ -13074,7 +13055,7 @@ const withoutLocal = (path) => {
13074
13055
  const joinPath = (base, path) => {
13075
13056
  const relative = withoutLocal(String$1.trim(path));
13076
13057
  if (base === ROOT$2) return relative;
13077
- return `${base}${SEPARATOR$11}${relative}`;
13058
+ return `${base}${SEPARATOR$12}${relative}`;
13078
13059
  };
13079
13060
  const reference = (kind, field, base = ROOT$2) => ({ text, offset }) => {
13080
13061
  const path = String$1.trim(text);
@@ -13147,11 +13128,11 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
13147
13128
  /** @internal */
13148
13129
  const producedPaths = (source) => pipe(jobsOf(source), Array$1.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array$1.flatMap(outputPathsOf));
13149
13130
  // src/features/check-repository-layout/model/workflow-paths.ts
13150
- const RULE$50 = "workflow-path";
13131
+ const RULE$52 = "workflow-path";
13151
13132
  const WORKFLOW_DIRECTORY = ".github/workflows/";
13152
13133
  const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
13153
13134
  const READ_CONCURRENCY$14 = 8;
13154
- const SEPARATOR$10 = "/";
13135
+ const SEPARATOR$11 = "/";
13155
13136
  const EXPECTED = {
13156
13137
  action: "a directory with action.yml",
13157
13138
  directory: "a directory",
@@ -13166,10 +13147,10 @@ const matchesAny = Effect.fn("matchesAny")(function* matchesAny(root, pathspecs)
13166
13147
  });
13167
13148
  const matchesGlob = (root, path) => matchesAny(root, [`:(glob)${path}`]);
13168
13149
  const hasAction = Effect.fn("hasAction")(function* hasAction(root, path) {
13169
- const found = yield* Effect.forEach(ACTION_DEFINITIONS, (name) => existsAt(root, `${path}${SEPARATOR$10}${name}`), { concurrency: 1 });
13150
+ const found = yield* Effect.forEach(ACTION_DEFINITIONS, (name) => existsAt(root, `${path}${SEPARATOR$11}${name}`), { concurrency: 1 });
13170
13151
  return pipe(found, Array$1.some(Boolean));
13171
13152
  });
13172
- const suffixAt = (segments) => (index) => `:(glob)**/${pipe(segments, Array$1.drop(index), Array$1.join(SEPARATOR$10))}`;
13153
+ const suffixAt = (segments) => (index) => `:(glob)**/${pipe(segments, Array$1.drop(index), Array$1.join(SEPARATOR$11))}`;
13173
13154
  const RESOLVERS = {
13174
13155
  action: hasAction,
13175
13156
  directory: isDirectoryAt,
@@ -13177,11 +13158,11 @@ const RESOLVERS = {
13177
13158
  glob: matchesGlob,
13178
13159
  script: Effect.fn("findsScript")(function* findsScript(root, path) {
13179
13160
  if (yield* existsAt(root, path)) return true;
13180
- const segments = String$1.split(path, SEPARATOR$10);
13161
+ const segments = String$1.split(path, SEPARATOR$11);
13181
13162
  return yield* matchesAny(root, Array$1.makeBy(segments.length, suffixAt(segments)));
13182
13163
  })
13183
13164
  };
13184
- const overlaps = (path) => (produced) => produced === path || String$1.startsWith(`${path}${SEPARATOR$10}`)(produced) || String$1.startsWith(`${produced}${SEPARATOR$10}`)(path);
13165
+ const overlaps = (path) => (produced) => produced === path || String$1.startsWith(`${path}${SEPARATOR$11}`)(produced) || String$1.startsWith(`${produced}${SEPARATOR$11}`)(path);
13185
13166
  const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, found) {
13186
13167
  const prefix = staticPrefix(found.path);
13187
13168
  if (pipe(produced, Array$1.some(overlaps(prefix)))) return false;
@@ -13191,7 +13172,7 @@ const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, f
13191
13172
  const problemOf$8 = (file, source) => (found) => ({
13192
13173
  file,
13193
13174
  ...positionOf(source)(found.offset),
13194
- rule: RULE$50,
13175
+ rule: RULE$52,
13195
13176
  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.`
13196
13177
  });
13197
13178
  const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
@@ -13217,9 +13198,9 @@ const ACTION = /^\.github\/actions\/(?<name>[^/]+)\/action\.ya?ml$/u;
13217
13198
  const FILTER_KEYS = ["paths", "paths-ignore"];
13218
13199
  const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
13219
13200
  const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
13220
- const START$25 = 0;
13201
+ const START$27 = 0;
13221
13202
  const READ_CONCURRENCY$13 = 8;
13222
- const SEPARATOR$9 = "/";
13203
+ const SEPARATOR$10 = "/";
13223
13204
  const WORD_SEPARATORS = /[-_]/gu;
13224
13205
  const SPACE = " ";
13225
13206
  const FILTER_MESSAGE = "A workflow that reacts to changes under listed paths needs a new entry for every package and drifts from the packages it is meant to cover. Run the generic pipeline on every push and let it decide from the workspace what changed.";
@@ -13242,13 +13223,13 @@ const pathFiltersIn = (file, source) => {
13242
13223
  };
13243
13224
  const matching = (workspaces, text) => pipe(workspaces, Array$1.findFirst(({ names }) => Array$1.isReadonlyArrayNonEmpty(names) && Option.isSome(String$1.match(patternOf$1(names))(text))), Option.map(({ directory }) => directory));
13244
13225
  const named$1 = (workspaces, text) => Option.orElse(matching(workspaces, text), () => matching(workspaces, String$1.replaceAll(WORD_SEPARATORS, SPACE)(text)));
13245
- const containing = (workspaces, path) => pipe(workspaces, Array$1.findFirst(({ directory }) => path === directory || String$1.startsWith(`${directory}${SEPARATOR$9}`)(path)), Option.map(({ directory }) => directory));
13226
+ const containing = (workspaces, path) => pipe(workspaces, Array$1.findFirst(({ directory }) => path === directory || String$1.startsWith(`${directory}${SEPARATOR$10}`)(path)), Option.map(({ directory }) => directory));
13246
13227
  const namesIn$2 = (name, source) => {
13247
13228
  const root = parseDocument(source).contents;
13248
13229
  return [
13249
13230
  {
13250
13231
  text: name,
13251
- offset: START$25
13232
+ offset: START$27
13252
13233
  },
13253
13234
  ...Option.toArray(stringOf(childOf("name")(root))),
13254
13235
  ...keysOf(childOf("jobs")(root))
@@ -13319,14 +13300,14 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
13319
13300
  });
13320
13301
  // src/shared/lib/package-name.ts
13321
13302
  const SCOPE$1 = "@";
13322
- const SEPARATOR$8 = "/";
13303
+ const SEPARATOR$9 = "/";
13323
13304
  const SCOPED_SEGMENTS = 2;
13324
13305
  const PLAIN_SEGMENTS = 1;
13325
13306
  const segmentCount = (specifier) => {
13326
13307
  if (String$1.startsWith(SCOPE$1)(specifier)) return SCOPED_SEGMENTS;
13327
13308
  return PLAIN_SEGMENTS;
13328
13309
  };
13329
- const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$8), Array$1.take(segmentCount(specifier)), Array$1.join(SEPARATOR$8));
13310
+ const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$9), Array$1.take(segmentCount(specifier)), Array$1.join(SEPARATOR$9));
13330
13311
  // src/features/measure-install-size/model/import-graph.ts
13331
13312
  const RELATIVE = /^\.\.?(?:\/|$)/u;
13332
13313
  const SUBPATH_IMPORT$1 = "#";
@@ -13483,11 +13464,11 @@ const LISTED_LARGEST = 5;
13483
13464
  const SIZE_CONCURRENCY = 32;
13484
13465
  const MEGABYTE = 1e6;
13485
13466
  const MEGABYTE_DIGITS = 1;
13486
- const START$24 = 0;
13467
+ const START$26 = 0;
13487
13468
  const SINGLE_ENTRY = 1;
13488
13469
  const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
13489
13470
  const usageHint = (dependency, entryCount) => {
13490
- if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$24 && dependency.entries.length < entryCount)) return "";
13471
+ if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$26 && dependency.entries.length < entryCount)) return "";
13491
13472
  return ` (imported only from ${Array$1.join(dependency.entries, ", ")})`;
13492
13473
  };
13493
13474
  const listed$1 = ({ largest, entryCount }) => pipe(largest, Array$1.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array$1.join(", "));
@@ -13496,7 +13477,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
13496
13477
  const { workspace, total } = overrun;
13497
13478
  const config = yield* files.readFile(workspace.configFile);
13498
13479
  const source = Option.getOrElse(config, () => "");
13499
- const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$24);
13480
+ const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$26);
13500
13481
  return {
13501
13482
  file: workspace.configFile,
13502
13483
  ...positionOf(source)(index),
@@ -13513,7 +13494,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
13513
13494
  const everything = pipe(closures, Array$1.flatMap(([, packages]) => Array$1.fromIterable(packages)), HashSet.fromIterable);
13514
13495
  const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
13515
13496
  const sizes = HashMap.fromIterable(measured);
13516
- const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$24)), Number$1.sumAll);
13497
+ const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$26)), Number$1.sumAll);
13517
13498
  return {
13518
13499
  closures,
13519
13500
  sizeOf,
@@ -13546,11 +13527,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
13546
13527
  })];
13547
13528
  });
13548
13529
  const stackProblems = (file, source, dependencies) => {
13549
- const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$24);
13530
+ const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$26);
13550
13531
  const rest = String$1.slice(section)(source);
13551
13532
  return pipe(Record.toEntries(dependencies), Array$1.filter(([, specifier]) => specifier === STACK_CATALOG), Array$1.map(([name]) => ({
13552
13533
  file,
13553
- ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$24)),
13534
+ ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$26)),
13554
13535
  rule: STACK_DEPENDENCY,
13555
13536
  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.`
13556
13537
  })));
@@ -13573,7 +13554,7 @@ const problemsOf$1 = Effect.fn("problemsOf")(function* problemsOf(workspace, fil
13573
13554
  }, Record.keys(dependencies));
13574
13555
  return [...stackProblems(file, source, dependencies), ...sized];
13575
13556
  });
13576
- const workspaceProblems$1 = Effect.fn("workspaceProblems")(function* workspaceProblems(workspace) {
13557
+ const workspaceProblems$2 = Effect.fn("workspaceProblems")(function* workspaceProblems(workspace) {
13577
13558
  const files = yield* RepositoryFiles;
13578
13559
  const file = files.join(workspace.directory, PACKAGE_JSON_FILE);
13579
13560
  const source = yield* files.readFile(file);
@@ -13585,11 +13566,11 @@ const workspaceProblems$1 = Effect.fn("workspaceProblems")(function* workspacePr
13585
13566
  /** @internal */
13586
13567
  const checkPublishedPackages = Effect.fn("checkPublishedPackages")(function* checkPublishedPackages(root) {
13587
13568
  const workspaces = yield* publishedWorkspaces(root);
13588
- const found = yield* Effect.forEach(workspaces, workspaceProblems$1, { concurrency: 1 });
13569
+ const found = yield* Effect.forEach(workspaces, workspaceProblems$2, { concurrency: 1 });
13589
13570
  return Array$1.flatten(found);
13590
13571
  });
13591
13572
  // src/features/check-migration-order/model/migration-order.ts
13592
- const RULE$49 = "migration-order";
13573
+ const RULE$51 = "migration-order";
13593
13574
  const SNAPSHOT = "snapshot.json";
13594
13575
  const MIGRATION = "migration.sql";
13595
13576
  const SNAPSHOTS = [`*/${SNAPSHOT}`];
@@ -13623,7 +13604,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
13623
13604
  file: join(root, file),
13624
13605
  line: FIRST$11,
13625
13606
  column: FIRST$11,
13626
- rule: RULE$49,
13607
+ rule: RULE$51,
13627
13608
  message: `${folder} is new, but it sorts before ${latest.folder}, which ${base} already has. A database that has applied ${latest.folder} rejects an earlier migration, so delete ${folder} and generate it again after ${latest.folder}.`
13628
13609
  })))), Option.getOrElse(() => []));
13629
13610
  /** @internal */
@@ -13674,7 +13655,7 @@ const unresolvedFrom = (entries) => Effect.acquireUseRelease(Effect.tryPromise({
13674
13655
  catch: bundleErrorDetail
13675
13656
  }), (bundle) => Effect.promise(() => bundle.close())).pipe(Effect.map(({ output }) => unresolvedIn(pipe(output, Array$1.filter(isChunk$1)))));
13676
13657
  // src/features/check-plugin-dependencies/model/plugin-dependencies.ts
13677
- const RULE$48 = "plugin-dependencies";
13658
+ const RULE$50 = "plugin-dependencies";
13678
13659
  const PLUGIN_FILE$2 = ".claude-plugin/plugin.json";
13679
13660
  const LOCK_FILE = "bun.lock";
13680
13661
  const SOURCE_FILE = /\.[cm]?[jt]sx?$/u;
@@ -13683,7 +13664,7 @@ const SUCCESS$1 = 0;
13683
13664
  const NOT_STARTED = -1;
13684
13665
  const DETAIL_LINES = 3;
13685
13666
  const PLUGIN_CONCURRENCY = 2;
13686
- const problemFor$4 = problemInFile(RULE$48);
13667
+ const problemFor$4 = problemInFile(RULE$50);
13687
13668
  const hasDependencies = Effect.fn("hasDependencies")(function* hasDependencies(directory) {
13688
13669
  const files = yield* RepositoryFiles;
13689
13670
  const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));
@@ -13783,8 +13764,8 @@ const quote = (text) => pipe(Schema.encodeOption(Quoted)(text), Option.getOrElse
13783
13764
  const builtins = new Set(builtinModules);
13784
13765
  const always = () => true;
13785
13766
  const never = () => false;
13786
- const taggedError$5 = Schema.TaggedError;
13787
- var BundleFailed = class extends taggedError$5()("BundleFailed", { detail: Schema.String }) {};
13767
+ const taggedError$6 = Schema.TaggedError;
13768
+ var BundleFailed = class extends taggedError$6()("BundleFailed", { detail: Schema.String }) {};
13788
13769
  const failed = (error) => BundleFailed.make({ detail: bundleErrorDetail(error) });
13789
13770
  const isBare = (specifier) => !String$1.startsWith(RELATIVE_PREFIX)(specifier) && !String$1.startsWith(SUBPATH_IMPORT)(specifier) && !ABSOLUTE.test(specifier) && !String$1.startsWith(VIRTUAL_PREFIX)(specifier);
13790
13771
  const isBuiltin$1 = (specifier) => String$1.startsWith(NODE_PROTOCOL)(specifier) || builtins.has(packageNameOf(specifier));
@@ -13886,24 +13867,24 @@ const bundleScopeOf = ({ manifest, workspace }) => ({
13886
13867
  });
13887
13868
  const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
13888
13869
  // src/features/check-tree-shaking/model/optional-peers.ts
13889
- const RULE$47 = "optional-peer";
13870
+ const RULE$49 = "optional-peer";
13890
13871
  const REQUIRED_RULE = "required-peer";
13891
- const START$23 = 0;
13872
+ const START$25 = 0;
13892
13873
  const SINGLE$1 = 1;
13893
13874
  const DEPENDENCIES_KEY = "\"dependencies\"";
13894
13875
  const PEER_META_KEY = "\"peerDependenciesMeta\"";
13895
13876
  const importsPackage = (name) => ({ packages }) => Array$1.contains(packages, name);
13896
- const labelsOf = (importers) => pipe(importers, Array$1.map(({ entry }) => `\`${entry.label}\``), Array$1.dedupe, Array$1.join(", "));
13877
+ const labelsOf$1 = (importers) => pipe(importers, Array$1.map(({ entry }) => `\`${entry.label}\``), Array$1.dedupe, Array$1.join(", "));
13897
13878
  const positionIn = (located, key, name) => {
13898
- const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$23);
13879
+ const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$25);
13899
13880
  const rest = String$1.slice(section)(located.source);
13900
- return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$23));
13881
+ return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$25));
13901
13882
  };
13902
13883
  const problemFor$3 = (located, name, importers) => ({
13903
13884
  file: located.file,
13904
13885
  ...positionIn(located, DEPENDENCIES_KEY, name),
13905
- rule: RULE$47,
13906
- message: `${name} is imported only from ${labelsOf(importers)}, so installing the other entries must not require it. Move it to peerDependencies, mark it optional in peerDependenciesMeta and keep it in devDependencies.`
13886
+ rule: RULE$49,
13887
+ message: `${name} is imported only from ${labelsOf$1(importers)}, so installing the other entries must not require it. Move it to peerDependencies, mark it optional in peerDependenciesMeta and keep it in devDependencies.`
13907
13888
  });
13908
13889
  const requiredPeerAdvice = (fromStack) => {
13909
13890
  if (fromStack) return "Make it a required peer by removing it from peerDependenciesMeta; it comes from the stack catalog, so every project that installs this package already has it.";
@@ -13917,7 +13898,7 @@ const optionalPeerProblems = ({ located, manifest, used }) => {
13917
13898
  return pipe(Record.keys(manifest.dependencies ?? {}), Array$1.flatMap((name) => {
13918
13899
  const importers = pipe(libraries, Array$1.filter(importsPackage(name)));
13919
13900
  const neededByBin = pipe(bins, Array$1.some(importsPackage(name)));
13920
- if (!(importers.length > START$23 && importers.length < libraries.length) || neededByBin) return [];
13901
+ if (!(importers.length > START$25 && importers.length < libraries.length) || neededByBin) return [];
13921
13902
  return [problemFor$3(located, name, importers)];
13922
13903
  }));
13923
13904
  };
@@ -13933,14 +13914,14 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
13933
13914
  file: located.file,
13934
13915
  ...positionIn(located, PEER_META_KEY, name),
13935
13916
  rule: REQUIRED_RULE,
13936
- message: `${name} is an optional peer, but ${labelsOf(importers)} import it at startup, so installing the package without it breaks them. ${requiredPeerAdvice(Array$1.contains(stack, name))}`
13917
+ message: `${name} is an optional peer, but ${labelsOf$1(importers)} import it at startup, so installing the package without it breaks them. ${requiredPeerAdvice(Array$1.contains(stack, name))}`
13937
13918
  }];
13938
13919
  }));
13939
13920
  };
13940
13921
  // src/features/check-tree-shaking/model/side-effects.ts
13941
- const RULE$46 = "side-effects";
13922
+ const RULE$48 = "side-effects";
13942
13923
  const BUNDLE_CONCURRENCY$2 = 4;
13943
- const START$22 = 0;
13924
+ const START$24 = 0;
13944
13925
  const FIRST$10 = 1;
13945
13926
  const LISTED_PACKAGES = 4;
13946
13927
  const SIDE_EFFECTS_KEY = "\"sideEffects\"";
@@ -13964,7 +13945,7 @@ const memberExcess = Effect.fn("memberExcess")(function* memberExcess({ scope, e
13964
13945
  label: entry.label,
13965
13946
  member,
13966
13947
  ...extra
13967
- }, ({ modules }) => modules > START$22);
13948
+ }, ({ modules }) => modules > START$24);
13968
13949
  });
13969
13950
  const excessOf = Effect.fn("excessOf")(function* excessOf(subject) {
13970
13951
  const names = yield* exportNamesOf(subject.scope, subject.entry.source);
@@ -13986,15 +13967,15 @@ const othersOf = (total) => {
13986
13967
  };
13987
13968
  const messageOf$4 = (worst, total) => `importing \`${worst.member}\` from \`${worst.label}\` also bundles ${String(worst.modules)} modules${importsOf(worst.packages)}, which it does not use.${othersOf(total)} Declare "sideEffects": false in package.json so that a bundler drops what nothing imports, and keep a module that must run for its effect out of the package.`;
13988
13969
  const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
13989
- const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$22));
13970
+ const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$24));
13990
13971
  const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
13991
13972
  file,
13992
13973
  ...positionOf(source)(keyIndex$1(source)),
13993
- rule: RULE$46,
13974
+ rule: RULE$48,
13994
13975
  message: messageOf$4(worst, excesses.length)
13995
13976
  })), Option.toArray);
13996
13977
  // src/features/check-tree-shaking/model/top-level-effects.ts
13997
- const RULE$45 = "top-level-effect";
13978
+ const RULE$47 = "top-level-effect";
13998
13979
  const CODE$1 = /\.[cm]?[jt]sx?$/u;
13999
13980
  const READ_CONCURRENCY$11 = 16;
14000
13981
  const IMPORT_MESSAGE = "imports a module only for its effect, but sideEffects in package.json does not list this file, so a bundler drops the import. Import what the module exports, or list the entry that exists for its effect in sideEffects.";
@@ -14010,7 +13991,7 @@ const messageOf$3 = (statement) => {
14010
13991
  const problemsIn$15 = (api) => (file) => (source) => {
14011
13992
  const retained = api.createSourceFile(file, source);
14012
13993
  const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$7({
14013
- rule: RULE$45,
13994
+ rule: RULE$47,
14014
13995
  message: messageOf$3(statement)
14015
13996
  })(statement)));
14016
13997
  retained.dispose();
@@ -14027,7 +14008,7 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
14027
14008
  return Array$1.flatten(found);
14028
14009
  }, Effect.scoped);
14029
14010
  const BUNDLED_RULE = "bundled-side-effects";
14030
- const START$21 = 0;
14011
+ const START$23 = 0;
14031
14012
  const NAME_KEY$2 = "\"name\"";
14032
14013
  const packageDirectoryOf = (manifests, files) => (module) => {
14033
14014
  const parent = files.dirname(module);
@@ -14044,7 +14025,7 @@ const undeclaredAt = Effect.fn("undeclaredAt")(function* undeclaredAt(directory)
14044
14025
  })));
14045
14026
  });
14046
14027
  const undeclaredMessage = (files, root) => ({ directory, name }) => `bundles modules of \`${name}\`, whose package.json does not declare "sideEffects". A bundler reads that field from the package that owns each module, so it keeps every module that \`${name}\` re-exports, together with what those modules import, even when this package uses none of them. Declare "sideEffects": false in ${files.relative(root, files.join(directory, PACKAGE_JSON_FILE))}, and keep a module that must run for its effect out of that package.`;
14047
- const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$2)(source), Option.getOrElse(() => START$21));
14028
+ const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$2)(source), Option.getOrElse(() => START$23));
14048
14029
  /** @internal */
14049
14030
  const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(function* bundledSideEffectProblems({ root, directory, located, used }) {
14050
14031
  const files = yield* RepositoryFiles;
@@ -14157,7 +14138,7 @@ const analyse = Effect.fn("analyse")(function* analyse(pack) {
14157
14138
  ];
14158
14139
  });
14159
14140
  const bundleProblem$1 = (file, error) => [problemInFile(BUNDLE)(file, `does not bundle for the tree-shaking check. ${error.detail}`)];
14160
- const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProblems(root, workspace) {
14141
+ const workspaceProblems$1 = Effect.fn("workspaceProblems")(function* workspaceProblems(root, workspace) {
14161
14142
  const found = yield* locatedManifest(workspace);
14162
14143
  if (Option.isNone(found)) return [];
14163
14144
  const { file, source, manifest } = found.value;
@@ -14174,11 +14155,11 @@ const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProb
14174
14155
  /** @internal */
14175
14156
  const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShaking(root) {
14176
14157
  const workspaces = yield* packedWorkspaces(root);
14177
- const found = yield* Effect.forEach(workspaces, (workspace) => workspaceProblems(root, workspace), { concurrency: 1 });
14158
+ const found = yield* Effect.forEach(workspaces, (workspace) => workspaceProblems$1(root, workspace), { concurrency: 1 });
14178
14159
  return Array$1.flatten(found);
14179
14160
  });
14180
14161
  // src/features/check-typescript-generation/model/typescript-generation.ts
14181
- const RULE$44 = "legacy-typescript";
14162
+ const RULE$46 = "legacy-typescript";
14182
14163
  const LOCKFILE = "pnpm-lock.yaml";
14183
14164
  const COMPILER = "typescript";
14184
14165
  const CURRENT_MAJOR = 7;
@@ -14209,12 +14190,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
14209
14190
  file,
14210
14191
  line: lineOf$2(source)(legacy.id),
14211
14192
  column: FIRST$9,
14212
- rule: RULE$44,
14193
+ rule: RULE$46,
14213
14194
  message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
14214
14195
  })));
14215
14196
  });
14216
14197
  // src/features/check-worker-bundles/model/worker-bundles.ts
14217
- const RULE$43 = "worker-bundle";
14198
+ const RULE$45 = "worker-bundle";
14218
14199
  const BUNDLE_CONCURRENCY = 4;
14219
14200
  const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
14220
14201
  const CONDITIONS = [
@@ -14225,7 +14206,7 @@ const CONDITIONS = [
14225
14206
  "module",
14226
14207
  "default"
14227
14208
  ];
14228
- const problemFor$2 = problemInFile(RULE$43);
14209
+ const problemFor$2 = problemInFile(RULE$45);
14229
14210
  const problemOf$7 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
14230
14211
  const bundleProblem = (file) => Effect.gen(function* bundle() {
14231
14212
  const built = yield* Effect.tryPromise({
@@ -14254,6 +14235,185 @@ const checkWorkerBundles = Effect.fn("checkWorkerBundles")(function* checkWorker
14254
14235
  const found = yield* Effect.forEach(entries, (entry) => bundleProblem(files.join(root, entry)), { concurrency: BUNDLE_CONCURRENCY });
14255
14236
  return Array$1.getSomes(found);
14256
14237
  });
14238
+ // src/app/check-expectations.ts
14239
+ const OFF = [
14240
+ "off",
14241
+ "allow",
14242
+ 0
14243
+ ];
14244
+ const PrintedConfig = Schema.fromJsonString(Schema.Struct({ rules: Schema.Record(Schema.String, Schema.Unknown) }));
14245
+ const isList$1 = (value) => Array$1.isArray(value);
14246
+ const severityOf$1 = (value) => pipe(Option.some(value), Option.filter(isList$1), Option.flatMap(Array$1.head), Option.getOrElse(() => value));
14247
+ const printedConfig = Effect.fn("printedConfig")(function* printedConfig(root) {
14248
+ const handle = yield* ChildProcess.make("vp", ["lint", "--print-config"], {
14249
+ cwd: root,
14250
+ extendEnv: true,
14251
+ stdin: "ignore"
14252
+ });
14253
+ const text = yield* handle.stdout.pipe(Stream.decodeText(), Stream.mkString);
14254
+ yield* handle.exitCode;
14255
+ return yield* Schema.decodeEffect(PrintedConfig)(text);
14256
+ }, Effect.scoped);
14257
+ const enabledRulesIn = Effect.fn("enabledRulesIn")(function* enabledRulesIn(root) {
14258
+ const printed = yield* printedConfig(root).pipe(Effect.option);
14259
+ return pipe(printed, Option.map(({ rules }) => pipe(Record.toEntries(rules), Array$1.filter(([, value]) => !Array$1.contains(OFF, severityOf$1(value))), Array$1.map(([name]) => name))), Option.getOrElse(() => []), (names) => new Set(names));
14260
+ });
14261
+ /** @internal */
14262
+ const expectationsIn = Effect.fn("expectationsIn")(function* expectationsIn(root) {
14263
+ return {
14264
+ enabledRules: yield* enabledRulesIn(root),
14265
+ text: {
14266
+ ignores: TEXT_IGNORES,
14267
+ builtRuleNames: builtTextRuleNames
14268
+ },
14269
+ markdown: {
14270
+ ignores: MARKDOWN_IGNORES,
14271
+ rules: MARKDOWN_RULES
14272
+ },
14273
+ tasks: MSCH_TASK_COMMANDS,
14274
+ verifyTasks: Record.keys(MSCH_TASK_COMMANDS),
14275
+ secrets: secretsOf()
14276
+ };
14277
+ });
14278
+ // src/app/config-weakenings.ts
14279
+ const PRESET_KEYS = [
14280
+ "categories",
14281
+ "plugins",
14282
+ "jsPlugins",
14283
+ "rules",
14284
+ "options",
14285
+ "settings"
14286
+ ];
14287
+ const ENABLED = ["error", "deny"];
14288
+ const SEVERITY_ONLY = 1;
14289
+ const MSCH_RELAXATIONS = [
14290
+ { "react/jsx-props-no-spreading": "off" },
14291
+ { "import/no-default-export": "off" },
14292
+ decisionTestRules
14293
+ ];
14294
+ const isList = (value) => Array$1.isArray(value);
14295
+ const isSection = (value) => Predicate.isObject(value) && !Array$1.isArray(value);
14296
+ const sectionOf = (value) => pipe(Option.some(value), Option.filter(isSection), Option.getOrElse(() => ({})));
14297
+ const listOf = (value) => pipe(Option.some(value), Option.filter(isList), Option.getOrElse(() => []));
14298
+ const severityOf = (value) => pipe(listOf(value), Array$1.head, Option.getOrElse(() => value));
14299
+ const hasOptions = (value) => Array$1.length(listOf(value)) > SEVERITY_ONLY;
14300
+ const unless = (kept, weakening) => Array$1.filter([weakening], () => !kept);
14301
+ const whenPresent = (what, weakeningsIn) => (value) => Option.match(Option.fromUndefinedOr(value), {
14302
+ onNone: () => [{
14303
+ anchor: "defineConfig",
14304
+ message: `vite.config.ts has no ${what}. Spread repositoryConfig from @r_masseater/msch/config into defineConfig.`
14305
+ }],
14306
+ onSome: (present) => weakeningsIn(sectionOf(present))
14307
+ });
14308
+ const presetDifferences = (lint) => pipe(PRESET_KEYS, Array$1.filter((key) => !Equal.equals(lint[key], lint$3[key])), Array$1.map((key) => ({
14309
+ anchor: "lint",
14310
+ message: `lint.${key} differs from the msch preset. Leave the lint section as repositoryConfig builds it; to add a rule, pass it in overrides or a workspace's msch.lint.overrides.`
14311
+ })));
14312
+ const isPresetOverride = (override) => pipe(lint$3.overrides, Array$1.some((built) => Equal.equals(built, override)));
14313
+ const isMschRelaxation = (override) => pipe(MSCH_RELAXATIONS, Array$1.some((rules) => Equal.equals(rules, override["rules"])));
14314
+ const ruleWeakening = (enabledRules) => ([name, value]) => [...unless(Array$1.contains(ENABLED, severityOf(value)), {
14315
+ anchor: name,
14316
+ message: `An override sets ${name} to ${String(severityOf(value))}. Rules are not turned off in a repository that uses msch: fix what the rule reports, or fix the rule in msch.`
14317
+ }), ...unless(!(hasOptions(value) && enabledRules.has(name)), {
14318
+ anchor: name,
14319
+ message: `An override changes the options of ${name}, which the msch preset already sets. Options of preset rules are not changed per file: fix what the rule reports, or change the rule in msch.`
14320
+ })];
14321
+ const overrideWeakenings = (enabledRules) => (override) => {
14322
+ const section = sectionOf(override);
14323
+ const builtByMsch = isPresetOverride(override) || isMschRelaxation(section);
14324
+ return pipe(Record.toEntries(sectionOf(section["rules"])), Array$1.filter(() => !builtByMsch), Array$1.flatMap(ruleWeakening(enabledRules)));
14325
+ };
14326
+ const lintWeakenings = (enabledRules) => whenPresent("lint section, so the msch preset does not run", (section) => [
14327
+ ...presetDifferences(section),
14328
+ ...unless(Equal.equals(section["ignorePatterns"], exempt), {
14329
+ anchor: "ignorePatterns",
14330
+ message: "lint.ignorePatterns differs from the files msch exempts (generated files, fixtures and upstream code). Files are not taken out of lint in a repository that uses msch."
14331
+ }),
14332
+ ...pipe(listOf(section["overrides"]), Array$1.flatMap(overrideWeakenings(enabledRules)))
14333
+ ]);
14334
+ const isOff = (value) => value === false || pipe(Record.values(sectionOf(value)), Array$1.some(isOff));
14335
+ const textRuleWeakenings = (expected) => (owner, rules) => [...pipe(expected.builtRuleNames, Array$1.filter((name) => !Record.has(rules, name)), Array$1.map((name) => ({
14336
+ anchor: "textlint",
14337
+ message: `${owner} does not run ${name}, which msch sets. Leave the textlint section as repositoryConfig builds it.`
14338
+ }))), ...pipe(Record.toEntries(rules), Array$1.filter(([, value]) => isOff(value)), Array$1.map(([name]) => ({
14339
+ anchor: name,
14340
+ message: `${owner} turns off ${name} or one of its rules. Rules are not turned off in a repository that uses msch: rewrite the text, or fix the rule in msch.`
14341
+ })))];
14342
+ const textWeakenings = (expected) => whenPresent("textlint section, so the Japanese text checks do not run", (section) => [
14343
+ ...unless(Equal.equals(section["ignores"], expected.ignores), {
14344
+ anchor: "ignores",
14345
+ message: "textlint.ignores differs from the files msch exempts. Files are not taken out of the text checks in a repository that uses msch."
14346
+ }),
14347
+ ...textRuleWeakenings(expected)("textlint", sectionOf(section["rules"])),
14348
+ ...pipe(listOf(section["sources"]), Array$1.flatMap((source) => textRuleWeakenings(expected)("A textlint source", sectionOf(sectionOf(source)["rules"]))))
14349
+ ]);
14350
+ const markdownWeakenings = (expected) => whenPresent("y8 section, so the Markdown checks do not run", (section) => [...unless(Equal.equals(section["ignores"], expected.ignores), {
14351
+ anchor: "ignores",
14352
+ message: "y8.ignores differs from the files msch exempts. Files are not taken out of the Markdown checks in a repository that uses msch."
14353
+ }), ...unless(Equal.equals(section["rules"], expected.rules), {
14354
+ anchor: "y8",
14355
+ message: "y8.rules differs from what markdownOf builds. Markdown rules are not turned off or changed in a repository that uses msch."
14356
+ })]);
14357
+ const taskWeakenings = (run, expected) => {
14358
+ const tasks = sectionOf(sectionOf(run)["tasks"]);
14359
+ const dependsOn = listOf(sectionOf(tasks["verify"])["dependsOn"]);
14360
+ return [...pipe(Record.toEntries(expected.tasks), Array$1.filter(([name, command]) => !Equal.equals(sectionOf(tasks[name])["command"], command)), Array$1.map(([name]) => ({
14361
+ anchor: "run",
14362
+ message: `The ${name} task does not run what msch builds for it. Leave msch's tasks as repositoryConfig builds them; add other work under another task name.`
14363
+ }))), ...pipe(expected.verifyTasks, Array$1.filter((name) => !Array$1.contains(dependsOn, name)), Array$1.map((name) => ({
14364
+ anchor: "verify",
14365
+ message: `verify does not run the ${name} task. Leave verify as repositoryConfig builds it.`
14366
+ })))];
14367
+ };
14368
+ const secretWeakenings = (h56m, expected) => unless(Equal.equals(h56m, expected), {
14369
+ anchor: "h56m",
14370
+ message: "h56m differs from what secretsOf builds. Findings and files are not taken out of the secret scan in a repository that uses msch: remove the value, or fix the scan in msch when the value is public."
14371
+ });
14372
+ /** @internal */
14373
+ const weakeningsOf = (expected) => (config) => [
14374
+ ...lintWeakenings(expected.enabledRules)(config.lint),
14375
+ ...textWeakenings(expected.text)(config.textlint),
14376
+ ...markdownWeakenings(expected.markdown)(config.y8),
14377
+ ...taskWeakenings(config.run, expected),
14378
+ ...secretWeakenings(config.h56m, expected.secrets)
14379
+ ];
14380
+ // src/app/disabled-rules.ts
14381
+ const RULE$44 = "disabled-rule";
14382
+ const CONFIG_FILE$5 = "vite.config.ts";
14383
+ const START$22 = 0;
14384
+ const SIDE_CONFIG = /(?:^|\/)(?:\.oxlintrc(?:\.jsonc?)?|oxlint\.config\.[cm]?[jt]s|\.oxlintignore|\.eslintrc(?:\.\w+)?|eslint\.config\.[cm]?[jt]s|\.eslintignore|\.textlintrc(?:\.\w+)?|\.textlintignore|\.markdownlint(?:-cli2)?(?:\.\w+)?|\.markdownlintignore|\.prettierignore|\.oxfmtrc(?:\.jsonc?)?|knip\.jsonc?)$/u;
14385
+ const SIDE_CONFIG_MESSAGE = "This file configures a check outside vite.config.ts, where msch cannot see whether it turns rules off. Delete it; msch builds every check setting in vite.config.ts.";
14386
+ const taggedError$5 = Schema.TaggedError;
14387
+ var DisabledRulesConfigUnreadable = class extends taggedError$5()("DisabledRulesConfigUnreadable", {
14388
+ file: Schema.String,
14389
+ reason: Schema.String
14390
+ }) {};
14391
+ const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
14392
+ const files = yield* RepositoryFiles;
14393
+ const listed = yield* files.listedFiles(root);
14394
+ const isExempt = matcher(exempt);
14395
+ return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$44)(files.join(root, name), "")(START$22, SIDE_CONFIG_MESSAGE)));
14396
+ });
14397
+ const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
14398
+ const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$5);
14399
+ const config = yield* Effect.tryPromise({
14400
+ try: () => resolveConfigFromFile(file),
14401
+ catch: (error) => DisabledRulesConfigUnreadable.make({
14402
+ file,
14403
+ reason: String(error)
14404
+ })
14405
+ });
14406
+ const expected = yield* expectationsIn(root);
14407
+ const at = problemAtIndex(RULE$44)(file, source);
14408
+ return pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$22), message)));
14409
+ });
14410
+ /** @internal */
14411
+ const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabledRules(root) {
14412
+ const files = yield* RepositoryFiles;
14413
+ const text = yield* files.readFile(files.join(root, CONFIG_FILE$5));
14414
+ if (Option.isNone(text)) return [];
14415
+ return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$44)(file, "")(START$22, `msch could not load this file: ${reason}`)]))), ...yield* sideConfigs(root)];
14416
+ });
14257
14417
  // src/app/build-checks.ts
14258
14418
  /** @internal */
14259
14419
  const checkBuilds = Effect.fn("checkBuilds")(function* checkBuilds(root) {
@@ -14262,7 +14422,8 @@ const checkBuilds = Effect.fn("checkBuilds")(function* checkBuilds(root) {
14262
14422
  checkWorkerBundles(root),
14263
14423
  checkTreeShaking(root),
14264
14424
  checkMigrationOrder(root),
14265
- checkPluginDependencies(root)
14425
+ checkPluginDependencies(root),
14426
+ checkDisabledRules(root)
14266
14427
  ], { concurrency: "unbounded" });
14267
14428
  return Array$1.flatten(found);
14268
14429
  });
@@ -14347,7 +14508,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
14347
14508
  imports: importedFilesOf(checker)(sourceFile)
14348
14509
  })), Array$1.filter((facts) => Array$1.isReadonlyArrayNonEmpty(facts.values) || Array$1.isReadonlyArrayNonEmpty(facts.imports)));
14349
14510
  // src/features/check-value-owners/model/name-lists.ts
14350
- const RULE$42 = "hand-written-names";
14511
+ const RULE$43 = "hand-written-names";
14351
14512
  const TEST_FILE$1 = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
14352
14513
  const nameListOf = (site) => {
14353
14514
  if (TEST_FILE$1.test(site.file) || site.values.length < 2) return Option.none();
@@ -14362,7 +14523,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
14362
14523
  file,
14363
14524
  line,
14364
14525
  column,
14365
- rule: RULE$42,
14526
+ rule: RULE$43,
14366
14527
  message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
14367
14528
  });
14368
14529
  const problemOf$6 = ({ list, reason }) => listedProblem({
@@ -14968,7 +15129,7 @@ const declaredNameProblem = ({ literals, relative }) => {
14968
15129
  const PATH_PREFIX = /^(?:!|\.\/)+/u;
14969
15130
  const GLOB = /[*?{[]/u;
14970
15131
  const EXTENSION$1 = /\.[^./]+$/u;
14971
- const SEPARATOR$7 = "/";
15132
+ const SEPARATOR$8 = "/";
14972
15133
  const ROOT$1 = ".";
14973
15134
  const namedPath = (repository, file) => (name) => {
14974
15135
  const bare = pipe(name, String$1.replace(PATH_PREFIX, ""));
@@ -14977,12 +15138,12 @@ const namedPath = (repository, file) => (name) => {
14977
15138
  return pipe([fromFile, bare], Array$1.findFirst((path) => HashSet.has(repository.paths, path)));
14978
15139
  };
14979
15140
  const kindOf = (repository) => (path) => {
14980
- if (HashSet.has(repository.directories, path)) return SEPARATOR$7;
15141
+ if (HashSet.has(repository.directories, path)) return SEPARATOR$8;
14981
15142
  return pipe(path, String$1.match(EXTENSION$1), Option.flatMap(Array$1.head), Option.getOrElse(() => path));
14982
15143
  };
14983
15144
  const siblingsOf = (repository) => (path) => pipe(Record.get(repository.entries, repository.dirname(path)), Option.getOrElse(() => []), Array$1.filter((entry) => kindOf(repository)(entry) === kindOf(repository)(path)));
14984
15145
  const coversDirectory = (repository) => (group) => pipe(Array$1.head(group), Option.exists((first) => group.length >= Math.max(2, siblingsOf(repository)(first).length - 1)));
14985
- const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array$1.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$7}${kindOf(repository)(path)}`), Record.values, Array$1.findFirst(coversDirectory(repository)), Option.flatMap(Array$1.head), Option.map(repository.dirname));
15146
+ const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array$1.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$8}${kindOf(repository)(path)}`), Record.values, Array$1.findFirst(coversDirectory(repository)), Option.flatMap(Array$1.head), Option.map(repository.dirname));
14986
15147
  const directoryLabel = (directory) => {
14987
15148
  if (directory === ROOT$1) return "the repository root";
14988
15149
  return directory;
@@ -15034,11 +15195,11 @@ const handWrittenNameProblems = ({ repository, literals }) => (sites) => {
15034
15195
  return pipe(lists, Array$1.map((list) => Array$1.findFirst(checks, (check) => check(list))), Array$1.getSomes);
15035
15196
  };
15036
15197
  // src/features/check-value-owners/model/repository-names.ts
15037
- const SEPARATOR$6 = "/";
15198
+ const SEPARATOR$7 = "/";
15038
15199
  const FIRST_SEGMENT = 1;
15039
15200
  const prefixesOf = (file) => {
15040
- const segments = pipe(file, String$1.split(SEPARATOR$6));
15041
- return pipe(Array$1.range(FIRST_SEGMENT, segments.length), Array$1.map((count) => pipe(Array$1.take(segments, count), Array$1.join(SEPARATOR$6))));
15201
+ const segments = pipe(file, String$1.split(SEPARATOR$7));
15202
+ return pipe(Array$1.range(FIRST_SEGMENT, segments.length), Array$1.map((count) => pipe(Array$1.take(segments, count), Array$1.join(SEPARATOR$7))));
15042
15203
  };
15043
15204
  const directoriesOf$1 = (file) => pipe(prefixesOf(file), Array$1.dropRight(FIRST_SEGMENT));
15044
15205
  const nameOf = (text) => pipe(text, Option.flatMap(decodePackageJson), Option.flatMap((parsed) => Option.fromUndefinedOr(parsed.name)));
@@ -15153,7 +15314,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
15153
15314
  return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
15154
15315
  }, Effect.scoped);
15155
15316
  // src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
15156
- const RULE$41 = "namespace-destructuring";
15317
+ const RULE$42 = "namespace-destructuring";
15157
15318
  const LOCAL = /^[.#/]/u;
15158
15319
  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.`;
15159
15320
  const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
@@ -15169,7 +15330,7 @@ const destructuredName = (declaration) => {
15169
15330
  return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
15170
15331
  };
15171
15332
  const problemOf$5 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$7({
15172
- rule: RULE$41,
15333
+ rule: RULE$42,
15173
15334
  message: messageOf$1(name)
15174
15335
  })), Option.map((report) => report(declaration)));
15175
15336
  const namespaceDestructuringIn = () => (sourceFile) => {
@@ -15177,7 +15338,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
15177
15338
  return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$5(names)), Array$1.getSomes);
15178
15339
  };
15179
15340
  // src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
15180
- const RULE$40 = "pass-through-wrapper";
15341
+ const RULE$41 = "pass-through-wrapper";
15181
15342
  const SINGLE_STATEMENT = 1;
15182
15343
  const SINGLE_DECLARATION = 1;
15183
15344
  const THIS_PARAMETER = "this";
@@ -15274,7 +15435,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
15274
15435
  const problemOf$4 = (checker) => (candidate) => {
15275
15436
  if (changesTheCall(candidate.wrapper)) return Option.none();
15276
15437
  return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$7({
15277
- rule: RULE$40,
15438
+ rule: RULE$41,
15278
15439
  message: messageOf(forward.callee.getText())
15279
15440
  })(candidate.name)));
15280
15441
  };
@@ -15282,9 +15443,24 @@ const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(so
15282
15443
  // src/app/source-checks.ts
15283
15444
  /** @internal */
15284
15445
  const checkSources = (root) => checkRepository(root, [passThroughWrappersIn, namespaceDestructuringIn]);
15446
+ // src/shared/lib/repository-origin.ts
15447
+ const ORIGIN = /[:/](?<owner>[^/:]+)\/(?<name>[^/]+?)(?:\.git)?\/?$/u;
15448
+ /** @internal */
15449
+ const originOf = (url) => pipe(Option.fromNullishOr(ORIGIN.exec(url)), Option.flatMap(({ groups }) => Option.fromNullishOr(groups)), Option.flatMap(({ owner, name }) => Option.all({
15450
+ owner: Option.fromNullishOr(owner),
15451
+ name: Option.fromNullishOr(name)
15452
+ })));
15453
+ /** @internal */
15454
+ const repositoryOrigin = Effect.fn("repositoryOrigin")(function* repositoryOrigin(root) {
15455
+ const url = yield* (yield* RepositoryFiles).originUrl(root);
15456
+ return pipe(url, Option.flatMap(originOf));
15457
+ });
15458
+ /** @internal */
15459
+ const slugOf = ({ owner, name }) => `${owner}/${name}`;
15285
15460
  // src/features/check-agent-settings/model/known-plugins.ts
15286
- const RULE$39 = "known-plugins";
15461
+ const RULE$40 = "known-plugins";
15287
15462
  const SETTINGS_FILE$2 = ".claude/settings.json";
15463
+ const MARKETPLACE_FILE$2 = ".claude-plugin/marketplace.json";
15288
15464
  const GITHUB$2 = "github";
15289
15465
  const Source$1 = Schema.Struct({
15290
15466
  source: Schema.String,
@@ -15298,39 +15474,47 @@ const SettingsSchema$1 = Schema.Struct({
15298
15474
  enabledPlugins: Schema.optionalKey(Plugins$1)
15299
15475
  });
15300
15476
  const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(SettingsSchema$1));
15301
- const problem$5 = problemInFile(RULE$39);
15302
- const fromGithub = (repository) => ({ source }) => source.source === GITHUB$2 && source.repo === repository;
15303
- const marketplaceKnown = (marketplace, settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(marketplace.name)), Option.exists(fromGithub(marketplace.repository)));
15477
+ const MarketplaceSchema = Schema.Struct({
15478
+ name: Schema.String,
15479
+ plugins: Schema.Array(Schema.Struct({ name: Schema.String }))
15480
+ });
15481
+ const decodeMarketplace = Schema.decodeUnknownOption(Schema.fromJsonString(MarketplaceSchema));
15482
+ const problem$5 = problemInFile(RULE$40);
15483
+ const knownFrom = (repository, marketplace, settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(marketplace.name)), Option.exists(({ source }) => source.source === GITHUB$2 && source.repo === repository));
15304
15484
  const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
15305
- const marketplaceProblems = (marketplace, file, settings) => {
15306
- if (marketplaceKnown(marketplace, settings)) return [];
15307
- return [problem$5(file, `Agents miss the owner's own tools when the ${marketplace.name} marketplace is not known. Add "extraKnownMarketplaces": { "${marketplace.name}": { "source": { "source": "${GITHUB$2}", "repo": "${marketplace.repository}" } } }.`)];
15308
- };
15309
15485
  const pluginProblems = (marketplace, file, settings) => {
15310
15486
  const enabled = pluginEnabled(settings);
15311
- return pipe(marketplace.plugins, Array$1.map((name) => `${name}@${marketplace.name}`), Array$1.filter((plugin) => !enabled(plugin)), Array$1.map((plugin) => problem$5(file, `Enable "${plugin}" in "enabledPlugins" so every session gets it.`)));
15487
+ return pipe(marketplace.plugins, Array$1.map(({ name }) => `${name}@${marketplace.name}`), Array$1.filter((plugin) => !enabled(plugin)), Array$1.map((plugin) => problem$5(file, `The settings know this repository's own ${marketplace.name} marketplace but leave "${plugin}" off. Enable it in "enabledPlugins" so every session here gets it.`)));
15312
15488
  };
15313
15489
  /** @internal */
15314
15490
  const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlugins(root) {
15315
15491
  const files = yield* RepositoryFiles;
15316
- const { marketplace } = yield* ownerSettings(root);
15492
+ const origin = yield* repositoryOrigin(root);
15493
+ const manifest = yield* files.readFile(files.join(root, MARKETPLACE_FILE$2));
15317
15494
  const file = files.join(root, SETTINGS_FILE$2);
15318
15495
  const text = yield* files.readFile(file);
15319
15496
  const settings = pipe(text, Option.flatMap(decodeSettings$1), Option.getOrElse(() => ({})));
15320
- return [...marketplaceProblems(marketplace, file, settings), ...pluginProblems(marketplace, file, settings)];
15497
+ const marketplace = pipe(manifest, Option.flatMap(decodeMarketplace));
15498
+ return pipe(Option.all({
15499
+ origin,
15500
+ marketplace
15501
+ }), Option.filter(({ origin: found, marketplace: listed }) => knownFrom(slugOf(found), listed, settings)), Option.match({
15502
+ onNone: () => [],
15503
+ onSome: ({ marketplace: listed }) => pluginProblems(listed, file, settings)
15504
+ }));
15321
15505
  });
15322
15506
  // src/features/check-agent-settings/model/missing-hooks.ts
15323
- const RULE$38 = "missing-hook";
15507
+ const RULE$39 = "missing-hook";
15324
15508
  const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
15325
15509
  const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
15326
15510
  const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
15327
15511
  const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
15328
15512
  const PLUGIN_ROOT = "..";
15329
15513
  const READ_CONCURRENCY$10 = 16;
15330
- const START$20 = 0;
15514
+ const START$21 = 0;
15331
15515
  const referenceOf$1 = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
15332
15516
  path,
15333
- index: found.index ?? START$20
15517
+ index: found.index ?? START$21
15334
15518
  })), Option.toArray);
15335
15519
  const referencesIn = (pattern, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.flatMap(referenceOf$1));
15336
15520
  const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
@@ -15345,7 +15529,7 @@ const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
15345
15529
  return pipe(missing, Array$1.map(({ path, index }) => ({
15346
15530
  file,
15347
15531
  ...positionOf(source)(index),
15348
- rule: RULE$38,
15532
+ rule: RULE$39,
15349
15533
  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.`
15350
15534
  })));
15351
15535
  });
@@ -15398,7 +15582,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
15398
15582
  }, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
15399
15583
  const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
15400
15584
  // src/features/check-documented-commands/model/commands.ts
15401
- const RULE$37 = "documented-commands";
15585
+ const RULE$38 = "documented-commands";
15402
15586
  const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
15403
15587
  const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
15404
15588
  const COMMAND = /`vp run (?<args>[^`]+)`/gu;
@@ -15407,7 +15591,7 @@ const ARGS = "args";
15407
15591
  const PLACEHOLDER = /[<>*{}$]/u;
15408
15592
  const WHITESPACE = /\s+/u;
15409
15593
  const ROOT = ".";
15410
- const SEPARATOR$5 = "/";
15594
+ const SEPARATOR$6 = "/";
15411
15595
  const END_OF_OPTIONS = "--";
15412
15596
  const FLAG = "-";
15413
15597
  const TASK_SEPARATOR$1 = "#";
@@ -15417,7 +15601,7 @@ const FILTER_ASSIGNMENT = "--filter=";
15417
15601
  const RECURSIVE_FLAGS = /* @__PURE__ */ new Set(["-r", "--recursive"]);
15418
15602
  const ROOT_FLAGS = /* @__PURE__ */ new Set(["-w", "--workspace-root"]);
15419
15603
  const ONE$1 = 1;
15420
- const START$19 = 0;
15604
+ const START$20 = 0;
15421
15605
  const optionsOf = (args) => pipe(String$1.split(String$1.trim(args), WHITESPACE), Array$1.takeWhile((token) => token !== END_OF_OPTIONS));
15422
15606
  const filterOf = (tokens) => pipe(tokens, Array$1.findFirstIndex((token) => FILTER_FLAGS.has(token)), Option.flatMap((index) => Array$1.get(tokens, index + ONE$1)), Option.orElse(() => pipe(tokens, Array$1.findFirst(String$1.startsWith(FILTER_ASSIGNMENT)), Option.map(String$1.slice(9)))));
15423
15607
  const follows = (tokens) => (index) => pipe(Array$1.get(tokens, index - ONE$1), Option.exists((previous) => FILTER_FLAGS.has(previous)));
@@ -15454,8 +15638,8 @@ const parsed = (args) => {
15454
15638
  return pipe(specifierOf(tokens), Option.filter(() => !pipe(tokens, Array$1.some((token) => PLACEHOLDER.test(token)))), Option.map(invocationOf(tokens)));
15455
15639
  };
15456
15640
  const ancestorsOf$1 = (file) => {
15457
- const parts = pipe(String$1.split(file, SEPARATOR$5), Array$1.dropRight(ONE$1));
15458
- return [...Array$1.makeBy(parts.length, (index) => pipe(parts, Array$1.take(parts.length - index), Array$1.join(SEPARATOR$5))), ROOT];
15641
+ const parts = pipe(String$1.split(file, SEPARATOR$6), Array$1.dropRight(ONE$1));
15642
+ return [...Array$1.makeBy(parts.length, (index) => pipe(parts, Array$1.take(parts.length - index), Array$1.join(SEPARATOR$6))), ROOT];
15459
15643
  };
15460
15644
  const named = (graph, name) => (directory) => directory === String$1.replace(LOCAL_PREFIX$1, "")(name) || pipe(Record.get(graph.packages, directory), Option.exists((found) => found.name === name));
15461
15645
  const packagesOf = (graph, file) => (scope) => {
@@ -15475,11 +15659,11 @@ const whereOf = (scope, file) => {
15475
15659
  const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph, file)(scope), Array$1.some(hasTask(graph, task)));
15476
15660
  const problemsIn$13 = (graph, absolute, { file, text }) => pipe(Array$1.fromIterable(String$1.matchAll(COMMAND)(text)), Array$1.flatMap((match) => pipe(Option.fromNullishOr(match.groups), Option.flatMap(Record.get(ARGS)), Option.flatMap(parsed), Option.filter(isMissing(graph, file)), Option.map(({ task, scope }) => ({
15477
15661
  file: absolute(file),
15478
- ...positionOf(text)(match.index ?? START$19),
15479
- rule: RULE$37,
15480
- message: `${match[START$19]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
15662
+ ...positionOf(text)(match.index ?? START$20),
15663
+ rule: RULE$38,
15664
+ message: `${match[START$20]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
15481
15665
  })), Option.toArray)));
15482
- const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$5), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
15666
+ const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$6), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
15483
15667
  /** @internal */
15484
15668
  const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* checkDocumentedCommands(root) {
15485
15669
  const files = yield* RepositoryFiles;
@@ -15501,14 +15685,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
15501
15685
  file: absolute(Array$1.headNonEmpty(commanded).file),
15502
15686
  line: ONE$1,
15503
15687
  column: ONE$1,
15504
- rule: RULE$37,
15688
+ rule: RULE$38,
15505
15689
  message: "msch could not list the tasks with `vp run --json`"
15506
15690
  }],
15507
15691
  onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$13(found, absolute, document)))
15508
15692
  });
15509
15693
  });
15510
15694
  // src/features/check-legacy-web/model/legacy-web.ts
15511
- const RULE$36 = "legacy-web";
15695
+ const RULE$37 = "legacy-web";
15512
15696
  const FIRST_COLUMN$3 = 1;
15513
15697
  const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
15514
15698
  const Finding = Schema.Struct({
@@ -15547,7 +15731,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
15547
15731
  file: files.join(root, file),
15548
15732
  line,
15549
15733
  column: FIRST_COLUMN$3,
15550
- rule: RULE$36,
15734
+ rule: RULE$37,
15551
15735
  message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
15552
15736
  });
15553
15737
  return pipe(scan.guides, Array$1.flatMap(({ guideId, rules }) => pipe(rules, Array$1.flatMap(({ ruleId, findings }) => pipe(findings, Array$1.map(problemOf(guideId, ruleId)))))));
@@ -15555,7 +15739,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
15555
15739
  // src/shared/lib/section-check.ts
15556
15740
  const taggedError$4 = Schema.TaggedError;
15557
15741
  var SectionConfigUnreadable = class extends taggedError$4()("SectionConfigUnreadable", { file: Schema.String }) {};
15558
- const CONFIG_FILE$3 = "vite.config.ts";
15742
+ const CONFIG_FILE$4 = "vite.config.ts";
15559
15743
  const FIRST$8 = 1;
15560
15744
  const ONE = 1;
15561
15745
  const diagnostics = Metric.counter("lint.diagnostics", { description: "Diagnostics that each lint rule reported, before msch keeps only the errors" });
@@ -15577,7 +15761,7 @@ const sectionAt = (file, pick) => Effect.gen(function* readSection() {
15577
15761
  });
15578
15762
  const checkSection = (check) => (root) => Effect.gen(function* runSection() {
15579
15763
  const files = yield* RepositoryFiles;
15580
- const configFile = files.join(root, CONFIG_FILE$3);
15764
+ const configFile = files.join(root, CONFIG_FILE$4);
15581
15765
  const section = yield* sectionAt(configFile, check.pick);
15582
15766
  if (Option.isNone(section)) return [];
15583
15767
  const config = section.value;
@@ -15618,7 +15802,7 @@ const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|
15618
15802
  const EXTENSION = /\.[^./]+$/u;
15619
15803
  const SETTINGS_FILE = ".claude/settings.json";
15620
15804
  const READ_CONCURRENCY$9 = 64;
15621
- const RULE$35 = "shell-script";
15805
+ const RULE$36 = "shell-script";
15622
15806
  const MESSAGE$13 = "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.";
15623
15807
  const HookSchema = Schema.Struct({
15624
15808
  command: Schema.optional(Schema.String),
@@ -15651,7 +15835,7 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
15651
15835
  };
15652
15836
  const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
15653
15837
  const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$9 });
15654
- return pipe(shell, Array$1.map((name) => problemInFile(RULE$35)(files.join(root, name), MESSAGE$13)));
15838
+ return pipe(shell, Array$1.map((name) => problemInFile(RULE$36)(files.join(root, name), MESSAGE$13)));
15655
15839
  });
15656
15840
  // src/shared/lib/workflow-files.ts
15657
15841
  const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
@@ -15670,8 +15854,8 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
15670
15854
  });
15671
15855
  // src/shared/lib/workflow-run.ts
15672
15856
  const RUN_KEY = "run";
15673
- const START$18 = 0;
15674
- const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$18));
15857
+ const START$19 = 0;
15858
+ const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$19));
15675
15859
  const runScriptsOf = (source) => {
15676
15860
  const found = [];
15677
15861
  visit(parseDocument(source), { Pair: (_key, pair) => {
@@ -15686,7 +15870,7 @@ const runScriptsOf = (source) => {
15686
15870
  const COMMAND_CHAIN = /&&|\|\||;|\|/u;
15687
15871
  const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
15688
15872
  const COMMENT = "#";
15689
- const RULE$34 = "workflow-script";
15873
+ const RULE$35 = "workflow-script";
15690
15874
  const ONE_COMMAND = 1;
15691
15875
  const MESSAGE$12 = "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.";
15692
15876
  const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
@@ -15697,7 +15881,7 @@ const runsMoreThanOneCommand = ({ text }) => {
15697
15881
  };
15698
15882
  const problemsIn$12 = (file) => (source) => {
15699
15883
  const at = positionOf(source);
15700
- return pipe(runScriptsOf(source), Array$1.filter(runsMoreThanOneCommand), Array$1.map(({ start }) => problemAtPosition(RULE$34)(file, at(start), MESSAGE$12)));
15884
+ return pipe(runScriptsOf(source), Array$1.filter(runsMoreThanOneCommand), Array$1.map(({ start }) => problemAtPosition(RULE$35)(file, at(start), MESSAGE$12)));
15701
15885
  };
15702
15886
  /** @internal */
15703
15887
  const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
@@ -15722,12 +15906,12 @@ const checkStructure = checkSection({
15722
15906
  // src/features/check-vite-plus/model/command-words.ts
15723
15907
  const CONTINUATION = /\\\n/gu;
15724
15908
  const QUOTED = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
15725
- const SEPARATOR$4 = /&&|\|\||[;|\n`]|\$\(/u;
15909
+ const SEPARATOR$5 = /&&|\|\||[;|\n`]|\$\(/u;
15726
15910
  const BLANK$1 = /\s+/u;
15727
15911
  const ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/u;
15728
15912
  const QUOTE = "\"\"";
15729
15913
  const wordsOf = (segment) => pipe(String$1.split(String$1.trim(segment), BLANK$1), Array$1.filter(String$1.isNonEmpty), Array$1.dropWhile((word) => ASSIGNMENT.test(word)));
15730
- const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$4), Array$1.map(wordsOf), Array$1.filter(Array$1.isReadonlyArrayNonEmpty));
15914
+ const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$5), Array$1.map(wordsOf), Array$1.filter(Array$1.isReadonlyArrayNonEmpty));
15731
15915
  // src/features/check-vite-plus/model/command-problems.ts
15732
15916
  const PACKAGE_MANAGERS = [
15733
15917
  "pnpm",
@@ -15828,7 +16012,7 @@ const AGENT_DOCS = [
15828
16012
  ...EXCLUDED$4
15829
16013
  ];
15830
16014
  const READ_CONCURRENCY$7 = 16;
15831
- const START$17 = 0;
16015
+ const START$18 = 0;
15832
16016
  const FIRST$7 = 1;
15833
16017
  const LINE = "\n";
15834
16018
  const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
@@ -15836,7 +16020,7 @@ const decodeCommandText = Schema.decodeUnknownOption(CommandText);
15836
16020
  const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
15837
16021
  const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
15838
16022
  const NO_SOURCES = [];
15839
- const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$17));
16023
+ const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$18));
15840
16024
  const scriptSources = (file) => (source) => pipe(decodePackageJson(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array$1.map(([name, text]) => {
15841
16025
  const offset = offsetOf$2(source, `"${name}"`);
15842
16026
  return {
@@ -15932,7 +16116,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
15932
16116
  return Array$1.flatten(found);
15933
16117
  });
15934
16118
  // src/features/check-vite-plus/model/package-scripts.ts
15935
- const RULE$33 = "package-script";
16119
+ const RULE$34 = "package-script";
15936
16120
  const LIFECYCLE = [
15937
16121
  "preinstall",
15938
16122
  "install",
@@ -15955,12 +16139,12 @@ const LIFECYCLE = [
15955
16139
  const problemOf$3 = ({ file, position, name }) => ({
15956
16140
  file,
15957
16141
  ...position,
15958
- rule: RULE$33,
16142
+ rule: RULE$34,
15959
16143
  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.`
15960
16144
  });
15961
16145
  const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$3));
15962
16146
  // src/features/check-vite-plus/model/vite-plus-block.ts
15963
- const RULE$32 = "vite-plus-block";
16147
+ const RULE$33 = "vite-plus-block";
15964
16148
  const MARKER = Array$1.join([
15965
16149
  "<!--",
15966
16150
  "VITE PLUS START",
@@ -15973,7 +16157,7 @@ const problemIn = (file) => (source) => {
15973
16157
  return Option.some({
15974
16158
  file,
15975
16159
  ...positionOf(source)(index.value),
15976
- rule: RULE$32,
16160
+ rule: RULE$33,
15977
16161
  message: MESSAGE$11
15978
16162
  });
15979
16163
  };
@@ -16051,7 +16235,7 @@ const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
16051
16235
  return pipe(drifts, Array$1.map(problemOf$2));
16052
16236
  });
16053
16237
  // src/features/check-workflows/model/publish-trigger.ts
16054
- const RULE$30 = "publish-trigger";
16238
+ const RULE$31 = "publish-trigger";
16055
16239
  const PUBLISH = /\bmsch-publish\s+(?:plan|npm|release)\b/u;
16056
16240
  const MANUAL = "workflow_dispatch";
16057
16241
  const TRIGGER_KEY$1 = "on";
@@ -16065,18 +16249,18 @@ const publishTriggerOffsetsOf = (source) => {
16065
16249
  };
16066
16250
  /** @internal */
16067
16251
  const checkPublishTrigger = workflowCheck({
16068
- rule: RULE$30,
16252
+ rule: RULE$31,
16069
16253
  message: MESSAGE$9,
16070
16254
  offsetsOf: publishTriggerOffsetsOf
16071
16255
  });
16072
16256
  // src/features/check-workflows/model/release-please.ts
16073
- const RULE$29 = "release-please";
16257
+ const RULE$30 = "release-please";
16074
16258
  const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
16075
16259
  const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
16076
16260
  const FIRST$6 = 1;
16077
16261
  const MESSAGE$8 = "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.";
16078
16262
  const checkReleasePleaseSteps = workflowCheck({
16079
- rule: RULE$29,
16263
+ rule: RULE$30,
16080
16264
  message: MESSAGE$8,
16081
16265
  offsetsOf: scalarKeyOffsets({
16082
16266
  name: "uses",
@@ -16090,7 +16274,7 @@ const checkReleasePleaseFiles = Effect.fn("checkReleasePleaseFiles")(function* c
16090
16274
  file: files.join(root, name),
16091
16275
  line: FIRST$6,
16092
16276
  column: FIRST$6,
16093
- rule: RULE$29,
16277
+ rule: RULE$30,
16094
16278
  message: MESSAGE$8
16095
16279
  })));
16096
16280
  });
@@ -16100,7 +16284,7 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
16100
16284
  return Array$1.flatten(found);
16101
16285
  });
16102
16286
  // src/features/check-workflows/model/workflow-cancel.ts
16103
- const RULE$28 = "workflow-cancel";
16287
+ const RULE$29 = "workflow-cancel";
16104
16288
  const PUSH = "push";
16105
16289
  const TRIGGER_KEY = "on";
16106
16290
  const CONCURRENCY_KEY$1 = "concurrency";
@@ -16115,24 +16299,24 @@ const cancelOffsetsOf = (source) => {
16115
16299
  };
16116
16300
  /** @internal */
16117
16301
  const checkWorkflowCancel = workflowCheck({
16118
- rule: RULE$28,
16302
+ rule: RULE$29,
16119
16303
  message: MESSAGE$7,
16120
16304
  offsetsOf: cancelOffsetsOf
16121
16305
  });
16122
16306
  // src/features/check-workflows/model/workflow-queue.ts
16123
16307
  const CONCURRENCY_KEY = "concurrency";
16124
16308
  const QUEUE_KEY = "queue";
16125
- const RULE$27 = "workflow-queue";
16309
+ const RULE$28 = "workflow-queue";
16126
16310
  const MESSAGE$6 = "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.";
16127
16311
  const queueOffsetsOf = (source) => pipe(pairsNamed(CONCURRENCY_KEY)(source), Array$1.flatMap((pair) => Option.toArray(keyOffsetIn(QUEUE_KEY)(pair.value))));
16128
16312
  /** @internal */
16129
16313
  const checkWorkflowQueues = workflowCheck({
16130
- rule: RULE$27,
16314
+ rule: RULE$28,
16131
16315
  message: MESSAGE$6,
16132
16316
  offsetsOf: queueOffsetsOf
16133
16317
  });
16134
16318
  // src/features/check-workflows/model/workflow-commits.ts
16135
- const RULE$26 = "workflow-commit";
16319
+ const RULE$27 = "workflow-commit";
16136
16320
  const GIT_WRITE = /\bgit\s+(?:-{1,2}\S+\s+(?:\S+\s+)?)*(?:commit|push)\b/u;
16137
16321
  const COMMIT_ACTION = /^[^@/]+\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;
16138
16322
  const MESSAGE$5 = "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.";
@@ -16140,7 +16324,7 @@ const offsetsWhere = (name, pattern) => (source) => pipe(pairsNamed(name)(source
16140
16324
  const commitOffsetsOf = (source) => [...offsetsWhere("run", GIT_WRITE)(source), ...offsetsWhere("uses", COMMIT_ACTION)(source)];
16141
16325
  /** @internal */
16142
16326
  const checkWorkflowCommits = workflowCheck({
16143
- rule: RULE$26,
16327
+ rule: RULE$27,
16144
16328
  message: MESSAGE$5,
16145
16329
  offsetsOf: commitOffsetsOf
16146
16330
  });
@@ -16180,18 +16364,48 @@ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
16180
16364
  });
16181
16365
  // src/shared/lib/comment-directives.ts
16182
16366
  const COMMENT_DIRECTIVES = [
16183
- "oxlint-disable",
16184
- "textlint-disable",
16185
- "textlint-enable",
16186
16367
  String.raw`\* @internal \*?$`,
16187
16368
  String.raw`\* @msch \S+ \*?$`,
16188
16369
  String.raw`\* @stability (?:experimental|unstable) \*?$`,
16189
- String.raw`shellcheck \w`,
16190
- String.raw`zizmor: ignore\[`,
16370
+ String.raw`shellcheck (?:source|shell)=`,
16191
16371
  String.raw`exit: \S`,
16192
16372
  "> statement-breakpoint$",
16193
16373
  "/ <reference (?:types|path|lib)="
16194
16374
  ];
16375
+ const SUPPRESSION = pipe([
16376
+ String.raw`\b(?:${Array$1.join([
16377
+ "eslint",
16378
+ "oxlint",
16379
+ "textlint",
16380
+ "y8",
16381
+ "markdownlint",
16382
+ "biome",
16383
+ "prettier",
16384
+ "oxfmt",
16385
+ "stylelint",
16386
+ "fallow",
16387
+ "knip",
16388
+ "jscpd",
16389
+ "c8",
16390
+ "v8",
16391
+ "istanbul",
16392
+ "tsrs",
16393
+ "tsgolint",
16394
+ "deno-lint",
16395
+ "rustfmt",
16396
+ "clippy"
16397
+ ], "|")})[- ](?:disable|enable|ignore)\b`,
16398
+ String.raw`@ts-(?:ignore|expect-error|nocheck)\b`,
16399
+ String.raw`\b(?:gitleaks|betterleaks|h56m|trufflehog|detect-secrets)\s*:\s*allow`,
16400
+ String.raw`\bpragma:\s*allowlist`,
16401
+ String.raw`\bshellcheck\s+disable=`,
16402
+ String.raw`\bzizmor\s*:\s*ignore`,
16403
+ String.raw`\bactionlint\s*:\s*ignore`,
16404
+ String.raw`\bnosemgrep\b`,
16405
+ String.raw`\bnoqa\b`,
16406
+ String.raw`\btype:\s*ignore\b`
16407
+ ], Array$1.join("|"), (source) => new RegExp(source, "iu"));
16408
+ const SUPPRESSION_MESSAGE = "This comment turns a check off. Checks are not turned off in a repository that uses msch: fix what the check reports, or, when the check itself is wrong, fix the check in msch.";
16195
16409
  // src/features/ban-comments/model/found-comment.ts
16196
16410
  const taggedError$3 = Schema.TaggedError;
16197
16411
  var CommentsUnreadable = class extends taggedError$3()("CommentsUnreadable", {
@@ -16253,7 +16467,7 @@ const COMMENT_NODES = [
16253
16467
  "block_comment",
16254
16468
  "multiline_comment"
16255
16469
  ];
16256
- const START$16 = 0;
16470
+ const START$17 = 0;
16257
16471
  const NEXT = 1;
16258
16472
  const NONE$1 = [];
16259
16473
  const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
@@ -16303,7 +16517,7 @@ const markupComment = (source) => (node) => {
16303
16517
  }];
16304
16518
  };
16305
16519
  const textComments = (grammars, grammar) => (text) => {
16306
- const shift = shifted(text.startIndex ?? START$16);
16520
+ const shift = shifted(text.startIndex ?? START$17);
16307
16521
  return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array$1.map(shift)));
16308
16522
  };
16309
16523
  const embeddedComments = (grammars) => (node) => {
@@ -16368,13 +16582,27 @@ const shebangReader = (source) => {
16368
16582
  return pipe(SHEBANG_READERS, Array$1.findFirst(([pattern]) => pattern.test(source)));
16369
16583
  };
16370
16584
  const readerOf = (name) => (source) => pipe(READERS$1, Array$1.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
16585
+ // src/features/ban-comments/model/scanned-files.ts
16586
+ const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
16587
+ const scannedFiles = Effect.fn("scannedFiles")(function* scannedFiles(root) {
16588
+ const files = yield* RepositoryFiles;
16589
+ const listed = yield* files.listedFiles(root);
16590
+ const generated = yield* files.generatedFiles(root);
16591
+ const vendored = yield* files.matchingFiles(root, [VENDORED_PATHSPEC]);
16592
+ const isIgnored = matcher(exempt);
16593
+ const skipped = HashSet.fromIterable([...generated, ...pipe(vendored, Array$1.map((name) => files.join(root, name)))]);
16594
+ return pipe(listed, Array$1.filter((name) => !isIgnored(name)), Array$1.map((name) => ({
16595
+ name,
16596
+ file: files.join(root, name)
16597
+ })), Array$1.filter(({ file }) => !HashSet.has(skipped, file)));
16598
+ });
16371
16599
  // src/features/ban-comments/model/comments.ts
16372
- const RULE$25 = "comment";
16600
+ const RULE$26 = "comment";
16601
+ const SUPPRESSION_RULE = "suppression";
16373
16602
  const UNUSED_RULE = "unused-comment-allowance";
16374
- const CONFIG_FILE$2 = "vite.config.ts";
16375
- const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
16603
+ const CONFIG_FILE$3 = "vite.config.ts";
16376
16604
  const READ_CONCURRENCY$6 = 64;
16377
- const START$15 = 0;
16605
+ const START$16 = 0;
16378
16606
  const SHEBANG = "#!";
16379
16607
  const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
16380
16608
  const VERSION = /^\s?v?\d[\w.+-]*$/u;
@@ -16383,46 +16611,32 @@ const MESSAGE$4 = "Comments are not written in this repository. Say it with name
16383
16611
  const Patterns = Schema.Array(Schema.String);
16384
16612
  const CommentSettings = Schema.Struct({ allow: Patterns });
16385
16613
  const MschSettings = Schema.Struct({ comments: Schema.optional(CommentSettings) });
16386
- const LintSettings = Schema.Struct({ ignorePatterns: Schema.optional(Patterns) });
16387
- const RootConfig = Schema.Struct({
16388
- msch: Schema.optional(MschSettings),
16389
- lint: Schema.optional(LintSettings)
16390
- });
16391
- const NO_SETTINGS = {
16392
- allow: [],
16393
- ignorePatterns: []
16394
- };
16614
+ const RootConfig = Schema.Struct({ msch: Schema.optional(MschSettings) });
16615
+ const NO_SETTINGS = { allow: [] };
16395
16616
  const taggedError$2 = Schema.TaggedError;
16396
16617
  var CommentConfigUnreadable = class extends taggedError$2()("CommentConfigUnreadable", { file: Schema.String }) {};
16397
16618
  const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
16398
16619
  const lineBefore = (source, index) => {
16399
- const lines = pipe(source, String$1.slice(START$15, index), String$1.split("\n"));
16620
+ const lines = pipe(source, String$1.slice(START$16, index), String$1.split("\n"));
16400
16621
  return Option.getOrElse(Array$1.last(lines), () => "");
16401
16622
  };
16402
16623
  const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
16403
- const isShebang = ({ index, text }) => index === START$15 && String$1.startsWith(SHEBANG)(text);
16404
- const isAllowed = (source, directives) => (comment) => isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment);
16624
+ const isShebang = ({ index, text }) => index === START$16 && String$1.startsWith(SHEBANG)(text);
16625
+ const isSuppression = (comment) => SUPPRESSION.test(comment.text);
16626
+ const isAllowed = (source, directives) => (comment) => !isSuppression(comment) && (isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment));
16405
16627
  const NOTHING = {
16406
16628
  problems: [],
16407
16629
  used: []
16408
16630
  };
16409
16631
  const unusedMessage = (entry) => `allows the comment pattern \`${entry}\`, but no comment in the repository matches it. Delete the entry and add it back when a comment needs it.`;
16410
- const problemOf$1 = (file, source) => ({ index }) => ({
16411
- file,
16412
- ...positionOf(source)(index),
16413
- rule: RULE$25,
16414
- message: MESSAGE$4
16415
- });
16416
- const settingsOf = ({ msch, lint }) => ({
16417
- allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
16418
- onNone: () => NO_SETTINGS.allow,
16419
- onSome: ({ allow }) => allow
16420
- })),
16421
- ignorePatterns: pipe(Option.fromUndefinedOr(lint), Option.flatMap(({ ignorePatterns }) => Option.fromUndefinedOr(ignorePatterns)), Option.getOrElse(() => NO_SETTINGS.ignorePatterns))
16422
- });
16632
+ const problemOf$1 = (file, source) => (comment) => Match.value(isSuppression(comment)).pipe(Match.when(true, () => problemAtIndex(SUPPRESSION_RULE)(file, source)(comment.index, SUPPRESSION_MESSAGE)), Match.orElse(() => problemAtIndex(RULE$26)(file, source)(comment.index, MESSAGE$4)));
16633
+ const settingsOf = ({ msch }) => ({ allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
16634
+ onNone: () => NO_SETTINGS.allow,
16635
+ onSome: ({ allow }) => allow
16636
+ })) });
16423
16637
  const rootSettings = Effect.fn("rootSettings")(function* rootSettings(root) {
16424
16638
  const files = yield* RepositoryFiles;
16425
- const file = files.join(root, CONFIG_FILE$2);
16639
+ const file = files.join(root, CONFIG_FILE$3);
16426
16640
  if (!(yield* files.exists(file))) return NO_SETTINGS;
16427
16641
  const config = yield* Effect.tryPromise({
16428
16642
  try: () => resolveConfigFromFile(file),
@@ -16434,31 +16648,14 @@ const rootSettings = Effect.fn("rootSettings")(function* rootSettings(root) {
16434
16648
  }));
16435
16649
  });
16436
16650
  const directivePattern = (directives) => new RegExp(String.raw`^\s?(?:${Array$1.join(directives, "|")})`, "u");
16437
- const scannedFiles = Effect.fn("scannedFiles")(function* scannedFiles(root, settings) {
16438
- const files = yield* RepositoryFiles;
16439
- const listed = yield* files.listedFiles(root);
16440
- const generated = yield* files.generatedFiles(root);
16441
- const vendored = yield* files.matchingFiles(root, [VENDORED_PATHSPEC]);
16442
- const isIgnored = matcher(settings.ignorePatterns);
16443
- const skipped = HashSet.fromIterable([...generated, ...pipe(vendored, Array$1.map((name) => files.join(root, name)))]);
16444
- return pipe(listed, Array$1.filter((name) => !isIgnored(name)), Array$1.map((name) => ({
16445
- name,
16446
- file: files.join(root, name)
16447
- })), Array$1.filter(({ file }) => !HashSet.has(skipped, file)));
16448
- });
16449
- const usedAllowances = (allowances, found) => pipe(allowances, Array$1.map((pattern, index) => [pattern, index]), Array$1.filter(([pattern]) => pipe(found, Array$1.some((comment) => pattern.test(valueOf(comment.text))))), Array$1.map(([, index]) => index));
16450
- const entryOffset = (source, entry) => pipe(String$1.indexOf(entry)(source), Option.getOrElse(() => START$15));
16651
+ const usedAllowances = (allowances, found) => pipe(allowances, Array$1.map((pattern, index) => [pattern, index]), Array$1.filter(([pattern]) => pipe(found, Array$1.some((comment) => !isSuppression(comment) && pattern.test(valueOf(comment.text))))), Array$1.map(([, index]) => index));
16652
+ const entryOffset = (source, entry) => pipe(String$1.indexOf(entry)(source), Option.getOrElse(() => START$16));
16451
16653
  const unusedAllowances = Effect.fn("unusedAllowances")(function* unusedAllowances(root, settings, used) {
16452
16654
  const files = yield* RepositoryFiles;
16453
- const file = files.join(root, CONFIG_FILE$2);
16655
+ const file = files.join(root, CONFIG_FILE$3);
16454
16656
  const text = yield* files.readFile(file);
16455
16657
  const source = Option.getOrElse(text, () => "");
16456
- return pipe(settings.allow, Array$1.filter((_entry, index) => !HashSet.has(used, index)), Array$1.map((entry) => ({
16457
- file,
16458
- ...positionOf(source)(entryOffset(source, entry)),
16459
- rule: UNUSED_RULE,
16460
- message: unusedMessage(entry)
16461
- })));
16658
+ return pipe(settings.allow, Array$1.filter((_entry, index) => !HashSet.has(used, index)), Array$1.map((entry) => problemAtIndex(UNUSED_RULE)(file, source)(entryOffset(source, entry), unusedMessage(entry))));
16462
16659
  });
16463
16660
  const scanFile = ({ directives, allowances, comments }) => ({ name, file }, source) => {
16464
16661
  const kept = Predicate.not(isAllowed(source, directives));
@@ -16469,7 +16666,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
16469
16666
  problems: pipe(found, Array$1.filter(kept), Array$1.map(toProblem)),
16470
16667
  used: usedAllowances(allowances, found)
16471
16668
  })), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
16472
- problems: [problemInFile(RULE$25)(file, `msch could not read the comments in this file: ${message}`)],
16669
+ problems: [problemAtIndex(RULE$26)(file, source)(START$16, `msch could not read the comments in this file: ${message}`)],
16473
16670
  used: []
16474
16671
  })))
16475
16672
  });
@@ -16478,7 +16675,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
16478
16675
  const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
16479
16676
  const files = yield* RepositoryFiles;
16480
16677
  const settings = yield* rootSettings(root);
16481
- const scanned = yield* scannedFiles(root, settings);
16678
+ const scanned = yield* scannedFiles(root);
16482
16679
  const grammars = yield* loadGrammars();
16483
16680
  const scan = scanFile({
16484
16681
  directives: directivePattern([...COMMENT_DIRECTIVES, ...settings.allow]),
@@ -16582,7 +16779,7 @@ const PYTHON = {
16582
16779
  /** @internal */
16583
16780
  const checkPython = (root) => checkBannedTool(root, PYTHON);
16584
16781
  // src/features/check-catalog-entries/model/uncataloged-dependencies.ts
16585
- const RULE$24 = "uncataloged-dependency";
16782
+ const RULE$25 = "uncataloged-dependency";
16586
16783
  const OWNED_ELSEWHERE = [
16587
16784
  "catalog:",
16588
16785
  "workspace:",
@@ -16596,7 +16793,7 @@ const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array$1.some((
16596
16793
  const problemsIn$11 = (entry, source) => pipe(manifestSpecifiers(source), Array$1.filter((found) => !isOwnedElsewhere(found)), Array$1.map((found) => ({
16597
16794
  file: entry.file,
16598
16795
  ...positionOf(source)(offsetIn$1(source)(manifestPattern(found))),
16599
- rule: RULE$24,
16796
+ rule: RULE$25,
16600
16797
  message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$3}`
16601
16798
  })));
16602
16799
  /** @internal */
@@ -16617,7 +16814,7 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
16617
16814
  const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
16618
16815
  const FIRST_LINE$2 = 1;
16619
16816
  const FIRST_COLUMN$1 = 1;
16620
- const RULE$23 = "prune-setting-off";
16817
+ const RULE$24 = "prune-setting-off";
16621
16818
  const PRUNE_SETTINGS = [["catalogPrune", "removes catalog entries no package refers to, so the catalog holds only versions in use."], ["minimumReleaseAgeExcludePrune", "removes `minimumReleaseAgeExclude` entries the lockfile no longer resolves, which only exempted that one version while it was new."]];
16622
16819
  const decodeTrue = Schema.decodeUnknownOption(Schema.Literal(true));
16623
16820
  const lineOf$1 = (source) => (setting) => pipe(String$1.split(source, "\n"), Array$1.findFirstIndex(String$1.startsWith(`${setting}:`)), Option.match({
@@ -16631,7 +16828,7 @@ const pruneProblems = Effect.fn("pruneProblems")(function* pruneProblems(file, s
16631
16828
  file,
16632
16829
  line: at(setting),
16633
16830
  column: FIRST_COLUMN$1,
16634
- rule: RULE$23,
16831
+ rule: RULE$24,
16635
16832
  message: `Set \`${setting}: true\`. It ${effect}`
16636
16833
  })));
16637
16834
  });
@@ -16652,12 +16849,13 @@ const checkCatalogEntries = Effect.fn("checkCatalogEntries")(function* checkCata
16652
16849
  // src/features/check-skills/model/skill-entry.ts
16653
16850
  const ENTRY_RULE = "unlocked-skill";
16654
16851
  const VISIBLE_RULE = "skill-source-visible";
16655
- const CONFIG_FILE$1 = "vite.config.ts";
16852
+ const CONFIG_FILE$2 = "vite.config.ts";
16656
16853
  const RENOVATE_FILE$1 = "renovate.json";
16657
- const PRESET$1 = "github>masseater/ecosystems//libs/vite-plus-adopt/renovate";
16658
- const START$14 = 0;
16854
+ const ADOPTER = "@r_masseater/vite-plus-adopt";
16855
+ const SOURCE_SEPARATOR = "/";
16856
+ const START$15 = 0;
16659
16857
  const LOCAL_PREFIX = "./";
16660
- const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
16858
+ const REGEX_SPECIAL$1 = /[.*+?^${}()|[\]\\/]/gu;
16661
16859
  const Source = Schema.Struct({
16662
16860
  commit: Schema.optional(Schema.String),
16663
16861
  skills: Schema.Union([Schema.Literal("all"), Schema.Array(Schema.String)])
@@ -16668,13 +16866,13 @@ const taggedError$1 = Schema.TaggedError;
16668
16866
  var SkillsConfigUnreadable = class extends taggedError$1()("SkillsConfigUnreadable", { file: Schema.String }) {};
16669
16867
  const problemAt$3 = (rule, file, text) => (anchor, message) => ({
16670
16868
  file,
16671
- ...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$14))),
16869
+ ...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$15))),
16672
16870
  rule,
16673
16871
  message
16674
16872
  });
16675
16873
  const declaredSkills = Effect.fn("declaredSkills")(function* declaredSkills(root) {
16676
16874
  const files = yield* RepositoryFiles;
16677
- const file = files.join(root, CONFIG_FILE$1);
16875
+ const file = files.join(root, CONFIG_FILE$2);
16678
16876
  const text = yield* files.readFile(file);
16679
16877
  if (Option.isNone(text)) return Option.none();
16680
16878
  const config = yield* Effect.tryPromise({
@@ -16687,44 +16885,50 @@ const declaredSkills = Effect.fn("declaredSkills")(function* declaredSkills(root
16687
16885
  sources: skills
16688
16886
  })));
16689
16887
  });
16690
- const entryProblems = (required, { file, text, sources }) => {
16691
- if (required === "marketplace") return [];
16888
+ const ownerOfSource = (source) => pipe(String$1.split(SOURCE_SEPARATOR)(source), Array$1.headNonEmpty);
16889
+ const entryProblems = (owner, { file, text, sources }) => {
16692
16890
  const at = problemAt$3(ENTRY_RULE, file, text);
16693
- const { repository: source, root } = required;
16694
- return pipe(Record.get(sources, source), Option.match({
16695
- onNone: () => [at("skills", `does not install ${source}. Add "${source}": { commit, root: "${root}", skills: "all" } to skills.`)],
16696
- onSome: (found) => pipe(Option.liftPredicate(found, ({ skills }) => skills !== "all"), Option.map(() => at(`"${source}"`, `picks skills from ${source} by name. Write skills: "all", so every repository gets each new skill with the next digest update.`)), Option.toArray)
16697
- }));
16891
+ return pipe(Record.toEntries(sources), Array$1.filter(([source, { skills }]) => ownerOfSource(source) === owner && skills !== "all"), Array$1.map(([source]) => at(`"${source}"`, `picks skills from ${source} by name. ${owner} owns both repositories, so write skills: "all" and every repository gets each new skill with the next digest update.`)));
16698
16892
  };
16699
- const literalPattern = (repository, commit) => new RegExp(`"${String$1.replaceAll(REGEX_SPECIAL, String.raw`\$&`)(repository)}": \\{\\s*commit: "${commit}"`, "u");
16893
+ const literalPattern = (repository, commit) => new RegExp(`"${String$1.replaceAll(REGEX_SPECIAL$1, String.raw`\$&`)(repository)}": \\{\\s*commit: "${commit}"`, "u");
16700
16894
  const visibleProblems = ({ file, text, sources }) => pipe(Record.toEntries(sources), Array$1.filter(([repository]) => !String$1.startsWith(LOCAL_PREFIX)(repository)), Array$1.filter(([repository, { commit }]) => !literalPattern(repository, commit ?? "").test(text)), Array$1.map(([repository]) => problemAt$3(VISIBLE_RULE, file, text)(repository, `declares ${repository} in a form the Renovate preset cannot read. Write "${repository}": { commit: "<sha>", ... } with commit first and as a string literal.`)));
16701
- const presetProblems = Effect.fn("presetProblems")(function* presetProblems(root) {
16895
+ const RepositoryField = Schema.Struct({
16896
+ url: Schema.String,
16897
+ directory: Schema.String
16898
+ });
16899
+ const decodeRepository$1 = Schema.decodeUnknownOption(RepositoryField);
16900
+ const adopterPreset = Effect.fn("adopterPreset")(function* adopterPreset() {
16901
+ const manifest = yield* installedManifest(ADOPTER, import.meta.url);
16902
+ return pipe(manifest, Option.flatMap(({ repository }) => decodeRepository$1(repository)), Option.flatMap(({ url, directory }) => pipe(originOf(url), Option.map((origin) => `github>${slugOf(origin)}//${directory}/renovate`))));
16903
+ });
16904
+ const presetProblems = Effect.fn("presetProblems")(function* presetProblems(root, preset) {
16702
16905
  const files = yield* RepositoryFiles;
16703
16906
  const file = files.join(root, RENOVATE_FILE$1);
16704
16907
  const text = yield* files.readFile(file);
16705
- if (pipe(text, Option.exists(String$1.includes(`"${PRESET$1}"`)))) return [];
16706
- return [problemAt$3(VISIBLE_RULE, file, Option.getOrElse(text, () => ""))("extends", `does not extend ${PRESET$1}, so Renovate never updates the commits in the skills section of ${CONFIG_FILE$1}.`)];
16908
+ if (pipe(text, Option.exists(String$1.includes(`"${preset}"`)))) return [];
16909
+ return [problemAt$3(VISIBLE_RULE, file, Option.getOrElse(text, () => ""))("extends", `does not extend ${preset}, so Renovate never updates the commits in the skills section of ${CONFIG_FILE$2}.`)];
16707
16910
  });
16708
16911
  /** @internal */
16709
16912
  const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(root) {
16710
16913
  const declared = yield* declaredSkills(root);
16711
16914
  if (Option.isNone(declared)) return [];
16712
- const preset = yield* presetProblems(root);
16713
- const { skills } = yield* ownerSettings(root);
16915
+ const preset = yield* adopterPreset();
16916
+ const unextended = yield* Effect.forEach(Option.toArray(preset), (found) => presetProblems(root, found), { concurrency: 1 });
16917
+ const origin = yield* repositoryOrigin(root);
16714
16918
  return [
16715
- ...entryProblems(skills, declared.value),
16919
+ ...pipe(origin, Option.map(({ owner }) => entryProblems(owner, declared.value)), Option.getOrElse(() => [])),
16716
16920
  ...visibleProblems(declared.value),
16717
- ...preset
16921
+ ...Array$1.flatten(unextended)
16718
16922
  ];
16719
16923
  });
16720
16924
  // src/features/check-skills/model/published-skills.ts
16721
- const RULE$22 = "published-skills";
16925
+ const RULE$23 = "published-skills";
16722
16926
  const KEYWORD = "tanstack-intent";
16723
16927
  const SKILLS = "skills";
16724
16928
  const SKILL_FILE$2 = "SKILL.md";
16725
16929
  const SUCCEEDED = 0;
16726
16930
  const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
16727
- const problemAt$2 = problemInFile(RULE$22);
16931
+ const problemAt$2 = problemInFile(RULE$23);
16728
16932
  const skillDirectoriesIn = (files, directory) => pipe(findSkillFiles(files.join(directory, SKILLS)), Array$1.filter((file) => files.basename(file) === SKILL_FILE$2), Array$1.map((file) => files.relative(directory, files.dirname(file))));
16729
16933
  const isShipped = (listed) => (skill) => Array$1.contains(listed, SKILLS) || Array$1.contains(listed, skill);
16730
16934
  const packagingMessages = ({ keywords, files }, skills) => {
@@ -16761,7 +16965,7 @@ const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPu
16761
16965
  return Array$1.flatten(problems);
16762
16966
  });
16763
16967
  // src/features/check-skills/model/skill-files.ts
16764
- const RULE$21 = "skill-file";
16968
+ const RULE$22 = "skill-file";
16765
16969
  const SKILL_FILE$1 = /(?:^|\/)SKILL\.md$/u;
16766
16970
  const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
16767
16971
  const FIXTURE = /(?:^|\/)fixtures\//u;
@@ -16777,8 +16981,8 @@ const FRAGMENT = /#.*$/u;
16777
16981
  const GITHUB = "https://github.com/";
16778
16982
  const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
16779
16983
  const BLANK = /\s+/u;
16780
- const SEPARATOR$3 = "/";
16781
- const START$13 = 0;
16984
+ const SEPARATOR$4 = "/";
16985
+ const START$14 = 0;
16782
16986
  const FIRST$5 = 1;
16783
16987
  const READ_CONCURRENCY$5 = 16;
16784
16988
  const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
@@ -16788,9 +16992,9 @@ const Frontmatter = Schema.Struct({
16788
16992
  metadata: Schema.optional(Metadata)
16789
16993
  });
16790
16994
  const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
16791
- const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$13));
16995
+ const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$14));
16792
16996
  const frontmatterOf = (source) => pipe(splitFrontmatter(source), Option.flatMap(({ fields }) => decodeFrontmatter(fields)));
16793
- const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$13].length), Option.getOrElse(() => START$13));
16997
+ const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$14].length), Option.getOrElse(() => START$14));
16794
16998
  const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
16795
16999
  const nameProblems = ({ source, directory }, name, folder) => {
16796
17000
  const bodyStart = bodyStartOf(source);
@@ -16818,16 +17022,16 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
16818
17022
  ]), Option.getOrElse(() => []), Array$1.map(({ index, message }) => ({
16819
17023
  file: skill.file,
16820
17024
  ...positionOf(skill.source)(index),
16821
- rule: RULE$21,
17025
+ rule: RULE$22,
16822
17026
  message
16823
17027
  })));
16824
17028
  const linkOf = (found) => pipe(groupOf("target")(found), Option.filter((target) => !EXTERNAL.test(target)), Option.map((target) => String$1.replace(FRAGMENT, "")(target)), Option.filter(String$1.isNonEmpty), Option.map((target) => ({
16825
17029
  target,
16826
- index: found.index ?? START$13
17030
+ index: found.index ?? START$14
16827
17031
  })), Option.toArray);
16828
17032
  const rangeOf$1 = (found) => {
16829
- const start = found.index ?? START$13;
16830
- return [start, start + found[START$13].length];
17033
+ const start = found.index ?? START$14;
17034
+ return [start, start + found[START$14].length];
16831
17035
  };
16832
17036
  const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array$1.some(([start, end]) => index >= start && index < end));
16833
17037
  const linksIn$1 = (source) => {
@@ -16845,7 +17049,7 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
16845
17049
  return pipe(missing, Array$1.map(({ target, index }) => ({
16846
17050
  file,
16847
17051
  ...positionOf(source)(index),
16848
- rule: RULE$21,
17052
+ rule: RULE$22,
16849
17053
  message: `links to ${target}, which does not exist. Fix the path or remove the link.`
16850
17054
  })));
16851
17055
  });
@@ -16853,7 +17057,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
16853
17057
  const files = yield* RepositoryFiles;
16854
17058
  const file = files.join(root, name);
16855
17059
  const directory = files.dirname(name);
16856
- const inside = pipe(listed, Array$1.filter(String$1.startsWith(`${directory}${SEPARATOR$3}`)));
17060
+ const inside = pipe(listed, Array$1.filter(String$1.startsWith(`${directory}${SEPARATOR$4}`)));
16857
17061
  const text = yield* files.readFile(file);
16858
17062
  const documents = pipe(inside, Array$1.filter(String$1.endsWith(MARKDOWN$4)), Array$1.map((entry) => files.join(root, entry)));
16859
17063
  const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$5 });
@@ -16861,7 +17065,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
16861
17065
  file: files.join(root, entry),
16862
17066
  line: FIRST$5,
16863
17067
  column: FIRST$5,
16864
- rule: RULE$21,
17068
+ rule: RULE$22,
16865
17069
  message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
16866
17070
  })));
16867
17071
  return [
@@ -16939,7 +17143,7 @@ const cargoEntries = (text) => {
16939
17143
  };
16940
17144
  const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
16941
17145
  // src/features/check-version-downgrades/model/version-downgrade.ts
16942
- const RULE$20 = "version-downgrade";
17146
+ const RULE$21 = "version-downgrade";
16943
17147
  const READ_CONCURRENCY$4 = 16;
16944
17148
  const READERS = [
16945
17149
  [/(?:^|\/)package\.json$/u, manifestEntries],
@@ -16964,7 +17168,7 @@ const downgradesIn = ({ file, text, before, after }) => {
16964
17168
  file,
16965
17169
  line: lineOf(text, entry),
16966
17170
  column: FIRST_LINE$1,
16967
- rule: RULE$20,
17171
+ rule: RULE$21,
16968
17172
  message: message(old, entry)
16969
17173
  })), Option.toArray)));
16970
17174
  };
@@ -16994,12 +17198,11 @@ const VERSION_CAP = /["']?allowedVersions["']?\s*:\s*["'](?<range>[^"']*<[^"']*)
16994
17198
  const AUTOMERGE_RULE = "renovate-platform-automerge";
16995
17199
  const CAP_RULE = "renovate-version-cap";
16996
17200
  const PRESET_RULE = "renovate-msch-preset";
16997
- const PRESET = "github>masseater/ecosystems//libs/msch/renovate";
16998
- const START$12 = 0;
17201
+ const START$13 = 0;
16999
17202
  const READ_CONCURRENCY$3 = 16;
17000
17203
  const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
17001
17204
  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.";
17002
- const PRESET_MESSAGE = `does not extend \`${PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
17205
+ const PRESET_MESSAGE = `does not extend \`${RENOVATE_PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
17003
17206
  const offsetsOf = (pattern, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.flatMap((match) => Option.toArray(Option.fromUndefinedOr(match.index))));
17004
17207
  const problemsIn$8 = (file, source) => {
17005
17208
  const at = positionOf(source);
@@ -17014,10 +17217,10 @@ const problemsIn$8 = (file, source) => {
17014
17217
  ...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
17015
17218
  ...pipe([{
17016
17219
  file,
17017
- ...at(START$12),
17220
+ ...at(START$13),
17018
17221
  rule: PRESET_RULE,
17019
17222
  message: PRESET_MESSAGE
17020
- }], Array$1.filter(() => !String$1.includes(`"${PRESET}"`)(source)))
17223
+ }], Array$1.filter(() => !String$1.includes(`"${RENOVATE_PRESET}"`)(source)))
17021
17224
  ];
17022
17225
  };
17023
17226
  /** @internal */
@@ -17034,17 +17237,16 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
17034
17237
  return Array$1.flatten(found);
17035
17238
  });
17036
17239
  // src/features/find-unneeded-files/model/applied-packages.ts
17037
- const MSCH = "@r_masseater/msch";
17038
- const SCOPE = Option.getOrElse(scopeOfName(MSCH), () => MSCH);
17240
+ const SCOPE = Option.getOrElse(scopeOfName(SELF_NAME), () => SELF_NAME);
17039
17241
  const PLUGIN_KEYWORDS = ["oxlint-plugin", "textlint-rule"];
17040
- const RULE$19 = "applied-package";
17242
+ const RULE$20 = "applied-package";
17041
17243
  const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
17042
17244
  const NOT_FOUND = -1;
17043
- const SEPARATOR$2 = "/";
17245
+ const SEPARATOR$3 = "/";
17044
17246
  /** @internal */
17045
17247
  const isApplied = ({ bins, keywords }) => Array$1.isReadonlyArrayNonEmpty(bins) || pipe(keywords, Array$1.some((keyword) => Array$1.contains(PLUGIN_KEYWORDS, keyword)));
17046
17248
  const BY_LENGTH = Order.mapInput(Order.Number, (text) => text.length);
17047
- const escaped = (text) => String$1.replaceAll(/[.*+?^${}()|[\]\\]/gu, String.raw`\$&`)(text);
17249
+ const escaped$1 = (text) => String$1.replaceAll(/[.*+?^${}()|[\]\\]/gu, String.raw`\$&`)(text);
17048
17250
  const declaredNames = (manifest) => namesIn(manifest, [
17049
17251
  "dependencies",
17050
17252
  "devDependencies",
@@ -17065,7 +17267,7 @@ const installedPackage = Effect.fn("installedPackage")(function* installedPackag
17065
17267
  })));
17066
17268
  });
17067
17269
  const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
17068
- const manifest = yield* installedManifest(MSCH, import.meta.url);
17270
+ const manifest = yield* installedManifest(SELF_NAME, import.meta.url);
17069
17271
  const names = pipe(manifest, Option.map(({ dependencies, peerDependencies }) => [...Record.keys(dependencies ?? {}), ...Record.keys(peerDependencies ?? {})]), Option.getOrElse(() => []), Array$1.filter(String$1.startsWith(SCOPE)));
17070
17272
  const found = yield* Effect.forEach(names, installedPackage, { concurrency: 1 });
17071
17273
  return Array$1.getSomes(found);
@@ -17073,20 +17275,20 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
17073
17275
  const problemAt$1 = (file, source) => (index, name) => ({
17074
17276
  file,
17075
17277
  ...positionOf(source)(index),
17076
- rule: RULE$19,
17278
+ rule: RULE$20,
17077
17279
  message: `msch applies ${name}. Remove this use and let msch apply it.`
17078
17280
  });
17079
- const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped(name)}(?=["'\`/])`, "gu");
17080
- const binPattern = (bin) => new RegExp(`(?<![\\w./@:-])${escaped(bin)}(?=[ \\t"'\`]|$)`, "gmu");
17281
+ const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped$1(name)}(?=["'\`/])`, "gu");
17282
+ const binPattern = (bin) => new RegExp(`(?<![\\w./@:-])${escaped$1(bin)}(?=[ \\t"'\`]|$)`, "gmu");
17081
17283
  const usesIn = (applied) => ({ file }, source) => pipe(applied, Array$1.flatMap((entry) => pipe([specifierPattern(entry), ...pipe(entry.bins, Array$1.map(binPattern))], Array$1.flatMap((pattern) => Array$1.fromIterable(String$1.matchAll(pattern)(source))), Array$1.map((found) => problemAt$1(file, source)(found.index ?? NOT_FOUND, entry.name)))));
17082
- const ownerOf$1 = (directories) => (name) => pipe(directories, Array$1.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$2}`)(name)), Array$1.match({
17284
+ const ownerOf$1 = (directories) => (name) => pipe(directories, Array$1.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$3}`)(name)), Array$1.match({
17083
17285
  onEmpty: () => "",
17084
17286
  onNonEmpty: Array$1.max(BY_LENGTH)
17085
17287
  }));
17086
17288
  const isScannedSource = (entry) => isScannedText(entry) && !String$1.endsWith(PACKAGE_JSON_FILE)(entry.name) && entry.name !== WORKSPACE_FILE$2;
17087
17289
  const consumersIn = Effect.fn("consumersIn")(function* consumersIn(root, directories) {
17088
17290
  const files = yield* RepositoryFiles;
17089
- return yield* pipe(directories, Effect.filter((directory) => readManifest(files.join(root, directory)).pipe(Effect.map(Option.exists((manifest) => manifest.name !== MSCH && Array$1.contains(declaredNames(manifest), MSCH))))));
17291
+ return yield* pipe(directories, Effect.filter((directory) => readManifest(files.join(root, directory)).pipe(Effect.map(Option.exists((manifest) => manifest.name !== SELF_NAME && Array$1.contains(declaredNames(manifest), SELF_NAME))))));
17090
17292
  });
17091
17293
  const manifestUses = Effect.fn("manifestUses")(function* manifestUses(root, appliedNames, directory) {
17092
17294
  const files = yield* RepositoryFiles;
@@ -17128,7 +17330,7 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
17128
17330
  return yield* appliedPackageProblems(root, applied);
17129
17331
  });
17130
17332
  // src/features/find-unneeded-files/model/replaced-tools.ts
17131
- const RULE$18 = "replaced-tool";
17333
+ const RULE$19 = "replaced-tool";
17132
17334
  const FIRST$4 = 1;
17133
17335
  const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
17134
17336
  const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
@@ -17209,7 +17411,7 @@ const problemFor$1 = ({ name, file }) => pipe(REPLACED, Array$1.findFirst(({ pat
17209
17411
  file,
17210
17412
  line: FIRST$4,
17211
17413
  column: FIRST$4,
17212
- rule: RULE$18,
17414
+ rule: RULE$19,
17213
17415
  message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
17214
17416
  })));
17215
17417
  /** @internal */
@@ -17227,7 +17429,7 @@ const unneededLockfile = (present) => (entry) => FOREIGN_LOCKFILE.test(entry.nam
17227
17429
  // src/features/find-unneeded-files/model/unneeded-files.ts
17228
17430
  const WORKSPACE_FILE$1 = "pnpm-workspace.yaml";
17229
17431
  const PNPM_DIRECTORY = ".pnpm/";
17230
- const SEPARATOR$1 = "/";
17432
+ const SEPARATOR$2 = "/";
17231
17433
  const CARGO_MANIFEST_FILE = /(?:^|\/)Cargo\.toml$/u;
17232
17434
  const CARGO_LOCK_FILE = /(?:^|\/)Cargo\.lock$/u;
17233
17435
  const PNPM_OUTPUT = /(?:^|\/)\.pnpm\//u;
@@ -17243,7 +17445,7 @@ const SETUP_PATTERNS = [
17243
17445
  ];
17244
17446
  const INSTALL_PATTERNS = [/(?<![\w./@-])cargo[ \t]+b?install\b/gu];
17245
17447
  const TOOL_PATTERNS = [/^[ \t]*["']?(?:rust|rustup)["']?[ \t]*(?:=|[ \t]+\S)/gmu];
17246
- const START$11 = 0;
17448
+ const START$12 = 0;
17247
17449
  const LAST_SEGMENT = 1;
17248
17450
  const FIRST_LINE = 1;
17249
17451
  const FIRST_COLUMN = 1;
@@ -17295,10 +17497,10 @@ const matches = (pattern) => ({ name }) => pattern.test(name);
17295
17497
  const isCargoManifest = matches(CARGO_MANIFEST_FILE);
17296
17498
  const isLegacyCargoConfig = matches(LEGACY_CARGO_CONFIG);
17297
17499
  const isPnpmOutput = matches(PNPM_OUTPUT);
17298
- const directoryOf = (name) => pipe(String$1.split(name, SEPARATOR$1), Array$1.dropRight(LAST_SEGMENT), Array$1.join(SEPARATOR$1));
17500
+ const directoryOf = (name) => pipe(String$1.split(name, SEPARATOR$2), Array$1.dropRight(LAST_SEGMENT), Array$1.join(SEPARATOR$2));
17299
17501
  const ancestorsOf = (directory) => {
17300
- const parts = String$1.split(directory, SEPARATOR$1);
17301
- return pipe(Array$1.makeBy(parts.length, (depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$1)), Array$1.filter((ancestor) => ancestor !== directory));
17502
+ const parts = String$1.split(directory, SEPARATOR$2);
17503
+ return pipe(Array$1.makeBy(parts.length, (depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$2)), Array$1.filter((ancestor) => ancestor !== directory));
17302
17504
  };
17303
17505
  const readsCargoLock = (manifests, workspaces) => ({ name }) => {
17304
17506
  const directory = directoryOf(name);
@@ -17312,7 +17514,7 @@ const cargoWorkspaces = Effect.fn("cargoWorkspaces")(function* cargoWorkspaces(m
17312
17514
  const roots = yield* pipe(manifests, Effect.filter(({ file }) => files.readFile(file).pipe(Effect.map(isWorkspaceManifest))));
17313
17515
  return directoriesOf(roots);
17314
17516
  });
17315
- const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$11), (end) => String$1.slice(START$11, end)(name));
17517
+ const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$12), (end) => String$1.slice(START$12, end)(name));
17316
17518
  const pnpmOutputs = (present) => pipe(present, Array$1.filter(isPnpmOutput), Array$1.dedupeWith((left, right) => pnpmDirectoryOf(left) === pnpmDirectoryOf(right)), Array$1.map(pnpmOutput));
17317
17519
  const byDepth = Order.mapInput(Order.Number, ({ name }) => String$1.split(name, "/").length);
17318
17520
  const cargoProblems = (present, enabled) => {
@@ -17348,8 +17550,8 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
17348
17550
  return yield* unneededIn(root, cargoEnabled(workspace.value));
17349
17551
  });
17350
17552
  // src/features/check-markdown-directives/model/directives.ts
17351
- const RULE$17 = "markdown-directive";
17352
- const START$10 = 0;
17553
+ const RULE$18 = "markdown-directive";
17554
+ const START$11 = 0;
17353
17555
  const SECOND = 1;
17354
17556
  const ODD = 1;
17355
17557
  const PAIR = 2;
@@ -17360,24 +17562,20 @@ const SKIPPED_DIRECTORIES = [
17360
17562
  "/upstream/"
17361
17563
  ];
17362
17564
  const SKIPPED_FILES = ["CHANGELOG.md", "CLAUDE.md"];
17363
- const DISABLE = /<!--\s*(?:y8|markdownlint|textlint)-disable(?:-next-line|-line|-file)?(?<rest>(?:\s[\s\S]*?)?)-->/giu;
17565
+ const DISABLE = /<!--\s*(?:y8|markdownlint|textlint)-(?:disable|enable|capture|restore|configure-file)(?:-next-line|-line|-file)?(?:\s[\s\S]*?)?-->/giu;
17364
17566
  const FENCE$1 = /^\s{0,3}(?:`{3,}|~{3,})/u;
17365
17567
  const BACKTICK = /`/gu;
17366
- const DESCRIPTION = / -- .*/u;
17367
- const SEPARATORS = /[\s,]+/u;
17368
- const MESSAGE$2 = "Name the rules this comment disables, as in `<!-- y8-disable MD033 -->`. A comment with no rule name stops every rule, so it also hides violations that are added later.";
17568
+ const MESSAGE$2 = "This comment turns a Markdown or text check off. Checks are not turned off in a repository that uses msch: fix what the check reports, or, when the check itself is wrong, fix the check in msch.";
17369
17569
  const fenceStep = (inside, line) => Match.value(FENCE$1.test(line)).pipe(Match.when(true, () => [!inside, true]), Match.orElse(() => [inside, inside]));
17370
17570
  const insideCodeSpan = (before) => Array$1.fromIterable(String$1.matchAll(BACKTICK)(before)).length % PAIR === ODD;
17371
- const namedRules = (rest) => pipe(rest, String$1.replace(DESCRIPTION, ""), String$1.split(SEPARATORS), Array$1.filter(String$1.isNonEmpty));
17372
- const restOf = (found) => pipe(Option.fromNullishOr(found.groups), Option.flatMap(Record.get("rest")), Option.getOrElse(() => ""));
17373
17571
  const problemsIn$7 = (file, source) => {
17374
17572
  const lines = String$1.split("\n")(source);
17375
17573
  const fenced = Array$1.mapAccum(lines, false, fenceStep)[SECOND];
17376
17574
  const isCode = (index) => {
17377
17575
  const { line, column } = positionOf(source)(index);
17378
- return pipe(Array$1.get(fenced, line - SECOND), Option.getOrElse(() => false)) || pipe(Array$1.get(lines, line - SECOND), Option.map(String$1.slice(START$10, column - SECOND)), Option.exists(insideCodeSpan));
17576
+ return pipe(Array$1.get(fenced, line - SECOND), Option.getOrElse(() => false)) || pipe(Array$1.get(lines, line - SECOND), Option.map(String$1.slice(START$11, column - SECOND)), Option.exists(insideCodeSpan));
17379
17577
  };
17380
- return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => Array$1.isReadonlyArrayEmpty(namedRules(restOf(match)))), Array$1.filter((match) => !isCode(match.index ?? START$10)), Array$1.map((match) => problemAtIndex(RULE$17)(file, source)(match.index ?? START$10, MESSAGE$2)));
17578
+ return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => !isCode(match.index ?? START$11)), Array$1.map((match) => problemAtIndex(RULE$18)(file, source)(match.index ?? START$11, MESSAGE$2)));
17381
17579
  };
17382
17580
  const isChecked = (name) => String$1.endsWith(MARKDOWN$3)(name) && !pipe(SKIPPED_DIRECTORIES, Array$1.some((directory) => String$1.includes(directory)(`/${name}`))) && !pipe(SKIPPED_FILES, Array$1.some((skipped) => name === skipped || String$1.endsWith(`/${skipped}`)(name)));
17383
17581
  /** @internal */
@@ -17389,6 +17587,96 @@ const checkMarkdownDirectives = Effect.fn("checkMarkdownDirectives")(function* c
17389
17587
  file: files.join(root, name)
17390
17588
  }))), ({ file }, source) => problemsIn$7(file, source));
17391
17589
  });
17590
+ // src/features/check-owner-names/model/owner-names.ts
17591
+ const RULE$17 = "owner-name";
17592
+ const TEXT_FILE = /\.(?:[cm]?[jt]sx?|jsonc?|md|ya?ml|toml)$/u;
17593
+ const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
17594
+ const SEPARATOR$1 = "/";
17595
+ const START$10 = 0;
17596
+ const DECLARED = [
17597
+ "dependencies",
17598
+ "devDependencies",
17599
+ "peerDependencies"
17600
+ ];
17601
+ const CONFIG_FILE$1 = "vite.config.ts";
17602
+ const ANY_OWNER = /\banyOwner:\s*true\b/u;
17603
+ const escaped = (text) => String$1.replaceAll(REGEX_SPECIAL, String.raw`\$&`)(text);
17604
+ const messageFor$2 = (owner) => `names ${owner}, the owner of this repository, but msch.publish.anyOwner says this package works for any owner. Derive the value from the repository it runs in: its package.json, its git remote or its files. A package of an allowed scope is named in full, as @scope/name.`;
17605
+ const spansOf = (pattern, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.flatMap((match) => {
17606
+ const [token] = match;
17607
+ return pipe(Option.fromUndefinedOr(match.index), Option.map((start) => ({
17608
+ start,
17609
+ end: start + token.length
17610
+ })), Option.toArray);
17611
+ }));
17612
+ const scopedSpans = (scopes, source) => {
17613
+ if (!Array$1.isReadonlyArrayNonEmpty(scopes)) return [];
17614
+ const names = pipe(scopes, Array$1.map(escaped), Array$1.join("|"));
17615
+ return spansOf(new RegExp(`(?:${names})[\\w.*/-]*`, "gu"), source);
17616
+ };
17617
+ /** @internal */
17618
+ const ownerOffsets = ({ owner, scopes, source }) => {
17619
+ const allowed = scopedSpans(scopes, source);
17620
+ const named = new RegExp(escaped(owner), "giu");
17621
+ const isAllowed = (start) => pipe(allowed, Array$1.some((span) => span.start <= start && start < span.end));
17622
+ return pipe(spansOf(named, source), Array$1.filter(({ start }) => !isAllowed(start)), Array$1.map(({ start }) => start));
17623
+ };
17624
+ const scopesOf = (manifest) => pipe([...Option.toArray(Option.fromUndefinedOr(manifest.name)), ...namesIn(manifest, DECLARED)], Array$1.flatMap((name) => Option.toArray(scopeOfName(name))), Array$1.dedupe);
17625
+ const describedText = (manifest) => pipe([manifest.description ?? "", ...manifest.keywords ?? []], Array$1.join("\n"));
17626
+ const manifestProblems$3 = ({ owner, file, manifest }) => pipe(ownerOffsets({
17627
+ owner,
17628
+ scopes: scopesOf(manifest),
17629
+ source: describedText(manifest)
17630
+ }), Array$1.head, Option.toArray, Array$1.map(() => ({
17631
+ file,
17632
+ ...positionOf("")(START$10),
17633
+ rule: RULE$17,
17634
+ message: `Its description or keywords ${messageFor$2(owner)}`
17635
+ })));
17636
+ const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProblems(root, owner, directory) {
17637
+ const files = yield* RepositoryFiles;
17638
+ const manifest = yield* readManifest(directory);
17639
+ if (Option.isNone(manifest)) return [];
17640
+ const prefix = `${files.relative(root, directory)}${SEPARATOR$1}`;
17641
+ const names = yield* files.listedFiles(root);
17642
+ const listed = pipe(names, Array$1.filter((name) => String$1.startsWith(prefix)(name) && TEXT_FILE.test(name) && files.basename(name) !== PACKAGE_JSON_FILE && files.basename(name) !== CONFIG_FILE$1), Array$1.map((name) => ({
17643
+ name,
17644
+ file: files.join(root, name)
17645
+ })));
17646
+ const scopes = scopesOf(manifest.value);
17647
+ const inText = yield* scanText(listed, ({ file }, source) => pipe(ownerOffsets({
17648
+ owner,
17649
+ scopes,
17650
+ source
17651
+ }), Array$1.map((offset) => ({
17652
+ file,
17653
+ ...positionOf(source)(offset),
17654
+ rule: RULE$17,
17655
+ message: messageFor$2(owner)
17656
+ }))));
17657
+ return [...manifestProblems$3({
17658
+ owner,
17659
+ file: files.join(directory, PACKAGE_JSON_FILE),
17660
+ manifest: manifest.value
17661
+ }), ...inText];
17662
+ });
17663
+ const anyOwnerDirectories = Effect.fn("anyOwnerDirectories")(function* anyOwnerDirectories(root) {
17664
+ const files = yield* RepositoryFiles;
17665
+ const names = yield* workspaceConfigs(root);
17666
+ const configs = pipe(names, Array$1.map((name) => ({
17667
+ name,
17668
+ file: files.join(root, name)
17669
+ })));
17670
+ return yield* scanText(configs, ({ file }, source) => pipe(Option.liftPredicate(files.dirname(file), () => ANY_OWNER.test(source)), Option.toArray));
17671
+ });
17672
+ /** @internal */
17673
+ const checkOwnerNames = Effect.fn("checkOwnerNames")(function* checkOwnerNames(root) {
17674
+ const origin = yield* repositoryOrigin(root);
17675
+ if (Option.isNone(origin)) return [];
17676
+ const directories = yield* anyOwnerDirectories(root);
17677
+ const found = yield* Effect.forEach(directories, (directory) => workspaceProblems(root, origin.value.owner, directory), { concurrency: 1 });
17678
+ return Array$1.flatten(found);
17679
+ });
17392
17680
  // src/features/find-invisible-characters/model/hidden-unicode.ts
17393
17681
  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;
17394
17682
  const NUL = "\0";
@@ -17427,7 +17715,11 @@ const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHidden
17427
17715
  // src/app/document-checks.ts
17428
17716
  /** @internal */
17429
17717
  const checkDocuments = Effect.fn("checkDocuments")(function* checkDocuments(root) {
17430
- const found = yield* Effect.all([checkHiddenUnicode(root), checkMarkdownDirectives(root)], { concurrency: "unbounded" });
17718
+ const found = yield* Effect.all([
17719
+ checkHiddenUnicode(root),
17720
+ checkMarkdownDirectives(root),
17721
+ checkOwnerNames(root)
17722
+ ], { concurrency: "unbounded" });
17431
17723
  return Array$1.flatten(found);
17432
17724
  });
17433
17725
  // src/features/check-effect-diagnostics/model/effect-diagnostics.ts
@@ -17591,7 +17883,13 @@ const NAME_KEY = "\"name\"";
17591
17883
  const START$5 = 0;
17592
17884
  const unscopedName = (scope) => ({ manifest }) => pipe(Option.fromUndefinedOr(manifest.name), Option.filter((name) => !String$1.startsWith(scope)(name)));
17593
17885
  const nameIndex = (source) => pipe(String$1.indexOf(NAME_KEY)(source), Option.getOrElse(() => START$5));
17594
- const messageFor$1 = (scope, name) => `Packages are published only under the ${scope} scope. Rename "${name}" to "${scope}${String$1.replace(/^@[^/]+\//u, "")(name)}".`;
17886
+ const BY_COUNT = Order.mapInput(Order.Number, ([, names]) => names.length);
17887
+ /** @internal */
17888
+ const sharedScope = (names) => pipe(names, Array$1.flatMap((name) => Option.toArray(scopeOfName(name))), Array$1.groupBy((scope) => scope), Record.toEntries, Array$1.sortBy(Order.mapInput(Order.String, ([scope]) => scope)), Array$1.match({
17889
+ onEmpty: () => Option.none(),
17890
+ onNonEmpty: (groups) => Option.some(Array$1.max(BY_COUNT)(groups)[START$5])
17891
+ }));
17892
+ const messageFor$1 = (scope, name) => `Most packages of this repository are published under the ${scope} scope, and one scope tells whose packages they are. Rename "${name}" to "${scope}${String$1.replace(/^@[^/]+\//u, "")(name)}".`;
17595
17893
  /** @internal */
17596
17894
  const scopeProblems = (scope) => (found) => pipe(unscopedName(scope)(found), Option.map((name) => problemAtIndex(RULE$11)(found.entry.file, found.source)(nameIndex(found.source), messageFor$1(scope, name))), Option.toArray);
17597
17895
  // src/features/check-published-manifest/model/private-dependency.ts
@@ -17615,10 +17913,15 @@ const checkPublishedManifests = Effect.fn("checkPublishedManifests")(function* c
17615
17913
  const files = yield* RepositoryFiles;
17616
17914
  const homepage = homepageProblems(files.dirname);
17617
17915
  const privateNames = yield* privateNamesIn(root);
17618
- const { scope } = yield* ownerSettings(root);
17619
17916
  const privateDependencies = privateDependencyProblems(privateNames);
17917
+ const names = [];
17918
+ yield* scanPublishedManifests(root, ({ manifest }) => {
17919
+ names.push(...Option.toArray(Option.fromUndefinedOr(manifest.name)));
17920
+ return [];
17921
+ });
17922
+ const scoped = pipe(sharedScope(names), Option.map(scopeProblems), Option.getOrElse(() => () => []));
17620
17923
  return yield* scanPublishedManifests(root, (found) => [
17621
- ...scopeProblems(scope)(found),
17924
+ ...scoped(found),
17622
17925
  ...homepage(found),
17623
17926
  ...privateDependencies(found)
17624
17927
  ]);
@@ -18108,12 +18411,10 @@ const syncReadme = Effect.fn("syncReadme")(function* syncReadme({ directory, ski
18108
18411
  yield* files.writeFile(file, expected);
18109
18412
  return [problem$2(file, `The skills table between ${SKILLS_START} and ${SKILLS_END} is generated from the SKILL.md frontmatter of the plugin. msch rewrote it; commit the result.`)];
18110
18413
  });
18414
+ const labelsOf = ({ published }) => pipe(Option.liftPredicate(ENGLISH_LABELS, () => published), Option.getOrElse(() => JAPANESE_LABELS));
18111
18415
  /** @internal */
18112
18416
  const checkReadmeSkills = Effect.fn("checkReadmeSkills")(function* checkReadmeSkills(root) {
18113
18417
  const plugins = yield* pluginsIn$1(root);
18114
- const { publishRegistry } = yield* ownerSettings(root);
18115
- const english = isPublicRegistry(publishRegistry);
18116
- const labelsOf = ({ published }) => pipe(Option.liftPredicate(ENGLISH_LABELS, () => published && english), Option.getOrElse(() => JAPANESE_LABELS));
18117
18418
  const withSkills = pipe(plugins, Array$1.filter(({ skills }) => Array$1.isReadonlyArrayNonEmpty(skills)));
18118
18419
  const found = yield* Effect.forEach(withSkills, (plugin) => syncReadme(plugin, labelsOf(plugin)), { concurrency: "unbounded" });
18119
18420
  return Array$1.flatten(found);
@@ -18218,7 +18519,6 @@ const checkSkillEnumerations = Effect.fn("checkSkillEnumerations")(function* che
18218
18519
  });
18219
18520
  // src/features/check-skill-references/model/skill-references.ts
18220
18521
  const RULE$2 = "skill-reference";
18221
- const HUB = "masseater-style";
18222
18522
  const OWNER_PREFIX = "do-";
18223
18523
  const MARKDOWN$1 = ".md";
18224
18524
  const CONCURRENCY$1 = 16;
@@ -18252,19 +18552,22 @@ const ownerOnlyMessages = (skill, qualified) => pipe(Option.liftPredicate(skill,
18252
18552
  ]));
18253
18553
  const ownerProblems = (skill, qualified) => pipe([prefixMessage(skill), ...ownerOnlyMessages(skill, qualified)], Array$1.getSomes, Array$1.map((message) => problem$1(skill.file, message)));
18254
18554
  const hubProblems = (hub, names) => pipe(groupsOf(NAMED_IN_BACKTICKS, hub.source), Array$1.filter((name) => !names.has(name)), Array$1.map((name) => problem$1(hub.file, `names ${name}, which is not a skill.`)));
18255
- const documentProblems = Effect.fn("documentProblems")(function* documentProblems(file, skill, others) {
18555
+ const documentProblems = Effect.fn("documentProblems")(function* documentProblems({ file, hub }, skill, others) {
18256
18556
  const text = yield* (yield* RepositoryFiles).readFile(file);
18257
18557
  const body = String$1.replace(FRONTMATTER, "")(Option.getOrElse(text, () => ""));
18258
- return pipe(others, Array$1.filter((other) => other.name !== skill.name && namesSkill(other.name)(body)), Array$1.map((other) => problem$1(file, `names ${other.name}. Only ${HUB} names other skills; point to it from the hub instead.`)));
18558
+ return pipe(others, Array$1.filter((other) => other.name !== skill.name && namesSkill(other.name)(body)), Array$1.map((other) => problem$1(file, `names ${other.name}. Only ${hub.name} names other skills; point to it from the hub instead.`)));
18259
18559
  });
18260
- const spokeProblems = Effect.fn("spokeProblems")(function* spokeProblems(skill, others) {
18560
+ const spokeProblems = Effect.fn("spokeProblems")(function* spokeProblems(hub, skill, others) {
18261
18561
  const documents = pipe(skill.files, Array$1.filter(String$1.endsWith(MARKDOWN$1)));
18262
- const found = yield* Effect.forEach(documents, (file) => documentProblems(file, skill, others), { concurrency: CONCURRENCY$1 });
18562
+ const found = yield* Effect.forEach(documents, (file) => documentProblems({
18563
+ file,
18564
+ hub
18565
+ }, skill, others), { concurrency: CONCURRENCY$1 });
18263
18566
  return Array$1.flatten(found);
18264
18567
  });
18265
18568
  const referencesFrom = Effect.fn("referencesFrom")(function* referencesFrom(hub, skills) {
18266
- const others = pipe(skills, Array$1.filter((skill) => skill.name !== HUB && !isOwnerEntry(skill)));
18267
- const spokes = yield* Effect.forEach(others, (skill) => spokeProblems(skill, others), { concurrency: CONCURRENCY$1 });
18569
+ const others = pipe(skills, Array$1.filter((skill) => skill.name !== hub.name && !isOwnerEntry(skill)));
18570
+ const spokes = yield* Effect.forEach(others, (skill) => spokeProblems(hub, skill, others), { concurrency: CONCURRENCY$1 });
18268
18571
  const names = new Set(pipe(skills, Array$1.map(({ name }) => name)));
18269
18572
  return [...hubProblems(hub, names), ...Array$1.flatten(spokes)];
18270
18573
  });
@@ -18274,7 +18577,7 @@ const checkSkillReferences = Effect.fn("checkSkillReferences")(function* checkSk
18274
18577
  const skills = pipe(plugins, Array$1.flatMap(({ skills: own }) => own));
18275
18578
  const qualified = new Set(pipe(skills, Array$1.map(({ plugin, name }) => `${plugin}${QUALIFIER}${name}`)));
18276
18579
  const owners = pipe(skills, Array$1.flatMap((skill) => ownerProblems(skill, qualified)));
18277
- const hub = Array$1.findFirst(skills, ({ name }) => name === HUB);
18580
+ const hub = Array$1.findFirst(skills, ({ frontmatter }) => isIndexSkill(frontmatter));
18278
18581
  const hubbed = yield* Option.match(hub, {
18279
18582
  onNone: () => Effect.succeed([]),
18280
18583
  onSome: (found) => referencesFrom(found, skills)