@luckypiggy/zhihu-ai-cli 0.2.1-test.4 → 0.2.1-test.5

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.
@@ -36,6 +36,11 @@ function sleep(milliseconds, signal) {
36
36
  signal?.addEventListener("abort", onAbort, { once: true });
37
37
  });
38
38
  }
39
+ let heldProfileLocks = 0;
40
+ /** Runner installation must not start while any profile lock is held. */
41
+ export function profileLocksHeld() {
42
+ return heldProfileLocks;
43
+ }
39
44
  export function profileLockPath(profile, environment = process.env) {
40
45
  const name = normalizeProfileName(profile);
41
46
  return join(configRoot(environment), "locks", `${name}.lock`);
@@ -75,6 +80,7 @@ export class ProfileLock {
75
80
  closeSync(descriptor);
76
81
  }
77
82
  this.held = true;
83
+ heldProfileLocks += 1;
78
84
  return () => this.release();
79
85
  }
80
86
  catch (error) {
@@ -92,6 +98,7 @@ export class ProfileLock {
92
98
  if (!this.held)
93
99
  return;
94
100
  this.held = false;
101
+ heldProfileLocks = Math.max(0, heldProfileLocks - 1);
95
102
  try {
96
103
  const raw = JSON.parse(readFileSync(this.path, "utf8"));
97
104
  if (raw.nonce !== this.nonce)
package/dist/release.js CHANGED
@@ -4,10 +4,10 @@
4
4
  * cannot accidentally advertise a different runner or marker version.
5
5
  */
6
6
  export const CLI_PACKAGE_NAME = "@luckypiggy/zhihu-ai-cli";
7
- export const CLI_VERSION = "0.2.1-test.4";
7
+ export const CLI_VERSION = "0.2.1-test.5";
8
8
  /** Runner used by the canonical package and offline deliveries. */
9
- export const CLI_RUNNER = "npx --yes @luckypiggy/zhihu-ai-cli@0.2.1-test.4";
10
- export const CLI_DOCTOR_COMMAND = "npx --yes @luckypiggy/zhihu-ai-cli@0.2.1-test.4 doctor";
9
+ export const CLI_RUNNER = "npx --yes @luckypiggy/zhihu-ai-cli@0.2.1-test.5";
10
+ export const CLI_DOCTOR_COMMAND = "npx --yes @luckypiggy/zhihu-ai-cli@0.2.1-test.5 doctor";
11
11
  /** Build a user-facing command from the runner for the current package. */
12
12
  export function cliCommand(...arguments_) {
13
13
  return [CLI_RUNNER, ...arguments_].join(" ");
@@ -16,9 +16,12 @@ export function cliCommand(...arguments_) {
16
16
  * The public smoke-test package is intentionally version-pinned. A floating
17
17
  * dist-tag would make an installed Skill non-reproducible and could silently
18
18
  * change the command that Codex executes later.
19
+ *
20
+ * This constant is the next unpublished candidate. npm dist-tag `test` still
21
+ * points at 0.2.1-test.4 until that candidate is published in a separate step.
19
22
  */
20
23
  export const PUBLIC_TEST_PACKAGE_NAME = "@luckypiggy/zhihu-ai-cli";
21
- export const PUBLIC_TEST_PACKAGE_VERSION = "0.2.1-test.4";
24
+ export const PUBLIC_TEST_PACKAGE_VERSION = "0.2.1-test.5";
22
25
  export const PUBLIC_TEST_DIST_TAG = "test";
23
26
  export const PUBLIC_TEST_RUNNER = `npx --yes ${PUBLIC_TEST_PACKAGE_NAME}@${PUBLIC_TEST_PACKAGE_VERSION}`;
24
27
  export const PUBLIC_TEST_DOCTOR_COMMAND = `${PUBLIC_TEST_RUNNER} doctor`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luckypiggy/zhihu-ai-cli",
3
- "version": "0.2.1-test.4",
3
+ "version": "0.2.1-test.5",
4
4
  "description": "智护 Pilot CLI:认证、数字员工、资产、指标、告警、指定告警诊断和巡检只读能力(P1 Read-only)",
5
5
  "keywords": [
6
6
  "zhihu-pilot",