@kscs-inc/cli 0.4.0 → 0.4.2

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 CHANGED
@@ -5,11 +5,11 @@
5
5
  ## 安装
6
6
 
7
7
  ```sh
8
- npx @kscs-inc/cli@0.4.0 install
8
+ npx @kscs-inc/cli@0.4.2 install
9
9
  # 国内镜像(同步可能延迟)
10
- npx --registry=https://registry.npmmirror.com @kscs-inc/cli@0.4.0 install
10
+ npx --registry=https://registry.npmmirror.com @kscs-inc/cli@0.4.2 install
11
11
  # 或全局安装入口后显式安装客户端
12
- npm install -g @kscs-inc/cli@0.4.0
12
+ npm install -g @kscs-inc/cli@0.4.2
13
13
  kscs install
14
14
  ```
15
15
 
@@ -27,6 +27,6 @@ kscs products list
27
27
 
28
28
  ## 安全与更新
29
29
 
30
- 入口版本0.4.0固定对应发行目标,验证Ed25519签名及SHA256后调用同一安装事务。客户端自带Node,后续使用kscs update check/status/apply;npm仅更新入口。npm uninstall -g @kscs-inc/cli只删除npm入口,不删除实际客户端、配置和Skill。业务请求直接到公司CLI服务,不经过npm或镜像。
30
+ 入口版本0.4.2固定对应发行目标,验证Ed25519签名及SHA256后调用同一安装事务。客户端自带Node,后续使用kscs update check/status/apply;npm仅更新入口。npm uninstall -g @kscs-inc/cli只删除npm入口,不删除实际客户端、配置和Skill。业务请求直接到公司CLI服务,不经过npm或镜像。
31
31
 
32
32
  如安装中断,保留原客户端与身份,按中文错误提示恢复;不关闭TLS或签名校验。镜像不可用时从npm官方源重试或使用官网安装方式。内联第三方代码许可见THIRD-PARTY-NOTICES.txt。
package/bin/kscs.mjs CHANGED
@@ -1417,6 +1417,10 @@ var ERROR_CATEGORY = {
1417
1417
  INVALID_ARGUMENT: "validation",
1418
1418
  IDEMPOTENCY_KEY_REQUIRED: "validation",
1419
1419
  IDEMPOTENCY_CONFLICT: "validation",
1420
+ CLIENT_REGISTRATION_REQUIRED: "authentication",
1421
+ CLI_AUTH_REQUIRED: "authentication",
1422
+ CLIENT_DISABLED: "authorization",
1423
+ CLIENT_VERSION_UNAVAILABLE: "config",
1420
1424
  AUTH_REQUIRED: "authentication",
1421
1425
  SESSION_REVOKED: "authentication",
1422
1426
  TOKEN_EXPIRED: "authentication",
@@ -1446,6 +1450,7 @@ var ERROR_CATEGORY = {
1446
1450
  INSTALLATION_INCOMPLETE: "internal"
1447
1451
  };
1448
1452
  var HINTS = {
1453
+ REGISTER_CLIENT: "\u91CD\u65B0\u8FD0\u884C\u539F\u547D\u4EE4\u5B8C\u6210\u5BA2\u6237\u7AEF\u767B\u8BB0\uFF1B\u4ECD\u5931\u8D25\u65F6\u63D0\u4F9B\u8BF7\u6C42\u7F16\u53F7\u8054\u7CFB\u7BA1\u7406\u5458\u3002",
1449
1454
  UPGRADE_CLIENT: "\u5148\u5347\u7EA7CLI\u548C\u968F\u5305Skill\u5E76\u6838\u5BF9\u7248\u672C\uFF0C\u518D\u7EE7\u7EED\u5C1A\u672A\u53D1\u9001\u7684\u4EFB\u52A1\uFF1B\u5DF2\u53D1\u9001\u5199\u5165\u53EA\u67E5\u8BE2\u539F\u7ED3\u679C\u3002",
1450
1455
  FIX_INPUT: "\u6309 schema \u5B57\u6BB5\u8BF4\u660E\u4FEE\u6B63\u53C2\u6570\u3002",
1451
1456
  LOGIN: "\u8BF7\u5458\u5DE5\u91CD\u65B0\u5B8C\u6210\u98DE\u4E66\u767B\u5F55\u6388\u6743\u3002",
@@ -1574,7 +1579,7 @@ async function downloadResponse(url, allowLocal, timeoutMs) {
1574
1579
  response = await fetch(target, {
1575
1580
  redirect: "manual",
1576
1581
  signal,
1577
- headers: { "User-Agent": "kscs-node-installer/1" }
1582
+ headers: { "User-Agent": "kscs-node-installer/1", "Cache-Control": "no-cache" }
1578
1583
  });
1579
1584
  } catch (error) {
1580
1585
  const cause = error instanceof Error ? error.cause : void 0;
@@ -1821,9 +1826,11 @@ function validateTarget(value) {
1821
1826
  summary: String(target.summary)
1822
1827
  };
1823
1828
  }
1824
- function validateArtifact(value) {
1829
+ function validateArtifact(value, options2 = {}) {
1825
1830
  const target = validateTarget(value);
1826
1831
  const artifact = jsonObject(value);
1832
+ if (artifact.assembly_only === true && options2.allowAssemblyOnly !== true)
1833
+ throw new Error("\u8DE8\u5E73\u53F0\u51C6\u5907\u5236\u54C1\u4E0D\u80FD\u4F5C\u4E3A\u6B63\u5F0F\u5B89\u88C5\u76EE\u6807");
1827
1834
  if (typeof artifact.url !== "string" || typeof artifact.sha256 !== "string" || !SHA256_PATTERN.test(artifact.sha256) || !Number.isSafeInteger(artifact.size) || Number(artifact.size) <= 0 || Number(artifact.size) > MAX_DOWNLOAD_BYTES || !Array.isArray(artifact.files) || !artifact.files.length || artifact.files.length > MAX_ARCHIVE_FILES)
1828
1835
  throw new Error("\u53D1\u884C\u6E05\u5355\u7F3A\u5C11\u5B8C\u6574\u6027\u6821\u9A8C");
1829
1836
  for (const entry of artifact.files) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kscs-inc/cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "旷世传声 CLI 官方安装入口:中文引导、签名校验、公司客户端安装。",
5
5
  "type": "module",
6
6
  "bin": {
package/release.json CHANGED
@@ -1,79 +1,79 @@
1
1
  {
2
2
  "schema_version": 1,
3
3
  "name": "@kscs-inc/cli",
4
- "version": "0.4.0",
4
+ "version": "0.4.2",
5
5
  "targets": [
6
6
  {
7
7
  "mode": "personal",
8
8
  "platform": "darwin",
9
9
  "arch": "arm64",
10
10
  "channel": "stable",
11
- "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261027-003210-a6be6f68/manifest.json",
12
- "manifest_sha256": "1ab7e67891349798e303b89f305b75ec74a2e0dae49ead8142f4efb923aeec51",
13
- "build_id": "20261027-003210-a6be6f68"
11
+ "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261107-073811-a7d8d53b/manifest.json",
12
+ "manifest_sha256": "a69b265ee2fa76033a9d5afb1ff403c4a39a5588b2a8888f8666569c362015c7",
13
+ "build_id": "20261107-073811-a7d8d53b"
14
14
  },
15
15
  {
16
16
  "mode": "personal",
17
17
  "platform": "darwin",
18
18
  "arch": "x64",
19
19
  "channel": "stable",
20
- "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261027-003218-f6c9db82/manifest.json",
21
- "manifest_sha256": "e4fe53150f2e509be8a94a68e2ff95f3cd47529b1c593dd548665391de4677c0",
22
- "build_id": "20261027-003218-f6c9db82"
20
+ "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261107-073817-ef8220b7/manifest.json",
21
+ "manifest_sha256": "41f2a6dc2cb59b7923f763653be5255b6228e7e56898cbbe50c43a0c9c9fe1f7",
22
+ "build_id": "20261107-073817-ef8220b7"
23
23
  },
24
24
  {
25
25
  "mode": "personal",
26
26
  "platform": "linux",
27
27
  "arch": "arm64",
28
28
  "channel": "stable",
29
- "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261027-003229-d40918cc/manifest.json",
30
- "manifest_sha256": "f5b064923e98e836b4ddc9452556257a2edf121227c70fe3c147a14b4e844ac8",
31
- "build_id": "20261027-003229-d40918cc"
29
+ "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261107-073823-19d9d5bb/manifest.json",
30
+ "manifest_sha256": "d4c44ba9edf215a4c2d4749fca29411c4703235258bc221ccae9b42694d1942d",
31
+ "build_id": "20261107-073823-19d9d5bb"
32
32
  },
33
33
  {
34
34
  "mode": "personal",
35
35
  "platform": "linux",
36
36
  "arch": "x64",
37
37
  "channel": "stable",
38
- "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261027-003236-7cebb69c/manifest.json",
39
- "manifest_sha256": "20fa4cf52b7a362e30f0f9f7b3bf1e630e683b24645ceedffeb5e8f44e062c17",
40
- "build_id": "20261027-003236-7cebb69c"
38
+ "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261107-073829-c05d6b31/manifest.json",
39
+ "manifest_sha256": "c3d529c22262fadd6e4ce2308bd38d90ff353fd58a20619284de1887f746668e",
40
+ "build_id": "20261107-073829-c05d6b31"
41
41
  },
42
42
  {
43
43
  "mode": "personal",
44
44
  "platform": "win32",
45
45
  "arch": "arm64",
46
46
  "channel": "stable",
47
- "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261027-003243-28937214/manifest.json",
48
- "manifest_sha256": "38d45bf0b962308bc79b5e2c6acc8d941217f2586184f117c9cbd9aa1aa1ee7b",
49
- "build_id": "20261027-003243-28937214"
47
+ "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261107-073835-a07fa0c8/manifest.json",
48
+ "manifest_sha256": "2577f849b7cc05ed505486ea12f1212bb54db4081ad760bc94723af954136700",
49
+ "build_id": "20261107-073835-a07fa0c8"
50
50
  },
51
51
  {
52
52
  "mode": "personal",
53
53
  "platform": "win32",
54
54
  "arch": "x64",
55
55
  "channel": "stable",
56
- "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261027-003249-7394c20b/manifest.json",
57
- "manifest_sha256": "572a7940dacc0bade3a3e9cf23fde31fccc2bbef33517ebbdc605d716d791f47",
58
- "build_id": "20261027-003249-7394c20b"
56
+ "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261107-073839-dde1c8bd/manifest.json",
57
+ "manifest_sha256": "998634719fb6583fc61a38b5e1ee06bb607f9fda3a87aacce47f86ff5ebf362c",
58
+ "build_id": "20261107-073839-dde1c8bd"
59
59
  },
60
60
  {
61
61
  "mode": "team",
62
62
  "platform": "linux",
63
63
  "arch": "arm64",
64
64
  "channel": "stable",
65
- "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261027-003255-61679633/manifest.json",
66
- "manifest_sha256": "1d3f672a0c12035e7b313620fc426c12b6d9c0927d3ac8f82407a0960974926f",
67
- "build_id": "20261027-003255-61679633"
65
+ "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261107-073844-3ec49fcc/manifest.json",
66
+ "manifest_sha256": "e7b7857cd74532157419d9b0ba1b03c5efaf364b4199a07897c302bb68678ff6",
67
+ "build_id": "20261107-073844-3ec49fcc"
68
68
  },
69
69
  {
70
70
  "mode": "team",
71
71
  "platform": "linux",
72
72
  "arch": "x64",
73
73
  "channel": "stable",
74
- "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261027-003302-ae379fe0/manifest.json",
75
- "manifest_sha256": "8627a3dd783342d88890d2dc81579fa75cbbfd97eacbbd67eb2997aa001ce9e0",
76
- "build_id": "20261027-003302-ae379fe0"
74
+ "manifest": "https://cli.xaweiju.com/downloads/cli/node/20261107-073849-b6ffee88/manifest.json",
75
+ "manifest_sha256": "b201da94e36631aaa829794ebe8498b30788bdbddccde5efd266bdacbb809dc6",
76
+ "build_id": "20261107-073849-b6ffee88"
77
77
  }
78
78
  ]
79
79
  }
@@ -1 +1 @@
1
- {"algorithm":"Ed25519","key_id":"kscs-release-20261023","payload":"eyJzY2hlbWFfdmVyc2lvbiI6MSwicGF0aCI6Ii9kb3dubG9hZHMvY2xpL25vZGUvbnBtLzAuNC4wL3JlbGVhc2UuanNvbiIsInNoYTI1NiI6ImI0N2NiMDBkY2Y4Y2MzOGI3MzY4ZGFhNTI4NmFhN2MwMWM5NjM4NDZjMmEzOTIxMjNhYWYzMjhlMWM1MTVhMGUiLCJpc3N1ZWRfYXQiOjE3OTMwNjk2MzgsImV4cGlyZXNfYXQiOjE4MjQ2MDU2Mzh9","signature":"ltNXDwF/fmQ4JCbSbAq6zp3SiuwsazEShBI1BYavDkqerWMl+lUEtJZo5jTFO8IGElqd8aVNLj2n3z0KtmbnDA=="}
1
+ {"algorithm":"Ed25519","key_id":"kscs-release-20261023","payload":"eyJzY2hlbWFfdmVyc2lvbiI6MSwicGF0aCI6Ii9kb3dubG9hZHMvY2xpL25vZGUvbnBtLzAuNC4yL3JlbGVhc2UuanNvbiIsInNoYTI1NiI6ImY5ZTU2Yzk1N2UyYzZhNmE2NTdhNjIxZmU2NDk0OGNjY2Y0NTEyZTM4NjVlNjg4NjMxNjFlYWViOTYwN2IzZmQiLCJpc3N1ZWRfYXQiOjE3OTQwMDg3MzQsImV4cGlyZXNfYXQiOjE4MjU1NDQ3MzR9","signature":"9x1CW6rMMWB35gU7+vStyhreNaAOtW3+fiaGcLn0jatZp6mkOJe/ufRTdThAoLRypfLTMgs+3NKZPoQUG+aADw=="}