@topolo/cli 0.13.5 → 0.13.6

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/index.js +20 -7
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -124,7 +124,7 @@ import { platform as platform2 } from "os";
124
124
  import { createInterface } from "readline/promises";
125
125
  import { stdin as input } from "process";
126
126
 
127
- // node_modules/@topolo/sdk/dist/index.js
127
+ // node_modules/.pnpm/@topolo+sdk@0.23.19/node_modules/@topolo/sdk/dist/index.js
128
128
  function record(value) {
129
129
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
130
130
  }
@@ -3734,10 +3734,10 @@ async function pollUntilApproved(params) {
3734
3734
  throw new Error("Device code expired. Run `topolo auth login` again.");
3735
3735
  }
3736
3736
 
3737
- // node_modules/@topolo/sdk/dist/node/credential-store.js
3737
+ // node_modules/.pnpm/@topolo+sdk@0.23.19/node_modules/@topolo/sdk/dist/node/credential-store.js
3738
3738
  import { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2, chmod as chmod2, lstat, readdir as readdir2, rename as rename2, link } from "fs/promises";
3739
- import { existsSync as existsSync2, lstatSync, readdirSync, readFileSync as readFileSync2, openSync, writeFileSync, fsyncSync, closeSync, renameSync, unlinkSync, rmdirSync } from "fs";
3740
- import { randomUUID as randomUUID2 } from "crypto";
3739
+ import { existsSync as existsSync2, mkdirSync, lstatSync, readdirSync, readFileSync as readFileSync2, openSync, writeFileSync, fsyncSync, closeSync, renameSync, unlinkSync, rmdirSync, linkSync } from "fs";
3740
+ import { createHash as createHash2, randomUUID as randomUUID2 } from "crypto";
3741
3741
  import { homedir as homedir2, platform } from "os";
3742
3742
  import { dirname as dirname2, join as join3 } from "path";
3743
3743
  import { createHash, randomUUID } from "crypto";
@@ -4608,20 +4608,33 @@ var ConfigOwnershipError = class extends TopoloSdkError2 {
4608
4608
  super("state_conflict", "Credential configuration ownership cannot be verified. Retain the unresolved operation instead of starting another renewal.");
4609
4609
  }
4610
4610
  };
4611
+ function lockEntryExists(path) {
4612
+ try {
4613
+ lstatSync(path);
4614
+ return true;
4615
+ } catch (error) {
4616
+ if (error.code === "ENOENT") return false;
4617
+ throw new ConfigOwnershipError();
4618
+ }
4619
+ }
4611
4620
  async function withConfigWriteLock(operation) {
4612
4621
  const lockPath = `${configPath()}.lock`;
4613
4622
  await mkdir2(dirname2(lockPath), { recursive: true });
4614
4623
  const startedAt = performance.now();
4615
4624
  while (true) {
4616
4625
  try {
4626
+ if (lockEntryExists(lockPath + ".reconcile")) throw Object.assign(new Error(), { code: "EEXIST" });
4617
4627
  await mkdir2(lockPath, { mode: 448 });
4628
+ if (lockEntryExists(lockPath + ".reconcile")) {
4629
+ throw new ConfigOwnershipError();
4630
+ }
4618
4631
  break;
4619
4632
  } catch (error) {
4620
4633
  if (error.code !== "EEXIST") throw error;
4621
4634
  if (performance.now() - startedAt >= CONFIG_LOCK_TIMEOUT_MS) {
4622
4635
  throw new TopoloSdkError2("state_conflict", "Credential configuration is still held or unresolved. This waiter did not dispatch a renewal.");
4623
4636
  }
4624
- await new Promise((resolve4) => setTimeout(resolve4, CONFIG_LOCK_RETRY_MS));
4637
+ await new Promise((resolve22) => setTimeout(resolve22, CONFIG_LOCK_RETRY_MS));
4625
4638
  }
4626
4639
  }
4627
4640
  const directory = await lstat(lockPath);
@@ -4632,7 +4645,7 @@ async function withConfigWriteLock(operation) {
4632
4645
  await writeFile2(markerPath, marker, { flag: "wx", mode: 384 });
4633
4646
  const assertDirectory = async () => {
4634
4647
  const current = await lstat(lockPath);
4635
- if (!current.isDirectory() || current.isSymbolicLink() || current.dev !== directory.dev || current.ino !== directory.ino)
4648
+ if (lockEntryExists(lockPath + ".reconcile") || !current.isDirectory() || current.isSymbolicLink() || current.dev !== directory.dev || current.ino !== directory.ino)
4636
4649
  throw new ConfigOwnershipError();
4637
4650
  };
4638
4651
  const assertOwned = async () => {
@@ -4649,7 +4662,7 @@ async function withConfigWriteLock(operation) {
4649
4662
  };
4650
4663
  const assertDirectorySync = () => {
4651
4664
  const current = lstatSync(lockPath);
4652
- if (!current.isDirectory() || current.isSymbolicLink() || current.dev !== directory.dev || current.ino !== directory.ino)
4665
+ if (lockEntryExists(lockPath + ".reconcile") || !current.isDirectory() || current.isSymbolicLink() || current.dev !== directory.dev || current.ino !== directory.ino)
4653
4666
  throw new ConfigOwnershipError();
4654
4667
  };
4655
4668
  const assertOwnedSync = () => {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@topolo/cli",
3
3
  "packageManager": "pnpm@10.17.1",
4
- "version": "0.13.5",
5
- "topoloPublishedVersion": "0.13.5",
4
+ "version": "0.13.6",
5
+ "topoloPublishedVersion": "0.13.6",
6
6
  "description": "Public command-line interface for Topolo customer organizations, developers, and agents.",
7
7
  "license": "UNLICENSED",
8
8
  "author": "Topolo",
@@ -31,8 +31,8 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@modelcontextprotocol/sdk": "^1.0.0",
34
- "@topolo/mcp": "0.14.23",
35
- "@topolo/sdk": "0.23.18",
34
+ "@topolo/mcp": "0.14.24",
35
+ "@topolo/sdk": "0.23.19",
36
36
  "commander": "^12.1.0",
37
37
  "undici": "6.29.0"
38
38
  },