@nggaigc/cli 0.1.0 → 0.1.1

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/dist/bin.js CHANGED
@@ -11,7 +11,7 @@ const errorMessages = {
11
11
  ARCHIVE_EXTRACTION_FAILED: "安装包无法安全解压,请稍后重试。",
12
12
  BROWSER_AUTHORIZATION_FAILED: "浏览器授权未完成,请重新运行安装命令。",
13
13
  CONNECTION_VERIFICATION_FAILED: "设备连接验证失败,请重新运行安装命令。",
14
- INSTALLATION_FAILED: "本地安装未完成,已有文件不会被静默覆盖。",
14
+ INSTALLATION_FAILED: "本地安装未完成,请重试;现有文件未被修改。",
15
15
  INVALID_INPUT: "命令格式无效。请仅运行:npx --yes @nggaigc/cli@latest install",
16
16
  PACKAGE_VERIFICATION_FAILED: "安装包签名或完整性验证失败,已停止安装。",
17
17
  RUNTIME_UNSUPPORTED: "请使用 Node.js 22.13 或更高的 22.x 版本。",
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.1.zip";
21
+ const archiveName = "nggaigc-plugin-1.1.2.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.1" ||
60
+ manifestValue.version !== "1.1.2" ||
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,7 +8,7 @@ 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.1.zip"),
11
+ archive: path.join(vendor, "nggaigc-plugin-1.1.2.zip"),
12
12
  manifest: path.join(vendor, "manifest.json"),
13
13
  trust: path.join(vendor, "trusted-keys.json"),
14
14
  };
@@ -50,10 +50,11 @@ async function installedVersion(target) {
50
50
  return undefined;
51
51
  }
52
52
  }
53
- async function installSkill(installer, source, profile, expectedVersion, bundleFiles) {
54
- const target = path.join(profile, ".agents", "skills", "nggaigc");
53
+ async function installSkill(installer, source, profile, codexHome, expectedVersion, bundleFiles) {
54
+ const target = path.join(codexHome, "skills", "nggaigc");
55
55
  try {
56
56
  const result = await installer.main(["install", "--profile", profile], {
57
+ codexHome,
57
58
  source,
58
59
  });
59
60
  if (result.status !== "installed" || result.version !== expectedVersion)
@@ -74,6 +75,7 @@ async function installSkill(installer, source, profile, expectedVersion, bundleF
74
75
  }
75
76
  try {
76
77
  const result = await installer.main(["update", "--profile", profile], {
78
+ codexHome,
77
79
  source,
78
80
  });
79
81
  if (result.status !== "updated" || result.version !== expectedVersion)
@@ -135,6 +137,7 @@ function assertDisposableRoot(value, expectedParent) {
135
137
  export async function runInstall(options = {}) {
136
138
  validateRuntime(options.platform ?? process.platform, options.architecture ?? process.arch);
137
139
  const profile = safeProfile(options.profile ?? os.homedir());
140
+ const codexHome = safeProfile(options.codexHome ?? process.env.CODEX_HOME ?? path.join(profile, ".codex"));
138
141
  const report = options.reporter ?? (() => undefined);
139
142
  report("verifying");
140
143
  const bundle = await verifyBundle(options.bundle ?? defaultBundle());
@@ -150,8 +153,8 @@ export async function runInstall(options = {}) {
150
153
  const installer = require(path.join(extracted, "installer", "install.cjs"));
151
154
  if (!installer || typeof installer.main !== "function")
152
155
  throw new CliError("INSTALLATION_FAILED");
153
- const installation = await installSkill(installer, path.join(extracted, "skills", "nggaigc"), profile, bundle.version, bundle.files);
154
- const installedScripts = path.join(profile, ".agents", "skills", "nggaigc", "scripts");
156
+ const installation = await installSkill(installer, path.join(extracted, "skills", "nggaigc"), profile, codexHome, bundle.version, bundle.files);
157
+ const installedScripts = path.join(codexHome, "skills", "nggaigc", "scripts");
155
158
  const launcher = require(path.join(installedScripts, "launch-ngg-client.cjs"));
156
159
  if (!launcher ||
157
160
  typeof launcher.main !== "function" ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nggaigc/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Secure one-command NGGAIGC Skill installer for Codex on Windows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,30 +1,30 @@
1
1
  {
2
2
  "schemaVersion": "nggaigc-plugin-package/v1",
3
3
  "artifactId": "plugin.nggaigc",
4
- "version": "1.1.1",
5
- "sourceCommit": "6d6869feb01c935f16250beca0d269eef41a4eaa",
6
- "artifactPath": "packages/plugins/nggaigc-plugin-1.1.1.zip",
7
- "sha256": "f4371dcbfb58d003699ce854472d1a2cb356976c69db633f90b929bae2863bda",
8
- "sizeBytes": 106658,
4
+ "version": "1.1.2",
5
+ "sourceCommit": "c5d94b4d264ffc5b4465ebe697fe4d21de711bc9",
6
+ "artifactPath": "packages/plugins/nggaigc-plugin-1.1.2.zip",
7
+ "sha256": "1d706fb3638f075520d250b156e78c3a81a21057e6dc19f5626acfa39b3178af",
8
+ "sizeBytes": 33024,
9
9
  "fileCount": 11,
10
10
  "platforms": ["win32-x64", "win32-arm64"],
11
11
  "files": {
12
- ".codex-plugin/plugin.json": "705fd28fa3bd4b9ced198cad482bcf7af65144c368b8abcd6aa1504a47b2d25e",
13
- "installer/install.cjs": "79b0b610965211dd2faf3f569d93d4f5f84b1055fc2bd11483bfdaf413edea10",
12
+ ".codex-plugin/plugin.json": "cf293fefbf769030f5fcb96d0768b11778c8050c4730e7ca729a8a1d47559053",
13
+ "installer/install.cjs": "54e379c7e9fe1af7b9907887300f6d530095b77d44fccea124c8203380100842",
14
14
  "skills/nggaigc/agents/openai.yaml": "4a71357d3904a2dc69b8b495f7c2f83f01d0a3c231558d7d0f10c46cd98aa301",
15
15
  "skills/nggaigc/references/catalog-and-updates.md": "c0ee74bfe9b75dc8ee818f2db55d4fd7d581927ec037452b5971c9b3a9412e93",
16
- "skills/nggaigc/references/source.json": "e315fb2f4fe35ce4fefb2c1bed60bb464cc764c3a7c69e3f3c70b7ca8a623051",
17
- "skills/nggaigc/scripts/bootstrap-public.json": "ce699de3afa18941cbf9964a4e20b493a3a631f0edc1e0017a45668a9bee21a9",
18
- "skills/nggaigc/scripts/launch-ngg-client.cjs": "ab96625cd10194172c18c225ba8eff0e27f1680d826ae6578645f63bcd252146",
19
- "skills/nggaigc/scripts/ngg_client.mjs": "252d652b8f853fd0e610deb74a924f2143f7d17e4a34f9d35ee2bbcd800c7011",
20
- "skills/nggaigc/scripts/ngg-session.mjs": "5cdcdbcf25b4852b66346f29dc8f77837bda7f680ce97f0ff1d33dc404dfb752",
16
+ "skills/nggaigc/references/source.json": "6e928eb1868aa24585bd5976e47dbaebda072b55ec4e70df7cd3935b886f3a43",
17
+ "skills/nggaigc/scripts/bootstrap-public.json": "c22d41c4bc87c8118e0479354529663a5b404d75ed37aaf4473a4e388d948bb9",
18
+ "skills/nggaigc/scripts/launch-ngg-client.cjs": "9a8d51b04ef11174f618e7683c5e11ebe0d8bdb16010203f2cf68a53c8c6b088",
19
+ "skills/nggaigc/scripts/ngg_client.mjs": "fd084fbd2223d9aef8f87107b46bde137fea974a011f7e1bf88262869f633669",
20
+ "skills/nggaigc/scripts/ngg-session.mjs": "966202d5599291b8031d87082da368e5dda86ce6cfe1c5003488a42614335ded",
21
21
  "skills/nggaigc/scripts/windows-credential.ps1": "8b6e323bebd3f86f19e0c2ae5366f4dc68005d57c07d6f699aece366661be6a0",
22
- "skills/nggaigc/SKILL.md": "5545ed96d9ab9facc241b0e6d2a18800e693d012190f08037134e9930d21fa8e"
22
+ "skills/nggaigc/SKILL.md": "3287487b20ffbbd2806ef514f9958390fa2feebce519c190788a500c79a340f2"
23
23
  },
24
24
  "signature": {
25
25
  "algorithm": "ed25519",
26
26
  "keyId": "ngg-signing-skill-release-1",
27
27
  "scope": "artifact-bytes",
28
- "value": "yN8E8C4SfPMSZiOaBI4rDFJKb7EIU+5m2+dKEDGHNn/f/15xOLGiYjS0kCRoCGEDneG4GhpgF1gpX1sL/AeqDg=="
28
+ "value": "AymFZmaUtNXG11z+XmLla9MI92pqSjjLpVWsJJjp1nfLJD6DLtQcgMCts4lhS4i9EFy3k6RfAXeWfjvI0UmjAw=="
29
29
  }
30
30
  }
Binary file
Binary file