@wkgeo/cli 1.0.0 → 1.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/CHANGELOG.md +249 -203
- package/README.md +151 -19
- package/SKILL.md +108 -27
- package/lib/args.mjs +2 -2
- package/lib/asset-role.mjs +68 -0
- package/lib/cms.mjs +2 -2
- package/lib/commands/billing.mjs +56 -10
- package/lib/commands/cms.mjs +49 -13
- package/lib/commands/content.mjs +108 -0
- package/lib/commands/crawl.mjs +219 -0
- package/lib/commands/geo.mjs +1673 -0
- package/lib/commands/index.mjs +640 -528
- package/lib/commands/member.mjs +930 -0
- package/lib/commands/seo.mjs +1386 -0
- package/lib/commands/siteops.mjs +3 -3
- package/lib/commands/sites.mjs +21 -125
- package/lib/commands/template.mjs +1474 -0
- package/lib/config.mjs +16 -13
- package/lib/content-apply.mjs +664 -0
- package/lib/content-check.mjs +887 -0
- package/lib/content-contract.mjs +957 -0
- package/lib/errors.mjs +6 -0
- package/lib/format.mjs +5 -1
- package/lib/manifest-apply.mjs +1499 -0
- package/lib/manifest-schema.json +476 -0
- package/lib/manifest.mjs +1082 -0
- package/lib/oauth-urls.mjs +1 -1
- package/lib/runtime.mjs +5 -1
- package/lib/site-create.mjs +536 -0
- package/lib/tar.mjs +207 -0
- package/lib/template-anim.mjs +1338 -0
- package/lib/template-animation.mjs +232 -0
- package/lib/template-capture.mjs +700 -0
- package/lib/template-gen.mjs +1204 -0
- package/lib/template-pack.mjs +206 -0
- package/lib/template-package.mjs +522 -0
- package/lib/template-publish.mjs +733 -0
- package/lib/template-score.mjs +865 -0
- package/lib/template-validate.mjs +368 -0
- package/lib/template-verify.mjs +434 -0
- package/lib/templates-sync.mjs +616 -0
- package/package.json +2 -2
package/lib/errors.mjs
CHANGED
|
@@ -45,6 +45,12 @@ export class CliError extends Error {
|
|
|
45
45
|
this.exitCode = opts.exitCode === undefined ? EXIT.ERROR : opts.exitCode;
|
|
46
46
|
/** 原始响应(已脱敏),--verbose 时打印,便于排查"服务端到底说了什么" */
|
|
47
47
|
this.raw = opts.raw === undefined ? null : opts.raw;
|
|
48
|
+
/**
|
|
49
|
+
* 结构化失败明细(`errorEnvelope` 会原样带进 `--json` 信封的 `error.details`)。
|
|
50
|
+
* 典型用途:`content apply` 的 `rejected[]`、`content check` 的 `score/fixes`、
|
|
51
|
+
* `template verify` 的动画对账 —— 让 AI 端拿到明细自己决定下一步,而不是只看一句话。
|
|
52
|
+
*/
|
|
53
|
+
this.details = opts.details === undefined ? null : opts.details;
|
|
48
54
|
this.cause = opts.cause;
|
|
49
55
|
}
|
|
50
56
|
}
|
package/lib/format.mjs
CHANGED
|
@@ -63,7 +63,11 @@ function isSecretKey(key, value) {
|
|
|
63
63
|
|
|
64
64
|
/** 递归脱敏一个对象(用于 --verbose / --debug 打印原始响应) */
|
|
65
65
|
export function redact(value, depth = 0) {
|
|
66
|
-
|
|
66
|
+
// 深度上限只是"防巨型结构",不是"防泄漏":脱敏靠的是键名(`isSecretKey`),每一层都判。
|
|
67
|
+
// 2026-10-30 从 6 提到 12:`content apply` 的 `sections[].items[].changed[]` 与
|
|
68
|
+
// `content check` 的 `score.dimensions[].findings[]` 都在第 7 层,上限 6 时整片被压成「…」,
|
|
69
|
+
// AI 端拿到的 JSON 里看不到"哪几个字段变了 / 哪条 finding",等于白给。
|
|
70
|
+
if (depth > 12) return '…';
|
|
67
71
|
if (value === null || value === undefined) return value;
|
|
68
72
|
if (Array.isArray(value)) return value.map((v) => redact(v, depth + 1));
|
|
69
73
|
if (typeof value === 'object') {
|