bpmax-cli 0.2.1-beta.34 → 0.2.1-beta.35

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/bin.js CHANGED
@@ -311,6 +311,7 @@ function capabilityForRequest(method, path16) {
311
311
  if (normalizedMethod === "DELETE" && /^\/form_template\/[^/]+$/.test(normalizedPath)) return "config.form_template.delete";
312
312
  if (normalizedMethod === "POST" && normalizedPath === "/form_template/publish") return "config.form_template.submit";
313
313
  if (normalizedMethod === "POST" && normalizedPath === "/flow_page_template") return `${pageTemplatePrefix}.create`;
314
+ if (normalizedMethod === "GET" && normalizedPath === "/flow_page_template") return `${pageTemplatePrefix}.export`;
314
315
  if (normalizedMethod === "GET" && /^\/flow_page_template\/[^/]+$/.test(normalizedPath)) return `${pageTemplatePrefix}.export`;
315
316
  if (normalizedMethod === "PUT" && /^\/flow_page_template\/[^/]+$/.test(normalizedPath)) return `${pageTemplatePrefix}.submit`;
316
317
  if (normalizedMethod === "DELETE" && /^\/flow_page_template\/[^/]+$/.test(normalizedPath)) return `${pageTemplatePrefix}.delete`;
@@ -455,6 +456,9 @@ function flowPageTemplateCapabilityPrefix(path16) {
455
456
  if (type === "4") {
456
457
  return "config.console_template";
457
458
  }
459
+ if (type === "5") {
460
+ return "config.flow_detail_template";
461
+ }
458
462
  if (type === "6") {
459
463
  return "config.step_detail_template";
460
464
  }
@@ -492,7 +496,7 @@ function pluginAgentCapabilityForRequest(method, normalizedPath) {
492
496
  // package.json
493
497
  var package_default = {
494
498
  name: "bpmax-cli",
495
- version: "0.2.1-beta.34",
499
+ version: "0.2.1-beta.35",
496
500
  description: "CLI for BPMAX environments with multi-profile config and local login callback flow",
497
501
  type: "module",
498
502
  bin: {
@@ -4301,6 +4305,7 @@ var LOCAL_UUID_DOMAIN_DIR = {
4301
4305
  "list-template": "think_flow_page_template",
4302
4306
  "filter-template": "think_flow_page_template",
4303
4307
  "project-detail-template": "think_flow_page_template",
4308
+ "flow-detail-template": "think_flow_page_template",
4304
4309
  "step-detail-template": "think_flow_page_template",
4305
4310
  "console-template": "think_flow_page_template",
4306
4311
  dataset: "think_data_set",
@@ -4317,6 +4322,7 @@ var REMOTE_UUID_EXPORT_PATH = {
4317
4322
  "list-template": (uuid) => `/flow_page_template/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
4318
4323
  "filter-template": (uuid) => `/flow_page_template/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
4319
4324
  "project-detail-template": (uuid) => `/flow_page_template/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
4325
+ "flow-detail-template": (uuid) => `/flow_page_template/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
4320
4326
  "step-detail-template": (uuid) => `/flow_page_template/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
4321
4327
  "console-template": (uuid) => `/flow_page_template/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
4322
4328
  "user-model": (uuid) => `/user_model/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
@@ -4434,6 +4440,23 @@ var CONFIG_DOMAINS = {
4434
4440
  writeEndpoints: ["POST /api/flow_page_template", "PUT /api/flow_page_template/:id", "DELETE /api/flow_page_template/:id"],
4435
4441
  notes: ["type=2 project detail template. Create and edit both use the typed flow_page_template adapter; create automatically finalizes data_set_id/flow_type through PUT when needed; activate/delete remain domain-specific operations."]
4436
4442
  },
4443
+ "flow-detail-template": {
4444
+ capability: "config.flow_detail_template",
4445
+ exportPath: (id) => `/flow_page_template/${id}?type=5&skip_i18n=true`,
4446
+ exportStatus: "supported",
4447
+ buildStatus: "supported",
4448
+ submitStatus: "supported",
4449
+ createPath: "/flow_page_template",
4450
+ createMethod: "POST",
4451
+ deletePath: (id) => `/flow_page_template/${id}`,
4452
+ deleteMethod: "DELETE",
4453
+ submitPath: (id) => `/flow_page_template/${id}`,
4454
+ submitMethod: "PUT",
4455
+ expectedType: 5,
4456
+ readEndpoints: ["GET /api/flow_page_template?type=5&flow_type=:flow_type&flow_key=:flow_key", "GET /api/flow_page_template/:id?type=5&skip_i18n=true"],
4457
+ writeEndpoints: ["POST /api/flow_page_template", "PUT /api/flow_page_template/:id", "DELETE /api/flow_page_template/:id"],
4458
+ notes: ["type=5 flow report/document template managed by the report_template editor. The flow-detail-template command name is retained for compatibility; this domain is distinct from type=2 project detail templates and type=6 step detail templates."]
4459
+ },
4437
4460
  "step-detail-template": {
4438
4461
  capability: "config.step_detail_template",
4439
4462
  exportPath: (id) => `/flow_page_template/${id}?type=6&skip_i18n=true`,
@@ -7372,6 +7395,63 @@ function validatePageTemplateName(work, errors) {
7372
7395
  }
7373
7396
  throw new Error(message);
7374
7397
  }
7398
+ function lintFlowDetailTemplateWork(work, errors, warnings = []) {
7399
+ const configuredType = pageTemplateType(work);
7400
+ if (configuredType !== void 0 && configuredType !== 5) {
7401
+ errors.push(`flow-detail-template \u5FC5\u987B\u4F7F\u7528 flow_page_template.type=5\uFF0C\u5F53\u524D\u4E3A ${configuredType}\u3002`);
7402
+ }
7403
+ const content = parseTemplateContent(work, errors);
7404
+ if (!isRecord3(content)) {
7405
+ errors.push("flow-detail-template content \u5FC5\u987B\u662F\u5305\u542B fields \u548C templateFile \u7684 JSON \u5BF9\u8C61\u3002");
7406
+ return;
7407
+ }
7408
+ if (!Array.isArray(content.fields)) {
7409
+ errors.push("flow-detail-template content.fields \u5FC5\u987B\u662F\u6570\u7EC4\u3002");
7410
+ } else {
7411
+ const seenFields = /* @__PURE__ */ new Set();
7412
+ content.fields.forEach((item, index) => {
7413
+ const itemPath = `flow-detail-template content.fields[${index}]`;
7414
+ if (!isRecord3(item)) {
7415
+ errors.push(`${itemPath} \u5FC5\u987B\u662F\u5BF9\u8C61\u3002`);
7416
+ return;
7417
+ }
7418
+ for (const key of ["field", "desc", "expression"]) {
7419
+ if (typeof item[key] !== "string" || !item[key].trim()) {
7420
+ errors.push(`${itemPath}.${key} \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\u3002`);
7421
+ }
7422
+ }
7423
+ const field = typeof item.field === "string" ? item.field.trim() : "";
7424
+ if (field) {
7425
+ if (seenFields.has(field)) {
7426
+ errors.push(`${itemPath}.field \u4E0E\u5DF2\u6709\u62A5\u544A\u5B57\u6BB5 ${JSON.stringify(field)} \u91CD\u590D\u3002`);
7427
+ }
7428
+ seenFields.add(field);
7429
+ }
7430
+ });
7431
+ }
7432
+ if (!Array.isArray(content.templateFile)) {
7433
+ errors.push("flow-detail-template content.templateFile \u5FC5\u987B\u662F\u6570\u7EC4\u3002");
7434
+ } else {
7435
+ if (content.templateFile.length === 0) {
7436
+ errors.push("flow-detail-template content.templateFile \u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u62A5\u544A\u6A21\u677F\u6587\u4EF6\uFF1B\u5E73\u53F0\u751F\u6210\u62A5\u544A\u65F6\u8BFB\u53D6\u7B2C\u4E00\u4E2A\u6587\u4EF6\u3002");
7437
+ }
7438
+ content.templateFile.forEach((item, index) => {
7439
+ const itemPath = `flow-detail-template content.templateFile[${index}]`;
7440
+ if (!isRecord3(item)) {
7441
+ errors.push(`${itemPath} \u5FC5\u987B\u662F\u5BF9\u8C61\u3002`);
7442
+ return;
7443
+ }
7444
+ for (const key of ["name", "url"]) {
7445
+ if (typeof item[key] !== "string" || !item[key].trim()) {
7446
+ errors.push(`${itemPath}.${key} \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\u3002`);
7447
+ }
7448
+ }
7449
+ });
7450
+ if (content.templateFile.length > 1) {
7451
+ warnings.push("flow-detail-template \u914D\u7F6E\u4E86\u591A\u4E2A templateFile\uFF1B\u5E73\u53F0\u751F\u6210\u62A5\u544A\u65F6\u53EA\u4F7F\u7528\u7B2C\u4E00\u4E2A\u6587\u4EF6\uFF0C\u8BF7\u786E\u8BA4\u6392\u5E8F\u3002");
7452
+ }
7453
+ }
7454
+ }
7375
7455
  function normalizePageTemplatePayload(domain, work) {
7376
7456
  const definition = CONFIG_DOMAINS[domain];
7377
7457
  validatePageTemplateName(work);
@@ -7401,6 +7481,13 @@ function normalizePageTemplatePayload(domain, work) {
7401
7481
  throw new Error(`step-detail-template lint failed: ${errors.join("; ")}`);
7402
7482
  }
7403
7483
  }
7484
+ if (domain === "flow-detail-template") {
7485
+ const errors = [];
7486
+ lintFlowDetailTemplateWork(work, errors);
7487
+ if (errors.length) {
7488
+ throw new Error(`flow-detail-template lint failed: ${errors.join("; ")}`);
7489
+ }
7490
+ }
7404
7491
  const basic = isRecord3(work.basic) ? work.basic : work;
7405
7492
  const rawContent = work.content ?? basic.content;
7406
7493
  const type = definition.expectedType;
@@ -10210,7 +10297,7 @@ function buildDomainSubmitPayload(domain, work, options = {}, raw) {
10210
10297
  if (domain === "nav-config") {
10211
10298
  return buildNavConfigSubmitPayload(work, isRecord3(raw) ? raw : void 0, options);
10212
10299
  }
10213
- if (domain === "list-template" || domain === "filter-template" || domain === "project-detail-template" || domain === "step-detail-template" || domain === "console-template") {
10300
+ if (domain === "list-template" || domain === "filter-template" || domain === "project-detail-template" || domain === "flow-detail-template" || domain === "step-detail-template" || domain === "console-template") {
10214
10301
  return normalizePageTemplatePayload(domain, work);
10215
10302
  }
10216
10303
  throw new Error(`${CONFIG_SUBMIT_UNSUPPORTED_MESSAGE} Domain: ${domain}.`);
@@ -11397,7 +11484,7 @@ function normalizeTypedReadbackComparable(domain, value) {
11397
11484
  normalized.sub_ids = [...new Set(normalized.sub_ids.map(normalizeComparableId))].sort((left, right) => String(left).localeCompare(String(right)));
11398
11485
  }
11399
11486
  }
11400
- if (domain === "list-template" || domain === "filter-template" || domain === "project-detail-template" || domain === "step-detail-template" || domain === "console-template") {
11487
+ if (domain === "list-template" || domain === "filter-template" || domain === "project-detail-template" || domain === "flow-detail-template" || domain === "step-detail-template" || domain === "console-template") {
11401
11488
  if (Object.prototype.hasOwnProperty.call(normalized, "data_set_id")) {
11402
11489
  normalized.data_set_id = normalizeComparableId(normalized.data_set_id);
11403
11490
  }
@@ -11455,7 +11542,7 @@ function assertJsonSubset(expected, actual, label) {
11455
11542
  }
11456
11543
  }
11457
11544
  function isPageTemplateCreateFinalizeDomain(domain) {
11458
- return domain === "list-template" || domain === "filter-template" || domain === "project-detail-template" || domain === "step-detail-template";
11545
+ return domain === "list-template" || domain === "filter-template" || domain === "project-detail-template" || domain === "flow-detail-template" || domain === "step-detail-template";
11459
11546
  }
11460
11547
  function pageTemplateCreateNeedsFinalize(domain, payload, comparison) {
11461
11548
  if (!isPageTemplateCreateFinalizeDomain(domain)) {
@@ -11482,6 +11569,64 @@ async function readbackConfigDomain(config, profile, domain, id) {
11482
11569
  readback: data
11483
11570
  };
11484
11571
  }
11572
+ async function listFlowDetailTemplates(profile, options) {
11573
+ const flowType = options.flowType.trim();
11574
+ if (!flowType) {
11575
+ throw new Error("flow-detail-template list requires --flow-type.");
11576
+ }
11577
+ const page = options.page ?? 1;
11578
+ const pageSize = options.pageSize ?? 100;
11579
+ if (!Number.isSafeInteger(page) || page < 1) {
11580
+ throw new Error("flow-detail-template list --page \u5FC5\u987B\u662F\u5927\u4E8E\u7B49\u4E8E 1 \u7684\u6574\u6570\u3002");
11581
+ }
11582
+ if (!Number.isSafeInteger(pageSize) || pageSize < 1 || pageSize > 1e3) {
11583
+ throw new Error("flow-detail-template list --page-size \u5FC5\u987B\u662F 1-1000 \u7684\u6574\u6570\u3002");
11584
+ }
11585
+ const definition = CONFIG_DOMAINS["flow-detail-template"];
11586
+ await ensureConfigCapability(profile, `${definition.capability}.export`);
11587
+ const params = new URLSearchParams({
11588
+ type: "5",
11589
+ flow_type: flowType,
11590
+ flow_key: options.flowKey?.trim() ?? "",
11591
+ page: String(page),
11592
+ page_size: String(pageSize),
11593
+ sort: "-create_time"
11594
+ });
11595
+ const name = options.name?.trim();
11596
+ if (name) params.set("name", name);
11597
+ const endpoint = `/flow_page_template?${params.toString()}`;
11598
+ const response = await apiRequest(
11599
+ createApiClient(profile),
11600
+ "GET",
11601
+ endpoint,
11602
+ { capability: `${definition.capability}.export` }
11603
+ );
11604
+ const templates = extractListData(response).filter((record) => Number(record.type) === 5).map((record) => ({
11605
+ id: record.id ?? null,
11606
+ uuid: record.uuid ?? null,
11607
+ name: record.name ?? "",
11608
+ desc: record.desc ?? "",
11609
+ status: record.status ?? null,
11610
+ flow_type: record.flow_type ?? "",
11611
+ flow_key: record.flow_key ?? "",
11612
+ create_time: record.create_time ?? null,
11613
+ update_time: record.update_time ?? null,
11614
+ readback_hash: hashJson(record)
11615
+ }));
11616
+ const pagination = isRecord3(response) ? pickDefined(response, ["currentPage", "pageSize", "totalPages", "count"]) : {};
11617
+ return {
11618
+ domain: "flow-detail-template",
11619
+ semantic_type: "flow-report-template",
11620
+ flow_type: flowType,
11621
+ flow_key: options.flowKey?.trim() ?? "",
11622
+ name: name ?? "",
11623
+ source_api: `GET /api${endpoint}`,
11624
+ ...pagination,
11625
+ match_count: templates.length,
11626
+ templates,
11627
+ verified_at: (/* @__PURE__ */ new Date()).toISOString()
11628
+ };
11629
+ }
11485
11630
  async function resolveFlowAppContextFlowId(profile, flow) {
11486
11631
  const trimmed = flow.trim();
11487
11632
  if (!trimmed) {
@@ -11871,7 +12016,14 @@ async function resolveConfigUuidId(options) {
11871
12016
  { capability: `${definition.capability}.export` }
11872
12017
  );
11873
12018
  const remoteRecord = isRecord3(response) && isRecord3(response.data) ? response.data : response;
11874
- const remote = isRecord3(remoteRecord) ? {
12019
+ const hasRemoteIdentity = isRecord3(remoteRecord) && [
12020
+ remoteRecord.id,
12021
+ remoteRecord.origin_template_id,
12022
+ remoteRecord.uuid,
12023
+ remoteRecord.type,
12024
+ remoteRecord.name
12025
+ ].some((value) => value !== void 0 && value !== null && value !== "");
12026
+ const remote = hasRemoteIdentity && isRecord3(remoteRecord) ? {
11875
12027
  id: numericIdString(remoteRecord.id),
11876
12028
  origin_template_id: numericIdString(remoteRecord.origin_template_id),
11877
12029
  name: remoteRecord.name ?? remoteRecord.title ?? null,
@@ -12030,6 +12182,7 @@ async function buildConfigSubmitPayload(domain, workFile, outFile, metaFile, opt
12030
12182
  }
12031
12183
  const raw = typeof meta.raw_file === "string" ? await readJsonFile(meta.raw_file) : void 0;
12032
12184
  let formTemplateWarnings = [];
12185
+ let flowDetailTemplateWarnings = [];
12033
12186
  let stepDetailReferenceAudit;
12034
12187
  let stepDetailAnalysis;
12035
12188
  if (domain === "flow-template" && isRecord3(work)) {
@@ -12068,6 +12221,14 @@ async function buildConfigSubmitPayload(domain, workFile, outFile, metaFile, opt
12068
12221
  throw new Error(`step-detail-template lint failed: ${errors.join("; ")}`);
12069
12222
  }
12070
12223
  }
12224
+ if (domain === "flow-detail-template" && isRecord3(work)) {
12225
+ const errors = [];
12226
+ flowDetailTemplateWarnings = [];
12227
+ lintFlowDetailTemplateWork(work, errors, flowDetailTemplateWarnings);
12228
+ if (errors.length) {
12229
+ throw new Error(`flow-detail-template lint failed: ${errors.join("; ")}`);
12230
+ }
12231
+ }
12071
12232
  const payloadWork = (domain === "dataset" || domain === "dataset-field") && createMode && isRecord3(work) ? { ...work, mode: "create" } : work;
12072
12233
  const payload = buildDomainSubmitPayload(domain, payloadWork, options, raw);
12073
12234
  if (domain === "flow-template" && options.publishLive) {
@@ -12088,6 +12249,7 @@ async function buildConfigSubmitPayload(domain, workFile, outFile, metaFile, opt
12088
12249
  base_hash: createMode ? null : typeof meta.base_hash === "string" ? meta.base_hash : null,
12089
12250
  payload,
12090
12251
  ...formTemplateWarnings.length ? { form_template_warnings: formTemplateWarnings } : {},
12252
+ ...flowDetailTemplateWarnings.length ? { flow_detail_template_warnings: flowDetailTemplateWarnings } : {},
12091
12253
  ...stepDetailReferenceAudit ? {
12092
12254
  step_detail_references: stepDetailReferenceAudit.references,
12093
12255
  step_detail_warnings: stepDetailReferenceAudit.warnings,
@@ -12107,6 +12269,7 @@ async function buildConfigSubmitPayload(domain, workFile, outFile, metaFile, opt
12107
12269
  submit_file: outFile,
12108
12270
  payload_keys: Object.keys(payload),
12109
12271
  ...formTemplateWarnings.length ? { warnings: formTemplateWarnings } : {},
12272
+ ...flowDetailTemplateWarnings.length ? { warnings: flowDetailTemplateWarnings } : {},
12110
12273
  ...stepDetailReferenceAudit ? {
12111
12274
  step_detail_references: stepDetailReferenceAudit.references,
12112
12275
  warnings: stepDetailReferenceAudit.warnings,
@@ -12253,6 +12416,9 @@ async function lintConfigWorkFile(file, options = {}) {
12253
12416
  if (options.domain === "step-detail-template") {
12254
12417
  stepDetailAnalysis = lintStepDetailTemplateWork(value, errors, warnings);
12255
12418
  }
12419
+ if (options.domain === "flow-detail-template") {
12420
+ lintFlowDetailTemplateWork(value, errors, warnings);
12421
+ }
12256
12422
  if ((Object.prototype.hasOwnProperty.call(value, "content") || isRecord3(value.basic)) && pageTemplateType(value) === 1) {
12257
12423
  validateListTemplateActionGate(value, errors);
12258
12424
  }
@@ -12631,6 +12797,13 @@ async function submitConfigDomain(config, profile, domain, id, submitFile, confi
12631
12797
  throw new Error(`step-detail-template lint failed: ${stepDetailAnalysis.errors.join("; ")}`);
12632
12798
  }
12633
12799
  }
12800
+ if (domain === "flow-detail-template") {
12801
+ const errors = [];
12802
+ lintFlowDetailTemplateWork(submit.payload, errors);
12803
+ if (errors.length) {
12804
+ throw new Error(`flow-detail-template lint failed: ${errors.join("; ")}`);
12805
+ }
12806
+ }
12634
12807
  if (domain === "dataset-field") {
12635
12808
  validateDatasetFieldCreatePayload(submit.payload);
12636
12809
  }
@@ -12815,6 +12988,13 @@ async function submitConfigDomain(config, profile, domain, id, submitFile, confi
12815
12988
  throw new Error(`step-detail-template lint failed: ${stepDetailAnalysis.errors.join("; ")}`);
12816
12989
  }
12817
12990
  }
12991
+ if (domain === "flow-detail-template") {
12992
+ const errors = [];
12993
+ lintFlowDetailTemplateWork(submit.payload, errors);
12994
+ if (errors.length) {
12995
+ throw new Error(`flow-detail-template lint failed: ${errors.join("; ")}`);
12996
+ }
12997
+ }
12818
12998
  if (domain === "form-template" && submitMode === "create") {
12819
12999
  validateNonEmptyFormCreatePayload(submit.payload);
12820
13000
  await ensureConfigCapability(profile, `${definition.capability}.create`);
@@ -13410,6 +13590,7 @@ var CONFIG_DOMAINS2 = [
13410
13590
  ["list-template", "bpmax-list-template-editor", "\u5217\u8868\u6A21\u677F"],
13411
13591
  ["filter-template", "bpmax-filter-template-editor", "\u7B5B\u9009\u6A21\u677F"],
13412
13592
  ["project-detail-template", "bpmax-project-detail-template-editor", "\u9879\u76EE\u8BE6\u60C5\u6A21\u677F"],
13593
+ ["flow-detail-template", "bpmax-flow-detail-template-editor", "\u6D41\u7A0B\u62A5\u544A\u6A21\u677F\uFF08type=5\uFF09"],
13413
13594
  ["console-template", "bpmax-console-template-editor", "\u63A7\u5236\u53F0\u6A21\u677F"],
13414
13595
  ["dataset", "bpmax-dataset-template-editor", "\u6570\u636E\u96C6"],
13415
13596
  ["dataset-field", "bpmax-dataset-field-template-editor", "\u6570\u636E\u96C6\u5B57\u6BB5"],
@@ -15379,6 +15560,21 @@ function registerConfigCommands(program2) {
15379
15560
  await writeResponseOut(options.responseOut, result);
15380
15561
  printResult(options.format, result);
15381
15562
  });
15563
+ if (domain === "flow-detail-template") {
15564
+ domainCommand.command("list").description("List type=5 flow report/document templates for a flow").requiredOption("--flow-type <flowType>", "Main flow type, e.g. flow48198545").option("--flow-key <flowKey>", "Subflow key; omit or pass empty for the main flow", "").option("--name <name>", "Optional template name filter").option("--page <page>", "Page number", (value) => Number(value), 1).option("--page-size <pageSize>", "Page size, 1-1000", (value) => Number(value), 100).option("--profile <profile>", "Profile name").option("--format <format>", "Output format", "json").action(async (options) => {
15565
+ const configData = await loadConfig();
15566
+ const resolved = resolveProfile(configData, options.profile);
15567
+ const result = await listFlowDetailTemplates(resolved, {
15568
+ flowType: options.flowType,
15569
+ flowKey: options.flowKey,
15570
+ name: options.name,
15571
+ page: options.page,
15572
+ pageSize: options.pageSize
15573
+ });
15574
+ await saveConfig(configData);
15575
+ printResult(options.format, result);
15576
+ });
15577
+ }
15382
15578
  if (domain === "project-detail-template") {
15383
15579
  domainCommand.command("resolve-default").description("Resolve the flow-specific default project detail template used by /project_detail/0/<project_id>").requiredOption("--flow-type <flowType>", "Flow type, e.g. flow48198545").option("--flow-key <flowKey>", "Flow key for subflow defaults", "").option("--profile <profile>", "Profile name").option("--format <format>", "Output format", "json").action(async (options) => {
15384
15580
  const configData = await loadConfig();
@@ -17663,7 +17859,7 @@ function reportRuntimeEvidenceInvalid(text5) {
17663
17859
  const hashRoute = url.hash.startsWith("#/") ? new URL(url.hash.slice(1), url.origin) : null;
17664
17860
  const runtimePath = hashRoute?.pathname || url.pathname;
17665
17861
  const runtimeParams = hashRoute?.searchParams || url.searchParams;
17666
- const isSupportedUiRoute = /(?:\/project(?:$|\/|\?|_detail)|\/myProject|\/projectContinue|\/pages\/)/i.test(runtimePath) || /\/w:[^/]+\/userManagement(?:\/|$)/i.test(runtimePath);
17862
+ const isSupportedUiRoute = /(?:\/project(?:$|\/|\?|_detail)|\/myProject|\/projectContinue|\/pages\/)/i.test(runtimePath) || /^\/w:[^/]+\/(?:userManagement|console)(?:\/|$)/i.test(runtimePath);
17667
17863
  if (/(^|\.)example\.(?:com|org|net)$/i.test(url.hostname) || /\/(?:api|bpmax)(?:\/|$)/i.test(runtimePath) || !isSupportedUiRoute) {
17668
17864
  invalid.push("runtime_url/ui_route");
17669
17865
  }
@@ -22862,13 +23058,20 @@ function registerProjectCommands(program2) {
22862
23058
  );
22863
23059
  printResult(options.format, result);
22864
23060
  });
22865
- project.command("get <id>").description("Get project detail").option("--profile <profile>", "Profile name").option("--format <format>", "Output format", "pretty").action(async (id, options) => {
23061
+ project.command("get [id]").description("Get project detail").option("--project-id <projectId>", "Project id (compatibility alias for the positional id)").option("--profile <profile>", "Profile name").option("--format <format>", "Output format", "pretty").action(async (id, options) => {
23062
+ const resolvedId = id?.trim() || options.projectId?.trim();
23063
+ if (!resolvedId) {
23064
+ throw new Error("project get requires <id> or --project-id <id>.");
23065
+ }
23066
+ if (id?.trim() && options.projectId?.trim() && id.trim() !== options.projectId.trim()) {
23067
+ throw new Error(`project get received conflicting ids: positional=${id.trim()}, --project-id=${options.projectId.trim()}.`);
23068
+ }
22866
23069
  const config = await loadConfig();
22867
23070
  const profile = resolveProfile(config, options.profile);
22868
23071
  const result = await apiRequest(
22869
23072
  createApiClient(profile),
22870
23073
  "GET",
22871
- `/project/${id}`
23074
+ `/project/${resolvedId}`
22872
23075
  );
22873
23076
  printResult(options.format, attachProjectDetailUrl(profile, result));
22874
23077
  });
@@ -23574,6 +23777,10 @@ var schemaEntries = [
23574
23777
  { name: "config.project_detail_template.create", description: "Create project detail template config through a verified typed adapter.", method: "POST", path: "/api/flow_page_template" },
23575
23778
  { name: "config.project_detail_template.delete", description: "Delete project detail template config through a verified typed adapter.", method: "DELETE", path: "/api/flow_page_template/:id" },
23576
23779
  { name: "config.project_detail_template.submit", description: "Submit project detail template edits through a verified typed adapter.", method: "PUT", path: "/api/flow_page_template/:id" },
23780
+ { name: "config.flow_detail_template.export", description: "List or export type=5 flow report/document template config.", method: "GET", path: "/api/flow_page_template/:id?type=5&skip_i18n=true" },
23781
+ { name: "config.flow_detail_template.create", description: "Create a type=5 flow report/document template through a verified typed adapter.", method: "POST", path: "/api/flow_page_template" },
23782
+ { name: "config.flow_detail_template.delete", description: "Delete a type=5 flow report/document template through a verified typed adapter.", method: "DELETE", path: "/api/flow_page_template/:id" },
23783
+ { name: "config.flow_detail_template.submit", description: "Submit type=5 flow report/document template edits through a verified typed adapter.", method: "PUT", path: "/api/flow_page_template/:id" },
23577
23784
  { name: "config.console_template.export", description: "Export console template config.", method: "GET", path: "/api/flow_page_template/:id?skip_i18n=true" },
23578
23785
  { name: "config.console_template.create", description: "Create console template config through a verified typed adapter.", method: "POST", path: "/api/flow_page_template" },
23579
23786
  { name: "config.console_template.delete", description: "Delete console template config through a verified typed adapter.", method: "DELETE", path: "/api/flow_page_template/:id" },
@@ -23908,6 +24115,15 @@ var CONFIG_TASK_RULES = [
23908
24115
  constraintEvidence: /默认详情模板|resolve-default|详情页|project_detail|project-detail-template lint/i,
23909
24116
  mentionPattern: /项目详情模板|项目详情页|project-detail-template|project_detail/
23910
24117
  },
24118
+ {
24119
+ domain: "flow-detail-template",
24120
+ skill: "bpmax-flow-detail-template-editor",
24121
+ lockPattern: /flow-detail-template:(?:\d+|new-[A-Za-z0-9_-]+)/,
24122
+ writeEvidence: [/bpmax-cli config flow-detail-template lint/, /bpmax-cli config flow-detail-template build/, /bpmax-cli config flow-detail-template submit/, /bpmax-cli config flow-detail-template verify/],
24123
+ readonlyEvidence: [/bpmax-cli config flow-detail-template (?:list|export)|流程报告.*回读|流程报表.*回读|readback/i],
24124
+ constraintEvidence: /type=5|流程报告模板|流程报表模板|flow-detail-template lint/i,
24125
+ mentionPattern: /流程报告模板|流程报表模板|flow-detail-template|flow_detail_template/
24126
+ },
23911
24127
  {
23912
24128
  domain: "step-detail-template",
23913
24129
  skill: "bpmax-flow-template-editor",
@@ -24545,6 +24761,7 @@ function taskbookTemplate(title = "BPMAX AI \u5B9E\u65BD\u7F16\u6392\u4EFB\u52A1
24545
24761
  "| \u6D41\u7A0B\u6A21\u677F | bpmax-flow-template-editor | bpmax-cli config flow-template export/lint/build/submit/verify\uFF1B\u5199\u4EFB\u52A1\u5148\u8DD1 bpmax-cli config adapters --format json \u6838\u5BF9 capability/adapter | project_after_create_path\u3001message_template\u3001matrix_owner\u3001\u6D41\u7A0B\u6A21\u677F\u7EA6\u675F |",
24546
24762
  "| \u8868\u5355\u6A21\u677F | bpmax-form-template-editor | bpmax-cli config form-template export/lint/build/submit/verify\uFF1B\u5199\u4EFB\u52A1\u5148\u8DD1 bpmax-cli config adapters --format json \u6838\u5BF9 capability/adapter | \u5B57\u6BB5 schema\u3001\u8868\u5355\u987A\u5E8F\u3001raw.value\u3001layout\u3001sub_form\u3001form-template inspect |",
24547
24763
  "| \u5217\u8868\u6A21\u677F | bpmax-list-template-editor | bpmax-cli config list-template lint/build/submit/verify\uFF1B\u5199\u4EFB\u52A1\u5148\u8DD1 bpmax-cli config adapters --format json \u6838\u5BF9 capability/adapter | \u64CD\u4F5C\u5217\u3001\u8BE6\u60C5\u52A8\u4F5C\u3001\u5220\u9664\u6743\u9650 guard\uFF08\u9996\u9009 ctx.$CAN_DELETE\uFF0C\u7981\u6B62\u5F53\u524D\u73AF\u8282\u4E3A\u7A7A\u6761\u4EF6\uFF09\u3001icon\u3001\u67E5\u8BE2\u5B89\u5168\u3001\u771F\u5B9E\u5217\u8868\u9875 |",
24764
+ "| \u6D41\u7A0B\u62A5\u544A\u6A21\u677F | bpmax-flow-detail-template-editor | bpmax-cli config flow-detail-template list/export/lint/build/submit/verify | type=5\uFF0C\u5185\u5BB9\u4E3A fields + templateFile\uFF0C\u4E0D\u80FD\u4E0E\u9879\u76EE\u8BE6\u60C5 type=2 \u6216\u73AF\u8282\u8BE6\u60C5 type=6 \u6DF7\u7528 |",
24548
24765
  "| \u73AF\u8282\u8BE6\u60C5\u6A21\u677F | bpmax-flow-template-editor | bpmax-cli config step-detail-template export/lint/build/submit/verify\uFF1B\u6D41\u7A0B\u7ED1\u5B9A\u8FD8\u9700 flow-template verify | type=6\u3001content.layout\u3001\u6A21\u5757\u58F0\u660E\u3001step_detail_id \u8FDC\u7AEF\u5B58\u5728\u6027\u4E0E\u8282\u70B9\u9002\u914D |",
24549
24766
  "| \u5BFC\u822A\u914D\u7F6E | bpmax-nav-config-editor | bpmax-cli config nav-config lint/build/submit/verify\uFF1B\u5199\u4EFB\u52A1\u5148\u8DD1 bpmax-cli config adapters --format json \u6838\u5BF9 capability/adapter | PC/H5 \u5BFC\u822A\u3001\u5FEB\u6377\u5165\u53E3\u3001\u6D4F\u89C8\u5668\u6253\u5F00\u9A8C\u8BC1 |",
24550
24767
  "",
@@ -25547,6 +25764,7 @@ function commandEndpointHint(argv) {
25547
25764
  "list-template": "/flow_page_template",
25548
25765
  "filter-template": "/flow_page_template",
25549
25766
  "project-detail-template": "/flow_page_template",
25767
+ "flow-detail-template": "/flow_page_template",
25550
25768
  "step-detail-template": "/flow_page_template",
25551
25769
  "console-template": "/flow_page_template"
25552
25770
  };