@steinscheng/zhaotongkuan 0.8.0 → 0.8.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 +13 -2
- package/package.json +7 -4
- package/src/cli.js +7 -2
- package/src/release-channel.json +3 -3
package/README.md
CHANGED
|
@@ -6,6 +6,17 @@
|
|
|
6
6
|
npx @steinscheng/zhaotongkuan@latest install --start --json
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
+
自动化或远程部署在只想验证安装、启动、授权门禁后立即退出时,使用:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx @steinscheng/zhaotongkuan@latest install \
|
|
13
|
+
--start \
|
|
14
|
+
--stop-after-check \
|
|
15
|
+
--json
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`--stop-after-check` 必须与 `--start` 同时使用;成功结果不会留下本地服务进程。
|
|
19
|
+
|
|
9
20
|
私有 GitHub Release 会优先使用已登录的 `gh` CLI 下载;引导器不读取、保存或输出 GitHub Token。也可以安装发行方通过其他可信渠道交付的本地 ZIP:
|
|
10
21
|
|
|
11
22
|
```bash
|
|
@@ -18,6 +29,6 @@ npx @steinscheng/zhaotongkuan@latest install \
|
|
|
18
29
|
|
|
19
30
|
必须由发行方通过独立可信渠道提供 `--expected-sha256`。不要从和 ZIP 同一个未验证页面临时复制哈希。
|
|
20
31
|
|
|
21
|
-
|
|
32
|
+
支持 Windows 10/11、macOS 或 Linux(x64/arm64),需要 Node.js 18.18+ 和 Python 3.10+。第一阶段使用 Python 运行已审计的安装事务;引导器不会安装系统级 Python、FFmpeg 或 Codex。Windows 可使用 `scripts/install.cmd`、`scripts/start.cmd` 和 `scripts/ztk.cmd`,macOS/Linux 继续使用对应 `.command` 入口。
|
|
22
33
|
|
|
23
|
-
若机器同时保留系统旧版 Python 和新版 Python,可用 `--python
|
|
34
|
+
若机器同时保留系统旧版 Python 和新版 Python,可用 `--python <Python可执行文件绝对路径>` 显式指定;Windows 会识别 `python.exe`/`py`,macOS 引导器也会检查 Homebrew 的标准安装位置。
|
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steinscheng/zhaotongkuan",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"description": "Small, verifiable installer bootstrap for the Zhaotongkuan Codex plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"zhaotongkuan": "bin/zhaotongkuan.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"bin/",
|
|
11
|
-
"src/",
|
|
10
|
+
"bin/zhaotongkuan.js",
|
|
11
|
+
"src/cli.js",
|
|
12
|
+
"src/extract_installer.py",
|
|
13
|
+
"src/release-channel.json",
|
|
12
14
|
"README.md",
|
|
13
15
|
"LICENSE.txt"
|
|
14
16
|
],
|
|
@@ -21,7 +23,8 @@
|
|
|
21
23
|
},
|
|
22
24
|
"os": [
|
|
23
25
|
"darwin",
|
|
24
|
-
"linux"
|
|
26
|
+
"linux",
|
|
27
|
+
"win32"
|
|
25
28
|
],
|
|
26
29
|
"cpu": [
|
|
27
30
|
"x64",
|
package/src/cli.js
CHANGED
|
@@ -37,7 +37,7 @@ function cleanText(value, label) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export function normalizeTarget(platform = process.platform, arch = process.arch) {
|
|
40
|
-
const platforms = { darwin: "darwin", linux: "linux" };
|
|
40
|
+
const platforms = { darwin: "darwin", linux: "linux", win32: "windows" };
|
|
41
41
|
const architectures = { x64: "amd64", arm64: "arm64" };
|
|
42
42
|
if (!platforms[platform] || !architectures[arch]) {
|
|
43
43
|
throw new BootstrapError(`unsupported platform: ${platform}/${arch}`, "unsupported_platform");
|
|
@@ -81,6 +81,7 @@ export function parseArgs(argv) {
|
|
|
81
81
|
json: false,
|
|
82
82
|
dryRun: false,
|
|
83
83
|
start: false,
|
|
84
|
+
stopAfterCheck: false,
|
|
84
85
|
archive: "",
|
|
85
86
|
expectedSha256: "",
|
|
86
87
|
version: "",
|
|
@@ -110,6 +111,7 @@ export function parseArgs(argv) {
|
|
|
110
111
|
if (flag === "--json") result.json = true;
|
|
111
112
|
else if (flag === "--dry-run") result.dryRun = true;
|
|
112
113
|
else if (flag === "--start") result.start = true;
|
|
114
|
+
else if (flag === "--stop-after-check") result.stopAfterCheck = true;
|
|
113
115
|
else if (flag === "--help" || flag === "-h") result.command = "help";
|
|
114
116
|
else if (flag === "--bootstrap-version") result.command = "version";
|
|
115
117
|
else if (valueFlags.has(flag)) {
|
|
@@ -203,6 +205,8 @@ export function findPython(preferred = "", candidates) {
|
|
|
203
205
|
"/opt/homebrew/bin/python3",
|
|
204
206
|
"/usr/local/bin/python3",
|
|
205
207
|
"/usr/bin/python3",
|
|
208
|
+
"python.exe",
|
|
209
|
+
"py",
|
|
206
210
|
"python",
|
|
207
211
|
];
|
|
208
212
|
for (const value of values) {
|
|
@@ -316,6 +320,7 @@ export function installerArgv(options, release, archivePath, installerPath) {
|
|
|
316
320
|
];
|
|
317
321
|
if (options.dryRun) argv.push("--dry-run");
|
|
318
322
|
if (options.start) argv.push("--start");
|
|
323
|
+
if (options.stopAfterCheck) argv.push("--stop-after-check");
|
|
319
324
|
const mappings = [
|
|
320
325
|
[options.dataDir, "--data-dir"],
|
|
321
326
|
[options.installRoot, "--install-root"],
|
|
@@ -366,7 +371,7 @@ export function sanitizeForJson(value, key = "", depth = 0) {
|
|
|
366
371
|
}
|
|
367
372
|
|
|
368
373
|
function help() {
|
|
369
|
-
return `Usage:\n npx @steinscheng/zhaotongkuan@latest install [options]\n\nSupported hosts:\n macOS or Linux on x64/arm64\n\nOptions:\n --archive <path-or-https-url> Install an explicit release archive\n --expected-sha256 <digest> Trusted SHA-256 (required with --archive)\n --dry-run Validate without writing\n --start Start and health-check the service\n --data-dir <path> Preserve business data outside the program\n --install-root <path> Override managed program directory\n --codex-bin <path> Use an explicit Codex CLI\n --python <path> Use an explicit Python 3.10+ executable\n --json Emit one JSON object\n`;
|
|
374
|
+
return `Usage:\n npx @steinscheng/zhaotongkuan@latest install [options]\n\nSupported hosts:\n Windows, macOS, or Linux on x64/arm64\n\nOptions:\n --archive <path-or-https-url> Install an explicit release archive\n --expected-sha256 <digest> Trusted SHA-256 (required with --archive)\n --dry-run Validate without writing\n --start Start and health-check the service\n --stop-after-check Stop after a successful startup health check\n --data-dir <path> Preserve business data outside the program\n --install-root <path> Override managed program directory\n --codex-bin <path> Use an explicit Codex CLI\n --python <path> Use an explicit Python 3.10+ executable\n --json Emit one JSON object\n`;
|
|
370
375
|
}
|
|
371
376
|
|
|
372
377
|
function emitError(error, jsonMode) {
|
package/src/release-channel.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
3
|
"repository": "SchengSteins/zhaotongkuan",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.4",
|
|
5
5
|
"artifacts": {
|
|
6
6
|
"any": {
|
|
7
|
-
"url": "https://github.com/SchengSteins/zhaotongkuan/releases/download/v0.8.
|
|
8
|
-
"sha256": "
|
|
7
|
+
"url": "https://github.com/SchengSteins/zhaotongkuan/releases/download/v0.8.4/zhaotongkuan-0.8.4.zip",
|
|
8
|
+
"sha256": "42b0c3911b27b595127e40ca571a4f4bf807f5d410e1f1d042fb4bcc8c257aae"
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
}
|