@r_masseater/msch 0.115.0 → 0.115.2

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
@@ -44,7 +44,7 @@ import { Base64 } from "effect/encoding";
44
44
  import { CALLS_METRIC, mergeTallies, talliesIn, usageMetricsOf } from "@r_masseater/masseater-utils/usage-meter/report";
45
45
  // package.json
46
46
  var name = "@r_masseater/msch";
47
- var version = "0.115.0";
47
+ var version = "0.115.2";
48
48
  var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
49
49
  var repository = {
50
50
  "type": "git",
@@ -12787,7 +12787,7 @@ const LAYER_ITEMS = [
12787
12787
  ];
12788
12788
  const READ_CONCURRENCY$31 = 64;
12789
12789
  const EXCLUDED$6 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
12790
- const NONE$5 = [];
12790
+ const NONE$4 = [];
12791
12791
  const ROOT_MESSAGE = "defines code in the crate root. Keep lib.rs and main.rs to mod declarations of layers, use, pub use and fn main, and put the code in a layer.";
12792
12792
  const LAYER_INDEX_MESSAGE = "defines code in a layer module. A layer module holds only mod declarations of its slices and use; put the code in a slice.";
12793
12793
  const ENTRY_MESSAGE = "makes an inner module of a slice public. Declare it with plain mod and re-export what other slices use with pub use from the slice module.";
@@ -12802,12 +12802,12 @@ const isRootItem = (inner) => (item) => {
12802
12802
  };
12803
12803
  const isLayerItem = (item) => Array$1.contains(LAYER_ITEMS, item.kind) || item.kind === "mod_item" && !item.inline;
12804
12804
  const entryProblems$2 = (file, modulePath, parsed) => {
12805
- if (!isSliceIndex(modulePath)) return NONE$5;
12805
+ if (!isSliceIndex(modulePath)) return NONE$4;
12806
12806
  return pipe(parsed.items, Array$1.filter((item) => item.kind === "mod_item" && item.visible), Array$1.map(itemProblem(file, ENTRY_RULE$1, ENTRY_MESSAGE)));
12807
12807
  };
12808
12808
  const moduleProblems = ({ source, parsed }) => entryProblems$2(source.file, modulePathOf(source.inner), parsed);
12809
12809
  const testProblems = ({ source, parsed }) => {
12810
- if (parsed.replacesAllocator) return NONE$5;
12810
+ if (parsed.replacesAllocator) return NONE$4;
12811
12811
  return [fileProblem$1({
12812
12812
  file: source.file,
12813
12813
  rule: TEST_RULE,
@@ -12820,8 +12820,8 @@ const PROBLEMS = {
12820
12820
  layer: (read) => strayItems(read, isLayerItem, LAYER_INDEX_MESSAGE),
12821
12821
  test: testProblems,
12822
12822
  module: moduleProblems,
12823
- skipped: () => NONE$5,
12824
- misplaced: () => NONE$5
12823
+ skipped: () => NONE$4,
12824
+ misplaced: () => NONE$4
12825
12825
  };
12826
12826
  const problemsOf$4 = (read) => PROBLEMS[kindOf$1(read.source.inner)](read);
12827
12827
  const misnamedSlice = ({ crate, inner }, root, join) => {
@@ -12858,7 +12858,7 @@ const rustSources = Effect.fn("rustSources")(function* rustSources(root) {
12858
12858
  const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModules(root) {
12859
12859
  const files = yield* RepositoryFiles;
12860
12860
  const sources = yield* rustSources(root);
12861
- if (!Array$1.isReadonlyArrayNonEmpty(sources)) return NONE$5;
12861
+ if (!Array$1.isReadonlyArrayNonEmpty(sources)) return NONE$4;
12862
12862
  const language = yield* loadLanguage(GRAMMAR$1).pipe(Effect.orDie);
12863
12863
  const parse = parsedWith(language);
12864
12864
  const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$31 });
@@ -16657,7 +16657,7 @@ const COMMENT_NODES = [
16657
16657
  ];
16658
16658
  const START$19 = 0;
16659
16659
  const NEXT = 1;
16660
- const NONE$4 = [];
16660
+ const NONE$3 = [];
16661
16661
  const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
16662
16662
  onFailure: ({ message }) => unreadable(grammar)(message),
16663
16663
  onSuccess: (language) => [grammar, language]
@@ -16675,7 +16675,7 @@ const commentNodesIn = (language, source) => pipe(readTree({
16675
16675
  index: node.startIndex,
16676
16676
  text: node.text
16677
16677
  })))
16678
- }), Option.getOrElse(() => NONE$4));
16678
+ }), Option.getOrElse(() => NONE$3));
16679
16679
  const syntaxComments = (grammars, grammar) => (source) => Option.match(grammars(grammar), {
16680
16680
  onNone: () => Effect.fail(unreadable(grammar)("the grammar is not loaded")),
16681
16681
  onSome: (language) => commentsFrom(grammar)((text) => commentNodesIn(language, text))(source)
@@ -16698,7 +16698,7 @@ const shifted = (offset) => ({ index, text }) => ({
16698
16698
  text
16699
16699
  });
16700
16700
  const markupComment = (source) => (node) => {
16701
- if (!isComment(node) || node.startIndex === null || node.endIndex === null) return NONE$4;
16701
+ if (!isComment(node) || node.startIndex === null || node.endIndex === null) return NONE$3;
16702
16702
  return [{
16703
16703
  index: node.startIndex,
16704
16704
  text: String$1.slice(node.startIndex, node.endIndex + NEXT)(source)
@@ -16709,10 +16709,10 @@ const textComments = (grammars, grammar) => (text) => {
16709
16709
  return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array$1.map(shift)));
16710
16710
  };
16711
16711
  const embeddedComments = (grammars) => (node) => {
16712
- if (!isTag(node)) return Effect.succeed(NONE$4);
16712
+ if (!isTag(node)) return Effect.succeed(NONE$3);
16713
16713
  const texts = pipe(node.children, Array$1.filter(isText));
16714
16714
  return Option.match(embeddedGrammar(node), {
16715
- onNone: () => Effect.succeed(NONE$4),
16715
+ onNone: () => Effect.succeed(NONE$3),
16716
16716
  onSome: (grammar) => pipe(texts, (items) => Effect.forEach(items, textComments(grammars, grammar), { concurrency: 1 }), Effect.map(Array$1.flatten))
16717
16717
  });
16718
16718
  };
@@ -17877,10 +17877,9 @@ const MARKER = /\(owner, \d{4}-\d{2}-\d{2}\)/gu;
17877
17877
  const TRAILER = /^Owner-Decision-(?:Moved|Revoked):[ \t]*\S/mu;
17878
17878
  const READ_CONCURRENCY$10 = 16;
17879
17879
  const HEAD = "HEAD";
17880
- const NONE$3 = 0;
17881
17880
  const markersOf = (text) => pipe(String$1.matchAll(MARKER)(text), Array$1.fromIterable, Array$1.flatMap((hit) => Option.toArray(Array$1.head(hit))));
17882
17881
  const countOf = (markers) => (marker) => pipe(markers, Array$1.filter((candidate) => candidate === marker)).length;
17883
- const lostMarkers = (before, after) => pipe(Array$1.dedupe(before), Array$1.flatMap((marker) => Array$1.replicate(marker, Math.max(NONE$3, countOf(before)(marker) - countOf(after)(marker)))));
17882
+ const lostMarkers = (before, after) => pipe(Array$1.dedupe(before), Array$1.flatMap((marker) => pipe(before, Array$1.filter((candidate) => candidate === marker), Array$1.take(countOf(before)(marker) - countOf(after)(marker)))));
17884
17883
  const removalOf = (file, lost) => pipe(Option.liftPredicate(lost, Array$1.isReadonlyArrayNonEmpty), Option.map((markers) => ({
17885
17884
  file,
17886
17885
  markers
@@ -18821,7 +18820,7 @@ const TEST_FILE = /\.(?:test|spec)\.[cm]?[jt]sx?$/u;
18821
18820
  const BINARY_FILE = /\.(?:png|jpe?g|gif|webp|pdf|woff2?)$/u;
18822
18821
  const WRITE_CALL = /\b(?:writeFileSync|cpSync|renameSync|appendFileSync|copyFileSync)\(/u;
18823
18822
  const MAINTAINER_HEADING = /^#{1,6}\s.*(?:メンテナンス|保守|更新手順|再生成|撮り直|maintenance|maintainer|regenerat)/imu;
18824
- const REASON$2 = "A distributed skill holds only what the model needs while using it. Move this to maintenance/ (maintenance/<skill>.md, maintenance/bin/, maintenance/<skill>/) so loading the skill does not carry maintainer context.";
18823
+ 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.";
18825
18824
  const problem = problemInFile(RULE$4);
18826
18825
  const signalsOf = (file, text) => [
18827
18826
  ...pipe(Option.liftPredicate("a build project file (package.json, tsconfig, vite config or a .tsx source)", () => PROJECT_FILE.test(file)), Option.toArray),