@synopackageland/cli 0.15.1 → 0.15.2
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/CHANGELOG.md +8 -0
- package/README.md +44 -0
- package/dist/bin.js +2 -3
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +1 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.15.2 (2026-10-18)
|
|
4
|
+
|
|
5
|
+
- Preserve command-set process exit codes instead of resetting them to 0 after CLI dispatch. `ctl` failures now reach scripts and CI with their documented exit codes; successful commands still exit 0 and uncaught exceptions exit 1.
|
|
6
|
+
- Add subprocess regression coverage for `ctl` exit codes 0–8, confirmation before writes, and failures from `check`, `build`, `inspect`, `status` and `test`. Document the existing `ctl` exit-code contract and informational discovery/session results.
|
|
7
|
+
- CLI-only patch: templates and SDK fixtures/examples remain pinned to 0.15.1; executor/lifecycle digests are unchanged.
|
|
8
|
+
|
|
9
|
+
繁中摘要:修正 CLI 在子指令完成後把退出碼覆寫成 0 的問題,讓 `ctl` 失敗正確傳遞至腳本與 CI;成功仍為 0,未捕捉例外仍為 1。新增實際子行程測試,涵蓋 `ctl` 的 0–8 退出碼、寫入確認及其他主要指令的失敗;README 記錄既有退出碼與 discovery/session 資訊結果。此次僅更新 CLI,templates/SDK 維持 0.15.1,executor/lifecycle digest 不變。
|
|
10
|
+
|
|
3
11
|
## 0.15.1 (2026-10-18)
|
|
4
12
|
|
|
5
13
|
- Require explicit `DSM_E2E_SSH` for e2e tunnels and use `dsm` as the default saved-profile target; set `DSM_E2E_TARGET` to reuse an earlier target name. Anonymize internal NAS fixtures and documentation.
|
package/README.md
CHANGED
|
@@ -68,6 +68,19 @@ templates checkout and `SYNOPKGLAND_SDK_DIR` to an SDK checkout; SPKs built with
|
|
|
68
68
|
packs the local SDK into its frontend (`npm install --install-links`) without building it: run
|
|
69
69
|
`npm ci && npm run build` in `$SYNOPKGLAND_SDK_DIR/ts` first, and again after SDK changes.
|
|
70
70
|
|
|
71
|
+
To check the CLI's DSM terminology rules against templates without a new templates release:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
SYNOPKGLAND_TEMPLATES_DIR=/path/to/templates npm run test:glossary
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
This compares `OFF_GLOSSARY` and the Italian sentence rule, including regex sources and
|
|
78
|
+
flags. It supports declaration-only rules with read-only use in `glossaryProblems`;
|
|
79
|
+
post-declaration mutations, aliases and other unsupported rule uses fail the check instead of
|
|
80
|
+
comparing a partial snapshot. The command also fails on drift or missing source. It needs a checkout because templates
|
|
81
|
+
0.15.1 does not publish `scripts/test/i18n.test.mjs`. The npm gate runs this check when
|
|
82
|
+
`SYNOPKGLAND_TEMPLATES_DIR` is set; otherwise it explicitly reports that the drift check was skipped.
|
|
83
|
+
|
|
71
84
|
## Capabilities
|
|
72
85
|
|
|
73
86
|
Add them with `init --with …` or later with `synopkgland add <capability…>`.
|
|
@@ -260,6 +273,37 @@ commands and their schemas. Run the listed alias/command with typed flags,
|
|
|
260
273
|
`--help` and `--dry-run`; writes require `--yes`. There is no mutable current
|
|
261
274
|
context. Use `--host a,b` or `--all-hosts` for bounded parallel operations.
|
|
262
275
|
|
|
276
|
+
`ctl` preserves these process exit codes, including with `--json`:
|
|
277
|
+
|
|
278
|
+
| Exit code | Meaning and examples |
|
|
279
|
+
| --- | --- |
|
|
280
|
+
| 0 | Command completed successfully (including help and `--dry-run`). |
|
|
281
|
+
| 1 | Unexpected internal error (`CTL_INTERNAL`), or an uncaught CLI exception. |
|
|
282
|
+
| 2 | Authentication/session failure: `CTL_NOT_AUTHENTICATED`, `CTL_AUTH_FAILED`, `CTL_CREDENTIAL_MISMATCH`, or unavailable OS credential storage. |
|
|
283
|
+
| 3 | Invalid parameters, schema validation or unknown names: `CTL_PARAMS_INVALID`, `CTL_ARGUMENT_INVALID`, `CTL_APP_UNKNOWN`, `CTL_COMMAND_UNKNOWN`. |
|
|
284
|
+
| 4 | Permission refusal that fails the command: `CTL_PERMISSION_DENIED`, `CTL_INVENTORY_DENIED`. |
|
|
285
|
+
| 5 | App/contract failure that fails the command: `CTL_APP_ERROR`, `CTL_RESPONSE_INVALID`, `CTL_JOB_FAILED`. |
|
|
286
|
+
| 6 | Network/HTTP failure or uncertain completion: `CTL_NETWORK`, `CTL_HTTP_ERROR`, `CTL_JOB_TIMEOUT`, `CTL_LOGOUT_FAILED`. |
|
|
287
|
+
| 7 | Confirmation required (`CTL_CONFIRM_REQUIRED`): a write/destructive command or host removal without confirmation; no business operation runs. |
|
|
288
|
+
| 8 | A multi-host command has at least one failed host (including when all hosts fail); inspect each host's error. |
|
|
289
|
+
|
|
290
|
+
For example, `synopkgland ctl studio drafts create --host nas --json` without
|
|
291
|
+
`--yes` returns `ok:false` with `CTL_CONFIRM_REQUIRED` and exits 7 once discovery
|
|
292
|
+
and parameter validation succeed. Missing sessions fail earlier with exit 2.
|
|
293
|
+
Discovery catches per-App description errors and excludes those Apps from its
|
|
294
|
+
results. For example, a changed pinned description (`CTL_DESCRIPTION_CHANGED`)
|
|
295
|
+
or an invalid descriptor (`CTL_DESCRIPTOR_INVALID`) appears in
|
|
296
|
+
`ctl list --host nas --refresh --json` under `data.diagnostics`; the listing still
|
|
297
|
+
returns `ok:true` and exits 0, even if no Apps remain. These diagnostic codes do
|
|
298
|
+
not become process exit codes 4 or 5. Attempting to execute an excluded App with
|
|
299
|
+
`--refresh` instead returns `ok:false`, `CTL_APP_UNKNOWN` and exit 3 because the
|
|
300
|
+
App is absent from discovery results; no business operation runs.
|
|
301
|
+
|
|
302
|
+
`ctl host list/show` can also succeed while reporting `authenticated:false` and
|
|
303
|
+
exit 0. Check discovery `apps`/`diagnostics` and session fields as well as the exit
|
|
304
|
+
code when deciding whether an App is ready.
|
|
305
|
+
After a network or job timeout, query the App's state before retrying a write.
|
|
306
|
+
|
|
263
307
|
Read `synopkgland skill show ctl` for the AI workflow, batch discovery approval,
|
|
264
308
|
cache refresh, host removal/revocation and explicit `ctl.commands` authoring.
|
|
265
309
|
API descriptions are private SPK files named `synopkgland-api.json`, served
|
package/dist/bin.js
CHANGED
|
@@ -3,9 +3,8 @@ import { loadDotEnv } from "./load-env.js";
|
|
|
3
3
|
import { runCli } from "./cli.js";
|
|
4
4
|
loadDotEnv();
|
|
5
5
|
// Package deployment is explicit; this CLI does not publish releases.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}).catch((error) => {
|
|
6
|
+
// Successful completion leaves Node's default 0 or the command's exitCode intact.
|
|
7
|
+
runCli(process.argv).catch((error) => {
|
|
9
8
|
console.error(error instanceof Error ? error.message : String(error));
|
|
10
9
|
process.exit(1);
|
|
11
10
|
});
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -275,6 +275,7 @@ async function containerBuild(project, arches, options) {
|
|
|
275
275
|
return commitOutputs(options.outDir ? resolve(options.outDir) : project.root, (stage) => forEachArch(arches ?? CONTAINER_ARCH_FAMILIES, jobs, async (arch) => (await build(arch, join(stage, `${packageId}-${arch}.spk`)))
|
|
276
276
|
.outputPath));
|
|
277
277
|
}
|
|
278
|
+
/** Resolves after dispatch; commands may set process.exitCode. Rejections are failures. */
|
|
278
279
|
export async function runCli(argv) {
|
|
279
280
|
if (argv[2] === "ctl") {
|
|
280
281
|
const { runCtl } = await import("./ctl/cli.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synopackageland/cli",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "Syno Package Land Developer Kit CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "rm -rf dist && tsc",
|
|
21
21
|
"test": "npm run build && node --import tsx --test test/*.test.ts test/ctl/*.test.ts",
|
|
22
|
+
"test:glossary": "node --test scripts/test/glossary-drift.test.mjs",
|
|
22
23
|
"test:scripts": "node --test scripts/test/gate.test.mjs scripts/test/release.test.mjs scripts/test/pack-docker.test.mjs scripts/test/npm-pack.test.mjs scripts/test/executor-bump.test.mjs scripts/test/smoke-exports.test.mjs scripts/test/executor-digests.test.mjs scripts/test/parallel.test.mjs scripts/test/scaffold-matrix.test.mjs scripts/test/frontend-deps.test.mjs scripts/test/docker-gate.test.mjs scripts/test/gate-plan.test.mjs scripts/test/gates.test.mjs",
|
|
23
24
|
"gates": "bash scripts/ci/gates.sh",
|
|
24
25
|
"gates:fast": "bash scripts/ci/gates.sh --fast",
|