blun-king-cli 9.1.461 → 9.1.462

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.
Files changed (2) hide show
  1. package/blun.mjs +10 -4
  2. package/package.json +1 -1
package/blun.mjs CHANGED
@@ -342546,7 +342546,7 @@ function parseTuiConfig(tomlText) {
342546
342546
  }
342547
342547
  async function saveTuiConfig(config, filePath = getTuiConfigPath()) {
342548
342548
  assertConfiguredAppearanceContrast(config);
342549
- await withTuiConfigLock(filePath, () => writeTuiConfigAtomic(config, filePath));
342549
+ return withTuiConfigLock(filePath, () => writeTuiConfigIfChanged(config, filePath));
342550
342550
  }
342551
342551
  async function updateTuiAppearance(appearance, filePath = getTuiConfigPath()) {
342552
342552
  const parsedAppearance = normalizeAppearanceConfig(appearance === void 0 ? void 0 : AppearanceConfigSchema.parse(appearance));
@@ -342567,7 +342567,7 @@ async function updateTuiAppearance(appearance, filePath = getTuiConfigPath()) {
342567
342567
  ...parsedAppearance === void 0 ? { appearance: void 0 } : { appearance: parsedAppearance }
342568
342568
  });
342569
342569
  assertConfiguredAppearanceContrast(next);
342570
- await writeTuiConfigAtomic(next, filePath);
342570
+ await writeTuiConfigIfChanged(next, filePath);
342571
342571
  return next;
342572
342572
  });
342573
342573
  }
@@ -342638,12 +342638,12 @@ async function withTuiConfigLock(filePath, action) {
342638
342638
  await release();
342639
342639
  }
342640
342640
  }
342641
- async function writeTuiConfigAtomic(config, filePath) {
342641
+ async function writeTuiConfigAtomic(config, filePath, rendered = renderTuiConfig(config)) {
342642
342642
  const temporary = join(dirname(filePath), `.${basename(filePath)}.${process.pid}.${randomUUID()}.tmp`);
342643
342643
  const handle = await open(temporary, "wx", 384);
342644
342644
  try {
342645
342645
  try {
342646
- await handle.writeFile(renderTuiConfig(config), "utf-8");
342646
+ await handle.writeFile(rendered, "utf-8");
342647
342647
  await handle.sync();
342648
342648
  } finally {
342649
342649
  await handle.close();
@@ -342654,6 +342654,12 @@ async function writeTuiConfigAtomic(config, filePath) {
342654
342654
  throw error;
342655
342655
  }
342656
342656
  }
342657
+ async function writeTuiConfigIfChanged(config, filePath) {
342658
+ const rendered = renderTuiConfig(config);
342659
+ if (await configFileMatches(filePath, rendered)) return false;
342660
+ await writeTuiConfigAtomic(config, filePath, rendered);
342661
+ return true;
342662
+ }
342657
342663
  function isNotFound$3(error) {
342658
342664
  return typeof error === "object" && error !== null && error.code === "ENOENT";
342659
342665
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.461",
3
+ "version": "9.1.462",
4
4
  "description": "BLUN CLI - your own AI agent with a Telegram channel. Get it done. With BLUN.",
5
5
  "license": "MIT",
6
6
  "bin": {