@nggaigc/cli 0.1.2 → 0.1.4

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 ADDED
@@ -0,0 +1,11 @@
1
+ # @nggaigc/cli
2
+
3
+ NGGAIGC Codex Skill 的 Windows 一命令安装器。
4
+
5
+ ```powershell
6
+ npx --yes @nggaigc/cli@latest install
7
+ ```
8
+
9
+ 安装器会先验证内置 Plugin 的 Ed25519 签名、归档哈希和逐文件哈希,再原子安装 Skill。首次运行会打开 NGGAIGC 浏览器授权页;浏览器仅接收短期连接挑战,安装器通过内存中的独立轮询凭据获取连接结果,设备凭据只通过标准输入进入 Windows Credential Manager。安装器不接受 API Key、授权码或设备凭据参数,也不从环境变量读取这些值。
10
+
11
+ 当前候选支持 Windows x64/arm64,自动使用当前 Node.js 22.x(22.13 起)或 24.x。两个版本使用同一个安装包和同一套代码,不下载或内嵌 Node.js;其他主版本暂不支持。
package/dist/bin.js CHANGED
@@ -16,7 +16,7 @@ const errorMessages = {
16
16
  INSTALLATION_FAILED: "本地安装未完成,请重试;现有文件未被修改。",
17
17
  INVALID_INPUT: "命令格式无效。请仅运行:npx --yes @nggaigc/cli@latest install",
18
18
  PACKAGE_VERIFICATION_FAILED: "安装包签名或完整性验证失败,已停止安装。",
19
- RUNTIME_UNSUPPORTED: "请使用 Node.js 22.13 或更高的 22.x 版本。",
19
+ RUNTIME_UNSUPPORTED: "请使用 Node.js 22.x(22.13 起)或 24.x 版本。",
20
20
  UNSUPPORTED_PLATFORM: "当前候选仅支持 Windows x64 或 Windows arm64。",
21
21
  };
22
22
  export async function main(args) {
package/dist/bundle.js CHANGED
@@ -18,7 +18,7 @@ const manifestKeys = [
18
18
  "version",
19
19
  ];
20
20
  const signatureKeys = ["algorithm", "keyId", "scope", "value"];
21
- const archiveName = "nggaigc-plugin-1.1.3.zip";
21
+ const archiveName = "nggaigc-plugin-1.1.5.zip";
22
22
  const trustedKeyId = "ngg-signing-skill-release-1";
23
23
  const trustedKeySpkiSha256 = "3d7450a1a26785d900be03e52b4b7d0b2e84fe4e4fcb6f2e903c1371b0b96cee";
24
24
  function record(value) {
@@ -57,7 +57,7 @@ export async function verifyBundle(input) {
57
57
  !exactKeys(manifestValue, manifestKeys) ||
58
58
  manifestValue.schemaVersion !== "nggaigc-plugin-package/v1" ||
59
59
  manifestValue.artifactId !== "plugin.nggaigc" ||
60
- manifestValue.version !== "1.1.3" ||
60
+ manifestValue.version !== "1.1.5" ||
61
61
  manifestValue.artifactPath !== `packages/plugins/${archiveName}` ||
62
62
  typeof manifestValue.sourceCommit !== "string" ||
63
63
  !/^[a-f0-9]{40}$/.test(manifestValue.sourceCommit) ||
package/dist/install.js CHANGED
@@ -8,14 +8,14 @@ import { CliError, fixedErrorCode } from "./errors.js";
8
8
  function defaultBundle() {
9
9
  const vendor = fileURLToPath(new URL("../vendor/", import.meta.url));
10
10
  return {
11
- archive: path.join(vendor, "nggaigc-plugin-1.1.3.zip"),
11
+ archive: path.join(vendor, "nggaigc-plugin-1.1.5.zip"),
12
12
  manifest: path.join(vendor, "manifest.json"),
13
13
  trust: path.join(vendor, "trusted-keys.json"),
14
14
  };
15
15
  }
16
16
  function validateRuntime(platform, architecture) {
17
17
  const [major, minor] = process.versions.node.split(".").map(Number);
18
- if (major !== 22 || (minor ?? 0) < 13)
18
+ if (!((major === 22 && (minor ?? 0) >= 13) || major === 24))
19
19
  throw new CliError("RUNTIME_UNSUPPORTED");
20
20
  if (platform !== "win32")
21
21
  throw new CliError("UNSUPPORTED_PLATFORM");
@@ -111,12 +111,19 @@ async function connect(launcher, options, report, probe) {
111
111
  }
112
112
  if (!configured) {
113
113
  report("launching");
114
+ const interruptController = new AbortController();
115
+ const interrupt = () => interruptController.abort();
116
+ process.once("SIGINT", interrupt);
114
117
  try {
115
118
  const upstreamBrowserOpened = typeof options?.browserOpened === "function"
116
119
  ? options.browserOpened
117
120
  : undefined;
121
+ const upstreamSignal = options?.signal;
118
122
  const result = await launcher.main(["login"], {
119
123
  ...options,
124
+ signal: upstreamSignal
125
+ ? AbortSignal.any([upstreamSignal, interruptController.signal])
126
+ : interruptController.signal,
120
127
  browserOpened: () => {
121
128
  upstreamBrowserOpened?.();
122
129
  report("authorizing");
@@ -133,6 +140,9 @@ async function connect(launcher, options, report, probe) {
133
140
  throw new CliError("BROWSER_OPEN_FAILED");
134
141
  throw new CliError("BROWSER_AUTHORIZATION_FAILED");
135
142
  }
143
+ finally {
144
+ process.off("SIGINT", interrupt);
145
+ }
136
146
  }
137
147
  report("connected");
138
148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nggaigc/cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Secure one-command NGGAIGC Skill installer for Codex on Windows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,7 @@
12
12
  "vendor/"
13
13
  ],
14
14
  "engines": {
15
- "node": ">=22.13.0 <23"
15
+ "node": ">=22.13.0 <23 || >=24.0.0 <25"
16
16
  },
17
17
  "os": [
18
18
  "win32"
@@ -24,7 +24,7 @@
24
24
  "scripts": {
25
25
  "build": "tsc -p tsconfig.build.json",
26
26
  "prepack": "tsc -p tsconfig.build.json && node scripts/stage-assets.mjs",
27
- "test": "vitest run --exclude 'dist/**' --exclude 'src/windows-secure-store.integration.test.ts'",
27
+ "test": "vitest run src --exclude 'src/windows-secure-store.integration.test.ts'",
28
28
  "test:credential:os": "tsc -p tsconfig.build.json && vitest run src/windows-secure-store.integration.test.ts",
29
29
  "typecheck": "tsc -p tsconfig.json --noEmit"
30
30
  },
@@ -1,33 +1,30 @@
1
1
  {
2
2
  "schemaVersion": "nggaigc-plugin-package/v1",
3
3
  "artifactId": "plugin.nggaigc",
4
- "version": "1.1.3",
5
- "sourceCommit": "14842952f8e8f98b08877543b4465efd70eea03a",
6
- "artifactPath": "packages/plugins/nggaigc-plugin-1.1.3.zip",
7
- "sha256": "7000ba048a5e81c6e5863e3c45764a33f6084f11069dc29101f7064001554524",
8
- "sizeBytes": 114409,
4
+ "version": "1.1.5",
5
+ "sourceCommit": "0bdd7f286d33147cdc0c85c7774f782f1373a8e9",
6
+ "artifactPath": "packages/plugins/nggaigc-plugin-1.1.5.zip",
7
+ "sha256": "f516ff626222987c4e9a76afd865822f1ebcce2d3aa2d2bf125fe2c662540950",
8
+ "sizeBytes": 112167,
9
9
  "fileCount": 11,
10
- "platforms": [
11
- "win32-x64",
12
- "win32-arm64"
13
- ],
10
+ "platforms": ["win32-x64", "win32-arm64"],
14
11
  "files": {
15
- ".codex-plugin/plugin.json": "ab6a0ca539d051556d9ef626091d4062dd82cd9fb436c719746cad70ef8e4236",
16
- "installer/install.cjs": "d4e03432a23f01019e65ff5c322dfb18ffc8fcf4979666af581190d6e56862f9",
17
- "skills/nggaigc/SKILL.md": "0def06e6b06564c7d55640b5eaf6e05fb071785ad89cb1b667e422c12e784c21",
12
+ ".codex-plugin/plugin.json": "3efb8c28bd95b0041febdc886487c6e543d156e4607de0ae678a580c21dacd8a",
13
+ "installer/install.cjs": "34f4196d59a911f983311b0a79192b23112cdeeb5455cb57609f121bb3e55ea8",
18
14
  "skills/nggaigc/agents/openai.yaml": "4a71357d3904a2dc69b8b495f7c2f83f01d0a3c231558d7d0f10c46cd98aa301",
19
15
  "skills/nggaigc/references/catalog-and-updates.md": "c0ee74bfe9b75dc8ee818f2db55d4fd7d581927ec037452b5971c9b3a9412e93",
20
- "skills/nggaigc/references/source.json": "2a2e13120ea5a44d0f39797ea6bd4c9c3c4cb1cfc4750f9de01ea61a2c8300cb",
21
- "skills/nggaigc/scripts/bootstrap-public.json": "c32c19cd556aa1096bd341d25ac35724f9a38fbaca825e81122afcd63ff8ec44",
22
- "skills/nggaigc/scripts/launch-ngg-client.cjs": "a1a457af61bd5ca3cca15777d3f6147c83de8312e67d43309212e5baa7512451",
23
- "skills/nggaigc/scripts/ngg-session.mjs": "03c748a419b42010834ad5c0c564d2dd73702d8feb672d3530f1761b67ff670b",
24
- "skills/nggaigc/scripts/ngg_client.mjs": "b5702493708875274ec6ad7061c1aee4aff733f0f65680f21d39b357f10b892e",
25
- "skills/nggaigc/scripts/windows-credential.ps1": "8b6e323bebd3f86f19e0c2ae5366f4dc68005d57c07d6f699aece366661be6a0"
16
+ "skills/nggaigc/references/source.json": "6dea5c5cac921526b11593be481496d521cec81d8278a10f49edab2b6efadc94",
17
+ "skills/nggaigc/scripts/bootstrap-public.json": "9e43dcf830c9984e79609faf65ca19cfe5824964b576c4a9540263d0339c3cbb",
18
+ "skills/nggaigc/scripts/launch-ngg-client.cjs": "18c5e016baa4242ccba84fee419a4b017d138b4e71fbab04ab608197afecf630",
19
+ "skills/nggaigc/scripts/ngg_client.mjs": "04e875a78b139f8ee9105bd6230e9c7188e5ca549de5972cfc356f2cea0739ee",
20
+ "skills/nggaigc/scripts/ngg-session.mjs": "166628ccb1ba8cd844de03f76296179eb0ae1480da7ec66e280d1bf88d5363cb",
21
+ "skills/nggaigc/scripts/windows-credential.ps1": "8b6e323bebd3f86f19e0c2ae5366f4dc68005d57c07d6f699aece366661be6a0",
22
+ "skills/nggaigc/SKILL.md": "b07da5a3f78e4370301a87ceace7c26034a100631b651cdada65bf566f277ead"
26
23
  },
27
24
  "signature": {
28
25
  "algorithm": "ed25519",
29
26
  "keyId": "ngg-signing-skill-release-1",
30
27
  "scope": "artifact-bytes",
31
- "value": "mW5dDyO1xfTFDYjGLuYuzYfgrq5foJvukCTd8+GOyCrlxBLgc+uVndv+EBHlqrnPLhCkDX8x/XlzQf9fro+WDA=="
28
+ "value": "kNgGmwu+UD8JwsJ4GzGTp21pF5SsGg/7nQXDPlBQTWwbg3tpxnJef5/o4GNUDzWus6DtOHKRdFce4gUsSRVpBg=="
32
29
  }
33
30
  }
index ad548fa..b7a076c 100644
Binary file