@social-data/social-neuron-subscription 1.0.0-beta.22 → 1.0.0-beta.23
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/bin/cli.js +7 -2
- package/manifest.json +1130 -33
- package/package.json +1 -1
- package/skills/social-neuron-subscription/SKILL.md +251 -42
package/bin/cli.js
CHANGED
|
@@ -65,8 +65,9 @@ function normalize(body) {
|
|
|
65
65
|
const type = forgeType(body.code);
|
|
66
66
|
let message = body.msg || "";
|
|
67
67
|
if (type === "outdated") message += "(升级后请重新加载 SKILL.md 与 manifest 再调用)";
|
|
68
|
-
//
|
|
69
|
-
const extra = body.data
|
|
68
|
+
// 透传结构化诊断,并保留顶层 trace_id 的兼容读取。
|
|
69
|
+
const extra = body.data == null ? {} : { data: body.data };
|
|
70
|
+
if (body.data && body.data.trace_id) extra.trace_id = body.data.trace_id;
|
|
70
71
|
return { ok: false, error: { type, code: body.code, message, ...extra } };
|
|
71
72
|
}
|
|
72
73
|
return { ok: false, error: { type: "api_error", code: "UNKNOWN", message: JSON.stringify(body).slice(0, 200) } };
|
|
@@ -224,6 +225,10 @@ function parseArgs(cmd, argv) {
|
|
|
224
225
|
}
|
|
225
226
|
}
|
|
226
227
|
else if (f.type === "integer") val = Number(raw);
|
|
228
|
+
else if (f.type === "boolean") {
|
|
229
|
+
if (raw !== "true" && raw !== "false") return { err: fail("validation", "BAD_BOOLEAN", a + " 需为 true 或 false") };
|
|
230
|
+
val = raw === "true";
|
|
231
|
+
}
|
|
227
232
|
args[f.field] = val;
|
|
228
233
|
}
|
|
229
234
|
return { args };
|