@ariestools/toolchain 10.0.7 → 10.0.8

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/bin/xy.mjs CHANGED
@@ -6863,7 +6863,7 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6863
6863
  //#region src/lib/toolchainVersion.ts
6864
6864
  createRequire(import.meta.url);
6865
6865
  function bundledToolchainVersion() {
6866
- return "10.0.7";
6866
+ return "10.0.8";
6867
6867
  }
6868
6868
  function bundledToolchainRange() {
6869
6869
  return `^${bundledToolchainVersion()}`;
@@ -7209,7 +7209,7 @@ function productionDependencyNames(manifest) {
7209
7209
  }
7210
7210
  //#endregion
7211
7211
  //#region src/lib/licenseCheck/collectProductionLicenses.ts
7212
- function readManifest$1(packageDir) {
7212
+ function readManifest$2(packageDir) {
7213
7213
  const pkgPath = PATH.join(packageDir, "package.json");
7214
7214
  if (!fs.existsSync(pkgPath)) return void 0;
7215
7215
  try {
@@ -7248,7 +7248,7 @@ function packageKey(manifest, fallbackDir) {
7248
7248
  */
7249
7249
  function collectProductionLicenses(startDir) {
7250
7250
  const root = PATH.resolve(startDir);
7251
- const rootManifest = readManifest$1(root);
7251
+ const rootManifest = readManifest$2(root);
7252
7252
  if (rootManifest === void 0) return {};
7253
7253
  const result = {};
7254
7254
  const queue = [];
@@ -7266,7 +7266,7 @@ function collectProductionLicenses(startDir) {
7266
7266
  while (queue.length > 0) {
7267
7267
  const packageDir = queue.shift();
7268
7268
  if (packageDir === void 0) break;
7269
- const manifest = readManifest$1(packageDir);
7269
+ const manifest = readManifest$2(packageDir);
7270
7270
  if (manifest === void 0) continue;
7271
7271
  const key = packageKey(manifest, packageDir);
7272
7272
  if (result[key] === void 0) result[key] = {
@@ -11809,7 +11809,7 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
11809
11809
  exports.cosmiconfigSync = cosmiconfigSync;
11810
11810
  }));
11811
11811
  //#endregion
11812
- //#region ../../node_modules/.pnpm/cosmiconfig-typescript-loader@6.3.0_@types+node@26.6.0_cosmiconfig@10.0.1_typescript@6.0.3/node_modules/cosmiconfig-typescript-loader/dist/esm/typescript-compile-error.mjs
11812
+ //#region ../../node_modules/.pnpm/cosmiconfig-typescript-loader@6.3.0_@types+node@26.6.2_cosmiconfig@10.0.1_typescript@6.0.3/node_modules/cosmiconfig-typescript-loader/dist/esm/typescript-compile-error.mjs
11813
11813
  var TypeScriptCompileError = class _TypeScriptCompileError extends Error {
11814
11814
  constructor(message) {
11815
11815
  super(message);
@@ -11825,7 +11825,7 @@ ${error.message}`;
11825
11825
  }
11826
11826
  };
11827
11827
  //#endregion
11828
- //#region ../../node_modules/.pnpm/cosmiconfig-typescript-loader@6.3.0_@types+node@26.6.0_cosmiconfig@10.0.1_typescript@6.0.3/node_modules/cosmiconfig-typescript-loader/dist/esm/loader.mjs
11828
+ //#region ../../node_modules/.pnpm/cosmiconfig-typescript-loader@6.3.0_@types+node@26.6.2_cosmiconfig@10.0.1_typescript@6.0.3/node_modules/cosmiconfig-typescript-loader/dist/esm/loader.mjs
11829
11829
  function TypeScriptLoader(options) {
11830
11830
  const loader = createJiti("", {
11831
11831
  interopDefault: true,
@@ -11990,7 +11990,7 @@ In-flight workspace loads — concurrent jobs for the same dir share one search.
11990
11990
  */
11991
11991
  const workspaceConfigLoadPromises = /* @__PURE__ */ new Map();
11992
11992
  const deprecationWarned = /* @__PURE__ */ new Set();
11993
- function isRecord$11(value) {
11993
+ function isRecord$12(value) {
11994
11994
  return typeof value === "object" && value !== null && !Array.isArray(value);
11995
11995
  }
11996
11996
  const explorerState = {};
@@ -12071,12 +12071,12 @@ function warnOnce(key, message) {
12071
12071
  */
12072
12072
  function resolveCommandField(cfg, commandName, configPath) {
12073
12073
  const configKey = canonicalRuleConfigKey(commandName);
12074
- const commands = isRecord$11(cfg.commands) ? cfg.commands : void 0;
12074
+ const commands = isRecord$12(cfg.commands) ? cfg.commands : void 0;
12075
12075
  const fromCommands = commands?.[configKey];
12076
- if (isRecord$11(fromCommands)) return fromCommands;
12076
+ if (isRecord$12(fromCommands)) return fromCommands;
12077
12077
  for (const alias of deprecatedRuleConfigAliases(configKey)) {
12078
12078
  const fromAlias = commands?.[alias];
12079
- if (!isRecord$11(fromAlias)) continue;
12079
+ if (!isRecord$12(fromAlias)) continue;
12080
12080
  warnOnce(`${configPath ?? "unknown"}:commands.${alias}`, `[xy] Deprecated: "commands.${alias}" in ${configPath ?? "xy.config"} — use "commands.${configKey}"`);
12081
12081
  return fromAlias;
12082
12082
  }
@@ -12088,7 +12088,7 @@ function resolveCommandField(cfg, commandName, configPath) {
12088
12088
  return {};
12089
12089
  }
12090
12090
  function mergeRuleConfigs(target, source) {
12091
- if (isRecord$11(target) && isRecord$11(source)) return {
12091
+ if (isRecord$12(target) && isRecord$12(source)) return {
12092
12092
  ...target,
12093
12093
  ...source
12094
12094
  };
@@ -20832,7 +20832,7 @@ const SEVERITIES = /* @__PURE__ */ new Set([
20832
20832
  ]);
20833
20833
  const SCOPES = /* @__PURE__ */ new Set(["development", "runtime"]);
20834
20834
  const RELATIONSHIPS = /* @__PURE__ */ new Set(["direct", "transitive"]);
20835
- function isRecord$10(value) {
20835
+ function isRecord$11(value) {
20836
20836
  return typeof value === "object" && value !== null && !Array.isArray(value);
20837
20837
  }
20838
20838
  function readString(value) {
@@ -20851,13 +20851,13 @@ function readRelationship(value) {
20851
20851
  return RELATIONSHIPS.has(raw) ? raw : "unknown";
20852
20852
  }
20853
20853
  function parseDependabotAlert(raw) {
20854
- if (!isRecord$10(raw)) return void 0;
20855
- const dependency = isRecord$10(raw.dependency) ? raw.dependency : {};
20856
- const dependencyPackage = isRecord$10(dependency.package) ? dependency.package : {};
20857
- const advisory = isRecord$10(raw.security_advisory) ? raw.security_advisory : {};
20858
- const vulnerability = isRecord$10(raw.security_vulnerability) ? raw.security_vulnerability : {};
20859
- const patched = isRecord$10(vulnerability.first_patched_version) ? vulnerability.first_patched_version : {};
20860
- const repository = isRecord$10(raw.repository) ? raw.repository : {};
20854
+ if (!isRecord$11(raw)) return void 0;
20855
+ const dependency = isRecord$11(raw.dependency) ? raw.dependency : {};
20856
+ const dependencyPackage = isRecord$11(dependency.package) ? dependency.package : {};
20857
+ const advisory = isRecord$11(raw.security_advisory) ? raw.security_advisory : {};
20858
+ const vulnerability = isRecord$11(raw.security_vulnerability) ? raw.security_vulnerability : {};
20859
+ const patched = isRecord$11(vulnerability.first_patched_version) ? vulnerability.first_patched_version : {};
20860
+ const repository = isRecord$11(raw.repository) ? raw.repository : {};
20861
20861
  const packageName = readString(dependencyPackage.name);
20862
20862
  if (packageName.length === 0) return void 0;
20863
20863
  const patchedVersion = readString(patched.identifier);
@@ -22146,13 +22146,13 @@ async function fetchAllRegistryInfo(packageNames, options = {}) {
22146
22146
  return await fetchAllRegistryInfoDirect(packageNames, options);
22147
22147
  }
22148
22148
  //#endregion
22149
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.0/node_modules/@inquirer/core/dist/lib/key.js
22149
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.2/node_modules/@inquirer/core/dist/lib/key.js
22150
22150
  const isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
22151
22151
  const isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
22152
22152
  const isSpaceKey = (key) => key.name === "space";
22153
22153
  const isEnterKey = (key) => key.name === "enter" || key.name === "return";
22154
22154
  //#endregion
22155
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.0/node_modules/@inquirer/core/dist/lib/errors.js
22155
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.2/node_modules/@inquirer/core/dist/lib/errors.js
22156
22156
  var AbortPromptError = class extends Error {
22157
22157
  name = "AbortPromptError";
22158
22158
  message = "Prompt was aborted";
@@ -22175,7 +22175,7 @@ var ValidationError = class extends Error {
22175
22175
  name = "ValidationError";
22176
22176
  };
22177
22177
  //#endregion
22178
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.0/node_modules/@inquirer/core/dist/lib/hook-engine.js
22178
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.2/node_modules/@inquirer/core/dist/lib/hook-engine.js
22179
22179
  const hookStorage = new AsyncLocalStorage();
22180
22180
  function createStore(rl) {
22181
22181
  return {
@@ -22271,7 +22271,7 @@ const effectScheduler = {
22271
22271
  }
22272
22272
  };
22273
22273
  //#endregion
22274
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.0/node_modules/@inquirer/core/dist/lib/use-state.js
22274
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.2/node_modules/@inquirer/core/dist/lib/use-state.js
22275
22275
  function isFactory(value) {
22276
22276
  return typeof value === "function";
22277
22277
  }
@@ -22295,7 +22295,7 @@ function useState(defaultValue) {
22295
22295
  });
22296
22296
  }
22297
22297
  //#endregion
22298
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.0/node_modules/@inquirer/core/dist/lib/use-effect.js
22298
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.2/node_modules/@inquirer/core/dist/lib/use-effect.js
22299
22299
  function useEffect(cb, depArray) {
22300
22300
  withPointer((pointer) => {
22301
22301
  const oldDeps = pointer.get();
@@ -22304,12 +22304,12 @@ function useEffect(cb, depArray) {
22304
22304
  });
22305
22305
  }
22306
22306
  //#endregion
22307
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.0/node_modules/@inquirer/core/dist/lib/use-ref.js
22307
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.2/node_modules/@inquirer/core/dist/lib/use-ref.js
22308
22308
  function useRef(val) {
22309
22309
  return useState({ current: val })[0];
22310
22310
  }
22311
22311
  //#endregion
22312
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.0/node_modules/@inquirer/core/dist/lib/use-keypress.js
22312
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.2/node_modules/@inquirer/core/dist/lib/use-keypress.js
22313
22313
  function useKeypress(userHandler) {
22314
22314
  const signal = useRef(userHandler);
22315
22315
  signal.current = userHandler;
@@ -22637,7 +22637,7 @@ function wrapAnsi$1(string, columns, options) {
22637
22637
  return String(string).normalize().split(CRLF_OR_LF).map((line) => exec$2(line, columns, options)).join("\n");
22638
22638
  }
22639
22639
  //#endregion
22640
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.0/node_modules/@inquirer/core/dist/lib/utils.js
22640
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.2/node_modules/@inquirer/core/dist/lib/utils.js
22641
22641
  var import_cli_width = /* @__PURE__ */ __toESM(require_cli_width(), 1);
22642
22642
  /**
22643
22643
  * Force line returns at specific width. This function is ANSI code friendly and it'll
@@ -22977,7 +22977,7 @@ const eraseLine = "\x1B[2K";
22977
22977
  /** Erase the specified number of lines above the cursor */
22978
22978
  const eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + "\x1B[2K\x1B[G" : "";
22979
22979
  //#endregion
22980
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.0/node_modules/@inquirer/core/dist/lib/screen-manager.js
22980
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.2/node_modules/@inquirer/core/dist/lib/screen-manager.js
22981
22981
  const height = (content) => content.split("\n").length;
22982
22982
  const lastLine = (content) => content.split("\n").pop() ?? "";
22983
22983
  var ScreenManager = class {
@@ -23034,7 +23034,7 @@ var ScreenManager = class {
23034
23034
  }
23035
23035
  };
23036
23036
  //#endregion
23037
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.0/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
23037
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.2/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
23038
23038
  var PromisePolyfill = class extends Promise {
23039
23039
  static withResolver() {
23040
23040
  let resolve;
@@ -23050,7 +23050,7 @@ var PromisePolyfill = class extends Promise {
23050
23050
  }
23051
23051
  };
23052
23052
  //#endregion
23053
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.0/node_modules/@inquirer/core/dist/lib/create-prompt.js
23053
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.6.2/node_modules/@inquirer/core/dist/lib/create-prompt.js
23054
23054
  var import_lib = /* @__PURE__ */ __toESM(require_lib(), 1);
23055
23055
  const nativeSetImmediate = globalThis.setImmediate;
23056
23056
  /**
@@ -24717,7 +24717,7 @@ const RULE_LEVELS$1 = /* @__PURE__ */ new Set([
24717
24717
  "off",
24718
24718
  "warn"
24719
24719
  ]);
24720
- function isRecord$9(value) {
24720
+ function isRecord$10(value) {
24721
24721
  return typeof value === "object" && value !== null && !Array.isArray(value);
24722
24722
  }
24723
24723
  function isValidWeight(value) {
@@ -24734,7 +24734,7 @@ function parseTupleRuleSetting(location, setting) {
24734
24734
  if (setting.length !== 2) throw new TypeError(`${location} tuple must be [level, options]`);
24735
24735
  const [level, options] = setting;
24736
24736
  if (!isRuleLevel$4(level)) throw new TypeError(`${location} level must be "error", "warn", or "off"`);
24737
- if (!isRecord$9(options)) throw new TypeError(`${location} options must be an object`);
24737
+ if (!isRecord$10(options)) throw new TypeError(`${location} options must be an object`);
24738
24738
  return {
24739
24739
  enabled: level !== "off",
24740
24740
  level,
@@ -24767,7 +24767,7 @@ function parseRuleSetting(location, setting) {
24767
24767
  weight: parseWeight(location, setting)
24768
24768
  };
24769
24769
  if (Array.isArray(setting)) return parseTupleRuleSetting(location, setting);
24770
- if (isRecord$9(setting)) return parseObjectRuleSetting(location, setting);
24770
+ if (isRecord$10(setting)) return parseObjectRuleSetting(location, setting);
24771
24771
  throw new TypeError(`${location} must be a boolean, rule level, number, "infinite", [level, options], or { enabled?, level?, weight? } object`);
24772
24772
  }
24773
24773
  function validateRuleIds(location, rules) {
@@ -25459,7 +25459,7 @@ function findDependencyDir(startDir, dependency) {
25459
25459
  current = parent;
25460
25460
  }
25461
25461
  }
25462
- function readManifest(dependencyDir) {
25462
+ function readManifest$1(dependencyDir) {
25463
25463
  try {
25464
25464
  return JSON.parse(fs.readFileSync(PATH.join(dependencyDir, "package.json"), "utf8"));
25465
25465
  } catch {
@@ -25601,7 +25601,7 @@ function scanTypesSurface(typesEntry) {
25601
25601
  function getDependencySignals(workspaceDir, dependency) {
25602
25602
  const dependencyDir = findDependencyDir(workspaceDir, dependency);
25603
25603
  if (dependencyDir === void 0) return void 0;
25604
- const manifest = readManifest(dependencyDir);
25604
+ const manifest = readManifest$1(dependencyDir);
25605
25605
  if (manifest === void 0) return void 0;
25606
25606
  const findings = [];
25607
25607
  const report = (ruleId, evidence) => {
@@ -28104,11 +28104,11 @@ function applyPackageEditsToTsSource(text, edits) {
28104
28104
  }
28105
28105
  return result;
28106
28106
  }
28107
- function isRecord$8(value) {
28107
+ function isRecord$9(value) {
28108
28108
  return typeof value === "object" && value !== null && !Array.isArray(value);
28109
28109
  }
28110
28110
  function readJsonPackageConfig(value) {
28111
- if (!isRecord$8(value)) return void 0;
28111
+ if (!isRecord$9(value)) return void 0;
28112
28112
  const config = {};
28113
28113
  if (typeof value.placement === "string") config.placement = value.placement;
28114
28114
  if (typeof value.presence === "string") config.presence = value.presence;
@@ -28117,10 +28117,10 @@ function readJsonPackageConfig(value) {
28117
28117
  return config;
28118
28118
  }
28119
28119
  function resolveJsonDeplintObject(root) {
28120
- const commands = isRecord$8(root.commands) ? root.commands : void 0;
28121
- if (commands !== void 0 && isRecord$8(commands.deplint)) return commands.deplint;
28122
- if (isRecord$8(root.deplint)) return root.deplint;
28123
- if (!isRecord$8(root.commands)) root.commands = {};
28120
+ const commands = isRecord$9(root.commands) ? root.commands : void 0;
28121
+ if (commands !== void 0 && isRecord$9(commands.deplint)) return commands.deplint;
28122
+ if (isRecord$9(root.deplint)) return root.deplint;
28123
+ if (!isRecord$9(root.commands)) root.commands = {};
28124
28124
  const cmds = root.commands;
28125
28125
  const deplint = {};
28126
28126
  cmds.deplint = deplint;
@@ -28133,7 +28133,7 @@ function applyPackageEditsToJsonSource(text, edits) {
28133
28133
  if (edits.length === 0) return text;
28134
28134
  const root = JSON.parse(text);
28135
28135
  const deplint = resolveJsonDeplintObject(root);
28136
- const packages = isRecord$8(deplint.packages) ? deplint.packages : deplint.packages = {};
28136
+ const packages = isRecord$9(deplint.packages) ? deplint.packages : deplint.packages = {};
28137
28137
  for (const edit of edits) if (edit.config === void 0) delete packages[edit.dependency];
28138
28138
  else packages[edit.dependency] = edit.config;
28139
28139
  if (Object.keys(packages).length === 0) delete deplint.packages;
@@ -28168,9 +28168,9 @@ function readPackagesFromConfigFile(configPath) {
28168
28168
  const result = /* @__PURE__ */ new Map();
28169
28169
  if (isJsonConfigPath$1(configPath)) try {
28170
28170
  const root = JSON.parse(text);
28171
- const commands = isRecord$8(root.commands) ? root.commands : void 0;
28172
- const deplint = commands !== void 0 && isRecord$8(commands.deplint) ? commands.deplint : isRecord$8(root.deplint) ? root.deplint : void 0;
28173
- const packages = deplint !== void 0 && isRecord$8(deplint.packages) ? deplint.packages : void 0;
28171
+ const commands = isRecord$9(root.commands) ? root.commands : void 0;
28172
+ const deplint = commands !== void 0 && isRecord$9(commands.deplint) ? commands.deplint : isRecord$9(root.deplint) ? root.deplint : void 0;
28173
+ const packages = deplint !== void 0 && isRecord$9(deplint.packages) ? deplint.packages : void 0;
28174
28174
  if (packages === void 0) return result;
28175
28175
  for (const [name, value] of Object.entries(packages)) {
28176
28176
  const config = readJsonPackageConfig(value);
@@ -28516,7 +28516,7 @@ const BUILT_IN_RULE_OPTION_KEYS = {
28516
28516
  ]),
28517
28517
  "dep.workspace.protocol": /* @__PURE__ */ new Set(["ignore", "protocol"])
28518
28518
  };
28519
- function isRecord$7(value) {
28519
+ function isRecord$8(value) {
28520
28520
  return typeof value === "object" && value !== null && !Array.isArray(value);
28521
28521
  }
28522
28522
  function isRuleLevel$3(value) {
@@ -28557,7 +28557,7 @@ function parseRuleConfig$1(ruleId, value) {
28557
28557
  const level = value[0];
28558
28558
  if (!isRuleLevel$3(level)) throw new TypeError(`${formatRuleConfigLocation$1(ruleId)} level must be one of "off", "warn", or "error"`);
28559
28559
  const options = value[1];
28560
- if (!isRecord$7(options)) throw new TypeError(`${formatRuleConfigLocation$1(ruleId)} options must be an object`);
28560
+ if (!isRecord$8(options)) throw new TypeError(`${formatRuleConfigLocation$1(ruleId)} options must be an object`);
28561
28561
  return {
28562
28562
  level,
28563
28563
  options: { ...options }
@@ -33415,7 +33415,7 @@ for await (const line of rl) {
33415
33415
 
33416
33416
  try {
33417
33417
  const payload = await runJob(job)
33418
- console.log(marker + JSON.stringify(payload))
33418
+ console.log(marker + JSON.stringify({ ...payload, rssBytes: process.memoryUsage().rss }))
33419
33419
  } catch (ex) {
33420
33420
  console.error(ex instanceof Error ? (ex.stack ?? ex.message) : String(ex))
33421
33421
  console.log(marker + JSON.stringify({
@@ -33423,6 +33423,7 @@ for await (const line of rl) {
33423
33423
  errors: 1,
33424
33424
  files: 0,
33425
33425
  messages: [],
33426
+ rssBytes: process.memoryUsage().rss,
33426
33427
  warnings: 0,
33427
33428
  }))
33428
33429
  }
@@ -33434,6 +33435,7 @@ for await (const line of rl) {
33434
33435
  */
33435
33436
  var LintWorkerPool = class {
33436
33437
  closed = false;
33438
+ maxWorkerRssBytes;
33437
33439
  nextJobId = 1;
33438
33440
  queue = [];
33439
33441
  rootDir;
@@ -33442,6 +33444,8 @@ var LintWorkerPool = class {
33442
33444
  constructor(rootDir, size) {
33443
33445
  this.rootDir = rootDir;
33444
33446
  this.size = Math.max(1, size);
33447
+ const maxWorkerRssMb = Number(process.env.XY_LINT_WORKER_MAX_RSS_MB);
33448
+ this.maxWorkerRssBytes = (Number.isFinite(maxWorkerRssMb) && maxWorkerRssMb > 0 ? maxWorkerRssMb : 2048) * 1024 * 1024;
33445
33449
  }
33446
33450
  async close() {
33447
33451
  this.closed = true;
@@ -33520,6 +33524,7 @@ var LintWorkerPool = class {
33520
33524
  profile: parsed.profile,
33521
33525
  warnings: parsed.warnings
33522
33526
  });
33527
+ if (worker.pending.size === 0 && (parsed.rssBytes ?? 0) > this.maxWorkerRssBytes) this.retire(worker);
33523
33528
  this.pump();
33524
33529
  }
33525
33530
  }
@@ -33573,6 +33578,24 @@ var LintWorkerPool = class {
33573
33578
  }
33574
33579
  }
33575
33580
  }
33581
+ /**
33582
+ * Replaces a worker whose memory is past the budget. typescript-eslint and
33583
+ * resolver state grows package after package in a long-lived worker, so a fresh
33584
+ * process bounds it. The replacement takes the slot before the next pump, so the
33585
+ * retiring worker gets no more jobs and its close handler does not respawn it.
33586
+ */
33587
+ retire(worker) {
33588
+ const index = this.workers.indexOf(worker);
33589
+ if (index === -1) return;
33590
+ this.workers[index] = this.spawnWorker(worker.id);
33591
+ worker.busy = true;
33592
+ try {
33593
+ worker.child.stdin?.write("__XY_LINT_POOL_SHUTDOWN__\n");
33594
+ worker.child.stdin?.end();
33595
+ } catch {
33596
+ worker.child.kill("SIGTERM");
33597
+ }
33598
+ }
33576
33599
  spawnWorker(id) {
33577
33600
  const env = {
33578
33601
  ...process.env,
@@ -36228,7 +36251,7 @@ function formatExportPath$1(pathParts) {
36228
36251
  function ensureExportsPath$1(value) {
36229
36252
  return value.startsWith("./") ? value : `./${value}`;
36230
36253
  }
36231
- function isRecord$6(value) {
36254
+ function isRecord$7(value) {
36232
36255
  return typeof value === "object" && value !== null && !Array.isArray(value);
36233
36256
  }
36234
36257
  function normalizeTarget(target) {
@@ -36265,7 +36288,7 @@ function collectExportLeaves(value, subpath = ".", pathParts = ["exports"], cond
36265
36288
  }];
36266
36289
  }
36267
36290
  if (Array.isArray(value)) return value.flatMap((entry, index) => collectExportLeaves(entry, subpath, [...pathParts, `[${index}]`], conditionPath));
36268
- if (!isRecord$6(value)) return [];
36291
+ if (!isRecord$7(value)) return [];
36269
36292
  return Object.entries(value).flatMap(([key, nested]) => {
36270
36293
  if (isSubpathExportKey$1(key)) return collectExportLeaves(nested, key, [...pathParts, key], conditionPath);
36271
36294
  return collectExportLeaves(nested, subpath, [...pathParts, key], [...conditionPath, key]);
@@ -36363,14 +36386,14 @@ function shouldNormalizeExportsForFix(pkg) {
36363
36386
  pkg.exports = { ".": pkg.exports };
36364
36387
  return true;
36365
36388
  }
36366
- if (isRecord$6(pkg.exports) && !hasSubpathKeys(pkg.exports)) {
36389
+ if (isRecord$7(pkg.exports) && !hasSubpathKeys(pkg.exports)) {
36367
36390
  pkg.exports = { ".": pkg.exports };
36368
36391
  return true;
36369
36392
  }
36370
36393
  return false;
36371
36394
  }
36372
36395
  function isRecordObject(value) {
36373
- return isRecord$6(value);
36396
+ return isRecord$7(value);
36374
36397
  }
36375
36398
  function ensureSubpath(exports, subpath) {
36376
36399
  const existing = exports[subpath];
@@ -41923,7 +41946,7 @@ const VALID_RULE_LEVELS = /* @__PURE__ */ new Set([
41923
41946
  "warn",
41924
41947
  "error"
41925
41948
  ]);
41926
- function isRecord$5(value) {
41949
+ function isRecord$6(value) {
41927
41950
  return typeof value === "object" && value !== null && !Array.isArray(value);
41928
41951
  }
41929
41952
  function isRuleLevel(value) {
@@ -41948,13 +41971,13 @@ function parseRuleConfig(ruleId, value) {
41948
41971
  const level = value[0];
41949
41972
  if (!isRuleLevel(level)) throw new TypeError(`${formatRuleConfigLocation(ruleId)} level must be one of "off", "warn", or "error"`);
41950
41973
  const options = value[1];
41951
- if (!isRecord$5(options)) throw new TypeError(`${formatRuleConfigLocation(ruleId)} options must be an object`);
41974
+ if (!isRecord$6(options)) throw new TypeError(`${formatRuleConfigLocation(ruleId)} options must be an object`);
41952
41975
  return {
41953
41976
  level,
41954
41977
  options: { ...options }
41955
41978
  };
41956
41979
  }
41957
- if (isRecord$5(value)) return {
41980
+ if (isRecord$6(value)) return {
41958
41981
  level: "warn",
41959
41982
  options: { ...value }
41960
41983
  };
@@ -43149,7 +43172,7 @@ function applyCompileCompilerToTsSource(text, compiler) {
43149
43172
  if ((ts.isStringLiteral(validator.initializer) || ts.isNoSubstitutionTemplateLiteral(validator.initializer)) && validator.initializer.text === "shared") result = removePropertyFromObject(result, validator, afterCompiler);
43150
43173
  return result;
43151
43174
  }
43152
- function isRecord$4(value) {
43175
+ function isRecord$5(value) {
43153
43176
  return typeof value === "object" && value !== null && !Array.isArray(value);
43154
43177
  }
43155
43178
  /**
@@ -43157,7 +43180,7 @@ function isRecord$4(value) {
43157
43180
  */
43158
43181
  function applyCompileCompilerToJsonSource(text, compiler) {
43159
43182
  const root = JSON.parse(text);
43160
- const compile = isRecord$4(root.compile) ? { ...root.compile } : {};
43183
+ const compile = isRecord$5(root.compile) ? { ...root.compile } : {};
43161
43184
  compile.compiler = compiler;
43162
43185
  if (compiler === "native" && compile.validator === "shared") delete compile.validator;
43163
43186
  root.compile = compile;
@@ -45412,12 +45435,12 @@ function checkPnpmReleaseAgeExcludes(cwd, pm, workspaces = []) {
45412
45435
  for (const pattern of unnecessary) result.fixable.push(`pnpm-workspace.yaml minimumReleaseAgeExclude includes '${pattern}' but the repo does not use that scope`);
45413
45436
  return result;
45414
45437
  }
45415
- function isRecord$3(value) {
45438
+ function isRecord$4(value) {
45416
45439
  return typeof value === "object" && value !== null && !Array.isArray(value);
45417
45440
  }
45418
45441
  function isConfiguredValue(value) {
45419
45442
  if (value === void 0 || value === null) return false;
45420
- if (isRecord$3(value)) return Object.keys(value).length > 0;
45443
+ if (isRecord$4(value)) return Object.keys(value).length > 0;
45421
45444
  if (Array.isArray(value)) return value.length > 0;
45422
45445
  return value !== "";
45423
45446
  }
@@ -45445,8 +45468,8 @@ function formatOverrideWarning(location, keys) {
45445
45468
  function checkPnpmDependencyOverrides(cwd, pm, rootPkg) {
45446
45469
  const result = emptyResult$2();
45447
45470
  if (pm !== "pnpm") return result;
45448
- const packageJsonOverrides = (isRecord$3(rootPkg.pnpm) ? rootPkg.pnpm : void 0)?.overrides;
45449
- if (isConfiguredValue(packageJsonOverrides)) result.warnings.push(formatOverrideWarning("Root package.json pnpm.overrides field", isRecord$3(packageJsonOverrides) ? Object.keys(packageJsonOverrides) : []));
45471
+ const packageJsonOverrides = (isRecord$4(rootPkg.pnpm) ? rootPkg.pnpm : void 0)?.overrides;
45472
+ if (isConfiguredValue(packageJsonOverrides)) result.warnings.push(formatOverrideWarning("Root package.json pnpm.overrides field", isRecord$4(packageJsonOverrides) ? Object.keys(packageJsonOverrides) : []));
45450
45473
  const workspaceOverrides = readPnpmWorkspaceDocument(cwd)?.get("overrides");
45451
45474
  if (isConfiguredYamlNode(workspaceOverrides)) result.warnings.push(formatOverrideWarning("pnpm-workspace.yaml overrides field", configuredYamlKeys(workspaceOverrides)));
45452
45475
  return result;
@@ -48953,6 +48976,10 @@ const skillOrderIndex = (name) => {
48953
48976
  const sortSkills = (skills) => {
48954
48977
  return [...skills].toSorted((a, b) => skillOrderIndex(a) - skillOrderIndex(b) || a.localeCompare(b));
48955
48978
  };
48979
+ const withSkill = (skills, skill) => {
48980
+ if (skills.includes(skill)) return skills;
48981
+ return sortSkills([...skills, skill]);
48982
+ };
48956
48983
  const XY_SKILLS = ["xy-development", "xy-toolchain"];
48957
48984
  const XYO_SKILLS = ["xyo-knowledge"];
48958
48985
  const XL1_SKILLS = [
@@ -48993,6 +49020,7 @@ const normalizeAdditionalSkills = (value) => {
48993
49020
  /**
48994
49021
  * Required skills for a detected repo profile.
48995
49022
  * Adds `ariestools-sdk` when the repo depends on or produces packages from ariestools/sdk-js,
49023
+ * adds `xl1-dapp-kit` when the repo depends on or produces `@xyo-network/dapp-kit` packages,
48996
49024
  * plus any validated `additionalSkills` override from xy config.
48997
49025
  */
48998
49026
  const requiredSkillsForProfile = (profile) => {
@@ -49004,12 +49032,12 @@ const requiredSkillsForProfile = (profile) => {
49004
49032
  "xy-toolchain",
49005
49033
  "ariestools-sdk"
49006
49034
  ]);
49007
- if (base.includes("ariestools-sdk")) return base;
49008
- return sortSkills([...base, "ariestools-sdk"]);
49035
+ return withSkill(base, "ariestools-sdk");
49009
49036
  })();
49037
+ const withDappKit = profile.isUsingDappKit ? withSkill(withSdk, "xl1-dapp-kit") : withSdk;
49010
49038
  const additional = profile.additionalSkills ?? [];
49011
- if (additional.length === 0) return withSdk;
49012
- return sortSkills([.../* @__PURE__ */ new Set([...withSdk, ...additional])]);
49039
+ if (additional.length === 0) return withDappKit;
49040
+ return sortSkills([.../* @__PURE__ */ new Set([...withDappKit, ...additional])]);
49013
49041
  };
49014
49042
  const optionalSkillsForTier = (tier) => {
49015
49043
  if (tier !== "xl1") return [];
@@ -55280,6 +55308,7 @@ const XYLABS_SCOPE = "@xylabs/";
55280
55308
  const ARIESTOOLS_SCOPE = "@ariestools/";
55281
55309
  const XYO_NETWORK_SCOPE = "@xyo-network/";
55282
55310
  const XL1_PACKAGE_PREFIX = "@xyo-network/xl1";
55311
+ const DAPP_KIT_PACKAGE = "@xyo-network/dapp-kit";
55283
55312
  const LEGACY_TOOLCHAIN_PACKAGES = /* @__PURE__ */ new Set([
55284
55313
  "@xylabs/ts-scripts-yarn3",
55285
55314
  "@xylabs/ts-scripts-pnpm",
@@ -55334,6 +55363,14 @@ const hasToolchainDependency = (depName) => {
55334
55363
  const isAriestoolsSdkJsPackage = (name) => {
55335
55364
  return ARIESTOOLS_SDK_JS_PACKAGES.has(name);
55336
55365
  };
55366
+ /**
55367
+ * Published and private packages from the dapp-kit monorepo
55368
+ * (`@xyo-network/dapp-kit` and `@xyo-network/dapp-kit-*`).
55369
+ * Presence (import or produce) requires the `xl1-dapp-kit` skill.
55370
+ */
55371
+ const isDappKitPackage = (name) => {
55372
+ return name === DAPP_KIT_PACKAGE || name.startsWith(`${DAPP_KIT_PACKAGE}-`);
55373
+ };
55337
55374
  const isUsingXyScripts = (scripts) => {
55338
55375
  if (!scripts) return false;
55339
55376
  return Object.values(scripts).some((script) => /\bxy\b/.test(script));
@@ -55414,15 +55451,19 @@ const detectRepoProfile = (cwd) => {
55414
55451
  const allPackages = [...produced.produces, ...imported.imports];
55415
55452
  const isUsingAriestoolsSdk = allPackages.some(isAriestoolsSdkJsPackage);
55416
55453
  const sdkSignals = isUsingAriestoolsSdk ? allPackages.filter(isAriestoolsSdkJsPackage).toSorted((a, b) => a.localeCompare(b)).map((name) => `sdk-js ${name}`) : [];
55454
+ const isUsingDappKit = allPackages.some(isDappKitPackage);
55455
+ const dappKitSignals = isUsingDappKit ? allPackages.filter(isDappKitPackage).toSorted((a, b) => a.localeCompare(b)).map((name) => `dapp-kit ${name}`) : [];
55417
55456
  const signals = [
55418
55457
  ...produced.signals,
55419
55458
  ...imported.signals,
55420
55459
  ...toolchain.signals,
55421
- ...sdkSignals
55460
+ ...sdkSignals,
55461
+ ...dappKitSignals
55422
55462
  ].toSorted((a, b) => a.localeCompare(b));
55423
55463
  return {
55424
55464
  imports: imported.imports.toSorted((a, b) => a.localeCompare(b)),
55425
55465
  isUsingAriestoolsSdk,
55466
+ isUsingDappKit,
55426
55467
  produces: produced.produces.toSorted((a, b) => a.localeCompare(b)),
55427
55468
  signals,
55428
55469
  tier: resolveTier(produced.produces, imported.imports, toolchain.isUsingToolchain),
@@ -55480,11 +55521,11 @@ const SKILLS_LOCK_FILE = "skills-lock.json";
55480
55521
  const normalizeSkillSource = (source) => {
55481
55522
  return source.trim().replace(/^https?:\/\/github\.com\//i, "").replace(/^github:/i, "").replace(/\.git$/i, "").replace(/\/+$/, "").toLowerCase();
55482
55523
  };
55483
- const isRecord$2 = (value) => {
55524
+ const isRecord$3 = (value) => {
55484
55525
  return typeof value === "object" && value !== null && !Array.isArray(value);
55485
55526
  };
55486
55527
  const parseLockEntry = (value) => {
55487
- if (!isRecord$2(value) || typeof value.source !== "string" || value.source.length === 0) return void 0;
55528
+ if (!isRecord$3(value) || typeof value.source !== "string" || value.source.length === 0) return void 0;
55488
55529
  return {
55489
55530
  computedHash: typeof value.computedHash === "string" ? value.computedHash : void 0,
55490
55531
  skillPath: typeof value.skillPath === "string" ? value.skillPath : void 0,
@@ -55493,7 +55534,7 @@ const parseLockEntry = (value) => {
55493
55534
  };
55494
55535
  };
55495
55536
  const parseSkillsLock = (value) => {
55496
- if (!isRecord$2(value) || !isRecord$2(value.skills)) return void 0;
55537
+ if (!isRecord$3(value) || !isRecord$3(value.skills)) return void 0;
55497
55538
  const skills = {};
55498
55539
  for (const [name, entry] of Object.entries(value.skills)) {
55499
55540
  const parsed = parseLockEntry(entry);
@@ -55533,6 +55574,187 @@ const findUnmigratedSkills = (cwd) => {
55533
55574
  return unmigratedSkillsFromLock(readSkillsLock(cwd));
55534
55575
  };
55535
55576
  //#endregion
55577
+ //#region src/actions/skills/packageSkills.ts
55578
+ const SKILL_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
55579
+ const MAX_SKILL_NAME_LENGTH = 64;
55580
+ const isRecord$2 = (value) => {
55581
+ return typeof value === "object" && value !== null && !Array.isArray(value);
55582
+ };
55583
+ const isSkillName = (name) => {
55584
+ return name.length > 0 && name.length <= MAX_SKILL_NAME_LENGTH && SKILL_NAME_PATTERN.test(name);
55585
+ };
55586
+ const isSkillSource = (source) => {
55587
+ const trimmed = source.trim();
55588
+ if (trimmed.length === 0 || /\s/.test(trimmed)) return false;
55589
+ return /^[^/]+\/[^/]+$/.test(normalizeSkillSource(trimmed));
55590
+ };
55591
+ const readManifest = (filePath) => {
55592
+ if (!existsSync(filePath)) return void 0;
55593
+ try {
55594
+ const value = JSON.parse(readFileSync(filePath, "utf8"));
55595
+ return isRecord$2(value) ? value : void 0;
55596
+ } catch {
55597
+ return;
55598
+ }
55599
+ };
55600
+ const repoPath = (cwd, filePath) => {
55601
+ return PATH.relative(cwd, filePath).split(PATH.sep).join("/");
55602
+ };
55603
+ const findInstalledPackageJson = (fromDir, depName) => {
55604
+ let dir = fromDir;
55605
+ while (true) {
55606
+ const candidate = PATH.join(dir, "node_modules", depName, "package.json");
55607
+ if (existsSync(candidate)) return candidate;
55608
+ const parent = PATH.dirname(dir);
55609
+ if (parent === dir) return void 0;
55610
+ dir = parent;
55611
+ }
55612
+ };
55613
+ const parseSkillEntry = (packageName, file, index, value) => {
55614
+ if (!isRecord$2(value) || typeof value.name !== "string" || !isSkillName(value.name)) return { problem: {
55615
+ file,
55616
+ message: `${packageName} — xy.skills[${index}] must be an object with a skill name`
55617
+ } };
55618
+ const declaredSource = typeof value.source === "string" ? value.source : void 0;
55619
+ if (value.source !== void 0 && (declaredSource == null || !isSkillSource(declaredSource))) return { problem: {
55620
+ file,
55621
+ message: `${packageName} — xy.skills source for ${value.name} must be an owner/repo`
55622
+ } };
55623
+ if (isXyoSkillName(value.name)) {
55624
+ const source = skillSourceForName(value.name);
55625
+ const disagrees = declaredSource != null && normalizeSkillSource(declaredSource) !== normalizeSkillSource(source);
55626
+ return { entry: {
55627
+ file,
55628
+ name: value.name,
55629
+ packageName,
55630
+ source,
55631
+ override: disagrees ? {
55632
+ declaredSource: declaredSource.trim(),
55633
+ file,
55634
+ packageName
55635
+ } : void 0
55636
+ } };
55637
+ }
55638
+ if (declaredSource == null) return { problem: {
55639
+ file,
55640
+ message: `${packageName} — ${value.name} needs a source because it is outside the managed catalog`
55641
+ } };
55642
+ return { entry: {
55643
+ file,
55644
+ name: value.name,
55645
+ packageName,
55646
+ source: declaredSource.trim()
55647
+ } };
55648
+ };
55649
+ const parsePackageSkills = (packageName, file, manifest) => {
55650
+ if (!Object.hasOwn(manifest, "xy")) return {
55651
+ entries: [],
55652
+ problems: []
55653
+ };
55654
+ const xy = manifest.xy;
55655
+ if (!isRecord$2(xy) || !Object.hasOwn(xy, "skills")) return {
55656
+ entries: [],
55657
+ problems: []
55658
+ };
55659
+ if (!Array.isArray(xy.skills)) return {
55660
+ entries: [],
55661
+ problems: [{
55662
+ file,
55663
+ message: `${packageName} — xy.skills must be an array`
55664
+ }]
55665
+ };
55666
+ const entries = [];
55667
+ const problems = [];
55668
+ for (const [index, value] of xy.skills.entries()) {
55669
+ const parsed = parseSkillEntry(packageName, file, index, value);
55670
+ if (parsed.problem != null) problems.push(parsed.problem);
55671
+ if (parsed.entry != null) entries.push(parsed.entry);
55672
+ }
55673
+ return {
55674
+ entries,
55675
+ problems
55676
+ };
55677
+ };
55678
+ const addEntry = (drafts, problems, entry) => {
55679
+ const existing = drafts.get(entry.name);
55680
+ if (existing == null) {
55681
+ drafts.set(entry.name, {
55682
+ conflict: false,
55683
+ name: entry.name,
55684
+ packages: [entry.packageName],
55685
+ source: entry.source,
55686
+ sourceOverrides: entry.override == null ? [] : [entry.override]
55687
+ });
55688
+ return;
55689
+ }
55690
+ if (normalizeSkillSource(existing.source) !== normalizeSkillSource(entry.source)) {
55691
+ existing.conflict = true;
55692
+ problems.push({
55693
+ file: entry.file,
55694
+ message: `${entry.name} — ${existing.packages[0]} recommends source ${existing.source} and ${entry.packageName} recommends source ${entry.source}`
55695
+ });
55696
+ }
55697
+ if (!existing.packages.includes(entry.packageName)) existing.packages.push(entry.packageName);
55698
+ if (entry.override != null) existing.sourceOverrides.push(entry.override);
55699
+ };
55700
+ const absorbManifest = (drafts, problems, packageName, file, manifest) => {
55701
+ const parsed = parsePackageSkills(packageName, file, manifest);
55702
+ problems.push(...parsed.problems);
55703
+ for (const entry of parsed.entries) addEntry(drafts, problems, entry);
55704
+ };
55705
+ const packageNameFromManifest = (manifest, fallback) => {
55706
+ return typeof manifest.name === "string" && manifest.name.length > 0 ? manifest.name : fallback;
55707
+ };
55708
+ const collectWorkspaceRecommendations = (cwd, drafts, problems) => {
55709
+ for (const workspace of listWorkspacesFromFs(cwd)) {
55710
+ const filePath = PATH.resolve(cwd, workspace.location, "package.json");
55711
+ const manifest = readManifest(filePath);
55712
+ if (manifest == null) continue;
55713
+ absorbManifest(drafts, problems, packageNameFromManifest(manifest, workspace.name), repoPath(cwd, filePath), manifest);
55714
+ }
55715
+ };
55716
+ const collectDependencyRecommendations = (cwd, drafts, problems) => {
55717
+ const workspaces = listWorkspacesFromFs(cwd);
55718
+ const workspaceNames = new Set(workspaces.map((workspace) => workspace.name));
55719
+ const locationsByPackage = /* @__PURE__ */ new Map();
55720
+ for (const dep of collectWorkspaceDeps(cwd, workspaces, workspaceNames)) {
55721
+ if (workspaceNames.has(dep.registryName)) continue;
55722
+ const locations = locationsByPackage.get(dep.registryName) ?? [];
55723
+ locations.push(dep.workspaceLocation);
55724
+ locationsByPackage.set(dep.registryName, locations);
55725
+ }
55726
+ for (const [depName, locations] of locationsByPackage) {
55727
+ const filePath = locations.map((location) => findInstalledPackageJson(PATH.resolve(cwd, location), depName)).find((candidate) => candidate != null);
55728
+ if (filePath == null) continue;
55729
+ const manifest = readManifest(filePath);
55730
+ if (manifest == null) continue;
55731
+ absorbManifest(drafts, problems, packageNameFromManifest(manifest, depName), repoPath(cwd, filePath), manifest);
55732
+ }
55733
+ };
55734
+ const finalizeRecommendations = (drafts, problems) => {
55735
+ const skills = drafts.values().filter((draft) => !draft.conflict).map((draft) => ({
55736
+ name: draft.name,
55737
+ packages: draft.packages.toSorted((left, right) => left.localeCompare(right)),
55738
+ source: draft.source,
55739
+ sourceOverrides: draft.sourceOverrides
55740
+ })).toArray().toSorted((left, right) => left.name.localeCompare(right.name));
55741
+ return {
55742
+ problems: problems.toSorted((left, right) => left.message.localeCompare(right.message)),
55743
+ skills
55744
+ };
55745
+ };
55746
+ /**
55747
+ * Skills recommended by workspace packages and direct dependencies through
55748
+ * `package.json` `xy.skills`. Catalog skills keep the toolchain source.
55749
+ */
55750
+ const collectPackageSkillRecommendations = (cwd) => {
55751
+ const drafts = /* @__PURE__ */ new Map();
55752
+ const problems = [];
55753
+ collectWorkspaceRecommendations(cwd, drafts, problems);
55754
+ collectDependencyRecommendations(cwd, drafts, problems);
55755
+ return finalizeRecommendations(drafts, problems);
55756
+ };
55757
+ //#endregion
55536
55758
  //#region src/actions/skills/versions.ts
55537
55759
  const VERSION_PATTERN = /metadata:\s*\n(?:[ \t]+[^\n]+\n)*?[ \t]+version:\s*([^\s#]+)/;
55538
55760
  const upstreamSkillUrl = (skillName) => {
@@ -55592,18 +55814,28 @@ const logInfo = (message) => {
55592
55814
  console.log(chalk.gray(` \u{2139} ${message}`));
55593
55815
  };
55594
55816
  const createSkillInstaller = (cwd) => {
55595
- return async (skillName) => {
55817
+ return async (skillName, source) => {
55596
55818
  return runSkills([
55597
55819
  "add",
55598
- skillSourceForName(skillName),
55820
+ source ?? skillSourceForName(skillName),
55599
55821
  "--skill",
55600
55822
  skillName,
55601
55823
  "-y"
55602
55824
  ], { cwd });
55603
55825
  };
55604
55826
  };
55827
+ const installSkillOnce = (installSkill) => {
55828
+ const installed = /* @__PURE__ */ new Set();
55829
+ return async (skillName, source) => {
55830
+ if (installed.has(skillName)) return 0;
55831
+ const code = await installSkill(skillName, source);
55832
+ if (code === 0) installed.add(skillName);
55833
+ return code;
55834
+ };
55835
+ };
55605
55836
  const missingSkillReason = (profile, skillName) => {
55606
55837
  if (skillName === "ariestools-sdk" && profile.isUsingAriestoolsSdk) return "repo uses packages from ariestools/sdk-js";
55838
+ if (skillName === "xl1-dapp-kit" && profile.isUsingDappKit) return "repo uses dapp-kit packages";
55607
55839
  if (skillName === "xy-toolchain" && profile.isUsingToolchain) return "repo uses @ariestools/toolchain";
55608
55840
  if (profile.additionalSkills?.includes(skillName) === true) return "listed in commands.skillsLint.additionalSkills";
55609
55841
  return "required for repo profile";
@@ -55675,22 +55907,50 @@ const skillDiagnostics = (rule, messages) => {
55675
55907
  rule
55676
55908
  }));
55677
55909
  };
55678
- const installSkills = async (skillNames, installSkill, heading, success) => {
55910
+ const installSkills = async (skills, installSkill, heading, success) => {
55679
55911
  console.log();
55680
55912
  console.log(chalk.gray(heading));
55681
- for (const skillName of skillNames) {
55682
- const code = await installSkill(skillName);
55913
+ for (const skill of skills) {
55914
+ const code = await installSkill(skill.name, skill.source);
55683
55915
  if (code !== 0) return code;
55684
55916
  }
55685
55917
  console.log(chalk.green(success));
55686
55918
  return 0;
55687
55919
  };
55920
+ const packageSkillDiagnostics = (packageSkills, installed) => {
55921
+ const diagnostics = packageSkills.problems.map((problem) => ({
55922
+ file: problem.file,
55923
+ message: problem.message,
55924
+ rule: "skills.package-recommended"
55925
+ }));
55926
+ const missing = [];
55927
+ for (const skill of packageSkills.skills) {
55928
+ for (const override of skill.sourceOverrides) diagnostics.push({
55929
+ file: override.file,
55930
+ level: "warn",
55931
+ message: `${skill.name} — ${override.packageName} declares source ${override.declaredSource}; install from ${skill.source}`,
55932
+ rule: "skills.package-recommended"
55933
+ });
55934
+ if (installed.has(skill.name)) continue;
55935
+ missing.push(skill);
55936
+ }
55937
+ return {
55938
+ diagnostics,
55939
+ missing
55940
+ };
55941
+ };
55942
+ const missingPackageSkillDiagnostics = (missing) => {
55943
+ return missing.map((skill) => ({
55944
+ message: `${skill.name} — missing (recommended by ${skill.packages.join(", ")})`,
55945
+ rule: "skills.package-recommended"
55946
+ }));
55947
+ };
55688
55948
  const SKILLS_LINT_RULES = [
55689
55949
  {
55690
55950
  check: async ({ installSkill, missing, profile }, { fix }) => {
55691
55951
  if (missing.length === 0) return {};
55692
55952
  if (fix) {
55693
- if (await installSkills(missing, installSkill, "Installing missing required skills...", "Missing skills installed. Re-run `xy skills lint` to verify versions.") === 0) return { fixedCount: missing.length };
55953
+ if (await installSkills(missing.map((name) => ({ name })), installSkill, "Installing missing required skills...", "Missing skills installed. Re-run `xy skills lint` to verify versions.") === 0) return { fixedCount: missing.length };
55694
55954
  }
55695
55955
  return { diagnostics: skillDiagnostics("skills.required-installed", missing.map((skillName) => `${skillName} — missing (${missingSkillReason(profile, skillName)})`)) };
55696
55956
  },
@@ -55699,11 +55959,30 @@ const SKILLS_LINT_RULES = [
55699
55959
  fixable: true,
55700
55960
  id: "skills.required-installed"
55701
55961
  },
55962
+ {
55963
+ check: async ({ installSkill, installed, packageSkills }, { fix }) => {
55964
+ const { diagnostics, missing } = packageSkillDiagnostics(packageSkills, installed);
55965
+ if (missing.length === 0) return { diagnostics };
55966
+ if (!fix) return { diagnostics: [...diagnostics, ...missingPackageSkillDiagnostics(missing)] };
55967
+ if (await installSkills(missing.map((skill) => ({
55968
+ name: skill.name,
55969
+ source: skill.source
55970
+ })), installSkill, "Installing skills recommended by packages...", "Package-recommended skills installed. Re-run `xy skills lint` to verify versions.") === 0) return {
55971
+ diagnostics,
55972
+ fixedCount: missing.length
55973
+ };
55974
+ return { diagnostics: [...diagnostics, ...missingPackageSkillDiagnostics(missing)] };
55975
+ },
55976
+ defaultLevel: "error",
55977
+ description: "Skills listed in package.json xy.skills are installed",
55978
+ fixable: true,
55979
+ id: "skills.package-recommended"
55980
+ },
55702
55981
  {
55703
55982
  check: async ({ installSkill, outdated }, { fix }) => {
55704
55983
  if (outdated.length === 0) return {};
55705
55984
  if (fix) {
55706
- if (await installSkills(outdated.map((skill) => skill.name), installSkill, "Updating outdated skills...", "Outdated skills updated. Re-run `xy skills lint` to verify versions.") === 0) return { fixedCount: outdated.length };
55985
+ if (await installSkills(outdated.map((skill) => ({ name: skill.name })), installSkill, "Updating outdated skills...", "Outdated skills updated. Re-run `xy skills lint` to verify versions.") === 0) return { fixedCount: outdated.length };
55707
55986
  }
55708
55987
  return { diagnostics: skillDiagnostics("skills.required-current", outdated.map((skill) => `${skill.name} v${skill.version ?? "unknown"} — outdated (latest ${skill.latest ?? "unknown"})`)) };
55709
55988
  },
@@ -55716,7 +55995,7 @@ const SKILLS_LINT_RULES = [
55716
55995
  check: async ({ installSkill, unmigrated }, { fix }) => {
55717
55996
  if (unmigrated.length === 0) return {};
55718
55997
  if (fix) {
55719
- if (await installSkills(unmigrated.map((skill) => skill.name), installSkill, "Migrating skills to canonical sources...", "Migrated skills reinstalled from ariestools/ariestools-skills. Re-run `xy skills lint` to verify versions.") === 0) return { fixedCount: unmigrated.length };
55998
+ if (await installSkills(unmigrated.map((skill) => ({ name: skill.name })), installSkill, "Migrating skills to canonical sources...", "Migrated skills reinstalled from ariestools/ariestools-skills. Re-run `xy skills lint` to verify versions.") === 0) return { fixedCount: unmigrated.length };
55720
55999
  }
55721
56000
  return { diagnostics: unmigrated.map((skill) => ({
55722
56001
  file: SKILLS_LOCK_FILE,
@@ -55754,12 +56033,14 @@ function logCurrentRequiredSkills(requiredCheck) {
55754
56033
  }
55755
56034
  function logSkillsLintHints(diagnostics) {
55756
56035
  const hasMissingDiagnostic = diagnostics.some((diagnostic) => diagnostic.rule === "skills.required-installed");
56036
+ const hasPackageDiagnostic = diagnostics.some((diagnostic) => diagnostic.rule === "skills.package-recommended" && diagnostic.message.includes("— missing"));
55757
56037
  const hasMigratedDiagnostic = diagnostics.some((diagnostic) => diagnostic.rule === "skills.migrated-source");
55758
56038
  const hasOutdatedDiagnostic = diagnostics.some((diagnostic) => diagnostic.rule === "skills.required-current");
55759
- if (!hasMissingDiagnostic && !hasMigratedDiagnostic && !hasOutdatedDiagnostic) return;
56039
+ if (!hasMissingDiagnostic && !hasPackageDiagnostic && !hasMigratedDiagnostic && !hasOutdatedDiagnostic) return;
55760
56040
  const hints = [];
55761
56041
  const fixReasons = [];
55762
56042
  if (hasMissingDiagnostic) fixReasons.push("install missing required skills");
56043
+ if (hasPackageDiagnostic) fixReasons.push("install skills recommended by packages");
55763
56044
  if (hasMigratedDiagnostic) fixReasons.push("migrate xy-development and xy-toolchain to ariestools-skills");
55764
56045
  if (hasOutdatedDiagnostic) fixReasons.push("update outdated skills");
55765
56046
  if (fixReasons.length > 0) hints.push(`run \`xy skills lint --fix\` to ${fixReasons.join(" and ")}`);
@@ -55787,13 +56068,15 @@ const skillsLint = async (options = {}) => {
55787
56068
  additionalSkills: normalizeAdditionalSkills(config.additionalSkills)
55788
56069
  };
55789
56070
  const required = requiredSkillsForProfile(profile);
55790
- const optional = optionalSkillsForTier(profile.tier);
56071
+ const packageSkills = collectPackageSkillRecommendations(cwd);
56072
+ const recommendedNames = new Set(packageSkills.skills.map((skill) => skill.name));
56073
+ const optional = optionalSkillsForTier(profile.tier).filter((skillName) => !required.includes(skillName) && !recommendedNames.has(skillName));
55791
56074
  const installed = scanInstalledSkills(cwd, projectDirs);
55792
56075
  logProfileHeader(profile);
55793
56076
  const latestVersions = await resolveLatestSkillVersions(collectSkillNamesToCheck(required, installed), options);
55794
56077
  const requiredCheck = checkRequiredSkills(required, installed, latestVersions);
55795
56078
  logCurrentRequiredSkills(requiredCheck);
55796
- const unnecessary = collectUnnecessarySkills(profile, installed);
56079
+ const unnecessary = collectUnnecessarySkills(profile, installed).filter((name) => !recommendedNames.has(name));
55797
56080
  const duplicates = findDuplicateSkills(cwd, globalDir);
55798
56081
  const unmigrated = findUnmigratedSkills(cwd);
55799
56082
  return reportSkillsLintResult(await runRuleChecks({
@@ -55804,9 +56087,11 @@ const skillsLint = async (options = {}) => {
55804
56087
  cwd,
55805
56088
  duplicates,
55806
56089
  globalDir,
55807
- installSkill: options.installSkill ?? createSkillInstaller(cwd),
56090
+ installSkill: installSkillOnce(options.installSkill ?? createSkillInstaller(cwd)),
56091
+ installed,
55808
56092
  missing: requiredCheck.missing,
55809
56093
  outdated: requiredCheck.outdated,
56094
+ packageSkills,
55810
56095
  profile,
55811
56096
  unmigrated,
55812
56097
  unnecessary
@@ -59224,6 +59509,8 @@ Usage:
59224
59509
  Checks:
59225
59510
  - Detect repo tier (xy, xyo, xl1) from package.json and toolchain signals
59226
59511
  - Require ariestools-sdk when packages from ariestools/sdk-js are used
59512
+ - Require xl1-dapp-kit when the repo produces or depends on @xyo-network/dapp-kit packages
59513
+ - Require skills listed in package.json xy.skills on workspace packages and direct dependencies
59227
59514
  - Required skills installed in .claude/skills and/or .agents/skills
59228
59515
  - xy-development and xy-toolchain are locked to ariestools-skills, not xyo-skills
59229
59516
  - Installed skill versions vs upstream main
@@ -62864,7 +63151,7 @@ yargsParser.camelCase = camelCase;
62864
63151
  yargsParser.decamelize = decamelize;
62865
63152
  yargsParser.looksLikeNumber = looksLikeNumber;
62866
63153
  //#endregion
62867
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/utils/process-argv.js
63154
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/utils/process-argv.js
62868
63155
  function getProcessArgvBinIndex() {
62869
63156
  if (isBundledElectronApp()) return 0;
62870
63157
  return 1;
@@ -63142,7 +63429,7 @@ const y18n = (opts) => {
63142
63429
  return y18n$1(opts, node_default);
63143
63430
  };
63144
63431
  //#endregion
63145
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/lib/platform-shims/esm.mjs
63432
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/lib/platform-shims/esm.mjs
63146
63433
  var import_get_caller_file = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
63147
63434
  module.exports = function getCallerFile(position) {
63148
63435
  if (position === void 0) position = 2;
@@ -63206,7 +63493,7 @@ var esm_default = {
63206
63493
  })
63207
63494
  };
63208
63495
  //#endregion
63209
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/typings/common-types.js
63496
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/typings/common-types.js
63210
63497
  function assertNotStrictEqual(actual, expected, shim, message) {
63211
63498
  shim.assert.notStrictEqual(actual, expected, message);
63212
63499
  }
@@ -63217,12 +63504,12 @@ function objectKeys(object) {
63217
63504
  return Object.keys(object);
63218
63505
  }
63219
63506
  //#endregion
63220
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/utils/is-promise.js
63507
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/utils/is-promise.js
63221
63508
  function isPromise(maybePromise) {
63222
63509
  return !!maybePromise && !!maybePromise.then && typeof maybePromise.then === "function";
63223
63510
  }
63224
63511
  //#endregion
63225
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/yerror.js
63512
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/yerror.js
63226
63513
  var YError = class YError extends Error {
63227
63514
  constructor(msg) {
63228
63515
  super(msg || "yargs error");
@@ -63231,7 +63518,7 @@ var YError = class YError extends Error {
63231
63518
  }
63232
63519
  };
63233
63520
  //#endregion
63234
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/parse-command.js
63521
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/parse-command.js
63235
63522
  function parseCommand(cmd) {
63236
63523
  const splitCommand = cmd.replace(/\s{2,}/g, " ").split(/\s+(?![^[]*]|[^<]*>)/);
63237
63524
  const bregex = /\.*[\][<>]/g;
@@ -63258,7 +63545,7 @@ function parseCommand(cmd) {
63258
63545
  return parsedCommand;
63259
63546
  }
63260
63547
  //#endregion
63261
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/argsert.js
63548
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/argsert.js
63262
63549
  const positionName = [
63263
63550
  "first",
63264
63551
  "second",
@@ -63315,7 +63602,7 @@ function argumentTypeError(observedType, allowedTypes, position) {
63315
63602
  throw new YError(`Invalid ${positionName[position] || "manyith"} argument. Expected ${allowedTypes.join(" or ")} but received ${observedType}.`);
63316
63603
  }
63317
63604
  //#endregion
63318
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/middleware.js
63605
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/middleware.js
63319
63606
  var GlobalMiddleware = class {
63320
63607
  constructor(yargs) {
63321
63608
  this.globalMiddleware = [];
@@ -63391,7 +63678,7 @@ function applyMiddleware(argv, yargs, middlewares, beforeValidation) {
63391
63678
  }, argv);
63392
63679
  }
63393
63680
  //#endregion
63394
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/utils/maybe-async-result.js
63681
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/utils/maybe-async-result.js
63395
63682
  function maybeAsyncResult(getResult, resultHandler, errorHandler = (err) => {
63396
63683
  throw err;
63397
63684
  }) {
@@ -63406,7 +63693,7 @@ function isFunction(arg) {
63406
63693
  return typeof arg === "function";
63407
63694
  }
63408
63695
  //#endregion
63409
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/command.js
63696
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/command.js
63410
63697
  const DEFAULT_MARKER = /(^\*)|(^\$0)/;
63411
63698
  var CommandInstance = class {
63412
63699
  constructor(usage, validation, globalMiddleware, shim) {
@@ -63759,7 +64046,7 @@ function isCommandHandlerDefinition(cmd) {
63759
64046
  return typeof cmd === "object" && !Array.isArray(cmd);
63760
64047
  }
63761
64048
  //#endregion
63762
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/utils/obj-filter.js
64049
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/utils/obj-filter.js
63763
64050
  function objFilter(original = {}, filter = () => true) {
63764
64051
  const obj = {};
63765
64052
  objectKeys(original).forEach((key) => {
@@ -63768,7 +64055,7 @@ function objFilter(original = {}, filter = () => true) {
63768
64055
  return obj;
63769
64056
  }
63770
64057
  //#endregion
63771
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/utils/set-blocking.js
64058
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/utils/set-blocking.js
63772
64059
  function setBlocking(blocking) {
63773
64060
  if (typeof process === "undefined") return;
63774
64061
  [process.stdout, process.stderr].forEach((_stream) => {
@@ -63777,7 +64064,7 @@ function setBlocking(blocking) {
63777
64064
  });
63778
64065
  }
63779
64066
  //#endregion
63780
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/usage.js
64067
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/usage.js
63781
64068
  function isBoolean(fail) {
63782
64069
  return typeof fail === "boolean";
63783
64070
  }
@@ -64259,7 +64546,7 @@ function getText(text) {
64259
64546
  return isIndentedText(text) ? text.text : text;
64260
64547
  }
64261
64548
  //#endregion
64262
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/completion-templates.js
64549
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/completion-templates.js
64263
64550
  const completionShTemplate = `###-begin-{{app_name}}-completions-###
64264
64551
  #
64265
64552
  # yargs command completion script
@@ -64310,18 +64597,27 @@ _{{app_name}}_yargs_completions()
64310
64597
  _default
64311
64598
  fi
64312
64599
  }
64313
- if [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then
64600
+ if [[ "\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then
64314
64601
  _{{app_name}}_yargs_completions "$@"
64315
64602
  else
64316
64603
  compdef _{{app_name}}_yargs_completions {{app_name}}
64317
64604
  fi
64318
64605
  ###-end-{{app_name}}-completions-###
64319
64606
  `;
64607
+ const completionFishTemplate = `###-begin-{{app_name}}-completions-###
64608
+ #
64609
+ # yargs command completion script
64610
+ #
64611
+ # Installation: {{app_path}} {{completion_command}} > ~/.config/fish/completions/{{app_name}}.fish
64612
+ #
64613
+ complete -f -c {{app_name}} -a '({{app_path}} --get-yargs-completions (commandline -o)[2..-1])'
64614
+ ###-end-{{app_name}}-completions-###
64615
+ `;
64320
64616
  //#endregion
64321
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/completion.js
64617
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/completion.js
64322
64618
  var Completion = class {
64323
64619
  constructor(yargs, usage, command, shim) {
64324
- var _a, _b, _c;
64620
+ var _a, _b, _c, _d, _e;
64325
64621
  this.yargs = yargs;
64326
64622
  this.usage = usage;
64327
64623
  this.command = command;
@@ -64331,6 +64627,7 @@ var Completion = class {
64331
64627
  this.customCompletionFunction = null;
64332
64628
  this.indexAfterLastReset = 0;
64333
64629
  this.zshShell = (_c = ((_a = this.shim.getEnv("SHELL")) === null || _a === void 0 ? void 0 : _a.includes("zsh")) || ((_b = this.shim.getEnv("ZSH_NAME")) === null || _b === void 0 ? void 0 : _b.includes("zsh"))) !== null && _c !== void 0 ? _c : false;
64630
+ this.fishShell = (_e = (_d = this.shim.getEnv("SHELL")) === null || _d === void 0 ? void 0 : _d.includes("fish")) !== null && _e !== void 0 ? _e : false;
64334
64631
  }
64335
64632
  defaultCompletion(args, argv, current, done) {
64336
64633
  const handlers = this.command.getCommandHandlers();
@@ -64355,11 +64652,10 @@ var Completion = class {
64355
64652
  if (!current.match(/^-/) && parentCommands[parentCommands.length - 1] !== current && !this.previousArgHasChoices(args)) this.usage.getCommands().forEach((usageCommand) => {
64356
64653
  const commandName = parseCommand(usageCommand[0]).cmd;
64357
64654
  if (args.indexOf(commandName) === -1) {
64358
- if (!this.zshShell) completions.push(commandName);
64359
- else {
64360
- const desc = usageCommand[1] || "";
64361
- completions.push(commandName.replace(/:/g, "\\:") + ":" + desc);
64362
- }
64655
+ const desc = usageCommand[1] || "";
64656
+ if (this.fishShell) completions.push(commandName + " " + desc);
64657
+ else if (this.zshShell) completions.push(commandName.replace(/:/g, "\\:") + ":" + desc);
64658
+ else completions.push(commandName);
64363
64659
  }
64364
64660
  });
64365
64661
  }
@@ -64376,7 +64672,10 @@ var Completion = class {
64376
64672
  choicesFromOptionsCompletions(completions, args, argv, current) {
64377
64673
  if (this.previousArgHasChoices(args)) {
64378
64674
  const choices = this.getPreviousArgChoices(args);
64379
- if (choices && choices.length > 0) completions.push(...choices.map((c) => c.replace(/:/g, "\\:")));
64675
+ if (choices && choices.length > 0) {
64676
+ if (this.fishShell) completions.push(...choices);
64677
+ else completions.push(...choices.map((c) => c.replace(/:/g, "\\:")));
64678
+ }
64380
64679
  }
64381
64680
  }
64382
64681
  choicesFromPositionalsCompletions(completions, args, argv, current) {
@@ -64386,7 +64685,10 @@ var Completion = class {
64386
64685
  const positionalKey = positionalKeys[argv._.length - offset - 1];
64387
64686
  if (!positionalKey) return;
64388
64687
  const choices = this.yargs.getOptions().choices[positionalKey] || [];
64389
- for (const choice of choices) if (choice.startsWith(current)) completions.push(choice.replace(/:/g, "\\:"));
64688
+ for (const choice of choices) if (choice.startsWith(current)) {
64689
+ if (this.fishShell) completions.push(choice);
64690
+ else completions.push(choice.replace(/:/g, "\\:"));
64691
+ }
64390
64692
  }
64391
64693
  getPreviousArgChoices(args) {
64392
64694
  if (args.length < 1) return;
@@ -64423,15 +64725,16 @@ var Completion = class {
64423
64725
  completeOptionKey(key, completions, current, negable) {
64424
64726
  var _a, _b, _c, _d;
64425
64727
  let keyWithDesc = key;
64426
- if (this.zshShell) {
64728
+ if (this.zshShell || this.fishShell) {
64427
64729
  const descs = this.usage.getDescriptions();
64428
64730
  const aliasKey = (_b = (_a = this === null || this === void 0 ? void 0 : this.aliases) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.find((alias) => {
64429
64731
  const desc = descs[alias];
64430
64732
  return typeof desc === "string" && desc.length > 0;
64431
64733
  });
64432
64734
  const descFromAlias = aliasKey ? descs[aliasKey] : void 0;
64433
- const desc = (_d = (_c = descs[key]) !== null && _c !== void 0 ? _c : descFromAlias) !== null && _d !== void 0 ? _d : "";
64434
- keyWithDesc = `${key.replace(/:/g, "\\:")}:${desc.replace("__yargsString__:", "").replace(/(\r\n|\n|\r)/gm, " ")}`;
64735
+ const cleanedDesc = ((_d = (_c = descs[key]) !== null && _c !== void 0 ? _c : descFromAlias) !== null && _d !== void 0 ? _d : "").replace("__yargsString__:", "").replace(/(\r\n|\n|\r)/gm, " ");
64736
+ if (this.fishShell) keyWithDesc = `${key}\t${cleanedDesc}`;
64737
+ else keyWithDesc = `${key.replace(/:/g, "\\:")}:${cleanedDesc}`;
64435
64738
  }
64436
64739
  const startsByTwoDashes = (s) => /^--/.test(s);
64437
64740
  const isShortOption = (s) => /^[^0-9]$/.test(s);
@@ -64467,7 +64770,10 @@ var Completion = class {
64467
64770
  return isPromise(argv) ? argv.then(completionFunction) : completionFunction(argv);
64468
64771
  }
64469
64772
  generateCompletionScript($0, cmd) {
64470
- let script = this.zshShell ? completionZshTemplate : completionShTemplate;
64773
+ let script;
64774
+ if (this.zshShell) script = completionZshTemplate;
64775
+ else if (this.fishShell) script = completionFishTemplate;
64776
+ else script = completionShTemplate;
64471
64777
  const name = this.shim.path.basename($0);
64472
64778
  if ($0.match(/\.js$/)) $0 = `./${$0}`;
64473
64779
  script = script.replace(/{{app_name}}/g, name);
@@ -64491,7 +64797,7 @@ function isFallbackCompletionFunction(completionFunction) {
64491
64797
  return completionFunction.length > 3;
64492
64798
  }
64493
64799
  //#endregion
64494
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/utils/levenshtein.js
64800
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/utils/levenshtein.js
64495
64801
  function levenshtein(a, b) {
64496
64802
  if (a.length === 0) return b.length;
64497
64803
  if (b.length === 0) return a.length;
@@ -64506,7 +64812,7 @@ function levenshtein(a, b) {
64506
64812
  return matrix[b.length][a.length];
64507
64813
  }
64508
64814
  //#endregion
64509
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/validation.js
64815
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/validation.js
64510
64816
  const specialKeys = [
64511
64817
  "$0",
64512
64818
  "--",
@@ -64712,7 +65018,7 @@ function validation(yargs, usage, shim) {
64712
65018
  return self;
64713
65019
  }
64714
65020
  //#endregion
64715
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/utils/apply-extends.js
65021
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/utils/apply-extends.js
64716
65022
  let previouslyVisitedConfigs = [];
64717
65023
  let shim;
64718
65024
  function applyExtends(config, cwd, mergeExtends, _shim) {
@@ -64757,7 +65063,7 @@ function mergeDeep(config1, config2) {
64757
65063
  return target;
64758
65064
  }
64759
65065
  //#endregion
64760
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/build/lib/yargs-factory.js
65066
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/build/lib/yargs-factory.js
64761
65067
  var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
64762
65068
  if (kind === "m") throw new TypeError("Private method is not writable");
64763
65069
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -66078,7 +66384,7 @@ function isYargsInstance(y) {
66078
66384
  return !!y && typeof y.getInternalMethods === "function";
66079
66385
  }
66080
66386
  //#endregion
66081
- //#region ../../node_modules/.pnpm/yargs@18.1.0/node_modules/yargs/index.mjs
66387
+ //#region ../../node_modules/.pnpm/yargs@18.2.0/node_modules/yargs/index.mjs
66082
66388
  const Yargs = YargsFactory(esm_default);
66083
66389
  //#endregion
66084
66390
  //#region src/xy/xyParseOptions.ts