@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.
- package/README.md +14 -7
- package/assets/codex-skills/zhihu-aiops/SKILL.md +44 -22
- package/assets/codex-skills/zhihu-aiops/references/commands.md +30 -18
- package/assets/codex-skills/zhihu-aiops/references/errors.md +2 -1
- package/assets/codex-skills/zhihu-aiops/references/safety.md +7 -2
- package/dist/cli.js +70 -5
- package/dist/codex-skill.js +50 -8
- package/dist/credentials.js +30 -10
- package/dist/install.js +11 -4
- package/dist/local-runner.js +1717 -0
- package/dist/profile-lock.js +7 -0
- package/dist/release.js +7 -4
- package/package.json +1 -1
package/dist/profile-lock.js
CHANGED
|
@@ -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.
|
|
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.
|
|
10
|
-
export const CLI_DOCTOR_COMMAND = "npx --yes @luckypiggy/zhihu-ai-cli@0.2.1-test.
|
|
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.
|
|
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`;
|