@nggaigc/cli 0.1.37 → 0.1.39

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/bundle.js CHANGED
@@ -47,7 +47,7 @@ export async function verifyBundle(input) {
47
47
  !exactKeys(manifestValue, manifestKeys) ||
48
48
  manifestValue.schemaVersion !== "nggaigc-plugin-package/v1" ||
49
49
  manifestValue.artifactId !== "plugin.nggaigc" ||
50
- manifestValue.version !== "1.1.36" ||
50
+ manifestValue.version !== "1.1.38" ||
51
51
  manifestValue.artifactPath !==
52
52
  `packages/plugins/nggaigc-plugin-${manifestValue.version}.zip` ||
53
53
  typeof manifestValue.sourceCommit !== "string" ||
@@ -304,6 +304,55 @@ function storedZipEntries(input) {
304
304
  fail("PACKAGE_VERIFICATION_FAILED");
305
305
  return result;
306
306
  }
307
+ function packageFileType(value) {
308
+ if (value === "SKILL.md" ||
309
+ /^references\/[A-Za-z0-9._/-]+\.(md|json)$/.test(value))
310
+ return "document";
311
+ if (/^assets\/[A-Za-z0-9._/-]+\.png$/.test(value))
312
+ return "png";
313
+ return undefined;
314
+ }
315
+ function validStaticPng(input) {
316
+ const bytes = Buffer.from(input);
317
+ if (bytes.length < 45 ||
318
+ !bytes.subarray(0, 8).equals(Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a])))
319
+ return false;
320
+ let cursor = 8;
321
+ let chunks = 0;
322
+ let hasImageData = false;
323
+ while (cursor + 12 <= bytes.length) {
324
+ const length = bytes.readUInt32BE(cursor);
325
+ const end = cursor + 12 + length;
326
+ if (end > bytes.length)
327
+ return false;
328
+ const type = bytes.subarray(cursor + 4, cursor + 8);
329
+ if (!/^[A-Za-z]{4}$/.test(type.toString("ascii")))
330
+ return false;
331
+ if (crc32(bytes.subarray(cursor + 4, cursor + 8 + length)) !==
332
+ bytes.readUInt32BE(cursor + 8 + length))
333
+ return false;
334
+ const name = type.toString("ascii");
335
+ if (chunks === 0) {
336
+ if (name !== "IHDR" ||
337
+ length !== 13 ||
338
+ bytes.readUInt32BE(cursor + 8) === 0 ||
339
+ bytes.readUInt32BE(cursor + 12) === 0 ||
340
+ bytes[cursor + 18] !== 0 ||
341
+ bytes[cursor + 19] !== 0 ||
342
+ (bytes[cursor + 20] !== 0 && bytes[cursor + 20] !== 1))
343
+ return false;
344
+ }
345
+ if (name === "acTL" || name === "fcTL" || name === "fdAT")
346
+ return false;
347
+ if (name === "IDAT")
348
+ hasImageData = true;
349
+ if (name === "IEND")
350
+ return length === 0 && hasImageData && end === bytes.length;
351
+ chunks++;
352
+ cursor = end;
353
+ }
354
+ return false;
355
+ }
307
356
  function decodePackage(bytes, entry, trust) {
308
357
  const metadata = entry.manifest.package;
309
358
  if (bytes.length !== metadata.sizeBytes ||
@@ -361,8 +410,7 @@ function decodePackage(bytes, entry, trust) {
361
410
  file.path
362
411
  .split("/")
363
412
  .some((part) => !part || part === "." || part === ".." || /[. ]$/.test(part)) ||
364
- !(file.path === "SKILL.md" ||
365
- /^references\/[A-Za-z0-9._/-]+\.(md|json)$/.test(file.path)))
413
+ !packageFileType(file.path))
366
414
  fail("PACKAGE_VERIFICATION_FAILED");
367
415
  const folded = file.path.toLowerCase();
368
416
  if (seen.has(folded) ||
@@ -377,7 +425,8 @@ function decodePackage(bytes, entry, trust) {
377
425
  total += content.length;
378
426
  if (total > MAX_PACKAGE_BYTES ||
379
427
  content.length !== file.sizeBytes ||
380
- sha256(content) !== file.sha256)
428
+ sha256(content) !== file.sha256 ||
429
+ (packageFileType(file.path) === "png" && !validStaticPng(content)))
381
430
  fail("PACKAGE_VERIFICATION_FAILED");
382
431
  }
383
432
  if (!seen.has("skill.md") || archive.size !== payload.files.length + 1)
@@ -461,8 +510,7 @@ async function existingReceipt(target, entry, trust) {
461
510
  ].sort()))
462
511
  return false;
463
512
  for (const [name, digest] of Object.entries(receipt.files)) {
464
- if (!(name === "SKILL.md" ||
465
- /^references\/[A-Za-z0-9._/-]+\.(md|json)$/.test(name)) ||
513
+ if (!packageFileType(name) ||
466
514
  name.split("/").some((part) => part === "." || part === ".."))
467
515
  return false;
468
516
  const file = path.join(target, ...name.split("/"));
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.36.zip"),
11
+ archive: path.join(vendor, "nggaigc-plugin-1.1.38.zip"),
12
12
  manifest: path.join(vendor, "manifest.json"),
13
13
  trust: path.join(vendor, "trusted-keys.json"),
14
14
  };
@@ -15,7 +15,7 @@ function record(value) {
15
15
  async function productionDependencies(codexHome) {
16
16
  const vendor = fileURLToPath(new URL("../vendor/", import.meta.url));
17
17
  const bundle = await verifyBundle({
18
- archive: path.join(vendor, "nggaigc-plugin-1.1.36.zip"),
18
+ archive: path.join(vendor, "nggaigc-plugin-1.1.38.zip"),
19
19
  manifest: path.join(vendor, "manifest.json"),
20
20
  trust: path.join(vendor, "trusted-keys.json"),
21
21
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nggaigc/cli",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
4
4
  "description": "Secure one-command NGGAIGC Skill installer for Codex.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "schemaVersion": "nggaigc-plugin-package/v1",
3
3
  "artifactId": "plugin.nggaigc",
4
- "version": "1.1.36",
5
- "sourceCommit": "6f8b05505e5823d90d962be2d7b7ff1913d19d62",
6
- "artifactPath": "packages/plugins/nggaigc-plugin-1.1.36.zip",
7
- "sha256": "3221ab354d9ac540ab54133faabf2561913afa989bb92bbba22dfca456b02ba8",
8
- "sizeBytes": 483026,
4
+ "version": "1.1.38",
5
+ "sourceCommit": "9510ed872ea6a4ae2747fe759f093700a865a199",
6
+ "artifactPath": "packages/plugins/nggaigc-plugin-1.1.38.zip",
7
+ "sha256": "f62d297058c9647a1e7a429e0851ff076ac2266dee817d33a1c923704f9459bd",
8
+ "sizeBytes": 483669,
9
9
  "fileCount": 24,
10
10
  "platforms": [
11
11
  "win32-x64",
@@ -13,7 +13,7 @@
13
13
  "darwin-arm64"
14
14
  ],
15
15
  "files": {
16
- ".codex-plugin/plugin.json": "04bf483961519381a5a6ead9dbf8d6c5c7fd9cc947fd5c12c7750233ab3b7dfa",
16
+ ".codex-plugin/plugin.json": "b63e76c4b5bcc7d4c6870585e5dfa45087767ad639ce38a8aca46b15a9b0e342",
17
17
  "installer/install.cjs": "a0c94ed71edf4cd7eb4a66609a4dcf73049abbd14aa273ee65b9b3029be2da2b",
18
18
  "installer/legacy-root-digests.json": "922552646a5aa6cff8616c372912a37b1d5f263351206b85785ed9b2eae31641",
19
19
  "installer/signed-pair-1.1.16.json": "ccb22a90302cc5c9c585067ebc211a27b0c9d8a177c2740a5678a58a3d70bfe9",
@@ -25,23 +25,23 @@
25
25
  "migration/seedream-1.1.3/SKILL.md": "5c5cf3c2d99376f246425e873c5566436ed528256372ac3208abb60364c4517c",
26
26
  "skills/nggaigc/agents/openai.yaml": "8936d97b9821e687e224e9349cc42be2ee5fc20988562efffbcb70080aedf87c",
27
27
  "skills/nggaigc/references/catalog-and-updates.md": "f6eee93f5f009f381c4e729cb129176e976edd4ec5c0990c300ac6096dd4ea83",
28
- "skills/nggaigc/references/source.json": "f26725c09d456b5dd41fd7dab1e817ce6d64ab934ad7122eae4774c60ba87092",
28
+ "skills/nggaigc/references/source.json": "5f25202735e47df97fc95b2f7278ea46277d62c718b69a245e69f46b3e36430e",
29
29
  "skills/nggaigc/scripts/api_client.mjs": "bf3c671cec24e8ec80d227fdc7ce79c8051fddd21b80df67837ec724f1d8c0ae",
30
- "skills/nggaigc/scripts/api_package.mjs": "30a712aed56d4767d8d200921528aa5b9d7778cc6f0f3886622cbe41550128e5",
31
- "skills/nggaigc/scripts/bootstrap-public.json": "310df7aed701a622adca110dc04a19d4aec81468d5f0e7a7fcd0bb5e1336f35d",
32
- "skills/nggaigc/scripts/launch-ngg-client.cjs": "8af1c1dca84660d0913557568442f7c6aab5fe3dec3f28c9adbeecfd7fcb836b",
30
+ "skills/nggaigc/scripts/api_package.mjs": "86ea20f08e74d19fe146edd29ea374240d2594c1ff1e9682d7918ced1ff6a51c",
31
+ "skills/nggaigc/scripts/bootstrap-public.json": "eafd308e30582098b9422123992194b8d0e87ab373472995f4e240734e329cd0",
32
+ "skills/nggaigc/scripts/launch-ngg-client.cjs": "645bab6956539d2d63aa8d6a21d6446cdb1ebf3b1f174cb9ec7bf4b76e7496d9",
33
33
  "skills/nggaigc/scripts/macos-keychain": "b0bdf29d14219d38ca18c7e5c599deb0daa8c8ac70b0babbc7d4fb23673079ec",
34
34
  "skills/nggaigc/scripts/macos-keychain.swift": "1b57e74fde66c824fe970547dd8ca0883a3334c34c065e85a8a2a90d4556a7f5",
35
- "skills/nggaigc/scripts/ngg_client.mjs": "7eb08a5daa15fbf269c9f06cadddc13f549fb24a223d4b7c1126e3b81c945989",
36
- "skills/nggaigc/scripts/ngg-session.mjs": "6ea1f8eb3381a3952dd4236a582ebaa99db27b1a74f2154514c6473e2df3a913",
35
+ "skills/nggaigc/scripts/ngg_client.mjs": "bea0bbc681d582420a891abb62f72283ffe5094f2428475043cff7b7c2782d8b",
36
+ "skills/nggaigc/scripts/ngg-session.mjs": "b15f924bb6bc2dc5c4dfdc4fcff40db2e4e5e7525b59c57f4709ab416b7e6be5",
37
37
  "skills/nggaigc/scripts/supported-platforms.json": "ec8b0754c489e04534a1d9880dd6664ba9c5bcd07789e06d138e0923f23575ff",
38
38
  "skills/nggaigc/scripts/windows-credential.ps1": "80d470fb0c9473d26bd599cafa9f1c2ad69056d4a835888ddcbb5c1548f9d059",
39
- "skills/nggaigc/SKILL.md": "a76a0d418e65db91c2f5c1dce09b5878bee32856f06e05a9843b7bfbeade113f"
39
+ "skills/nggaigc/SKILL.md": "8128d8c38ec8051a664082f36c65e566a96d3a1927f40d5cf638dc928500fe03"
40
40
  },
41
41
  "signature": {
42
42
  "algorithm": "ed25519",
43
43
  "keyId": "ngg-signing-skill-release-1",
44
44
  "scope": "artifact-bytes",
45
- "value": "ZeLYQwGGsvYXbAtK2AvmR/DzBnU685/Ldm/62HGN+R/jChZAVa6RbSCdshahT/L1pgorZqE2TMdoU0qPLeJdDQ=="
45
+ "value": "RR82intdBjioMS/q0sKy8kamHve7htCxlG0UpiiA7ayHeIfoiDLKLPKmaJjFfsv5NMPZYpPVijLW0liO4JxvAg=="
46
46
  }
47
47
  }
index 2de125c..e2a0645 100644
Binary file