@r_masseater/msch 0.124.0 → 0.126.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -14,8 +14,8 @@ import { decodePackageJson, decodeVersionedPackageJson, readPackageJson, readRaw
14
14
  import { a as workspaceConfigs, c as publicEntriesOf, d as FRONTMATTER, f as splitFrontmatter, g as deployEntries, h as bundledEntries$1, i as publishedWorkspaces, l as modDirectories, m as workspaceLinks, o as entryNameOf, r as packedWorkspaces, s as isBinEntry, u as isIndexSkill, v as shadcnUiOf } from "./published-DkH6B-Gr.mjs";
15
15
  import { parse, resolveConfigFromFile } from "vite-plus";
16
16
  import { i as USAGE_SPOOL, n as DECISION_TIMEOUT_MS, r as JAPANESE, t as DECISION_MODEL } from "./config-B3SYjao5.mjs";
17
- import { _ as patternOf$1, a as CI_TASKS, c as MSCH_VERIFY_COMMANDS, f as existsAt, g as namedWorkspaces, m as isIgnored, n as builtTextRuleNames, r as secretsOf, s as MSCH_TASK_COMMANDS, t as TEXT_IGNORES, u as meteredCommand } from "./repository-text-DfTSvaqo.mjs";
18
- import { fileURLToPath } from "node:url";
17
+ import { _ as namedWorkspaces, a as TEXT_IGNORES, c as CI_TASKS, d as MSCH_VERIFY_COMMANDS, f as meteredCommand, g as isIgnored, h as existsAt, l as GIT_HOOKS, m as fu4Of, n as FORMAT, o as builtTextRuleNames, r as STAGED$1, s as secretsOf, t as COMMIT_LINT, u as MSCH_TASK_COMMANDS, v as patternOf$1 } from "./repository-config-8JN86BZA.mjs";
18
+ import { fileURLToPath, pathToFileURL } from "node:url";
19
19
  import treeSitter from "@vscode/tree-sitter-wasm";
20
20
  import { t as startedOnce } from "./started-once-BN_hLlmU.mjs";
21
21
  import { getStaticTOMLValue, parseTOML } from "toml-eslint-parser";
@@ -35,6 +35,7 @@ import { DockerfileParser } from "dockerfile-ast";
35
35
  import { parse as parse$2 } from "sql-parser-cst";
36
36
  import { findPackageJson } from "@r_masseater/masseater-utils/kestrion/node";
37
37
  import { findSkillFiles } from "@tanstack/intent";
38
+ import { moduleFiles } from "@r_masseater/cc-effect-hooks";
38
39
  import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http";
39
40
  import { runMainWith } from "@r_masseater/masseater-utils/node-main";
40
41
  import { sdkAgentQuery } from "@r_masseater/masseater-utils/agent-query";
@@ -48,7 +49,7 @@ import { Buffer } from "node:buffer";
48
49
  import { createZstdDecompress } from "node:zlib";
49
50
  // package.json
50
51
  var name = "@r_masseater/msch";
51
- var version = "0.124.0";
52
+ var version = "0.126.0";
52
53
  var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
53
54
  var repository = {
54
55
  "type": "git",
@@ -691,7 +692,7 @@ const owningWorkspace = (directories) => (directory) => {
691
692
  const PLUGIN_FILE$4 = ".claude-plugin/plugin.json";
692
693
  const SKILLS_DIRECTORY = "skills";
693
694
  const SKILL_FILE$4 = "SKILL.md";
694
- const CONCURRENCY$6 = 16;
695
+ const CONCURRENCY$7 = 16;
695
696
  const SEPARATOR$27 = "/";
696
697
  const PluginManifest$1 = Schema.fromJsonString(Schema.Struct({
697
698
  name: Schema.String,
@@ -731,7 +732,7 @@ const skillsOf$1 = Effect.fn("skillsOf")(function* skillsOf(scan, plugin, direct
731
732
  const found = yield* Effect.forEach(names, (entry) => skillIn(scan, {
732
733
  plugin,
733
734
  skills
734
- }, entry), { concurrency: CONCURRENCY$6 });
735
+ }, entry), { concurrency: CONCURRENCY$7 });
735
736
  return Array$1.sort(Array$1.getSomes(found), bySkillName);
736
737
  });
737
738
  const packageVersionAt = Effect.fn("packageVersionAt")(function* packageVersionAt(directory) {
@@ -770,7 +771,7 @@ const pluginsIn$1 = Effect.fn("pluginsIn")(function* pluginsIn(root) {
770
771
  }, {
771
772
  directory: files.join(root, directory),
772
773
  published
773
- }), { concurrency: CONCURRENCY$6 });
774
+ }), { concurrency: CONCURRENCY$7 });
774
775
  return Array$1.getSomes(found);
775
776
  });
776
777
  const HYPHENATED = "-";
@@ -1095,12 +1096,12 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, foundIn) {
1095
1096
  // src/features/check-overrides/model/git-subpath.ts
1096
1097
  const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
1097
1098
  const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
1098
- const RULE$80 = "git-subpath-dependency";
1099
+ const RULE$81 = "git-subpath-dependency";
1099
1100
  const WHOLE_MATCH$4 = 0;
1100
1101
  const problemAt$5 = ({ file }, source) => (found) => ({
1101
1102
  file,
1102
1103
  ...positionOf(source)(found.index ?? WHOLE_MATCH$4),
1103
- rule: RULE$80,
1104
+ rule: RULE$81,
1104
1105
  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])}\`.`
1105
1106
  });
1106
1107
  const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$5(entry, source)));
@@ -1111,13 +1112,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
1111
1112
  return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$24);
1112
1113
  });
1113
1114
  // src/features/check-overrides/model/restricted-rules.ts
1114
- const RULE$79 = "unnamed-restriction";
1115
+ const RULE$80 = "unnamed-restriction";
1115
1116
  const WHOLE_MATCH$3 = 0;
1116
1117
  const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-[a-z]+(?:-[a-z]+)*\\b`, "gu");
1117
1118
  const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
1118
1119
  file: entry.file,
1119
1120
  ...positionOf(source)(found.index ?? WHOLE_MATCH$3),
1120
- rule: RULE$79,
1121
+ rule: RULE$80,
1121
1122
  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.`
1122
1123
  })));
1123
1124
  /** @internal */
@@ -1126,13 +1127,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
1126
1127
  return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
1127
1128
  });
1128
1129
  // src/features/check-overrides/model/type-exemptions.ts
1129
- const RULE$78 = "named-type-exemption";
1130
+ const RULE$79 = "named-type-exemption";
1130
1131
  const WHOLE_MATCH$2 = 0;
1131
1132
  const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
1132
1133
  const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
1133
1134
  file: entry.file,
1134
1135
  ...positionOf(source)(found.index ?? WHOLE_MATCH$2),
1135
- rule: RULE$78,
1136
+ rule: RULE$79,
1136
1137
  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."
1137
1138
  })));
1138
1139
  /** @internal */
@@ -1148,7 +1149,7 @@ const INSTALL_REGISTRY = "https://npm.flatt.tech/";
1148
1149
  const withTrailingSlash = (url) => `${String$1.replace(TRAILING_SLASH$1, "")(url)}/`;
1149
1150
  const scopeOfName = (name) => pipe(Option.liftPredicate(name, String$1.startsWith("@")), Option.flatMap((scoped) => pipe(String$1.indexOf(SCOPE_SEPARATOR)(scoped), Option.map((end) => String$1.takeLeft(scoped, end + 1)))));
1150
1151
  // src/features/check-overrides/model/package-registry.ts
1151
- const RULE$77 = "package-registry";
1152
+ const RULE$78 = "package-registry";
1152
1153
  const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
1153
1154
  const NPMRC = /(?:^|\/)\.npmrc$/u;
1154
1155
  const WORKSPACE_REGISTRY = /^registry:/mu;
@@ -1162,7 +1163,7 @@ const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ in
1162
1163
  const workspaceProblem = ({ file, source }, registry) => ({
1163
1164
  file,
1164
1165
  ...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
1165
- rule: RULE$77,
1166
+ rule: RULE$78,
1166
1167
  message: Option.match(registry, {
1167
1168
  onNone: () => `${REASON$4} Set \`registry: ${INSTALL_REGISTRY}\` in ${WORKSPACE_FILE$6}.`,
1168
1169
  onSome: (value) => `${REASON$4} \`registry\` is ${value}. Set it to ${INSTALL_REGISTRY}.`
@@ -1171,7 +1172,7 @@ const workspaceProblem = ({ file, source }, registry) => ({
1171
1172
  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) => ({
1172
1173
  file: entry.file,
1173
1174
  ...positionOf(source)(found.index ?? START$34),
1174
- rule: RULE$77,
1175
+ rule: RULE$78,
1175
1176
  message: `${REASON$4} This .npmrc overrides it with \`${String$1.trim(found[START$34])}\`. Remove the line.`
1176
1177
  })));
1177
1178
  const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
@@ -1194,6 +1195,30 @@ const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPa
1194
1195
  const overrides = yield* scanText(pipe(listed, Array$1.filter(({ name }) => NPMRC.test(name))), npmrcProblems);
1195
1196
  return [...yield* checkWorkspace(root), ...overrides];
1196
1197
  });
1198
+ // src/shared/lib/repository-origin.ts
1199
+ const ORIGIN = /[:/](?<owner>[^/:]+)\/(?<name>[^/]+?)(?:\.git)?\/?$/u;
1200
+ /** @internal */
1201
+ const originOf = (url) => pipe(Option.fromNullishOr(ORIGIN.exec(url)), Option.flatMap(({ groups }) => Option.fromNullishOr(groups)), Option.flatMap(({ owner, name }) => Option.all({
1202
+ owner: Option.fromNullishOr(owner),
1203
+ name: Option.fromNullishOr(name)
1204
+ })));
1205
+ /** @internal */
1206
+ const repositoryOrigin = Effect.fn("repositoryOrigin")(function* repositoryOrigin(root) {
1207
+ const url = yield* (yield* RepositoryFiles).originUrl(root);
1208
+ return pipe(url, Option.flatMap(originOf));
1209
+ });
1210
+ /** @internal */
1211
+ const slugOf = ({ owner, name }) => `${owner}/${name}`;
1212
+ // src/entities/package/model/renovate-preset.ts
1213
+ const RepositoryField = Schema.Struct({
1214
+ url: Schema.String,
1215
+ directory: Schema.String
1216
+ });
1217
+ const decodeRepository$2 = Schema.decodeUnknownOption(RepositoryField);
1218
+ const renovatePresetOf = Effect.fn("renovatePresetOf")(function* renovatePresetOf(name, base) {
1219
+ const manifest = yield* installedManifest(name, base);
1220
+ return pipe(manifest, Option.flatMap(({ repository }) => decodeRepository$2(repository)), Option.flatMap(({ url, directory }) => pipe(originOf(url), Option.map((origin) => `github>${slugOf(origin)}//${directory}/renovate`))));
1221
+ });
1197
1222
  // src/entities/package/model/stack-catalog.ts
1198
1223
  const STACK_CATALOG = "catalog:stack";
1199
1224
  // src/entities/package/model/specifiers.ts
@@ -1249,7 +1274,7 @@ const SELF_HOMEPAGE = homepage;
1249
1274
  const SELF_DIRECTORY = repository.directory;
1250
1275
  const RENOVATE_PRESET = `github>${pipe(repository.url, String$1.replace(GIT_PREFIX, ""), String$1.replace(GIT_SUFFIX, ""), String$1.replace(GITHUB$6, ""))}//${SELF_DIRECTORY}/renovate`;
1251
1276
  // src/features/check-overrides/model/removed-peers.ts
1252
- const RULE$76 = "removed-peer";
1277
+ const RULE$77 = "removed-peer";
1253
1278
  const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
1254
1279
  const REMOVED = "-";
1255
1280
  const PARENT_SEPARATOR = ">";
@@ -1276,7 +1301,7 @@ const problemAt$4 = (file, { key, line, column }) => ({ peer, dependent }) => ({
1276
1301
  file,
1277
1302
  line,
1278
1303
  column,
1279
- rule: RULE$76,
1304
+ rule: RULE$77,
1280
1305
  message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
1281
1306
  });
1282
1307
  const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
@@ -3417,7 +3442,7 @@ const matcher = (patterns) => {
3417
3442
  String$1.startsWith(NEGATION$1);
3418
3443
  String$1.slice(1);
3419
3444
  // src/features/check-placement/model/colocated-git-patterns.ts
3420
- const RULE$75 = "colocated-git-patterns";
3445
+ const RULE$76 = "colocated-git-patterns";
3421
3446
  const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
3422
3447
  const ROOT$3 = ".";
3423
3448
  const NEGATION = "!";
@@ -3464,7 +3489,7 @@ const entriesIn$2 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
3464
3489
  const toEntry = entryOf$2(absolute, files.basename(file), files.dirname(file));
3465
3490
  return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
3466
3491
  });
3467
- const patternProblem = (entry, message) => problemAtPosition(RULE$75)(entry.file, {
3492
+ const patternProblem = (entry, message) => problemAtPosition(RULE$76)(entry.file, {
3468
3493
  line: entry.line,
3469
3494
  column: FIRST$26
3470
3495
  }, message);
@@ -3527,7 +3552,7 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
3527
3552
  return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
3528
3553
  });
3529
3554
  // src/features/check-placement/model/colocated-tests.ts
3530
- const RULE$74 = "colocated-test";
3555
+ const RULE$75 = "colocated-test";
3531
3556
  const FIRST$25 = 1;
3532
3557
  const READ_CONCURRENCY$39 = 64;
3533
3558
  const ROOT_SUBPATH$1 = ".";
@@ -3550,7 +3575,7 @@ const problemFor$11 = (test, message) => ({
3550
3575
  file: test.file,
3551
3576
  line: FIRST$25,
3552
3577
  column: FIRST$25,
3553
- rule: RULE$74,
3578
+ rule: RULE$75,
3554
3579
  message: `${test.base} ${message}`
3555
3580
  });
3556
3581
  const groupsOf$1 = (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);
@@ -3633,7 +3658,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
3633
3658
  // src/features/check-placement/model/agent-docs-length.ts
3634
3659
  const RECOMMENDED_LINES = 200;
3635
3660
  const FIRST$24 = 1;
3636
- const RULE$73 = "agent-docs-length";
3661
+ const RULE$74 = "agent-docs-length";
3637
3662
  const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
3638
3663
  const problemFor$10 = (file) => (lines) => {
3639
3664
  if (lines <= RECOMMENDED_LINES) return Option.none();
@@ -3641,14 +3666,14 @@ const problemFor$10 = (file) => (lines) => {
3641
3666
  file,
3642
3667
  line: 201,
3643
3668
  column: FIRST$24,
3644
- rule: RULE$73,
3669
+ rule: RULE$74,
3645
3670
  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.`
3646
3671
  });
3647
3672
  };
3648
3673
  /** @internal */
3649
3674
  const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$10(file)(lineCount(source)));
3650
3675
  // src/features/check-placement/model/claude-link.ts
3651
- const RULE$72 = "claude-md-link";
3676
+ const RULE$73 = "claude-md-link";
3652
3677
  const CLAUDE = "CLAUDE.md";
3653
3678
  const AGENTS = "AGENTS.md";
3654
3679
  const FIRST$23 = 1;
@@ -3667,7 +3692,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
3667
3692
  file: path,
3668
3693
  line: FIRST$23,
3669
3694
  column: FIRST$23,
3670
- rule: RULE$72,
3695
+ rule: RULE$73,
3671
3696
  message: MESSAGE$15
3672
3697
  })));
3673
3698
  });
@@ -3676,7 +3701,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
3676
3701
  return Array$1.getSomes(found);
3677
3702
  });
3678
3703
  // src/features/check-placement/model/dangling-links.ts
3679
- const RULE$71 = "dangling-link";
3704
+ const RULE$72 = "dangling-link";
3680
3705
  const SEPARATOR$26 = "/";
3681
3706
  const FIRST$22 = 1;
3682
3707
  const READ_CONCURRENCY$36 = 16;
@@ -3692,7 +3717,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
3692
3717
  file,
3693
3718
  line: FIRST$22,
3694
3719
  column: FIRST$22,
3695
- rule: RULE$71,
3720
+ rule: RULE$72,
3696
3721
  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.`
3697
3722
  })));
3698
3723
  });
@@ -3750,10 +3775,10 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
3750
3775
  }));
3751
3776
  });
3752
3777
  // src/features/check-placement/model/deployed-readme.ts
3753
- const RULE$70 = "deployed-readme";
3778
+ const RULE$71 = "deployed-readme";
3754
3779
  const ROOT_DIRECTORY$4 = "";
3755
3780
  const READ_CONCURRENCY$35 = 16;
3756
- 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.";
3781
+ const MISSING_MESSAGE$3 = "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.";
3757
3782
  const NO_URL_MESSAGE = "has no https:// URL. This workspace has an Alchemy stack that serves an address, so link the URL it is served at.";
3758
3783
  const ADDRESS_KEYS = [
3759
3784
  "domain",
@@ -3790,14 +3815,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
3790
3815
  const readme = yield* readReadme({
3791
3816
  root,
3792
3817
  directory,
3793
- rule: RULE$70,
3794
- missingMessage: MISSING_MESSAGE$2
3818
+ rule: RULE$71,
3819
+ missingMessage: MISSING_MESSAGE$3
3795
3820
  });
3796
3821
  return Result.match(readme, {
3797
3822
  onFailure: Option.some,
3798
3823
  onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
3799
3824
  file,
3800
- rule: RULE$70,
3825
+ rule: RULE$71,
3801
3826
  message: NO_URL_MESSAGE
3802
3827
  })))
3803
3828
  });
@@ -3814,7 +3839,7 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
3814
3839
  return Array$1.getSomes(found);
3815
3840
  });
3816
3841
  // src/features/check-placement/model/nested-docs.ts
3817
- const RULE$69 = "nested-docs";
3842
+ const RULE$70 = "nested-docs";
3818
3843
  const CONFIG_FILE$9 = "vite.config.ts";
3819
3844
  const SEPARATOR$24 = "/";
3820
3845
  const READ_CONCURRENCY$34 = 64;
@@ -3827,10 +3852,10 @@ const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Sc
3827
3852
  const taggedError$13 = Schema.TaggedError;
3828
3853
  var RootConfigUnreadable = class extends taggedError$13()("RootConfigUnreadable", { file: Schema.String }) {};
3829
3854
  const isNested = (name) => String$1.includes(SEPARATOR$24)(name);
3830
- const problemFor$9 = problemInFile(RULE$69);
3855
+ const problemFor$9 = problemInFile(RULE$70);
3831
3856
  const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
3832
3857
  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.";
3833
- 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.";
3858
+ const MISSING_MESSAGE$2 = "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.";
3834
3859
  const README_MESSAGE = "is allowed below the root only in a workspace, the directory that holds its package.json. Move it into the workspace it describes.";
3835
3860
  const agentDocProblem = ({ file, base, directory }, allowed) => {
3836
3861
  if (!allowed.workspaceAgentDocs) return Option.some(problemFor$9(file, `${base} ${AGENT_DOCS_MESSAGE}`));
@@ -3841,7 +3866,7 @@ const readmeProblem = ({ file, base, directory }, allowed) => {
3841
3866
  if (!README.test(base) || HashSet.has(allowed.workspaces, directory)) return Option.none();
3842
3867
  return Option.some(problemFor$9(file, `${base} ${README_MESSAGE}`));
3843
3868
  };
3844
- const missingProblems = ({ required, directories, present, join }) => pipe(directories, Array$1.filter((directory) => required && !HashSet.has(present, join(directory, WORKSPACE_AGENT_DOC))), Array$1.map((directory) => problemInFile(MISSING_RULE)(join(directory, MANIFEST$4), MISSING_MESSAGE$1)));
3869
+ const missingProblems = ({ required, directories, present, join }) => pipe(directories, Array$1.filter((directory) => required && !HashSet.has(present, join(directory, WORKSPACE_AGENT_DOC))), Array$1.map((directory) => problemInFile(MISSING_RULE)(join(directory, MANIFEST$4), MISSING_MESSAGE$2)));
3845
3870
  const problemIn$6 = Effect.fn("problemIn")(function* problemIn(root, allowed, name) {
3846
3871
  const files = yield* RepositoryFiles;
3847
3872
  const file = files.join(root, name);
@@ -3884,16 +3909,16 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
3884
3909
  return [...Array$1.getSomes(found), ...missing];
3885
3910
  });
3886
3911
  // src/features/check-placement/model/published-readme.ts
3887
- const RULE$68 = "published-readme";
3912
+ const RULE$69 = "published-readme";
3888
3913
  const READ_CONCURRENCY$33 = 16;
3889
3914
  const MESSAGE$14 = "contains Japanese. This package is published to npm, so write its README in English.";
3890
- const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
3915
+ const MISSING_MESSAGE$1 = "is missing. This package is published to npm, so give it an English README.md.";
3891
3916
  const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
3892
3917
  const readme = yield* readReadme({
3893
3918
  root,
3894
3919
  directory,
3895
- rule: RULE$68,
3896
- missingMessage: MISSING_MESSAGE
3920
+ rule: RULE$69,
3921
+ missingMessage: MISSING_MESSAGE$1
3897
3922
  });
3898
3923
  return Result.match(readme, {
3899
3924
  onFailure: Option.some,
@@ -3903,7 +3928,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
3903
3928
  file,
3904
3929
  line,
3905
3930
  column,
3906
- rule: RULE$68,
3931
+ rule: RULE$69,
3907
3932
  message: MESSAGE$14
3908
3933
  };
3909
3934
  }))
@@ -3916,7 +3941,7 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
3916
3941
  return Array$1.getSomes(found);
3917
3942
  });
3918
3943
  // src/features/check-placement/model/published-tests.ts
3919
- const RULE$67 = "published-tests";
3944
+ const RULE$68 = "published-tests";
3920
3945
  const FILE_START = 1;
3921
3946
  const TEST_FILE$3 = /\.test\.[cm]?[jt]sx?$/u;
3922
3947
  const MESSAGE$13 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
@@ -3930,7 +3955,7 @@ const problemFor$8 = Effect.fn("problemFor")(function* problemFor(root, listed,
3930
3955
  file: files.join(absolute, PACKAGE_JSON_FILE),
3931
3956
  line: FILE_START,
3932
3957
  column: FILE_START,
3933
- rule: RULE$67,
3958
+ rule: RULE$68,
3934
3959
  message: MESSAGE$13
3935
3960
  });
3936
3961
  });
@@ -3944,7 +3969,7 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
3944
3969
  return Array$1.getSomes(found);
3945
3970
  });
3946
3971
  // src/features/check-placement/model/root-docs.ts
3947
- const RULE$66 = "root-docs";
3972
+ const RULE$67 = "root-docs";
3948
3973
  const SEPARATOR$23 = "/";
3949
3974
  const FIRST$20 = 1;
3950
3975
  const MARKDOWN$6 = /\.(?:md|mdx|markdown)$/iu;
@@ -3959,12 +3984,12 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
3959
3984
  file: files.join(root, name),
3960
3985
  line: FIRST$20,
3961
3986
  column: FIRST$20,
3962
- rule: RULE$66,
3987
+ rule: RULE$67,
3963
3988
  message: `${name} ${MESSAGE$12}`
3964
3989
  })));
3965
3990
  });
3966
3991
  // src/features/check-placement/model/root-readme.ts
3967
- const RULE$65 = "root-readme";
3992
+ const RULE$66 = "root-readme";
3968
3993
  const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
3969
3994
  const READ_CONCURRENCY$32 = 16;
3970
3995
  const START$32 = 0;
@@ -4007,7 +4032,7 @@ const problemsIn$21 = (file, source, plugins) => (workspace) => {
4007
4032
  const message = messageFor$5(workspace.directory);
4008
4033
  const at = positionOf(source);
4009
4034
  const pattern = patternFor(plugins)(workspace);
4010
- return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$65)(file, at(found.index ?? START$32), message)));
4035
+ return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$66)(file, at(found.index ?? START$32), message)));
4011
4036
  };
4012
4037
  const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
4013
4038
  const text = yield* (yield* RepositoryFiles).readFile(file);
@@ -4044,7 +4069,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
4044
4069
  return Array$1.flatten(found);
4045
4070
  });
4046
4071
  // src/features/check-placement/model/docs-mirror.ts
4047
- const RULE$64 = "docs-mirror";
4072
+ const RULE$65 = "docs-mirror";
4048
4073
  const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
4049
4074
  const MIRROR_LIMIT = 3;
4050
4075
  const READ_CONCURRENCY$31 = 16;
@@ -4069,7 +4094,7 @@ const problemFor$7 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
4069
4094
  file,
4070
4095
  line,
4071
4096
  column,
4072
- rule: RULE$64,
4097
+ rule: RULE$65,
4073
4098
  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.`
4074
4099
  };
4075
4100
  }), Option.toArray);
@@ -4101,7 +4126,7 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
4101
4126
  return Array$1.flatten(found);
4102
4127
  });
4103
4128
  // src/features/check-placement/model/ignored-sources.ts
4104
- const RULE$63 = "ignored-sources";
4129
+ const RULE$64 = "ignored-sources";
4105
4130
  const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
4106
4131
  const FIRST$19 = 1;
4107
4132
  const MESSAGE$11 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
@@ -4113,7 +4138,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
4113
4138
  file: files.join(root, file),
4114
4139
  line: FIRST$19,
4115
4140
  column: FIRST$19,
4116
- rule: RULE$63,
4141
+ rule: RULE$64,
4117
4142
  message: MESSAGE$11
4118
4143
  })));
4119
4144
  });
@@ -12870,13 +12895,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
12870
12895
  return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
12871
12896
  });
12872
12897
  // src/features/check-placement/model/shadcn-ui-alias.ts
12873
- const RULE$62 = "shadcn-ui-alias";
12898
+ const RULE$63 = "shadcn-ui-alias";
12874
12899
  const FIRST$18 = 1;
12875
12900
  const problemOf$12 = (directory, { file, alias }) => ({
12876
12901
  file,
12877
12902
  line: FIRST$18,
12878
12903
  column: FIRST$18,
12879
- rule: RULE$62,
12904
+ rule: RULE$63,
12880
12905
  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/*".`
12881
12906
  });
12882
12907
  /** @internal */
@@ -13144,7 +13169,7 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
13144
13169
  ])));
13145
13170
  });
13146
13171
  // src/features/check-repository-layout/model/config-paths.ts
13147
- const RULE$61 = "config-path";
13172
+ const RULE$62 = "config-path";
13148
13173
  const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
13149
13174
  const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
13150
13175
  const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
@@ -13163,7 +13188,7 @@ const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
13163
13188
  const problemOf$11 = (file, source) => (mention) => ({
13164
13189
  file,
13165
13190
  ...positionOf(source)(mention.index),
13166
- rule: RULE$61,
13191
+ rule: RULE$62,
13167
13192
  message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
13168
13193
  });
13169
13194
  const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
@@ -13188,7 +13213,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
13188
13213
  return pipe(patterns, Array$1.map((pattern) => ({
13189
13214
  file,
13190
13215
  ...positionOf(source.value)(indexOfText(source.value)(pattern)),
13191
- rule: RULE$61,
13216
+ rule: RULE$62,
13192
13217
  message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
13193
13218
  })));
13194
13219
  });
@@ -13200,7 +13225,7 @@ const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPath
13200
13225
  return [...Array$1.flatten(found), ...patterns];
13201
13226
  });
13202
13227
  // src/features/check-repository-layout/model/crates.ts
13203
- const RULE$60 = "unverified-crate";
13228
+ const RULE$61 = "unverified-crate";
13204
13229
  const VERSION_RULE = "release-version";
13205
13230
  const APP_DIRECTORIES = ["", "src-tauri"];
13206
13231
  const CARGO_FILE$1 = "Cargo.toml";
@@ -13212,7 +13237,7 @@ const problemFor$6 = (crate, message) => ({
13212
13237
  file: crate.manifest,
13213
13238
  line: FIRST$16,
13214
13239
  column: FIRST$16,
13215
- rule: RULE$60,
13240
+ rule: RULE$61,
13216
13241
  message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
13217
13242
  });
13218
13243
  const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
@@ -13251,7 +13276,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
13251
13276
  return Array$1.getSomes(Array$1.flatten(found));
13252
13277
  });
13253
13278
  // src/features/check-repository-layout/model/deploy-entry-patterns.ts
13254
- const RULE$59 = "deploy-entry-pattern";
13279
+ const RULE$60 = "deploy-entry-pattern";
13255
13280
  const FALLOW_KEYS = [
13256
13281
  "entry",
13257
13282
  "entryPoints",
@@ -13322,7 +13347,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
13322
13347
  return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
13323
13348
  file: path,
13324
13349
  ...positionOf(text.value)(start - kind.offset),
13325
- rule: RULE$59,
13350
+ rule: RULE$60,
13326
13351
  message: `${pattern} ${MESSAGE$10}`
13327
13352
  })));
13328
13353
  });
@@ -13355,7 +13380,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
13355
13380
  return Array$1.flatten(found);
13356
13381
  });
13357
13382
  // src/features/check-repository-layout/model/fallow-entries.ts
13358
- const RULE$58 = "listed-entry";
13383
+ const RULE$59 = "listed-entry";
13359
13384
  const ENTRY_KEYS = [
13360
13385
  "entry",
13361
13386
  "entryPoints",
@@ -13385,7 +13410,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
13385
13410
  return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
13386
13411
  file: path,
13387
13412
  ...positionOf(text.value)(start),
13388
- rule: RULE$58,
13413
+ rule: RULE$59,
13389
13414
  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.`
13390
13415
  })));
13391
13416
  });
@@ -13397,7 +13422,7 @@ const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallow
13397
13422
  return Array$1.flatten(found);
13398
13423
  });
13399
13424
  // src/features/check-repository-layout/model/root-workspace-paths.ts
13400
- const RULE$57 = "root-workspace-path";
13425
+ const RULE$58 = "root-workspace-path";
13401
13426
  const CONFIG_FILE$7 = "vite.config.ts";
13402
13427
  const PATH_CHARACTER = /[\w.@/-]/u;
13403
13428
  const NAME_CHARACTER = /[\w.@-]/u;
@@ -13416,7 +13441,7 @@ const mentions = (directory) => (text) => {
13416
13441
  const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
13417
13442
  file,
13418
13443
  ...positionOf(source)(found.start),
13419
- rule: RULE$57,
13444
+ rule: RULE$58,
13420
13445
  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.`
13421
13446
  })));
13422
13447
  /** @internal */
@@ -13430,7 +13455,7 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
13430
13455
  return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$16(file, source.value, directories)));
13431
13456
  });
13432
13457
  // src/features/check-repository-layout/model/hidden-verify.ts
13433
- const RULE$56 = "hidden-verify";
13458
+ const RULE$57 = "hidden-verify";
13434
13459
  const CONFIG_FILE$6 = "vite.config.ts";
13435
13460
  const FIRST$14 = 1;
13436
13461
  const READ_CONCURRENCY$24 = 8;
@@ -13444,7 +13469,7 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
13444
13469
  file,
13445
13470
  line: FIRST$14,
13446
13471
  column: FIRST$14,
13447
- rule: RULE$56,
13472
+ rule: RULE$57,
13448
13473
  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}.`
13449
13474
  }).pipe(Option.filter(() => verified));
13450
13475
  });
@@ -13455,7 +13480,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
13455
13480
  return Array$1.getSomes(found);
13456
13481
  });
13457
13482
  // src/features/check-repository-layout/model/shared-uncached-tasks.ts
13458
- const RULE$55 = "shared-uncached-task";
13483
+ const RULE$56 = "shared-uncached-task";
13459
13484
  const READ_CONCURRENCY$23 = 8;
13460
13485
  const SHARED = 2;
13461
13486
  const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
@@ -13498,7 +13523,7 @@ const problemsOf$3 = (definitions) => {
13498
13523
  return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
13499
13524
  file,
13500
13525
  ...position,
13501
- rule: RULE$55,
13526
+ rule: RULE$56,
13502
13527
  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.`
13503
13528
  })));
13504
13529
  };
@@ -13509,7 +13534,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
13509
13534
  return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
13510
13535
  });
13511
13536
  // src/features/check-repository-layout/model/tested-verify.ts
13512
- const RULE$54 = "tested-verify";
13537
+ const RULE$55 = "tested-verify";
13513
13538
  const READ_CONCURRENCY$22 = 8;
13514
13539
  const TESTS = new Set(TEST_TASK_NAMES);
13515
13540
  const RUNS_TESTS = /\b(?:vp|cargo) test\b/u;
@@ -13538,7 +13563,7 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directo
13538
13563
  return pipe(Option.toArray(config), Array$1.flatMap(({ file, source, program }) => pipe(testedEdges(runTasksIn(program)), Array$1.map(({ to, at }) => ({
13539
13564
  file,
13540
13565
  ...positionOf(source)(at.start),
13541
- rule: RULE$54,
13566
+ rule: RULE$55,
13542
13567
  message: `The verify task of ${directory} runs tests through ${to}. verify is what the pre-push hook runs, and tests run in CI through the root ci task, which runs the test and cargo-test tasks of every workspace. Move them into this workspace's test or cargo-test task, and take them out of verify.`
13543
13568
  })))));
13544
13569
  });
@@ -13549,7 +13574,7 @@ const checkTestedVerify = Effect.fn("checkTestedVerify")(function* checkTestedVe
13549
13574
  return Array$1.flatten(found);
13550
13575
  });
13551
13576
  // src/features/check-repository-layout/model/unlocked-tasks.ts
13552
- const RULE$53 = "unlocked-task";
13577
+ const RULE$54 = "unlocked-task";
13553
13578
  const READ_CONCURRENCY$21 = 8;
13554
13579
  const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
13555
13580
  const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
@@ -13561,7 +13586,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
13561
13586
  const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
13562
13587
  file,
13563
13588
  ...positionOf(source)(task.start),
13564
- rule: RULE$53,
13589
+ rule: RULE$54,
13565
13590
  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.`
13566
13591
  })), Option.toArray)));
13567
13592
  /** @internal */
@@ -13877,7 +13902,7 @@ const baseRevision = Effect.fn("baseRevision")(function* baseRevision(root) {
13877
13902
  return yield* files.mergeBase(root, base);
13878
13903
  });
13879
13904
  // src/features/check-migration-order/model/migration-order.ts
13880
- const RULE$52 = "migration-order";
13905
+ const RULE$53 = "migration-order";
13881
13906
  const SNAPSHOT = "snapshot.json";
13882
13907
  const MIGRATION = "migration.sql";
13883
13908
  const SNAPSHOTS = [`*/${SNAPSHOT}`];
@@ -13911,7 +13936,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
13911
13936
  file: join(root, file),
13912
13937
  line: FIRST$13,
13913
13938
  column: FIRST$13,
13914
- rule: RULE$52,
13939
+ rule: RULE$53,
13915
13940
  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}.`
13916
13941
  })))), Option.getOrElse(() => []));
13917
13942
  /** @internal */
@@ -14014,15 +14039,15 @@ const vendorFiles = Effect.fn("vendorFiles")(function* vendorFiles(request) {
14014
14039
  return pipe(output.output, Array$1.filter(isChunk$2), Array$1.map((chunk) => [chunk.fileName, chunk.code]), Record.fromEntries, Record.set(`${request.name}.d.ts`, `export * from "${request.name}";\n`));
14015
14040
  });
14016
14041
  // src/features/check-mod-vendor/model/mod-vendor.ts
14017
- const RULE$51 = "mod-vendor";
14042
+ const RULE$52 = "mod-vendor";
14018
14043
  const VENDOR = "vendor";
14019
14044
  const SOURCE_FILE$2 = /\.[cm]?[jt]sx?$/u;
14020
14045
  const RELATIVE$1 = /^\.\.?\//u;
14021
14046
  const FILE_LIMIT = 1048576;
14022
14047
  const TOTAL_LIMIT = 8388608;
14023
- const CONCURRENCY$5 = 4;
14048
+ const CONCURRENCY$6 = 4;
14024
14049
  const EMPTY$3 = "";
14025
- const problemFor$5 = problemInFile(RULE$51);
14050
+ const problemFor$5 = problemInFile(RULE$52);
14026
14051
  const isModSource = (directory) => (file) => String$1.startsWith(directory)(file) && !String$1.startsWith(`${directory}${VENDOR}/`)(file) && SOURCE_FILE$2.test(file);
14027
14052
  const sourcesOf$2 = (plugin, directory, join) => pipe(plugin.files, Array$1.filter(isModSource(directory)), Array$1.map((file) => join(plugin.directory, file)));
14028
14053
  const modsOf = Effect.fn("modsOf")(function* modsOf(root, plugin) {
@@ -14045,7 +14070,7 @@ const wantedIn$1 = Effect.fn("wantedIn")(function* wantedIn(mod, file) {
14045
14070
  return pipe(declarations, Array$1.filter(({ specifier }) => RELATIVE$1.test(specifier)), Array$1.flatMap(({ specifier, names }) => pipe(packagesOf(specifier), Array$1.map((name) => [name, names]))));
14046
14071
  });
14047
14072
  const wantedOf = Effect.fn("wantedOf")(function* wantedOf(mod) {
14048
- const found = yield* Effect.forEach(mod.sources, (file) => wantedIn$1(mod, file), { concurrency: CONCURRENCY$5 });
14073
+ const found = yield* Effect.forEach(mod.sources, (file) => wantedIn$1(mod, file), { concurrency: CONCURRENCY$6 });
14049
14074
  return pipe(Array$1.flatten(found), Array$1.groupBy(([name]) => name), Record.map(Array$1.flatMap(([, names]) => names)));
14050
14075
  });
14051
14076
  const expectedOf = Effect.fn("expectedOf")(function* expectedOf(mod, wanted) {
@@ -14060,7 +14085,7 @@ const expectedOf = Effect.fn("expectedOf")(function* expectedOf(mod, wanted) {
14060
14085
  const currentOf = Effect.fn("currentOf")(function* currentOf(mod) {
14061
14086
  const files = yield* RepositoryFiles;
14062
14087
  const entries = yield* files.walkDirectory(mod.vendor);
14063
- const read = yield* Effect.forEach(entries, (name) => files.readFile(files.join(mod.vendor, name)).pipe(Effect.map(Option.map((text) => [name, text]))), { concurrency: CONCURRENCY$5 });
14088
+ const read = yield* Effect.forEach(entries, (name) => files.readFile(files.join(mod.vendor, name)).pipe(Effect.map(Option.map((text) => [name, text]))), { concurrency: CONCURRENCY$6 });
14064
14089
  return Record.fromEntries(Array$1.getSomes(read));
14065
14090
  });
14066
14091
  const byteLength = (text) => new TextEncoder().encode(text).length;
@@ -14071,15 +14096,15 @@ const sizeProblems = (mod, expected) => {
14071
14096
  return [...fileProblems(mod, sizes), ...totalProblems(mod, sizes)];
14072
14097
  };
14073
14098
  const sameFiles = (current, expected) => Record.size(current) === Record.size(expected) && pipe(Record.toEntries(expected), Array$1.every(([name, text]) => Option.contains(Record.get(current, name), text)));
14074
- const rewrite$1 = Effect.fn("rewrite")(function* rewrite(mod, current, expected) {
14099
+ const rewrite$2 = Effect.fn("rewrite")(function* rewrite(mod, current, expected) {
14075
14100
  const files = yield* RepositoryFiles;
14076
14101
  const stale = pipe(Record.keys(current), Array$1.filter((name) => !Record.has(expected, name)));
14077
14102
  yield* Effect.forEach(stale, (name) => files.removeFile(files.join(mod.vendor, name)), {
14078
- concurrency: CONCURRENCY$5,
14103
+ concurrency: CONCURRENCY$6,
14079
14104
  discard: true
14080
14105
  });
14081
14106
  yield* Effect.forEach(Record.toEntries(expected), ([name, text]) => files.writeFile(files.join(mod.vendor, name), text), {
14082
- concurrency: CONCURRENCY$5,
14107
+ concurrency: CONCURRENCY$6,
14083
14108
  discard: true
14084
14109
  });
14085
14110
  });
@@ -14090,7 +14115,7 @@ const syncMod = Effect.fn("syncMod")(function* syncMod(mod) {
14090
14115
  const current = yield* currentOf(mod);
14091
14116
  const sized = sizeProblems(mod, expected);
14092
14117
  if (sameFiles(current, expected)) return sized;
14093
- yield* rewrite$1(mod, current, expected);
14118
+ yield* rewrite$2(mod, current, expected);
14094
14119
  return [problemFor$5(mod.vendor, REWRITTEN), ...sized];
14095
14120
  });
14096
14121
  const failedBundle = (mod) => (detail) => [problemFor$5(mod.vendor, `The vendor directory could not be bundled. ${detail}`)];
@@ -14100,8 +14125,8 @@ const checkMod = Effect.fn("checkMod")(function* checkMod(mod) {
14100
14125
  /** @internal */
14101
14126
  const checkModVendor = Effect.fn("checkModVendor")(function* checkModVendor(root) {
14102
14127
  const plugins = yield* pluginsIn$1(root);
14103
- const mods = yield* Effect.forEach(plugins, (plugin) => modsOf(root, plugin), { concurrency: CONCURRENCY$5 });
14104
- const found = yield* Effect.forEach(Array$1.flatten(mods), checkMod, { concurrency: CONCURRENCY$5 });
14128
+ const mods = yield* Effect.forEach(plugins, (plugin) => modsOf(root, plugin), { concurrency: CONCURRENCY$6 });
14129
+ const found = yield* Effect.forEach(Array$1.flatten(mods), checkMod, { concurrency: CONCURRENCY$6 });
14105
14130
  return Array$1.flatten(found);
14106
14131
  });
14107
14132
  // src/features/check-plugin-dependencies/model/unresolved-imports.ts
@@ -14128,7 +14153,7 @@ const unresolvedFrom = (entries) => Effect.acquireUseRelease(Effect.tryPromise({
14128
14153
  catch: bundleErrorDetail
14129
14154
  }), (bundle) => Effect.promise(() => bundle.close())).pipe(Effect.map(({ output }) => unresolvedIn(pipe(output, Array$1.filter(isChunk$1)))));
14130
14155
  // src/features/check-plugin-dependencies/model/plugin-dependencies.ts
14131
- const RULE$50 = "plugin-dependencies";
14156
+ const RULE$51 = "plugin-dependencies";
14132
14157
  const PLUGIN_FILE$3 = ".claude-plugin/plugin.json";
14133
14158
  const LOCK_FILE = "bun.lock";
14134
14159
  const SOURCE_FILE$1 = /\.[cm]?[jt]sx?$/u;
@@ -14137,7 +14162,7 @@ const SUCCESS$6 = 0;
14137
14162
  const NOT_STARTED = -1;
14138
14163
  const DETAIL_LINES = 3;
14139
14164
  const PLUGIN_CONCURRENCY = 2;
14140
- const problemFor$4 = problemInFile(RULE$50);
14165
+ const problemFor$4 = problemInFile(RULE$51);
14141
14166
  const hasDependencies = Effect.fn("hasDependencies")(function* hasDependencies(directory) {
14142
14167
  const files = yield* RepositoryFiles;
14143
14168
  const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));
@@ -14366,7 +14391,7 @@ const bundleScopeOf = ({ manifest, workspace }) => ({
14366
14391
  });
14367
14392
  const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
14368
14393
  // src/features/check-tree-shaking/model/optional-peers.ts
14369
- const RULE$49 = "optional-peer";
14394
+ const RULE$50 = "optional-peer";
14370
14395
  const REQUIRED_RULE = "required-peer";
14371
14396
  const START$28 = 0;
14372
14397
  const SINGLE$3 = 1;
@@ -14383,7 +14408,7 @@ const positionIn = (located, key, name) => {
14383
14408
  const problemFor$3 = (located, name, importers) => ({
14384
14409
  file: located.file,
14385
14410
  ...positionIn(located, DEPENDENCIES_KEY, name),
14386
- rule: RULE$49,
14411
+ rule: RULE$50,
14387
14412
  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.`
14388
14413
  });
14389
14414
  const requiredPeerAdvice = (fromStack) => {
@@ -14419,7 +14444,7 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
14419
14444
  }));
14420
14445
  };
14421
14446
  // src/features/check-tree-shaking/model/side-effects.ts
14422
- const RULE$48 = "side-effects";
14447
+ const RULE$49 = "side-effects";
14423
14448
  const BUNDLE_CONCURRENCY$2 = 4;
14424
14449
  const START$27 = 0;
14425
14450
  const FIRST$12 = 1;
@@ -14471,11 +14496,11 @@ const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source),
14471
14496
  const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
14472
14497
  file,
14473
14498
  ...positionOf(source)(keyIndex$1(source)),
14474
- rule: RULE$48,
14499
+ rule: RULE$49,
14475
14500
  message: messageOf$5(worst, excesses.length)
14476
14501
  })), Option.toArray);
14477
14502
  // src/features/check-tree-shaking/model/top-level-effects.ts
14478
- const RULE$47 = "top-level-effect";
14503
+ const RULE$48 = "top-level-effect";
14479
14504
  const CODE$1 = /\.[cm]?[jt]sx?$/u;
14480
14505
  const READ_CONCURRENCY$19 = 16;
14481
14506
  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.";
@@ -14491,7 +14516,7 @@ const messageOf$4 = (statement) => {
14491
14516
  const problemsIn$14 = (api) => (file) => (source) => {
14492
14517
  const retained = api.createSourceFile(file, source);
14493
14518
  const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$6({
14494
- rule: RULE$47,
14519
+ rule: RULE$48,
14495
14520
  message: messageOf$4(statement)
14496
14521
  })(statement)));
14497
14522
  retained.dispose();
@@ -14660,7 +14685,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
14660
14685
  return Array$1.flatten(found);
14661
14686
  });
14662
14687
  // src/features/check-typescript-generation/model/typescript-generation.ts
14663
- const RULE$46 = "legacy-typescript";
14688
+ const RULE$47 = "legacy-typescript";
14664
14689
  const LOCKFILE = "pnpm-lock.yaml";
14665
14690
  const COMPILER = "typescript";
14666
14691
  const CURRENT_MAJOR = 7;
@@ -14691,12 +14716,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
14691
14716
  file,
14692
14717
  line: lineOf$4(source)(legacy.id),
14693
14718
  column: FIRST$11,
14694
- rule: RULE$46,
14719
+ rule: RULE$47,
14695
14720
  message: messageOf$3(legacy, dependentsOf$1(Option.getOrElse(nodes, () => []))(legacy.id))
14696
14721
  })));
14697
14722
  });
14698
14723
  // src/features/check-worker-bundles/model/worker-bundles.ts
14699
- const RULE$45 = "worker-bundle";
14724
+ const RULE$46 = "worker-bundle";
14700
14725
  const BUNDLE_CONCURRENCY = 4;
14701
14726
  const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
14702
14727
  const CONDITIONS = [
@@ -14707,7 +14732,7 @@ const CONDITIONS = [
14707
14732
  "module",
14708
14733
  "default"
14709
14734
  ];
14710
- const problemFor$2 = problemInFile(RULE$45);
14735
+ const problemFor$2 = problemInFile(RULE$46);
14711
14736
  const problemOf$10 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
14712
14737
  const bundleProblem = (file) => Effect.gen(function* bundle() {
14713
14738
  const built = yield* Effect.tryPromise({
@@ -14774,9 +14799,57 @@ const expectationsIn = Effect.fn("expectationsIn")(function* expectationsIn(root
14774
14799
  tasks: MSCH_TASK_COMMANDS,
14775
14800
  verifyTasks: Record.keys(MSCH_VERIFY_COMMANDS),
14776
14801
  ciTasks: CI_TASKS,
14777
- secrets: secretsOf()
14802
+ secrets: secretsOf(),
14803
+ fixed: {
14804
+ commitlint: COMMIT_LINT,
14805
+ fu4: fu4Of(),
14806
+ staged: STAGED$1,
14807
+ fmt: FORMAT
14808
+ },
14809
+ gitHooks: GIT_HOOKS
14778
14810
  };
14779
14811
  });
14812
+ // src/app/config-sections.ts
14813
+ const isList = (value) => Array$1.isArray(value);
14814
+ const isSection = (value) => Predicate$1.isObject(value) && !Array$1.isArray(value);
14815
+ const sectionOf = (value) => pipe(Option.some(value), Option.filter(isSection), Option.getOrElse(() => ({})));
14816
+ const listOf$2 = (value) => pipe(Option.some(value), Option.filter(isList), Option.getOrElse(() => []));
14817
+ // src/app/section-weakenings.ts
14818
+ const fixedWeakenings = (config, expected) => pipe(Record.toEntries(expected.fixed), Array$1.filter(([section, built]) => !Equal.equals(config[section], built)), Array$1.map(([section]) => ({
14819
+ anchor: section,
14820
+ message: `${section} differs from what repositoryConfig builds, so msch's ${section} settings do not apply. Leave the ${section} section as repositoryConfig builds it.`
14821
+ })));
14822
+ const builtSections = [
14823
+ "wism",
14824
+ "dependencyRules",
14825
+ "test"
14826
+ ];
14827
+ const missingSections = (config) => pipe(builtSections, Array$1.filter((section) => Predicate$1.isUndefined(config[section])), Array$1.map((section) => ({
14828
+ anchor: "defineConfig",
14829
+ message: `vite.config.ts has no ${section} section, so the checks msch builds into it do not run. Spread repositoryConfig from @r_masseater/msch/config into defineConfig.`
14830
+ })));
14831
+ const RUN_PREFIX = "vp run ";
14832
+ const tasksRunBy = (tasks) => (command) => {
14833
+ const named = String$1.slice(7)(command);
14834
+ const dependsOn = listOf$2(sectionOf(tasks[named])["dependsOn"]);
14835
+ return [named, ...pipe(dependsOn, Array$1.filter(Predicate$1.isString))];
14836
+ };
14837
+ const runCommandOf = (command) => pipe(String$1.lastIndexOf(RUN_PREFIX)(command), Option.map((index) => String$1.slice(index)(command)));
14838
+ const covers = (tasks) => (built) => (command) => Predicate$1.isString(command) && (String$1.endsWith(built)(command) || String$1.startsWith(RUN_PREFIX)(built) && pipe(runCommandOf(command), Option.exists((run) => Array$1.contains(tasksRunBy(tasks)(run), String$1.slice(7)(built)))));
14839
+ const hookWeakenings = (config, expected) => {
14840
+ const hooks = sectionOf(config.gitHooks);
14841
+ const tasks = sectionOf(sectionOf(config.run)["tasks"]);
14842
+ return pipe(Record.toEntries(expected.gitHooks), Array$1.flatMap(([hook, commands]) => pipe(commands, Array$1.filter((built) => !Array$1.some(listOf$2(hooks[hook]), covers(tasks)(built))), Array$1.map((built) => ({
14843
+ anchor: "gitHooks",
14844
+ message: `The ${hook} hook does not run \`${built}\`, which msch puts there. Add commands to a hook or wrap them, but keep the ones repositoryConfig builds.`
14845
+ })))));
14846
+ };
14847
+ /** @internal */
14848
+ const sectionWeakenings = (config, expected) => [
14849
+ ...fixedWeakenings(config, expected),
14850
+ ...missingSections(config),
14851
+ ...hookWeakenings(config, expected)
14852
+ ];
14780
14853
  // src/app/config-weakenings.ts
14781
14854
  const PRESET_KEYS = [
14782
14855
  "categories",
@@ -14793,10 +14866,6 @@ const MSCH_RELAXATIONS = [
14793
14866
  { "import/no-default-export": "off" },
14794
14867
  decisionTestRules
14795
14868
  ];
14796
- const isList = (value) => Array$1.isArray(value);
14797
- const isSection = (value) => Predicate$1.isObject(value) && !Array$1.isArray(value);
14798
- const sectionOf = (value) => pipe(Option.some(value), Option.filter(isSection), Option.getOrElse(() => ({})));
14799
- const listOf$2 = (value) => pipe(Option.some(value), Option.filter(isList), Option.getOrElse(() => []));
14800
14869
  const severityOf = (value) => pipe(listOf$2(value), Array$1.head, Option.getOrElse(() => value));
14801
14870
  const hasOptions = (value) => Array$1.length(listOf$2(value)) > SEVERITY_ONLY;
14802
14871
  const unless = (kept, weakening) => Array$1.filter([weakening], () => !kept);
@@ -14897,10 +14966,11 @@ const weakeningsOf = (expected) => (config) => [
14897
14966
  ...textWeakenings(expected.text)(config.textlint),
14898
14967
  ...markdownWeakenings(expected.markdown)(config.y8),
14899
14968
  ...taskWeakenings(config.run, expected),
14900
- ...secretWeakenings(config.h56m, expected.secrets)
14969
+ ...secretWeakenings(config.h56m, expected.secrets),
14970
+ ...sectionWeakenings(config, expected)
14901
14971
  ];
14902
14972
  // src/app/disabled-rules.ts
14903
- const RULE$44 = "disabled-rule";
14973
+ const RULE$45 = "disabled-rule";
14904
14974
  const CONFIG_FILE$5 = "vite.config.ts";
14905
14975
  const START$25 = 0;
14906
14976
  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;
@@ -14914,7 +14984,7 @@ const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
14914
14984
  const files = yield* RepositoryFiles;
14915
14985
  const listed = yield* files.listedFiles(root);
14916
14986
  const isExempt = matcher(exempt);
14917
- 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$25, SIDE_CONFIG_MESSAGE)));
14987
+ return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$45)(files.join(root, name), "")(START$25, SIDE_CONFIG_MESSAGE)));
14918
14988
  });
14919
14989
  const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
14920
14990
  const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$5);
@@ -14926,7 +14996,7 @@ const configWeakenings = Effect.fn("configWeakenings")(function* configWeakening
14926
14996
  })
14927
14997
  });
14928
14998
  const expected = yield* expectationsIn(root);
14929
- const at = problemAtIndex(RULE$44)(file, source);
14999
+ const at = problemAtIndex(RULE$45)(file, source);
14930
15000
  return pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$25), message)));
14931
15001
  });
14932
15002
  /** @internal */
@@ -14934,7 +15004,7 @@ const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabl
14934
15004
  const files = yield* RepositoryFiles;
14935
15005
  const text = yield* files.readFile(files.join(root, CONFIG_FILE$5));
14936
15006
  if (Option.isNone(text)) return [];
14937
- return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$44)(file, "")(START$25, `msch could not load this file: ${reason}`)]))), ...yield* sideConfigs(root)];
15007
+ return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$45)(file, "")(START$25, `msch could not load this file: ${reason}`)]))), ...yield* sideConfigs(root)];
14938
15008
  });
14939
15009
  // src/app/build-checks.ts
14940
15010
  /** @internal */
@@ -15031,7 +15101,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
15031
15101
  imports: importedFilesOf(checker)(sourceFile)
15032
15102
  })), Array$1.filter((facts) => Array$1.isReadonlyArrayNonEmpty(facts.values) || Array$1.isReadonlyArrayNonEmpty(facts.imports)));
15033
15103
  // src/features/check-value-owners/model/name-lists.ts
15034
- const RULE$43 = "hand-written-names";
15104
+ const RULE$44 = "hand-written-names";
15035
15105
  const TEST_FILE$1 = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
15036
15106
  const nameListOf = (site) => {
15037
15107
  if (TEST_FILE$1.test(site.file) || site.values.length < 2) return Option.none();
@@ -15046,7 +15116,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
15046
15116
  file,
15047
15117
  line,
15048
15118
  column,
15049
- rule: RULE$43,
15119
+ rule: RULE$44,
15050
15120
  message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
15051
15121
  });
15052
15122
  const problemOf$9 = ({ list, reason }) => listedProblem({
@@ -15837,7 +15907,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
15837
15907
  return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
15838
15908
  }, Effect.scoped);
15839
15909
  // src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
15840
- const RULE$42 = "namespace-destructuring";
15910
+ const RULE$43 = "namespace-destructuring";
15841
15911
  const LOCAL = /^[.#/]/u;
15842
15912
  const messageOf$2 = (name) => `Destructuring ${name}, which comes from a package, makes the bundler keep everything ${name} exports. Write ${name}.<member> where it is used.`;
15843
15913
  const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
@@ -15853,7 +15923,7 @@ const destructuredName = (declaration) => {
15853
15923
  return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
15854
15924
  };
15855
15925
  const problemOf$8 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$6({
15856
- rule: RULE$42,
15926
+ rule: RULE$43,
15857
15927
  message: messageOf$2(name)
15858
15928
  })), Option.map((report) => report(declaration)));
15859
15929
  const namespaceDestructuringIn = () => (sourceFile) => {
@@ -15861,7 +15931,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
15861
15931
  return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$8(names)), Array$1.getSomes);
15862
15932
  };
15863
15933
  // src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
15864
- const RULE$41 = "pass-through-wrapper";
15934
+ const RULE$42 = "pass-through-wrapper";
15865
15935
  const SINGLE_STATEMENT = 1;
15866
15936
  const SINGLE_DECLARATION = 1;
15867
15937
  const THIS_PARAMETER = "this";
@@ -15958,7 +16028,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
15958
16028
  const problemOf$7 = (checker) => (candidate) => {
15959
16029
  if (changesTheCall(candidate.wrapper)) return Option.none();
15960
16030
  return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$6({
15961
- rule: RULE$41,
16031
+ rule: RULE$42,
15962
16032
  message: messageOf$1(forward.callee.getText())
15963
16033
  })(candidate.name)));
15964
16034
  };
@@ -15966,22 +16036,8 @@ const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(so
15966
16036
  // src/app/source-checks.ts
15967
16037
  /** @internal */
15968
16038
  const checkSources = (root) => checkRepository(root, [passThroughWrappersIn, namespaceDestructuringIn]);
15969
- // src/shared/lib/repository-origin.ts
15970
- const ORIGIN = /[:/](?<owner>[^/:]+)\/(?<name>[^/]+?)(?:\.git)?\/?$/u;
15971
- /** @internal */
15972
- const originOf = (url) => pipe(Option.fromNullishOr(ORIGIN.exec(url)), Option.flatMap(({ groups }) => Option.fromNullishOr(groups)), Option.flatMap(({ owner, name }) => Option.all({
15973
- owner: Option.fromNullishOr(owner),
15974
- name: Option.fromNullishOr(name)
15975
- })));
15976
- /** @internal */
15977
- const repositoryOrigin = Effect.fn("repositoryOrigin")(function* repositoryOrigin(root) {
15978
- const url = yield* (yield* RepositoryFiles).originUrl(root);
15979
- return pipe(url, Option.flatMap(originOf));
15980
- });
15981
- /** @internal */
15982
- const slugOf = ({ owner, name }) => `${owner}/${name}`;
15983
16039
  // src/features/check-agent-settings/model/known-plugins.ts
15984
- const RULE$40 = "known-plugins";
16040
+ const RULE$41 = "known-plugins";
15985
16041
  const SETTINGS_FILE$3 = ".claude/settings.json";
15986
16042
  const MARKETPLACE_FILE$2 = ".claude-plugin/marketplace.json";
15987
16043
  const GITHUB$5 = "github";
@@ -16002,12 +16058,12 @@ const MarketplaceSchema = Schema.Struct({
16002
16058
  plugins: Schema.Array(Schema.Struct({ name: Schema.String }))
16003
16059
  });
16004
16060
  const decodeMarketplace = Schema.decodeUnknownOption(Schema.fromJsonString(MarketplaceSchema));
16005
- const problem$5 = problemInFile(RULE$40);
16061
+ const problem$6 = problemInFile(RULE$41);
16006
16062
  const knownFrom = (repository, marketplace, settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(marketplace.name)), Option.exists(({ source }) => source.source === GITHUB$5 && source.repo === repository));
16007
16063
  const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
16008
16064
  const pluginProblems = (marketplace, file, settings) => {
16009
16065
  const enabled = pluginEnabled(settings);
16010
- 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.`)));
16066
+ return pipe(marketplace.plugins, Array$1.map(({ name }) => `${name}@${marketplace.name}`), Array$1.filter((plugin) => !enabled(plugin)), Array$1.map((plugin) => problem$6(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.`)));
16011
16067
  };
16012
16068
  /** @internal */
16013
16069
  const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlugins(root) {
@@ -16027,7 +16083,7 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
16027
16083
  }));
16028
16084
  });
16029
16085
  // src/features/check-agent-settings/model/missing-hooks.ts
16030
- const RULE$39 = "missing-hook";
16086
+ const RULE$40 = "missing-hook";
16031
16087
  const SETTINGS_FILE$2 = /^\.claude\/settings\.json$/u;
16032
16088
  const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
16033
16089
  const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
@@ -16052,7 +16108,7 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
16052
16108
  return pipe(missing, Array$1.map(({ path, index }) => ({
16053
16109
  file,
16054
16110
  ...positionOf(source)(index),
16055
- rule: RULE$39,
16111
+ rule: RULE$40,
16056
16112
  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.`
16057
16113
  })));
16058
16114
  });
@@ -16080,7 +16136,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
16080
16136
  return Array$1.flatten(found);
16081
16137
  });
16082
16138
  // src/features/check-agent-settings/model/project-extensions.ts
16083
- const RULE$38 = "project-claude-extensions";
16139
+ const RULE$39 = "project-claude-extensions";
16084
16140
  const SETTINGS_FILE$1 = ".claude/settings.json";
16085
16141
  const SETUP_EVENT = "SessionStart";
16086
16142
  const EXTENSION_DIRECTORIES = [
@@ -16096,8 +16152,8 @@ const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Settin
16096
16152
  const hookProblems = (file, source) => pipe(decodeSettings$1(source), Option.flatMap(({ hooks }) => Option.fromUndefinedOr(hooks)), Option.map(Record.keys), Option.getOrElse(() => []), Array$1.filter((event) => event !== SETUP_EVENT), Array$1.map((event) => {
16097
16153
  const message = `runs a ${event} hook from the project settings. ${REASON$3}`;
16098
16154
  return pipe(source, String$1.indexOf(`"${event}"`), Option.match({
16099
- onNone: () => problemInFile(RULE$38)(file, message),
16100
- onSome: (index) => problemAtIndex(RULE$38)(file, source)(index, message)
16155
+ onNone: () => problemInFile(RULE$39)(file, message),
16156
+ onSome: (index) => problemAtIndex(RULE$39)(file, source)(index, message)
16101
16157
  }));
16102
16158
  }));
16103
16159
  const checkProjectExtensions = Effect.fn("checkProjectExtensions")(function* checkProjectExtensions(root) {
@@ -16105,7 +16161,7 @@ const checkProjectExtensions = Effect.fn("checkProjectExtensions")(function* che
16105
16161
  const settingsFile = files.join(root, SETTINGS_FILE$1);
16106
16162
  const settings = yield* files.readFile(settingsFile);
16107
16163
  const tracked = yield* files.trackedFiles(root, EXTENSION_DIRECTORIES);
16108
- const extensionProblems = pipe(tracked, Array$1.filter((name) => pipe(EXTENSION_DIRECTORIES, Array$1.some((directory) => String$1.startsWith(directory)(name)))), Array$1.map((name) => problemInFile(RULE$38)(files.join(root, name), `is a Claude Code extension in .claude. ${REASON$3}`)));
16164
+ const extensionProblems = pipe(tracked, Array$1.filter((name) => pipe(EXTENSION_DIRECTORIES, Array$1.some((directory) => String$1.startsWith(directory)(name)))), Array$1.map((name) => problemInFile(RULE$39)(files.join(root, name), `is a Claude Code extension in .claude. ${REASON$3}`)));
16109
16165
  return [...Option.match(settings, {
16110
16166
  onNone: () => [],
16111
16167
  onSome: (source) => hookProblems(settingsFile, source)
@@ -16137,7 +16193,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
16137
16193
  }, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
16138
16194
  const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
16139
16195
  // src/features/check-documented-commands/model/commands.ts
16140
- const RULE$37 = "documented-commands";
16196
+ const RULE$38 = "documented-commands";
16141
16197
  const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
16142
16198
  const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
16143
16199
  const COMMAND = /`vp run (?<args>[^`]+)`/gu;
@@ -16215,7 +16271,7 @@ const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph,
16215
16271
  const problemsIn$12 = (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 }) => ({
16216
16272
  file: absolute(file),
16217
16273
  ...positionOf(text)(match.index ?? START$23),
16218
- rule: RULE$37,
16274
+ rule: RULE$38,
16219
16275
  message: `${match[START$23]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
16220
16276
  })), Option.toArray)));
16221
16277
  const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$12), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
@@ -16240,14 +16296,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
16240
16296
  file: absolute(Array$1.headNonEmpty(commanded).file),
16241
16297
  line: ONE$2,
16242
16298
  column: ONE$2,
16243
- rule: RULE$37,
16299
+ rule: RULE$38,
16244
16300
  message: "msch could not list the tasks with `vp run --json`"
16245
16301
  }],
16246
16302
  onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$12(found, absolute, document)))
16247
16303
  });
16248
16304
  });
16249
16305
  // src/features/check-legacy-web/model/legacy-web.ts
16250
- const RULE$36 = "legacy-web";
16306
+ const RULE$37 = "legacy-web";
16251
16307
  const FIRST_COLUMN$7 = 1;
16252
16308
  const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
16253
16309
  const Finding = Schema.Struct({
@@ -16286,7 +16342,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
16286
16342
  file: files.join(root, file),
16287
16343
  line,
16288
16344
  column: FIRST_COLUMN$7,
16289
- rule: RULE$36,
16345
+ rule: RULE$37,
16290
16346
  message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
16291
16347
  });
16292
16348
  return pipe(scan.guides, Array$1.flatMap(({ guideId, rules }) => pipe(rules, Array$1.flatMap(({ ruleId, findings }) => pipe(findings, Array$1.map(problemOf(guideId, ruleId)))))));
@@ -16359,7 +16415,7 @@ const SETTINGS_FILE = ".claude/settings.json";
16359
16415
  const PLUGIN_HOOKS = /(?:^|\/)hooks\/hooks\.json$/u;
16360
16416
  const PLUGIN_ROOT = /\$\{CLAUDE_PLUGIN_ROOT\}/gu;
16361
16417
  const READ_CONCURRENCY$17 = 64;
16362
- const RULE$35 = "shell-script";
16418
+ const RULE$36 = "shell-script";
16363
16419
  const MESSAGE$9 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only a SessionStart hook in .claude/settings.json or a plugin's hooks/hooks.json, which installs the toolchain or the plugin's dependencies before TypeScript can run, stays a shell script.";
16364
16420
  const HookSchema = Schema.Struct({
16365
16421
  command: Schema.optional(Schema.String),
@@ -16403,7 +16459,7 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
16403
16459
  };
16404
16460
  const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
16405
16461
  const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$17 });
16406
- return pipe(shell, Array$1.map((name) => problemInFile(RULE$35)(files.join(root, name), MESSAGE$9)));
16462
+ return pipe(shell, Array$1.map((name) => problemInFile(RULE$36)(files.join(root, name), MESSAGE$9)));
16407
16463
  });
16408
16464
  // src/features/check-structure/model/structure.ts
16409
16465
  const checkStructure = checkSection({
@@ -16641,7 +16697,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
16641
16697
  return Array$1.flatten(found);
16642
16698
  });
16643
16699
  // src/features/check-vite-plus/model/package-scripts.ts
16644
- const RULE$34 = "package-script";
16700
+ const RULE$35 = "package-script";
16645
16701
  const LIFECYCLE = [
16646
16702
  "preinstall",
16647
16703
  "install",
@@ -16664,12 +16720,12 @@ const LIFECYCLE = [
16664
16720
  const problemOf$6 = ({ file, position, name }) => ({
16665
16721
  file,
16666
16722
  ...position,
16667
- rule: RULE$34,
16723
+ rule: RULE$35,
16668
16724
  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.`
16669
16725
  });
16670
16726
  const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$6));
16671
16727
  // src/features/check-vite-plus/model/vite-plus-block.ts
16672
- const RULE$33 = "vite-plus-block";
16728
+ const RULE$34 = "vite-plus-block";
16673
16729
  const MARKER = Array$1.join([
16674
16730
  "<!--",
16675
16731
  "VITE PLUS START",
@@ -16682,7 +16738,7 @@ const problemIn = (file) => (source) => {
16682
16738
  return Option.some({
16683
16739
  file,
16684
16740
  ...positionOf(source)(index.value),
16685
- rule: RULE$33,
16741
+ rule: RULE$34,
16686
16742
  message: MESSAGE$8
16687
16743
  });
16688
16744
  };
@@ -16715,7 +16771,7 @@ const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
16715
16771
  return pipe(drifts, Array$1.map(problemOf$5));
16716
16772
  });
16717
16773
  // src/features/check-workflows/model/release-please.ts
16718
- const RULE$32 = "release-please";
16774
+ const RULE$33 = "release-please";
16719
16775
  const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
16720
16776
  const FIRST$8 = 1;
16721
16777
  const MESSAGE$7 = "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.";
@@ -16727,7 +16783,7 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
16727
16783
  file: files.join(root, name),
16728
16784
  line: FIRST$8,
16729
16785
  column: FIRST$8,
16730
- rule: RULE$32,
16786
+ rule: RULE$33,
16731
16787
  message: MESSAGE$7
16732
16788
  })));
16733
16789
  });
@@ -17016,7 +17072,7 @@ const scannedFiles = Effect.fn("scannedFiles")(function* scannedFiles(root) {
17016
17072
  })), Array$1.filter(({ file }) => !HashSet.has(skipped, file)));
17017
17073
  });
17018
17074
  // src/features/ban-comments/model/comments.ts
17019
- const RULE$31 = "comment";
17075
+ const RULE$32 = "comment";
17020
17076
  const SUPPRESSION_RULE = "suppression";
17021
17077
  const UNUSED_RULE = "unused-comment-allowance";
17022
17078
  const CONFIG_FILE$3 = "vite.config.ts";
@@ -17048,7 +17104,7 @@ const NOTHING = {
17048
17104
  used: []
17049
17105
  };
17050
17106
  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.`;
17051
- const problemOf$4 = (file, source) => (comment) => Match.value(isSuppression(comment)).pipe(Match.when(true, () => problemAtIndex(SUPPRESSION_RULE)(file, source)(comment.index, SUPPRESSION_MESSAGE)), Match.orElse(() => problemAtIndex(RULE$31)(file, source)(comment.index, MESSAGE$6)));
17107
+ const problemOf$4 = (file, source) => (comment) => Match.value(isSuppression(comment)).pipe(Match.when(true, () => problemAtIndex(SUPPRESSION_RULE)(file, source)(comment.index, SUPPRESSION_MESSAGE)), Match.orElse(() => problemAtIndex(RULE$32)(file, source)(comment.index, MESSAGE$6)));
17052
17108
  const settingsOf = ({ msch }) => ({ allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
17053
17109
  onNone: () => NO_SETTINGS.allow,
17054
17110
  onSome: ({ allow }) => allow
@@ -17085,7 +17141,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
17085
17141
  problems: pipe(found, Array$1.filter(kept), Array$1.map(toProblem)),
17086
17142
  used: usedAllowances(allowances, found)
17087
17143
  })), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
17088
- problems: [problemAtIndex(RULE$31)(file, source)(START$19, `msch could not read the comments in this file: ${message}`)],
17144
+ problems: [problemAtIndex(RULE$32)(file, source)(START$19, `msch could not read the comments in this file: ${message}`)],
17089
17145
  used: []
17090
17146
  })))
17091
17147
  });
@@ -17198,7 +17254,7 @@ const PYTHON = {
17198
17254
  /** @internal */
17199
17255
  const checkPython = (root) => checkBannedTool(root, PYTHON);
17200
17256
  // src/features/check-catalog-entries/model/uncataloged-dependencies.ts
17201
- const RULE$30 = "uncataloged-dependency";
17257
+ const RULE$31 = "uncataloged-dependency";
17202
17258
  const OWNED_ELSEWHERE = [
17203
17259
  "catalog:",
17204
17260
  "workspace:",
@@ -17212,7 +17268,7 @@ const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array$1.some((
17212
17268
  const problemsIn$11 = (entry, source) => pipe(manifestSpecifiers(source), Array$1.filter((found) => !isOwnedElsewhere(found)), Array$1.map((found) => ({
17213
17269
  file: entry.file,
17214
17270
  ...positionOf(source)(offsetIn(source)(manifestPattern(found))),
17215
- rule: RULE$30,
17271
+ rule: RULE$31,
17216
17272
  message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$5}`
17217
17273
  })));
17218
17274
  /** @internal */
@@ -17233,7 +17289,7 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
17233
17289
  const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
17234
17290
  const FIRST_LINE$5 = 1;
17235
17291
  const FIRST_COLUMN$5 = 1;
17236
- const RULE$29 = "prune-setting-off";
17292
+ const RULE$30 = "prune-setting-off";
17237
17293
  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."]];
17238
17294
  const decodeTrue = Schema.decodeUnknownOption(Schema.Literal(true));
17239
17295
  const lineOf$3 = (source) => (setting) => pipe(String$1.split(source, "\n"), Array$1.findFirstIndex(String$1.startsWith(`${setting}:`)), Option.match({
@@ -17247,7 +17303,7 @@ const pruneProblems = Effect.fn("pruneProblems")(function* pruneProblems(file, s
17247
17303
  file,
17248
17304
  line: at(setting),
17249
17305
  column: FIRST_COLUMN$5,
17250
- rule: RULE$29,
17306
+ rule: RULE$30,
17251
17307
  message: `Set \`${setting}: true\`. It ${effect}`
17252
17308
  })));
17253
17309
  });
@@ -17269,8 +17325,6 @@ const checkCatalogEntries = Effect.fn("checkCatalogEntries")(function* checkCata
17269
17325
  const ENTRY_RULE = "unlocked-skill";
17270
17326
  const VISIBLE_RULE = "skill-source-visible";
17271
17327
  const CONFIG_FILE$2 = "vite.config.ts";
17272
- const RENOVATE_FILE$1 = "renovate.json";
17273
- const ADOPTER = "@r_masseater/vite-plus-adopt";
17274
17328
  const SOURCE_SEPARATOR = "/";
17275
17329
  const START$18 = 0;
17276
17330
  const LOCAL_PREFIX = "./";
@@ -17311,43 +17365,21 @@ const entryProblems$1 = (owner, { file, text, sources }) => {
17311
17365
  };
17312
17366
  const literalPattern = (repository, commit) => new RegExp(`"${String$1.replaceAll(REGEX_SPECIAL$1, String.raw`\$&`)(repository)}": \\{\\s*commit: "${commit}"`, "u");
17313
17367
  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.`)));
17314
- const RepositoryField = Schema.Struct({
17315
- url: Schema.String,
17316
- directory: Schema.String
17317
- });
17318
- const decodeRepository$2 = Schema.decodeUnknownOption(RepositoryField);
17319
- const adopterPreset = Effect.fn("adopterPreset")(function* adopterPreset() {
17320
- const manifest = yield* installedManifest(ADOPTER, import.meta.url);
17321
- return pipe(manifest, Option.flatMap(({ repository }) => decodeRepository$2(repository)), Option.flatMap(({ url, directory }) => pipe(originOf(url), Option.map((origin) => `github>${slugOf(origin)}//${directory}/renovate`))));
17322
- });
17323
- const presetProblems = Effect.fn("presetProblems")(function* presetProblems(root, preset) {
17324
- const files = yield* RepositoryFiles;
17325
- const file = files.join(root, RENOVATE_FILE$1);
17326
- const text = yield* files.readFile(file);
17327
- if (pipe(text, Option.exists(String$1.includes(`"${preset}"`)))) return [];
17328
- 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}.`)];
17329
- });
17330
17368
  /** @internal */
17331
17369
  const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(root) {
17332
17370
  const declared = yield* declaredSkills(root);
17333
17371
  if (Option.isNone(declared)) return [];
17334
- const preset = yield* adopterPreset();
17335
- const unextended = yield* Effect.forEach(Option.toArray(preset), (found) => presetProblems(root, found), { concurrency: 1 });
17336
17372
  const origin = yield* repositoryOrigin(root);
17337
- return [
17338
- ...pipe(origin, Option.map(({ owner }) => entryProblems$1(owner, declared.value)), Option.getOrElse(() => [])),
17339
- ...visibleProblems(declared.value),
17340
- ...Array$1.flatten(unextended)
17341
- ];
17373
+ return [...pipe(origin, Option.map(({ owner }) => entryProblems$1(owner, declared.value)), Option.getOrElse(() => [])), ...visibleProblems(declared.value)];
17342
17374
  });
17343
17375
  // src/features/check-skills/model/published-skills.ts
17344
- const RULE$28 = "published-skills";
17376
+ const RULE$29 = "published-skills";
17345
17377
  const KEYWORD = "tanstack-intent";
17346
17378
  const SKILLS = "skills";
17347
17379
  const SKILL_FILE$3 = "SKILL.md";
17348
17380
  const SUCCEEDED = 0;
17349
17381
  const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
17350
- const problemAt$2 = problemInFile(RULE$28);
17382
+ const problemAt$2 = problemInFile(RULE$29);
17351
17383
  const skillDirectoriesIn = (files, directory) => pipe(findSkillFiles(files.join(directory, SKILLS)), Array$1.filter((file) => files.basename(file) === SKILL_FILE$3), Array$1.map((file) => files.relative(directory, files.dirname(file))));
17352
17384
  const isShipped = (listed) => (skill) => Array$1.contains(listed, SKILLS) || Array$1.contains(listed, skill);
17353
17385
  const packagingMessages = ({ keywords, files }, skills) => {
@@ -17384,7 +17416,7 @@ const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPu
17384
17416
  return Array$1.flatten(problems);
17385
17417
  });
17386
17418
  // src/features/check-skills/model/skill-files.ts
17387
- const RULE$27 = "skill-file";
17419
+ const RULE$28 = "skill-file";
17388
17420
  const SKILL_FILE$2 = /(?:^|\/)SKILL\.md$/u;
17389
17421
  const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
17390
17422
  const FIXTURE$1 = /(?:^|\/)fixtures\//u;
@@ -17441,7 +17473,7 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
17441
17473
  ]), Option.getOrElse(() => []), Array$1.map(({ index, message }) => ({
17442
17474
  file: skill.file,
17443
17475
  ...positionOf(skill.source)(index),
17444
- rule: RULE$27,
17476
+ rule: RULE$28,
17445
17477
  message
17446
17478
  })));
17447
17479
  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) => ({
@@ -17468,7 +17500,7 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
17468
17500
  return pipe(missing, Array$1.map(({ target, index }) => ({
17469
17501
  file,
17470
17502
  ...positionOf(source)(index),
17471
- rule: RULE$27,
17503
+ rule: RULE$28,
17472
17504
  message: `links to ${target}, which does not exist. Fix the path or remove the link.`
17473
17505
  })));
17474
17506
  });
@@ -17484,7 +17516,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
17484
17516
  file: files.join(root, entry),
17485
17517
  line: FIRST$7,
17486
17518
  column: FIRST$7,
17487
- rule: RULE$27,
17519
+ rule: RULE$28,
17488
17520
  message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
17489
17521
  })));
17490
17522
  return [
@@ -17562,7 +17594,7 @@ const cargoEntries = (text) => {
17562
17594
  };
17563
17595
  const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
17564
17596
  // src/features/check-version-downgrades/model/version-downgrade.ts
17565
- const RULE$26 = "version-downgrade";
17597
+ const RULE$27 = "version-downgrade";
17566
17598
  const READ_CONCURRENCY$13 = 16;
17567
17599
  const READERS = [
17568
17600
  [/(?:^|\/)package\.json$/u, manifestEntries],
@@ -17587,7 +17619,7 @@ const downgradesIn = ({ file, text, before, after }) => {
17587
17619
  file,
17588
17620
  line: lineOf$2(text, entry),
17589
17621
  column: FIRST_LINE$4,
17590
- rule: RULE$26,
17622
+ rule: RULE$27,
17591
17623
  message: message$1(old, entry)
17592
17624
  })), Option.toArray)));
17593
17625
  };
@@ -17617,13 +17649,33 @@ const VERSION_CAP = /["']?allowedVersions["']?\s*:\s*["'](?<range>[^"']*<[^"']*)
17617
17649
  const AUTOMERGE_RULE = "renovate-platform-automerge";
17618
17650
  const CAP_RULE = "renovate-version-cap";
17619
17651
  const PRESET_RULE = "renovate-msch-preset";
17652
+ const ADOPTER = "@r_masseater/vite-plus-adopt";
17653
+ const DEFAULT_FILE = "renovate.json";
17620
17654
  const START$16 = 0;
17621
17655
  const READ_CONCURRENCY$12 = 16;
17622
17656
  const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
17623
17657
  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.";
17624
17658
  const PRESET_MESSAGE = `does not extend \`${RENOVATE_PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
17659
+ const MISSING_MESSAGE = `is missing, so Renovate does not run msch's preset \`${RENOVATE_PRESET}\` and dependencies stay on old versions. Add a Renovate config that extends it.`;
17660
+ const adopterMessage = (preset) => `does not extend \`${preset}\` after \`${RENOVATE_PRESET}\`, so Renovate never updates the commits and versions in the skills and tools sections of vite.config.ts, and the package groups it waits for go out apart. Add it to \`extends\` after msch's preset.`;
17661
+ const Presets = Schema.Unknown.pipe(Schema.Array, Schema.optional);
17662
+ const Extends = Schema.fromJsonString(Schema.Struct({ extends: Presets }));
17663
+ const decodeExtends = Schema.decodeUnknownOption(Extends);
17664
+ const quotedOffset = (source) => (preset) => String$1.indexOf(`"${preset}"`)(source);
17665
+ const extendedAt = (source) => pipe(decodeExtends(source), Option.match({
17666
+ onNone: () => quotedOffset(source),
17667
+ onSome: ({ extends: presets = [] }) => (preset) => Array$1.findFirstIndex(presets, (entry) => entry === preset)
17668
+ }));
17669
+ const presetsMissing = (source, adopter) => {
17670
+ const at = extendedAt(source);
17671
+ const own = at(RENOVATE_PRESET);
17672
+ return [...Array$1.filter([PRESET_MESSAGE], () => Option.isNone(own)), ...pipe(Option.toArray(adopter), Array$1.filter((preset) => pipe(at(preset), Option.match({
17673
+ onNone: () => true,
17674
+ onSome: (index) => Option.exists(own, (ownIndex) => index < ownIndex)
17675
+ }))), Array$1.map(adopterMessage))];
17676
+ };
17625
17677
  const offsetsOf = (pattern, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.flatMap((match) => Option.toArray(Option.fromUndefinedOr(match.index))));
17626
- const problemsIn$8 = (file, source) => {
17678
+ const problemsIn$8 = (adopter) => (file, source) => {
17627
17679
  const at = positionOf(source);
17628
17680
  const found = (pattern, rule, message) => pipe(offsetsOf(pattern, source), Array$1.map((offset) => ({
17629
17681
  file,
@@ -17634,23 +17686,31 @@ const problemsIn$8 = (file, source) => {
17634
17686
  return [
17635
17687
  ...found(AUTOMERGE_OFF, AUTOMERGE_RULE, AUTOMERGE_MESSAGE),
17636
17688
  ...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
17637
- ...pipe([{
17689
+ ...pipe(presetsMissing(source, adopter), Array$1.map((message) => ({
17638
17690
  file,
17639
17691
  ...at(START$16),
17640
17692
  rule: PRESET_RULE,
17641
- message: PRESET_MESSAGE
17642
- }], Array$1.filter(() => !String$1.includes(`"${RENOVATE_PRESET}"`)(source)))
17693
+ message
17694
+ })))
17643
17695
  ];
17644
17696
  };
17645
17697
  /** @internal */
17646
17698
  const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* checkRenovateSettings(root) {
17647
17699
  const files = yield* RepositoryFiles;
17648
17700
  const listed = yield* files.listedFiles(root);
17649
- const found = yield* Effect.forEach(pipe(listed, Array$1.filter((name) => RENOVATE_FILE.test(name))), (name) => {
17701
+ const adopter = yield* renovatePresetOf(ADOPTER, import.meta.url);
17702
+ const configs = pipe(listed, Array$1.filter((name) => RENOVATE_FILE.test(name)));
17703
+ if (Array$1.isReadonlyArrayEmpty(configs)) return [{
17704
+ file: files.join(root, DEFAULT_FILE),
17705
+ ...positionOf("")(START$16),
17706
+ rule: PRESET_RULE,
17707
+ message: MISSING_MESSAGE
17708
+ }];
17709
+ const found = yield* Effect.forEach(configs, (name) => {
17650
17710
  const file = files.join(root, name);
17651
17711
  return files.readFile(file).pipe(Effect.map(Option.match({
17652
17712
  onNone: () => [],
17653
- onSome: (source) => problemsIn$8(file, source)
17713
+ onSome: (source) => problemsIn$8(adopter)(file, source)
17654
17714
  })));
17655
17715
  }, { concurrency: READ_CONCURRENCY$12 });
17656
17716
  return Array$1.flatten(found);
@@ -17670,7 +17730,7 @@ const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
17670
17730
  return Array$1.getSomes(read);
17671
17731
  });
17672
17732
  // src/features/check-version-downgrades/model/package-versions.ts
17673
- const RULE$25 = "unbumped-package";
17733
+ const RULE$26 = "unbumped-package";
17674
17734
  const UNSHIPPED = /(?:\.test\.[\w.]+$|(?:^|\/)(?:fixtures|__tests__|tests?)\/|(?:^|\/)(?:AGENTS|CLAUDE|CHANGELOG)\.md$)/u;
17675
17735
  const UNVERSIONED$5 = "0.0.0";
17676
17736
  const FIRST_LINE$3 = 1;
@@ -17745,7 +17805,7 @@ const checkPackageVersions = Effect.fn("checkPackageVersions")(function* checkPa
17745
17805
  file: files.join(root, pack.file),
17746
17806
  line: versionLine(pack.text),
17747
17807
  column: FIRST_COLUMN$4,
17748
- rule: RULE$25,
17808
+ rule: RULE$26,
17749
17809
  message: message(pack, part, lowest)
17750
17810
  })), Option.toArray);
17751
17811
  }), { concurrency: READ_CONCURRENCY$10 });
@@ -17754,7 +17814,7 @@ const checkPackageVersions = Effect.fn("checkPackageVersions")(function* checkPa
17754
17814
  // src/features/find-unneeded-files/model/applied-packages.ts
17755
17815
  const SCOPE$1 = Option.getOrElse(scopeOfName(SELF_NAME), () => SELF_NAME);
17756
17816
  const PLUGIN_KEYWORDS = ["oxlint-plugin", "textlint-rule"];
17757
- const RULE$24 = "applied-package";
17817
+ const RULE$25 = "applied-package";
17758
17818
  const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
17759
17819
  const NOT_FOUND$4 = -1;
17760
17820
  const SEPARATOR$9 = "/";
@@ -17790,7 +17850,7 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
17790
17850
  const problemAt$1 = (file, source) => (index, name) => ({
17791
17851
  file,
17792
17852
  ...positionOf(source)(index),
17793
- rule: RULE$24,
17853
+ rule: RULE$25,
17794
17854
  message: `msch applies ${name}. Remove this use and let msch apply it.`
17795
17855
  });
17796
17856
  const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped$1(name)}(?=["'\`/])`, "gu");
@@ -17845,7 +17905,7 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
17845
17905
  return yield* appliedPackageProblems(root, applied);
17846
17906
  });
17847
17907
  // src/features/find-unneeded-files/model/replaced-tools.ts
17848
- const RULE$23 = "replaced-tool";
17908
+ const RULE$24 = "replaced-tool";
17849
17909
  const FIRST$6 = 1;
17850
17910
  const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
17851
17911
  const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
@@ -17926,7 +17986,7 @@ const problemFor$1 = ({ name, file }) => pipe(REPLACED, Array$1.findFirst(({ pat
17926
17986
  file,
17927
17987
  line: FIRST$6,
17928
17988
  column: FIRST$6,
17929
- rule: RULE$23,
17989
+ rule: RULE$24,
17930
17990
  message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
17931
17991
  })));
17932
17992
  /** @internal */
@@ -18065,7 +18125,7 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
18065
18125
  return yield* unneededIn(root, cargoEnabled(workspace.value));
18066
18126
  });
18067
18127
  // src/features/check-markdown-directives/model/directives.ts
18068
- const RULE$22 = "markdown-directive";
18128
+ const RULE$23 = "markdown-directive";
18069
18129
  const START$14 = 0;
18070
18130
  const SECOND = 1;
18071
18131
  const ODD = 1;
@@ -18090,7 +18150,7 @@ const problemsIn$7 = (file, source) => {
18090
18150
  const { line, column } = positionOf(source)(index);
18091
18151
  return pipe(Array$1.get(fenced, line - SECOND), Option.getOrElse(() => false)) || pipe(Array$1.get(lines, line - SECOND), Option.map(String$1.slice(START$14, column - SECOND)), Option.exists(insideCodeSpan));
18092
18152
  };
18093
- return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => !isCode(match.index ?? START$14)), Array$1.map((match) => problemAtIndex(RULE$22)(file, source)(match.index ?? START$14, MESSAGE$4)));
18153
+ return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => !isCode(match.index ?? START$14)), Array$1.map((match) => problemAtIndex(RULE$23)(file, source)(match.index ?? START$14, MESSAGE$4)));
18094
18154
  };
18095
18155
  const isChecked$1 = (name) => String$1.endsWith(MARKDOWN$4)(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)));
18096
18156
  /** @internal */
@@ -18103,7 +18163,7 @@ const checkMarkdownDirectives = Effect.fn("checkMarkdownDirectives")(function* c
18103
18163
  }))), ({ file }, source) => problemsIn$7(file, source));
18104
18164
  });
18105
18165
  // src/features/check-owner-names/model/owner-names.ts
18106
- const RULE$21 = "owner-name";
18166
+ const RULE$22 = "owner-name";
18107
18167
  const TEXT_FILE$1 = /\.(?:[cm]?[jt]sx?|jsonc?|md|ya?ml|toml)$/u;
18108
18168
  const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
18109
18169
  const SEPARATOR$7 = "/";
@@ -18145,7 +18205,7 @@ const manifestProblems$3 = ({ owner, file, manifest }) => pipe(ownerOffsets({
18145
18205
  }), Array$1.head, Option.toArray, Array$1.map(() => ({
18146
18206
  file,
18147
18207
  ...positionOf("")(START$13),
18148
- rule: RULE$21,
18208
+ rule: RULE$22,
18149
18209
  message: `Its description or keywords ${messageFor$4(owner)}`
18150
18210
  })));
18151
18211
  const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProblems(root, owner, directory) {
@@ -18166,7 +18226,7 @@ const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProb
18166
18226
  }), Array$1.map((offset) => ({
18167
18227
  file,
18168
18228
  ...positionOf(source)(offset),
18169
- rule: RULE$21,
18229
+ rule: RULE$22,
18170
18230
  message: messageFor$4(owner)
18171
18231
  }))));
18172
18232
  return [...manifestProblems$3({
@@ -18199,7 +18259,7 @@ const branchCarries = Effect.fn("branchCarries")(function* branchCarries(root, b
18199
18259
  return pipe(messages, Array$1.some((commit) => trailer.test(commit)));
18200
18260
  });
18201
18261
  // src/features/check-owner-principles/model/owner-principles.ts
18202
- const RULE$20 = "owner-principle-changed";
18262
+ const RULE$21 = "owner-principle-changed";
18203
18263
  const PRINCIPLE_FILE = /(?:^|\/)(?:skills\/principle-[^/]+\/|PRINCIPLE\.md$)/u;
18204
18264
  const TRAILER = /^Owner-Said:[ \t]*\S/mu;
18205
18265
  const MESSAGE$3 = "changes a principle. Only the owner changes a principle: change it in a session the owner opened with /do-principle, and add the trailer \"Owner-Said: <the owner's words>\" to a commit of the branch. When you only found a fact at odds with the principle, record it as a lesson instead.";
@@ -18211,7 +18271,7 @@ const checkOwnerPrinciples = Effect.fn("checkOwnerPrinciples")(function* checkOw
18211
18271
  const all = yield* files.changedFiles(root, base.value);
18212
18272
  const changed = pipe(all, Array$1.filter((name) => PRINCIPLE_FILE.test(name)));
18213
18273
  if (!Array$1.isReadonlyArrayNonEmpty(changed) || (yield* branchCarries(root, base.value, TRAILER))) return [];
18214
- return pipe(changed, Array$1.map((name) => problemInFile(RULE$20)(files.join(root, name), MESSAGE$3)));
18274
+ return pipe(changed, Array$1.map((name) => problemInFile(RULE$21)(files.join(root, name), MESSAGE$3)));
18215
18275
  });
18216
18276
  // src/features/find-invisible-characters/model/hidden-unicode.ts
18217
18277
  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;
@@ -18220,14 +18280,14 @@ const START$12 = 0;
18220
18280
  const HEX = 16;
18221
18281
  const CODE_POINT_WIDTH = 4;
18222
18282
  const READ_CONCURRENCY$9 = 64;
18223
- const RULE$19 = "hidden-unicode";
18283
+ const RULE$20 = "hidden-unicode";
18224
18284
  const hexOf = (character) => pipe(String$1.codePointAt(START$12)(character), Option.getOrElse(() => START$12), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
18225
18285
  const problemOf$3 = (file, source) => (found) => {
18226
18286
  const hex = hexOf(found[START$12]);
18227
18287
  return {
18228
18288
  file,
18229
18289
  ...positionOf(source)(found.index ?? START$12),
18230
- rule: RULE$19,
18290
+ rule: RULE$20,
18231
18291
  message: `U+${hex} is invisible in editors and reviews and can change what the text means. Remove it, or write it as the escape \\u${hex}.`
18232
18292
  };
18233
18293
  };
@@ -18260,7 +18320,7 @@ const checkDocuments = Effect.fn("checkDocuments")(function* checkDocuments(root
18260
18320
  return Array$1.flatten(found);
18261
18321
  });
18262
18322
  // src/features/check-effect-diagnostics/model/effect-diagnostics.ts
18263
- const RULE$18 = "effect-diagnostics-once";
18323
+ const RULE$19 = "effect-diagnostics-once";
18264
18324
  const PLUGIN = "@effect/language-service";
18265
18325
  const CONFIG_PATHSPEC = ":(glob)**/tsconfig*.json";
18266
18326
  const EXCLUDED$4 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
@@ -18278,7 +18338,7 @@ const reportsDiagnostics = (plugin) => plugin.name === PLUGIN && plugin.diagnost
18278
18338
  const problemsIn$5 = (entry, source) => pipe(decodeConfig(source), Option.flatMap(({ compilerOptions }) => Option.fromUndefinedOr(compilerOptions)), Option.flatMap(({ plugins }) => Option.fromUndefinedOr(plugins)), Option.filter(Array$1.some(reportsDiagnostics)), Option.map(() => ({
18279
18339
  file: entry.file,
18280
18340
  ...positionOf(source)(pipe(String$1.indexOf(`"${PLUGIN}"`)(source), Option.getOrElse(() => START$11))),
18281
- rule: RULE$18,
18341
+ rule: RULE$19,
18282
18342
  message: MESSAGE$2
18283
18343
  })), Option.toArray);
18284
18344
  /** @internal */
@@ -18291,7 +18351,7 @@ const checkEffectDiagnostics = Effect.fn("checkEffectDiagnostics")(function* che
18291
18351
  }))), problemsIn$5);
18292
18352
  });
18293
18353
  // src/features/check-exact-versions/model/exact-versions.ts
18294
- const RULE$17 = "version-range";
18354
+ const RULE$18 = "version-range";
18295
18355
  const WORKSPACE_FILE = "pnpm-workspace.yaml";
18296
18356
  const ALIAS = /^npm:(?:@[^/@]+\/)?[^@]+@(?<version>.+)$/u;
18297
18357
  const PROTOCOL = /^[a-z+]+:/u;
@@ -18307,7 +18367,7 @@ const isRange = (specifier) => {
18307
18367
  const problemsFor = (file, source, pattern) => (found) => pipe(found, Array$1.filter(({ specifier }) => isRange(specifier)), Array$1.map((range) => ({
18308
18368
  file,
18309
18369
  ...positionOf(source)(offsetIn(source)(pattern(range))),
18310
- rule: RULE$17,
18370
+ rule: RULE$18,
18311
18371
  message: `\`${range.name}\` \`${range.specifier}\` ${MESSAGE$1}`
18312
18372
  })));
18313
18373
  const catalogPattern = ({ name }) => new RegExp(`^\\s+["']?${quoted$1(name)}["']?:`, "mu");
@@ -18336,7 +18396,7 @@ const checkExactVersions = Effect.fn("checkExactVersions")(function* checkExactV
18336
18396
  return [...fromManifests, ...fromCatalogs];
18337
18397
  });
18338
18398
  // src/features/check-pack-settings/model/pack-settings.ts
18339
- const RULE$16 = "pack-publint";
18399
+ const RULE$17 = "pack-publint";
18340
18400
  const CONFIG_FILE = "vite.config.ts";
18341
18401
  const PACK_KEY = "pack:";
18342
18402
  const START$10 = 0;
@@ -18352,7 +18412,7 @@ const runsStrictPublint = (config) => pipe(decodePackConfig(config), Option.flat
18352
18412
  const problemFor = (file, source) => ({
18353
18413
  file,
18354
18414
  ...positionOf(source)(Option.getOrElse(String$1.indexOf(PACK_KEY)(source), () => START$10)),
18355
- rule: RULE$16,
18415
+ rule: RULE$17,
18356
18416
  message: "This package is published, so its pack must run publint with `publint: { strict: true }`. Without it, publishConfig can point at files vp pack never writes, and the published package fails to import."
18357
18417
  });
18358
18418
  const strictPublintIn = Effect.fn("strictPublintIn")(function* strictPublintIn(configFile) {
@@ -18382,7 +18442,7 @@ const checkPackSettings = Effect.fn("checkPackSettings")(function* checkPackSett
18382
18442
  return Array$1.flatten(found);
18383
18443
  });
18384
18444
  // src/features/check-published-manifest/model/private-dependency.ts
18385
- const RULE$15 = "private-workspace-dependency";
18445
+ const RULE$16 = "private-workspace-dependency";
18386
18446
  const START$9 = 0;
18387
18447
  const listedIn = (manifest) => pipe(RUNTIME_SECTIONS, Array$1.flatMap((section) => pipe(Option.fromUndefinedOr(manifest[section]), Option.map(Record.keys), Option.getOrElse(() => []), Array$1.map((name) => ({
18388
18448
  section,
@@ -18392,9 +18452,9 @@ const messageFor$3 = ({ section, name }) => `lists the private workspace package
18392
18452
  /** @internal */
18393
18453
  const quotedNameIndex = (source) => (name) => pipe(String$1.indexOf(`"${name}"`)(source), Option.getOrElse(() => START$9));
18394
18454
  /** @internal */
18395
- const privateDependencyProblems = (privateNames) => (found) => pipe(listedIn(found.manifest), Array$1.filter(({ name }) => privateNames.has(name)), Array$1.map((listed) => problemAtIndex(RULE$15)(found.entry.file, found.source)(quotedNameIndex(found.source)(listed.name), messageFor$3(listed))));
18455
+ const privateDependencyProblems = (privateNames) => (found) => pipe(listedIn(found.manifest), Array$1.filter(({ name }) => privateNames.has(name)), Array$1.map((listed) => problemAtIndex(RULE$16)(found.entry.file, found.source)(quotedNameIndex(found.source)(listed.name), messageFor$3(listed))));
18396
18456
  // src/features/check-published-manifest/model/dependency-peer-floor.ts
18397
- const RULE$14 = "dependency-peer-floor";
18457
+ const RULE$15 = "dependency-peer-floor";
18398
18458
  const NODE_MODULES = "node_modules";
18399
18459
  const namesOf$1 = (section) => pipe(Option.fromUndefinedOr(section), Option.map(Record.keys), Option.getOrElse(() => []));
18400
18460
  const isOptional = (manifest, peer) => pipe(Option.fromUndefinedOr(manifest.peerDependenciesMeta), Option.flatMap(Record.get(peer)), Option.exists((meta) => meta.optional === true));
@@ -18457,10 +18517,10 @@ const ownPeers = ({ manifest }) => requiredPeersOf(manifest);
18457
18517
  /** @internal */
18458
18518
  const dependencyPeerFloorProblems = (installed) => (found) => {
18459
18519
  const mismatches = mismatchOf(ownPeers(found));
18460
- return pipe(Option.fromUndefinedOr(installed.get(found.entry.file)), Option.getOrElse(() => []), Array$1.flatMap(mismatches), Array$1.map((mismatch) => problemAtIndex(RULE$14)(found.entry.file, found.source)(quotedNameIndex(found.source)(mismatch.listed), messageFor$2(mismatch))));
18520
+ return pipe(Option.fromUndefinedOr(installed.get(found.entry.file)), Option.getOrElse(() => []), Array$1.flatMap(mismatches), Array$1.map((mismatch) => problemAtIndex(RULE$15)(found.entry.file, found.source)(quotedNameIndex(found.source)(mismatch.listed), messageFor$2(mismatch))));
18461
18521
  };
18462
18522
  // src/features/check-published-manifest/model/package-homepage.ts
18463
- const RULE$13 = "package-homepage";
18523
+ const RULE$14 = "package-homepage";
18464
18524
  const BRANCH = "main";
18465
18525
  const ROOT_DIRECTORY$1 = ".";
18466
18526
  const START$8 = 0;
@@ -18491,9 +18551,9 @@ const messagesOf = (manifest, directory) => pipe(decodeRepository$1(manifest.rep
18491
18551
  }));
18492
18552
  const firstKeyIndex = (source) => pipe(KEYS, Array$1.findFirst((key) => String$1.includes(key)(source)), Option.flatMap((key) => String$1.indexOf(key)(source)), Option.getOrElse(() => START$8));
18493
18553
  /** @internal */
18494
- const homepageProblems = (dirname) => ({ entry, source, manifest }) => pipe(Option.some(dirname(entry.name)), Option.filter((directory) => directory !== ROOT_DIRECTORY$1), Option.map((directory) => messagesOf(manifest, directory)), Option.getOrElse(() => []), Array$1.map((message) => problemAtIndex(RULE$13)(entry.file, source)(firstKeyIndex(source), message)));
18554
+ const homepageProblems = (dirname) => ({ entry, source, manifest }) => pipe(Option.some(dirname(entry.name)), Option.filter((directory) => directory !== ROOT_DIRECTORY$1), Option.map((directory) => messagesOf(manifest, directory)), Option.getOrElse(() => []), Array$1.map((message) => problemAtIndex(RULE$14)(entry.file, source)(firstKeyIndex(source), message)));
18495
18555
  // src/features/check-published-manifest/model/package-scope.ts
18496
- const RULE$12 = "package-scope";
18556
+ const RULE$13 = "package-scope";
18497
18557
  const NAME_KEY = "\"name\"";
18498
18558
  const START$7 = 0;
18499
18559
  const unscopedName = (scope) => ({ manifest }) => pipe(Option.fromUndefinedOr(manifest.name), Option.filter((name) => !String$1.startsWith(scope)(name)));
@@ -18506,7 +18566,7 @@ const sharedScope = (names) => pipe(names, Array$1.flatMap((name) => Option.toAr
18506
18566
  }));
18507
18567
  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)}".`;
18508
18568
  /** @internal */
18509
- const scopeProblems = (scope) => (found) => pipe(unscopedName(scope)(found), Option.map((name) => problemAtIndex(RULE$12)(found.entry.file, found.source)(nameIndex(found.source), messageFor$1(scope, name))), Option.toArray);
18569
+ const scopeProblems = (scope) => (found) => pipe(unscopedName(scope)(found), Option.map((name) => problemAtIndex(RULE$13)(found.entry.file, found.source)(nameIndex(found.source), messageFor$1(scope, name))), Option.toArray);
18510
18570
  // src/features/check-published-manifest/model/published-manifests.ts
18511
18571
  const privateNamesIn = Effect.fn("privateNamesIn")(function* privateNamesIn(root) {
18512
18572
  const manifests = yield* manifestTexts(root);
@@ -18539,7 +18599,7 @@ const checkPublishedManifests = Effect.fn("checkPublishedManifests")(function* c
18539
18599
  ]);
18540
18600
  });
18541
18601
  // src/features/check-runtime-version/model/node-version.ts
18542
- const RULE$11 = "node-version";
18602
+ const RULE$12 = "node-version";
18543
18603
  const MINIMUM = 26;
18544
18604
  const SUPPORTED = `Node.js ${String(MINIMUM)} or later is the only supported runtime.`;
18545
18605
  const MANIFEST$1 = /(?:^|\/)package\.json$/u;
@@ -18563,7 +18623,7 @@ const floorIsOld = (alternative) => pipe(floorOf$1(alternative), Option.match({
18563
18623
  onSome: isOld
18564
18624
  }));
18565
18625
  const admitsOld = (range) => pipe(String$1.split(range, ALTERNATIVE$1), Array$1.some(floorIsOld));
18566
- const problemAt = ({ entry, source, index }, message) => problemAtIndex(RULE$11)(entry.file, source)(index, message);
18626
+ const problemAt = ({ entry, source, index }, message) => problemAtIndex(RULE$12)(entry.file, source)(index, message);
18567
18627
  const offsetOf = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$6));
18568
18628
  const unstatedProblem = (entry, source) => problemAt({
18569
18629
  entry,
@@ -18614,7 +18674,7 @@ const checkNodeVersion = Effect.fn("checkNodeVersion")(function* checkNodeVersio
18614
18674
  return yield* scanText(sources, problemsIn$3);
18615
18675
  });
18616
18676
  // src/features/check-workspace-descriptions/model/workspace-descriptions.ts
18617
- const RULE$10 = "workspace-description";
18677
+ const RULE$11 = "workspace-description";
18618
18678
  const FIRST$5 = 1;
18619
18679
  /** @internal */
18620
18680
  const checkWorkspaceDescriptions = Effect.fn("checkWorkspaceDescriptions")(function* checkWorkspaceDescriptions(root) {
@@ -18624,12 +18684,12 @@ const checkWorkspaceDescriptions = Effect.fn("checkWorkspaceDescriptions")(funct
18624
18684
  file: files.join(root, directory, PACKAGE_JSON_FILE),
18625
18685
  line: FIRST$5,
18626
18686
  column: FIRST$5,
18627
- rule: RULE$10,
18687
+ rule: RULE$11,
18628
18688
  message: "Add a one-line \"description\" that says what this workspace is for. Agents find existing tools by these descriptions, so a workspace without one is invisible to them."
18629
18689
  })));
18630
18690
  });
18631
18691
  // src/features/check-plugin-layout/model/plugin-layout.ts
18632
- const RULE$9 = "plugin-layout";
18692
+ const RULE$10 = "plugin-layout";
18633
18693
  const PLUGIN_FILE$2 = ".claude-plugin/plugin.json";
18634
18694
  const MARKETPLACE_FILE$1 = ".claude-plugin/marketplace.json";
18635
18695
  const SKILL_FILE$1 = "SKILL.md";
@@ -18640,7 +18700,7 @@ const LONGEST_PATH = 472;
18640
18700
  const MOST_DEPTH = 12;
18641
18701
  const LONGEST_PART = 255;
18642
18702
  const LONGEST_DESCRIPTION = 500;
18643
- const CONCURRENCY$4 = 16;
18703
+ const CONCURRENCY$5 = 16;
18644
18704
  const PLUGIN_NAME = /^[\p{Ll}\p{Nd}-]{1,64}$/u;
18645
18705
  const ALLOWED_PATH = /^[A-Za-z0-9 _.\-/(),]+$/u;
18646
18706
  const XML_TAG = /<[A-Za-z][^>]*>/u;
@@ -18651,7 +18711,7 @@ const SkillFields$1 = Schema.Struct({
18651
18711
  description: Schema.optionalKey(Schema.String)
18652
18712
  });
18653
18713
  const decodeSkillFields = Schema.decodeUnknownOption(SkillFields$1);
18654
- const problem$4 = problemInFile(RULE$9);
18714
+ const problem$5 = problemInFile(RULE$10);
18655
18715
  const violation = (path, message) => ({
18656
18716
  path,
18657
18717
  message
@@ -18715,7 +18775,7 @@ const skillViolations = (skills) => {
18715
18775
  const skillFilesOf = (plugin) => pipe(plugin.files, Array$1.filter((file) => file === SKILL_FILE$1 || String$1.endsWith(`${SEPARATOR$6}${SKILL_FILE$1}`)(file)));
18716
18776
  const violationsOf = Effect.fn("violationsOf")(function* violationsOf(root, plugin, links) {
18717
18777
  const prefix = `${(yield* RepositoryFiles).relative(root, plugin.directory)}${SEPARATOR$6}`;
18718
- const skills = yield* Effect.forEach(skillFilesOf(plugin), (file) => skillTextOf(plugin, file), { concurrency: CONCURRENCY$4 });
18778
+ const skills = yield* Effect.forEach(skillFilesOf(plugin), (file) => skillTextOf(plugin, file), { concurrency: CONCURRENCY$5 });
18719
18779
  return [
18720
18780
  ...manifestViolations(plugin),
18721
18781
  ...nestedManifests(plugin),
@@ -18731,7 +18791,7 @@ const rootProblems = Effect.fn("rootProblems")(function* rootProblems(root) {
18731
18791
  const marketplace = yield* files.exists(files.join(root, MARKETPLACE_FILE$1));
18732
18792
  const manifest = files.join(root, PLUGIN_FILE$2);
18733
18793
  const isPlugin = yield* files.exists(manifest);
18734
- return pipe(Option.liftPredicate(problem$4(manifest, "makes the marketplace root a plugin. The marketplace is not itself a plugin."), () => marketplace && isPlugin), Option.toArray);
18794
+ return pipe(Option.liftPredicate(problem$5(manifest, "makes the marketplace root a plugin. The marketplace is not itself a plugin."), () => marketplace && isPlugin), Option.toArray);
18735
18795
  });
18736
18796
  /** @internal */
18737
18797
  const checkPluginLayout = Effect.fn("checkPluginLayout")(function* checkPluginLayout(root) {
@@ -18739,12 +18799,12 @@ const checkPluginLayout = Effect.fn("checkPluginLayout")(function* checkPluginLa
18739
18799
  const plugins = yield* pluginsIn$1(root);
18740
18800
  const linked = yield* files.linkedFiles(root);
18741
18801
  const links = new Set(linked);
18742
- const found = yield* Effect.forEach(plugins, (plugin) => violationsOf(root, plugin, links).pipe(Effect.map(Array$1.map(({ path, message }) => problem$4(files.join(plugin.directory, path), message)))), { concurrency: CONCURRENCY$4 });
18802
+ const found = yield* Effect.forEach(plugins, (plugin) => violationsOf(root, plugin, links).pipe(Effect.map(Array$1.map(({ path, message }) => problem$5(files.join(plugin.directory, path), message)))), { concurrency: CONCURRENCY$5 });
18743
18803
  const marketplace = yield* rootProblems(root);
18744
18804
  return [...Array$1.flatten(found), ...marketplace];
18745
18805
  });
18746
18806
  // src/features/check-plugin-marketplace/model/plugin-marketplace.ts
18747
- const RULE$8 = "plugin-marketplace";
18807
+ const RULE$9 = "plugin-marketplace";
18748
18808
  const PLUGIN_DIRECTORY = ".claude-plugin";
18749
18809
  const PLUGIN_FILE$1 = `${PLUGIN_DIRECTORY}/plugin.json`;
18750
18810
  const MARKETPLACE_FILE = `${PLUGIN_DIRECTORY}/marketplace.json`;
@@ -18800,7 +18860,7 @@ const pluginIn = Effect.fn("pluginIn")(function* pluginIn(root, project) {
18800
18860
  description: Option.getOrElse(project.description, () => "")
18801
18861
  })));
18802
18862
  });
18803
- const problem$3 = problemInFile(RULE$8);
18863
+ const problem$4 = problemInFile(RULE$9);
18804
18864
  const pluginsIn = Effect.fn("pluginsIn")(function* pluginsIn(root) {
18805
18865
  const projects = yield* workspaceProjects(root);
18806
18866
  const found = yield* Effect.forEach(projects, (project) => pluginIn(root, project), { concurrency: "unbounded" });
@@ -18819,16 +18879,16 @@ const ownerIn = Effect.fn("ownerIn")(function* ownerIn(root) {
18819
18879
  ...described(description)
18820
18880
  })))));
18821
18881
  });
18822
- const rewrite = Effect.fn("rewrite")(function* rewrite(file, expected) {
18882
+ const rewrite$1 = Effect.fn("rewrite")(function* rewrite(file, expected) {
18823
18883
  const files = yield* RepositoryFiles;
18824
18884
  const written = yield* files.readFile(file);
18825
18885
  if (Option.exists(written, (text) => text === expected)) return [];
18826
18886
  yield* files.writeFile(file, expected);
18827
- return [problem$3(file, `${MARKETPLACE_FILE} is generated from the workspaces that have ${PLUGIN_FILE$1}. msch rewrote it; commit the result.`)];
18887
+ return [problem$4(file, `${MARKETPLACE_FILE} is generated from the workspaces that have ${PLUGIN_FILE$1}. msch rewrote it; commit the result.`)];
18828
18888
  });
18829
18889
  const withoutPlugins = Effect.fn("withoutPlugins")(function* withoutPlugins(file) {
18830
18890
  if (!(yield* (yield* RepositoryFiles).exists(file))) return [];
18831
- return [problem$3(file, `No workspace has ${PLUGIN_FILE$1}. Delete ${MARKETPLACE_FILE}.`)];
18891
+ return [problem$4(file, `No workspace has ${PLUGIN_FILE$1}. Delete ${MARKETPLACE_FILE}.`)];
18832
18892
  });
18833
18893
  /** @internal */
18834
18894
  const checkPluginMarketplace = Effect.fn("checkPluginMarketplace")(function* checkPluginMarketplace(root) {
@@ -18837,15 +18897,15 @@ const checkPluginMarketplace = Effect.fn("checkPluginMarketplace")(function* che
18837
18897
  const plugins = yield* pluginsIn(root);
18838
18898
  if (!Array$1.isReadonlyArrayNonEmpty(plugins)) return yield* withoutPlugins(file);
18839
18899
  const header = yield* ownerIn(root);
18840
- if (Option.isNone(header)) return [problem$3(files.join(root, PACKAGE_JSON_FILE), `Workspaces ship Claude Code plugins, so ${MARKETPLACE_FILE} lists them. Add "author" to the root ${PACKAGE_JSON_FILE}; it becomes the marketplace owner.`)];
18900
+ if (Option.isNone(header)) return [problem$4(files.join(root, PACKAGE_JSON_FILE), `Workspaces ship Claude Code plugins, so ${MARKETPLACE_FILE} lists them. Add "author" to the root ${PACKAGE_JSON_FILE}; it becomes the marketplace owner.`)];
18841
18901
  const text = yield* encodeMarketplace({
18842
18902
  ...header.value,
18843
18903
  plugins
18844
18904
  });
18845
- return yield* rewrite(file, `${text}\n`);
18905
+ return yield* rewrite$1(file, `${text}\n`);
18846
18906
  });
18847
18907
  // src/features/check-readme-skills/model/readme-skills.ts
18848
- const RULE$7 = "readme-skills";
18908
+ const RULE$8 = "readme-skills";
18849
18909
  const README_FILE = "README.md";
18850
18910
  const FIRST_SENTENCE = /^[\s\S]*?(?:。|\.(?=\s|$))/u;
18851
18911
  const CALLED_SKILL$1 = /`(?<name>[a-z0-9-]+:[a-z0-9-]+)`/u;
@@ -18869,7 +18929,7 @@ const SkillFields = Schema.Struct({
18869
18929
  "disable-model-invocation": Schema.optionalKey(Schema.Boolean)
18870
18930
  });
18871
18931
  const decodeFields = Schema.decodeUnknownOption(SkillFields);
18872
- const problem$2 = problemInFile(RULE$7);
18932
+ const problem$3 = problemInFile(RULE$8);
18873
18933
  const cell = (text) => pipe(text, String$1.replaceAll("|", String.raw`\|`), String$1.replaceAll("\n", " "));
18874
18934
  const sceneOf = (description) => pipe(Option.fromNullishOr(FIRST_SENTENCE.exec(description)), Option.flatMap(Array$1.head), Option.getOrElse(() => description));
18875
18935
  const targetOf = (fields, body) => pipe(Option.liftPredicate(body, () => fields["disable-model-invocation"] === true), Option.flatMap((text) => groupOf("name")(CALLED_SKILL$1.exec(text))), Option.map((name) => `\`${name}\``), Option.getOrElse(() => EMPTY$1));
@@ -18919,7 +18979,7 @@ const syncReadme = Effect.fn("syncReadme")(function* syncReadme({ directory, ski
18919
18979
  });
18920
18980
  if (canonical(expected) === canonical(current)) return [];
18921
18981
  yield* files.writeFile(file, expected);
18922
- 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.`)];
18982
+ return [problem$3(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.`)];
18923
18983
  });
18924
18984
  const labelsOf = ({ published }) => pipe(Option.liftPredicate(ENGLISH_LABELS, () => published), Option.getOrElse(() => JAPANESE_LABELS));
18925
18985
  /** @internal */
@@ -19002,11 +19062,11 @@ const enumerationSignals = (entities) => (file, text) => {
19002
19062
  }));
19003
19063
  };
19004
19064
  // src/features/check-skill-enumerations/model/skill-enumerations.ts
19005
- const RULE$6 = "skill-enumeration";
19065
+ const RULE$7 = "skill-enumeration";
19006
19066
  const FIRST$3 = 1;
19007
- const CONCURRENCY$3 = 16;
19067
+ const CONCURRENCY$4 = 16;
19008
19068
  const DOCUMENT_FILE = /\.(?:md|ts|tsx)$/u;
19009
- const position = problemAtPosition(RULE$6);
19069
+ const position = problemAtPosition(RULE$7);
19010
19070
  const problemsIn$2 = Effect.fn("problemsIn")(function* problemsIn(root, name, entities) {
19011
19071
  const files = yield* RepositoryFiles;
19012
19072
  const file = files.join(root, name);
@@ -19024,21 +19084,21 @@ const checkSkillEnumerations = Effect.fn("checkSkillEnumerations")(function* che
19024
19084
  if (!Array$1.isReadonlyArrayNonEmpty(entities)) return [];
19025
19085
  const listed = yield* files.listedFiles(root);
19026
19086
  const documents = pipe(listed, Array$1.filter((name) => DOCUMENT_FILE.test(name)));
19027
- const found = yield* Effect.forEach(documents, (name) => problemsIn$2(root, name, entities), { concurrency: CONCURRENCY$3 });
19087
+ const found = yield* Effect.forEach(documents, (name) => problemsIn$2(root, name, entities), { concurrency: CONCURRENCY$4 });
19028
19088
  return Array$1.flatten(found);
19029
19089
  });
19030
19090
  // src/features/check-skill-references/model/skill-references.ts
19031
- const RULE$5 = "skill-reference";
19091
+ const RULE$6 = "skill-reference";
19032
19092
  const OWNER_PREFIX = "do-";
19033
19093
  const MARKDOWN$2 = ".md";
19034
- const CONCURRENCY$2 = 16;
19094
+ const CONCURRENCY$3 = 16;
19035
19095
  const MOST_OWNER_LINES = 4;
19036
19096
  const NAMED_IN_BACKTICKS = /`(?<name>[a-z0-9]+(?:-[a-z0-9]+)*)`(?!\]\()/gu;
19037
19097
  const CALLED_SKILL = /`(?<name>[a-z0-9-]+:[a-z0-9-]+)`/gu;
19038
19098
  const LIST_ITEM = /^\s*(?:[-*]|\d+\.)\s/u;
19039
19099
  const TOOL_NAME = /ツール|\bgh\b|\bgit\b|\bcurl\b|\bclaude\b|\bvp\b|\bbun\b/u;
19040
19100
  const QUALIFIER = ":";
19041
- const problem$1 = problemInFile(RULE$5);
19101
+ const problem$2 = problemInFile(RULE$6);
19042
19102
  const groupsOf = (pattern, text) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(text)), Array$1.flatMap((found) => Option.toArray(groupOf("name")(found))));
19043
19103
  const isOwnerEntry = ({ name }) => String$1.startsWith(OWNER_PREFIX)(name);
19044
19104
  const isOwnerOnly = ({ frontmatter }) => frontmatter.fields["disable-model-invocation"] === true;
@@ -19060,24 +19120,24 @@ const ownerOnlyMessages = (skill, qualified) => pipe(Option.liftPredicate(skill,
19060
19120
  toolMessage(owner),
19061
19121
  calledMessage(owner, qualified)
19062
19122
  ]));
19063
- const ownerProblems = (skill, qualified) => pipe([prefixMessage(skill), ...ownerOnlyMessages(skill, qualified)], Array$1.getSomes, Array$1.map((message) => problem$1(skill.file, message)));
19064
- 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.`)));
19123
+ const ownerProblems = (skill, qualified) => pipe([prefixMessage(skill), ...ownerOnlyMessages(skill, qualified)], Array$1.getSomes, Array$1.map((message) => problem$2(skill.file, message)));
19124
+ const hubProblems = (hub, names) => pipe(groupsOf(NAMED_IN_BACKTICKS, hub.source), Array$1.filter((name) => !names.has(name)), Array$1.map((name) => problem$2(hub.file, `names ${name}, which is not a skill.`)));
19065
19125
  const documentProblems = Effect.fn("documentProblems")(function* documentProblems({ file, hub }, skill, others) {
19066
19126
  const text = yield* (yield* RepositoryFiles).readFile(file);
19067
19127
  const body = String$1.replace(FRONTMATTER, "")(Option.getOrElse(text, () => ""));
19068
- 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.`)));
19128
+ return pipe(others, Array$1.filter((other) => other.name !== skill.name && namesSkill(other.name)(body)), Array$1.map((other) => problem$2(file, `names ${other.name}. Only ${hub.name} names other skills; point to it from the hub instead.`)));
19069
19129
  });
19070
19130
  const spokeProblems = Effect.fn("spokeProblems")(function* spokeProblems(hub, skill, others) {
19071
19131
  const documents = pipe(skill.files, Array$1.filter(String$1.endsWith(MARKDOWN$2)));
19072
19132
  const found = yield* Effect.forEach(documents, (file) => documentProblems({
19073
19133
  file,
19074
19134
  hub
19075
- }, skill, others), { concurrency: CONCURRENCY$2 });
19135
+ }, skill, others), { concurrency: CONCURRENCY$3 });
19076
19136
  return Array$1.flatten(found);
19077
19137
  });
19078
19138
  const referencesFrom = Effect.fn("referencesFrom")(function* referencesFrom(hub, skills) {
19079
19139
  const others = pipe(skills, Array$1.filter((skill) => skill.name !== hub.name && !isOwnerEntry(skill)));
19080
- const spokes = yield* Effect.forEach(others, (skill) => spokeProblems(hub, skill, others), { concurrency: CONCURRENCY$2 });
19140
+ const spokes = yield* Effect.forEach(others, (skill) => spokeProblems(hub, skill, others), { concurrency: CONCURRENCY$3 });
19081
19141
  const names = new Set(pipe(skills, Array$1.map(({ name }) => name)));
19082
19142
  return [...hubProblems(hub, names), ...Array$1.flatten(spokes)];
19083
19143
  });
@@ -19095,8 +19155,8 @@ const checkSkillReferences = Effect.fn("checkSkillReferences")(function* checkSk
19095
19155
  return [...owners, ...hubbed];
19096
19156
  });
19097
19157
  // src/features/check-skill-structure/model/skill-structure.ts
19098
- const RULE$4 = "skill-maintainer-context";
19099
- const CONCURRENCY$1 = 16;
19158
+ const RULE$5 = "skill-maintainer-context";
19159
+ const CONCURRENCY$2 = 16;
19100
19160
  const MARKDOWN$1 = ".md";
19101
19161
  const PROJECT_FILE = /(?:^|\/)(?:package\.json|tsconfig[^/]*\.json|vite\.config\.[cm]?[jt]s|vitest\.config\.[cm]?[jt]s)$|\.[jt]sx$/u;
19102
19162
  const SCRIPT_FILE = /\.[cm]?[jt]s$/u;
@@ -19105,7 +19165,7 @@ const BINARY_FILE = /\.(?:png|jpe?g|gif|webp|pdf|woff2?)$/u;
19105
19165
  const WRITE_CALL = /\b(?:writeFileSync|cpSync|renameSync|appendFileSync|copyFileSync)\(/u;
19106
19166
  const MAINTAINER_HEADING = /^#{1,6}\s.*(?:メンテナンス|保守|更新手順|再生成|撮り直|maintenance|maintainer|regenerat)/imu;
19107
19167
  const REASON$2 = "A distributed skill holds only what the model needs while using it, so loading it does not carry maintainer context. Turn this into something that runs on its own, such as a check, a hook or a task in the repository that owns what the skill describes. A note that only asks to be read before a change is never read.";
19108
- const problem = problemInFile(RULE$4);
19168
+ const problem$1 = problemInFile(RULE$5);
19109
19169
  const signalsOf = (file, text) => [
19110
19170
  ...pipe(Option.liftPredicate("a build project file (package.json, tsconfig, vite config or a .tsx source)", () => PROJECT_FILE.test(file)), Option.toArray),
19111
19171
  ...pipe(Option.liftPredicate("a script that writes files next to itself, which regenerates the skill's own files", () => SCRIPT_FILE.test(file) && !TEST_FILE.test(file) && String$1.includes("import.meta.dirname")(text) && WRITE_CALL.test(text)), Option.toArray),
@@ -19115,18 +19175,69 @@ const problemsIn$1 = Effect.fn("problemsIn")(function* problemsIn(file) {
19115
19175
  const files = yield* RepositoryFiles;
19116
19176
  const text = yield* files.readFile(file);
19117
19177
  const source = pipe(text, Option.filter(() => !BINARY_FILE.test(file)));
19118
- return pipe(signalsOf(files.basename(file), Option.getOrElse(source, () => "")), Array$1.map((signal) => problem(file, `is ${signal}. ${REASON$2}`)));
19178
+ return pipe(signalsOf(files.basename(file), Option.getOrElse(source, () => "")), Array$1.map((signal) => problem$1(file, `is ${signal}. ${REASON$2}`)));
19119
19179
  });
19120
19180
  /** @internal */
19121
19181
  const checkSkillStructure = Effect.fn("checkSkillStructure")(function* checkSkillStructure(root) {
19122
19182
  const plugins = yield* pluginsIn$1(root);
19123
19183
  const inside = pipe(plugins, Array$1.flatMap(({ skills }) => skills), Array$1.flatMap(({ files }) => files));
19124
- const found = yield* Effect.forEach(inside, problemsIn$1, { concurrency: CONCURRENCY$1 });
19184
+ const found = yield* Effect.forEach(inside, problemsIn$1, { concurrency: CONCURRENCY$2 });
19185
+ return Array$1.flatten(found);
19186
+ });
19187
+ // src/features/write-plugin-definition/model/plugin-definition.ts
19188
+ const RULE$4 = "plugin-definition";
19189
+ const DEFINITION = "plugin.ts";
19190
+ const CONCURRENCY$1 = 4;
19191
+ const problem = problemInFile(RULE$4);
19192
+ const reasonOf$2 = (failure) => {
19193
+ if (failure instanceof Error) return failure.message;
19194
+ return String(failure);
19195
+ };
19196
+ const load = (file) => Effect.tryPromise({
19197
+ try: () => import(pathToFileURL(file).href),
19198
+ catch: reasonOf$2
19199
+ });
19200
+ const rewrite = Effect.fn("rewrite")(function* rewrite(directory, { path, text }) {
19201
+ const files = yield* RepositoryFiles;
19202
+ const file = files.join(directory, path);
19203
+ const written = yield* files.readFile(file);
19204
+ if (Option.exists(written, (found) => found === text)) return Option.none();
19205
+ yield* files.writeFile(file, text);
19206
+ return Option.some(problem(file, `${path} is generated from ${DEFINITION}. msch rewrote it; commit the result.`));
19207
+ });
19208
+ const pluginName = (packageName) => pipe(packageName, String$1.replace(/^@[^/]+\//u, ""));
19209
+ const filesOf = (project, definition) => Effect.gen(function* generate() {
19210
+ const name = yield* Effect.fromOption(project.packageName).pipe(Effect.mapError(() => `${project.directory}/package.json has no name for plugin.json.`));
19211
+ const loaded = yield* load(definition);
19212
+ return yield* moduleFiles(loaded, {
19213
+ name: pluginName(name),
19214
+ ...Option.match(project.description, {
19215
+ onNone: () => ({}),
19216
+ onSome: (description) => ({ description })
19217
+ })
19218
+ }).pipe(Effect.mapError(reasonOf$2));
19219
+ });
19220
+ const writeOne = Effect.fn("writeOne")(function* writeOne(root, project) {
19221
+ const files = yield* RepositoryFiles;
19222
+ const directory = files.join(root, project.directory);
19223
+ const definition = files.join(directory, DEFINITION);
19224
+ if (!(yield* files.exists(definition))) return [];
19225
+ const generated = yield* Effect.result(filesOf(project, definition));
19226
+ return yield* Result.match(generated, {
19227
+ onFailure: (reason) => Effect.succeed([problem(definition, `msch could not load the plugin definition: ${reason}`)]),
19228
+ onSuccess: (written) => Effect.forEach(written, (file) => rewrite(directory, file), { concurrency: 1 }).pipe(Effect.map(Array$1.getSomes))
19229
+ });
19230
+ });
19231
+ /** @internal */
19232
+ const writePluginDefinitions = Effect.fn("writePluginDefinitions")(function* writePluginDefinitions(root) {
19233
+ const projects = yield* workspaceProjects(root);
19234
+ const found = yield* Effect.forEach(projects, (project) => writeOne(root, project), { concurrency: CONCURRENCY$1 });
19125
19235
  return Array$1.flatten(found);
19126
19236
  });
19127
19237
  // src/app/plugin-checks.ts
19128
19238
  /** @internal */
19129
19239
  const checkPlugins = Effect.fn("checkPlugins")(function* checkPlugins(root) {
19240
+ const generated = yield* writePluginDefinitions(root);
19130
19241
  const found = yield* Effect.all([
19131
19242
  checkPluginMarketplace(root),
19132
19243
  checkPluginLayout(root),
@@ -19135,7 +19246,7 @@ const checkPlugins = Effect.fn("checkPlugins")(function* checkPlugins(root) {
19135
19246
  checkSkillReferences(root),
19136
19247
  checkSkillEnumerations(root)
19137
19248
  ], { concurrency: "unbounded" });
19138
- return Array$1.flatten(found);
19249
+ return [...generated, ...Array$1.flatten(found)];
19139
19250
  });
19140
19251
  // src/features/check-upstream-exits/model/deviation-entries.ts
19141
19252
  const WORKSPACE_SECTIONS = [