@hcmai/cli 0.4.4 → 0.4.6

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/dist/index.js CHANGED
@@ -2286,9 +2286,9 @@ async function loginCommand(args) {
2286
2286
  } catch (e) {
2287
2287
  const err = e;
2288
2288
  if (err.isAxiosError) {
2289
- const { fromAxiosError: fromAxiosError21 } = await import("@hcmai/sdk");
2289
+ const { fromAxiosError: fromAxiosError22 } = await import("@hcmai/sdk");
2290
2290
  exitWithError(
2291
- fromAxiosError21(
2291
+ fromAxiosError22(
2292
2292
  e,
2293
2293
  envName
2294
2294
  )
@@ -3211,29 +3211,29 @@ import {
3211
3211
  import chalk2 from "chalk";
3212
3212
  import * as fs4 from "fs/promises";
3213
3213
  function parseInjectOn(s) {
3214
- const fail5 = (detail) => {
3214
+ const fail6 = (detail) => {
3215
3215
  throw new CliError13({
3216
3216
  code: CliErrorCode12.INVALID_ARGUMENT,
3217
3217
  message: `--inject-on \u683C\u5F0F <eventType>:<action>[:<arg>]\uFF0Caction \u2208 {interrupt, steer}\uFF08steer \u5FC5\u987B\u5E26 content\uFF09\uFF1B${detail}\uFF0C\u6536\u5230 "${s}"`
3218
3218
  });
3219
3219
  };
3220
3220
  const firstColon = s.indexOf(":");
3221
- if (firstColon < 0) return fail5("\u7F3A\u5C11 action \u6BB5");
3221
+ if (firstColon < 0) return fail6("\u7F3A\u5C11 action \u6BB5");
3222
3222
  const eventType = s.slice(0, firstColon);
3223
3223
  const rest = s.slice(firstColon + 1);
3224
3224
  const secondColon = rest.indexOf(":");
3225
3225
  const action = secondColon < 0 ? rest : rest.slice(0, secondColon);
3226
3226
  const arg = secondColon < 0 ? void 0 : rest.slice(secondColon + 1);
3227
- if (!eventType) return fail5("eventType \u6BB5\u4E3A\u7A7A");
3227
+ if (!eventType) return fail6("eventType \u6BB5\u4E3A\u7A7A");
3228
3228
  if (action === "interrupt") {
3229
- if (arg !== void 0) return fail5("interrupt \u4E0D\u63A5\u53D7 arg");
3229
+ if (arg !== void 0) return fail6("interrupt \u4E0D\u63A5\u53D7 arg");
3230
3230
  return { eventType, action: "interrupt" };
3231
3231
  }
3232
3232
  if (action === "steer") {
3233
- if (arg === void 0 || arg === "") return fail5("steer \u5FC5\u987B\u5E26 content\uFF08arg\uFF09");
3233
+ if (arg === void 0 || arg === "") return fail6("steer \u5FC5\u987B\u5E26 content\uFF08arg\uFF09");
3234
3234
  return { eventType, action: "steer", arg };
3235
3235
  }
3236
- return fail5(`\u672A\u77E5 action "${action}"`);
3236
+ return fail6(`\u672A\u77E5 action "${action}"`);
3237
3237
  }
3238
3238
  function parseOnConfirm(s) {
3239
3239
  if (s === "approve") return { decision: "approve" };
@@ -4258,20 +4258,131 @@ async function cacheClearMetaCommand(model, args) {
4258
4258
  }
4259
4259
  }
4260
4260
 
4261
- // src/commands/upload.ts
4261
+ // src/commands/script.ts
4262
4262
  init_exit();
4263
4263
  init_auth_guard();
4264
+ import { readFileSync as readFileSync3 } from "fs";
4264
4265
  import {
4265
4266
  HcmClient as HcmClient14,
4266
4267
  formatObject as formatObject12,
4267
4268
  fromAxiosError as fromAxiosError12,
4269
+ scriptDryRun,
4270
+ validateScriptManifest,
4271
+ queryScriptLogs,
4272
+ getScriptTask
4273
+ } from "@hcmai/sdk";
4274
+ async function withClient2(args, fn) {
4275
+ const client3 = HcmClient14.fromAuthContext(await getActiveAuthContextFromCli(args));
4276
+ return fn(client3);
4277
+ }
4278
+ function emit2(result, args, human) {
4279
+ const fmt = args.output ?? "json";
4280
+ if (fmt !== "json") process.stdout.write(human + "\n");
4281
+ process.stdout.write(formatObject12(result, { format: fmt }) + "\n");
4282
+ process.exit(0);
4283
+ }
4284
+ function fail3(e, args) {
4285
+ const err = e;
4286
+ if (err?.isAxiosError) exitWithError(fromAxiosError12(err, args.env));
4287
+ exitWithError(e);
4288
+ process.exit(1);
4289
+ }
4290
+ function parseJsonArg(raw, field) {
4291
+ if (raw === void 0) return void 0;
4292
+ try {
4293
+ const parsed = JSON.parse(raw);
4294
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
4295
+ throw new Error(`${field} \u5FC5\u987B\u662F JSON \u5BF9\u8C61\uFF0C\u5B9E\u9645\u662F ${Array.isArray(parsed) ? "\u6570\u7EC4" : typeof parsed}`);
4296
+ }
4297
+ return parsed;
4298
+ } catch (e) {
4299
+ throw new Error(`--${field} \u4E0D\u662F\u5408\u6CD5 JSON \u5BF9\u8C61\uFF1A${e.message}
4300
+ \u6536\u5230\uFF1A${raw}`);
4301
+ }
4302
+ }
4303
+ async function scriptDryRunCommand(args) {
4304
+ try {
4305
+ if (!args.scriptKey) {
4306
+ throw new Error("\u7F3A\u5C11 --script-key\n \u4E0B\u4E00\u6B65\uFF1Ahcm script dry-run --script-key <scriptKey>");
4307
+ }
4308
+ if (args.params && args.paramsFile) {
4309
+ throw new Error("--params \u4E0E --params-file \u4E92\u65A5\uFF0C\u4E8C\u9009\u4E00");
4310
+ }
4311
+ const rawParams = args.paramsFile ? readFileSync3(args.paramsFile, "utf8") : args.params;
4312
+ const request = {
4313
+ scriptKey: args.scriptKey,
4314
+ modelKey: args.model,
4315
+ actionKey: args.action,
4316
+ scope: args.scope,
4317
+ httpMethod: args.method,
4318
+ targetId: args.targetId,
4319
+ params: parseJsonArg(rawParams, "params"),
4320
+ context: parseJsonArg(args.context, "context"),
4321
+ event: parseJsonArg(args.event, "event"),
4322
+ timeoutMs: args.timeout ? Number(args.timeout) : void 0
4323
+ };
4324
+ const result = await withClient2(args, (c) => scriptDryRun(c.raw(), request));
4325
+ const intents = Array.isArray(result?.writeIntents) ? result.writeIntents.length : 0;
4326
+ emit2(result, args, `\u{1F9EA} dry-run \u5B8C\u6210\uFF1A${args.scriptKey}\uFF08\u62E6\u4E0B ${intents} \u4E2A\u5199\u610F\u56FE\uFF09`);
4327
+ } catch (e) {
4328
+ fail3(e, args);
4329
+ }
4330
+ }
4331
+ async function scriptManifestValidateCommand(args) {
4332
+ try {
4333
+ if (!args.file) {
4334
+ throw new Error("\u7F3A\u5C11 --file\n \u4E0B\u4E00\u6B65\uFF1Ahcm script manifest-validate --file ./manifest.yml");
4335
+ }
4336
+ const yaml = readFileSync3(args.file, "utf8");
4337
+ const result = await withClient2(args, (c) => validateScriptManifest(c.raw(), yaml));
4338
+ emit2(result, args, `\u{1F4CB} manifest \u6821\u9A8C\u5B8C\u6210\uFF1A${args.file}`);
4339
+ } catch (e) {
4340
+ fail3(e, args);
4341
+ }
4342
+ }
4343
+ async function scriptLogsCommand(args) {
4344
+ try {
4345
+ const page = await withClient2(
4346
+ args,
4347
+ (c) => queryScriptLogs(c.raw(), {
4348
+ scriptKey: args.scriptKey,
4349
+ status: args.status,
4350
+ mode: args.mode,
4351
+ dryRun: args.dryRun,
4352
+ from: args.from,
4353
+ to: args.to,
4354
+ page: args.page ? Number(args.page) : void 0,
4355
+ size: args.size ? Number(args.size) : void 0
4356
+ })
4357
+ );
4358
+ emit2(page, args, "\u{1F4DC} \u811A\u672C\u6267\u884C\u65E5\u5FD7");
4359
+ } catch (e) {
4360
+ fail3(e, args);
4361
+ }
4362
+ }
4363
+ async function scriptTaskCommand(taskId, args) {
4364
+ try {
4365
+ const task = await withClient2(args, (c) => getScriptTask(c.raw(), taskId));
4366
+ emit2(task, args, `\u2699\uFE0F \u4EFB\u52A1 ${taskId}\uFF1A${task?.status ?? "\u672A\u77E5"}\uFF08\u7B2C ${task?.attempts ?? "?"}/${task?.maxAttempts ?? "?"} \u6B21\uFF09`);
4367
+ } catch (e) {
4368
+ fail3(e, args);
4369
+ }
4370
+ }
4371
+
4372
+ // src/commands/upload.ts
4373
+ init_exit();
4374
+ init_auth_guard();
4375
+ import {
4376
+ HcmClient as HcmClient15,
4377
+ formatObject as formatObject13,
4378
+ fromAxiosError as fromAxiosError13,
4268
4379
  uploadDocument as uploadDocument2
4269
4380
  } from "@hcmai/sdk";
4270
4381
  var DEFAULT_UPLOAD_CATEGORY = "attachment";
4271
4382
  async function uploadCommand(filePath, args) {
4272
4383
  try {
4273
4384
  const ctx = await getActiveAuthContextFromCli(args);
4274
- const client3 = HcmClient14.fromAuthContext(ctx);
4385
+ const client3 = HcmClient15.fromAuthContext(ctx);
4275
4386
  const meta2 = await uploadDocument2(
4276
4387
  client3.raw(),
4277
4388
  filePath,
@@ -4284,7 +4395,7 @@ async function uploadCommand(filePath, args) {
4284
4395
  `
4285
4396
  );
4286
4397
  }
4287
- process.stdout.write(formatObject12(meta2, { format: fmt }) + "\n");
4398
+ process.stdout.write(formatObject13(meta2, { format: fmt }) + "\n");
4288
4399
  process.exit(0);
4289
4400
  } catch (e) {
4290
4401
  const err = e;
@@ -4294,7 +4405,7 @@ async function uploadCommand(filePath, args) {
4294
4405
  } else if (status === 413) {
4295
4406
  exitWithError(new Error("\u6587\u4EF6\u8D85\u51FA\u670D\u52A1\u7AEF\u5927\u5C0F\u4E0A\u9650\uFF08413\uFF09"));
4296
4407
  } else if (err?.isAxiosError) {
4297
- exitWithError(fromAxiosError12(err, args.env));
4408
+ exitWithError(fromAxiosError13(err, args.env));
4298
4409
  } else {
4299
4410
  exitWithError(e);
4300
4411
  }
@@ -4322,8 +4433,8 @@ import {
4322
4433
  resolveAllSkillsInstallOrder,
4323
4434
  matchSkills,
4324
4435
  filterByStage,
4325
- formatObject as formatObject14,
4326
- fromAxiosError as fromAxiosError13,
4436
+ formatObject as formatObject15,
4437
+ fromAxiosError as fromAxiosError14,
4327
4438
  loadEnv as loadEnv5,
4328
4439
  loadGlobalConfig as loadGlobalConfig6,
4329
4440
  resolveActiveEnv as resolveActiveEnv3,
@@ -4450,11 +4561,11 @@ import * as path3 from "path";
4450
4561
  import { CliError as CliError15, CliErrorCode as CliErrorCode14, assertSafeReferencePath, parseSkillRequirements } from "@hcmai/sdk";
4451
4562
 
4452
4563
  // src/commands/skills-manifest.ts
4453
- import { readFileSync as readFileSync3, readdirSync as readdirSync2, statSync as statSync3, existsSync } from "fs";
4564
+ import { readFileSync as readFileSync4, readdirSync as readdirSync2, statSync as statSync3, existsSync } from "fs";
4454
4565
  import { createHash } from "crypto";
4455
4566
  import * as path2 from "path";
4456
4567
  import { fileURLToPath } from "url";
4457
- import { formatObject as formatObject13, parseSkillFrontmatter } from "@hcmai/sdk";
4568
+ import { formatObject as formatObject14, parseSkillFrontmatter } from "@hcmai/sdk";
4458
4569
  function collectCommandSurface(root) {
4459
4570
  const out = [];
4460
4571
  const walk = (cmd, prefix) => {
@@ -4495,11 +4606,11 @@ function collectBundledSkills(dir = bundledSkillsDir()) {
4495
4606
  if (!files.includes("SKILL.md")) continue;
4496
4607
  let bytes = 0;
4497
4608
  const fileRows = files.map((rel) => {
4498
- const buf = readFileSync3(path2.join(skillDir, rel));
4609
+ const buf = readFileSync4(path2.join(skillDir, rel));
4499
4610
  bytes += buf.byteLength;
4500
4611
  return { path: rel, bytes: buf.byteLength, sha256: sha256(buf) };
4501
4612
  });
4502
- const body = readFileSync3(path2.join(skillDir, "SKILL.md"), "utf8");
4613
+ const body = readFileSync4(path2.join(skillDir, "SKILL.md"), "utf8");
4503
4614
  const fm = parseSkillFrontmatter(body, id);
4504
4615
  out.push({
4505
4616
  id,
@@ -4525,7 +4636,7 @@ function buildManifest(root, skillsDir = bundledSkillsDir()) {
4525
4636
  }
4526
4637
  function skillsManifestCommand(root, args) {
4527
4638
  const manifest2 = buildManifest(root);
4528
- process.stdout.write(formatObject13(manifest2, { format: args.output ?? "json" }) + "\n");
4639
+ process.stdout.write(formatObject14(manifest2, { format: args.output ?? "json" }) + "\n");
4529
4640
  }
4530
4641
  function str(v) {
4531
4642
  return typeof v === "string" && v ? v : void 0;
@@ -4716,12 +4827,12 @@ async function chironClient(args) {
4716
4827
  });
4717
4828
  return { http, endpoint, base: await resolveChironBase(http) };
4718
4829
  }
4719
- function fail3(e, args) {
4830
+ function fail4(e, args) {
4720
4831
  const err = e;
4721
4832
  if (err?.response?.status === 404) {
4722
4833
  exitWithError(new Error("\u8BE5\u73AF\u5883\u6CA1\u6709\u8FD9\u4E2A\u6280\u80FD \u2014\u2014 \u8DD1 `hcm skills list` \u770B\u76EE\u5F55\uFF08\u6280\u80FD\u968F\u4EA7\u54C1\u7248\u672C\u8D70\uFF09"));
4723
4834
  }
4724
- if (err?.isAxiosError) exitWithError(fromAxiosError13(err, args.env));
4835
+ if (err?.isAxiosError) exitWithError(fromAxiosError14(err, args.env));
4725
4836
  exitWithError(e);
4726
4837
  process.exit(1);
4727
4838
  }
@@ -4772,7 +4883,7 @@ async function skillsListCommand(keyword, args) {
4772
4883
  }
4773
4884
  if (fmt === "json" || fmt === "yaml") {
4774
4885
  process.stdout.write(
4775
- formatObject14(
4886
+ formatObject15(
4776
4887
  {
4777
4888
  ...manifest2 ?? {},
4778
4889
  categories: cats,
@@ -4845,7 +4956,7 @@ async function skillsListCommand(keyword, args) {
4845
4956
  `);
4846
4957
  process.exit(0);
4847
4958
  } catch (e) {
4848
- fail3(e, args);
4959
+ fail4(e, args);
4849
4960
  }
4850
4961
  }
4851
4962
  async function listInstalledSkills(keyword, args) {
@@ -4854,7 +4965,7 @@ async function listInstalledSkills(keyword, args) {
4854
4965
  const fmt = args.output ?? "table";
4855
4966
  if (!state || Object.keys(state.skills).length === 0) {
4856
4967
  if (fmt === "json" || fmt === "yaml") {
4857
- process.stdout.write(formatObject14({ baseDir: layout.baseDir, target: layout.target, all: false, skills: [] }, { format: fmt }) + "\n");
4968
+ process.stdout.write(formatObject15({ baseDir: layout.baseDir, target: layout.target, all: false, skills: [] }, { format: fmt }) + "\n");
4858
4969
  process.exit(0);
4859
4970
  }
4860
4971
  process.stdout.write(`${path4.join(layout.baseDir, SKILLS_STATE_FILE)} \u4E0D\u5B58\u5728\u6216\u4E3A\u7A7A \u2014\u2014 \u8FD9\u4E2A\u76EE\u5F55\u4E0B\u8FD8\u6CA1\u7528\u672C CLI \u88C5\u8FC7\u6280\u80FD\u3002
@@ -4887,7 +4998,7 @@ async function listInstalledSkills(keyword, args) {
4887
4998
  const shown = sourceFilter === "all" ? byKeyword : byKeyword.filter((row) => row.sourceKind === sourceFilter);
4888
4999
  const groupOf = (kind) => kind === "cli" ? "CLI \u81EA\u5E26" : kind === "local" ? "\u672C\u5730\u76EE\u5F55\u88C5\u7684" : "\u777F\u620E\u6280\u80FD\u5E93";
4889
5000
  if (fmt === "json" || fmt === "yaml") {
4890
- process.stdout.write(formatObject14({
5001
+ process.stdout.write(formatObject15({
4891
5002
  baseDir: layout.baseDir,
4892
5003
  target: layout.target,
4893
5004
  endpoint: state.endpoint,
@@ -4956,7 +5067,7 @@ async function skillsShowCommand(id, args) {
4956
5067
  process.stdout.write(md.endsWith("\n") ? md : md + "\n");
4957
5068
  process.exit(0);
4958
5069
  } catch (e) {
4959
- fail3(e, args);
5070
+ fail4(e, args);
4960
5071
  }
4961
5072
  }
4962
5073
  async function skillsInstallCommand(id, args) {
@@ -5086,7 +5197,7 @@ async function skillsInstallCommand(id, args) {
5086
5197
  const agents = layout.agentsFile ? await syncAgentsIndex(layout, manifest2) : void 0;
5087
5198
  const fmt = args.output ?? "table";
5088
5199
  if (fmt === "json" || fmt === "yaml") {
5089
- process.stdout.write(formatObject14({ ...result, all, target_agent: layout.target, agentsFile: layout.agentsFile, agents, conflictCheck: conflictNote ? { checked: false, note: conflictNote } : { checked: true } }, { format: fmt }) + "\n");
5200
+ process.stdout.write(formatObject15({ ...result, all, target_agent: layout.target, agentsFile: layout.agentsFile, agents, conflictCheck: conflictNote ? { checked: false, note: conflictNote } : { checked: true } }, { format: fmt }) + "\n");
5090
5201
  } else {
5091
5202
  const headline = all ? `\u2705 \u5168\u90E8 ${requestedIds.length} \u4E2A\u6280\u80FD \u2192 ${result.baseDir}` : `\u2705 ${id} \u2192 ${path4.join(result.baseDir, id, "SKILL.md")}`;
5092
5203
  process.stdout.write(`${headline}
@@ -5118,7 +5229,7 @@ async function skillsInstallCommand(id, args) {
5118
5229
  }
5119
5230
  process.exit(0);
5120
5231
  } catch (e) {
5121
- fail3(e, args);
5232
+ fail4(e, args);
5122
5233
  }
5123
5234
  }
5124
5235
  var FETCH_CONCURRENCY = 6;
@@ -5651,7 +5762,7 @@ async function skillsUpdateCommand(args) {
5651
5762
  const changed = plan.entries.filter((e) => e.status === "updated" || e.status === "added");
5652
5763
  const fmt = args.output ?? "table";
5653
5764
  if (fmt === "json" || fmt === "yaml") {
5654
- process.stdout.write(formatObject14({
5765
+ process.stdout.write(formatObject15({
5655
5766
  endpoint,
5656
5767
  baseDir: layout.baseDir,
5657
5768
  target: layout.target,
@@ -5722,7 +5833,7 @@ async function skillsUpdateCommand(args) {
5722
5833
  }
5723
5834
  process.exit(0);
5724
5835
  } catch (e) {
5725
- fail3(e, args);
5836
+ fail4(e, args);
5726
5837
  }
5727
5838
  }
5728
5839
 
@@ -5730,8 +5841,8 @@ async function skillsUpdateCommand(args) {
5730
5841
  import {
5731
5842
  bootstrapTenant,
5732
5843
  createHttpClient as createHttpClient3,
5733
- formatObject as formatObject15,
5734
- fromAxiosError as fromAxiosError14,
5844
+ formatObject as formatObject16,
5845
+ fromAxiosError as fromAxiosError15,
5735
5846
  loadEnv as loadEnv6,
5736
5847
  loadGlobalConfig as loadGlobalConfig7,
5737
5848
  resolveActiveEnv as resolveActiveEnv4,
@@ -5822,14 +5933,14 @@ async function tenantBootstrapCommand(args) {
5822
5933
  `
5823
5934
  );
5824
5935
  }
5825
- process.stdout.write(formatObject15(result, { format: fmt }) + "\n");
5936
+ process.stdout.write(formatObject16(result, { format: fmt }) + "\n");
5826
5937
  process.exit(0);
5827
5938
  } catch (e) {
5828
5939
  const err = e;
5829
5940
  if (err?.response?.status === 403) {
5830
5941
  exitWithError(new Error("bootstrap key \u65E0\u6548\uFF08403\uFF09\u2014\u2014 \u6838\u5BF9\u90E8\u7F72\u65B9\u63D0\u4F9B\u7684 key\uFF0C\u52FF\u590D\u7528\u5176\u4ED6\u73AF\u5883\u7684"));
5831
5942
  } else if (err?.isAxiosError) {
5832
- exitWithError(fromAxiosError14(err, args.env));
5943
+ exitWithError(fromAxiosError15(err, args.env));
5833
5944
  } else {
5834
5945
  exitWithError(e);
5835
5946
  }
@@ -5839,9 +5950,9 @@ async function tenantBootstrapCommand(args) {
5839
5950
  // src/commands/meta.ts
5840
5951
  import { promises as fsp3 } from "fs";
5841
5952
  import {
5842
- HcmClient as HcmClient15,
5843
- formatObject as formatObject16,
5844
- fromAxiosError as fromAxiosError15,
5953
+ HcmClient as HcmClient16,
5954
+ formatObject as formatObject17,
5955
+ fromAxiosError as fromAxiosError16,
5845
5956
  listTenantMeta,
5846
5957
  getTenantMeta,
5847
5958
  saveTenantMeta,
@@ -5852,16 +5963,16 @@ import {
5852
5963
  init_exit();
5853
5964
  init_auth_guard();
5854
5965
  async function client2(args) {
5855
- return HcmClient15.fromAuthContext(await getActiveAuthContextFromCli(args));
5966
+ return HcmClient16.fromAuthContext(await getActiveAuthContextFromCli(args));
5856
5967
  }
5857
- function fail4(e, args) {
5968
+ function fail5(e, args) {
5858
5969
  const err = e;
5859
5970
  if (err?.response?.status === 403) {
5860
5971
  exitWithError(
5861
5972
  new Error("\u5143\u6570\u636E\u5199\u5165\u88AB\u62D2\uFF08403\uFF09\u2014\u2014 \u9700 config-admin \u8EAB\u4EFD\u4E14\u5F53\u524D source \u53EF\u5199\uFF1B\u82E5\u5728\u79DF\u6237\u5F00\u53D1\u7A7A\u95F4\u5916\uFF0C\u5148 `hcm workspace bind <key>`")
5862
5973
  );
5863
5974
  }
5864
- if (err?.isAxiosError) exitWithError(fromAxiosError15(err, args.env));
5975
+ if (err?.isAxiosError) exitWithError(fromAxiosError16(err, args.env));
5865
5976
  exitWithError(e);
5866
5977
  process.exit(1);
5867
5978
  }
@@ -5877,10 +5988,10 @@ async function metaListCommand(args) {
5877
5988
  const fmt = args.output ?? "json";
5878
5989
  if (fmt !== "json") process.stdout.write(`\u{1F4C4} ${items.length} \u4EFD${total ? ` / \u5171 ${total}` : ""}
5879
5990
  `);
5880
- process.stdout.write(formatObject16(items, { format: fmt }) + "\n");
5991
+ process.stdout.write(formatObject17(items, { format: fmt }) + "\n");
5881
5992
  process.exit(0);
5882
5993
  } catch (e) {
5883
- fail4(e, args);
5994
+ fail5(e, args);
5884
5995
  }
5885
5996
  }
5886
5997
  async function metaGetCommand(path11, args) {
@@ -5890,7 +6001,7 @@ async function metaGetCommand(path11, args) {
5890
6001
  process.stdout.write(content.endsWith("\n") ? content : content + "\n");
5891
6002
  process.exit(0);
5892
6003
  } catch (e) {
5893
- fail4(e, args);
6004
+ fail5(e, args);
5894
6005
  }
5895
6006
  }
5896
6007
  async function metaSetCommand(path11, args) {
@@ -5925,11 +6036,11 @@ ${content}
5925
6036
  \u8BB0\u5F97\u6E05\u7F13\u5B58\uFF1Ahcm cache clear-meta <Model>
5926
6037
  `);
5927
6038
  }
5928
- process.stdout.write(formatObject16(result, { format: fmt }) + "\n");
6039
+ process.stdout.write(formatObject17(result, { format: fmt }) + "\n");
5929
6040
  process.exit(0);
5930
6041
  } catch (e) {
5931
6042
  if (e?.code === "ENOENT") exitWithError(new Error(`\u6587\u4EF6\u4E0D\u5B58\u5728\uFF1A${args.file}`));
5932
- fail4(e, args);
6043
+ fail5(e, args);
5933
6044
  }
5934
6045
  }
5935
6046
  async function metaDeleteCommand(path11, args) {
@@ -5946,10 +6057,10 @@ async function metaDeleteCommand(path11, args) {
5946
6057
  const fmt = args.output ?? "json";
5947
6058
  if (fmt !== "json") process.stdout.write(`\u{1F5D1}\uFE0F \u5DF2\u5220\u9664 ${path11}
5948
6059
  `);
5949
- process.stdout.write(formatObject16(result, { format: fmt }) + "\n");
6060
+ process.stdout.write(formatObject17(result, { format: fmt }) + "\n");
5950
6061
  process.exit(0);
5951
6062
  } catch (e) {
5952
- fail4(e, args);
6063
+ fail5(e, args);
5953
6064
  }
5954
6065
  }
5955
6066
 
@@ -5965,10 +6076,10 @@ import {
5965
6076
  createWorkspaceFile,
5966
6077
  deleteWorkspaceFile,
5967
6078
  formatMiniVerifyReport,
5968
- formatObject as formatObject17,
6079
+ formatObject as formatObject18,
5969
6080
  formatRows as formatRows5,
5970
6081
  getMiniStatus,
5971
- HcmClient as HcmClient16,
6082
+ HcmClient as HcmClient17,
5972
6083
  initMiniAppProject,
5973
6084
  inferMiniWritableTemplateOptionsFromModel,
5974
6085
  listWorkspaceFiles,
@@ -5978,7 +6089,7 @@ import {
5978
6089
  runMiniSmokeChecks,
5979
6090
  saveWorkspaceFileContent,
5980
6091
  validateMiniProject,
5981
- fromAxiosError as fromAxiosError16
6092
+ fromAxiosError as fromAxiosError17
5982
6093
  } from "@hcmai/sdk";
5983
6094
 
5984
6095
  // src/commands/workspace-format.ts
@@ -6025,7 +6136,7 @@ var RAW_WORKSPACE_EXCLUDED_DIRS = /* @__PURE__ */ new Set([
6025
6136
  var RAW_WORKSPACE_EXCLUDED_FILES = /* @__PURE__ */ new Set([WORKSPACE_CONTEXT_FILE, ".DS_Store"]);
6026
6137
  async function workspaceListCommand(args) {
6027
6138
  try {
6028
- const client3 = HcmClient16.fromAuthContext(await getActiveAuthContextFromCli(args));
6139
+ const client3 = HcmClient17.fromAuthContext(await getActiveAuthContextFromCli(args));
6029
6140
  const limit = parsePositiveInt3(args.limit, 50, "--limit");
6030
6141
  const result = await client3.query("TenantExtensionWorkspace", {
6031
6142
  keyword: args.keyword,
@@ -6054,7 +6165,7 @@ async function workspaceActiveCommand(args) {
6054
6165
  const ctx = await getActiveAuthContextFromCli(args, {
6055
6166
  fallbackEnv: localContext?.profile
6056
6167
  });
6057
- const client3 = HcmClient16.fromAuthContext(ctx);
6168
+ const client3 = HcmClient17.fromAuthContext(ctx);
6058
6169
  const result = await client3.query("TenantExtensionWorkspace", {
6059
6170
  filter: { devModeEnabled: true },
6060
6171
  fields: ["workspaceKey", "devModeEnabled"],
@@ -6109,7 +6220,7 @@ async function workspaceCreateCommand(workspaceKey, args) {
6109
6220
  `${WORKSPACE_CONTEXT_FILE} already binds workspace '${existing.workspaceKey}'; use --force to rebind`
6110
6221
  );
6111
6222
  }
6112
- const client3 = HcmClient16.fromAuthContext(await getActiveAuthContextFromCli(args));
6223
+ const client3 = HcmClient17.fromAuthContext(await getActiveAuthContextFromCli(args));
6113
6224
  const normalizedWorkspaceKey = normalizeWorkspaceKey(workspaceKey);
6114
6225
  const resp = await client3.raw().post("/api/models/TenantExtensionWorkspace", {
6115
6226
  workspaceKey: normalizedWorkspaceKey,
@@ -6156,7 +6267,7 @@ async function workspacePullCommand(args) {
6156
6267
  `workspace key is required; pass --workspace <key> or run hcm workspace bind <key> first`
6157
6268
  );
6158
6269
  }
6159
- const client3 = HcmClient16.fromAuthContext(
6270
+ const client3 = HcmClient17.fromAuthContext(
6160
6271
  await getActiveAuthContextFromCli(args, { fallbackEnv: existing?.profile })
6161
6272
  );
6162
6273
  const context = buildWorkspaceContext({
@@ -6294,7 +6405,7 @@ async function workspaceStatusCommand(args) {
6294
6405
  }
6295
6406
  if (args.output === "json" || args.output === "yaml") {
6296
6407
  process.stdout.write(
6297
- formatObject17({ rootDir, miniApps: rows }, { format: args.output }) + "\n"
6408
+ formatObject18({ rootDir, miniApps: rows }, { format: args.output }) + "\n"
6298
6409
  );
6299
6410
  } else {
6300
6411
  process.stdout.write(formatRows5(rows, { format: "table" }) + "\n");
@@ -6323,7 +6434,7 @@ async function workspacePushCommand(args) {
6323
6434
  const rootDir = resolveRootDir(args.dir);
6324
6435
  const context = await requireWorkspaceContext(rootDir);
6325
6436
  const miniApps = await discoverMiniApps(rootDir);
6326
- const client3 = HcmClient16.fromAuthContext(
6437
+ const client3 = HcmClient17.fromAuthContext(
6327
6438
  await getActiveAuthContextFromCli(args, { fallbackEnv: context.profile })
6328
6439
  );
6329
6440
  const rawResult = await pushWorkspaceRawFiles({
@@ -6344,7 +6455,7 @@ async function workspacePushCommand(args) {
6344
6455
  writeWorkspacePushResult(rawResult, results, args.output ?? "table");
6345
6456
  const hint = activationHint(
6346
6457
  await probeActiveWorkspaceKey(
6347
- HcmClient16.fromAuthContext(
6458
+ HcmClient17.fromAuthContext(
6348
6459
  await getActiveAuthContextFromCli(args, { fallbackEnv: context.profile })
6349
6460
  )
6350
6461
  ),
@@ -6381,7 +6492,7 @@ async function workspacePreviewCommand(args) {
6381
6492
  );
6382
6493
  }
6383
6494
  if (args.output === "json" || args.output === "yaml") {
6384
- process.stdout.write(formatObject17(rows, { format: args.output }) + "\n");
6495
+ process.stdout.write(formatObject18(rows, { format: args.output }) + "\n");
6385
6496
  } else {
6386
6497
  process.stdout.write(formatRows5(rows, { format: "table" }) + "\n");
6387
6498
  }
@@ -6832,7 +6943,7 @@ async function readMiniStatusSafely(app) {
6832
6943
  async function loadProfileClient(args) {
6833
6944
  try {
6834
6945
  const ctx = await getActiveAuthContextFromCli(args);
6835
- return HcmClient16.fromAuthContext(ctx);
6946
+ return HcmClient17.fromAuthContext(ctx);
6836
6947
  } catch (e) {
6837
6948
  if (args.env || args.profile) throw e;
6838
6949
  return null;
@@ -6987,7 +7098,7 @@ function optionalText(value) {
6987
7098
  }
6988
7099
  function writeWorkspaceListResult(rows, format, total) {
6989
7100
  if (format !== "table") {
6990
- process.stdout.write(formatObject17({ rows, total }, { format }) + "\n");
7101
+ process.stdout.write(formatObject18({ rows, total }, { format }) + "\n");
6991
7102
  return;
6992
7103
  }
6993
7104
  process.stdout.write(formatRows5(toWorkspaceListRows(rows), { format: "table" }) + "\n");
@@ -6998,7 +7109,7 @@ function writeWorkspaceListResult(rows, format, total) {
6998
7109
  }
6999
7110
  function writeWorkspaceActiveResult(view, format) {
7000
7111
  if (format !== "table") {
7001
- process.stdout.write(formatObject17(view, { format }) + "\n");
7112
+ process.stdout.write(formatObject18(view, { format }) + "\n");
7002
7113
  return;
7003
7114
  }
7004
7115
  const rows = [
@@ -7016,7 +7127,7 @@ function writeWorkspaceActiveResult(view, format) {
7016
7127
  }
7017
7128
  function writeWorkspaceBindResult(context, rootDir, format) {
7018
7129
  if (format !== "table") {
7019
- process.stdout.write(formatObject17({ ...context, rootDir }, { format }) + "\n");
7130
+ process.stdout.write(formatObject18({ ...context, rootDir }, { format }) + "\n");
7020
7131
  return;
7021
7132
  }
7022
7133
  process.stdout.write(
@@ -7030,7 +7141,7 @@ function writeWorkspaceBindResult(context, rootDir, format) {
7030
7141
  }
7031
7142
  function writeWorkspaceCreateResult(result, format) {
7032
7143
  if (format !== "table") {
7033
- process.stdout.write(formatObject17(result, { format }) + "\n");
7144
+ process.stdout.write(formatObject18(result, { format }) + "\n");
7034
7145
  return;
7035
7146
  }
7036
7147
  process.stdout.write(
@@ -7046,7 +7157,7 @@ function writeWorkspaceCreateResult(result, format) {
7046
7157
  }
7047
7158
  function writeWorkspacePullResult(result, format) {
7048
7159
  if (format !== "table") {
7049
- process.stdout.write(formatObject17(result, { format }) + "\n");
7160
+ process.stdout.write(formatObject18(result, { format }) + "\n");
7050
7161
  return;
7051
7162
  }
7052
7163
  const lines = [
@@ -7064,7 +7175,7 @@ function writeWorkspacePullResult(result, format) {
7064
7175
  }
7065
7176
  function writeWorkspaceAddMiniResult(result, rootDir, format) {
7066
7177
  if (format !== "table") {
7067
- process.stdout.write(formatObject17({ ...result, workspaceRoot: rootDir }, { format }) + "\n");
7178
+ process.stdout.write(formatObject18({ ...result, workspaceRoot: rootDir }, { format }) + "\n");
7068
7179
  return;
7069
7180
  }
7070
7181
  process.stdout.write(
@@ -7080,7 +7191,7 @@ function writeWorkspaceAddMiniResult(result, rootDir, format) {
7080
7191
  function writeWorkspaceValidateResult(results, format) {
7081
7192
  if (format !== "table") {
7082
7193
  process.stdout.write(
7083
- formatObject17(
7194
+ formatObject18(
7084
7195
  results.map((item) => ({ artifact: `mini:${item.app.appCode}`, ...item.result })),
7085
7196
  { format }
7086
7197
  ) + "\n"
@@ -7108,7 +7219,7 @@ mini:${item.app.appCode}
7108
7219
  function writeWorkspacePushResult(rawResult, results, format) {
7109
7220
  if (format !== "table") {
7110
7221
  process.stdout.write(
7111
- formatObject17(
7222
+ formatObject18(
7112
7223
  {
7113
7224
  workspaceFiles: { artifact: "workspace", ...rawResult },
7114
7225
  miniApps: results.map((item) => ({ artifact: `mini:${item.app.appCode}`, ...item.result }))
@@ -7164,7 +7275,7 @@ function writeWorkspaceVerifyResult(context, rootDir, raw, reports, format) {
7164
7275
  const ok = rawOk && reports.every((item) => item.report.ok);
7165
7276
  if (format === "json") {
7166
7277
  process.stdout.write(
7167
- formatObject17(
7278
+ formatObject18(
7168
7279
  {
7169
7280
  ok,
7170
7281
  workspaceKey: context.workspaceKey,
@@ -7191,7 +7302,7 @@ function writeWorkspaceVerifyResult(context, rootDir, raw, reports, format) {
7191
7302
  }
7192
7303
  if (format !== "table") {
7193
7304
  process.stdout.write(
7194
- formatObject17(
7305
+ formatObject18(
7195
7306
  {
7196
7307
  ok,
7197
7308
  workspaceKey: context.workspaceKey,
@@ -7243,7 +7354,7 @@ function formatStatusSummary(summary) {
7243
7354
  function exitWorkspaceError(err, profile) {
7244
7355
  const maybeAxios = err;
7245
7356
  if (maybeAxios?.isAxiosError) {
7246
- exitWithError(fromAxiosError16(err, profile));
7357
+ exitWithError(fromAxiosError17(err, profile));
7247
7358
  }
7248
7359
  exitWithError(err);
7249
7360
  }
@@ -7278,7 +7389,7 @@ async function setDevModeBinding(client3, workspaceKey) {
7278
7389
  }
7279
7390
  async function workspaceActivateCommand(workspaceKey, args) {
7280
7391
  try {
7281
- const client3 = HcmClient16.fromAuthContext(await getActiveAuthContextFromCli(args));
7392
+ const client3 = HcmClient17.fromAuthContext(await getActiveAuthContextFromCli(args));
7282
7393
  const key2 = normalizeWorkspaceKey(workspaceKey);
7283
7394
  await setDevModeBinding(client3, key2);
7284
7395
  const fmt = args.output ?? "table";
@@ -7288,7 +7399,7 @@ async function workspaceActivateCommand(workspaceKey, args) {
7288
7399
  process.stdout.write("\u8BE5\u7A7A\u95F4\u7684 metas / scripts / menus / mini_apps \u73B0\u5DF2\u5728\u5F53\u524D\u79DF\u6237\u751F\u6548\u3002\n");
7289
7400
  } else {
7290
7401
  process.stdout.write(
7291
- formatObject17({ workspaceKey: key2, activated: true }, { format: fmt }) + "\n"
7402
+ formatObject18({ workspaceKey: key2, activated: true }, { format: fmt }) + "\n"
7292
7403
  );
7293
7404
  }
7294
7405
  process.exit(0);
@@ -7374,8 +7485,8 @@ async function identityRemove(name) {
7374
7485
  // src/commands/delivery-action-policy.ts
7375
7486
  init_auth_guard();
7376
7487
  import {
7377
- HcmClient as HcmClient17,
7378
- formatObject as formatObject18
7488
+ HcmClient as HcmClient18,
7489
+ formatObject as formatObject19
7379
7490
  } from "@hcmai/sdk";
7380
7491
 
7381
7492
  // src/commands/delivery.ts
@@ -7539,7 +7650,16 @@ function classify(argv, actionResolution) {
7539
7650
  return guarded("managed-local-write", "workspace-local-change");
7540
7651
  }
7541
7652
  if (subcommand === "create") return guarded("tenant-write", "workspace-create");
7542
- if (subcommand === "push") return forbidden("publish", "\u5F00\u53D1\u7A7A\u95F4\u53D1\u5E03\u5C5E\u4E8E R3\u3002");
7653
+ if (subcommand === "activate") return guarded("tenant-write", "workspace-activate");
7654
+ if (subcommand === "push") return guarded("tenant-write", "workspace-push");
7655
+ if (["deploy", "release", "promote", "publish"].includes(subcommand)) {
7656
+ return forbidden("publish", "\u90E8\u7F72\u5230 active \u5C5E\u4E8E R3\uFF0C\u987B\u8D70\u53D1\u5E03\u4E0E\u5BA1\u6279\u94FE\u8DEF\u3002");
7657
+ }
7658
+ }
7659
+ if (name === "script") {
7660
+ if (["dry-run", "manifest-validate", "logs", "task"].includes(subcommand)) {
7661
+ return direct("R1", "remote-read", "script-" + subcommand);
7662
+ }
7543
7663
  }
7544
7664
  if (name === "import") {
7545
7665
  if (hasFlag(argv, "--dry-run")) {
@@ -7731,7 +7851,7 @@ async function assessEffectiveDeliveryCommand(inputArgv, dependencies = {}) {
7731
7851
  }
7732
7852
  async function deliveryAssessCommand(argv, args) {
7733
7853
  const assessment = await assessEffectiveDeliveryCommand(argv);
7734
- process.stdout.write(formatObject18(assessment, { format: args.output ?? "json" }) + "\n");
7854
+ process.stdout.write(formatObject19(assessment, { format: args.output ?? "json" }) + "\n");
7735
7855
  }
7736
7856
  async function resolveCoreAction(request) {
7737
7857
  try {
@@ -7740,7 +7860,7 @@ async function resolveCoreAction(request) {
7740
7860
  as: request.identity,
7741
7861
  profile: request.profile
7742
7862
  });
7743
- const description = await HcmClient17.fromAuthContext(auth).describe(request.model);
7863
+ const description = await HcmClient18.fromAuthContext(auth).describe(request.model);
7744
7864
  const named = description.actions.filter((action2) => action2.name === request.action);
7745
7865
  if (named.length === 0) {
7746
7866
  return failed(
@@ -7830,10 +7950,10 @@ function flagValue2(argv, flag) {
7830
7950
  init_auth_guard();
7831
7951
  init_exit();
7832
7952
  import {
7833
- HcmClient as HcmClient18,
7953
+ HcmClient as HcmClient19,
7834
7954
  fetchReconIdentity,
7835
- formatObject as formatObject19,
7836
- fromAxiosError as fromAxiosError17,
7955
+ formatObject as formatObject20,
7956
+ fromAxiosError as fromAxiosError18,
7837
7957
  httpProbe,
7838
7958
  runDoctor
7839
7959
  } from "@hcmai/sdk";
@@ -7852,17 +7972,17 @@ function render2(report) {
7852
7972
  async function deliveryDoctorCommand(args) {
7853
7973
  try {
7854
7974
  const ctx = await getActiveAuthContextFromCli(args);
7855
- const client3 = HcmClient18.fromAuthContext(ctx);
7975
+ const client3 = HcmClient19.fromAuthContext(ctx);
7856
7976
  const probe = httpProbe(client3.raw(), args.capabilities ?? DEFAULT_CAPABILITIES);
7857
7977
  const identity2 = await fetchReconIdentity(probe, ctx.tenantId);
7858
7978
  const report = await runDoctor(probe, identity2);
7859
7979
  const fmt = args.output ?? "json";
7860
7980
  if (fmt !== "json") process.stdout.write(render2(report) + "\n");
7861
- process.stdout.write(formatObject19(report, { format: fmt }) + "\n");
7981
+ process.stdout.write(formatObject20(report, { format: fmt }) + "\n");
7862
7982
  process.exit(report.ok ? 0 : 1);
7863
7983
  } catch (e) {
7864
7984
  const err = e;
7865
- if (err?.isAxiosError) exitWithError(fromAxiosError17(err, args.env));
7985
+ if (err?.isAxiosError) exitWithError(fromAxiosError18(err, args.env));
7866
7986
  exitWithError(e);
7867
7987
  process.exit(1);
7868
7988
  }
@@ -7872,12 +7992,12 @@ async function deliveryDoctorCommand(args) {
7872
7992
  init_auth_guard();
7873
7993
  init_exit();
7874
7994
  import {
7875
- HcmClient as HcmClient19,
7995
+ HcmClient as HcmClient20,
7876
7996
  ReconLayout,
7877
7997
  ROUND_EXIT_CODES,
7878
7998
  computeReconSourceKey,
7879
- formatObject as formatObject20,
7880
- fromAxiosError as fromAxiosError18,
7999
+ formatObject as formatObject21,
8000
+ fromAxiosError as fromAxiosError19,
7881
8001
  httpProbe as httpProbe2,
7882
8002
  inspectRound,
7883
8003
  renderRound,
@@ -7887,7 +8007,7 @@ var DEFAULT_CAPABILITIES2 = "default";
7887
8007
  async function deliveryReconCommand(args) {
7888
8008
  try {
7889
8009
  const ctx = await getActiveAuthContextFromCli(args);
7890
- const client3 = HcmClient19.fromAuthContext(ctx);
8010
+ const client3 = HcmClient20.fromAuthContext(ctx);
7891
8011
  const probe = httpProbe2(client3.raw(), args.capabilities ?? DEFAULT_CAPABILITIES2);
7892
8012
  const sourceKey = await computeReconSourceKey(probe);
7893
8013
  const layout = new ReconLayout(args.out ?? ".", ctx.tenantId, sourceKey);
@@ -7896,10 +8016,10 @@ async function deliveryReconCommand(args) {
7896
8016
  onlyModel: args.model ?? null,
7897
8017
  identity: ctx.tenantId ? { requestedTenantId: ctx.tenantId } : null
7898
8018
  });
7899
- process.stdout.write(formatObject20(summary, { format: args.output ?? "json" }) + "\n");
8019
+ process.stdout.write(formatObject21(summary, { format: args.output ?? "json" }) + "\n");
7900
8020
  } catch (e) {
7901
8021
  const err = e;
7902
- if (err?.isAxiosError) exitWithError(fromAxiosError18(err, args.env));
8022
+ if (err?.isAxiosError) exitWithError(fromAxiosError19(err, args.env));
7903
8023
  exitWithError(e);
7904
8024
  process.exit(1);
7905
8025
  }
@@ -7910,7 +8030,7 @@ async function deliveryReconRoundCommand(args) {
7910
8030
  const result = inspectRound(args.dir ?? ".");
7911
8031
  const fmt = args.output ?? "json";
7912
8032
  if (fmt !== "json") process.stdout.write(renderRound(result));
7913
- process.stdout.write(formatObject20(result, { format: fmt }) + "\n");
8033
+ process.stdout.write(formatObject21(result, { format: fmt }) + "\n");
7914
8034
  code = ROUND_EXIT_CODES[result.state];
7915
8035
  } catch (e) {
7916
8036
  exitWithError(e);
@@ -7925,9 +8045,10 @@ import {
7925
8045
  baselineRoundPremise,
7926
8046
  checkPremise,
7927
8047
  CHANNELS,
8048
+ GAP_REASONS,
7928
8049
  deriveAclass,
7929
8050
  exitCode as gate0ExitCode,
7930
- formatObject as formatObject21,
8051
+ formatObject as formatObject22,
7931
8052
  inspectRound as inspectRound2,
7932
8053
  loadProtocolFacts,
7933
8054
  scan
@@ -7944,8 +8065,15 @@ function renderGate0(result, skillRoot) {
7944
8065
  for (const red of rows) lines.push(` - (${red.reason}) ${red.message}`);
7945
8066
  }
7946
8067
  if (result.gaps.length > 0) {
7947
- lines.push(` [gaps] ${result.gaps.length} \u6761\uFF08\u4E0D\u9876 rc\uFF0C\u8BF7\u81EA\u5DF1\u770B\u4E00\u773C\uFF09`);
7948
- for (const gap of result.gaps) lines.push(` - (${gap.reason}) ${gap.why}`);
8068
+ lines.push(` [gaps] ${result.gaps.length} \u6761\uFF08\u4E0D\u9876 rc\uFF0C\u8BF7\u81EA\u5DF1\u770B\u4E00\u773C\uFF1B\u9010\u6761\u89C1 --output json\uFF09`);
8069
+ for (const reason of GAP_REASONS) {
8070
+ const rows = result.gaps.filter((g) => g.reason === reason);
8071
+ if (rows.length === 0) continue;
8072
+ const byToken = /* @__PURE__ */ new Map();
8073
+ for (const g of rows) byToken.set(g.token, (byToken.get(g.token) ?? 0) + 1);
8074
+ const tokens = [...byToken.entries()].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).map(([token, n]) => n > 1 ? `${token}\xD7${n}` : token);
8075
+ lines.push(` - (${reason}) ${rows.length} \u6761 / ${byToken.size} \u4E2A token\uFF1A${tokens.join("\u3001")}`);
8076
+ }
7949
8077
  }
7950
8078
  return `${lines.join("\n")}
7951
8079
  `;
@@ -7965,7 +8093,7 @@ async function deliveryGate0Command(args) {
7965
8093
  const merged = { ...result, premise: premise5 };
7966
8094
  const fmt = args.output ?? "json";
7967
8095
  if (fmt !== "json") process.stdout.write(renderGate0(merged, skillRoot));
7968
- process.stdout.write(`${formatObject21(merged, { format: fmt })}
8096
+ process.stdout.write(`${formatObject22(merged, { format: fmt })}
7969
8097
  `);
7970
8098
  for (const problem of premise5) {
7971
8099
  process.stderr.write(`\u{1F534} \u524D\u63D0\u4E0D\u6210\u7ACB\uFF08${problem.reason}\uFF09\uFF1A${problem.message}
@@ -7989,7 +8117,8 @@ import {
7989
8117
  DRY_RUN_TAIL,
7990
8118
  DriftDetected,
7991
8119
  FORCE_STALE_FLAG,
7992
- HcmClient as HcmClient20,
8120
+ HcmClient as HcmClient21,
8121
+ fetchReconIdentity as fetchReconIdentity2,
7993
8122
  INIT_EXIT_CODES,
7994
8123
  JOURNAL_STOP_KINDS,
7995
8124
  JOURNAL_STOP_UNKNOWN,
@@ -8128,7 +8257,7 @@ async function authOrSignpost(args, cmd) {
8128
8257
  }
8129
8258
  async function deliverySeedPlanCommand(args) {
8130
8259
  const ctx = await authOrSignpost(args, "plan");
8131
- const client3 = HcmClient20.fromAuthContext(ctx);
8260
+ const client3 = HcmClient21.fromAuthContext(ctx);
8132
8261
  process.exitCode = await runSeedPlan(args, seedClient(client3, ctx));
8133
8262
  }
8134
8263
  function seedClient(client3, ctx) {
@@ -8162,6 +8291,11 @@ function seedClient(client3, ctx) {
8162
8291
  post: (p, body) => wrap(() => raw.post(p, body))
8163
8292
  };
8164
8293
  }
8294
+ async function seedVerifyClient(client3, ctx) {
8295
+ const base = seedClient(client3, ctx);
8296
+ const identity2 = await fetchReconIdentity2(base, String(ctx.tenantId ?? ""));
8297
+ return { ...base, identity: identity2 };
8298
+ }
8165
8299
  function lowerCaseHeaders(headers) {
8166
8300
  if (headers === null || typeof headers !== "object") return {};
8167
8301
  const out = {};
@@ -8297,7 +8431,7 @@ async function runSeedApply(args, client3) {
8297
8431
  }
8298
8432
  async function deliverySeedApplyCommand(args) {
8299
8433
  const ctx = await authOrSignpost(args, "apply");
8300
- const client3 = HcmClient20.fromAuthContext(ctx);
8434
+ const client3 = HcmClient21.fromAuthContext(ctx);
8301
8435
  process.exitCode = await runSeedApply(args, seedClient(client3, ctx));
8302
8436
  }
8303
8437
  async function runSeedVerify(args, client3) {
@@ -8321,13 +8455,13 @@ async function deliverySeedVerifyCommand(args) {
8321
8455
  return;
8322
8456
  }
8323
8457
  const ctx = await authOrSignpost(args, "verify");
8324
- const client3 = HcmClient20.fromAuthContext(ctx);
8325
- process.exitCode = await runSeedVerify(args, seedClient(client3, ctx));
8458
+ const client3 = HcmClient21.fromAuthContext(ctx);
8459
+ process.exitCode = await runSeedVerify(args, await seedVerifyClient(client3, ctx));
8326
8460
  }
8327
8461
 
8328
8462
  // src/commands/delivery-seed-find.ts
8329
8463
  import { existsSync as existsSync3 } from "fs";
8330
- import { readFileSync as readFileSync4 } from "fs";
8464
+ import { readFileSync as readFileSync5 } from "fs";
8331
8465
  import * as path8 from "path";
8332
8466
  import {
8333
8467
  INIT_EXIT_CODES as INIT_EXIT_CODES2,
@@ -8390,7 +8524,7 @@ function runSeedFind(args) {
8390
8524
  if (!existsSync3(chosen.indexFile)) {
8391
8525
  return premise2(`\u7D22\u5F15\u6587\u4EF6\u5728\u9009\u4E2D\u4E4B\u540E\u6D88\u5931\u4E86\uFF1A${chosen.indexFile}`);
8392
8526
  }
8393
- const { rows, problems } = loadRows(readFileSync4(chosen.indexFile, "utf-8"));
8527
+ const { rows, problems } = loadRows(readFileSync5(chosen.indexFile, "utf-8"));
8394
8528
  process.stdout.write(
8395
8529
  renderFind(find(rows, args.term), args.term, rows.length, {
8396
8530
  prefixBytes: Buffer.byteLength(prefix, "utf-8"),
@@ -8430,13 +8564,13 @@ function deliverySeedValuesCommand(model, args) {
8430
8564
 
8431
8565
  // src/commands/delivery-meta.ts
8432
8566
  init_auth_guard();
8433
- import { readFileSync as readFileSync5 } from "fs";
8567
+ import { readFileSync as readFileSync6 } from "fs";
8434
8568
  import {
8435
8569
  BINDING_WORDS,
8436
8570
  CHANGE_STATES,
8437
8571
  CHANGE_UNKNOWN,
8438
8572
  CODE_WORDS,
8439
- HcmClient as HcmClient21,
8573
+ HcmClient as HcmClient22,
8440
8574
  INIT_EXIT_CODES as INIT_EXIT_CODES3,
8441
8575
  META_WRITE_STEPS,
8442
8576
  META_VERIFY_STEPS,
@@ -8578,7 +8712,7 @@ function premise3(what, hint) {
8578
8712
  async function runDeliveryMeta(args, client3) {
8579
8713
  let content;
8580
8714
  try {
8581
- content = readFileSync5(args.contentFile, "utf-8");
8715
+ content = readFileSync6(args.contentFile, "utf-8");
8582
8716
  } catch (e) {
8583
8717
  return premise3(
8584
8718
  `\u8981\u5199\u8FDB\u53BB\u7684\u6B63\u6587\u8BFB\u4E0D\u51FA\u6765\uFF1A${e.message}`,
@@ -8664,7 +8798,7 @@ function lowerCaseHeaders2(headers) {
8664
8798
  }
8665
8799
  async function deliveryMetaCommand(args) {
8666
8800
  const ctx = await getActiveAuthContextFromCli(args);
8667
- const client3 = HcmClient21.fromAuthContext(ctx);
8801
+ const client3 = HcmClient22.fromAuthContext(ctx);
8668
8802
  process.exitCode = await runDeliveryMeta(
8669
8803
  { ...args, tenant: args.tenant ?? String(ctx.tenantId ?? "") },
8670
8804
  metaClient(client3, ctx)
@@ -8676,12 +8810,12 @@ init_auth_guard();
8676
8810
  init_exit();
8677
8811
  import {
8678
8812
  computeReconSourceKey as computeReconSourceKey2,
8679
- HcmClient as HcmClient22,
8813
+ HcmClient as HcmClient23,
8680
8814
  httpProbe as httpProbe3,
8681
8815
  ReconLayout as ReconLayout2,
8682
8816
  runTriageRound
8683
8817
  } from "@hcmai/sdk";
8684
- import { mkdirSync, readFileSync as readFileSync6, writeFileSync as writeFileSync2 } from "fs";
8818
+ import { mkdirSync, readFileSync as readFileSync7, writeFileSync as writeFileSync2 } from "fs";
8685
8819
  import * as path9 from "path";
8686
8820
  var DEFAULT_CAPABILITIES4 = "default";
8687
8821
  function premise4(message, hint) {
@@ -8695,7 +8829,7 @@ var REQUESTS_SHAPE = "`--requests` \u6536\u7684\u662F\u4E00\u4E2A JSON \u6570\u7
8695
8829
  function readRequests(file) {
8696
8830
  let raw;
8697
8831
  try {
8698
- raw = JSON.parse(readFileSync6(file, "utf8"));
8832
+ raw = JSON.parse(readFileSync7(file, "utf8"));
8699
8833
  } catch (e) {
8700
8834
  throw new Error(`\u9700\u6C42\u6E05\u5355\u8BFB\u4E0D\u51FA\u6765\uFF08${file}\uFF09\uFF1A${e instanceof Error ? e.message : String(e)}`);
8701
8835
  }
@@ -8732,7 +8866,7 @@ async function runTriage(args) {
8732
8866
  return premise4(e instanceof Error ? e.message : String(e), REQUESTS_SHAPE);
8733
8867
  }
8734
8868
  const ctx = await getActiveAuthContextFromCli(args);
8735
- const client3 = HcmClient22.fromAuthContext(ctx);
8869
+ const client3 = HcmClient23.fromAuthContext(ctx);
8736
8870
  const probe = httpProbe3(client3.raw(), args.capabilities ?? DEFAULT_CAPABILITIES4);
8737
8871
  const artifactsDir = args.recon ?? new ReconLayout2(args.out ?? ".", ctx.tenantId, await computeReconSourceKey2(probe)).dir;
8738
8872
  const result = await runTriageRound(probe, artifactsDir, entriesIn);
@@ -8761,7 +8895,7 @@ import { createHash as createHash5, randomBytes as secureRandomBytes } from "cry
8761
8895
  import { spawn } from "child_process";
8762
8896
  import { createReadStream, promises as fs6 } from "fs";
8763
8897
  import path10 from "path";
8764
- import { CliError as CliError20, CliErrorCode as CliErrorCode19, formatObject as formatObject22 } from "@hcmai/sdk";
8898
+ import { CliError as CliError20, CliErrorCode as CliErrorCode19, formatObject as formatObject23 } from "@hcmai/sdk";
8765
8899
  init_exit();
8766
8900
  var EXECUTION_CONTRACT_VERSION = "2026-08-29.controlled-v3";
8767
8901
  var DEFAULT_TTL_SECONDS = 15 * 60;
@@ -8915,7 +9049,7 @@ async function deliveryPrepareCommand(argv, args) {
8915
9049
  evidenceDir: args.evidenceDir,
8916
9050
  ...ttlSeconds === void 0 ? {} : { ttlSeconds }
8917
9051
  });
8918
- process.stdout.write(formatObject22(plan, { format: args.output ?? "json" }) + "\n");
9052
+ process.stdout.write(formatObject23(plan, { format: args.output ?? "json" }) + "\n");
8919
9053
  process.stderr.write(`
8920
9054
  \u4E0B\u4E00\u6B65\uFF08argv \u5FC5\u987B\u4E0E\u672C\u6B21\u5B8C\u5168\u4E00\u81F4\uFF09\uFF1A
8921
9055
  ${nextCommandHint(plan.planId, args.project, argv)}
@@ -8936,7 +9070,7 @@ async function deliveryExecuteCommand(planId, argv, args) {
8936
9070
  planId,
8937
9071
  argv
8938
9072
  });
8939
- process.stdout.write(formatObject22(receipt, { format: args.output ?? "json" }) + "\n");
9073
+ process.stdout.write(formatObject23(receipt, { format: args.output ?? "json" }) + "\n");
8940
9074
  process.exitCode = receipt.exitCode;
8941
9075
  } catch (cause) {
8942
9076
  exitWithError(cause);
@@ -9325,10 +9459,10 @@ function nextCommandHint(planId, project, argv) {
9325
9459
  init_auth_guard();
9326
9460
  init_exit();
9327
9461
  import {
9328
- HcmClient as HcmClient23,
9462
+ HcmClient as HcmClient24,
9329
9463
  adminResetPassword,
9330
- formatObject as formatObject23,
9331
- fromAxiosError as fromAxiosError19,
9464
+ formatObject as formatObject24,
9465
+ fromAxiosError as fromAxiosError20,
9332
9466
  CliError as CliError21,
9333
9467
  CliErrorCode as CliErrorCode20
9334
9468
  } from "@hcmai/sdk";
@@ -9359,12 +9493,12 @@ async function userResetPasswordCommand(args) {
9359
9493
  try {
9360
9494
  const password = args.passwordStdin ? await readSecretFromStdin() : await promptPasswordTwice();
9361
9495
  const request = buildAdminResetPasswordRequest(args, password);
9362
- const client3 = HcmClient23.fromAuthContext(await getActiveAuthContextFromCli(args));
9496
+ const client3 = HcmClient24.fromAuthContext(await getActiveAuthContextFromCli(args));
9363
9497
  const result = await adminResetPassword(client3.raw(), request);
9364
- process.stdout.write(formatObject23(result, { format: args.output ?? "json" }) + "\n");
9498
+ process.stdout.write(formatObject24(result, { format: args.output ?? "json" }) + "\n");
9365
9499
  } catch (cause) {
9366
9500
  const err = cause;
9367
- if (err?.isAxiosError) exitWithError(fromAxiosError19(err, args.env));
9501
+ if (err?.isAxiosError) exitWithError(fromAxiosError20(err, args.env));
9368
9502
  exitWithError(cause);
9369
9503
  }
9370
9504
  }
@@ -9384,19 +9518,19 @@ async function promptPasswordTwice() {
9384
9518
  init_exit();
9385
9519
  init_auth_guard();
9386
9520
  import {
9387
- HcmClient as HcmClient24,
9388
- formatObject as formatObject24,
9389
- fromAxiosError as fromAxiosError20
9521
+ HcmClient as HcmClient25,
9522
+ formatObject as formatObject25,
9523
+ fromAxiosError as fromAxiosError21
9390
9524
  } from "@hcmai/sdk";
9391
9525
  async function modelsCommand(keyword, args) {
9392
9526
  try {
9393
- const client3 = HcmClient24.fromAuthContext(await getActiveAuthContextFromCli(args));
9527
+ const client3 = HcmClient25.fromAuthContext(await getActiveAuthContextFromCli(args));
9394
9528
  const all = await client3.listModels();
9395
9529
  const needle = keyword?.trim().toLowerCase();
9396
9530
  const rows = (needle ? all.filter((m) => JSON.stringify(m).toLowerCase().includes(needle)) : all).sort((a, b) => key(a).localeCompare(key(b)));
9397
9531
  const fmt = args.output ?? "table";
9398
9532
  if (fmt !== "table") {
9399
- process.stdout.write(formatObject24({ total: rows.length, models: rows }, { format: fmt }) + "\n");
9533
+ process.stdout.write(formatObject25({ total: rows.length, models: rows }, { format: fmt }) + "\n");
9400
9534
  process.exit(0);
9401
9535
  }
9402
9536
  if (rows.length === 0) {
@@ -9420,7 +9554,7 @@ async function modelsCommand(keyword, args) {
9420
9554
  process.exit(0);
9421
9555
  } catch (e) {
9422
9556
  const err = e;
9423
- if (err?.isAxiosError) exitWithError(fromAxiosError20(err, args.profile));
9557
+ if (err?.isAxiosError) exitWithError(fromAxiosError21(err, args.profile));
9424
9558
  exitWithError(e);
9425
9559
  }
9426
9560
  }
@@ -9579,6 +9713,11 @@ workspace.command("verify").description(
9579
9713
  ).option("--dir <path>", "\u5DE5\u4F5C\u7A7A\u95F4\u672C\u5730\u76EE\u5F55", ".").option("--env <name>", "\u4E34\u65F6\u5207\u73AF\u5883\uFF08\u8986\u76D6 activeEnv\uFF0Cdry-run \u9636\u6BB5\u9700\u8981\uFF09").option("--as <identity>", "\u4E34\u65F6\u6362\u8EAB\u4EFD\uFF08\u8986\u76D6 env defaultIdentity\uFF0C\u672C\u6B21\u547D\u4EE4\uFF09").option("--profile <name>", "[deprecated] \u7528 --env \u66FF\u4EE3").option("--frontend <url>", "\u524D\u7AEF\u5730\u5740", "http://127.0.0.1:5179").option("--surface <surface>", "\u9884\u89C8\u5F62\u6001\uFF1Aall | bare | standalone | embedded", "all").option("--smoke", "\u5BF9\u9884\u89C8\u5165\u53E3\u4E0E\u57FA\u7840\u8D44\u6E90\u6267\u884C\u53EA\u8BFB HTTP GET \u53EF\u8FBE\u68C0\u67E5").option("--output <fmt>", "\u8F93\u51FA\u683C\u5F0F\uFF1Atable | json | yaml", "table").action((opts) => workspaceVerifyCommand(opts));
9580
9714
  program.command("trace [traceId]").description("\u67E5\u770B trace\uFF1A\u4E0D\u4F20 traceId \u5217\u6700\u8FD1\u8BB0\u5F55\uFF0C\u4F20 traceId \u663E\u793A\u4EBA\u7C7B\u53EF\u8BFB\u8BE6\u60C5").option("--conv <convId>", "\u67E5\u4F1A\u8BDD\u7684 LLM \u9010\u8C03\u7528 trace\uFF08PG llm_call_trace\uFF0CADR-134 D2\uFF09").option("--llm-calls", "\u628A\u4F4D\u7F6E\u53C2\u5F53 convId \u67E5 LLM \u9010\u8C03\u7528\uFF08\u7B49\u4EF7 --conv <convId>\uFF09").option("--span <N>", "\u67E5\u770B\u7B2C N \u4E2A span \u7684\u8BE6\u60C5").option("-n, --limit <N>", "\u5217\u8868\u6A21\u5F0F\u663E\u793A\u6761\u6570", "10").option("--events", "\u6309\u4E8B\u4EF6\u65F6\u95F4\u7EBF\u5C55\u793A spans/logs/LLM \u5185\u5BB9\u6458\u8981").option("--raw", "\u8F93\u51FA\u539F\u59CB trace \u805A\u5408 JSON\uFF08\u534F\u8BAE/P0 \u8C03\u8BD5\u7528\uFF09").option("--env <name>", "\u4E34\u65F6\u5207\u73AF\u5883\uFF08\u8986\u76D6 activeEnv\uFF0C\u672C\u6B21\u547D\u4EE4\uFF09").option("--as <identity>", "\u4E34\u65F6\u6362\u8EAB\u4EFD\uFF08\u8986\u76D6 env defaultIdentity\uFF0C\u672C\u6B21\u547D\u4EE4\uFF09").option("--profile <name>", "[deprecated] \u7528 --env \u66FF\u4EE3").option("--output <fmt>", "\u517C\u5BB9\u8F93\u51FA\u683C\u5F0F\uFF1Atable | json | yaml\uFF1B\u8C03\u8BD5\u539F\u6587\u4F18\u5148\u7528 --raw", "table").action((traceId, opts) => traceCommand(traceId ?? null, opts));
9581
9715
  program.command("mini").description("\u5DF2\u79FB\u9664\uFF1A\u8BF7\u6539\u7528 hcm workspace").allowUnknownOption(true).allowExcessArguments(true).argument("[args...]").action(() => removedMiniCommand());
9716
+ var script = program.command("script").description("\u4E91\u51FD\u6570\uFF1A\u53EA\u8BFB\u8BD5\u8FD0\u884C\u3001manifest \u6821\u9A8C\u3001\u6267\u884C\u65E5\u5FD7\u4E0E\u5F02\u6B65\u4EFB\u52A1\uFF08\u8D70 CLI \u8BA4\u8BC1\uFF0C\u4E0D\u9700\u8981\u81EA\u5DF1\u62FF token\uFF09");
9717
+ script.command("dry-run").description("\u53EA\u8BFB\u8BD5\u8FD0\u884C\u4E91\u51FD\u6570\uFF1B\u5199\u64CD\u4F5C\u88AB\u62E6\u622A\u3001\u4EC5\u8BB0\u5F55\u4E3A writeIntents\uFF0C\u4E0D\u6539\u6570\u636E").requiredOption("--script-key <key>", "\u811A\u672C key\uFF0C\u5982 employee.sync-tags").option("--model <Model>", "\u7ED1\u5B9A\u7684 Model").option("--action <action>", "\u7ED1\u5B9A\u7684 Action key").option("--scope <scope>", "Action scope\uFF1Aclass | object").option("--method <method>", "HTTP \u65B9\u6CD5").option("--target-id <id>", "object scope \u7684\u76EE\u6807\u5B9E\u4F53 id").option("--params <JSON>", "\u5165\u53C2 JSON \u5BF9\u8C61").option("--params-file <path>", "\u4ECE UTF-8 JSON \u6587\u4EF6\u8BFB\u5165\u53C2\uFF08\u4E0E --params \u4E92\u65A5\uFF09").option("--context <JSON>", "context JSON \u5BF9\u8C61").option("--event <JSON>", "event JSON \u5BF9\u8C61").option("--timeout <ms>", "\u8D85\u65F6\u6BEB\u79D2").option("--env <name>", "\u4E34\u65F6\u5207\u73AF\u5883\uFF08\u8986\u76D6 activeEnv\uFF0C\u672C\u6B21\u547D\u4EE4\uFF09").option("--as <identity>", "\u4E34\u65F6\u6362\u8EAB\u4EFD").option("--output <fmt>", "\u8F93\u51FA\u683C\u5F0F\uFF1Atable | json | yaml", "json").action((opts) => scriptDryRunCommand(opts));
9718
+ script.command("manifest-validate").description("\u6821\u9A8C\u6269\u5C55\u5305 manifest.yml").requiredOption("--file <path>", "manifest.yml \u8DEF\u5F84").option("--env <name>", "\u4E34\u65F6\u5207\u73AF\u5883\uFF08\u8986\u76D6 activeEnv\uFF0C\u672C\u6B21\u547D\u4EE4\uFF09").option("--as <identity>", "\u4E34\u65F6\u6362\u8EAB\u4EFD").option("--output <fmt>", "\u8F93\u51FA\u683C\u5F0F\uFF1Atable | json | yaml", "json").action((opts) => scriptManifestValidateCommand(opts));
9719
+ script.command("logs").description("\u67E5\u540C\u6B65\u6267\u884C\u65E5\u5FD7\uFF08\u5206\u9875\uFF09").option("--script-key <key>", "\u53EA\u770B\u67D0\u4E2A\u811A\u672C").option("--status <status>", "\u6309\u72B6\u6001\u8FC7\u6EE4").option("--mode <mode>", "\u6309 sync/async \u8FC7\u6EE4").option("--dry-run", "\u53EA\u770B dry-run \u8BB0\u5F55").option("--from <iso>", "\u8D77\u59CB\u65F6\u95F4\uFF08ISO 8601\uFF09").option("--to <iso>", "\u7ED3\u675F\u65F6\u95F4\uFF08ISO 8601\uFF09").option("--page <n>", "\u9875\u7801\uFF0C\u4ECE 0 \u5F00\u59CB").option("--size <n>", "\u6BCF\u9875\u6761\u6570").option("--env <name>", "\u4E34\u65F6\u5207\u73AF\u5883\uFF08\u8986\u76D6 activeEnv\uFF0C\u672C\u6B21\u547D\u4EE4\uFF09").option("--as <identity>", "\u4E34\u65F6\u6362\u8EAB\u4EFD").option("--output <fmt>", "\u8F93\u51FA\u683C\u5F0F\uFF1Atable | json | yaml", "json").action((opts) => scriptLogsCommand(opts));
9720
+ script.command("task <taskId>").description("\u67E5\u5F02\u6B65\u4EFB\u52A1\uFF1A\u72B6\u6001\u3001\u91CD\u8BD5\u6B21\u6570\u3001\u6700\u7EC8\u7ED3\u679C\u4E0E\u9519\u8BEF").option("--env <name>", "\u4E34\u65F6\u5207\u73AF\u5883\uFF08\u8986\u76D6 activeEnv\uFF0C\u672C\u6B21\u547D\u4EE4\uFF09").option("--as <identity>", "\u4E34\u65F6\u6362\u8EAB\u4EFD").option("--output <fmt>", "\u8F93\u51FA\u683C\u5F0F\uFF1Atable | json | yaml", "json").action((taskId, opts) => scriptTaskCommand(taskId, opts));
9582
9721
  var cache = program.command("cache").description("\u6A21\u578B\u7F13\u5B58\u8FD0\u7EF4\uFF08Caffeine \u672C\u5730 + Redis \u8FDC\u7A0B\uFF0C\u987B\u8D70 API\uFF09");
9583
9722
  cache.command("stats <Model>").description("\u67E5\u770B\u6A21\u578B\u7F13\u5B58\u7EDF\u8BA1").option("--env <name>", "\u4E34\u65F6\u5207\u73AF\u5883\uFF08\u8986\u76D6 activeEnv\uFF0C\u672C\u6B21\u547D\u4EE4\uFF09").option("--as <identity>", "\u4E34\u65F6\u6362\u8EAB\u4EFD").option("--output <fmt>", "\u8F93\u51FA\u683C\u5F0F\uFF1Atable | json | yaml", "json").action((model, opts) => cacheStatsCommand(model, opts));
9584
9723
  cache.command("clear <Model>").description("\u6E05\u6A21\u578B\u5B9E\u4F53\u7F13\u5B58\uFF08\u5E42\u7B49\uFF0C\u4E0D\u7834\u574F\u6570\u636E\uFF09").option("--id <id>", "\u53EA\u6E05\u5355\u6761\uFF08\u9ED8\u8BA4\u6E05\u5168\u90E8\uFF09").option("--env <name>", "\u4E34\u65F6\u5207\u73AF\u5883\uFF08\u8986\u76D6 activeEnv\uFF0C\u672C\u6B21\u547D\u4EE4\uFF09").option("--as <identity>", "\u4E34\u65F6\u6362\u8EAB\u4EFD").option("--output <fmt>", "\u8F93\u51FA\u683C\u5F0F\uFF1Atable | json | yaml", "json").action((model, opts) => cacheClearCommand(model, opts));