bpmax-cli 0.2.1-beta.77 → 0.2.1-beta.79

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
@@ -326,6 +326,14 @@ function capabilityForRequest(method, path29) {
326
326
  if (normalizedMethod === "GET" && /^\/page_composition_asset\/\d+$/.test(normalizedPath)) return "config.page_template.asset.list";
327
327
  if (normalizedMethod === "POST" && /^\/page_composition_asset\/\d+$/.test(normalizedPath)) return "config.page_template.asset.upload";
328
328
  if (normalizedMethod === "DELETE" && /^\/page_composition_asset\/\d+$/.test(normalizedPath)) return "config.page_template.asset.delete";
329
+ if (normalizedMethod === "GET" && normalizedPath === "/home_portal") return "config.home_portal.export";
330
+ if (normalizedMethod === "GET" && normalizedPath === "/home_portal/flows") return "config.home_portal.flows";
331
+ if (normalizedMethod === "GET" && normalizedPath === "/home_portal/nav_preview") return "config.home_portal.preview";
332
+ if (normalizedMethod === "GET" && normalizedPath === "/home_portal/workspaces") return "config.home_portal.preview";
333
+ if (normalizedMethod === "GET" && normalizedPath === "/home_portal/copy_preview") return "config.home_portal.preview";
334
+ if (normalizedMethod === "PUT" && normalizedPath === "/home_portal") return "config.home_portal.submit";
335
+ if (normalizedMethod === "POST" && normalizedPath === "/home_portal/nav_import") return "config.home_portal.nav_import";
336
+ if (normalizedMethod === "POST" && normalizedPath === "/home_portal/copy") return "config.home_portal.copy";
329
337
  if (normalizedMethod === "GET" && normalizedPath === "/flow_page_template/generate_report") return "config.flow_detail_template.render";
330
338
  if (normalizedMethod === "POST" && normalizedPath === "/flow_page_template") return `${pageTemplatePrefix}.create`;
331
339
  if (normalizedMethod === "GET" && normalizedPath === "/flow_page_template") return `${pageTemplatePrefix}.export`;
@@ -514,7 +522,7 @@ function pluginAgentCapabilityForRequest(method, normalizedPath) {
514
522
  // package.json
515
523
  var package_default = {
516
524
  name: "bpmax-cli",
517
- version: "0.2.1-beta.77",
525
+ version: "0.2.1-beta.79",
518
526
  description: "CLI for BPMAX environments with multi-profile config and local login callback flow",
519
527
  type: "module",
520
528
  bin: {
@@ -1368,7 +1376,7 @@ function parseQuery(path29) {
1368
1376
  }
1369
1377
  function isRawConfigPath(method, path29) {
1370
1378
  const normalizedPath = normalizeApiPath2(path29);
1371
- if (/^\/(configuration|form_template|flow_page_template|data_set|data_set_field|api_platform|api_platform_instance|api_proxy|api_proxy_entity_binding|entity|entity_field|role|point|user_role|workspace|group|config_repository)(\/|$)/.test(normalizedPath)) {
1379
+ if (/^\/(configuration|home_portal|form_template|flow_page_template|data_set|data_set_field|api_platform|api_platform_instance|api_proxy|api_proxy_entity_binding|entity|entity_field|role|point|user_role|workspace|group|config_repository)(\/|$)/.test(normalizedPath)) {
1372
1380
  return true;
1373
1381
  }
1374
1382
  if (normalizedPath === "/flow/list/lightweight" || normalizedPath.startsWith("/flow/configuration/")) {
@@ -4929,6 +4937,48 @@ function textOf(value) {
4929
4937
  if (isRecord4(value)) return Object.values(value).map(textOf).join(" ");
4930
4938
  return "";
4931
4939
  }
4940
+ function changedTextFragment(before, after) {
4941
+ if (before === after) return "";
4942
+ let prefix = 0;
4943
+ while (prefix < before.length && prefix < after.length && before[prefix] === after[prefix]) prefix += 1;
4944
+ let suffix = 0;
4945
+ while (suffix < before.length - prefix && suffix < after.length - prefix && before[before.length - 1 - suffix] === after[after.length - 1 - suffix]) suffix += 1;
4946
+ const changedExpression = (text5, offset, endOffset) => {
4947
+ const boundary = Math.max(
4948
+ text5.lastIndexOf("\n", Math.max(0, offset - 1)),
4949
+ text5.lastIndexOf(";", Math.max(0, offset - 1)),
4950
+ text5.lastIndexOf("{", Math.max(0, offset - 1)),
4951
+ text5.lastIndexOf("}", Math.max(0, offset - 1))
4952
+ ) + 1;
4953
+ const end = text5.indexOf(";", endOffset);
4954
+ return text5.slice(boundary, end === -1 ? text5.length : end);
4955
+ };
4956
+ const enclosingFunction = (text5, offset) => {
4957
+ const starts = [...text5.matchAll(/\bfunction\s+[A-Za-z_$][\w$]*\s*\([^)]*\)\s*\{/g)].map((match) => match.index ?? -1).filter((index) => index >= 0 && index < offset);
4958
+ const start = starts.at(-1);
4959
+ if (start === void 0) return "";
4960
+ let depth = 0;
4961
+ let opened = false;
4962
+ for (let index = start; index < text5.length; index += 1) {
4963
+ if (text5[index] === "{") {
4964
+ depth += 1;
4965
+ opened = true;
4966
+ } else if (text5[index] === "}" && opened) {
4967
+ depth -= 1;
4968
+ if (depth === 0) return offset <= index ? text5.slice(start, index + 1) : "";
4969
+ }
4970
+ }
4971
+ return "";
4972
+ };
4973
+ return [
4974
+ changedExpression(before, prefix, before.length - suffix),
4975
+ before.slice(prefix, before.length - suffix),
4976
+ changedExpression(after, prefix, after.length - suffix),
4977
+ after.slice(prefix, after.length - suffix),
4978
+ enclosingFunction(before, prefix),
4979
+ enclosingFunction(after, prefix)
4980
+ ].join("\n");
4981
+ }
4932
4982
  function containsPermissionIdentifier(value) {
4933
4983
  return /(?:^|[^A-Za-z0-9])(?:permission|permissions|role|roles|scope|organization|product|gtm|authorize|authorization)(?:$|[^A-Za-z0-9])|\$CAN_|\$canInFlow|__owner_id|project\.(?:view|delete)/i.test(value);
4934
4984
  }
@@ -4952,7 +5002,10 @@ function matchesBoundary(path29, declared) {
4952
5002
  }
4953
5003
  function analyzeListTemplatePermissionBoundary(raw, work, manifest) {
4954
5004
  const changedPaths = changedJsonPaths(raw, work);
4955
- const permissionRelated = changedPaths.some((path29) => containsPermissionIdentifier(path29) || containsPermissionIdentifier(textOf(valueAtPointer(raw, path29))) || containsPermissionIdentifier(textOf(valueAtPointer(work, path29))));
5005
+ const permissionRelated = changedPaths.some((path29) => containsPermissionIdentifier(path29) || containsPermissionIdentifier(changedTextFragment(
5006
+ textOf(valueAtPointer(raw, path29)),
5007
+ textOf(valueAtPointer(work, path29))
5008
+ )));
4956
5009
  if (!permissionRelated) {
4957
5010
  return { permission_related: false, changed_paths: changedPaths, boundary: null };
4958
5011
  }
@@ -5559,6 +5612,18 @@ var CONFIG_DOMAINS = {
5559
5612
  readEndpoints: ["GET /api/configuration?q_type=:type&is_default_action=1&page=1&page_size=10000", "GET /api/point/point_list", "GET /api/group/sub_groups"],
5560
5613
  writeEndpoints: ["PUT /api/configuration/:id?is_default_action=1", "POST /api/configuration?is_default_action=1", "DELETE /api/configuration/:id?is_default_action=1"],
5561
5614
  notes: ["Nav config is four configuration records (navmenu/shortcut/navmenu_mobile/shortcut_mobile). Export id is the workspace key. Submit writes all four records as an operation plan."]
5615
+ },
5616
+ "home-portal": {
5617
+ capability: "config.home_portal",
5618
+ exportPath: () => "/home_portal",
5619
+ exportStatus: "supported",
5620
+ buildStatus: "supported",
5621
+ submitStatus: "supported",
5622
+ submitPath: () => "/home_portal",
5623
+ submitMethod: "PUT",
5624
+ readEndpoints: ["GET /api/home_portal", "GET /api/home_portal/flows", "GET /api/home_portal/nav_preview", "GET /api/home_portal/workspaces", "GET /api/home_portal/copy_preview"],
5625
+ writeEndpoints: ["PUT /api/home_portal", "POST /api/home_portal/nav_import", "POST /api/home_portal/copy"],
5626
+ notes: ["Workspace-scoped flow portal bundle. Export/submit uses the workspace profile and optimistic version CAS; use nav/copy specialized APIs for preview-token imports."]
5562
5627
  }
5563
5628
  };
5564
5629
  var CONFIG_SUBMIT_UNSUPPORTED_MESSAGE = "Typed config build/submit adapters are not implemented for this domain yet. Stop before remote writes and use the matching editor Skill verified scripts until bpmax-cli adds a domain-specific adapter.";
@@ -5684,6 +5749,55 @@ function normalizeWorkspaceKey(workspace) {
5684
5749
  const nextWorkspace = workspace.trim().replace(/^\/+|\/+$/g, "");
5685
5750
  return nextWorkspace.startsWith("w:") ? nextWorkspace.slice(2) : nextWorkspace;
5686
5751
  }
5752
+ function normalizeHomePortalPayload(work) {
5753
+ const version = Number(work.version);
5754
+ if (!Number.isSafeInteger(version) || version < 0) throw new Error("home-portal version must be a non-negative integer.");
5755
+ const categories = Array.isArray(work.categories) ? work.categories : [];
5756
+ const entries = Array.isArray(work.entries) ? work.entries : [];
5757
+ const categoryIds = new Set(categories.map((item) => isRecord5(item) ? String(item.id ?? "") : ""));
5758
+ if (categories.some((item) => !isRecord5(item) || !String(item.id ?? "").trim())) throw new Error("home-portal categories require string ids.");
5759
+ const clean = (value, max) => String(value ?? "").trim().slice(0, max);
5760
+ const normalizedEntries = entries.map((item, index) => {
5761
+ if (!isRecord5(item)) throw new Error(`home-portal entry ${index} must be an object.`);
5762
+ const categoryId = clean(item.categoryId ?? item.category_id, 120);
5763
+ const pathValue2 = clean(item.path, 2e3);
5764
+ if (!categoryIds.has(categoryId) || !pathValue2) throw new Error(`home-portal entry ${index} requires a valid categoryId and path.`);
5765
+ return {
5766
+ id: clean(item.id, 120) || `entry-${index + 1}`,
5767
+ categoryId,
5768
+ name: clean(item.name, 120) || `\u5165\u53E3 ${index + 1}`,
5769
+ description: clean(item.description, 500),
5770
+ path: pathValue2,
5771
+ pathMobile: clean(item.pathMobile ?? item.path_mobile, 2e3),
5772
+ linkLabel: clean(item.linkLabel ?? item.link_label, 120),
5773
+ secondPath: clean(item.secondPath ?? item.second_path, 2e3),
5774
+ secondPathMobile: clean(item.secondPathMobile ?? item.second_path_mobile, 2e3),
5775
+ secondLinkLabel: clean(item.secondLinkLabel ?? item.second_link_label, 120),
5776
+ icon: clean(item.icon, 120),
5777
+ color: clean(item.color, 30) || "#4C86F7",
5778
+ openInWindow: Boolean(item.openInWindow ?? item.open_in_window),
5779
+ common: Boolean(item.common),
5780
+ enabled: item.enabled !== false,
5781
+ order: Number(item.order ?? index),
5782
+ flowType: clean(item.flowType ?? item.flow_type, 120),
5783
+ flowKey: clean(item.flowKey ?? item.flow_key, 120),
5784
+ permissionType: clean(item.permissionType ?? item.permission_type, 40),
5785
+ permission: clean(item.permission, 255),
5786
+ visibility: clean(item.visibility, 40) || "public",
5787
+ visibility_scope: item.visibility_scope ?? "",
5788
+ sourceNavId: clean(item.sourceNavId ?? item.source_nav_id, 120)
5789
+ };
5790
+ });
5791
+ return {
5792
+ workspace: normalizeWorkspaceKey(clean(work.workspace, 120)),
5793
+ version,
5794
+ categories: categories.map((item, index) => {
5795
+ if (!isRecord5(item)) throw new Error(`home-portal category ${index} must be an object.`);
5796
+ return { id: clean(item.id, 120), name: clean(item.name, 120) || `\u5206\u7C7B ${index + 1}`, icon: clean(item.icon, 120), color: clean(item.color, 30), order: Number(item.order ?? index), enabled: item.enabled !== false, permissionType: clean(item.permissionType ?? item.permission_type, 40), permission: clean(item.permission, 255), visibility: clean(item.visibility, 40) || "public", visibility_scope: item.visibility_scope ?? "", sourceNavId: clean(item.sourceNavId ?? item.source_nav_id, 120) };
5797
+ }),
5798
+ entries: normalizedEntries
5799
+ };
5800
+ }
5687
5801
  function numericId(value) {
5688
5802
  if (typeof value === "number" && Number.isFinite(value)) {
5689
5803
  return value;
@@ -14752,6 +14866,9 @@ function buildDomainSubmitPayload(domain, work, options = {}, raw) {
14752
14866
  if (domain === "page-template") {
14753
14867
  return normalizePageCompositionTemplatePayload(work);
14754
14868
  }
14869
+ if (domain === "home-portal") {
14870
+ return normalizeHomePortalPayload(work);
14871
+ }
14755
14872
  throw new Error(`${CONFIG_SUBMIT_UNSUPPORTED_MESSAGE} Domain: ${domain}.`);
14756
14873
  }
14757
14874
  function responseDataId(response) {
@@ -16929,6 +17046,7 @@ function validatePageTemplatePreviewManifest(manifest, payload) {
16929
17046
  }
16930
17047
  async function exportConfigDomain(config, profile, domain, id, outDir, options = {}) {
16931
17048
  void config;
17049
+ const definition = CONFIG_DOMAINS[domain];
16932
17050
  assertNotLocalUuidConfigId(domain, id, "export");
16933
17051
  if (domain === "api-platform") {
16934
17052
  const { raw, work: work2 } = await collectApiPlatformAggregate(profile, id);
@@ -16975,7 +17093,21 @@ async function exportConfigDomain(config, profile, domain, id, outDir, options =
16975
17093
  });
16976
17094
  return { domain, id, raw_file: rawFile2, work_file: workFile2, meta_file: metaFile2, base_hash: baseHash2 };
16977
17095
  }
16978
- const definition = CONFIG_DOMAINS[domain];
17096
+ if (domain === "home-portal") {
17097
+ const workspace = normalizeWorkspaceKey(id || profile.config.workspace);
17098
+ await ensureConfigCapability(profile, `${definition.capability}.export`);
17099
+ const data2 = await apiRequest(createApiClient(profile), "GET", "/home_portal", { params: { workspace }, capability: `${definition.capability}.export` });
17100
+ const payload = isRecord5(data2) ? { workspace, ...data2 } : { workspace, version: 0, categories: [], entries: [] };
17101
+ const baseHash2 = hashJson(payload);
17102
+ const stem2 = `${domain}-${workspace.replace(/[^a-zA-Z0-9._-]+/g, "-")}`;
17103
+ const rawFile2 = path6.join(outDir, "raw", `${stem2}.json`);
17104
+ const workFile2 = path6.join(outDir, "work", `${stem2}.json`);
17105
+ const metaFile2 = path6.join(outDir, "meta", `${stem2}.meta.json`);
17106
+ await writeJsonFile(rawFile2, payload);
17107
+ await writeJsonFile(workFile2, payload);
17108
+ await writeJsonFile(metaFile2, { domain, id: workspace, profile: profile.name, workspace: profile.config.workspace, exported_at: (/* @__PURE__ */ new Date()).toISOString(), base_hash: baseHash2, raw_file: rawFile2, work_file: workFile2 });
17109
+ return { domain, id: workspace, raw_file: rawFile2, work_file: workFile2, meta_file: metaFile2, base_hash: baseHash2 };
17110
+ }
16979
17111
  if (!definition.exportPath) {
16980
17112
  throw new Error(definition.unsupportedExportReason || `Config export is not implemented for ${domain}.`);
16981
17113
  }
@@ -17825,6 +17957,24 @@ async function submitConfigDomain(config, profile, domain, id, submitFile, confi
17825
17957
  readback_hash: hashJson(readback2)
17826
17958
  };
17827
17959
  }
17960
+ if (domain === "home-portal") {
17961
+ const submit2 = await readJsonFile(submitFile);
17962
+ if (!isRecord5(submit2) || submit2.domain !== domain || !isRecord5(submit2.payload) || !isRecord5(submit2.meta)) throw new Error("Config submit requires a payload produced by `config home-portal build`.");
17963
+ const workspace = normalizeWorkspaceKey(String(submit2.payload.workspace || id || profile.config.workspace));
17964
+ if (String(submit2.meta.id || workspace) !== workspace) throw new Error(`Config submit metadata id mismatch. Expected ${workspace}.`);
17965
+ if (typeof submit2.base_hash !== "string") throw new Error("home-portal submit requires base_hash from export/build.");
17966
+ await ensureConfigCapability(profile, `${definition.capability}.export`);
17967
+ await ensureConfigCapability(profile, `${definition.capability}.submit`);
17968
+ const currentRaw = await apiRequest(createApiClient(profile), "GET", "/home_portal", { params: { workspace }, capability: `${definition.capability}.export` });
17969
+ const current2 = isRecord5(currentRaw) ? { workspace, ...currentRaw } : { workspace, version: 0, categories: [], entries: [] };
17970
+ if (hashJson(current2) !== submit2.base_hash) throw new Error("Remote config changed after export. Re-export before submitting.");
17971
+ const expectedConfirm2 = `submit ${domain} ${workspace}`;
17972
+ if (confirm3 !== expectedConfirm2) return { ...dryRunFields(expectedConfirm2), domain, id: workspace, endpoint: "/home_portal", method: "PUT", payload: submit2.payload, current_hash: hashJson(current2), next: `Run again with --confirm "${expectedConfirm2}" to submit.` };
17973
+ const response2 = await apiRequest(createApiClient(profile), "PUT", "/home_portal", { data: { version: submit2.payload.version, categories: submit2.payload.categories, entries: submit2.payload.entries }, params: { workspace }, capability: `${definition.capability}.submit` });
17974
+ const readbackRaw = await apiRequest(createApiClient(profile), "GET", "/home_portal", { params: { workspace }, capability: `${definition.capability}.export` });
17975
+ const readback2 = isRecord5(readbackRaw) ? { workspace, ...readbackRaw } : readbackRaw;
17976
+ return { ...executedFields(), domain, id: workspace, endpoint: "/home_portal", method: "PUT", response: response2, readback_hash: hashJson(readback2) };
17977
+ }
17828
17978
  if (domain === "role" || domain === "api-platform" || domain === "nav-config") {
17829
17979
  if (definition.submitStatus !== "supported") {
17830
17980
  throw new Error(`${CONFIG_SUBMIT_UNSUPPORTED_MESSAGE} Domain: ${domain}.`);
@@ -21980,6 +22130,16 @@ function registerConfigCommands(program2) {
21980
22130
  printResult(options.format, result);
21981
22131
  });
21982
22132
  }
22133
+ if (domain === "home-portal") {
22134
+ domainCommand.command("flows").description("List flow options available to portal entries").option("--profile <profile>").option("--format <format>", "Output format", "json").action(async (options) => {
22135
+ const profile2 = resolveProfile(await loadConfig(), options.profile);
22136
+ printResult(options.format, await apiRequest(createApiClient(profile2), "GET", "/home_portal/flows", { capability: "config.home_portal.flows" }));
22137
+ });
22138
+ domainCommand.command("nav-preview").description("Preview importing PC navigation into the portal").option("--profile <profile>").option("--format <format>", "Output format", "json").action(async (options) => {
22139
+ const profile2 = resolveProfile(await loadConfig(), options.profile);
22140
+ printResult(options.format, await apiRequest(createApiClient(profile2), "GET", "/home_portal/nav_preview", { capability: "config.home_portal.preview" }));
22141
+ });
22142
+ }
21983
22143
  const createCommand = domainCommand.command("create").description(domain === "flow-template" ? "Create a new main flow template through the typed adapter" : domain === "page-template" ? "Create a page-template config object through the typed adapter; a verified preview manifest authorizes the write" : `Create a ${domain} config object through a verified typed adapter; dry-run unless --confirm is exact`).option("--profile <profile>", "Profile name").option("--confirm <text>", "Exact confirmation text").option("--publish-live", "For flow-template, publish the created flow to live after saving draft").option("--response-out <file>", "Write the full JSON response to a file").option("--format <format>", "Output format", "pretty");
21984
22144
  if (domain === "flow-template") {
21985
22145
  createCommand.requiredOption("--work <file>", "Flow-template work JSON file").option("--agent <agent>", "Agent adapter for installed plugin lint discovery", "codex");
@@ -22491,6 +22651,12 @@ var schemaEntries = [
22491
22651
  { name: "config.page_template.asset.list", description: "List static resources registered for an independent page-composition template.", method: "GET", path: "/api/page_composition_asset/:templateId" },
22492
22652
  { name: "config.page_template.asset.upload", description: "Upload and register a static resource for an independent page-composition template.", method: "POST", path: "/api/page_composition_asset/:templateId" },
22493
22653
  { name: "config.page_template.asset.delete", description: "Delete an unreferenced static resource from an independent page-composition template.", method: "DELETE", path: "/api/page_composition_asset/:assetId" },
22654
+ { name: "config.home_portal.export", description: "Export the workspace-scoped flow portal bundle.", method: "GET", path: "/api/home_portal" },
22655
+ { name: "config.home_portal.submit", description: "Replace the workspace flow portal bundle with optimistic version checking.", method: "PUT", path: "/api/home_portal" },
22656
+ { name: "config.home_portal.flows", description: "List flow options available to flow portal editors.", method: "GET", path: "/api/home_portal/flows" },
22657
+ { name: "config.home_portal.preview", description: "Preview navigation, workspaces, or portal copy operations.", method: "GET", path: "/api/home_portal/nav_preview + /api/home_portal/workspaces + /api/home_portal/copy_preview" },
22658
+ { name: "config.home_portal.import", description: "Import navigation into the flow portal using a preview token.", method: "POST", path: "/api/home_portal/nav_import" },
22659
+ { name: "config.home_portal.copy", description: "Copy a flow portal from another workspace using a preview token.", method: "POST", path: "/api/home_portal/copy" },
22494
22660
  { name: "config.step_detail_template.export", description: "Export type=6 flow-step detail template config.", method: "GET", path: "/api/flow_page_template/:id?type=6&skip_i18n=true" },
22495
22661
  { name: "config.step_detail_template.create", description: "Create a type=6 flow-step detail template through a verified typed adapter.", method: "POST", path: "/api/flow_page_template?type=6" },
22496
22662
  { name: "config.step_detail_template.delete", description: "Delete a type=6 flow-step detail template through a verified typed adapter.", method: "DELETE", path: "/api/flow_page_template/:id?type=6" },
@@ -23120,7 +23286,7 @@ function hasDynamicRuntimeId(value) {
23120
23286
  if (!value || value.includes("{{")) return false;
23121
23287
  return /(?:[?&](?:id|project_id|step_id|trace_id)=\d+)|(?:\/project(?:Continue|_detail)?\/\d+)/i.test(value);
23122
23288
  }
23123
- function targetIssues(target, stepKey, actionIndex) {
23289
+ function targetIssues(target, stepKey, actionIndex, actionType = "") {
23124
23290
  if (!isRecord9(target)) {
23125
23291
  return [{
23126
23292
  rule_id: "test_suite.automation.target_missing",
@@ -23160,7 +23326,8 @@ function targetIssues(target, stepKey, actionIndex) {
23160
23326
  }];
23161
23327
  }
23162
23328
  const css = stringValue2(target.css);
23163
- if (css && !/^(?:\[(?:data-[\w-]+|name|aria-label)=|#[A-Za-z][\w:-]*$)/.test(css)) {
23329
+ const knownListContainerCss = actionType === "list.assert_record" && css === ".project-table-container";
23330
+ if (css && !knownListContainerCss && !/^(?:\[(?:data-[\w-]+|name|aria-label)=|#[A-Za-z][\w:-]*$)/.test(css)) {
23164
23331
  return [{
23165
23332
  rule_id: "test_suite.automation.selector_unstable",
23166
23333
  step_key: stepKey,
@@ -23248,7 +23415,7 @@ function actionIssues(action, stepKey, index, check, resolutionOutcome) {
23248
23415
  "file.download",
23249
23416
  "wait.visible"
23250
23417
  ].includes(type)) {
23251
- issues.push(...targetIssues(action.target ?? (action.field ? { field: action.field } : void 0), stepKey, index));
23418
+ issues.push(...targetIssues(action.target ?? (action.field ? { field: action.field } : void 0), stepKey, index, type));
23252
23419
  }
23253
23420
  if (type === "page.assert_text_sequence") {
23254
23421
  const target = isRecord9(action.target) ? action.target : {};
@@ -31848,7 +32015,10 @@ function browserPageStepMatches(expected, bodyText, textVisible, runtimeUrl = ""
31848
32015
  return normalizedActiveSteps.includes(normalizedExpected);
31849
32016
  }
31850
32017
  if (handledCurrentStep) return expected === "\u64CD\u4F5C\u6210\u529F";
31851
- return textVisible;
32018
+ if (normalizedExpected === "\u5F52\u6863" && textVisible && /归档[\s\S]{0,80}(?:完成|已完成|已归档)/.test(bodyText)) {
32019
+ return true;
32020
+ }
32021
+ return false;
31852
32022
  }
31853
32023
  function browserEvidenceStatusIsVerified(status) {
31854
32024
  return status !== "submitted_outcome_unknown";
@@ -32616,7 +32786,7 @@ function browserListContainerKind(descriptor) {
32616
32786
  if (classes.has("el-table")) return "element_table";
32617
32787
  if (descriptor.tag === "table") return "table";
32618
32788
  if (descriptor.role === "rowgroup") return "rowgroup";
32619
- if (/(?:^|[-_])(list|table|records)(?:$|[-_])/i.test(descriptor.test_id) || classes.has("project-list") || classes.has("list-container")) return "known_list";
32789
+ if (/(?:^|[-_])(list|table|records)(?:$|[-_])/i.test(descriptor.test_id) || classes.has("project-list") || classes.has("list-container") || classes.has("project-table-container")) return "known_list";
32620
32790
  return void 0;
32621
32791
  }
32622
32792
  async function visibleBrowserRecords(records) {
@@ -33060,7 +33230,13 @@ async function executeAction(page, action, variables, runtime) {
33060
33230
  }
33061
33231
  case "detail.assert_rows": {
33062
33232
  const table = await tableLocator(page, String(next.table));
33063
- const count = await table.locator(".el-table__body-wrapper tbody tr, .el-table__body tr, tbody tr").count();
33233
+ const rowGroups = [
33234
+ table.locator(".el-table__body-wrapper:not(.el-table__fixed-body-wrapper) > table.el-table__body > tbody > tr"),
33235
+ table.locator("table:not(.el-table__fixed) > tbody > tr"),
33236
+ table.locator('[role="rowgroup"] > [role="row"]')
33237
+ ];
33238
+ const rows2 = await firstVisibleBrowserRecordGroup(rowGroups);
33239
+ const count = rows2.length;
33064
33240
  const passed = count === Number(next.count);
33065
33241
  if (!passed) throw new Error(`detail row count mismatch: expected ${next.count}, got ${count}`);
33066
33242
  return { assertion: { type: next.type, passed, table: next.table, count } };
@@ -36753,40 +36929,74 @@ function mergeField(existing, incoming) {
36753
36929
  ...children?.length ? { children } : {}
36754
36930
  };
36755
36931
  }
36756
- function collectFieldCandidates(value, fields, depth = 0) {
36932
+ function fieldRecords(value) {
36933
+ if (Array.isArray(value)) return value.flatMap((item) => fieldRecords(item));
36934
+ if (!isRecord14(value)) return [];
36935
+ if (pickString(value, FIELD_KEY_NAMES)) return [value];
36936
+ return Object.values(value).flatMap((item) => fieldRecords(item));
36937
+ }
36938
+ function fieldLabel(value) {
36939
+ return pickString(value, FIELD_LABEL_NAMES)?.toLowerCase() ?? "";
36940
+ }
36941
+ function collectFieldCandidates(value, fields, aliases = /* @__PURE__ */ new Map(), depth = 0) {
36757
36942
  if (depth > 8) {
36758
36943
  return;
36759
36944
  }
36760
36945
  if (Array.isArray(value)) {
36761
36946
  for (const item of value) {
36762
- collectFieldCandidates(item, fields, depth + 1);
36947
+ collectFieldCandidates(item, fields, new Map(aliases), depth + 1);
36763
36948
  }
36764
36949
  return;
36765
36950
  }
36766
36951
  if (!isRecord14(value)) {
36767
36952
  return;
36768
36953
  }
36954
+ const localAliases = new Map(aliases);
36955
+ for (const [ruleName, valueName] of [["rule", "value"], ["rules", "values"]]) {
36956
+ const rules = fieldRecords(value[ruleName]);
36957
+ const values = fieldRecords(value[valueName]);
36958
+ if (rules.length === 0 || values.length === 0) continue;
36959
+ const usedValues = /* @__PURE__ */ new Set();
36960
+ for (let index = 0; index < rules.length; index += 1) {
36961
+ const rule = rules[index];
36962
+ const ruleKey = pickString(rule, FIELD_KEY_NAMES);
36963
+ if (!ruleKey) continue;
36964
+ let valueIndex = values.findIndex((candidate, candidateIndex) => !usedValues.has(candidateIndex) && fieldLabel(rule) !== "" && fieldLabel(rule) === fieldLabel(candidate));
36965
+ const positionalCandidate = index < values.length ? values[index] : void 0;
36966
+ const labelsCompatible = !fieldLabel(rule) || !positionalCandidate || !fieldLabel(positionalCandidate) || fieldLabel(rule) === fieldLabel(positionalCandidate);
36967
+ if (valueIndex < 0 && labelsCompatible && index < values.length && !usedValues.has(index)) valueIndex = index;
36968
+ if (valueIndex < 0) continue;
36969
+ const persisted = values[valueIndex];
36970
+ const persistedKey = pickString(persisted, FIELD_KEY_NAMES);
36971
+ if (!ruleKey || !persistedKey || ruleKey === persistedKey) continue;
36972
+ usedValues.add(valueIndex);
36973
+ localAliases.set(ruleKey, persistedKey);
36974
+ localAliases.set(persistedKey, persistedKey);
36975
+ }
36976
+ }
36769
36977
  const field = fieldFromRecord(value);
36770
36978
  if (field) {
36771
- if (isSubFormField(field)) {
36979
+ const canonicalKey = localAliases.get(field.key) ?? field.key;
36980
+ const canonicalField = canonicalKey === field.key ? field : { ...field, key: canonicalKey };
36981
+ if (isSubFormField(canonicalField)) {
36772
36982
  const childFields = /* @__PURE__ */ new Map();
36773
36983
  for (const child of Object.values(value)) {
36774
36984
  if (isRecord14(child) || Array.isArray(child)) {
36775
- collectFieldCandidates(child, childFields, depth + 1);
36985
+ collectFieldCandidates(child, childFields, localAliases, depth + 1);
36776
36986
  }
36777
36987
  }
36778
36988
  const children = [...childFields.values()].sort((left, right) => left.key.localeCompare(right.key));
36779
36989
  fields.set(
36780
- field.key,
36781
- mergeField(fields.get(field.key), { ...field, ...children.length ? { children } : {} })
36990
+ canonicalKey,
36991
+ mergeField(fields.get(canonicalKey), { ...canonicalField, ...children.length ? { children } : {} })
36782
36992
  );
36783
36993
  return;
36784
36994
  }
36785
- fields.set(field.key, mergeField(fields.get(field.key), field));
36995
+ fields.set(canonicalKey, mergeField(fields.get(canonicalKey), canonicalField));
36786
36996
  }
36787
36997
  for (const child of Object.values(value)) {
36788
36998
  if (isRecord14(child) || Array.isArray(child)) {
36789
- collectFieldCandidates(child, fields, depth + 1);
36999
+ collectFieldCandidates(child, fields, localAliases, depth + 1);
36790
37000
  }
36791
37001
  }
36792
37002
  }
@@ -41622,7 +41832,7 @@ function cancelIfNeeded(value) {
41622
41832
  throw new Error("Interactive project creation cancelled.");
41623
41833
  }
41624
41834
  }
41625
- function fieldLabel(field) {
41835
+ function fieldLabel2(field) {
41626
41836
  return field.label ? `${field.label} (${field.key})` : field.key;
41627
41837
  }
41628
41838
  function isArrayField(field) {
@@ -41648,7 +41858,7 @@ function subFormHint(field) {
41648
41858
  return `JSON array rows: ${children}`;
41649
41859
  }
41650
41860
  async function promptField(field, currentValue) {
41651
- const message = field.required ? `${fieldLabel(field)} *` : fieldLabel(field);
41861
+ const message = field.required ? `${fieldLabel2(field)} *` : fieldLabel2(field);
41652
41862
  if (isSubFormField(field)) {
41653
41863
  const value2 = await text3({
41654
41864
  message,