@yhong91/cpac 0.1.15 → 0.1.16

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/dist/cpac.js +7 -0
  2. package/package.json +1 -1
package/dist/cpac.js CHANGED
@@ -1729,6 +1729,13 @@ export function isKimiConfigInstalled() {
1729
1729
  function writeKimiBlock(path, block) {
1730
1730
  let content = existsSync(path) ? readFileSync(path, "utf8") : "";
1731
1731
  content = content.replace(kimiBlockRegex, "");
1732
+ // A truncated managed block (start marker without the end marker) leaves its
1733
+ // tables behind; appending again would duplicate [providers.cpac], make the
1734
+ // file invalid TOML, and block `kimi login`. The block is always appended
1735
+ // last, so dropping from an orphaned start marker to EOF is safe.
1736
+ const orphan = content.indexOf(KIMI_BLOCK_START);
1737
+ if (orphan !== -1)
1738
+ content = content.slice(0, orphan);
1732
1739
  if (block) {
1733
1740
  content = `${content}${content && !content.endsWith("\n") ? "\n" : ""}${block}\n`;
1734
1741
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yhong91/cpac",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Connect Codex and Claude Code to a remote CLIProxyAPI gateway",
5
5
  "type": "module",
6
6
  "bin": {