@volcengine/ark-cli 1.0.15 → 1.0.16-probe.f12dc606324b

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,65 +1,37 @@
1
1
  {
2
- "version": "1.0.15",
2
+ "version": "1.0.16-probe.f12dc606324b",
3
3
  "platforms": {
4
4
  "darwin-amd64": {
5
- "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.15/arkcli-1.0.15-darwin-amd64",
6
- "sha256": "5a9edac4b67ae933e6c9b2badae25f01c2f4191b302042bae834ebef7899c4d3",
7
- "fallback": {
8
- "url": "https://github.com/volcengine/ark-cli/releases/download/v1.0.15/arkcli-1.0.15-darwin-amd64",
9
- "kind": "github-release"
10
- }
5
+ "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/dev/1.0.16-probe.f12dc606324b/arkcli-1.0.16-probe.f12dc606324b-darwin-amd64",
6
+ "sha256": "f9458493dbddc3d5a9c403632491f422dce63a0e9124c0de70f05ca5cd21ba1d"
11
7
  },
12
8
  "darwin-arm64": {
13
- "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.15/arkcli-1.0.15-darwin-arm64",
14
- "sha256": "f6779ac2270c1f0c747619858de47aa07a60abd2cf0071bdc355f36fde794f07",
15
- "fallback": {
16
- "url": "https://github.com/volcengine/ark-cli/releases/download/v1.0.15/arkcli-1.0.15-darwin-arm64",
17
- "kind": "github-release"
18
- }
9
+ "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/dev/1.0.16-probe.f12dc606324b/arkcli-1.0.16-probe.f12dc606324b-darwin-arm64",
10
+ "sha256": "40a26487e46c9625f5bb3c45e1dbae01c1d290b555ec5d0507b2613307933afd"
19
11
  },
20
12
  "linux-amd64": {
21
- "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.15/arkcli-1.0.15-linux-amd64",
22
- "sha256": "91531abd722f795595e6ae0a6c56ee8bff89a390f24b75828e8071f41d811c39",
23
- "fallback": {
24
- "url": "https://github.com/volcengine/ark-cli/releases/download/v1.0.15/arkcli-1.0.15-linux-amd64",
25
- "kind": "github-release"
26
- }
13
+ "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/dev/1.0.16-probe.f12dc606324b/arkcli-1.0.16-probe.f12dc606324b-linux-amd64",
14
+ "sha256": "d476e276c8ce731d6b535dd4a69585706dae0c948c63bdce04484f82f5dad8ea"
27
15
  },
28
16
  "linux-arm64": {
29
- "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.15/arkcli-1.0.15-linux-arm64",
30
- "sha256": "de38318a67d937bd1c2de0fde4a4009ea61f327a94f7182176b2849b710116b9",
31
- "fallback": {
32
- "url": "https://github.com/volcengine/ark-cli/releases/download/v1.0.15/arkcli-1.0.15-linux-arm64",
33
- "kind": "github-release"
34
- }
17
+ "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/dev/1.0.16-probe.f12dc606324b/arkcli-1.0.16-probe.f12dc606324b-linux-arm64",
18
+ "sha256": "6a4b7c0456396ffb770c3befcca3cd3c34ff608f7446c0e55fadd4a792aba3e2"
35
19
  },
36
20
  "windows-amd64": {
37
- "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.15/arkcli-1.0.15-windows-amd64.exe",
38
- "sha256": "b2277006be2408e938fb272a6cd48d468b166931a3e8c4d9b899785caecbf47e",
39
- "fallback": {
40
- "url": "https://github.com/volcengine/ark-cli/releases/download/v1.0.15/arkcli-1.0.15-windows-amd64.exe",
41
- "kind": "github-release"
42
- }
21
+ "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/dev/1.0.16-probe.f12dc606324b/arkcli-1.0.16-probe.f12dc606324b-windows-amd64.exe",
22
+ "sha256": "359e554f35b8caa84331b8ef16614eaccf44e1e5e2993f08c24f0e31e5dc4794"
43
23
  },
44
24
  "windows-arm64": {
45
- "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.15/arkcli-1.0.15-windows-arm64.exe",
46
- "sha256": "425caa456d088588c9a69041d49be86a9f9f3be034aa295660e31b50572f659c",
47
- "fallback": {
48
- "url": "https://github.com/volcengine/ark-cli/releases/download/v1.0.15/arkcli-1.0.15-windows-arm64.exe",
49
- "kind": "github-release"
50
- }
25
+ "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/dev/1.0.16-probe.f12dc606324b/arkcli-1.0.16-probe.f12dc606324b-windows-arm64.exe",
26
+ "sha256": "4f810feade3cb6f34166d8c16eae3a2538a54e4774812c02574c0d26d291eb8f"
51
27
  }
52
28
  },
53
29
  "skills": {
54
30
  "primary": {
55
- "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prod/1.0.15/skills.tar.gz",
56
- "sha256": "74d3fcc809be0abc0fd27945c9a444eabd074e3947ce3607359741f374810d06",
31
+ "url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/dev/1.0.16-probe.f12dc606324b/skills.tar.gz",
32
+ "sha256": "6e0933ae281a1b962c6c97253d4ac69c3e088026a62339e637cae907ba155b56",
57
33
  "kind": "cdn"
58
34
  },
59
- "tag": "v1.0.15",
60
- "fallback": {
61
- "url": "https://github.com/volcengine/ark-cli/archive/refs/tags/v1.0.15.tar.gz",
62
- "kind": "github"
63
- }
35
+ "tag": "v1.0.16-probe.f12dc606324b"
64
36
  }
65
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volcengine/ark-cli",
3
- "version": "1.0.15",
3
+ "version": "1.0.16-probe.f12dc606324b",
4
4
  "description": "火山方舟 ARK 平台命令行工具",
5
5
  "bin": {
6
6
  "arkcli": "scripts/run.js"
@@ -23,6 +23,38 @@ const https = require("https");
23
23
  const crypto = require("crypto");
24
24
  const { execFileSync } = require("child_process");
25
25
 
26
+ function writeInstallNotice(message, warning = false) {
27
+ const terminal = process.platform === "win32" ? "\\\\.\\CONOUT$" : "/dev/tty";
28
+ let fd = null;
29
+ try {
30
+ fd = fs.openSync(terminal, "w");
31
+ fs.writeSync(fd, `${message}${process.platform === "win32" ? "\r\n" : "\n"}`);
32
+ return;
33
+ } catch (_) {
34
+ (warning ? console.warn : console.log)(message);
35
+ } finally {
36
+ if (fd !== null) {
37
+ try { fs.closeSync(fd); } catch (_) {}
38
+ }
39
+ }
40
+ }
41
+
42
+ function hasInteractiveInstallConsole() {
43
+ if (process.stdout.isTTY || process.stderr.isTTY) return true;
44
+ if (process.platform !== "win32") return false;
45
+ let fd = null;
46
+ try {
47
+ fd = fs.openSync("\\\\.\\CONOUT$", "w");
48
+ return true;
49
+ } catch (_) {
50
+ return false;
51
+ } finally {
52
+ if (fd !== null) {
53
+ try { fs.closeSync(fd); } catch (_) {}
54
+ }
55
+ }
56
+ }
57
+
26
58
  // —— 逃生阀 ——
27
59
  if (process.env.ARKCLI_SKIP_POSTINSTALL === "1") {
28
60
  process.exit(0);
@@ -173,10 +205,79 @@ async function downloadVerifiedBinary(sources, dest, expectedSHA) {
173
205
  );
174
206
 
175
207
  // CI 环境:不下 skill、不 +connect(无 agent 交互场景,且 CI 常无外网),直接收工。
176
- if (process.env.CI === "true" || process.env.CI === "1") {
208
+ if (process.env.CI || process.env.BUILD_NUMBER || process.env.RUN_ID) {
177
209
  process.exit(0);
178
210
  }
179
211
 
212
+ if (process.env.npm_config_global === "true") {
213
+ // Bootstrap provisioning is updater-consumer setup, not an install gate.
214
+ // A failure leaves this exact npm installation usable and automatic
215
+ // mutation disabled; the user can retry later with an explicit reinstall.
216
+ let bootstrapReady = false;
217
+ let bootstrapError;
218
+ if (process.platform === "win32") {
219
+ try {
220
+ execFileSync(binPath, ["_initialize-update-bootstrap"], {
221
+ timeout: 120000,
222
+ stdio: "ignore",
223
+ });
224
+ bootstrapReady = true;
225
+ } catch (err) {
226
+ bootstrapError = err;
227
+ }
228
+ }
229
+ let automaticSupported;
230
+ let mode;
231
+ let policyError;
232
+ if (bootstrapReady && hasInteractiveInstallConsole()) {
233
+ try {
234
+ const supported = execFileSync(
235
+ binPath,
236
+ ["_refresh-update-cache", "--print-automatic-supported"],
237
+ { timeout: 10000, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] },
238
+ ).trim();
239
+ if (supported !== "true" && supported !== "false") {
240
+ throw new Error(`unexpected automatic-update capability ${JSON.stringify(supported)}`);
241
+ }
242
+ automaticSupported = supported === "true";
243
+ if (automaticSupported) {
244
+ mode = execFileSync(
245
+ binPath,
246
+ ["_refresh-update-cache", "--print-mode"],
247
+ { timeout: 10000, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] },
248
+ ).trim();
249
+ }
250
+ } catch (err) {
251
+ policyError = err;
252
+ }
253
+ }
254
+ try {
255
+ execFileSync(binPath, ["_refresh-update-cache"], {
256
+ timeout: 10000,
257
+ stdio: "ignore",
258
+ });
259
+ } catch (_) {}
260
+ if (bootstrapError) {
261
+ writeInstallNotice(
262
+ `@volcengine/ark-cli: recoverable automatic-update bootstrap is unavailable; this install remains notice/manual-only (${bootstrapError.message || bootstrapError})`,
263
+ true,
264
+ );
265
+ } else if (policyError) {
266
+ writeInstallNotice(
267
+ `@volcengine/ark-cli: automatic-update capability could not be confirmed; this install remains notice/manual-only (${policyError.message || policyError})`,
268
+ true,
269
+ );
270
+ } else if (automaticSupported === false) {
271
+ writeInstallNotice("@volcengine/ark-cli: update notices/manual update remain active by default; silent automatic update is not enabled for this product and platform.");
272
+ } else if (mode === "automatic") {
273
+ writeInstallNotice("@volcengine/ark-cli: this reinstall retired the prior automatic binding; run `arkcli config set update.mode automatic` to authorize this exact install again.");
274
+ } else if (mode === "disabled") {
275
+ writeInstallNotice("@volcengine/ark-cli: the disabled update policy was preserved; silent automatic update is not active.");
276
+ } else if (bootstrapReady && automaticSupported) {
277
+ writeInstallNotice("@volcengine/ark-cli: update notices/manual update remain active by default; run `arkcli config set update.mode automatic` to opt in to silent automatic update.");
278
+ }
279
+ }
280
+
180
281
  // —— +connect --refresh:下载最新 skill 到 <pkg>/skills/ 再装进各 agent ——
181
282
  // skill 的下载/解压/校验【收口在 Go 二进制】(internal/skillfs.Refresh),postinstall
182
283
  // 不再自己下 skill。+connect 非交互(自动检测 agent + 全装),有/无 tty 都能跑:有
package/scripts/run.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  // @volcengine/ark-cli npm bin wrapper。
3
- // 二进制不内嵌在包里 —— 由 postinstall 按当前平台从 CDN 下载到 <pkg>/bin/,
4
- // 这里只负责 exec 它。对外只有 arkcli 一个产品,故产品名硬编码。
3
+ // 二进制不内嵌在包里——由 postinstall 按当前平台从 CDN 下载到 <pkg>/bin/,
4
+ // 这里只负责 exec 它。对外只有 arkcli 一个产品,故产品名硬编码。
5
5
  const path = require("path");
6
6
  const fs = require("fs");
7
7
  const { execFileSync } = require("child_process");
@@ -33,5 +33,5 @@ if (!fs.existsSync(binary)) {
33
33
  try {
34
34
  execFileSync(binary, process.argv.slice(2), { stdio: "inherit" });
35
35
  } catch (err) {
36
- process.exit(err.status || 1);
36
+ process.exit(Number.isInteger(err.status) ? err.status : 1);
37
37
  }