@hcmai/cli 0.26.3 → 0.27.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/README.md +22 -0
- package/dist/index.js +110 -12
- package/dist/index.js.map +1 -1
- package/dist/skills/manifest.json +14 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -132,3 +132,25 @@ Run these commands from the bound local workspace. Plan files require an existin
|
|
|
132
132
|
outside its real physical root and are created exclusively; use a new filename each time.
|
|
133
133
|
For API boundaries, field-policy failures and recovery, see the
|
|
134
134
|
[workspace workflow](../../docs/how-to/agent-workspace-workflow.md#规模辅助材料清理与受检封箱).
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
### Standard release lifecycle and scopes (ADR-464)
|
|
138
|
+
|
|
139
|
+
These commands require a Core build that implements ADR-464. They are standard product capabilities.
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
hcm workspace release-plan 2.0.0 --policy-version RUNTIME_ASSETS_V2 --plan /tmp/release-2.json
|
|
143
|
+
hcm workspace release --plan /tmp/release-2.json
|
|
144
|
+
hcm workspace cancel-release <releaseId> --reason 'Unused candidate'
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
New previews default to `RUNTIME_ASSETS_V2`. Unknown paths block publication. Choose
|
|
148
|
+
`ALL_WORKSPACE_PATCH_FILES_V1` explicitly to retain the previous all-patch behavior.
|
|
149
|
+
The selected policy is saved with the reviewed digest and sent unchanged for checked creation;
|
|
150
|
+
an older Core ignoring V2 is rejected before saving an executable plan. Existing V1 plans remain compatible.
|
|
151
|
+
|
|
152
|
+
Cancellation requires both workspace ownership and configuration administrator authorization.
|
|
153
|
+
Any deployment/MR history, package installation/recovery dependency or unknown evidence blocks it.
|
|
154
|
+
Release bytes, audit and version reservation remain; cancelled releases cannot be deployed, merged,
|
|
155
|
+
or used for a new workspace. Cancellation disables automatic retries. A lost response remains UNKNOWN;
|
|
156
|
+
read the original release and its cancellation audit before deciding whether to retry that exact ID.
|
package/dist/index.js
CHANGED
|
@@ -2253,6 +2253,12 @@ import {
|
|
|
2253
2253
|
workspaceDeliveryError,
|
|
2254
2254
|
workspaceObjectActionBase
|
|
2255
2255
|
} from "@hcmai/sdk";
|
|
2256
|
+
var RELEASE_POLICY_V1 = "ALL_WORKSPACE_PATCH_FILES_V1";
|
|
2257
|
+
var RELEASE_POLICY_V2 = "RUNTIME_ASSETS_V2";
|
|
2258
|
+
function releasePolicy(value) {
|
|
2259
|
+
if (value === RELEASE_POLICY_V1 || value === RELEASE_POLICY_V2) return value;
|
|
2260
|
+
throw workspaceDeliveryError("RELEASE_SCOPE_UNSUPPORTED", "\u4E0D\u652F\u6301\u7684\u53D1\u5E03\u8303\u56F4\uFF1B\u8BF7\u9009\u62E9 ALL_WORKSPACE_PATCH_FILES_V1 \u6216 RUNTIME_ASSETS_V2\uFF0C\u672A\u6267\u884C\u5C01\u7BB1\u3002");
|
|
2261
|
+
}
|
|
2256
2262
|
async function connect(args) {
|
|
2257
2263
|
const root = path.resolve(args.dir ?? ".");
|
|
2258
2264
|
let binding;
|
|
@@ -2356,11 +2362,17 @@ async function workspaceCleanupCommand(args) {
|
|
|
2356
2362
|
}
|
|
2357
2363
|
async function workspaceReleasePlanCommand(version2, args) {
|
|
2358
2364
|
return command(args, async (target) => {
|
|
2365
|
+
const policyVersion = releasePolicy(args.policyVersion ?? RELEASE_POLICY_V2);
|
|
2359
2366
|
const action = await workspaceObjectActionBase(target.client.raw(), target.workspaceKey);
|
|
2360
|
-
const
|
|
2367
|
+
const form = { version: text(version2, "version"), ...policyVersion === RELEASE_POLICY_V2 ? { policyVersion } : {} };
|
|
2368
|
+
const response = await target.client.raw().post(`${action}/release-plan`, { form });
|
|
2361
2369
|
const plan = readReleasePlan(workspaceActionPayload(response.data), target.workspaceKey, version2);
|
|
2370
|
+
if (plan.policyVersion !== policyVersion) throw workspaceDeliveryError(
|
|
2371
|
+
"RELEASE_SCOPE_MISMATCH",
|
|
2372
|
+
"Core \u6CA1\u6709\u6309\u9009\u5B9A\u7684\u53D1\u5E03\u8303\u56F4\u751F\u6210\u8BA1\u5212\uFF1B\u8BF7\u5347\u7EA7\u652F\u6301\u8BE5\u7B56\u7565\u7684 Core \u540E\u91CD\u65B0\u9884\u68C0\uFF0C\u672C\u6B21\u672A\u4FDD\u5B58\u8BA1\u5212\u3002"
|
|
2373
|
+
);
|
|
2362
2374
|
if (args.plan) await savePlan("workspace-release-plan", plan, target, args.plan);
|
|
2363
|
-
process.stderr.write("\u53D1\u5E03\u9884\u68C0\
|
|
2375
|
+
process.stderr.write(policyVersion === RELEASE_POLICY_V2 ? "\u53D1\u5E03\u9884\u68C0\u4F7F\u7528\u8FD0\u884C\u8D44\u4EA7 V2\uFF0C\u672A\u77E5\u8DEF\u5F84\u4F1A\u963B\u6B62\u53D1\u5E03\u3002\u6838\u5BF9 files/deletedPaths \u540E\uFF0C\u7528\u539F\u8BA1\u5212\u6267\u884C workspace release\u3002\n" : "\u53D1\u5E03\u9884\u68C0\u4F7F\u7528\u517C\u5BB9 V1 \u5168\u6587\u4EF6 patch \u89C4\u5219\uFF1B\u672A\u77E5\u7528\u9014\u6587\u4EF6\u4ECD\u53EF\u80FD\u8FDB\u5165\u5236\u54C1\u3002\u6838\u5BF9 files/deletedPaths \u4E0E classification \u540E\uFF0C\u7528\u539F\u8BA1\u5212\u6267\u884C workspace release\u3002\n");
|
|
2364
2376
|
writeResult(plan, args);
|
|
2365
2377
|
process.exitCode = 0;
|
|
2366
2378
|
});
|
|
@@ -2373,17 +2385,55 @@ async function workspaceReleaseCommand(args) {
|
|
|
2373
2385
|
workspaceKey: target.workspaceKey,
|
|
2374
2386
|
version: plan.version,
|
|
2375
2387
|
description: args.description ?? "",
|
|
2376
|
-
planDigest: plan.planDigest
|
|
2388
|
+
planDigest: plan.planDigest,
|
|
2389
|
+
...plan.policyVersion === RELEASE_POLICY_V2 ? { policyVersion: plan.policyVersion } : {}
|
|
2377
2390
|
};
|
|
2378
2391
|
const response = await target.client.raw().post("/api/models/TenantExtensionRelease/action/create-checked", { form }, { __skipRetry: true });
|
|
2379
2392
|
const result = workspaceActionPayload(response.data);
|
|
2380
|
-
if (typeof result.id !== "string" || !result.id.trim() || result.workspaceKey !== target.workspaceKey || result.version !== plan.version) {
|
|
2393
|
+
if (typeof result.id !== "string" || !result.id.trim() || result.workspaceKey !== target.workspaceKey || result.version !== plan.version || plan.policyVersion === RELEASE_POLICY_V2 && result.policyVersion !== plan.policyVersion) {
|
|
2381
2394
|
throw workspaceDeliveryError("INVALID_WORKSPACE_RELEASE_RECEIPT", "create-checked \u56DE\u6267\u4E0E\u53D7\u68C0\u7A7A\u95F4\u6216\u7248\u672C\u4E0D\u7B26\uFF1B\u5C01\u7BB1\u7ED3\u679C\u672A\u77E5\uFF0C\u4E0D\u80FD\u81EA\u52A8\u91CD\u8BD5\u3002");
|
|
2382
2395
|
}
|
|
2383
2396
|
writeResult(result, args);
|
|
2384
2397
|
process.exitCode = 0;
|
|
2385
2398
|
});
|
|
2386
2399
|
}
|
|
2400
|
+
async function workspaceCancelReleaseCommand(releaseId, args) {
|
|
2401
|
+
return command(args, async (target) => {
|
|
2402
|
+
if (!/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(releaseId))
|
|
2403
|
+
throw new Error("releaseId \u5FC5\u987B\u662F\u5408\u6CD5 UUID\uFF1B\u672A\u6267\u884C\u53D6\u6D88\u3002");
|
|
2404
|
+
const reason = text(args.reason, "--reason").trim();
|
|
2405
|
+
if (reason.length > 1800) throw new Error("\u53D6\u6D88\u539F\u56E0\u4E0D\u80FD\u8D85\u8FC7 1800 \u5B57\uFF1B\u672A\u6267\u884C\u53D6\u6D88\u3002");
|
|
2406
|
+
const url = `/api/models/TenantExtensionRelease/${releaseId}`;
|
|
2407
|
+
const before = workspaceActionPayload((await target.client.raw().get(url)).data);
|
|
2408
|
+
if (before.id !== releaseId || before.workspaceKey !== target.workspaceKey)
|
|
2409
|
+
throw new Error("release \u4E0D\u5C5E\u4E8E\u5F53\u524D workspace\uFF0C\u672A\u6267\u884C\u53D6\u6D88\u3002");
|
|
2410
|
+
let result;
|
|
2411
|
+
try {
|
|
2412
|
+
result = workspaceActionPayload((await target.client.raw().post(
|
|
2413
|
+
`${url}/action/cancel-release`,
|
|
2414
|
+
{ form: { reason } },
|
|
2415
|
+
{ __skipRetry: true }
|
|
2416
|
+
)).data);
|
|
2417
|
+
} catch (error) {
|
|
2418
|
+
if (error?.response) throw error;
|
|
2419
|
+
throw new CliError3({
|
|
2420
|
+
code: CliErrorCode2.NETWORK_ERROR,
|
|
2421
|
+
message: "\u53D6\u6D88\u672A\u6536\u5230\u53EF\u786E\u8BA4\u56DE\u6267\uFF0C\u7ED3\u679C UNKNOWN\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002",
|
|
2422
|
+
cause: error,
|
|
2423
|
+
context: {
|
|
2424
|
+
reason: "RELEASE_CANCELLATION_UNKNOWN",
|
|
2425
|
+
releaseId,
|
|
2426
|
+
commitState: "UNKNOWN",
|
|
2427
|
+
nextStep: "\u6309\u539F releaseId \u56DE\u8BFB\u72B6\u6001\u53CA\u53D6\u6D88\u5BA1\u8BA1\uFF1B\u4FDD\u7559\u539F\u539F\u56E0\uFF0C\u786E\u8BA4\u540E\u4EC5\u5BF9\u539F ID \u91CD\u8BD5\uFF0C\u4E0D\u80FD\u521B\u5EFA\u66FF\u4EE3\u7248\u672C\u6216\u5220\u9664\u5236\u54C1\u3002"
|
|
2428
|
+
}
|
|
2429
|
+
});
|
|
2430
|
+
}
|
|
2431
|
+
if (result.id !== releaseId || result.workspaceKey !== target.workspaceKey || result.status !== "CANCELLED" || result.commitState !== "COMMITTED" || typeof result.alreadyCancelled !== "boolean" || typeof result.reason !== "string" || !result.reason.trim() || !result.cancelledBy || result.contentHash !== before.contentHash || !Array.isArray(result.postCommitErrors))
|
|
2432
|
+
throw workspaceDeliveryError("INVALID_RELEASE_CANCELLATION_RECEIPT", "\u53D6\u6D88\u56DE\u6267\u4E0D\u5B8C\u6574\uFF1B\u7ED3\u679C\u672A\u77E5\uFF0C\u8BF7\u6309\u539F ID \u6838\u5BF9\u72B6\u6001\u53CA\u53D6\u6D88\u5BA1\u8BA1\uFF0C\u4E0D\u81EA\u52A8\u91CD\u8BD5\u3002");
|
|
2433
|
+
writeResult(result, args);
|
|
2434
|
+
process.exitCode = result.postCommitErrors.length ? 3 : 0;
|
|
2435
|
+
});
|
|
2436
|
+
}
|
|
2387
2437
|
function readCleanupPlan(result, workspaceKey) {
|
|
2388
2438
|
if (result.protocolVersion !== 1 || result.workspaceKey !== workspaceKey || result.complete !== true || result.ownerDeclaration !== true || result.eligibilityBasis !== "ownerDeclaration" || result.referenceCoverage !== "knownConsumersOnly" || typeof result.canExecute !== "boolean") {
|
|
2389
2439
|
throw workspaceDeliveryError("INVALID_WORKSPACE_CLEANUP_PLAN", "\u6E05\u7406\u9884\u68C0\u672A\u8FD4\u56DE\u5B8C\u6574\u534F\u8BAE\u3001\u58F0\u660E\u6216\u68C0\u67E5\u8986\u76D6\u8303\u56F4\u3002");
|
|
@@ -2412,6 +2462,7 @@ function readReleasePlan(result, workspaceKey, version2) {
|
|
|
2412
2462
|
text(result.version, "version");
|
|
2413
2463
|
text(result.planDigest, "planDigest");
|
|
2414
2464
|
text(result.policyVersion, "policyVersion");
|
|
2465
|
+
releasePolicy(result.policyVersion);
|
|
2415
2466
|
const files = result.files;
|
|
2416
2467
|
if (!Array.isArray(files) || !nonnegativeInteger(result.filesCount) || result.filesCount !== files.length || !nonnegativeInteger(result.totalSize) || new Set(files.map((item) => item?.relativePath)).size !== files.length || files.some((item) => !item || !isWorkspaceRelativePath(item.relativePath) || !nonnegativeInteger(item.fileSize) || typeof item.contentHash !== "string" || !/^sha256:[a-f0-9]{64}$/.test(item.contentHash)) || files.reduce((sum, item) => sum + item.fileSize, 0) !== result.totalSize) {
|
|
2417
2468
|
throw workspaceDeliveryError("INVALID_WORKSPACE_RELEASE_PLAN", "\u53D1\u5E03 patch \u6E05\u5355\u3001\u8BA1\u6570\u3001\u5B57\u8282\u6570\u6216\u5B9E\u9645\u54C8\u5E0C\u4E0D\u5B8C\u6574\uFF1B\u672A\u6267\u884C\u5C01\u7BB1\u3002");
|
|
@@ -4253,6 +4304,19 @@ function buildQueryDsl(args) {
|
|
|
4253
4304
|
function printQueryResult(result, fmt, dsl = {}) {
|
|
4254
4305
|
const out = formatRows(result.rows, { format: fmt });
|
|
4255
4306
|
process.stdout.write(out + "\n");
|
|
4307
|
+
for (const w of result.warnings ?? []) {
|
|
4308
|
+
const text2 = [w.message, w.suggestion].filter((s) => s && s.length > 0).join("\uFF1B");
|
|
4309
|
+
process.stderr.write(`\u63D0\u793A [${w.code}]${text2 ? " " + text2 : ""}
|
|
4310
|
+
`);
|
|
4311
|
+
}
|
|
4312
|
+
for (const m of result.match ?? []) {
|
|
4313
|
+
const total = m.includedTotal ?? m.included.length;
|
|
4314
|
+
const listed = m.listedInWarning ?? m.included.length;
|
|
4315
|
+
if (m.included.length <= listed && total <= listed) continue;
|
|
4316
|
+
process.stderr.write(
|
|
4317
|
+
`match \u53D6\u503C\u5168\u96C6 [${m.field}]\uFF08\u5171 ${total} \u4E2A\uFF0C\u63D0\u793A\u6B63\u6587\u53EA\u5217\u4E86\u524D ${listed} \u4E2A\uFF09\uFF1A` + m.included.map((hit) => `"${hit.value}"`).join("\u3001") + "\n"
|
|
4318
|
+
);
|
|
4319
|
+
}
|
|
4256
4320
|
if (fmt === "table" && result.total !== void 0) {
|
|
4257
4321
|
process.stdout.write(`Showing ${result.rows.length} of ${result.total} results.
|
|
4258
4322
|
`);
|
|
@@ -5008,7 +5072,7 @@ function formatDescriptionTable(desc, verbose = false) {
|
|
|
5008
5072
|
const req = f.required ? " required" : " ";
|
|
5009
5073
|
const extras = verbose ? [f.label, f.description, formatEnumValues(f.enums)] : [f.label];
|
|
5010
5074
|
const lbl = extras.filter((s) => s && s.length > 0).map((s) => ` ${s}`).join("");
|
|
5011
|
-
const hints = [f.i18n && "i18n", f.jsonObject && "json", f.decimalNumber && "decimal"].filter(Boolean).map((hint) => ` (${hint})`).join("");
|
|
5075
|
+
const hints = [f.i18n && "i18n", f.jsonObject && "json", f.decimalNumber && "decimal", f.valueMatch && "match"].filter(Boolean).map((hint) => ` (${hint})`).join("");
|
|
5012
5076
|
const type = f.type + hints;
|
|
5013
5077
|
const writeHints = [f.readOnly && "readonly", f.systemManaged && "system-managed"].filter(Boolean).map((hint) => ` [${hint}]`).join("");
|
|
5014
5078
|
const objectRef = f.object ? ` \u2192 ${f.object}` : "";
|
|
@@ -5030,6 +5094,11 @@ function formatDescriptionTable(desc, verbose = false) {
|
|
|
5030
5094
|
' \u2139\uFE0F (i18n) = \u591A\u8BED\u8A00\u5B57\u6BB5\uFF0C\u503C\u5F62\u5982 {zh_CN: "\u2026"}\uFF1B\u4E0D\u5E26 --i18n \u65F6\u4F20\u5B57\u7B26\u4E32\u53EA\u6539\u5F53\u524D\u8BED\u8A00\uFF0C\u5E26 --i18n \u5219\u6309 Map \u6574\u4EFD\u66FF\u6362'
|
|
5031
5095
|
);
|
|
5032
5096
|
}
|
|
5097
|
+
if (desc.fields.some((f) => f.valueMatch)) {
|
|
5098
|
+
lines.push(
|
|
5099
|
+
' \u2139\uFE0F (match) = \u53EF\u7528\u8BED\u4E49\u5339\u914D\uFF1Afilter \u5199 {"field":"<\u5B57\u6BB5>","op":"match","value":"<\u7B80\u79F0\u6216\u53E3\u8BED>"}\uFF0C\u670D\u52A1\u7AEF\u6309\u8BED\u4E49\u7EB3\u5165\u771F\u5B9E\u53D6\u503C\u518D\u6539\u5199\u6210 in\uFF1B\u7EB3\u5165\u4E86\u54EA\u4E9B\u503C\u3001\u662F\u5426\u964D\u7EA7\u4E3A\u5B57\u9762\u5305\u542B\uFF0C\u89C1 hcm query \u6253\u5230 stderr \u7684\u63D0\u793A'
|
|
5100
|
+
);
|
|
5101
|
+
}
|
|
5033
5102
|
lines.push(`actions (${desc.actions.length}):`);
|
|
5034
5103
|
for (const a of desc.actions) {
|
|
5035
5104
|
const call = [a.scope, a.httpMethod].filter(Boolean).join(" ");
|
|
@@ -5046,7 +5115,13 @@ function formatDescriptionTable(desc, verbose = false) {
|
|
|
5046
5115
|
);
|
|
5047
5116
|
}
|
|
5048
5117
|
if (desc.relations.length) {
|
|
5049
|
-
lines.push(`relations: ${desc.relations.map((r) =>
|
|
5118
|
+
lines.push(`relations: ${desc.relations.map((r) => {
|
|
5119
|
+
const target = r.target ? ` \u2192 ${r.target}` : "";
|
|
5120
|
+
const card = r.cardinality ? `, ${r.cardinality}${r.cardinality === "many" ? "\uFF08\u4EC5 exists\uFF09" : ""}` : "";
|
|
5121
|
+
const filter = r.filter ? `, \u8FC7\u6EE4 ${r.filter}` : "";
|
|
5122
|
+
const declared = r.declaredIn && r.declaredIn !== desc.model && !r.auto ? `, \u58F0\u660E\u4E8E ${r.declaredIn}` : "";
|
|
5123
|
+
return `${r.key}(via ${r.via}${target}${card}${filter}${declared})`;
|
|
5124
|
+
}).join(", ")}`);
|
|
5050
5125
|
}
|
|
5051
5126
|
return lines.join("\n");
|
|
5052
5127
|
}
|
|
@@ -16357,16 +16432,37 @@ var installed = async (ctx) => {
|
|
|
16357
16432
|
ctx.skills = states;
|
|
16358
16433
|
const keys = (s) => Object.keys(s.state.skills);
|
|
16359
16434
|
const count = new Set(states.flatMap(keys)).size;
|
|
16435
|
+
const localDir = skillsLocalDir(ctx.root);
|
|
16436
|
+
let local;
|
|
16437
|
+
try {
|
|
16438
|
+
local = await readLocalSkills(localDir, { strict: true });
|
|
16439
|
+
} catch (error) {
|
|
16440
|
+
if (!(error instanceof SkillsDirUnreadable)) throw error;
|
|
16441
|
+
return unknown("SKILLS_LOCAL_UNREADABLE", `${path15.relative(ctx.root, localDir)} \u8BFB\u4E0D\u4E86\uFF0C\u81EA\u5199\u6280\u80FD\u6570\u4E0D\u51FA\u6765\uFF1B${unreadableFix(error.code, error.detail)}\u540E\u91CD\u67E5`, {
|
|
16442
|
+
note: `${error.where}\uFF1A${error.detail}`
|
|
16443
|
+
});
|
|
16444
|
+
}
|
|
16445
|
+
const localNote = local.length > 0 ? `\uFF1B${path15.relative(ctx.root, localDir)}/ \u53E6\u6709 ${local.length} \u4EFD\u81EA\u5199\u6280\u80FD\uFF08\u4E0D\u8FDB\u9501\u6587\u4EF6\uFF0Csync \u4E0D\u7BA1\u5B83\u4EEC\uFF09` : "";
|
|
16360
16446
|
const target = ctx.environments.find((e) => e.report.target);
|
|
16361
16447
|
if (states.some((s) => s.state.endpoint && normalizeOrigin6(s.state.endpoint) !== normalizeOrigin6(target.config.endpoint)))
|
|
16362
16448
|
return found("SKILLS_ENDPOINT_MISMATCH", void 0, { value: count });
|
|
16363
16449
|
if (count === 0) {
|
|
16364
16450
|
const legacy = await read(path15.join(ctx.root, "hcm-skills"));
|
|
16365
|
-
|
|
16451
|
+
if (legacy && Object.keys(legacy.skills).length > 0) return found("SKILLS_LEGACY_LAYOUT", void 0, { value: count, evidence: "ABSENT" });
|
|
16452
|
+
if (local.length > 0) {
|
|
16453
|
+
return pass(
|
|
16454
|
+
`0 \u4E2A\u4EA7\u54C1\u6280\u80FD\uFF08hcm-skills/sync/ \u4E0E .claude/skills/ \u90FD\u6CA1\u6709\u9501\u6587\u4EF6\uFF09${localNote}\uFF1B\u8981\u88C5\u4EA7\u54C1\u6280\u80FD\u518D\u8DD1 sync`,
|
|
16455
|
+
{ value: local.length }
|
|
16456
|
+
);
|
|
16457
|
+
}
|
|
16458
|
+
return found("SKILLS_EMPTY", void 0, { value: count, evidence: "ABSENT" });
|
|
16366
16459
|
}
|
|
16367
16460
|
if (states.length === 2 && keys(states[0]).length > 0 && keys(states[1]).length > 0 && keys(states[0]).sort().join("\0") !== keys(states[1]).sort().join("\0"))
|
|
16368
16461
|
return found("SKILLS_SPLIT_LAYOUT", void 0, { value: count });
|
|
16369
|
-
return pass(
|
|
16462
|
+
return pass(
|
|
16463
|
+
`${count} \u4E2A\u4EA7\u54C1\u6280\u80FD\uFF08\u4E24\u4EFD\u9501\u6587\u4EF6 skills \u952E\u7684\u5E76\u96C6\uFF09\uFF1B${states.map((s) => path15.relative(ctx.root, s.baseDir)).join("\u3001")}${localNote}`,
|
|
16464
|
+
{ value: count + local.length }
|
|
16465
|
+
);
|
|
16370
16466
|
} catch (error) {
|
|
16371
16467
|
return unknown("SKILLS_STATE_UNREADABLE", void 0, {
|
|
16372
16468
|
note: `${reading}\uFF1A${safeError(error)}\uFF1B\u5148\u4FEE\u590D\u9501\u6587\u4EF6 JSON \u6216\u8BFB\u53D6\u6743\u9650\uFF08\u53EF\u4ECE\u5907\u4EFD\u6062\u590D\uFF09\uFF0C\u518D\u6309\u4E0B\u4E00\u6B65\u540C\u6B65\u5E76\u91CD\u8DD1\u4F53\u68C0`
|
|
@@ -17051,7 +17147,7 @@ var CODE_TABLE = {
|
|
|
17051
17147
|
CLI_LATEST_UNKNOWN: c("\u53D6\u4E0D\u5230 npm \u6700\u65B0\u7248\u672C\uFF1B\u68C0\u67E5 registry \u7F51\u7EDC\u540E\u91CD\u8BD5"),
|
|
17052
17148
|
CLI_VERSION_UNPARSEABLE: c("\u7248\u672C\u53F7\u4E0D\u662F X.Y.Z\uFF0C\u6BD4\u4E0D\u4E86\u65B0\u65E7\uFF1B\u5BF9\u7167 hcm --version \u4E0E npm view @hcmai/cli version --registry https://registry.npmjs.org \u7684\u539F\u6837\u8F93\u51FA\uFF0C\u91CD\u88C5\u672C\u673A CLI \u6216\u62A5\u7ED9 CLI \u7EF4\u62A4\u65B9\u540E\u91CD\u67E5"),
|
|
17053
17149
|
SKILLS_STATE_UNREADABLE: c("\u6280\u80FD\u9501\u6587\u4EF6\u65E0\u6CD5\u8BFB\u53D6\uFF1B\u4FEE\u590D\u6587\u4EF6\u540E\u540C\u6B65\u91CD\u67E5", "WARN", "FDE", both),
|
|
17054
|
-
SKILLS_EMPTY: c("\u4E24\u79CD\u5E03\u5C40\
|
|
17150
|
+
SKILLS_EMPTY: c("\u4E24\u79CD\u5E03\u5C40\u7684\u9501\u6587\u4EF6\u4E0E hcm-skills/local/ \u90FD\u6CA1\u6709\u6280\u80FD", "CRITICAL", "FDE", both),
|
|
17055
17151
|
SKILLS_LEGACY_LAYOUT: c("\u4EC5\u6709\u65E7\u6241\u5E73\u5E03\u5C40\u7684\u6280\u80FD", "WARN", "FDE", (e) => sync(e, "codex")),
|
|
17056
17152
|
SKILLS_SPLIT_LAYOUT: c("\u4E24\u79CD\u5E03\u5C40\u7684\u6280\u80FD\u96C6\u5408\u4E0D\u540C", "WARN", "FDE", both),
|
|
17057
17153
|
SKILLS_ENDPOINT_MISMATCH: c("\u6280\u80FD\u9501\u6587\u4EF6\u7684 endpoint \u4E0E\u76EE\u6807\u4E0D\u7B26", "CRITICAL", "FDE", both),
|
|
@@ -17139,7 +17235,7 @@ var CHECKS = [
|
|
|
17139
17235
|
descriptor("local.project.env", "\u9879\u76EE\u73AF\u5883", [], ["ENV_FILE_MISSING", "ENV_FILE_INVALID", "ENV_NOT_RESOLVED"], 5e3, localChecks.project),
|
|
17140
17236
|
descriptor("local.credential", "\u672C\u673A\u51ED\u636E\u69FD", ["local.project.env"], ["CREDENTIAL_MISSING"], 5e3, localChecks.credential),
|
|
17141
17237
|
descriptor("local.cli.version", "CLI \u7248\u672C", [], ["CLI_OUTDATED", "CLI_LATEST_UNKNOWN", "CLI_VERSION_UNPARSEABLE"], 1e4, localChecks.version),
|
|
17142
|
-
descriptor("local.skills.installed", "\u6280\u80FD", ["local.project.env"], ["SKILLS_STATE_UNREADABLE", "SKILLS_EMPTY", "SKILLS_LEGACY_LAYOUT", "SKILLS_SPLIT_LAYOUT", "SKILLS_ENDPOINT_MISMATCH"], 5e3, localChecks.installed),
|
|
17238
|
+
descriptor("local.skills.installed", "\u6280\u80FD", ["local.project.env"], ["SKILLS_STATE_UNREADABLE", "SKILLS_EMPTY", "SKILLS_LEGACY_LAYOUT", "SKILLS_SPLIT_LAYOUT", "SKILLS_ENDPOINT_MISMATCH", "SKILLS_LOCAL_UNREADABLE"], 5e3, localChecks.installed),
|
|
17143
17239
|
descriptor("local.skills.fresh", "\u6280\u80FD\u65B0\u9C9C\u5EA6", ["local.skills.installed"], ["SKILLS_STALE", "SKILLS_LOCALLY_MODIFIED", "SKILLS_CATALOG_UNCHECKED", "SKILLS_CATALOG_UNAVAILABLE"], 1e4, localChecks.fresh),
|
|
17144
17240
|
descriptor("local.skills.shadow", "\u672C\u5730\u906E\u853D", [], ["SKILLS_LOCAL_SHADOW", "SKILLS_LOCAL_UNREADABLE"], 5e3, localChecks.shadow),
|
|
17145
17241
|
descriptor("local.boundary", "\u9879\u76EE\u8FB9\u754C", [], ["BOUNDARY_MISSING", "BOUNDARY_FALLBACK"], 5e3, localChecks.boundary),
|
|
@@ -17936,7 +18032,7 @@ var localCriterion = {
|
|
|
17936
18032
|
"local.project.env": "env.yaml \u5B58\u5728\u3001\u53EF\u89E3\u6790\uFF0C\u76EE\u6807\u73AF\u5883\u80FD\u89E3\u6790\u5230\u9879\u76EE\u73AF\u5883",
|
|
17937
18033
|
"local.credential": "\u6BCF\u4E2A\u9879\u76EE\u73AF\u5883\u6709\u5339\u914D endpoint \u4E0E\u79DF\u6237\u7684\u672C\u673A\u51ED\u636E\u69FD",
|
|
17938
18034
|
"local.cli.version": "\u4E0E npm \u6700\u65B0 CLI \u7248\u672C\u6BD4\u8F83",
|
|
17939
|
-
"local.skills.installed": "\u4E24\u79CD\u5E03\u5C40\u7684\
|
|
18035
|
+
"local.skills.installed": "\u4E24\u79CD\u5E03\u5C40\u7684\u9501\u6587\u4EF6\u5E76\u96C6\u52A0 hcm-skills/local/ \u81EA\u5199\u6280\u80FD\u3001\u9501\u6587\u4EF6\u4E0E\u76EE\u6807\u73AF\u5883\u4E00\u81F4",
|
|
17940
18036
|
"local.skills.fresh": "\u672C\u673A\u6280\u80FD\u4E0E\u76EE\u6807\u73AF\u5883\u7684\u4EA7\u54C1\u6280\u80FD\u76EE\u5F55\u5BF9\u8D26",
|
|
17941
18037
|
"local.skills.shadow": "hcm-skills/local/ \u91CC\u4E0E hcm-skills/sync/ \u540C id \u7684\u6280\u80FD\uFF08\u540C\u540D\u65F6\u751F\u6548\u7684\u662F local/\uFF0C\u4EA7\u54C1\u7248\u88AB\u538B\u4F4F\uFF09\uFF1B\u6709\u5C31 WARN \u5E76\u5217\u51FA id \u4E0E local \u90A3\u4EFD\u7684\u9996\u884C\u8BF4\u660E\u3002local/ \u8BFB\u4E0D\u4E86\u3001\u6216 sync/ \u91CC\u4E0E local/ \u540C id \u7684\u90A3\u4EFD\u8BFB\u4E0D\u4E86\uFF0C\u5224 UNDETERMINED\uFF1Bsync/ \u91CC\u4E0E local/ \u65E0\u5173\u7684\u6761\u76EE\u8BFB\u4E0D\u4E86\u4E0D\u6321\u7ED3\u8BBA\uFF0C\u6458\u8981\u5217\u51FA\u3001note \u5E26\u539F\u59CB\u62A5\u9519\uFF1Bsync/ \u8BFB\u5F97\u4E86\u7684\u4E00\u4EFD\u90FD\u6CA1\u6709\u53C8\u6709\u8BFB\u4E0D\u4E86\u7684\uFF0C\u5224 UNDETERMINED",
|
|
17942
18038
|
"local.boundary": "\u9879\u76EE\u8FB9\u754C\u5757\u5B58\u5728\uFF0C\u4E14\u4E0D\u662F CLI fallback \u526F\u672C",
|
|
@@ -19539,6 +19635,7 @@ function classify(argv, actionResolution) {
|
|
|
19539
19635
|
return guarded("managed-local-write", "workspace-local-change");
|
|
19540
19636
|
}
|
|
19541
19637
|
if (subcommand === "cleanup") return guarded("tenant-write", "workspace-cleanup");
|
|
19638
|
+
if (subcommand === "cancel-release") return guarded("tenant-write", "workspace-release-cancel");
|
|
19542
19639
|
if (subcommand === "rm") return guarded("managed-local-write", "workspace-local-change");
|
|
19543
19640
|
if (subcommand === "create") return guarded("tenant-write", "workspace-create");
|
|
19544
19641
|
if (subcommand === "activate") return guarded("tenant-write", "workspace-activate");
|
|
@@ -21468,7 +21565,8 @@ for (const definition of [
|
|
|
21468
21565
|
item.action((opts) => definition.run(opts));
|
|
21469
21566
|
}
|
|
21470
21567
|
workspace.command("cleanup-plan <paths...>").description("\u53EA\u8BFB\u5C55\u5F00\u8F85\u52A9\u7269\u6599\u6E05\u7406\u5019\u9009\uFF1B\u5C55\u793A\u5DF2\u77E5\u6D88\u8D39\u8005\u68C0\u67E5\u8986\u76D6\uFF0Cowner \u987B\u58F0\u660E\u53EF\u4EE5\u4E22\u5F03").option("--workspace <key>", "\u5F00\u53D1\u7A7A\u95F4 key\uFF1B\u672A\u63D0\u4F9B\u65F6\u8BFB\u53D6\u672C\u5730\u7ED1\u5B9A").option("--dir <path>", "\u5DE5\u4F5C\u7A7A\u95F4\u672C\u5730\u76EE\u5F55", ".").option("--env <name>", "\u672C\u6B21\u4F7F\u7528\u7684\u9879\u76EE\u73AF\u5883\u540D\u6216\u672C\u673A\u69FD\u540D").option("--as <identity>", "\u4E34\u65F6\u6362\u8EAB\u4EFD").option("--profile <name>", "[deprecated] \u7528 --env \u66FF\u4EE3").requiredOption("--purpose <text>", "\u5019\u9009\u6750\u6599\u7528\u9014\u8BF4\u660E").requiredOption("--reason <text>", "\u6E05\u7406\u539F\u56E0").option("--owner-declaration", "\u58F0\u660E\u8FD9\u4E9B\u6750\u6599\u53EF\u4EE5\u4E22\u5F03\uFF1B\u4E0D\u80FD\u7ED5\u8FC7\u5DF2\u77E5\u8D44\u4EA7\u3001\u5F15\u7528\u6216\u5220\u9664\u610F\u56FE\u68C0\u67E5").option("--plan <path>", "\u628A\u539F execution \u4E0E\u6458\u8981\u4FDD\u5B58\u5230 workspace \u5916\u7684\u65B0 JSON \u6587\u4EF6").option("--output <fmt>", "\u8F93\u51FA\u683C\u5F0F\uFF1Atable | json | yaml", "json").action((paths, opts) => workspaceCleanupPlanCommand(paths, opts));
|
|
21471
|
-
workspace.command("release-plan <version>").description("\u53EA\u8BFB\u9884\u68C0\u672C\u6B21\u771F\u5B9E patch \u6587\u4EF6\u4E0E\u5220\u9664\u96C6\uFF0C\u751F\u6210\u7ED1\u5B9A\u7248\u672C\u548C\u5185\u5BB9\u7684\u5C01\u7BB1\u6458\u8981").option("--workspace <key>", "\u5F00\u53D1\u7A7A\u95F4 key\uFF1B\u672A\u63D0\u4F9B\u65F6\u8BFB\u53D6\u672C\u5730\u7ED1\u5B9A").option("--dir <path>", "\u5DE5\u4F5C\u7A7A\u95F4\u672C\u5730\u76EE\u5F55", ".").option("--env <name>", "\u672C\u6B21\u4F7F\u7528\u7684\u9879\u76EE\u73AF\u5883\u540D\u6216\u672C\u673A\u69FD\u540D").option("--as <identity>", "\u4E34\u65F6\u6362\u8EAB\u4EFD").option("--profile <name>", "[deprecated] \u7528 --env \u66FF\u4EE3").option("--plan <path>", "\u628A\u539F\u9884\u68C0\u56DE\u6267\u4FDD\u5B58\u5230 workspace \u5916\u7684\u65B0 JSON \u6587\u4EF6").option("--output <fmt>", "\u8F93\u51FA\u683C\u5F0F\uFF1Atable | json | yaml", "json").action((version2, opts) => workspaceReleasePlanCommand(version2, opts));
|
|
21568
|
+
workspace.command("release-plan <version>").description("\u53EA\u8BFB\u9884\u68C0\u672C\u6B21\u771F\u5B9E patch \u6587\u4EF6\u4E0E\u5220\u9664\u96C6\uFF0C\u751F\u6210\u7ED1\u5B9A\u7248\u672C\u548C\u5185\u5BB9\u7684\u5C01\u7BB1\u6458\u8981").option("--workspace <key>", "\u5F00\u53D1\u7A7A\u95F4 key\uFF1B\u672A\u63D0\u4F9B\u65F6\u8BFB\u53D6\u672C\u5730\u7ED1\u5B9A").option("--dir <path>", "\u5DE5\u4F5C\u7A7A\u95F4\u672C\u5730\u76EE\u5F55", ".").option("--env <name>", "\u672C\u6B21\u4F7F\u7528\u7684\u9879\u76EE\u73AF\u5883\u540D\u6216\u672C\u673A\u69FD\u540D").option("--as <identity>", "\u4E34\u65F6\u6362\u8EAB\u4EFD").option("--profile <name>", "[deprecated] \u7528 --env \u66FF\u4EE3").option("--plan <path>", "\u628A\u539F\u9884\u68C0\u56DE\u6267\u4FDD\u5B58\u5230 workspace \u5916\u7684\u65B0 JSON \u6587\u4EF6").option("--policy-version <id>", "\u53D1\u5E03\u8303\u56F4\uFF1ARUNTIME_ASSETS_V2 \u6216 ALL_WORKSPACE_PATCH_FILES_V1", "RUNTIME_ASSETS_V2").option("--output <fmt>", "\u8F93\u51FA\u683C\u5F0F\uFF1Atable | json | yaml", "json").action((version2, opts) => workspaceReleasePlanCommand(version2, opts));
|
|
21569
|
+
workspace.command("cancel-release <releaseId>").description("\u53D6\u6D88\u672A\u4F7F\u7528\u7684 CREATED \u5236\u54C1\uFF1B\u4FDD\u7559\u5236\u54C1\u6587\u4EF6\u3001\u5BA1\u8BA1\u548C\u7248\u672C\u5360\u4F4D").option("--workspace <key>", "\u5F00\u53D1\u7A7A\u95F4 key\uFF1B\u672A\u63D0\u4F9B\u65F6\u8BFB\u53D6\u672C\u5730\u7ED1\u5B9A").option("--dir <path>", "\u5DE5\u4F5C\u7A7A\u95F4\u672C\u5730\u76EE\u5F55", ".").option("--env <name>", "\u672C\u6B21\u4F7F\u7528\u7684\u9879\u76EE\u73AF\u5883\u540D\u6216\u672C\u673A\u69FD\u540D").option("--as <identity>", "\u4E34\u65F6\u6362\u8EAB\u4EFD").option("--profile <name>", "[deprecated] \u7528 --env \u66FF\u4EE3").requiredOption("--reason <text>", "\u53D6\u6D88\u539F\u56E0\uFF0C\u6700\u591A 1800 \u5B57").option("--output <fmt>", "\u8F93\u51FA\u683C\u5F0F\uFF1Atable | json | yaml", "json").action((releaseId, opts) => workspaceCancelReleaseCommand(releaseId, opts));
|
|
21472
21570
|
var workspaceAdd = workspace.command("add").description("\u5411\u5DF2\u7ED1\u5B9A\u5F00\u53D1\u7A7A\u95F4\u6DFB\u52A0 artifact");
|
|
21473
21571
|
workspaceAdd.command("mini <appCode>").description("\u65B0\u589E\u8F7B\u5E94\u7528 artifact\uFF08\u5199\u5165 mini_apps/<appCode>/\uFF09").option("--dir <path>", "\u5DE5\u4F5C\u7A7A\u95F4\u672C\u5730\u76EE\u5F55", ".").option("--name <name>", "\u8F7B\u5E94\u7528\u5C55\u793A\u540D").option("--template <kind>", "\u6A21\u677F\uFF1Adashboard | multi-page | writable-workbench", "dashboard").option("--sdk-version <semver>", "\u76EE\u6807 Core \u7684\u8F7B\u5E94\u7528\u8FD0\u884C\u65F6 ABI\uFF08\u9ED8\u8BA4 0.1.0\uFF0C\u72EC\u7ACB\u4E8E CLI \u5305\u7248\u672C\uFF1B\u4E0D\u63A2\u6D4B\u7EBF\u4E0A\u7248\u672C\uFF09").option("--model <Model>", "\u53EF\u5199\u5DE5\u4F5C\u53F0\u7ED1\u5B9A\u7684 Model\uFF0C\u4F8B\u5982 OrgUnit").option("--fields <csv|auto>", "\u53EF\u5199\u5DE5\u4F5C\u53F0\u8868\u5355\u5B57\u6BB5\u5217\u8868\uFF1B\u4F20 auto \u65F6\u6839\u636E Model \u5143\u6570\u636E\u63A8\u65AD").option("--defaults <JSON|auto>", "\u53EF\u5199\u5DE5\u4F5C\u53F0\u521B\u5EFA\u9ED8\u8BA4\u503C\uFF1B\u4F20 auto \u65F6\u6839\u636E Model \u5143\u6570\u636E\u63A8\u65AD").option(
|
|
21474
21572
|
"--surface <surface>",
|