@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 +1 -1
- package/dist/bundle.js +2 -2
- package/dist/install.js +8 -5
- package/package.json +1 -1
- package/vendor/manifest.json +14 -14
- package/vendor/nggaigc-plugin-1.1.2.zip +0 -0
- package/vendor/nggaigc-plugin-1.1.1.zip +0 -0
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.
|
|
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.
|
|
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.
|
|
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(
|
|
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(
|
|
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
package/vendor/manifest.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "nggaigc-plugin-package/v1",
|
|
3
3
|
"artifactId": "plugin.nggaigc",
|
|
4
|
-
"version": "1.1.
|
|
5
|
-
"sourceCommit": "
|
|
6
|
-
"artifactPath": "packages/plugins/nggaigc-plugin-1.1.
|
|
7
|
-
"sha256": "
|
|
8
|
-
"sizeBytes":
|
|
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": "
|
|
13
|
-
"installer/install.cjs": "
|
|
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": "
|
|
17
|
-
"skills/nggaigc/scripts/bootstrap-public.json": "
|
|
18
|
-
"skills/nggaigc/scripts/launch-ngg-client.cjs": "
|
|
19
|
-
"skills/nggaigc/scripts/ngg_client.mjs": "
|
|
20
|
-
"skills/nggaigc/scripts/ngg-session.mjs": "
|
|
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": "
|
|
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": "
|
|
28
|
+
"value": "AymFZmaUtNXG11z+XmLla9MI92pqSjjLpVWsJJjp1nfLJD6DLtQcgMCts4lhS4i9EFy3k6RfAXeWfjvI0UmjAw=="
|
|
29
29
|
}
|
|
30
30
|
}
|
|
Binary file
|
|
Binary file
|