@byteplus/ark-cli 1.0.23 → 1.0.24-prerelease.a31151ece5fc

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/manifest.json CHANGED
@@ -1,72 +1,43 @@
1
1
  {
2
2
  "package": "@byteplus/ark-cli",
3
- "version": "1.0.23",
3
+ "version": "1.0.24-prerelease.a31151ece5fc",
4
4
  "platforms": {
5
5
  "darwin-amd64": {
6
6
  "kind": "cdn",
7
- "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.23/arkcli-1.0.23-darwin-amd64",
8
- "sha256": "af933680ddbfcaf54f5e64300e4ba97e9b5fde9dbf35420581f4806a3ccf9d9e",
9
- "fallback": {
10
- "kind": "github-release",
11
- "url": "https://github.com/byteplus-sdk/ark-cli/releases/download/v1.0.23/arkcli-1.0.23-darwin-amd64"
12
- }
7
+ "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.24-prerelease.a31151ece5fc/arkcli-1.0.24-prerelease.a31151ece5fc-darwin-amd64",
8
+ "sha256": "22be4dbf4b9524f4008209103db1a8976bff365710f99fc510ec2fa08005e72f"
13
9
  },
14
10
  "darwin-arm64": {
15
11
  "kind": "cdn",
16
- "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.23/arkcli-1.0.23-darwin-arm64",
17
- "sha256": "1f6c7fcd22553125d3740dfebd474acf74f2914ab415b63888e279d5fe3a5f88",
18
- "fallback": {
19
- "kind": "github-release",
20
- "url": "https://github.com/byteplus-sdk/ark-cli/releases/download/v1.0.23/arkcli-1.0.23-darwin-arm64"
21
- }
12
+ "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.24-prerelease.a31151ece5fc/arkcli-1.0.24-prerelease.a31151ece5fc-darwin-arm64",
13
+ "sha256": "46fa1351bf97fc32f41ea944483cfcb377d68b57cf3f44e61fde8669744ed314"
22
14
  },
23
15
  "linux-amd64": {
24
16
  "kind": "cdn",
25
- "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.23/arkcli-1.0.23-linux-amd64",
26
- "sha256": "5200a35712169e5b905e9faa544ff64cf1383a0416a0d648ee6a98589a5a8028",
27
- "fallback": {
28
- "kind": "github-release",
29
- "url": "https://github.com/byteplus-sdk/ark-cli/releases/download/v1.0.23/arkcli-1.0.23-linux-amd64"
30
- }
17
+ "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.24-prerelease.a31151ece5fc/arkcli-1.0.24-prerelease.a31151ece5fc-linux-amd64",
18
+ "sha256": "1b3df858fc4720422919f6990e817136648182ee64302cc7834ee098af13a7d6"
31
19
  },
32
20
  "linux-arm64": {
33
21
  "kind": "cdn",
34
- "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.23/arkcli-1.0.23-linux-arm64",
35
- "sha256": "e80ad2ca3fd69e8276e5f96a9582db1c34aa34140342d047f5e5bec4e8c63f46",
36
- "fallback": {
37
- "kind": "github-release",
38
- "url": "https://github.com/byteplus-sdk/ark-cli/releases/download/v1.0.23/arkcli-1.0.23-linux-arm64"
39
- }
22
+ "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.24-prerelease.a31151ece5fc/arkcli-1.0.24-prerelease.a31151ece5fc-linux-arm64",
23
+ "sha256": "ce33c9c5aa7b1665e007244cf75791e1e57aec3d0611b1f285d6696f4c517191"
40
24
  },
41
25
  "windows-amd64": {
42
26
  "kind": "cdn",
43
- "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.23/arkcli-1.0.23-windows-amd64.exe",
44
- "sha256": "8fba624d4324f4b4c03f6d7a3db845eebb55f2d891d4724d3be6e3499e1c7c4b",
45
- "fallback": {
46
- "kind": "github-release",
47
- "url": "https://github.com/byteplus-sdk/ark-cli/releases/download/v1.0.23/arkcli-1.0.23-windows-amd64.exe"
48
- }
27
+ "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.24-prerelease.a31151ece5fc/arkcli-1.0.24-prerelease.a31151ece5fc-windows-amd64.exe",
28
+ "sha256": "5fd239257ee0bde7ba5c3875b9fbad02bb7906a372f4b213f6ab968f04e37d4e"
49
29
  },
50
30
  "windows-arm64": {
51
31
  "kind": "cdn",
52
- "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.23/arkcli-1.0.23-windows-arm64.exe",
53
- "sha256": "1e882487033e786e9791c0c1ca87e1599b352273ed8e11388cbd7879233b6962",
54
- "fallback": {
55
- "kind": "github-release",
56
- "url": "https://github.com/byteplus-sdk/ark-cli/releases/download/v1.0.23/arkcli-1.0.23-windows-arm64.exe"
57
- }
32
+ "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.24-prerelease.a31151ece5fc/arkcli-1.0.24-prerelease.a31151ece5fc-windows-arm64.exe",
33
+ "sha256": "7ccc553c6209acbf7532482a3ce2b186042e709262ad7ed840e018a4a423b21f"
58
34
  }
59
35
  },
60
36
  "skills": {
61
37
  "primary": {
62
38
  "kind": "cdn",
63
- "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.23/skills.tar.gz",
64
- "sha256": "8800e119b044e1112a22296fc941f7bce950c88675616b98bfa297ffee07c5d7"
65
- },
66
- "tag": "v1.0.23",
67
- "fallback": {
68
- "kind": "github",
69
- "url": "https://github.com/byteplus-sdk/ark-cli/archive/refs/tags/v1.0.23.tar.gz"
39
+ "url": "https://sf16-sg.tiktokcdn.com/obj/eden-sg/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.24-prerelease.a31151ece5fc/skills.tar.gz",
40
+ "sha256": "8ff1121f3cb979eac195b78ffc13f30c3f71962bfa0695de643233033b414028"
70
41
  }
71
42
  }
72
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byteplus/ark-cli",
3
- "version": "1.0.23",
3
+ "version": "1.0.24-prerelease.a31151ece5fc",
4
4
  "description": "BytePlus Ark command-line interface",
5
5
  "bin": {
6
6
  "arkcli": "scripts/run.js"
@@ -264,25 +264,45 @@ function download(
264
264
  });
265
265
  const output = fs.createWriteStream(destination, { flags: "wx", mode: 0o600 });
266
266
  pipeline(response, limiter, output, (err) => {
267
- if (err) {
268
- rejectOnce(err);
269
- } else if (received === 0) {
270
- rejectOnce(new Error(`${kind} returned an empty binary`));
271
- } else {
272
- resolveOnce();
267
+ const settleAfterOutputClose = () => {
268
+ if (err) {
269
+ rejectOnce(err);
270
+ } else if (received === 0) {
271
+ rejectOnce(new Error(`${kind} returned an empty binary`));
272
+ } else {
273
+ resolveOnce();
274
+ }
275
+ };
276
+ if (output.closed) {
277
+ settleAfterOutputClose();
278
+ return;
273
279
  }
280
+ // On Windows, pipeline's callback can run before the underlying file
281
+ // handle has emitted close. Do not let the fallback remove or reuse the
282
+ // abandoned destination until the OS has released that handle.
283
+ output.once("close", settleAfterOutputClose);
274
284
  });
275
285
  });
276
286
  wallTimer = setTimeout(() => {
277
287
  const err = new Error(`${kind} exceeded the total download deadline`);
278
- if (activeResponse !== null) activeResponse.destroy(err);
288
+ if (activeResponse !== null) {
289
+ // The pipeline callback owns settlement after a response has started.
290
+ // Waiting for it guarantees the destination stream is closed before the
291
+ // caller removes the abandoned file, which Windows requires.
292
+ activeResponse.destroy(err);
293
+ request.destroy(err);
294
+ return;
295
+ }
279
296
  request.destroy(err);
280
297
  rejectOnce(err);
281
298
  }, remaining);
282
299
  request.setTimeout(Math.min(DEFAULT_DOWNLOAD_TIMEOUT_MS, remaining), () => {
283
300
  request.destroy(new Error(`${kind} download timed out`));
284
301
  });
285
- request.on("error", rejectOnce);
302
+ request.on("error", (err) => {
303
+ if (activeResponse !== null) return;
304
+ rejectOnce(err);
305
+ });
286
306
  });
287
307
  }
288
308
 
@@ -477,8 +497,12 @@ async function install() {
477
497
  writeInstallNotice(`${PACKAGE_NAME}: silent stable patch updates are enabled by default for this new install; the first human command will not update. Disable with \`arkcli config set update.mode disabled\`.`);
478
498
  } else if (enrollmentPhase === "manual_reinstall_suspended") {
479
499
  writeInstallNotice(`${PACKAGE_NAME}: a manual npm install or version change was detected, so silent automatic updates are paused. Keep this version with \`arkcli config set update.mode disabled\`; resume with \`arkcli config set update.mode automatic\`.`);
480
- } else if (enrollmentPhase === "disabled" || mode === "disabled") {
481
- writeInstallNotice(`${PACKAGE_NAME}: the disabled update policy was preserved; update notices remain active and silent automatic update is not active.`);
500
+ } else if (enrollmentPhase === "disabled" || mode === "disabled" || mode === "notify") {
501
+ if (mode === "notify") {
502
+ writeInstallNotice(`${PACKAGE_NAME}: the legacy notify-only update policy was preserved; silent automatic update is not active. Resume with \`arkcli config set update.mode automatic\`.`);
503
+ } else {
504
+ writeInstallNotice(`${PACKAGE_NAME}: the disabled update policy was preserved; update notices remain active and silent automatic update is not active.`);
505
+ }
482
506
  } else if (enrollmentPhase === "grace_completed") {
483
507
  writeInstallNotice(`${PACKAGE_NAME}: first-run grace is complete; the next successful human command only activates exact-install consent and will not update immediately. Disable with \`arkcli config set update.mode disabled\`.`);
484
508
  } else if (enrollmentPhase === "automatic_active") {