@r_masseater/msch 0.127.0 → 0.128.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
@@ -11,10 +11,10 @@ import { i as workspaceDependencies$1, n as installedManifest, r as readManifest
11
11
  import { C as childrenOf$4, D as propertyValue, E as nestedValues, O as stringsIn, S as KeySchema, T as literalOf, a as workspaceManifest, c as TASK_NAMES, d as definesTask, f as hasCargoTask, i as workspaceProjects, l as TEST_TASK_NAMES, n as unmatchedWorkspacePatterns, p as hasVerifyTask, r as workspaceDirectories, s as RUN_TASKS, t as publishedProjects, u as VERIFY_TASK, w as keyName, x as workspaceConfigOf } from "./workspace-projects-eapoa0az.mjs";
12
12
  import { a as parent, i as join, n as isInside, t as baseName$1 } from "./path-BhBnc3Sn.mjs";
13
13
  import { decodePackageJson, decodeVersionedPackageJson, readPackageJson, readRawPackageJson, readVersionedPackageJson, updatePackageJson, writePackageJson } from "@r_masseater/masseater-utils/kestrion/npm";
14
- import { a as workspaceConfigs, c as publicEntriesOf, d as FRONTMATTER, f as splitFrontmatter, g as deployEntries, h as bundledEntries$1, i as publishedWorkspaces, l as modDirectories, m as workspaceLinks, o as entryNameOf, r as packedWorkspaces, s as isBinEntry, u as isIndexSkill, v as shadcnUiOf } from "./published-DkH6B-Gr.mjs";
14
+ import { a as workspaceConfigs, c as publicEntriesOf, d as FRONTMATTER, f as splitFrontmatter, g as deployEntries, h as bundledEntries$1, i as publishedWorkspaces, l as modDirectories, m as workspaceLinks, o as entryNameOf, r as packedWorkspaces, s as isBinEntry, u as INDEX_SKILL, v as shadcnUiOf } from "./published-BbAu-6IS.mjs";
15
15
  import { parse, resolveConfigFromFile } from "vite-plus";
16
16
  import { i as USAGE_SPOOL, n as DECISION_TIMEOUT_MS, r as JAPANESE, t as DECISION_MODEL } from "./config-B3SYjao5.mjs";
17
- import { _ as namedWorkspaces, a as TEXT_IGNORES, c as CI_TASKS, d as MSCH_VERIFY_COMMANDS, f as meteredCommand, g as isIgnored, h as existsAt, l as GIT_HOOKS, m as fu4Of, n as FORMAT, o as builtTextRuleNames, r as STAGED$1, s as secretsOf, t as COMMIT_LINT, u as MSCH_TASK_COMMANDS, v as patternOf$1 } from "./repository-config-8JN86BZA.mjs";
17
+ import { _ as isIgnored, a as TEXT_IGNORES, c as CI_TASKS, d as MSCH_VERIFY_COMMANDS, f as meteredCommand, g as existsAt, h as fu4Of, l as GIT_HOOKS, n as FORMAT, o as builtTextRuleNames, p as MDLCT_BIN, r as STAGED$1, s as secretsOf, t as COMMIT_LINT, u as MSCH_TASK_COMMANDS, v as namedWorkspaces, y as patternOf$1 } from "./repository-config-DGEG2Ew6.mjs";
18
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";
@@ -49,7 +49,7 @@ import { Buffer } from "node:buffer";
49
49
  import { createZstdDecompress } from "node:zlib";
50
50
  // package.json
51
51
  var name = "@r_masseater/msch";
52
- var version = "0.127.0";
52
+ var version = "0.128.0";
53
53
  var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
54
54
  var repository = {
55
55
  "type": "git",
@@ -1268,11 +1268,11 @@ const scanPublishedManifests = Effect.fn("scanPublishedManifests")(function* sca
1268
1268
  // src/shared/config/self.ts
1269
1269
  const GIT_PREFIX = /^git\+/u;
1270
1270
  const GIT_SUFFIX = /\.git$/u;
1271
- const GITHUB$6 = "https://github.com/";
1271
+ const GITHUB$5 = "https://github.com/";
1272
1272
  const SELF_NAME = name;
1273
1273
  const SELF_HOMEPAGE = homepage;
1274
1274
  const SELF_DIRECTORY = repository.directory;
1275
- const RENOVATE_PRESET = `github>${pipe(repository.url, String$1.replace(GIT_PREFIX, ""), String$1.replace(GIT_SUFFIX, ""), String$1.replace(GITHUB$6, ""))}//${SELF_DIRECTORY}/renovate`;
1275
+ const RENOVATE_PRESET = `github>${pipe(repository.url, String$1.replace(GIT_PREFIX, ""), String$1.replace(GIT_SUFFIX, ""), String$1.replace(GITHUB$5, ""))}//${SELF_DIRECTORY}/renovate`;
1276
1276
  // src/features/check-overrides/model/removed-peers.ts
1277
1277
  const RULE$77 = "removed-peer";
1278
1278
  const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
@@ -16040,7 +16040,7 @@ const checkSources = (root) => checkRepository(root, [passThroughWrappersIn, nam
16040
16040
  const RULE$41 = "known-plugins";
16041
16041
  const SETTINGS_FILE$3 = ".claude/settings.json";
16042
16042
  const MARKETPLACE_FILE$2 = ".claude-plugin/marketplace.json";
16043
- const GITHUB$5 = "github";
16043
+ const GITHUB$4 = "github";
16044
16044
  const Source$1 = Schema.Struct({
16045
16045
  source: Schema.String,
16046
16046
  repo: Schema.optionalKey(Schema.String)
@@ -16059,7 +16059,7 @@ const MarketplaceSchema = Schema.Struct({
16059
16059
  });
16060
16060
  const decodeMarketplace = Schema.decodeUnknownOption(Schema.fromJsonString(MarketplaceSchema));
16061
16061
  const problem$6 = problemInFile(RULE$41);
16062
- const knownFrom = (repository, marketplace, settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(marketplace.name)), Option.exists(({ source }) => source.source === GITHUB$5 && source.repo === repository));
16062
+ const knownFrom = (repository, marketplace, settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(marketplace.name)), Option.exists(({ source }) => source.source === GITHUB$4 && source.repo === repository));
16063
16063
  const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
16064
16064
  const pluginProblems = (marketplace, file, settings) => {
16065
16065
  const enabled = pluginEnabled(settings);
@@ -16477,10 +16477,10 @@ const checkStructure = checkSection({
16477
16477
  const CONTINUATION = /\\\n/gu;
16478
16478
  const QUOTED = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
16479
16479
  const SEPARATOR$11 = /&&|\|\||[;|\n`]|\$\(/u;
16480
- const BLANK$1 = /\s+/u;
16480
+ const BLANK = /\s+/u;
16481
16481
  const ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/u;
16482
16482
  const QUOTE = "\"\"";
16483
- const wordsOf = (segment) => pipe(String$1.split(String$1.trim(segment), BLANK$1), Array$1.filter(String$1.isNonEmpty), Array$1.dropWhile((word) => ASSIGNMENT.test(word)));
16483
+ const wordsOf = (segment) => pipe(String$1.split(String$1.trim(segment), BLANK), Array$1.filter(String$1.isNonEmpty), Array$1.dropWhile((word) => ASSIGNMENT.test(word)));
16484
16484
  const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$11), Array$1.map(wordsOf), Array$1.filter(Array$1.isReadonlyArrayNonEmpty));
16485
16485
  // src/features/check-vite-plus/model/command-problems.ts
16486
16486
  const PACKAGE_MANAGERS = [
@@ -16495,7 +16495,7 @@ const PACKAGE_MANAGERS = [
16495
16495
  const VITE_PLUS$1 = "vp";
16496
16496
  const RUN = "run";
16497
16497
  const GIT = "git";
16498
- const GITHUB$4 = "gh";
16498
+ const GITHUB$3 = "gh";
16499
16499
  const MERGE = "merge";
16500
16500
  const SKIP_HOOKS = "--no-verify";
16501
16501
  const BYPASS_RULESET = "--admin";
@@ -16515,7 +16515,7 @@ const RULES = [
16515
16515
  },
16516
16516
  {
16517
16517
  rule: "skipped-gate",
16518
- applies: (_source, words) => programOf(words) === GIT && Array$1.contains(words, SKIP_HOOKS) || programOf(words) === GITHUB$4 && Array$1.contains(words, MERGE) && Array$1.contains(words, BYPASS_RULESET),
16518
+ applies: (_source, words) => programOf(words) === GIT && Array$1.contains(words, SKIP_HOOKS) || programOf(words) === GITHUB$3 && Array$1.contains(words, MERGE) && Array$1.contains(words, BYPASS_RULESET),
16519
16519
  message: (command) => `\`${command}\` skips a gate: ${SKIP_HOOKS} skips the hooks that run verify, and ${BYPASS_RULESET} bypasses the ruleset. Remove the flag and fix what the gate reports.`
16520
16520
  },
16521
16521
  {
@@ -17378,13 +17378,13 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
17378
17378
  // src/features/check-skills/model/published-skills.ts
17379
17379
  const RULE$29 = "published-skills";
17380
17380
  const KEYWORD = "tanstack-intent";
17381
- const SKILLS = "skills";
17381
+ const SKILLS$1 = "skills";
17382
17382
  const SKILL_FILE$3 = "SKILL.md";
17383
17383
  const SUCCEEDED = 0;
17384
17384
  const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
17385
17385
  const problemAt$2 = problemInFile(RULE$29);
17386
- 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))));
17387
- const isShipped = (listed) => (skill) => Array$1.contains(listed, SKILLS) || Array$1.contains(listed, skill);
17386
+ const skillDirectoriesIn = (files, directory) => pipe(findSkillFiles(files.join(directory, SKILLS$1)), Array$1.filter((file) => files.basename(file) === SKILL_FILE$3), Array$1.map((file) => files.relative(directory, files.dirname(file))));
17387
+ const isShipped = (listed) => (skill) => Array$1.contains(listed, SKILLS$1) || Array$1.contains(listed, skill);
17388
17388
  const packagingMessages = ({ keywords, files }, skills) => {
17389
17389
  const keyword = pipe(Option.liftPredicate(keywords, (own) => !Array$1.contains(own, KEYWORD)), Option.map(() => `is published with skills but lacks the ${KEYWORD} keyword, so Intent does not find them. Add it to keywords.`));
17390
17390
  const unshipped = pipe(files, Option.map((listed) => pipe(skills, Array$1.filter((skill) => !isShipped(listed)(skill)))), Option.filter((left) => Array$1.isReadonlyArrayNonEmpty(left)), Option.map((left) => `leaves ${Array$1.join(left, ", ")} out of files, so the published package does not ship them. List them in files.`));
@@ -17394,7 +17394,7 @@ const validationOf = Effect.fn("validationOf")(function* validationOf(directory)
17394
17394
  const handle = yield* ChildProcess.make("node", [
17395
17395
  INTENT_CLI,
17396
17396
  "validate",
17397
- SKILLS
17397
+ SKILLS$1
17398
17398
  ], {
17399
17399
  cwd: directory,
17400
17400
  extendEnv: true,
@@ -17408,9 +17408,9 @@ const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn(root, project
17408
17408
  const directory = files.join(root, project.directory);
17409
17409
  const manifest = files.join(directory, PACKAGE_JSON_FILE);
17410
17410
  const skills = skillDirectoriesIn(files, directory);
17411
- if (!Array$1.isReadonlyArrayNonEmpty(skills)) return [problemAt$2(manifest, `is published without agent skills. Write the tasks an agent needs for this package as ${SKILLS}/<task>/${SKILL_FILE$3}, so that repositories which approve them in the permissions of pnpm-workspace.yaml give their agents guidance for the installed version.`)];
17411
+ if (!Array$1.isReadonlyArrayNonEmpty(skills)) return [problemAt$2(manifest, `is published without agent skills. Write the tasks an agent needs for this package as ${SKILLS$1}/<task>/${SKILL_FILE$3}, so that repositories which approve them in the permissions of pnpm-workspace.yaml give their agents guidance for the installed version.`)];
17412
17412
  const validation = yield* validationOf(directory).pipe(Effect.orElseSucceed(() => Option.none()));
17413
- return [...pipe(packagingMessages(project, skills), Array$1.map((message) => problemAt$2(manifest, message))), ...pipe(validation, Option.map((output) => problemAt$2(files.join(directory, SKILLS), `fails intent validate:\n${output}`)), Option.toArray)];
17413
+ return [...pipe(packagingMessages(project, skills), Array$1.map((message) => problemAt$2(manifest, message))), ...pipe(validation, Option.map((output) => problemAt$2(files.join(directory, SKILLS$1), `fails intent validate:\n${output}`)), Option.toArray)];
17414
17414
  });
17415
17415
  /** @internal */
17416
17416
  const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPublishedSkills(root) {
@@ -17432,18 +17432,13 @@ const CODE = /```[\s\S]*?```|`[^`\n]*`/gu;
17432
17432
  const LINK = /\]\((?<target>[^)\s]+)\)/gu;
17433
17433
  const EXTERNAL = /^(?:[a-z][a-z0-9+.-]*:|#|\/)|[<>{}]/iu;
17434
17434
  const FRAGMENT = /#.*$/u;
17435
- const GITHUB$3 = "https://github.com/";
17436
- const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
17437
- const BLANK = /\s+/u;
17438
17435
  const SEPARATOR$10 = "/";
17439
17436
  const START$17 = 0;
17440
17437
  const FIRST$7 = 1;
17441
17438
  const READ_CONCURRENCY$14 = 16;
17442
- const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
17443
17439
  const Frontmatter = Schema.Struct({
17444
17440
  name: Schema.optional(Schema.String),
17445
- license: Schema.optional(Schema.Unknown),
17446
- metadata: Schema.optional(Metadata)
17441
+ license: Schema.optional(Schema.Unknown)
17447
17442
  });
17448
17443
  const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
17449
17444
  const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$17));
@@ -17462,18 +17457,10 @@ const nameProblems = ({ source, directory }, name, folder) => {
17462
17457
  message: `The first heading is ${headingText(found)}. Start the body with "# ${name}", the frontmatter name.`
17463
17458
  })), Option.toArray)];
17464
17459
  };
17465
- const derivedProblems = (source, derived) => pipe(String$1.split(String$1.trim(derived), BLANK), Array$1.filter((url) => String$1.startsWith(GITHUB$3)(url) && !COMMIT_LINK.test(url)), Array$1.map((url) => ({
17466
- index: offsetOf$1(source, url),
17467
- message: `metadata.derived-from holds ${url}, which does not name a commit, so what it shows changes. Write a permalink: ${GITHUB$3}<owner>/<repo>/blob/<commit>/<path>.`
17468
- })));
17469
- const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source), Option.map((frontmatter) => [
17470
- ...pipe(Option.fromUndefinedOr(frontmatter.name), Option.map((name) => nameProblems(skill, name, folder)), Option.getOrElse(() => [])),
17471
- ...pipe(Option.fromUndefinedOr(frontmatter.license), Option.map(() => ({
17472
- index: offsetOf$1(skill.source, LICENSE_KEY),
17473
- message: "The frontmatter has license. Skills here carry neither a license field nor a LICENSE file. Remove it."
17474
- })), Option.toArray),
17475
- ...pipe(Option.fromUndefinedOr(frontmatter.metadata), Option.flatMap((metadata) => Option.fromUndefinedOr(metadata["derived-from"])), Option.map((derived) => derivedProblems(skill.source, derived)), Option.getOrElse(() => []))
17476
- ]), Option.getOrElse(() => []), Array$1.map(({ index, message }) => ({
17460
+ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source), Option.map((frontmatter) => [...pipe(Option.fromUndefinedOr(frontmatter.name), Option.map((name) => nameProblems(skill, name, folder)), Option.getOrElse(() => [])), ...pipe(Option.fromUndefinedOr(frontmatter.license), Option.map(() => ({
17461
+ index: offsetOf$1(skill.source, LICENSE_KEY),
17462
+ message: "The frontmatter has license. Skills here carry neither a license field nor a LICENSE file. Remove it."
17463
+ })), Option.toArray)]), Option.getOrElse(() => []), Array$1.map(({ index, message }) => ({
17477
17464
  file: skill.file,
17478
17465
  ...positionOf(skill.source)(index),
17479
17466
  rule: RULE$28,
@@ -19150,7 +19137,7 @@ const checkSkillReferences = Effect.fn("checkSkillReferences")(function* checkSk
19150
19137
  const skills = pipe(plugins, Array$1.flatMap(({ skills: own }) => own));
19151
19138
  const qualified = new Set(pipe(skills, Array$1.map(({ plugin, name }) => `${plugin}${QUALIFIER}${name}`)));
19152
19139
  const owners = pipe(skills, Array$1.flatMap((skill) => ownerProblems(skill, qualified)));
19153
- const hub = Array$1.findFirst(skills, ({ frontmatter }) => isIndexSkill(frontmatter));
19140
+ const hub = Array$1.findFirst(skills, ({ file }) => INDEX_SKILL.test(file));
19154
19141
  const hubbed = yield* Option.match(hub, {
19155
19142
  onNone: () => Effect.succeed([]),
19156
19143
  onSome: (found) => referencesFrom(found, skills)
@@ -20575,7 +20562,7 @@ const summaryOf = ({ name, text }) => pipe(splitFrontmatter(text), Option.match(
20575
20562
  onSome: (frontmatter) => ({
20576
20563
  name,
20577
20564
  description: descriptionOf(frontmatter.fields),
20578
- index: isIndexSkill(frontmatter)
20565
+ index: INDEX_SKILL.test(name)
20579
20566
  })
20580
20567
  }));
20581
20568
  const readAll = (root, names) => Effect.forEach(names, readDocument(root), { concurrency: READ_CONCURRENCY$4 }).pipe(Effect.map(Array$1.getSomes));
@@ -21393,7 +21380,7 @@ const loadsCleanly = ({ runtime, consumer, failure, args }) => mustSucceed({
21393
21380
  });
21394
21381
  // src/features/publish-workspace/model/plugin-lock.ts
21395
21382
  const PLUGIN_FILE = ".claude-plugin/plugin.json";
21396
- const PACKED_ROOT = "package";
21383
+ const PACKED_ROOT$1 = "package";
21397
21384
  const NPM_LOCK$1 = "package-lock.json";
21398
21385
  const MINIMUM_RELEASE_AGE_DAYS = 1;
21399
21386
  const SCOPE = /^@[^/]+\//u;
@@ -21425,7 +21412,7 @@ const unpacked = Effect.fn("publish.unpacked")(function* unpacked(tarball, direc
21425
21412
  directory
21426
21413
  ]
21427
21414
  });
21428
- return path.join(directory, PACKED_ROOT);
21415
+ return path.join(directory, PACKED_ROOT$1);
21429
21416
  });
21430
21417
  /** @internal */
21431
21418
  const installsDependencies = Effect.fn("publish.installsDependencies")(function* installsDependencies(root) {
@@ -21475,7 +21462,7 @@ const lockPlugin = Effect.fn("publish.lockPlugin")(function* lockPlugin(tarball,
21475
21462
  tarball,
21476
21463
  "-C",
21477
21464
  unpackedTo,
21478
- PACKED_ROOT
21465
+ PACKED_ROOT$1
21479
21466
  ]
21480
21467
  });
21481
21468
  });
@@ -21641,6 +21628,37 @@ const packHookEnv = Effect.fn("publish.packHook")(function* packHookEnv(director
21641
21628
  });
21642
21629
  // src/features/publish-workspace/model/pack.ts
21643
21630
  const TARBALL = "package.tgz";
21631
+ const PACKED_ROOT = "package";
21632
+ const SKILLS = "skills";
21633
+ const writeIntent = Effect.fn("publish.writeIntent")(function* writeIntent(tarball, temporary) {
21634
+ const fileSystem = yield* FileSystem.FileSystem;
21635
+ const path = yield* Path.Path;
21636
+ const unpackedTo = path.join(temporary, "intent");
21637
+ const root = yield* unpacked(tarball, unpackedTo);
21638
+ if (!(yield* fileSystem.exists(path.join(root, SKILLS)))) return;
21639
+ yield* mustSucceed({
21640
+ command: "node",
21641
+ args: [
21642
+ MDLCT_BIN,
21643
+ "intent",
21644
+ root
21645
+ ]
21646
+ });
21647
+ yield* mustSucceed({
21648
+ command: "tar",
21649
+ args: [
21650
+ "-czf",
21651
+ tarball,
21652
+ "-C",
21653
+ unpackedTo,
21654
+ PACKED_ROOT
21655
+ ]
21656
+ });
21657
+ });
21658
+ const finishTarball = Effect.fn("publish.finishTarball")(function* finishTarball(tarball, temporary, plugin) {
21659
+ if (plugin) yield* lockPlugin(tarball, temporary);
21660
+ yield* writeIntent(tarball, temporary);
21661
+ });
21644
21662
  /** @internal */
21645
21663
  const pack = Effect.fn("publish.pack")(function* pack(directory) {
21646
21664
  const fileSystem = yield* FileSystem.FileSystem;
@@ -21660,7 +21678,7 @@ const pack = Effect.fn("publish.pack")(function* pack(directory) {
21660
21678
  env,
21661
21679
  cwd: directory
21662
21680
  });
21663
- if (plugin) yield* lockPlugin(tarball, temporary);
21681
+ yield* finishTarball(tarball, temporary, plugin);
21664
21682
  return tarball;
21665
21683
  });
21666
21684
  // src/features/publish-workspace/model/compat-native.ts