@r_masseater/msch 0.123.1 → 0.125.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
@@ -15,7 +15,7 @@ import { a as workspaceConfigs, c as publicEntriesOf, d as FRONTMATTER, f as spl
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
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";
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,8 +35,10 @@ 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";
41
+ import { sdkAgentQuery } from "@r_masseater/masseater-utils/agent-query";
40
42
  import { dual } from "effect/Function";
41
43
  import { judgeText } from "@r_masseater/oxlint-plugin-decision";
42
44
  import { finished, mustSucceed, outputOf, succeeds, writeOutputs } from "@r_masseater/masseater-utils/github-workflow";
@@ -47,7 +49,7 @@ import { Buffer } from "node:buffer";
47
49
  import { createZstdDecompress } from "node:zlib";
48
50
  // package.json
49
51
  var name = "@r_masseater/msch";
50
- var version = "0.123.1";
52
+ var version = "0.125.0";
51
53
  var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
52
54
  var repository = {
53
55
  "type": "git",
@@ -690,7 +692,7 @@ const owningWorkspace = (directories) => (directory) => {
690
692
  const PLUGIN_FILE$4 = ".claude-plugin/plugin.json";
691
693
  const SKILLS_DIRECTORY = "skills";
692
694
  const SKILL_FILE$4 = "SKILL.md";
693
- const CONCURRENCY$6 = 16;
695
+ const CONCURRENCY$7 = 16;
694
696
  const SEPARATOR$27 = "/";
695
697
  const PluginManifest$1 = Schema.fromJsonString(Schema.Struct({
696
698
  name: Schema.String,
@@ -730,7 +732,7 @@ const skillsOf$1 = Effect.fn("skillsOf")(function* skillsOf(scan, plugin, direct
730
732
  const found = yield* Effect.forEach(names, (entry) => skillIn(scan, {
731
733
  plugin,
732
734
  skills
733
- }, entry), { concurrency: CONCURRENCY$6 });
735
+ }, entry), { concurrency: CONCURRENCY$7 });
734
736
  return Array$1.sort(Array$1.getSomes(found), bySkillName);
735
737
  });
736
738
  const packageVersionAt = Effect.fn("packageVersionAt")(function* packageVersionAt(directory) {
@@ -769,7 +771,7 @@ const pluginsIn$1 = Effect.fn("pluginsIn")(function* pluginsIn(root) {
769
771
  }, {
770
772
  directory: files.join(root, directory),
771
773
  published
772
- }), { concurrency: CONCURRENCY$6 });
774
+ }), { concurrency: CONCURRENCY$7 });
773
775
  return Array$1.getSomes(found);
774
776
  });
775
777
  const HYPHENATED = "-";
@@ -1094,12 +1096,12 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, foundIn) {
1094
1096
  // src/features/check-overrides/model/git-subpath.ts
1095
1097
  const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
1096
1098
  const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
1097
- const RULE$80 = "git-subpath-dependency";
1099
+ const RULE$81 = "git-subpath-dependency";
1098
1100
  const WHOLE_MATCH$4 = 0;
1099
1101
  const problemAt$5 = ({ file }, source) => (found) => ({
1100
1102
  file,
1101
1103
  ...positionOf(source)(found.index ?? WHOLE_MATCH$4),
1102
- rule: RULE$80,
1104
+ rule: RULE$81,
1103
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])}\`.`
1104
1106
  });
1105
1107
  const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$5(entry, source)));
@@ -1110,13 +1112,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
1110
1112
  return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$24);
1111
1113
  });
1112
1114
  // src/features/check-overrides/model/restricted-rules.ts
1113
- const RULE$79 = "unnamed-restriction";
1115
+ const RULE$80 = "unnamed-restriction";
1114
1116
  const WHOLE_MATCH$3 = 0;
1115
1117
  const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-[a-z]+(?:-[a-z]+)*\\b`, "gu");
1116
1118
  const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
1117
1119
  file: entry.file,
1118
1120
  ...positionOf(source)(found.index ?? WHOLE_MATCH$3),
1119
- rule: RULE$79,
1121
+ rule: RULE$80,
1120
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.`
1121
1123
  })));
1122
1124
  /** @internal */
@@ -1125,13 +1127,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
1125
1127
  return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
1126
1128
  });
1127
1129
  // src/features/check-overrides/model/type-exemptions.ts
1128
- const RULE$78 = "named-type-exemption";
1130
+ const RULE$79 = "named-type-exemption";
1129
1131
  const WHOLE_MATCH$2 = 0;
1130
1132
  const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
1131
1133
  const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
1132
1134
  file: entry.file,
1133
1135
  ...positionOf(source)(found.index ?? WHOLE_MATCH$2),
1134
- rule: RULE$78,
1136
+ rule: RULE$79,
1135
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."
1136
1138
  })));
1137
1139
  /** @internal */
@@ -1147,7 +1149,7 @@ const INSTALL_REGISTRY = "https://npm.flatt.tech/";
1147
1149
  const withTrailingSlash = (url) => `${String$1.replace(TRAILING_SLASH$1, "")(url)}/`;
1148
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)))));
1149
1151
  // src/features/check-overrides/model/package-registry.ts
1150
- const RULE$77 = "package-registry";
1152
+ const RULE$78 = "package-registry";
1151
1153
  const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
1152
1154
  const NPMRC = /(?:^|\/)\.npmrc$/u;
1153
1155
  const WORKSPACE_REGISTRY = /^registry:/mu;
@@ -1161,7 +1163,7 @@ const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ in
1161
1163
  const workspaceProblem = ({ file, source }, registry) => ({
1162
1164
  file,
1163
1165
  ...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
1164
- rule: RULE$77,
1166
+ rule: RULE$78,
1165
1167
  message: Option.match(registry, {
1166
1168
  onNone: () => `${REASON$4} Set \`registry: ${INSTALL_REGISTRY}\` in ${WORKSPACE_FILE$6}.`,
1167
1169
  onSome: (value) => `${REASON$4} \`registry\` is ${value}. Set it to ${INSTALL_REGISTRY}.`
@@ -1170,7 +1172,7 @@ const workspaceProblem = ({ file, source }, registry) => ({
1170
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) => ({
1171
1173
  file: entry.file,
1172
1174
  ...positionOf(source)(found.index ?? START$34),
1173
- rule: RULE$77,
1175
+ rule: RULE$78,
1174
1176
  message: `${REASON$4} This .npmrc overrides it with \`${String$1.trim(found[START$34])}\`. Remove the line.`
1175
1177
  })));
1176
1178
  const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
@@ -1248,7 +1250,7 @@ const SELF_HOMEPAGE = homepage;
1248
1250
  const SELF_DIRECTORY = repository.directory;
1249
1251
  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`;
1250
1252
  // src/features/check-overrides/model/removed-peers.ts
1251
- const RULE$76 = "removed-peer";
1253
+ const RULE$77 = "removed-peer";
1252
1254
  const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
1253
1255
  const REMOVED = "-";
1254
1256
  const PARENT_SEPARATOR = ">";
@@ -1275,7 +1277,7 @@ const problemAt$4 = (file, { key, line, column }) => ({ peer, dependent }) => ({
1275
1277
  file,
1276
1278
  line,
1277
1279
  column,
1278
- rule: RULE$76,
1280
+ rule: RULE$77,
1279
1281
  message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
1280
1282
  });
1281
1283
  const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
@@ -3416,7 +3418,7 @@ const matcher = (patterns) => {
3416
3418
  String$1.startsWith(NEGATION$1);
3417
3419
  String$1.slice(1);
3418
3420
  // src/features/check-placement/model/colocated-git-patterns.ts
3419
- const RULE$75 = "colocated-git-patterns";
3421
+ const RULE$76 = "colocated-git-patterns";
3420
3422
  const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
3421
3423
  const ROOT$3 = ".";
3422
3424
  const NEGATION = "!";
@@ -3463,7 +3465,7 @@ const entriesIn$2 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
3463
3465
  const toEntry = entryOf$2(absolute, files.basename(file), files.dirname(file));
3464
3466
  return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
3465
3467
  });
3466
- const patternProblem = (entry, message) => problemAtPosition(RULE$75)(entry.file, {
3468
+ const patternProblem = (entry, message) => problemAtPosition(RULE$76)(entry.file, {
3467
3469
  line: entry.line,
3468
3470
  column: FIRST$26
3469
3471
  }, message);
@@ -3526,7 +3528,7 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
3526
3528
  return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
3527
3529
  });
3528
3530
  // src/features/check-placement/model/colocated-tests.ts
3529
- const RULE$74 = "colocated-test";
3531
+ const RULE$75 = "colocated-test";
3530
3532
  const FIRST$25 = 1;
3531
3533
  const READ_CONCURRENCY$39 = 64;
3532
3534
  const ROOT_SUBPATH$1 = ".";
@@ -3549,7 +3551,7 @@ const problemFor$11 = (test, message) => ({
3549
3551
  file: test.file,
3550
3552
  line: FIRST$25,
3551
3553
  column: FIRST$25,
3552
- rule: RULE$74,
3554
+ rule: RULE$75,
3553
3555
  message: `${test.base} ${message}`
3554
3556
  });
3555
3557
  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);
@@ -3632,7 +3634,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
3632
3634
  // src/features/check-placement/model/agent-docs-length.ts
3633
3635
  const RECOMMENDED_LINES = 200;
3634
3636
  const FIRST$24 = 1;
3635
- const RULE$73 = "agent-docs-length";
3637
+ const RULE$74 = "agent-docs-length";
3636
3638
  const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
3637
3639
  const problemFor$10 = (file) => (lines) => {
3638
3640
  if (lines <= RECOMMENDED_LINES) return Option.none();
@@ -3640,14 +3642,14 @@ const problemFor$10 = (file) => (lines) => {
3640
3642
  file,
3641
3643
  line: 201,
3642
3644
  column: FIRST$24,
3643
- rule: RULE$73,
3645
+ rule: RULE$74,
3644
3646
  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.`
3645
3647
  });
3646
3648
  };
3647
3649
  /** @internal */
3648
3650
  const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$10(file)(lineCount(source)));
3649
3651
  // src/features/check-placement/model/claude-link.ts
3650
- const RULE$72 = "claude-md-link";
3652
+ const RULE$73 = "claude-md-link";
3651
3653
  const CLAUDE = "CLAUDE.md";
3652
3654
  const AGENTS = "AGENTS.md";
3653
3655
  const FIRST$23 = 1;
@@ -3666,7 +3668,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
3666
3668
  file: path,
3667
3669
  line: FIRST$23,
3668
3670
  column: FIRST$23,
3669
- rule: RULE$72,
3671
+ rule: RULE$73,
3670
3672
  message: MESSAGE$15
3671
3673
  })));
3672
3674
  });
@@ -3675,7 +3677,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
3675
3677
  return Array$1.getSomes(found);
3676
3678
  });
3677
3679
  // src/features/check-placement/model/dangling-links.ts
3678
- const RULE$71 = "dangling-link";
3680
+ const RULE$72 = "dangling-link";
3679
3681
  const SEPARATOR$26 = "/";
3680
3682
  const FIRST$22 = 1;
3681
3683
  const READ_CONCURRENCY$36 = 16;
@@ -3691,7 +3693,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
3691
3693
  file,
3692
3694
  line: FIRST$22,
3693
3695
  column: FIRST$22,
3694
- rule: RULE$71,
3696
+ rule: RULE$72,
3695
3697
  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.`
3696
3698
  })));
3697
3699
  });
@@ -3749,7 +3751,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
3749
3751
  }));
3750
3752
  });
3751
3753
  // src/features/check-placement/model/deployed-readme.ts
3752
- const RULE$70 = "deployed-readme";
3754
+ const RULE$71 = "deployed-readme";
3753
3755
  const ROOT_DIRECTORY$4 = "";
3754
3756
  const READ_CONCURRENCY$35 = 16;
3755
3757
  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.";
@@ -3789,14 +3791,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
3789
3791
  const readme = yield* readReadme({
3790
3792
  root,
3791
3793
  directory,
3792
- rule: RULE$70,
3794
+ rule: RULE$71,
3793
3795
  missingMessage: MISSING_MESSAGE$2
3794
3796
  });
3795
3797
  return Result.match(readme, {
3796
3798
  onFailure: Option.some,
3797
3799
  onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
3798
3800
  file,
3799
- rule: RULE$70,
3801
+ rule: RULE$71,
3800
3802
  message: NO_URL_MESSAGE
3801
3803
  })))
3802
3804
  });
@@ -3813,7 +3815,7 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
3813
3815
  return Array$1.getSomes(found);
3814
3816
  });
3815
3817
  // src/features/check-placement/model/nested-docs.ts
3816
- const RULE$69 = "nested-docs";
3818
+ const RULE$70 = "nested-docs";
3817
3819
  const CONFIG_FILE$9 = "vite.config.ts";
3818
3820
  const SEPARATOR$24 = "/";
3819
3821
  const READ_CONCURRENCY$34 = 64;
@@ -3826,7 +3828,7 @@ const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Sc
3826
3828
  const taggedError$13 = Schema.TaggedError;
3827
3829
  var RootConfigUnreadable = class extends taggedError$13()("RootConfigUnreadable", { file: Schema.String }) {};
3828
3830
  const isNested = (name) => String$1.includes(SEPARATOR$24)(name);
3829
- const problemFor$9 = problemInFile(RULE$69);
3831
+ const problemFor$9 = problemInFile(RULE$70);
3830
3832
  const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
3831
3833
  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.";
3832
3834
  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.";
@@ -3883,7 +3885,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
3883
3885
  return [...Array$1.getSomes(found), ...missing];
3884
3886
  });
3885
3887
  // src/features/check-placement/model/published-readme.ts
3886
- const RULE$68 = "published-readme";
3888
+ const RULE$69 = "published-readme";
3887
3889
  const READ_CONCURRENCY$33 = 16;
3888
3890
  const MESSAGE$14 = "contains Japanese. This package is published to npm, so write its README in English.";
3889
3891
  const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
@@ -3891,7 +3893,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
3891
3893
  const readme = yield* readReadme({
3892
3894
  root,
3893
3895
  directory,
3894
- rule: RULE$68,
3896
+ rule: RULE$69,
3895
3897
  missingMessage: MISSING_MESSAGE
3896
3898
  });
3897
3899
  return Result.match(readme, {
@@ -3902,7 +3904,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
3902
3904
  file,
3903
3905
  line,
3904
3906
  column,
3905
- rule: RULE$68,
3907
+ rule: RULE$69,
3906
3908
  message: MESSAGE$14
3907
3909
  };
3908
3910
  }))
@@ -3915,7 +3917,7 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
3915
3917
  return Array$1.getSomes(found);
3916
3918
  });
3917
3919
  // src/features/check-placement/model/published-tests.ts
3918
- const RULE$67 = "published-tests";
3920
+ const RULE$68 = "published-tests";
3919
3921
  const FILE_START = 1;
3920
3922
  const TEST_FILE$3 = /\.test\.[cm]?[jt]sx?$/u;
3921
3923
  const MESSAGE$13 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
@@ -3929,7 +3931,7 @@ const problemFor$8 = Effect.fn("problemFor")(function* problemFor(root, listed,
3929
3931
  file: files.join(absolute, PACKAGE_JSON_FILE),
3930
3932
  line: FILE_START,
3931
3933
  column: FILE_START,
3932
- rule: RULE$67,
3934
+ rule: RULE$68,
3933
3935
  message: MESSAGE$13
3934
3936
  });
3935
3937
  });
@@ -3943,7 +3945,7 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
3943
3945
  return Array$1.getSomes(found);
3944
3946
  });
3945
3947
  // src/features/check-placement/model/root-docs.ts
3946
- const RULE$66 = "root-docs";
3948
+ const RULE$67 = "root-docs";
3947
3949
  const SEPARATOR$23 = "/";
3948
3950
  const FIRST$20 = 1;
3949
3951
  const MARKDOWN$6 = /\.(?:md|mdx|markdown)$/iu;
@@ -3958,12 +3960,12 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
3958
3960
  file: files.join(root, name),
3959
3961
  line: FIRST$20,
3960
3962
  column: FIRST$20,
3961
- rule: RULE$66,
3963
+ rule: RULE$67,
3962
3964
  message: `${name} ${MESSAGE$12}`
3963
3965
  })));
3964
3966
  });
3965
3967
  // src/features/check-placement/model/root-readme.ts
3966
- const RULE$65 = "root-readme";
3968
+ const RULE$66 = "root-readme";
3967
3969
  const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
3968
3970
  const READ_CONCURRENCY$32 = 16;
3969
3971
  const START$32 = 0;
@@ -4006,7 +4008,7 @@ const problemsIn$21 = (file, source, plugins) => (workspace) => {
4006
4008
  const message = messageFor$5(workspace.directory);
4007
4009
  const at = positionOf(source);
4008
4010
  const pattern = patternFor(plugins)(workspace);
4009
- return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$65)(file, at(found.index ?? START$32), message)));
4011
+ return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$66)(file, at(found.index ?? START$32), message)));
4010
4012
  };
4011
4013
  const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
4012
4014
  const text = yield* (yield* RepositoryFiles).readFile(file);
@@ -4043,7 +4045,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
4043
4045
  return Array$1.flatten(found);
4044
4046
  });
4045
4047
  // src/features/check-placement/model/docs-mirror.ts
4046
- const RULE$64 = "docs-mirror";
4048
+ const RULE$65 = "docs-mirror";
4047
4049
  const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
4048
4050
  const MIRROR_LIMIT = 3;
4049
4051
  const READ_CONCURRENCY$31 = 16;
@@ -4068,7 +4070,7 @@ const problemFor$7 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
4068
4070
  file,
4069
4071
  line,
4070
4072
  column,
4071
- rule: RULE$64,
4073
+ rule: RULE$65,
4072
4074
  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.`
4073
4075
  };
4074
4076
  }), Option.toArray);
@@ -4100,7 +4102,7 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
4100
4102
  return Array$1.flatten(found);
4101
4103
  });
4102
4104
  // src/features/check-placement/model/ignored-sources.ts
4103
- const RULE$63 = "ignored-sources";
4105
+ const RULE$64 = "ignored-sources";
4104
4106
  const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
4105
4107
  const FIRST$19 = 1;
4106
4108
  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.";
@@ -4112,7 +4114,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
4112
4114
  file: files.join(root, file),
4113
4115
  line: FIRST$19,
4114
4116
  column: FIRST$19,
4115
- rule: RULE$63,
4117
+ rule: RULE$64,
4116
4118
  message: MESSAGE$11
4117
4119
  })));
4118
4120
  });
@@ -12869,13 +12871,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
12869
12871
  return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
12870
12872
  });
12871
12873
  // src/features/check-placement/model/shadcn-ui-alias.ts
12872
- const RULE$62 = "shadcn-ui-alias";
12874
+ const RULE$63 = "shadcn-ui-alias";
12873
12875
  const FIRST$18 = 1;
12874
12876
  const problemOf$12 = (directory, { file, alias }) => ({
12875
12877
  file,
12876
12878
  line: FIRST$18,
12877
12879
  column: FIRST$18,
12878
- rule: RULE$62,
12880
+ rule: RULE$63,
12879
12881
  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/*".`
12880
12882
  });
12881
12883
  /** @internal */
@@ -13143,7 +13145,7 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
13143
13145
  ])));
13144
13146
  });
13145
13147
  // src/features/check-repository-layout/model/config-paths.ts
13146
- const RULE$61 = "config-path";
13148
+ const RULE$62 = "config-path";
13147
13149
  const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
13148
13150
  const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
13149
13151
  const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
@@ -13162,7 +13164,7 @@ const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
13162
13164
  const problemOf$11 = (file, source) => (mention) => ({
13163
13165
  file,
13164
13166
  ...positionOf(source)(mention.index),
13165
- rule: RULE$61,
13167
+ rule: RULE$62,
13166
13168
  message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
13167
13169
  });
13168
13170
  const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
@@ -13187,7 +13189,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
13187
13189
  return pipe(patterns, Array$1.map((pattern) => ({
13188
13190
  file,
13189
13191
  ...positionOf(source.value)(indexOfText(source.value)(pattern)),
13190
- rule: RULE$61,
13192
+ rule: RULE$62,
13191
13193
  message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
13192
13194
  })));
13193
13195
  });
@@ -13199,7 +13201,7 @@ const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPath
13199
13201
  return [...Array$1.flatten(found), ...patterns];
13200
13202
  });
13201
13203
  // src/features/check-repository-layout/model/crates.ts
13202
- const RULE$60 = "unverified-crate";
13204
+ const RULE$61 = "unverified-crate";
13203
13205
  const VERSION_RULE = "release-version";
13204
13206
  const APP_DIRECTORIES = ["", "src-tauri"];
13205
13207
  const CARGO_FILE$1 = "Cargo.toml";
@@ -13211,7 +13213,7 @@ const problemFor$6 = (crate, message) => ({
13211
13213
  file: crate.manifest,
13212
13214
  line: FIRST$16,
13213
13215
  column: FIRST$16,
13214
- rule: RULE$60,
13216
+ rule: RULE$61,
13215
13217
  message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
13216
13218
  });
13217
13219
  const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
@@ -13250,7 +13252,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
13250
13252
  return Array$1.getSomes(Array$1.flatten(found));
13251
13253
  });
13252
13254
  // src/features/check-repository-layout/model/deploy-entry-patterns.ts
13253
- const RULE$59 = "deploy-entry-pattern";
13255
+ const RULE$60 = "deploy-entry-pattern";
13254
13256
  const FALLOW_KEYS = [
13255
13257
  "entry",
13256
13258
  "entryPoints",
@@ -13321,7 +13323,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
13321
13323
  return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
13322
13324
  file: path,
13323
13325
  ...positionOf(text.value)(start - kind.offset),
13324
- rule: RULE$59,
13326
+ rule: RULE$60,
13325
13327
  message: `${pattern} ${MESSAGE$10}`
13326
13328
  })));
13327
13329
  });
@@ -13354,7 +13356,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
13354
13356
  return Array$1.flatten(found);
13355
13357
  });
13356
13358
  // src/features/check-repository-layout/model/fallow-entries.ts
13357
- const RULE$58 = "listed-entry";
13359
+ const RULE$59 = "listed-entry";
13358
13360
  const ENTRY_KEYS = [
13359
13361
  "entry",
13360
13362
  "entryPoints",
@@ -13384,7 +13386,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
13384
13386
  return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
13385
13387
  file: path,
13386
13388
  ...positionOf(text.value)(start),
13387
- rule: RULE$58,
13389
+ rule: RULE$59,
13388
13390
  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.`
13389
13391
  })));
13390
13392
  });
@@ -13396,7 +13398,7 @@ const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallow
13396
13398
  return Array$1.flatten(found);
13397
13399
  });
13398
13400
  // src/features/check-repository-layout/model/root-workspace-paths.ts
13399
- const RULE$57 = "root-workspace-path";
13401
+ const RULE$58 = "root-workspace-path";
13400
13402
  const CONFIG_FILE$7 = "vite.config.ts";
13401
13403
  const PATH_CHARACTER = /[\w.@/-]/u;
13402
13404
  const NAME_CHARACTER = /[\w.@-]/u;
@@ -13415,7 +13417,7 @@ const mentions = (directory) => (text) => {
13415
13417
  const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
13416
13418
  file,
13417
13419
  ...positionOf(source)(found.start),
13418
- rule: RULE$57,
13420
+ rule: RULE$58,
13419
13421
  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.`
13420
13422
  })));
13421
13423
  /** @internal */
@@ -13429,7 +13431,7 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
13429
13431
  return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$16(file, source.value, directories)));
13430
13432
  });
13431
13433
  // src/features/check-repository-layout/model/hidden-verify.ts
13432
- const RULE$56 = "hidden-verify";
13434
+ const RULE$57 = "hidden-verify";
13433
13435
  const CONFIG_FILE$6 = "vite.config.ts";
13434
13436
  const FIRST$14 = 1;
13435
13437
  const READ_CONCURRENCY$24 = 8;
@@ -13443,7 +13445,7 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
13443
13445
  file,
13444
13446
  line: FIRST$14,
13445
13447
  column: FIRST$14,
13446
- rule: RULE$56,
13448
+ rule: RULE$57,
13447
13449
  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}.`
13448
13450
  }).pipe(Option.filter(() => verified));
13449
13451
  });
@@ -13454,7 +13456,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
13454
13456
  return Array$1.getSomes(found);
13455
13457
  });
13456
13458
  // src/features/check-repository-layout/model/shared-uncached-tasks.ts
13457
- const RULE$55 = "shared-uncached-task";
13459
+ const RULE$56 = "shared-uncached-task";
13458
13460
  const READ_CONCURRENCY$23 = 8;
13459
13461
  const SHARED = 2;
13460
13462
  const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
@@ -13497,7 +13499,7 @@ const problemsOf$3 = (definitions) => {
13497
13499
  return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
13498
13500
  file,
13499
13501
  ...position,
13500
- rule: RULE$55,
13502
+ rule: RULE$56,
13501
13503
  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.`
13502
13504
  })));
13503
13505
  };
@@ -13508,7 +13510,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
13508
13510
  return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
13509
13511
  });
13510
13512
  // src/features/check-repository-layout/model/tested-verify.ts
13511
- const RULE$54 = "tested-verify";
13513
+ const RULE$55 = "tested-verify";
13512
13514
  const READ_CONCURRENCY$22 = 8;
13513
13515
  const TESTS = new Set(TEST_TASK_NAMES);
13514
13516
  const RUNS_TESTS = /\b(?:vp|cargo) test\b/u;
@@ -13537,7 +13539,7 @@ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directo
13537
13539
  return pipe(Option.toArray(config), Array$1.flatMap(({ file, source, program }) => pipe(testedEdges(runTasksIn(program)), Array$1.map(({ to, at }) => ({
13538
13540
  file,
13539
13541
  ...positionOf(source)(at.start),
13540
- rule: RULE$54,
13542
+ rule: RULE$55,
13541
13543
  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.`
13542
13544
  })))));
13543
13545
  });
@@ -13548,7 +13550,7 @@ const checkTestedVerify = Effect.fn("checkTestedVerify")(function* checkTestedVe
13548
13550
  return Array$1.flatten(found);
13549
13551
  });
13550
13552
  // src/features/check-repository-layout/model/unlocked-tasks.ts
13551
- const RULE$53 = "unlocked-task";
13553
+ const RULE$54 = "unlocked-task";
13552
13554
  const READ_CONCURRENCY$21 = 8;
13553
13555
  const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
13554
13556
  const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
@@ -13560,7 +13562,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
13560
13562
  const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
13561
13563
  file,
13562
13564
  ...positionOf(source)(task.start),
13563
- rule: RULE$53,
13565
+ rule: RULE$54,
13564
13566
  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.`
13565
13567
  })), Option.toArray)));
13566
13568
  /** @internal */
@@ -13876,7 +13878,7 @@ const baseRevision = Effect.fn("baseRevision")(function* baseRevision(root) {
13876
13878
  return yield* files.mergeBase(root, base);
13877
13879
  });
13878
13880
  // src/features/check-migration-order/model/migration-order.ts
13879
- const RULE$52 = "migration-order";
13881
+ const RULE$53 = "migration-order";
13880
13882
  const SNAPSHOT = "snapshot.json";
13881
13883
  const MIGRATION = "migration.sql";
13882
13884
  const SNAPSHOTS = [`*/${SNAPSHOT}`];
@@ -13910,7 +13912,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
13910
13912
  file: join(root, file),
13911
13913
  line: FIRST$13,
13912
13914
  column: FIRST$13,
13913
- rule: RULE$52,
13915
+ rule: RULE$53,
13914
13916
  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}.`
13915
13917
  })))), Option.getOrElse(() => []));
13916
13918
  /** @internal */
@@ -14013,15 +14015,15 @@ const vendorFiles = Effect.fn("vendorFiles")(function* vendorFiles(request) {
14013
14015
  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`));
14014
14016
  });
14015
14017
  // src/features/check-mod-vendor/model/mod-vendor.ts
14016
- const RULE$51 = "mod-vendor";
14018
+ const RULE$52 = "mod-vendor";
14017
14019
  const VENDOR = "vendor";
14018
14020
  const SOURCE_FILE$2 = /\.[cm]?[jt]sx?$/u;
14019
14021
  const RELATIVE$1 = /^\.\.?\//u;
14020
14022
  const FILE_LIMIT = 1048576;
14021
14023
  const TOTAL_LIMIT = 8388608;
14022
- const CONCURRENCY$5 = 4;
14024
+ const CONCURRENCY$6 = 4;
14023
14025
  const EMPTY$3 = "";
14024
- const problemFor$5 = problemInFile(RULE$51);
14026
+ const problemFor$5 = problemInFile(RULE$52);
14025
14027
  const isModSource = (directory) => (file) => String$1.startsWith(directory)(file) && !String$1.startsWith(`${directory}${VENDOR}/`)(file) && SOURCE_FILE$2.test(file);
14026
14028
  const sourcesOf$2 = (plugin, directory, join) => pipe(plugin.files, Array$1.filter(isModSource(directory)), Array$1.map((file) => join(plugin.directory, file)));
14027
14029
  const modsOf = Effect.fn("modsOf")(function* modsOf(root, plugin) {
@@ -14044,7 +14046,7 @@ const wantedIn$1 = Effect.fn("wantedIn")(function* wantedIn(mod, file) {
14044
14046
  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]))));
14045
14047
  });
14046
14048
  const wantedOf = Effect.fn("wantedOf")(function* wantedOf(mod) {
14047
- const found = yield* Effect.forEach(mod.sources, (file) => wantedIn$1(mod, file), { concurrency: CONCURRENCY$5 });
14049
+ const found = yield* Effect.forEach(mod.sources, (file) => wantedIn$1(mod, file), { concurrency: CONCURRENCY$6 });
14048
14050
  return pipe(Array$1.flatten(found), Array$1.groupBy(([name]) => name), Record.map(Array$1.flatMap(([, names]) => names)));
14049
14051
  });
14050
14052
  const expectedOf = Effect.fn("expectedOf")(function* expectedOf(mod, wanted) {
@@ -14059,7 +14061,7 @@ const expectedOf = Effect.fn("expectedOf")(function* expectedOf(mod, wanted) {
14059
14061
  const currentOf = Effect.fn("currentOf")(function* currentOf(mod) {
14060
14062
  const files = yield* RepositoryFiles;
14061
14063
  const entries = yield* files.walkDirectory(mod.vendor);
14062
- 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 });
14064
+ 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 });
14063
14065
  return Record.fromEntries(Array$1.getSomes(read));
14064
14066
  });
14065
14067
  const byteLength = (text) => new TextEncoder().encode(text).length;
@@ -14070,15 +14072,15 @@ const sizeProblems = (mod, expected) => {
14070
14072
  return [...fileProblems(mod, sizes), ...totalProblems(mod, sizes)];
14071
14073
  };
14072
14074
  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)));
14073
- const rewrite$1 = Effect.fn("rewrite")(function* rewrite(mod, current, expected) {
14075
+ const rewrite$2 = Effect.fn("rewrite")(function* rewrite(mod, current, expected) {
14074
14076
  const files = yield* RepositoryFiles;
14075
14077
  const stale = pipe(Record.keys(current), Array$1.filter((name) => !Record.has(expected, name)));
14076
14078
  yield* Effect.forEach(stale, (name) => files.removeFile(files.join(mod.vendor, name)), {
14077
- concurrency: CONCURRENCY$5,
14079
+ concurrency: CONCURRENCY$6,
14078
14080
  discard: true
14079
14081
  });
14080
14082
  yield* Effect.forEach(Record.toEntries(expected), ([name, text]) => files.writeFile(files.join(mod.vendor, name), text), {
14081
- concurrency: CONCURRENCY$5,
14083
+ concurrency: CONCURRENCY$6,
14082
14084
  discard: true
14083
14085
  });
14084
14086
  });
@@ -14089,7 +14091,7 @@ const syncMod = Effect.fn("syncMod")(function* syncMod(mod) {
14089
14091
  const current = yield* currentOf(mod);
14090
14092
  const sized = sizeProblems(mod, expected);
14091
14093
  if (sameFiles(current, expected)) return sized;
14092
- yield* rewrite$1(mod, current, expected);
14094
+ yield* rewrite$2(mod, current, expected);
14093
14095
  return [problemFor$5(mod.vendor, REWRITTEN), ...sized];
14094
14096
  });
14095
14097
  const failedBundle = (mod) => (detail) => [problemFor$5(mod.vendor, `The vendor directory could not be bundled. ${detail}`)];
@@ -14099,8 +14101,8 @@ const checkMod = Effect.fn("checkMod")(function* checkMod(mod) {
14099
14101
  /** @internal */
14100
14102
  const checkModVendor = Effect.fn("checkModVendor")(function* checkModVendor(root) {
14101
14103
  const plugins = yield* pluginsIn$1(root);
14102
- const mods = yield* Effect.forEach(plugins, (plugin) => modsOf(root, plugin), { concurrency: CONCURRENCY$5 });
14103
- const found = yield* Effect.forEach(Array$1.flatten(mods), checkMod, { concurrency: CONCURRENCY$5 });
14104
+ const mods = yield* Effect.forEach(plugins, (plugin) => modsOf(root, plugin), { concurrency: CONCURRENCY$6 });
14105
+ const found = yield* Effect.forEach(Array$1.flatten(mods), checkMod, { concurrency: CONCURRENCY$6 });
14104
14106
  return Array$1.flatten(found);
14105
14107
  });
14106
14108
  // src/features/check-plugin-dependencies/model/unresolved-imports.ts
@@ -14127,7 +14129,7 @@ const unresolvedFrom = (entries) => Effect.acquireUseRelease(Effect.tryPromise({
14127
14129
  catch: bundleErrorDetail
14128
14130
  }), (bundle) => Effect.promise(() => bundle.close())).pipe(Effect.map(({ output }) => unresolvedIn(pipe(output, Array$1.filter(isChunk$1)))));
14129
14131
  // src/features/check-plugin-dependencies/model/plugin-dependencies.ts
14130
- const RULE$50 = "plugin-dependencies";
14132
+ const RULE$51 = "plugin-dependencies";
14131
14133
  const PLUGIN_FILE$3 = ".claude-plugin/plugin.json";
14132
14134
  const LOCK_FILE = "bun.lock";
14133
14135
  const SOURCE_FILE$1 = /\.[cm]?[jt]sx?$/u;
@@ -14136,7 +14138,7 @@ const SUCCESS$6 = 0;
14136
14138
  const NOT_STARTED = -1;
14137
14139
  const DETAIL_LINES = 3;
14138
14140
  const PLUGIN_CONCURRENCY = 2;
14139
- const problemFor$4 = problemInFile(RULE$50);
14141
+ const problemFor$4 = problemInFile(RULE$51);
14140
14142
  const hasDependencies = Effect.fn("hasDependencies")(function* hasDependencies(directory) {
14141
14143
  const files = yield* RepositoryFiles;
14142
14144
  const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));
@@ -14365,7 +14367,7 @@ const bundleScopeOf = ({ manifest, workspace }) => ({
14365
14367
  });
14366
14368
  const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
14367
14369
  // src/features/check-tree-shaking/model/optional-peers.ts
14368
- const RULE$49 = "optional-peer";
14370
+ const RULE$50 = "optional-peer";
14369
14371
  const REQUIRED_RULE = "required-peer";
14370
14372
  const START$28 = 0;
14371
14373
  const SINGLE$3 = 1;
@@ -14382,7 +14384,7 @@ const positionIn = (located, key, name) => {
14382
14384
  const problemFor$3 = (located, name, importers) => ({
14383
14385
  file: located.file,
14384
14386
  ...positionIn(located, DEPENDENCIES_KEY, name),
14385
- rule: RULE$49,
14387
+ rule: RULE$50,
14386
14388
  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.`
14387
14389
  });
14388
14390
  const requiredPeerAdvice = (fromStack) => {
@@ -14418,7 +14420,7 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
14418
14420
  }));
14419
14421
  };
14420
14422
  // src/features/check-tree-shaking/model/side-effects.ts
14421
- const RULE$48 = "side-effects";
14423
+ const RULE$49 = "side-effects";
14422
14424
  const BUNDLE_CONCURRENCY$2 = 4;
14423
14425
  const START$27 = 0;
14424
14426
  const FIRST$12 = 1;
@@ -14470,11 +14472,11 @@ const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source),
14470
14472
  const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
14471
14473
  file,
14472
14474
  ...positionOf(source)(keyIndex$1(source)),
14473
- rule: RULE$48,
14475
+ rule: RULE$49,
14474
14476
  message: messageOf$5(worst, excesses.length)
14475
14477
  })), Option.toArray);
14476
14478
  // src/features/check-tree-shaking/model/top-level-effects.ts
14477
- const RULE$47 = "top-level-effect";
14479
+ const RULE$48 = "top-level-effect";
14478
14480
  const CODE$1 = /\.[cm]?[jt]sx?$/u;
14479
14481
  const READ_CONCURRENCY$19 = 16;
14480
14482
  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.";
@@ -14490,7 +14492,7 @@ const messageOf$4 = (statement) => {
14490
14492
  const problemsIn$14 = (api) => (file) => (source) => {
14491
14493
  const retained = api.createSourceFile(file, source);
14492
14494
  const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$6({
14493
- rule: RULE$47,
14495
+ rule: RULE$48,
14494
14496
  message: messageOf$4(statement)
14495
14497
  })(statement)));
14496
14498
  retained.dispose();
@@ -14659,7 +14661,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
14659
14661
  return Array$1.flatten(found);
14660
14662
  });
14661
14663
  // src/features/check-typescript-generation/model/typescript-generation.ts
14662
- const RULE$46 = "legacy-typescript";
14664
+ const RULE$47 = "legacy-typescript";
14663
14665
  const LOCKFILE = "pnpm-lock.yaml";
14664
14666
  const COMPILER = "typescript";
14665
14667
  const CURRENT_MAJOR = 7;
@@ -14690,12 +14692,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
14690
14692
  file,
14691
14693
  line: lineOf$4(source)(legacy.id),
14692
14694
  column: FIRST$11,
14693
- rule: RULE$46,
14695
+ rule: RULE$47,
14694
14696
  message: messageOf$3(legacy, dependentsOf$1(Option.getOrElse(nodes, () => []))(legacy.id))
14695
14697
  })));
14696
14698
  });
14697
14699
  // src/features/check-worker-bundles/model/worker-bundles.ts
14698
- const RULE$45 = "worker-bundle";
14700
+ const RULE$46 = "worker-bundle";
14699
14701
  const BUNDLE_CONCURRENCY = 4;
14700
14702
  const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
14701
14703
  const CONDITIONS = [
@@ -14706,7 +14708,7 @@ const CONDITIONS = [
14706
14708
  "module",
14707
14709
  "default"
14708
14710
  ];
14709
- const problemFor$2 = problemInFile(RULE$45);
14711
+ const problemFor$2 = problemInFile(RULE$46);
14710
14712
  const problemOf$10 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
14711
14713
  const bundleProblem = (file) => Effect.gen(function* bundle() {
14712
14714
  const built = yield* Effect.tryPromise({
@@ -14899,7 +14901,7 @@ const weakeningsOf = (expected) => (config) => [
14899
14901
  ...secretWeakenings(config.h56m, expected.secrets)
14900
14902
  ];
14901
14903
  // src/app/disabled-rules.ts
14902
- const RULE$44 = "disabled-rule";
14904
+ const RULE$45 = "disabled-rule";
14903
14905
  const CONFIG_FILE$5 = "vite.config.ts";
14904
14906
  const START$25 = 0;
14905
14907
  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;
@@ -14913,7 +14915,7 @@ const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
14913
14915
  const files = yield* RepositoryFiles;
14914
14916
  const listed = yield* files.listedFiles(root);
14915
14917
  const isExempt = matcher(exempt);
14916
- 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)));
14918
+ 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)));
14917
14919
  });
14918
14920
  const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
14919
14921
  const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$5);
@@ -14925,7 +14927,7 @@ const configWeakenings = Effect.fn("configWeakenings")(function* configWeakening
14925
14927
  })
14926
14928
  });
14927
14929
  const expected = yield* expectationsIn(root);
14928
- const at = problemAtIndex(RULE$44)(file, source);
14930
+ const at = problemAtIndex(RULE$45)(file, source);
14929
14931
  return pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$25), message)));
14930
14932
  });
14931
14933
  /** @internal */
@@ -14933,7 +14935,7 @@ const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabl
14933
14935
  const files = yield* RepositoryFiles;
14934
14936
  const text = yield* files.readFile(files.join(root, CONFIG_FILE$5));
14935
14937
  if (Option.isNone(text)) return [];
14936
- 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)];
14938
+ 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)];
14937
14939
  });
14938
14940
  // src/app/build-checks.ts
14939
14941
  /** @internal */
@@ -15030,7 +15032,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
15030
15032
  imports: importedFilesOf(checker)(sourceFile)
15031
15033
  })), Array$1.filter((facts) => Array$1.isReadonlyArrayNonEmpty(facts.values) || Array$1.isReadonlyArrayNonEmpty(facts.imports)));
15032
15034
  // src/features/check-value-owners/model/name-lists.ts
15033
- const RULE$43 = "hand-written-names";
15035
+ const RULE$44 = "hand-written-names";
15034
15036
  const TEST_FILE$1 = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
15035
15037
  const nameListOf = (site) => {
15036
15038
  if (TEST_FILE$1.test(site.file) || site.values.length < 2) return Option.none();
@@ -15045,7 +15047,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
15045
15047
  file,
15046
15048
  line,
15047
15049
  column,
15048
- rule: RULE$43,
15050
+ rule: RULE$44,
15049
15051
  message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
15050
15052
  });
15051
15053
  const problemOf$9 = ({ list, reason }) => listedProblem({
@@ -15836,7 +15838,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
15836
15838
  return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
15837
15839
  }, Effect.scoped);
15838
15840
  // src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
15839
- const RULE$42 = "namespace-destructuring";
15841
+ const RULE$43 = "namespace-destructuring";
15840
15842
  const LOCAL = /^[.#/]/u;
15841
15843
  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.`;
15842
15844
  const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
@@ -15852,7 +15854,7 @@ const destructuredName = (declaration) => {
15852
15854
  return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
15853
15855
  };
15854
15856
  const problemOf$8 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$6({
15855
- rule: RULE$42,
15857
+ rule: RULE$43,
15856
15858
  message: messageOf$2(name)
15857
15859
  })), Option.map((report) => report(declaration)));
15858
15860
  const namespaceDestructuringIn = () => (sourceFile) => {
@@ -15860,7 +15862,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
15860
15862
  return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$8(names)), Array$1.getSomes);
15861
15863
  };
15862
15864
  // src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
15863
- const RULE$41 = "pass-through-wrapper";
15865
+ const RULE$42 = "pass-through-wrapper";
15864
15866
  const SINGLE_STATEMENT = 1;
15865
15867
  const SINGLE_DECLARATION = 1;
15866
15868
  const THIS_PARAMETER = "this";
@@ -15957,7 +15959,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
15957
15959
  const problemOf$7 = (checker) => (candidate) => {
15958
15960
  if (changesTheCall(candidate.wrapper)) return Option.none();
15959
15961
  return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$6({
15960
- rule: RULE$41,
15962
+ rule: RULE$42,
15961
15963
  message: messageOf$1(forward.callee.getText())
15962
15964
  })(candidate.name)));
15963
15965
  };
@@ -15980,7 +15982,7 @@ const repositoryOrigin = Effect.fn("repositoryOrigin")(function* repositoryOrigi
15980
15982
  /** @internal */
15981
15983
  const slugOf = ({ owner, name }) => `${owner}/${name}`;
15982
15984
  // src/features/check-agent-settings/model/known-plugins.ts
15983
- const RULE$40 = "known-plugins";
15985
+ const RULE$41 = "known-plugins";
15984
15986
  const SETTINGS_FILE$3 = ".claude/settings.json";
15985
15987
  const MARKETPLACE_FILE$2 = ".claude-plugin/marketplace.json";
15986
15988
  const GITHUB$5 = "github";
@@ -16001,12 +16003,12 @@ const MarketplaceSchema = Schema.Struct({
16001
16003
  plugins: Schema.Array(Schema.Struct({ name: Schema.String }))
16002
16004
  });
16003
16005
  const decodeMarketplace = Schema.decodeUnknownOption(Schema.fromJsonString(MarketplaceSchema));
16004
- const problem$5 = problemInFile(RULE$40);
16006
+ const problem$6 = problemInFile(RULE$41);
16005
16007
  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));
16006
16008
  const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
16007
16009
  const pluginProblems = (marketplace, file, settings) => {
16008
16010
  const enabled = pluginEnabled(settings);
16009
- 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.`)));
16011
+ 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.`)));
16010
16012
  };
16011
16013
  /** @internal */
16012
16014
  const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlugins(root) {
@@ -16026,7 +16028,7 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
16026
16028
  }));
16027
16029
  });
16028
16030
  // src/features/check-agent-settings/model/missing-hooks.ts
16029
- const RULE$39 = "missing-hook";
16031
+ const RULE$40 = "missing-hook";
16030
16032
  const SETTINGS_FILE$2 = /^\.claude\/settings\.json$/u;
16031
16033
  const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
16032
16034
  const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
@@ -16051,7 +16053,7 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
16051
16053
  return pipe(missing, Array$1.map(({ path, index }) => ({
16052
16054
  file,
16053
16055
  ...positionOf(source)(index),
16054
- rule: RULE$39,
16056
+ rule: RULE$40,
16055
16057
  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.`
16056
16058
  })));
16057
16059
  });
@@ -16079,7 +16081,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
16079
16081
  return Array$1.flatten(found);
16080
16082
  });
16081
16083
  // src/features/check-agent-settings/model/project-extensions.ts
16082
- const RULE$38 = "project-claude-extensions";
16084
+ const RULE$39 = "project-claude-extensions";
16083
16085
  const SETTINGS_FILE$1 = ".claude/settings.json";
16084
16086
  const SETUP_EVENT = "SessionStart";
16085
16087
  const EXTENSION_DIRECTORIES = [
@@ -16095,8 +16097,8 @@ const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Settin
16095
16097
  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) => {
16096
16098
  const message = `runs a ${event} hook from the project settings. ${REASON$3}`;
16097
16099
  return pipe(source, String$1.indexOf(`"${event}"`), Option.match({
16098
- onNone: () => problemInFile(RULE$38)(file, message),
16099
- onSome: (index) => problemAtIndex(RULE$38)(file, source)(index, message)
16100
+ onNone: () => problemInFile(RULE$39)(file, message),
16101
+ onSome: (index) => problemAtIndex(RULE$39)(file, source)(index, message)
16100
16102
  }));
16101
16103
  }));
16102
16104
  const checkProjectExtensions = Effect.fn("checkProjectExtensions")(function* checkProjectExtensions(root) {
@@ -16104,7 +16106,7 @@ const checkProjectExtensions = Effect.fn("checkProjectExtensions")(function* che
16104
16106
  const settingsFile = files.join(root, SETTINGS_FILE$1);
16105
16107
  const settings = yield* files.readFile(settingsFile);
16106
16108
  const tracked = yield* files.trackedFiles(root, EXTENSION_DIRECTORIES);
16107
- 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}`)));
16109
+ 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}`)));
16108
16110
  return [...Option.match(settings, {
16109
16111
  onNone: () => [],
16110
16112
  onSome: (source) => hookProblems(settingsFile, source)
@@ -16136,7 +16138,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
16136
16138
  }, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
16137
16139
  const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
16138
16140
  // src/features/check-documented-commands/model/commands.ts
16139
- const RULE$37 = "documented-commands";
16141
+ const RULE$38 = "documented-commands";
16140
16142
  const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
16141
16143
  const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
16142
16144
  const COMMAND = /`vp run (?<args>[^`]+)`/gu;
@@ -16214,7 +16216,7 @@ const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph,
16214
16216
  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 }) => ({
16215
16217
  file: absolute(file),
16216
16218
  ...positionOf(text)(match.index ?? START$23),
16217
- rule: RULE$37,
16219
+ rule: RULE$38,
16218
16220
  message: `${match[START$23]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
16219
16221
  })), Option.toArray)));
16220
16222
  const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$12), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
@@ -16239,14 +16241,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
16239
16241
  file: absolute(Array$1.headNonEmpty(commanded).file),
16240
16242
  line: ONE$2,
16241
16243
  column: ONE$2,
16242
- rule: RULE$37,
16244
+ rule: RULE$38,
16243
16245
  message: "msch could not list the tasks with `vp run --json`"
16244
16246
  }],
16245
16247
  onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$12(found, absolute, document)))
16246
16248
  });
16247
16249
  });
16248
16250
  // src/features/check-legacy-web/model/legacy-web.ts
16249
- const RULE$36 = "legacy-web";
16251
+ const RULE$37 = "legacy-web";
16250
16252
  const FIRST_COLUMN$7 = 1;
16251
16253
  const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
16252
16254
  const Finding = Schema.Struct({
@@ -16285,7 +16287,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
16285
16287
  file: files.join(root, file),
16286
16288
  line,
16287
16289
  column: FIRST_COLUMN$7,
16288
- rule: RULE$36,
16290
+ rule: RULE$37,
16289
16291
  message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
16290
16292
  });
16291
16293
  return pipe(scan.guides, Array$1.flatMap(({ guideId, rules }) => pipe(rules, Array$1.flatMap(({ ruleId, findings }) => pipe(findings, Array$1.map(problemOf(guideId, ruleId)))))));
@@ -16358,7 +16360,7 @@ const SETTINGS_FILE = ".claude/settings.json";
16358
16360
  const PLUGIN_HOOKS = /(?:^|\/)hooks\/hooks\.json$/u;
16359
16361
  const PLUGIN_ROOT = /\$\{CLAUDE_PLUGIN_ROOT\}/gu;
16360
16362
  const READ_CONCURRENCY$17 = 64;
16361
- const RULE$35 = "shell-script";
16363
+ const RULE$36 = "shell-script";
16362
16364
  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.";
16363
16365
  const HookSchema = Schema.Struct({
16364
16366
  command: Schema.optional(Schema.String),
@@ -16402,7 +16404,7 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
16402
16404
  };
16403
16405
  const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
16404
16406
  const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$17 });
16405
- return pipe(shell, Array$1.map((name) => problemInFile(RULE$35)(files.join(root, name), MESSAGE$9)));
16407
+ return pipe(shell, Array$1.map((name) => problemInFile(RULE$36)(files.join(root, name), MESSAGE$9)));
16406
16408
  });
16407
16409
  // src/features/check-structure/model/structure.ts
16408
16410
  const checkStructure = checkSection({
@@ -16640,7 +16642,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
16640
16642
  return Array$1.flatten(found);
16641
16643
  });
16642
16644
  // src/features/check-vite-plus/model/package-scripts.ts
16643
- const RULE$34 = "package-script";
16645
+ const RULE$35 = "package-script";
16644
16646
  const LIFECYCLE = [
16645
16647
  "preinstall",
16646
16648
  "install",
@@ -16663,12 +16665,12 @@ const LIFECYCLE = [
16663
16665
  const problemOf$6 = ({ file, position, name }) => ({
16664
16666
  file,
16665
16667
  ...position,
16666
- rule: RULE$34,
16668
+ rule: RULE$35,
16667
16669
  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.`
16668
16670
  });
16669
16671
  const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$6));
16670
16672
  // src/features/check-vite-plus/model/vite-plus-block.ts
16671
- const RULE$33 = "vite-plus-block";
16673
+ const RULE$34 = "vite-plus-block";
16672
16674
  const MARKER = Array$1.join([
16673
16675
  "<!--",
16674
16676
  "VITE PLUS START",
@@ -16681,7 +16683,7 @@ const problemIn = (file) => (source) => {
16681
16683
  return Option.some({
16682
16684
  file,
16683
16685
  ...positionOf(source)(index.value),
16684
- rule: RULE$33,
16686
+ rule: RULE$34,
16685
16687
  message: MESSAGE$8
16686
16688
  });
16687
16689
  };
@@ -16714,7 +16716,7 @@ const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
16714
16716
  return pipe(drifts, Array$1.map(problemOf$5));
16715
16717
  });
16716
16718
  // src/features/check-workflows/model/release-please.ts
16717
- const RULE$32 = "release-please";
16719
+ const RULE$33 = "release-please";
16718
16720
  const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
16719
16721
  const FIRST$8 = 1;
16720
16722
  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.";
@@ -16726,7 +16728,7 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
16726
16728
  file: files.join(root, name),
16727
16729
  line: FIRST$8,
16728
16730
  column: FIRST$8,
16729
- rule: RULE$32,
16731
+ rule: RULE$33,
16730
16732
  message: MESSAGE$7
16731
16733
  })));
16732
16734
  });
@@ -17015,7 +17017,7 @@ const scannedFiles = Effect.fn("scannedFiles")(function* scannedFiles(root) {
17015
17017
  })), Array$1.filter(({ file }) => !HashSet.has(skipped, file)));
17016
17018
  });
17017
17019
  // src/features/ban-comments/model/comments.ts
17018
- const RULE$31 = "comment";
17020
+ const RULE$32 = "comment";
17019
17021
  const SUPPRESSION_RULE = "suppression";
17020
17022
  const UNUSED_RULE = "unused-comment-allowance";
17021
17023
  const CONFIG_FILE$3 = "vite.config.ts";
@@ -17047,7 +17049,7 @@ const NOTHING = {
17047
17049
  used: []
17048
17050
  };
17049
17051
  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.`;
17050
- 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)));
17052
+ 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)));
17051
17053
  const settingsOf = ({ msch }) => ({ allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
17052
17054
  onNone: () => NO_SETTINGS.allow,
17053
17055
  onSome: ({ allow }) => allow
@@ -17084,7 +17086,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
17084
17086
  problems: pipe(found, Array$1.filter(kept), Array$1.map(toProblem)),
17085
17087
  used: usedAllowances(allowances, found)
17086
17088
  })), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
17087
- problems: [problemAtIndex(RULE$31)(file, source)(START$19, `msch could not read the comments in this file: ${message}`)],
17089
+ problems: [problemAtIndex(RULE$32)(file, source)(START$19, `msch could not read the comments in this file: ${message}`)],
17088
17090
  used: []
17089
17091
  })))
17090
17092
  });
@@ -17197,7 +17199,7 @@ const PYTHON = {
17197
17199
  /** @internal */
17198
17200
  const checkPython = (root) => checkBannedTool(root, PYTHON);
17199
17201
  // src/features/check-catalog-entries/model/uncataloged-dependencies.ts
17200
- const RULE$30 = "uncataloged-dependency";
17202
+ const RULE$31 = "uncataloged-dependency";
17201
17203
  const OWNED_ELSEWHERE = [
17202
17204
  "catalog:",
17203
17205
  "workspace:",
@@ -17211,7 +17213,7 @@ const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array$1.some((
17211
17213
  const problemsIn$11 = (entry, source) => pipe(manifestSpecifiers(source), Array$1.filter((found) => !isOwnedElsewhere(found)), Array$1.map((found) => ({
17212
17214
  file: entry.file,
17213
17215
  ...positionOf(source)(offsetIn(source)(manifestPattern(found))),
17214
- rule: RULE$30,
17216
+ rule: RULE$31,
17215
17217
  message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$5}`
17216
17218
  })));
17217
17219
  /** @internal */
@@ -17232,7 +17234,7 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
17232
17234
  const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
17233
17235
  const FIRST_LINE$5 = 1;
17234
17236
  const FIRST_COLUMN$5 = 1;
17235
- const RULE$29 = "prune-setting-off";
17237
+ const RULE$30 = "prune-setting-off";
17236
17238
  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."]];
17237
17239
  const decodeTrue = Schema.decodeUnknownOption(Schema.Literal(true));
17238
17240
  const lineOf$3 = (source) => (setting) => pipe(String$1.split(source, "\n"), Array$1.findFirstIndex(String$1.startsWith(`${setting}:`)), Option.match({
@@ -17246,7 +17248,7 @@ const pruneProblems = Effect.fn("pruneProblems")(function* pruneProblems(file, s
17246
17248
  file,
17247
17249
  line: at(setting),
17248
17250
  column: FIRST_COLUMN$5,
17249
- rule: RULE$29,
17251
+ rule: RULE$30,
17250
17252
  message: `Set \`${setting}: true\`. It ${effect}`
17251
17253
  })));
17252
17254
  });
@@ -17340,13 +17342,13 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
17340
17342
  ];
17341
17343
  });
17342
17344
  // src/features/check-skills/model/published-skills.ts
17343
- const RULE$28 = "published-skills";
17345
+ const RULE$29 = "published-skills";
17344
17346
  const KEYWORD = "tanstack-intent";
17345
17347
  const SKILLS = "skills";
17346
17348
  const SKILL_FILE$3 = "SKILL.md";
17347
17349
  const SUCCEEDED = 0;
17348
17350
  const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
17349
- const problemAt$2 = problemInFile(RULE$28);
17351
+ const problemAt$2 = problemInFile(RULE$29);
17350
17352
  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))));
17351
17353
  const isShipped = (listed) => (skill) => Array$1.contains(listed, SKILLS) || Array$1.contains(listed, skill);
17352
17354
  const packagingMessages = ({ keywords, files }, skills) => {
@@ -17383,7 +17385,7 @@ const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPu
17383
17385
  return Array$1.flatten(problems);
17384
17386
  });
17385
17387
  // src/features/check-skills/model/skill-files.ts
17386
- const RULE$27 = "skill-file";
17388
+ const RULE$28 = "skill-file";
17387
17389
  const SKILL_FILE$2 = /(?:^|\/)SKILL\.md$/u;
17388
17390
  const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
17389
17391
  const FIXTURE$1 = /(?:^|\/)fixtures\//u;
@@ -17440,7 +17442,7 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
17440
17442
  ]), Option.getOrElse(() => []), Array$1.map(({ index, message }) => ({
17441
17443
  file: skill.file,
17442
17444
  ...positionOf(skill.source)(index),
17443
- rule: RULE$27,
17445
+ rule: RULE$28,
17444
17446
  message
17445
17447
  })));
17446
17448
  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) => ({
@@ -17467,7 +17469,7 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
17467
17469
  return pipe(missing, Array$1.map(({ target, index }) => ({
17468
17470
  file,
17469
17471
  ...positionOf(source)(index),
17470
- rule: RULE$27,
17472
+ rule: RULE$28,
17471
17473
  message: `links to ${target}, which does not exist. Fix the path or remove the link.`
17472
17474
  })));
17473
17475
  });
@@ -17483,7 +17485,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
17483
17485
  file: files.join(root, entry),
17484
17486
  line: FIRST$7,
17485
17487
  column: FIRST$7,
17486
- rule: RULE$27,
17488
+ rule: RULE$28,
17487
17489
  message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
17488
17490
  })));
17489
17491
  return [
@@ -17561,7 +17563,7 @@ const cargoEntries = (text) => {
17561
17563
  };
17562
17564
  const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
17563
17565
  // src/features/check-version-downgrades/model/version-downgrade.ts
17564
- const RULE$26 = "version-downgrade";
17566
+ const RULE$27 = "version-downgrade";
17565
17567
  const READ_CONCURRENCY$13 = 16;
17566
17568
  const READERS = [
17567
17569
  [/(?:^|\/)package\.json$/u, manifestEntries],
@@ -17586,7 +17588,7 @@ const downgradesIn = ({ file, text, before, after }) => {
17586
17588
  file,
17587
17589
  line: lineOf$2(text, entry),
17588
17590
  column: FIRST_LINE$4,
17589
- rule: RULE$26,
17591
+ rule: RULE$27,
17590
17592
  message: message$1(old, entry)
17591
17593
  })), Option.toArray)));
17592
17594
  };
@@ -17669,7 +17671,7 @@ const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
17669
17671
  return Array$1.getSomes(read);
17670
17672
  });
17671
17673
  // src/features/check-version-downgrades/model/package-versions.ts
17672
- const RULE$25 = "unbumped-package";
17674
+ const RULE$26 = "unbumped-package";
17673
17675
  const UNSHIPPED = /(?:\.test\.[\w.]+$|(?:^|\/)(?:fixtures|__tests__|tests?)\/|(?:^|\/)(?:AGENTS|CLAUDE|CHANGELOG)\.md$)/u;
17674
17676
  const UNVERSIONED$5 = "0.0.0";
17675
17677
  const FIRST_LINE$3 = 1;
@@ -17744,7 +17746,7 @@ const checkPackageVersions = Effect.fn("checkPackageVersions")(function* checkPa
17744
17746
  file: files.join(root, pack.file),
17745
17747
  line: versionLine(pack.text),
17746
17748
  column: FIRST_COLUMN$4,
17747
- rule: RULE$25,
17749
+ rule: RULE$26,
17748
17750
  message: message(pack, part, lowest)
17749
17751
  })), Option.toArray);
17750
17752
  }), { concurrency: READ_CONCURRENCY$10 });
@@ -17753,7 +17755,7 @@ const checkPackageVersions = Effect.fn("checkPackageVersions")(function* checkPa
17753
17755
  // src/features/find-unneeded-files/model/applied-packages.ts
17754
17756
  const SCOPE$1 = Option.getOrElse(scopeOfName(SELF_NAME), () => SELF_NAME);
17755
17757
  const PLUGIN_KEYWORDS = ["oxlint-plugin", "textlint-rule"];
17756
- const RULE$24 = "applied-package";
17758
+ const RULE$25 = "applied-package";
17757
17759
  const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
17758
17760
  const NOT_FOUND$4 = -1;
17759
17761
  const SEPARATOR$9 = "/";
@@ -17789,7 +17791,7 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
17789
17791
  const problemAt$1 = (file, source) => (index, name) => ({
17790
17792
  file,
17791
17793
  ...positionOf(source)(index),
17792
- rule: RULE$24,
17794
+ rule: RULE$25,
17793
17795
  message: `msch applies ${name}. Remove this use and let msch apply it.`
17794
17796
  });
17795
17797
  const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped$1(name)}(?=["'\`/])`, "gu");
@@ -17844,7 +17846,7 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
17844
17846
  return yield* appliedPackageProblems(root, applied);
17845
17847
  });
17846
17848
  // src/features/find-unneeded-files/model/replaced-tools.ts
17847
- const RULE$23 = "replaced-tool";
17849
+ const RULE$24 = "replaced-tool";
17848
17850
  const FIRST$6 = 1;
17849
17851
  const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
17850
17852
  const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
@@ -17925,7 +17927,7 @@ const problemFor$1 = ({ name, file }) => pipe(REPLACED, Array$1.findFirst(({ pat
17925
17927
  file,
17926
17928
  line: FIRST$6,
17927
17929
  column: FIRST$6,
17928
- rule: RULE$23,
17930
+ rule: RULE$24,
17929
17931
  message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
17930
17932
  })));
17931
17933
  /** @internal */
@@ -18064,7 +18066,7 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
18064
18066
  return yield* unneededIn(root, cargoEnabled(workspace.value));
18065
18067
  });
18066
18068
  // src/features/check-markdown-directives/model/directives.ts
18067
- const RULE$22 = "markdown-directive";
18069
+ const RULE$23 = "markdown-directive";
18068
18070
  const START$14 = 0;
18069
18071
  const SECOND = 1;
18070
18072
  const ODD = 1;
@@ -18089,7 +18091,7 @@ const problemsIn$7 = (file, source) => {
18089
18091
  const { line, column } = positionOf(source)(index);
18090
18092
  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));
18091
18093
  };
18092
- 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)));
18094
+ 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)));
18093
18095
  };
18094
18096
  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)));
18095
18097
  /** @internal */
@@ -18102,7 +18104,7 @@ const checkMarkdownDirectives = Effect.fn("checkMarkdownDirectives")(function* c
18102
18104
  }))), ({ file }, source) => problemsIn$7(file, source));
18103
18105
  });
18104
18106
  // src/features/check-owner-names/model/owner-names.ts
18105
- const RULE$21 = "owner-name";
18107
+ const RULE$22 = "owner-name";
18106
18108
  const TEXT_FILE$1 = /\.(?:[cm]?[jt]sx?|jsonc?|md|ya?ml|toml)$/u;
18107
18109
  const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
18108
18110
  const SEPARATOR$7 = "/";
@@ -18144,7 +18146,7 @@ const manifestProblems$3 = ({ owner, file, manifest }) => pipe(ownerOffsets({
18144
18146
  }), Array$1.head, Option.toArray, Array$1.map(() => ({
18145
18147
  file,
18146
18148
  ...positionOf("")(START$13),
18147
- rule: RULE$21,
18149
+ rule: RULE$22,
18148
18150
  message: `Its description or keywords ${messageFor$4(owner)}`
18149
18151
  })));
18150
18152
  const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProblems(root, owner, directory) {
@@ -18165,7 +18167,7 @@ const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProb
18165
18167
  }), Array$1.map((offset) => ({
18166
18168
  file,
18167
18169
  ...positionOf(source)(offset),
18168
- rule: RULE$21,
18170
+ rule: RULE$22,
18169
18171
  message: messageFor$4(owner)
18170
18172
  }))));
18171
18173
  return [...manifestProblems$3({
@@ -18198,7 +18200,7 @@ const branchCarries = Effect.fn("branchCarries")(function* branchCarries(root, b
18198
18200
  return pipe(messages, Array$1.some((commit) => trailer.test(commit)));
18199
18201
  });
18200
18202
  // src/features/check-owner-principles/model/owner-principles.ts
18201
- const RULE$20 = "owner-principle-changed";
18203
+ const RULE$21 = "owner-principle-changed";
18202
18204
  const PRINCIPLE_FILE = /(?:^|\/)(?:skills\/principle-[^/]+\/|PRINCIPLE\.md$)/u;
18203
18205
  const TRAILER = /^Owner-Said:[ \t]*\S/mu;
18204
18206
  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.";
@@ -18210,7 +18212,7 @@ const checkOwnerPrinciples = Effect.fn("checkOwnerPrinciples")(function* checkOw
18210
18212
  const all = yield* files.changedFiles(root, base.value);
18211
18213
  const changed = pipe(all, Array$1.filter((name) => PRINCIPLE_FILE.test(name)));
18212
18214
  if (!Array$1.isReadonlyArrayNonEmpty(changed) || (yield* branchCarries(root, base.value, TRAILER))) return [];
18213
- return pipe(changed, Array$1.map((name) => problemInFile(RULE$20)(files.join(root, name), MESSAGE$3)));
18215
+ return pipe(changed, Array$1.map((name) => problemInFile(RULE$21)(files.join(root, name), MESSAGE$3)));
18214
18216
  });
18215
18217
  // src/features/find-invisible-characters/model/hidden-unicode.ts
18216
18218
  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;
@@ -18219,14 +18221,14 @@ const START$12 = 0;
18219
18221
  const HEX = 16;
18220
18222
  const CODE_POINT_WIDTH = 4;
18221
18223
  const READ_CONCURRENCY$9 = 64;
18222
- const RULE$19 = "hidden-unicode";
18224
+ const RULE$20 = "hidden-unicode";
18223
18225
  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"));
18224
18226
  const problemOf$3 = (file, source) => (found) => {
18225
18227
  const hex = hexOf(found[START$12]);
18226
18228
  return {
18227
18229
  file,
18228
18230
  ...positionOf(source)(found.index ?? START$12),
18229
- rule: RULE$19,
18231
+ rule: RULE$20,
18230
18232
  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}.`
18231
18233
  };
18232
18234
  };
@@ -18259,7 +18261,7 @@ const checkDocuments = Effect.fn("checkDocuments")(function* checkDocuments(root
18259
18261
  return Array$1.flatten(found);
18260
18262
  });
18261
18263
  // src/features/check-effect-diagnostics/model/effect-diagnostics.ts
18262
- const RULE$18 = "effect-diagnostics-once";
18264
+ const RULE$19 = "effect-diagnostics-once";
18263
18265
  const PLUGIN = "@effect/language-service";
18264
18266
  const CONFIG_PATHSPEC = ":(glob)**/tsconfig*.json";
18265
18267
  const EXCLUDED$4 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
@@ -18277,7 +18279,7 @@ const reportsDiagnostics = (plugin) => plugin.name === PLUGIN && plugin.diagnost
18277
18279
  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(() => ({
18278
18280
  file: entry.file,
18279
18281
  ...positionOf(source)(pipe(String$1.indexOf(`"${PLUGIN}"`)(source), Option.getOrElse(() => START$11))),
18280
- rule: RULE$18,
18282
+ rule: RULE$19,
18281
18283
  message: MESSAGE$2
18282
18284
  })), Option.toArray);
18283
18285
  /** @internal */
@@ -18290,7 +18292,7 @@ const checkEffectDiagnostics = Effect.fn("checkEffectDiagnostics")(function* che
18290
18292
  }))), problemsIn$5);
18291
18293
  });
18292
18294
  // src/features/check-exact-versions/model/exact-versions.ts
18293
- const RULE$17 = "version-range";
18295
+ const RULE$18 = "version-range";
18294
18296
  const WORKSPACE_FILE = "pnpm-workspace.yaml";
18295
18297
  const ALIAS = /^npm:(?:@[^/@]+\/)?[^@]+@(?<version>.+)$/u;
18296
18298
  const PROTOCOL = /^[a-z+]+:/u;
@@ -18306,7 +18308,7 @@ const isRange = (specifier) => {
18306
18308
  const problemsFor = (file, source, pattern) => (found) => pipe(found, Array$1.filter(({ specifier }) => isRange(specifier)), Array$1.map((range) => ({
18307
18309
  file,
18308
18310
  ...positionOf(source)(offsetIn(source)(pattern(range))),
18309
- rule: RULE$17,
18311
+ rule: RULE$18,
18310
18312
  message: `\`${range.name}\` \`${range.specifier}\` ${MESSAGE$1}`
18311
18313
  })));
18312
18314
  const catalogPattern = ({ name }) => new RegExp(`^\\s+["']?${quoted$1(name)}["']?:`, "mu");
@@ -18335,7 +18337,7 @@ const checkExactVersions = Effect.fn("checkExactVersions")(function* checkExactV
18335
18337
  return [...fromManifests, ...fromCatalogs];
18336
18338
  });
18337
18339
  // src/features/check-pack-settings/model/pack-settings.ts
18338
- const RULE$16 = "pack-publint";
18340
+ const RULE$17 = "pack-publint";
18339
18341
  const CONFIG_FILE = "vite.config.ts";
18340
18342
  const PACK_KEY = "pack:";
18341
18343
  const START$10 = 0;
@@ -18351,7 +18353,7 @@ const runsStrictPublint = (config) => pipe(decodePackConfig(config), Option.flat
18351
18353
  const problemFor = (file, source) => ({
18352
18354
  file,
18353
18355
  ...positionOf(source)(Option.getOrElse(String$1.indexOf(PACK_KEY)(source), () => START$10)),
18354
- rule: RULE$16,
18356
+ rule: RULE$17,
18355
18357
  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."
18356
18358
  });
18357
18359
  const strictPublintIn = Effect.fn("strictPublintIn")(function* strictPublintIn(configFile) {
@@ -18381,7 +18383,7 @@ const checkPackSettings = Effect.fn("checkPackSettings")(function* checkPackSett
18381
18383
  return Array$1.flatten(found);
18382
18384
  });
18383
18385
  // src/features/check-published-manifest/model/private-dependency.ts
18384
- const RULE$15 = "private-workspace-dependency";
18386
+ const RULE$16 = "private-workspace-dependency";
18385
18387
  const START$9 = 0;
18386
18388
  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) => ({
18387
18389
  section,
@@ -18391,9 +18393,9 @@ const messageFor$3 = ({ section, name }) => `lists the private workspace package
18391
18393
  /** @internal */
18392
18394
  const quotedNameIndex = (source) => (name) => pipe(String$1.indexOf(`"${name}"`)(source), Option.getOrElse(() => START$9));
18393
18395
  /** @internal */
18394
- 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))));
18396
+ 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))));
18395
18397
  // src/features/check-published-manifest/model/dependency-peer-floor.ts
18396
- const RULE$14 = "dependency-peer-floor";
18398
+ const RULE$15 = "dependency-peer-floor";
18397
18399
  const NODE_MODULES = "node_modules";
18398
18400
  const namesOf$1 = (section) => pipe(Option.fromUndefinedOr(section), Option.map(Record.keys), Option.getOrElse(() => []));
18399
18401
  const isOptional = (manifest, peer) => pipe(Option.fromUndefinedOr(manifest.peerDependenciesMeta), Option.flatMap(Record.get(peer)), Option.exists((meta) => meta.optional === true));
@@ -18456,10 +18458,10 @@ const ownPeers = ({ manifest }) => requiredPeersOf(manifest);
18456
18458
  /** @internal */
18457
18459
  const dependencyPeerFloorProblems = (installed) => (found) => {
18458
18460
  const mismatches = mismatchOf(ownPeers(found));
18459
- 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))));
18461
+ 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))));
18460
18462
  };
18461
18463
  // src/features/check-published-manifest/model/package-homepage.ts
18462
- const RULE$13 = "package-homepage";
18464
+ const RULE$14 = "package-homepage";
18463
18465
  const BRANCH = "main";
18464
18466
  const ROOT_DIRECTORY$1 = ".";
18465
18467
  const START$8 = 0;
@@ -18490,9 +18492,9 @@ const messagesOf = (manifest, directory) => pipe(decodeRepository$1(manifest.rep
18490
18492
  }));
18491
18493
  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));
18492
18494
  /** @internal */
18493
- 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)));
18495
+ 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)));
18494
18496
  // src/features/check-published-manifest/model/package-scope.ts
18495
- const RULE$12 = "package-scope";
18497
+ const RULE$13 = "package-scope";
18496
18498
  const NAME_KEY = "\"name\"";
18497
18499
  const START$7 = 0;
18498
18500
  const unscopedName = (scope) => ({ manifest }) => pipe(Option.fromUndefinedOr(manifest.name), Option.filter((name) => !String$1.startsWith(scope)(name)));
@@ -18505,7 +18507,7 @@ const sharedScope = (names) => pipe(names, Array$1.flatMap((name) => Option.toAr
18505
18507
  }));
18506
18508
  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)}".`;
18507
18509
  /** @internal */
18508
- 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);
18510
+ 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);
18509
18511
  // src/features/check-published-manifest/model/published-manifests.ts
18510
18512
  const privateNamesIn = Effect.fn("privateNamesIn")(function* privateNamesIn(root) {
18511
18513
  const manifests = yield* manifestTexts(root);
@@ -18538,7 +18540,7 @@ const checkPublishedManifests = Effect.fn("checkPublishedManifests")(function* c
18538
18540
  ]);
18539
18541
  });
18540
18542
  // src/features/check-runtime-version/model/node-version.ts
18541
- const RULE$11 = "node-version";
18543
+ const RULE$12 = "node-version";
18542
18544
  const MINIMUM = 26;
18543
18545
  const SUPPORTED = `Node.js ${String(MINIMUM)} or later is the only supported runtime.`;
18544
18546
  const MANIFEST$1 = /(?:^|\/)package\.json$/u;
@@ -18562,7 +18564,7 @@ const floorIsOld = (alternative) => pipe(floorOf$1(alternative), Option.match({
18562
18564
  onSome: isOld
18563
18565
  }));
18564
18566
  const admitsOld = (range) => pipe(String$1.split(range, ALTERNATIVE$1), Array$1.some(floorIsOld));
18565
- const problemAt = ({ entry, source, index }, message) => problemAtIndex(RULE$11)(entry.file, source)(index, message);
18567
+ const problemAt = ({ entry, source, index }, message) => problemAtIndex(RULE$12)(entry.file, source)(index, message);
18566
18568
  const offsetOf = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$6));
18567
18569
  const unstatedProblem = (entry, source) => problemAt({
18568
18570
  entry,
@@ -18613,7 +18615,7 @@ const checkNodeVersion = Effect.fn("checkNodeVersion")(function* checkNodeVersio
18613
18615
  return yield* scanText(sources, problemsIn$3);
18614
18616
  });
18615
18617
  // src/features/check-workspace-descriptions/model/workspace-descriptions.ts
18616
- const RULE$10 = "workspace-description";
18618
+ const RULE$11 = "workspace-description";
18617
18619
  const FIRST$5 = 1;
18618
18620
  /** @internal */
18619
18621
  const checkWorkspaceDescriptions = Effect.fn("checkWorkspaceDescriptions")(function* checkWorkspaceDescriptions(root) {
@@ -18623,12 +18625,12 @@ const checkWorkspaceDescriptions = Effect.fn("checkWorkspaceDescriptions")(funct
18623
18625
  file: files.join(root, directory, PACKAGE_JSON_FILE),
18624
18626
  line: FIRST$5,
18625
18627
  column: FIRST$5,
18626
- rule: RULE$10,
18628
+ rule: RULE$11,
18627
18629
  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."
18628
18630
  })));
18629
18631
  });
18630
18632
  // src/features/check-plugin-layout/model/plugin-layout.ts
18631
- const RULE$9 = "plugin-layout";
18633
+ const RULE$10 = "plugin-layout";
18632
18634
  const PLUGIN_FILE$2 = ".claude-plugin/plugin.json";
18633
18635
  const MARKETPLACE_FILE$1 = ".claude-plugin/marketplace.json";
18634
18636
  const SKILL_FILE$1 = "SKILL.md";
@@ -18639,7 +18641,7 @@ const LONGEST_PATH = 472;
18639
18641
  const MOST_DEPTH = 12;
18640
18642
  const LONGEST_PART = 255;
18641
18643
  const LONGEST_DESCRIPTION = 500;
18642
- const CONCURRENCY$4 = 16;
18644
+ const CONCURRENCY$5 = 16;
18643
18645
  const PLUGIN_NAME = /^[\p{Ll}\p{Nd}-]{1,64}$/u;
18644
18646
  const ALLOWED_PATH = /^[A-Za-z0-9 _.\-/(),]+$/u;
18645
18647
  const XML_TAG = /<[A-Za-z][^>]*>/u;
@@ -18650,7 +18652,7 @@ const SkillFields$1 = Schema.Struct({
18650
18652
  description: Schema.optionalKey(Schema.String)
18651
18653
  });
18652
18654
  const decodeSkillFields = Schema.decodeUnknownOption(SkillFields$1);
18653
- const problem$4 = problemInFile(RULE$9);
18655
+ const problem$5 = problemInFile(RULE$10);
18654
18656
  const violation = (path, message) => ({
18655
18657
  path,
18656
18658
  message
@@ -18714,7 +18716,7 @@ const skillViolations = (skills) => {
18714
18716
  const skillFilesOf = (plugin) => pipe(plugin.files, Array$1.filter((file) => file === SKILL_FILE$1 || String$1.endsWith(`${SEPARATOR$6}${SKILL_FILE$1}`)(file)));
18715
18717
  const violationsOf = Effect.fn("violationsOf")(function* violationsOf(root, plugin, links) {
18716
18718
  const prefix = `${(yield* RepositoryFiles).relative(root, plugin.directory)}${SEPARATOR$6}`;
18717
- const skills = yield* Effect.forEach(skillFilesOf(plugin), (file) => skillTextOf(plugin, file), { concurrency: CONCURRENCY$4 });
18719
+ const skills = yield* Effect.forEach(skillFilesOf(plugin), (file) => skillTextOf(plugin, file), { concurrency: CONCURRENCY$5 });
18718
18720
  return [
18719
18721
  ...manifestViolations(plugin),
18720
18722
  ...nestedManifests(plugin),
@@ -18730,7 +18732,7 @@ const rootProblems = Effect.fn("rootProblems")(function* rootProblems(root) {
18730
18732
  const marketplace = yield* files.exists(files.join(root, MARKETPLACE_FILE$1));
18731
18733
  const manifest = files.join(root, PLUGIN_FILE$2);
18732
18734
  const isPlugin = yield* files.exists(manifest);
18733
- return pipe(Option.liftPredicate(problem$4(manifest, "makes the marketplace root a plugin. The marketplace is not itself a plugin."), () => marketplace && isPlugin), Option.toArray);
18735
+ return pipe(Option.liftPredicate(problem$5(manifest, "makes the marketplace root a plugin. The marketplace is not itself a plugin."), () => marketplace && isPlugin), Option.toArray);
18734
18736
  });
18735
18737
  /** @internal */
18736
18738
  const checkPluginLayout = Effect.fn("checkPluginLayout")(function* checkPluginLayout(root) {
@@ -18738,12 +18740,12 @@ const checkPluginLayout = Effect.fn("checkPluginLayout")(function* checkPluginLa
18738
18740
  const plugins = yield* pluginsIn$1(root);
18739
18741
  const linked = yield* files.linkedFiles(root);
18740
18742
  const links = new Set(linked);
18741
- 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 });
18743
+ 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 });
18742
18744
  const marketplace = yield* rootProblems(root);
18743
18745
  return [...Array$1.flatten(found), ...marketplace];
18744
18746
  });
18745
18747
  // src/features/check-plugin-marketplace/model/plugin-marketplace.ts
18746
- const RULE$8 = "plugin-marketplace";
18748
+ const RULE$9 = "plugin-marketplace";
18747
18749
  const PLUGIN_DIRECTORY = ".claude-plugin";
18748
18750
  const PLUGIN_FILE$1 = `${PLUGIN_DIRECTORY}/plugin.json`;
18749
18751
  const MARKETPLACE_FILE = `${PLUGIN_DIRECTORY}/marketplace.json`;
@@ -18799,7 +18801,7 @@ const pluginIn = Effect.fn("pluginIn")(function* pluginIn(root, project) {
18799
18801
  description: Option.getOrElse(project.description, () => "")
18800
18802
  })));
18801
18803
  });
18802
- const problem$3 = problemInFile(RULE$8);
18804
+ const problem$4 = problemInFile(RULE$9);
18803
18805
  const pluginsIn = Effect.fn("pluginsIn")(function* pluginsIn(root) {
18804
18806
  const projects = yield* workspaceProjects(root);
18805
18807
  const found = yield* Effect.forEach(projects, (project) => pluginIn(root, project), { concurrency: "unbounded" });
@@ -18818,16 +18820,16 @@ const ownerIn = Effect.fn("ownerIn")(function* ownerIn(root) {
18818
18820
  ...described(description)
18819
18821
  })))));
18820
18822
  });
18821
- const rewrite = Effect.fn("rewrite")(function* rewrite(file, expected) {
18823
+ const rewrite$1 = Effect.fn("rewrite")(function* rewrite(file, expected) {
18822
18824
  const files = yield* RepositoryFiles;
18823
18825
  const written = yield* files.readFile(file);
18824
18826
  if (Option.exists(written, (text) => text === expected)) return [];
18825
18827
  yield* files.writeFile(file, expected);
18826
- return [problem$3(file, `${MARKETPLACE_FILE} is generated from the workspaces that have ${PLUGIN_FILE$1}. msch rewrote it; commit the result.`)];
18828
+ return [problem$4(file, `${MARKETPLACE_FILE} is generated from the workspaces that have ${PLUGIN_FILE$1}. msch rewrote it; commit the result.`)];
18827
18829
  });
18828
18830
  const withoutPlugins = Effect.fn("withoutPlugins")(function* withoutPlugins(file) {
18829
18831
  if (!(yield* (yield* RepositoryFiles).exists(file))) return [];
18830
- return [problem$3(file, `No workspace has ${PLUGIN_FILE$1}. Delete ${MARKETPLACE_FILE}.`)];
18832
+ return [problem$4(file, `No workspace has ${PLUGIN_FILE$1}. Delete ${MARKETPLACE_FILE}.`)];
18831
18833
  });
18832
18834
  /** @internal */
18833
18835
  const checkPluginMarketplace = Effect.fn("checkPluginMarketplace")(function* checkPluginMarketplace(root) {
@@ -18836,15 +18838,15 @@ const checkPluginMarketplace = Effect.fn("checkPluginMarketplace")(function* che
18836
18838
  const plugins = yield* pluginsIn(root);
18837
18839
  if (!Array$1.isReadonlyArrayNonEmpty(plugins)) return yield* withoutPlugins(file);
18838
18840
  const header = yield* ownerIn(root);
18839
- 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.`)];
18841
+ 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.`)];
18840
18842
  const text = yield* encodeMarketplace({
18841
18843
  ...header.value,
18842
18844
  plugins
18843
18845
  });
18844
- return yield* rewrite(file, `${text}\n`);
18846
+ return yield* rewrite$1(file, `${text}\n`);
18845
18847
  });
18846
18848
  // src/features/check-readme-skills/model/readme-skills.ts
18847
- const RULE$7 = "readme-skills";
18849
+ const RULE$8 = "readme-skills";
18848
18850
  const README_FILE = "README.md";
18849
18851
  const FIRST_SENTENCE = /^[\s\S]*?(?:。|\.(?=\s|$))/u;
18850
18852
  const CALLED_SKILL$1 = /`(?<name>[a-z0-9-]+:[a-z0-9-]+)`/u;
@@ -18868,7 +18870,7 @@ const SkillFields = Schema.Struct({
18868
18870
  "disable-model-invocation": Schema.optionalKey(Schema.Boolean)
18869
18871
  });
18870
18872
  const decodeFields = Schema.decodeUnknownOption(SkillFields);
18871
- const problem$2 = problemInFile(RULE$7);
18873
+ const problem$3 = problemInFile(RULE$8);
18872
18874
  const cell = (text) => pipe(text, String$1.replaceAll("|", String.raw`\|`), String$1.replaceAll("\n", " "));
18873
18875
  const sceneOf = (description) => pipe(Option.fromNullishOr(FIRST_SENTENCE.exec(description)), Option.flatMap(Array$1.head), Option.getOrElse(() => description));
18874
18876
  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));
@@ -18918,7 +18920,7 @@ const syncReadme = Effect.fn("syncReadme")(function* syncReadme({ directory, ski
18918
18920
  });
18919
18921
  if (canonical(expected) === canonical(current)) return [];
18920
18922
  yield* files.writeFile(file, expected);
18921
- 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.`)];
18923
+ 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.`)];
18922
18924
  });
18923
18925
  const labelsOf = ({ published }) => pipe(Option.liftPredicate(ENGLISH_LABELS, () => published), Option.getOrElse(() => JAPANESE_LABELS));
18924
18926
  /** @internal */
@@ -19001,11 +19003,11 @@ const enumerationSignals = (entities) => (file, text) => {
19001
19003
  }));
19002
19004
  };
19003
19005
  // src/features/check-skill-enumerations/model/skill-enumerations.ts
19004
- const RULE$6 = "skill-enumeration";
19006
+ const RULE$7 = "skill-enumeration";
19005
19007
  const FIRST$3 = 1;
19006
- const CONCURRENCY$3 = 16;
19008
+ const CONCURRENCY$4 = 16;
19007
19009
  const DOCUMENT_FILE = /\.(?:md|ts|tsx)$/u;
19008
- const position = problemAtPosition(RULE$6);
19010
+ const position = problemAtPosition(RULE$7);
19009
19011
  const problemsIn$2 = Effect.fn("problemsIn")(function* problemsIn(root, name, entities) {
19010
19012
  const files = yield* RepositoryFiles;
19011
19013
  const file = files.join(root, name);
@@ -19023,21 +19025,21 @@ const checkSkillEnumerations = Effect.fn("checkSkillEnumerations")(function* che
19023
19025
  if (!Array$1.isReadonlyArrayNonEmpty(entities)) return [];
19024
19026
  const listed = yield* files.listedFiles(root);
19025
19027
  const documents = pipe(listed, Array$1.filter((name) => DOCUMENT_FILE.test(name)));
19026
- const found = yield* Effect.forEach(documents, (name) => problemsIn$2(root, name, entities), { concurrency: CONCURRENCY$3 });
19028
+ const found = yield* Effect.forEach(documents, (name) => problemsIn$2(root, name, entities), { concurrency: CONCURRENCY$4 });
19027
19029
  return Array$1.flatten(found);
19028
19030
  });
19029
19031
  // src/features/check-skill-references/model/skill-references.ts
19030
- const RULE$5 = "skill-reference";
19032
+ const RULE$6 = "skill-reference";
19031
19033
  const OWNER_PREFIX = "do-";
19032
19034
  const MARKDOWN$2 = ".md";
19033
- const CONCURRENCY$2 = 16;
19035
+ const CONCURRENCY$3 = 16;
19034
19036
  const MOST_OWNER_LINES = 4;
19035
19037
  const NAMED_IN_BACKTICKS = /`(?<name>[a-z0-9]+(?:-[a-z0-9]+)*)`(?!\]\()/gu;
19036
19038
  const CALLED_SKILL = /`(?<name>[a-z0-9-]+:[a-z0-9-]+)`/gu;
19037
19039
  const LIST_ITEM = /^\s*(?:[-*]|\d+\.)\s/u;
19038
19040
  const TOOL_NAME = /ツール|\bgh\b|\bgit\b|\bcurl\b|\bclaude\b|\bvp\b|\bbun\b/u;
19039
19041
  const QUALIFIER = ":";
19040
- const problem$1 = problemInFile(RULE$5);
19042
+ const problem$2 = problemInFile(RULE$6);
19041
19043
  const groupsOf = (pattern, text) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(text)), Array$1.flatMap((found) => Option.toArray(groupOf("name")(found))));
19042
19044
  const isOwnerEntry = ({ name }) => String$1.startsWith(OWNER_PREFIX)(name);
19043
19045
  const isOwnerOnly = ({ frontmatter }) => frontmatter.fields["disable-model-invocation"] === true;
@@ -19059,24 +19061,24 @@ const ownerOnlyMessages = (skill, qualified) => pipe(Option.liftPredicate(skill,
19059
19061
  toolMessage(owner),
19060
19062
  calledMessage(owner, qualified)
19061
19063
  ]));
19062
- const ownerProblems = (skill, qualified) => pipe([prefixMessage(skill), ...ownerOnlyMessages(skill, qualified)], Array$1.getSomes, Array$1.map((message) => problem$1(skill.file, message)));
19063
- 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.`)));
19064
+ const ownerProblems = (skill, qualified) => pipe([prefixMessage(skill), ...ownerOnlyMessages(skill, qualified)], Array$1.getSomes, Array$1.map((message) => problem$2(skill.file, message)));
19065
+ 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.`)));
19064
19066
  const documentProblems = Effect.fn("documentProblems")(function* documentProblems({ file, hub }, skill, others) {
19065
19067
  const text = yield* (yield* RepositoryFiles).readFile(file);
19066
19068
  const body = String$1.replace(FRONTMATTER, "")(Option.getOrElse(text, () => ""));
19067
- 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.`)));
19069
+ 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.`)));
19068
19070
  });
19069
19071
  const spokeProblems = Effect.fn("spokeProblems")(function* spokeProblems(hub, skill, others) {
19070
19072
  const documents = pipe(skill.files, Array$1.filter(String$1.endsWith(MARKDOWN$2)));
19071
19073
  const found = yield* Effect.forEach(documents, (file) => documentProblems({
19072
19074
  file,
19073
19075
  hub
19074
- }, skill, others), { concurrency: CONCURRENCY$2 });
19076
+ }, skill, others), { concurrency: CONCURRENCY$3 });
19075
19077
  return Array$1.flatten(found);
19076
19078
  });
19077
19079
  const referencesFrom = Effect.fn("referencesFrom")(function* referencesFrom(hub, skills) {
19078
19080
  const others = pipe(skills, Array$1.filter((skill) => skill.name !== hub.name && !isOwnerEntry(skill)));
19079
- const spokes = yield* Effect.forEach(others, (skill) => spokeProblems(hub, skill, others), { concurrency: CONCURRENCY$2 });
19081
+ const spokes = yield* Effect.forEach(others, (skill) => spokeProblems(hub, skill, others), { concurrency: CONCURRENCY$3 });
19080
19082
  const names = new Set(pipe(skills, Array$1.map(({ name }) => name)));
19081
19083
  return [...hubProblems(hub, names), ...Array$1.flatten(spokes)];
19082
19084
  });
@@ -19094,8 +19096,8 @@ const checkSkillReferences = Effect.fn("checkSkillReferences")(function* checkSk
19094
19096
  return [...owners, ...hubbed];
19095
19097
  });
19096
19098
  // src/features/check-skill-structure/model/skill-structure.ts
19097
- const RULE$4 = "skill-maintainer-context";
19098
- const CONCURRENCY$1 = 16;
19099
+ const RULE$5 = "skill-maintainer-context";
19100
+ const CONCURRENCY$2 = 16;
19099
19101
  const MARKDOWN$1 = ".md";
19100
19102
  const PROJECT_FILE = /(?:^|\/)(?:package\.json|tsconfig[^/]*\.json|vite\.config\.[cm]?[jt]s|vitest\.config\.[cm]?[jt]s)$|\.[jt]sx$/u;
19101
19103
  const SCRIPT_FILE = /\.[cm]?[jt]s$/u;
@@ -19104,7 +19106,7 @@ const BINARY_FILE = /\.(?:png|jpe?g|gif|webp|pdf|woff2?)$/u;
19104
19106
  const WRITE_CALL = /\b(?:writeFileSync|cpSync|renameSync|appendFileSync|copyFileSync)\(/u;
19105
19107
  const MAINTAINER_HEADING = /^#{1,6}\s.*(?:メンテナンス|保守|更新手順|再生成|撮り直|maintenance|maintainer|regenerat)/imu;
19106
19108
  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.";
19107
- const problem = problemInFile(RULE$4);
19109
+ const problem$1 = problemInFile(RULE$5);
19108
19110
  const signalsOf = (file, text) => [
19109
19111
  ...pipe(Option.liftPredicate("a build project file (package.json, tsconfig, vite config or a .tsx source)", () => PROJECT_FILE.test(file)), Option.toArray),
19110
19112
  ...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),
@@ -19114,18 +19116,69 @@ const problemsIn$1 = Effect.fn("problemsIn")(function* problemsIn(file) {
19114
19116
  const files = yield* RepositoryFiles;
19115
19117
  const text = yield* files.readFile(file);
19116
19118
  const source = pipe(text, Option.filter(() => !BINARY_FILE.test(file)));
19117
- return pipe(signalsOf(files.basename(file), Option.getOrElse(source, () => "")), Array$1.map((signal) => problem(file, `is ${signal}. ${REASON$2}`)));
19119
+ return pipe(signalsOf(files.basename(file), Option.getOrElse(source, () => "")), Array$1.map((signal) => problem$1(file, `is ${signal}. ${REASON$2}`)));
19118
19120
  });
19119
19121
  /** @internal */
19120
19122
  const checkSkillStructure = Effect.fn("checkSkillStructure")(function* checkSkillStructure(root) {
19121
19123
  const plugins = yield* pluginsIn$1(root);
19122
19124
  const inside = pipe(plugins, Array$1.flatMap(({ skills }) => skills), Array$1.flatMap(({ files }) => files));
19123
- const found = yield* Effect.forEach(inside, problemsIn$1, { concurrency: CONCURRENCY$1 });
19125
+ const found = yield* Effect.forEach(inside, problemsIn$1, { concurrency: CONCURRENCY$2 });
19126
+ return Array$1.flatten(found);
19127
+ });
19128
+ // src/features/write-plugin-definition/model/plugin-definition.ts
19129
+ const RULE$4 = "plugin-definition";
19130
+ const DEFINITION = "plugin.ts";
19131
+ const CONCURRENCY$1 = 4;
19132
+ const problem = problemInFile(RULE$4);
19133
+ const reasonOf$2 = (failure) => {
19134
+ if (failure instanceof Error) return failure.message;
19135
+ return String(failure);
19136
+ };
19137
+ const load = (file) => Effect.tryPromise({
19138
+ try: () => import(pathToFileURL(file).href),
19139
+ catch: reasonOf$2
19140
+ });
19141
+ const rewrite = Effect.fn("rewrite")(function* rewrite(directory, { path, text }) {
19142
+ const files = yield* RepositoryFiles;
19143
+ const file = files.join(directory, path);
19144
+ const written = yield* files.readFile(file);
19145
+ if (Option.exists(written, (found) => found === text)) return Option.none();
19146
+ yield* files.writeFile(file, text);
19147
+ return Option.some(problem(file, `${path} is generated from ${DEFINITION}. msch rewrote it; commit the result.`));
19148
+ });
19149
+ const pluginName = (packageName) => pipe(packageName, String$1.replace(/^@[^/]+\//u, ""));
19150
+ const filesOf = (project, definition) => Effect.gen(function* generate() {
19151
+ const name = yield* Effect.fromOption(project.packageName).pipe(Effect.mapError(() => `${project.directory}/package.json has no name for plugin.json.`));
19152
+ const loaded = yield* load(definition);
19153
+ return yield* moduleFiles(loaded, {
19154
+ name: pluginName(name),
19155
+ ...Option.match(project.description, {
19156
+ onNone: () => ({}),
19157
+ onSome: (description) => ({ description })
19158
+ })
19159
+ }).pipe(Effect.mapError(reasonOf$2));
19160
+ });
19161
+ const writeOne = Effect.fn("writeOne")(function* writeOne(root, project) {
19162
+ const files = yield* RepositoryFiles;
19163
+ const directory = files.join(root, project.directory);
19164
+ const definition = files.join(directory, DEFINITION);
19165
+ if (!(yield* files.exists(definition))) return [];
19166
+ const generated = yield* Effect.result(filesOf(project, definition));
19167
+ return yield* Result.match(generated, {
19168
+ onFailure: (reason) => Effect.succeed([problem(definition, `msch could not load the plugin definition: ${reason}`)]),
19169
+ onSuccess: (written) => Effect.forEach(written, (file) => rewrite(directory, file), { concurrency: 1 }).pipe(Effect.map(Array$1.getSomes))
19170
+ });
19171
+ });
19172
+ /** @internal */
19173
+ const writePluginDefinitions = Effect.fn("writePluginDefinitions")(function* writePluginDefinitions(root) {
19174
+ const projects = yield* workspaceProjects(root);
19175
+ const found = yield* Effect.forEach(projects, (project) => writeOne(root, project), { concurrency: CONCURRENCY$1 });
19124
19176
  return Array$1.flatten(found);
19125
19177
  });
19126
19178
  // src/app/plugin-checks.ts
19127
19179
  /** @internal */
19128
19180
  const checkPlugins = Effect.fn("checkPlugins")(function* checkPlugins(root) {
19181
+ const generated = yield* writePluginDefinitions(root);
19129
19182
  const found = yield* Effect.all([
19130
19183
  checkPluginMarketplace(root),
19131
19184
  checkPluginLayout(root),
@@ -19134,7 +19187,7 @@ const checkPlugins = Effect.fn("checkPlugins")(function* checkPlugins(root) {
19134
19187
  checkSkillReferences(root),
19135
19188
  checkSkillEnumerations(root)
19136
19189
  ], { concurrency: "unbounded" });
19137
- return Array$1.flatten(found);
19190
+ return [...generated, ...Array$1.flatten(found)];
19138
19191
  });
19139
19192
  // src/features/check-upstream-exits/model/deviation-entries.ts
19140
19193
  const WORKSPACE_SECTIONS = [
@@ -20499,54 +20552,6 @@ const checkWithAgents = Effect.fn("checkWithAgents")(function* checkWithAgents(r
20499
20552
  const found = yield* Effect.forEach(checks, runAgentCheck(setup), { concurrency: SEQUENTIAL$1 });
20500
20553
  return pipe(found, Array$1.flatten);
20501
20554
  });
20502
- // src/shared/lib/agent-query.ts
20503
- const SDK = "@anthropic-ai/claude-agent-sdk";
20504
- const ResultMessage = Schema.Struct({
20505
- type: Schema.Literal("result"),
20506
- subtype: Schema.String,
20507
- is_error: Schema.Boolean,
20508
- structured_output: Schema.optional(Schema.Unknown)
20509
- });
20510
- const isResult = Schema.is(ResultMessage);
20511
- const reasonOf$2 = (failure) => {
20512
- if (failure instanceof Error) return failure.message;
20513
- return String(failure);
20514
- };
20515
- const loadSdk = Effect.tryPromise({
20516
- try: () => import("@anthropic-ai/claude-agent-sdk"),
20517
- catch: () => `${SDK} is not installed. Add it to the devDependencies of the repository root to run agents.`
20518
- });
20519
- const answerOf = (message) => {
20520
- if (message.is_error || message.subtype !== "success") return Effect.fail(`the agent ended with ${message.subtype}`);
20521
- return Effect.fromOption(Option.fromUndefinedOr(message.structured_output)).pipe(Effect.mapError(() => "the agent returned no structured output"));
20522
- };
20523
- const lastResult = (messages) => pipe(Stream.fromAsyncIterable(messages, reasonOf$2), Stream.filter(isResult), Stream.runLast);
20524
- /** @internal */
20525
- const sdkAgentQuery = Effect.fn("sdkAgentQuery")(function* querying(request) {
20526
- const messages = (yield* loadSdk).query({
20527
- prompt: request.prompt,
20528
- options: {
20529
- cwd: request.directory,
20530
- model: request.model,
20531
- effort: request.effort,
20532
- tools: [...request.tools],
20533
- allowedTools: [...request.allowed],
20534
- permissionMode: "dontAsk",
20535
- settingSources: [],
20536
- mcpServers: {},
20537
- strictMcpConfig: true,
20538
- persistSession: false,
20539
- maxTurns: request.maxTurns,
20540
- outputFormat: {
20541
- type: "json_schema",
20542
- schema: { ...request.schema }
20543
- }
20544
- }
20545
- });
20546
- const result = yield* lastResult(messages);
20547
- const message = yield* Effect.fromOption(result).pipe(Effect.mapError(() => "the agent ended without a result"));
20548
- return yield* answerOf(message);
20549
- });
20550
20555
  // src/app/agents-command.ts
20551
20556
  const agents = Effect.fn("agents")(function* investigating(input) {
20552
20557
  const root = (yield* RepositoryFiles).resolve(".");