harnessed 4.46.0 → 4.47.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
@@ -38,7 +38,7 @@ var init_package = __esm({
38
38
  "package.json"() {
39
39
  package_default = {
40
40
  name: "harnessed",
41
- version: "4.46.0",
41
+ version: "4.47.0",
42
42
  description: "AI coding harness package manager + composition orchestrator",
43
43
  type: "module",
44
44
  license: "Apache-2.0",
@@ -2654,6 +2654,46 @@ var init_safeCwd = __esm({
2654
2654
  }
2655
2655
  });
2656
2656
 
2657
+ // src/installers/lib/codexMcpServers.ts
2658
+ function parseCodexMcpList(stdout2) {
2659
+ const text = stdout2.trim();
2660
+ if (!text.startsWith("[")) return null;
2661
+ try {
2662
+ const parsed = JSON.parse(text);
2663
+ if (!Array.isArray(parsed)) return null;
2664
+ const names = /* @__PURE__ */ new Set();
2665
+ for (const entry of parsed) {
2666
+ if (typeof entry?.name === "string" && entry.name !== "") names.add(entry.name);
2667
+ }
2668
+ return names;
2669
+ } catch {
2670
+ return null;
2671
+ }
2672
+ }
2673
+ function invalidateCodexMcpCache() {
2674
+ cache2 = null;
2675
+ }
2676
+ async function listOnce() {
2677
+ const r = await runHarnessArgs("codex", ["mcp", "list", "--json"], getMcpSpawnCwd(), 3e4);
2678
+ return r.exitCode === 0 ? parseCodexMcpList(r.stdout) : null;
2679
+ }
2680
+ function listCodexMcpServers() {
2681
+ cache2 = cache2 ?? listOnce();
2682
+ return cache2;
2683
+ }
2684
+ async function isCodexMcpServerRegistered(name) {
2685
+ const names = await listCodexMcpServers();
2686
+ return names ? names.has(name) : false;
2687
+ }
2688
+ var cache2;
2689
+ var init_codexMcpServers = __esm({
2690
+ "src/installers/lib/codexMcpServers.ts"() {
2691
+ init_runClaudeArgs();
2692
+ init_safeCwd();
2693
+ cache2 = null;
2694
+ }
2695
+ });
2696
+
2657
2697
  // src/installers/lib/codexPlugins.ts
2658
2698
  function parseCodexPluginList(stdout2) {
2659
2699
  const text = stdout2.trim();
@@ -2676,9 +2716,9 @@ function parseCodexPluginList(stdout2) {
2676
2716
  return ids;
2677
2717
  }
2678
2718
  function invalidateCodexPluginCache() {
2679
- cache2 = null;
2719
+ cache3 = null;
2680
2720
  }
2681
- async function listOnce() {
2721
+ async function listOnce2() {
2682
2722
  const cwd = getMcpSpawnCwd();
2683
2723
  const json2 = await runHarnessArgs("codex", ["plugin", "list", "--json"], cwd, 3e4);
2684
2724
  const fromJson = json2.exitCode === 0 ? parseCodexPluginList(json2.stdout) : null;
@@ -2688,8 +2728,8 @@ async function listOnce() {
2688
2728
  return table.exitCode === 0 ? parseCodexPluginList(table.stdout) : null;
2689
2729
  }
2690
2730
  function listInstalledCodexPlugins() {
2691
- cache2 = cache2 ?? listOnce();
2692
- return cache2;
2731
+ cache3 = cache3 ?? listOnce2();
2732
+ return cache3;
2693
2733
  }
2694
2734
  async function isCodexPluginInstalled(name) {
2695
2735
  const ids = await listInstalledCodexPlugins();
@@ -2703,12 +2743,12 @@ function withCodexPluginLock(fn) {
2703
2743
  lock = run.catch(() => void 0);
2704
2744
  return run;
2705
2745
  }
2706
- var cache2, lock;
2746
+ var cache3, lock;
2707
2747
  var init_codexPlugins = __esm({
2708
2748
  "src/installers/lib/codexPlugins.ts"() {
2709
2749
  init_runClaudeArgs();
2710
2750
  init_safeCwd();
2711
- cache2 = null;
2751
+ cache3 = null;
2712
2752
  lock = Promise.resolve();
2713
2753
  }
2714
2754
  });
@@ -2716,6 +2756,7 @@ function getUserClaudeJsonPath() {
2716
2756
  return getMcpConfigPath();
2717
2757
  }
2718
2758
  async function readUserClaudeJson() {
2759
+ if (detectPlatform().id === "codex") return {};
2719
2760
  const path = getUserClaudeJsonPath();
2720
2761
  let raw;
2721
2762
  try {
@@ -2732,23 +2773,9 @@ async function readUserClaudeJson() {
2732
2773
  return {};
2733
2774
  }
2734
2775
  }
2735
- function isMcpServerInToml(raw, name) {
2736
- const esc = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2737
- const re = new RegExp(`^\\s*\\[mcp_servers\\.(?:${esc}|"${esc}"|'${esc}')(?:\\]|\\.)`, "m");
2738
- return re.test(raw);
2739
- }
2740
2776
  async function isMcpServerRegistered(name) {
2741
2777
  const platform = detectPlatform();
2742
- if (platform.id === "codex") {
2743
- let raw;
2744
- try {
2745
- raw = await readFile(platform.mcpConfigPath, "utf8");
2746
- } catch (err2) {
2747
- if (err2.code === "ENOENT") return false;
2748
- throw err2;
2749
- }
2750
- return isMcpServerInToml(raw, name);
2751
- }
2778
+ if (platform.id === "codex") return isCodexMcpServerRegistered(name);
2752
2779
  const config = await readUserClaudeJson();
2753
2780
  const servers = config.mcpServers;
2754
2781
  if (!servers || typeof servers !== "object") return false;
@@ -2788,6 +2815,7 @@ async function isPluginRegistered(pluginName) {
2788
2815
  var init_readClaudeConfig = __esm({
2789
2816
  "src/installers/lib/readClaudeConfig.ts"() {
2790
2817
  init_platform();
2818
+ init_codexMcpServers();
2791
2819
  init_codexPlugins();
2792
2820
  }
2793
2821
  });
@@ -4678,9 +4706,9 @@ function defaultDeps2() {
4678
4706
  };
4679
4707
  }
4680
4708
  function resolveBash(deps) {
4681
- if (cache3) return cache3;
4682
- cache3 = compute({ ...defaultDeps2(), ...deps });
4683
- return cache3;
4709
+ if (cache4) return cache4;
4710
+ cache4 = compute({ ...defaultDeps2(), ...deps });
4711
+ return cache4;
4684
4712
  }
4685
4713
  function compute(d) {
4686
4714
  if (d.platform !== "win32") {
@@ -4727,12 +4755,12 @@ function compute(d) {
4727
4755
  }
4728
4756
  return { path: "bash", source: "path-fallback" };
4729
4757
  }
4730
- var dirname9, join22, WSL_STUB_RE, cache3;
4758
+ var dirname9, join22, WSL_STUB_RE, cache4;
4731
4759
  var init_resolveBash = __esm({
4732
4760
  "src/installers/lib/resolveBash.ts"() {
4733
4761
  ({ dirname: dirname9, join: join22 } = win32);
4734
4762
  WSL_STUB_RE = /[\\/](windows[\\/](system32|sysnative|syswow64)|microsoft[\\/]windowsapps)[\\/]bash\.exe$/i;
4735
- cache3 = null;
4763
+ cache4 = null;
4736
4764
  }
4737
4765
  });
4738
4766
 
@@ -5395,7 +5423,7 @@ async function checkMcpAvailability() {
5395
5423
  if (keyless.length > 0) {
5396
5424
  const vars = keyless.map((k) => k.envVar).join(" / ");
5397
5425
  fixes.push(
5398
- `set ${vars} in the ~/.claude/settings.json "env" block (e.g. {"env": {"${keyless[0]?.envVar}": "<your-key>"}}) or export it in your shell; a mcpServers.<name>.env entry in ~/.claude.json also works`
5426
+ detectPlatform().id === "codex" ? `export ${vars} in your shell (on codex that is the only source this check can read \u2014 its MCP config is TOML and there is no JSON settings file)` : `set ${vars} in the ~/.claude/settings.json "env" block (e.g. {"env": {"${keyless[0]?.envVar}": "<your-key>"}}) or export it in your shell; a mcpServers.<name>.env entry in ~/.claude.json also works`
5399
5427
  );
5400
5428
  }
5401
5429
  return {
@@ -5409,6 +5437,7 @@ var TARGET_SERVERS, CHECK_NAME;
5409
5437
  var init_check_mcp_availability = __esm({
5410
5438
  "src/cli/lib/check-mcp-availability.ts"() {
5411
5439
  init_readClaudeConfig();
5440
+ init_platform();
5412
5441
  init_search_mcp_keys();
5413
5442
  TARGET_SERVERS = Object.keys(SEARCH_MCP_KEY_VARS);
5414
5443
  CHECK_NAME = "MCP servers (tavily/exa)";
@@ -8097,8 +8126,8 @@ var init_before_spawn = __esm({
8097
8126
  _implCache = /* @__PURE__ */ new Map();
8098
8127
  }
8099
8128
  });
8100
- function isUndefinedVariableError(e) {
8101
- return e instanceof GateEvalError && /undefined variable/i.test(e.message);
8129
+ function isStaticGateConfigError(e) {
8130
+ return e instanceof GateEvalError && STATIC_CONFIG_ERROR.test(e.message);
8102
8131
  }
8103
8132
  function evalGate(expression, context) {
8104
8133
  try {
@@ -8116,7 +8145,7 @@ function evalGate(expression, context) {
8116
8145
  throw new GateEvalError(`Gate eval failed: ${err2.message}`, expression);
8117
8146
  }
8118
8147
  }
8119
- var PARSER_OPTIONS, _parserSingleton, GateEvalError;
8148
+ var PARSER_OPTIONS, _parserSingleton, GateEvalError, STATIC_CONFIG_ERROR;
8120
8149
  var init_exprBuilder = __esm({
8121
8150
  "src/workflow/exprBuilder.ts"() {
8122
8151
  PARSER_OPTIONS = {
@@ -8140,6 +8169,7 @@ var init_exprBuilder = __esm({
8140
8169
  }
8141
8170
  expression;
8142
8171
  };
8172
+ STATIC_CONFIG_ERROR = /undefined variable|cannot read propert(?:y|ies) of (?:undefined|null)|parse error/i;
8143
8173
  }
8144
8174
  });
8145
8175
  var GovernanceStatus, GovernanceV1;
@@ -9337,14 +9367,14 @@ async function runMasterOrchestrator(masterName, context, packageRoot, spawnDriv
9337
9367
  const veto = await resolveSkipVeto(clause.skip_gate, context, packageRoot);
9338
9368
  gateEvalled.push(veto ? { clause, passes: false, reason: veto } : { clause, passes: true });
9339
9369
  } catch (e) {
9340
- if (isUndefinedVariableError(e)) {
9370
+ if (isStaticGateConfigError(e)) {
9341
9371
  console.warn(
9342
- `\u26A0\uFE0F master ${masterName} sub ${clause.sub} gate ${clause.gate} references a variable missing from the gate context (${e.message}). Treating as NOT fired (fail-closed for config errors) \u2014 fix the judgments yaml expression or supply the variable via --context / gateContext defaults.`
9372
+ `\u26A0\uFE0F master ${masterName} sub ${clause.sub} gate ${clause.gate} cannot be evaluated against the gate context (${e.message}). Treating as NOT fired (fail-closed for config errors) \u2014 fix the judgments yaml expression or supply the variable via --context / gateContext defaults.`
9343
9373
  );
9344
9374
  gateEvalled.push({
9345
9375
  clause,
9346
9376
  passes: false,
9347
- reason: `gate ${clause.gate} misconfigured (undefined variable) \u2014 fail-closed, not fired`
9377
+ reason: `gate ${clause.gate} misconfigured (expression/context drift) \u2014 fail-closed, not fired`
9348
9378
  });
9349
9379
  } else {
9350
9380
  console.warn(
@@ -9589,9 +9619,9 @@ async function runWorkflow(yamlPath, vars, opts = {}) {
9589
9619
  try {
9590
9620
  fires = await resolveJudgmentGate(ph.gate, gateContext, packageRoot);
9591
9621
  } catch (err2) {
9592
- if (isUndefinedVariableError(err2)) {
9622
+ if (isStaticGateConfigError(err2)) {
9593
9623
  console.warn(
9594
- `\u26A0\uFE0F phase ${ph.id} gate ${ph.gate} references a variable missing from the gate context (${err2.message}). Treating as NOT fired (fail-closed for config errors) \u2014 fix the judgments yaml expression or supply the variable via --context / gateContext defaults.`
9624
+ `\u26A0\uFE0F phase ${ph.id} gate ${ph.gate} cannot be evaluated against the gate context (${err2.message}) \u2014 a missing variable, \`in\` against a missing/null member, or an unparseable expression. Treating as NOT fired (fail-closed for config errors) \u2014 fix the judgments yaml expression or supply the fact via --context / gateContext defaults.`
9595
9625
  );
9596
9626
  fires = false;
9597
9627
  } else {
@@ -9844,7 +9874,9 @@ function resolveCapabilityCmd(capability, installedPlugins, installedUserSkills,
9844
9874
  anyDetected = true;
9845
9875
  break;
9846
9876
  }
9847
- missingHints.push(`plugin '${plugin_id}' (\`claude plugin install ${plugin_id}\`)`);
9877
+ missingHints.push(
9878
+ host === "codex" ? `plugin '${plugin_id}' is distributed as a Claude Code plugin and this host has no plugin registry \u2014 unavailable here, no install can change that; treat steps that call it as skipped (record the skip) rather than substituting an equivalent` : `plugin '${plugin_id}' (\`claude plugin install ${plugin_id}\`)`
9879
+ );
9848
9880
  } else {
9849
9881
  if (!skill_dir) {
9850
9882
  missingHints.push(
@@ -9897,6 +9929,34 @@ var init_capabilityResolver = __esm({
9897
9929
  CAPABILITY_CMD_TEMPLATE = /\{\{\s*capabilities\.([a-zA-Z0-9_-]+)\.cmd\s*\}\}/g;
9898
9930
  }
9899
9931
  });
9932
+ function userLangPinPath() {
9933
+ return join(detectPlatform().stateRoot, USER_LANG_PIN);
9934
+ }
9935
+ async function writeUserLangPin(code2) {
9936
+ const path = userLangPinPath();
9937
+ await mkdir(detectPlatform().stateRoot, { recursive: true });
9938
+ await writeFile(path, `${code2}
9939
+ `, "utf8");
9940
+ return path;
9941
+ }
9942
+ function readUserLangPin() {
9943
+ let raw;
9944
+ try {
9945
+ raw = readFileSync(userLangPinPath(), "utf8");
9946
+ } catch {
9947
+ return void 0;
9948
+ }
9949
+ const value = raw.trim();
9950
+ return SUPPORTED2.includes(value) ? value : void 0;
9951
+ }
9952
+ var SUPPORTED2, USER_LANG_PIN;
9953
+ var init_userLangPin = __esm({
9954
+ "src/cli/lib/userLangPin.ts"() {
9955
+ init_platform();
9956
+ SUPPORTED2 = ["en", "zh-Hans"];
9957
+ USER_LANG_PIN = "user-lang";
9958
+ }
9959
+ });
9900
9960
 
9901
9961
  // src/cli/prompt.ts
9902
9962
  var prompt_exports = {};
@@ -10017,7 +10077,7 @@ async function renderPreserveCategories(categories, packageRoot, host) {
10017
10077
  }
10018
10078
  }
10019
10079
  async function buildLanguageSection(packageRoot, host = toHostId(detectPlatform().id)) {
10020
- const code2 = process.env.HARNESSED_USER_LANG;
10080
+ const code2 = process.env.HARNESSED_USER_LANG || readUserLangPin();
10021
10081
  if (!code2) return "";
10022
10082
  const name = LANG_NAMES[code2] ?? code2;
10023
10083
  const categories = await renderPreserveCategories(
@@ -10127,6 +10187,7 @@ var init_prompt = __esm({
10127
10187
  init_capabilityResolver();
10128
10188
  init_hostPrimitives();
10129
10189
  init_rolePromptHostRender();
10190
+ init_userLangPin();
10130
10191
  DEFAULT_MAX_ITERATIONS = 20;
10131
10192
  DEFAULT_MODEL = "sonnet";
10132
10193
  DEFAULT_SPECIALIST = "Implementation Engineer";
@@ -10412,13 +10473,13 @@ async function runGatesPlan(master, raw, deps = defaultRunDeps) {
10412
10473
  if (veto) skip.push({ sub: clause.sub, reason: veto });
10413
10474
  else fire.push(fireEntry(clause, master));
10414
10475
  } catch (e) {
10415
- if (isUndefinedVariableError(e)) {
10476
+ if (isStaticGateConfigError(e)) {
10416
10477
  deps.warn(
10417
- `\u26A0\uFE0F master ${master} sub ${clause.sub} gate ${clause.gate} references a variable missing from the gate context (${e.message}). Treating as NOT fired (fail-closed for config errors) \u2014 fix the judgments yaml expression or supply the variable via --context / gateContext defaults.`
10478
+ `\u26A0\uFE0F master ${master} sub ${clause.sub} gate ${clause.gate} cannot be evaluated against the gate context (${e.message}). Treating as NOT fired (fail-closed for config errors) \u2014 fix the judgments yaml expression or supply the variable via --context / gateContext defaults.`
10418
10479
  );
10419
10480
  skip.push({
10420
10481
  sub: clause.sub,
10421
- reason: `gate ${clause.gate} misconfigured (undefined variable) \u2014 fail-closed, not fired`
10482
+ reason: `gate ${clause.gate} misconfigured (expression/context drift) \u2014 fail-closed, not fired`
10422
10483
  });
10423
10484
  } else {
10424
10485
  deps.warn(
@@ -11825,6 +11886,7 @@ var init_mcpHttpAdd2 = __esm({
11825
11886
  init_security();
11826
11887
  init_platform();
11827
11888
  init_backup();
11889
+ init_codexMcpServers();
11828
11890
  init_confirm();
11829
11891
  init_diff();
11830
11892
  init_err();
@@ -11979,9 +12041,11 @@ ${newEntry}
11979
12041
  )
11980
12042
  };
11981
12043
  }
12044
+ if (bin === "codex") invalidateCodexMcpCache();
11982
12045
  const registered = await isMcpServerRegistered(name);
11983
12046
  if (!registered) {
11984
- const cfgLabel = bin === "codex" ? "[mcp_servers] table of ~/.codex/config.toml" : "mcpServers map of ~/.claude.json";
12047
+ const cfgLabel = bin === "codex" ? "the `codex mcp list --json` listing" : "mcpServers map of ~/.claude.json";
12048
+ const cfgHint = bin === "codex" ? "the add reported success but the listing does not show it \u2014 `codex mcp add` may have written under a different CODEX_HOME, or the listing could not be parsed" : `file may have been overwritten, or ${bin} mcp add wrote to a non-default location`;
11985
12049
  return {
11986
12050
  ok: false,
11987
12051
  phase: "verify",
@@ -11989,7 +12053,7 @@ ${newEntry}
11989
12053
  error: err(
11990
12054
  ctx,
11991
12055
  "/spec/verify/cmd",
11992
- `verify: '${name}' not found in ${cfgLabel} after install spawn exit 0 (file may have been overwritten, or ${bin} mcp add wrote to a non-default location)`,
12056
+ `verify: '${name}' not found in ${cfgLabel} after install spawn exit 0 (${cfgHint})`,
11993
12057
  "verify-failed"
11994
12058
  )
11995
12059
  };
@@ -12007,6 +12071,7 @@ var init_mcpStdioAdd2 = __esm({
12007
12071
  init_security();
12008
12072
  init_platform();
12009
12073
  init_backup();
12074
+ init_codexMcpServers();
12010
12075
  init_confirm();
12011
12076
  init_diff();
12012
12077
  init_err();
@@ -12127,9 +12192,11 @@ ${newEntry}
12127
12192
  )
12128
12193
  };
12129
12194
  }
12195
+ if (bin === "codex") invalidateCodexMcpCache();
12130
12196
  const registered = await isMcpServerRegistered(name);
12131
12197
  if (!registered) {
12132
- const cfgLabel = bin === "codex" ? "[mcp_servers] table of ~/.codex/config.toml" : "mcpServers map of ~/.claude.json";
12198
+ const cfgLabel = bin === "codex" ? "the `codex mcp list --json` listing" : "mcpServers map of ~/.claude.json";
12199
+ const cfgHint = bin === "codex" ? "the add reported success but the listing does not show it \u2014 `codex mcp add` may have written under a different CODEX_HOME, or the listing could not be parsed" : `file may have been overwritten, or ${bin} mcp add wrote to a non-default location`;
12133
12200
  return {
12134
12201
  ok: false,
12135
12202
  phase: "verify",
@@ -12137,7 +12204,7 @@ ${newEntry}
12137
12204
  error: err(
12138
12205
  ctx,
12139
12206
  "/spec/verify/cmd",
12140
- `verify: '${name}' not found in ${cfgLabel} after install spawn exit 0 (file may have been overwritten, or ${bin} mcp add wrote to a non-default location)`,
12207
+ `verify: '${name}' not found in ${cfgLabel} after install spawn exit 0 (${cfgHint})`,
12141
12208
  "verify-failed"
12142
12209
  )
12143
12210
  };
@@ -16726,6 +16793,7 @@ async function enableAgentTeamsInSettings() {
16726
16793
  // src/cli/lib/enableUserLangInSettings.ts
16727
16794
  init_platform();
16728
16795
  init_settingsWriter();
16796
+ init_userLangPin();
16729
16797
  var ENV_KEY2 = "HARNESSED_USER_LANG";
16730
16798
  function detectUserLang(override) {
16731
16799
  if (override) {
@@ -16745,13 +16813,17 @@ function safeIntlLocale2() {
16745
16813
  }
16746
16814
  async function enableUserLangInSettings(override) {
16747
16815
  const platform = detectPlatform();
16816
+ const detected = detectUserLang(override);
16748
16817
  if (!platform.supportsEnvKeyWrite) {
16749
- return {
16750
- status: "warn",
16751
- message: `platform '${platform.id}' does not support env-key settings writes (capability-absent) \u2014 ${ENV_KEY2} skipped`
16752
- };
16818
+ try {
16819
+ return { status: "pinned", path: await writeUserLangPin(detected), detected };
16820
+ } catch (e) {
16821
+ return {
16822
+ status: "warn",
16823
+ message: `platform '${platform.id}' has no env-key store and the ${ENV_KEY2} pin could not be written (${e.message})`
16824
+ };
16825
+ }
16753
16826
  }
16754
- const detected = detectUserLang(override);
16755
16827
  const r = await mergeSettingsEnvKey(ENV_KEY2, detected, {
16756
16828
  skipIfPresent: () => override === void 0
16757
16829
  });
@@ -17010,7 +17082,7 @@ var V3_4_3_SIGNATURE_MASTER_RX = /\*\*Preferred path\*\*[\s\S]*dispatch to the p
17010
17082
  function shouldOverwriteFile(content) {
17011
17083
  return HARNESSED_MARKER_RX2.test(content) || V3_4_3_SIGNATURE_SUB_RX.test(content) || V3_4_3_SIGNATURE_MASTER_RX.test(content);
17012
17084
  }
17013
- async function writeAllCommands(slashNames, commandsDir, rolePrompts, capabilities, installedPlugins, installedUserSkills, writer, fileExists2 = existsSync, readFileSync25 = (p8) => readFileSync(p8, "utf8"), hostRender) {
17085
+ async function writeAllCommands(slashNames, commandsDir, rolePrompts, capabilities, installedPlugins, installedUserSkills, writer, fileExists2 = existsSync, readFileSync26 = (p8) => readFileSync(p8, "utf8"), hostRender) {
17014
17086
  const results = [];
17015
17087
  const aggregatedWarnings = /* @__PURE__ */ new Set();
17016
17088
  for (const name of slashNames) {
@@ -17029,7 +17101,7 @@ async function writeAllCommands(slashNames, commandsDir, rolePrompts, capabiliti
17029
17101
  if (fileExists2(path)) {
17030
17102
  let existing = "";
17031
17103
  try {
17032
- existing = readFileSync25(path);
17104
+ existing = readFileSync26(path);
17033
17105
  } catch {
17034
17106
  existing = "";
17035
17107
  }
@@ -17151,6 +17223,7 @@ async function renderSkillFile(skillName, skillsBase, capabilities, installedPlu
17151
17223
  const needsWrite = localeBodySelected || finalBody !== body;
17152
17224
  if (!needsWrite) {
17153
17225
  result.warnings = rendered.warnings;
17226
+ await stripLocaleSiblings(dir);
17154
17227
  return result;
17155
17228
  }
17156
17229
  try {
@@ -17161,17 +17234,18 @@ async function renderSkillFile(skillName, skillsBase, capabilities, installedPlu
17161
17234
  result.error = `write failed: ${e.message}`;
17162
17235
  return result;
17163
17236
  }
17164
- if (localeBodySelected) {
17165
- for (const loc of LOCALE_SIBLINGS) {
17166
- const sibling = skillBodyFilename(loc);
17167
- if (sibling === "SKILL.md") continue;
17168
- try {
17169
- await rm(join(dir, sibling), { force: true });
17170
- } catch {
17171
- }
17237
+ await stripLocaleSiblings(dir);
17238
+ return result;
17239
+ }
17240
+ async function stripLocaleSiblings(dir) {
17241
+ for (const loc of LOCALE_SIBLINGS) {
17242
+ const sibling = skillBodyFilename(loc);
17243
+ if (sibling === "SKILL.md") continue;
17244
+ try {
17245
+ await rm(join(dir, sibling), { force: true });
17246
+ } catch {
17172
17247
  }
17173
17248
  }
17174
- return result;
17175
17249
  }
17176
17250
  async function renderAllSkills(skillNames, skillsBase, workflowsDir, homedirOverride, locale, host) {
17177
17251
  const resolvedLocale = locale ?? getLocale();