bpmax-cli 0.2.1-beta.80 → 0.2.1-beta.82
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 +244 -37
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -458,6 +458,24 @@ function capabilityEnabled(cache, capabilityName, now = /* @__PURE__ */ new Date
|
|
|
458
458
|
}
|
|
459
459
|
return cache.capabilities.some((item) => item.name === capabilityName && item.enabled === true);
|
|
460
460
|
}
|
|
461
|
+
function capabilityStatus(profile, capabilityName, now = /* @__PURE__ */ new Date()) {
|
|
462
|
+
const cache = profile.capabilities_cache;
|
|
463
|
+
const cacheFresh = Boolean(cache && Date.parse(cache.expires_at) > now.getTime());
|
|
464
|
+
if (cacheFresh && cache) {
|
|
465
|
+
const entry = cache.capabilities.find((item) => item.name === capabilityName);
|
|
466
|
+
if (entry) {
|
|
467
|
+
return { status: entry.enabled === true ? "enabled" : "disabled", source: "server_capabilities" };
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
const localValue = profile.api_key_capabilities?.[capabilityName];
|
|
471
|
+
if (localValue === true) {
|
|
472
|
+
return { status: "enabled", source: "local_authorization" };
|
|
473
|
+
}
|
|
474
|
+
if (localValue === false) {
|
|
475
|
+
return { status: "disabled", source: "local_authorization" };
|
|
476
|
+
}
|
|
477
|
+
return { status: "unknown", source: "none" };
|
|
478
|
+
}
|
|
461
479
|
async function updateProfileCapabilities(profileName, cache) {
|
|
462
480
|
const config = await loadConfig();
|
|
463
481
|
const profile = config.profiles[profileName];
|
|
@@ -522,7 +540,7 @@ function pluginAgentCapabilityForRequest(method, normalizedPath) {
|
|
|
522
540
|
// package.json
|
|
523
541
|
var package_default = {
|
|
524
542
|
name: "bpmax-cli",
|
|
525
|
-
version: "0.2.1-beta.
|
|
543
|
+
version: "0.2.1-beta.82",
|
|
526
544
|
description: "CLI for BPMAX environments with multi-profile config and local login callback flow",
|
|
527
545
|
type: "module",
|
|
528
546
|
bin: {
|
|
@@ -11882,6 +11900,38 @@ function normalizeFlowTemplatePayload(work, options = {}) {
|
|
|
11882
11900
|
}
|
|
11883
11901
|
return payload;
|
|
11884
11902
|
}
|
|
11903
|
+
function flowTemplateLintOnlyDeclarations(work) {
|
|
11904
|
+
const lint = isRecord6(work.bpmax_lint) ? work.bpmax_lint : {};
|
|
11905
|
+
return Object.keys(lint).length ? lint : {};
|
|
11906
|
+
}
|
|
11907
|
+
function buildFlowTemplateLintOnlyEvidence(work, payload) {
|
|
11908
|
+
const declarations = flowTemplateLintOnlyDeclarations(work);
|
|
11909
|
+
if (!Object.keys(declarations).length) {
|
|
11910
|
+
return void 0;
|
|
11911
|
+
}
|
|
11912
|
+
return {
|
|
11913
|
+
schema_version: 1,
|
|
11914
|
+
declarations,
|
|
11915
|
+
declarations_hash: hashJson(declarations),
|
|
11916
|
+
payload_hash: hashJson(payload)
|
|
11917
|
+
};
|
|
11918
|
+
}
|
|
11919
|
+
function readFlowTemplateLintOnlyDeclarations(submit) {
|
|
11920
|
+
const evidence = isRecord6(submit.lint_only_evidence) ? submit.lint_only_evidence : void 0;
|
|
11921
|
+
if (!evidence) {
|
|
11922
|
+
return {};
|
|
11923
|
+
}
|
|
11924
|
+
if (evidence.schema_version !== 1 || !isRecord6(evidence.declarations) || typeof evidence.declarations_hash !== "string" || typeof evidence.payload_hash !== "string") {
|
|
11925
|
+
throw new Error("flow-template lint-only evidence is malformed; rebuild the submit payload.");
|
|
11926
|
+
}
|
|
11927
|
+
if (evidence.declarations_hash !== hashJson(evidence.declarations)) {
|
|
11928
|
+
throw new Error("flow-template lint-only evidence was modified after build; rebuild the submit payload.");
|
|
11929
|
+
}
|
|
11930
|
+
if (isRecord6(submit.payload) && evidence.payload_hash !== hashJson(submit.payload)) {
|
|
11931
|
+
throw new Error("flow-template lint-only evidence does not match this submit payload; rebuild the submit payload.");
|
|
11932
|
+
}
|
|
11933
|
+
return evidence.declarations;
|
|
11934
|
+
}
|
|
11885
11935
|
function validateNonEmptyFlowCreatePayload(payload) {
|
|
11886
11936
|
const data = payload.data;
|
|
11887
11937
|
if (!isRecord6(data) || !Array.isArray(data.nodes) || !data.nodes.some((node) => isRecord6(node) && typeof node.id === "string" && node.id.trim())) {
|
|
@@ -13647,6 +13697,22 @@ function validateFormTemplateSubmitPayload(payload, mode) {
|
|
|
13647
13697
|
throw new Error(`form-template lint failed: ${errors.join("; ")}`);
|
|
13648
13698
|
}
|
|
13649
13699
|
}
|
|
13700
|
+
function validateFormTemplateSubmitPayloadWithBaseline(payload, mode, raw) {
|
|
13701
|
+
const errors = [];
|
|
13702
|
+
validateFormTemplateWorkLint(payload, errors, [], mode);
|
|
13703
|
+
if (!errors.length) {
|
|
13704
|
+
return;
|
|
13705
|
+
}
|
|
13706
|
+
if (mode === "create" || !isRecord6(raw)) {
|
|
13707
|
+
throw new Error(`form-template lint failed: ${errors.join("; ")}`);
|
|
13708
|
+
}
|
|
13709
|
+
const baselineErrors = [];
|
|
13710
|
+
validateFormTemplateWorkLint(raw, baselineErrors, [], "edit");
|
|
13711
|
+
const classified = classifyFormTemplateEditLint(errors, baselineErrors);
|
|
13712
|
+
if (classified.errors.length) {
|
|
13713
|
+
throw new Error(`form-template lint failed: ${classified.errors.join("; ")}`);
|
|
13714
|
+
}
|
|
13715
|
+
}
|
|
13650
13716
|
function collectSubFormTemplateBindings(payload) {
|
|
13651
13717
|
const bindings = /* @__PURE__ */ new Map();
|
|
13652
13718
|
for (const entry of collectFormTemplateRuleEntries(payload)) {
|
|
@@ -14736,7 +14802,90 @@ function buildNavConfigSubmitPayload(work, raw, options = {}) {
|
|
|
14736
14802
|
all_records: Boolean(options.allRecords)
|
|
14737
14803
|
};
|
|
14738
14804
|
}
|
|
14739
|
-
|
|
14805
|
+
var NAV_NAME_HANZI_LIMIT = 6;
|
|
14806
|
+
function navConfigLongNameExceptions(work, errors) {
|
|
14807
|
+
const exceptions = /* @__PURE__ */ new Map();
|
|
14808
|
+
const lint = isRecord6(work.bpmax_lint) ? work.bpmax_lint : {};
|
|
14809
|
+
const declarations = lint.long_nav_name_exceptions;
|
|
14810
|
+
if (declarations === void 0) {
|
|
14811
|
+
return exceptions;
|
|
14812
|
+
}
|
|
14813
|
+
if (!Array.isArray(declarations)) {
|
|
14814
|
+
errors.push("bpmax_lint.long_nav_name_exceptions must be an array.");
|
|
14815
|
+
return exceptions;
|
|
14816
|
+
}
|
|
14817
|
+
declarations.forEach((declaration, index) => {
|
|
14818
|
+
const pathName = `bpmax_lint.long_nav_name_exceptions[${index}]`;
|
|
14819
|
+
if (!isRecord6(declaration)) {
|
|
14820
|
+
errors.push(`${pathName} must be an object.`);
|
|
14821
|
+
return;
|
|
14822
|
+
}
|
|
14823
|
+
const pathKey = typeof declaration.path === "string" ? declaration.path.trim() : "";
|
|
14824
|
+
const name = typeof declaration.name === "string" ? declaration.name.trim() : "";
|
|
14825
|
+
const reason = typeof declaration.reason === "string" ? declaration.reason.trim() : "";
|
|
14826
|
+
if (!pathKey) {
|
|
14827
|
+
errors.push(`${pathName}.path is required, for example navmenu.navConfig[0].sub[2].`);
|
|
14828
|
+
}
|
|
14829
|
+
if (!name) {
|
|
14830
|
+
errors.push(`${pathName}.name is required so the exception is bound to one exact menu name.`);
|
|
14831
|
+
}
|
|
14832
|
+
if (!reason) {
|
|
14833
|
+
errors.push(`${pathName}.reason is required to explain why the name exceeds the 6 Hanzi limit.`);
|
|
14834
|
+
}
|
|
14835
|
+
if (!pathKey || !name || !reason) {
|
|
14836
|
+
return;
|
|
14837
|
+
}
|
|
14838
|
+
if (exceptions.has(pathKey)) {
|
|
14839
|
+
errors.push(`${pathName} duplicates the long-name exception for ${pathKey}.`);
|
|
14840
|
+
return;
|
|
14841
|
+
}
|
|
14842
|
+
exceptions.set(pathKey, { name, reason });
|
|
14843
|
+
});
|
|
14844
|
+
return exceptions;
|
|
14845
|
+
}
|
|
14846
|
+
function navConfigNodeUnchanged(node, nodePath, baseline) {
|
|
14847
|
+
const baselineNodes = navConfigNodesByPath(baseline);
|
|
14848
|
+
const signature = navConfigNodeSignature(node);
|
|
14849
|
+
const exact = baselineNodes.get(nodePath);
|
|
14850
|
+
if (exact && navConfigNodeSignature(exact) === signature) {
|
|
14851
|
+
return true;
|
|
14852
|
+
}
|
|
14853
|
+
const typePrefix = nodePath.split(".")[0];
|
|
14854
|
+
for (const [baselinePath, baselineNode] of baselineNodes) {
|
|
14855
|
+
if (!baselinePath.startsWith(`${typePrefix}.`)) continue;
|
|
14856
|
+
if (navConfigNodeSignature(baselineNode) === signature) {
|
|
14857
|
+
return true;
|
|
14858
|
+
}
|
|
14859
|
+
}
|
|
14860
|
+
return false;
|
|
14861
|
+
}
|
|
14862
|
+
function navConfigNodeSignature(node) {
|
|
14863
|
+
const name = typeof node.name === "string" ? node.name.trim() : "";
|
|
14864
|
+
const icon = typeof node.icon === "string" ? node.icon.trim() : "";
|
|
14865
|
+
const route = typeof node.path === "string" ? node.path.trim() : "";
|
|
14866
|
+
return `${name}\0${icon}\0${route}`;
|
|
14867
|
+
}
|
|
14868
|
+
function navConfigNodesByPath(value) {
|
|
14869
|
+
const byPath = /* @__PURE__ */ new Map();
|
|
14870
|
+
const configs = isRecord6(value.configs) ? value.configs : {};
|
|
14871
|
+
for (const type of NAV_CONFIG_TYPES) {
|
|
14872
|
+
const config = isRecord6(configs[type]) ? configs[type] : void 0;
|
|
14873
|
+
if (!config) continue;
|
|
14874
|
+
const contentKey = NAV_CONTENT_KEY_BY_TYPE[type];
|
|
14875
|
+
const { items } = navConfigItemsForType(type, config);
|
|
14876
|
+
const walk = (nodes, pathPrefix) => {
|
|
14877
|
+
nodes.forEach((node, index) => {
|
|
14878
|
+
if (!isRecord6(node)) return;
|
|
14879
|
+
const nodePath = `${pathPrefix}[${index}]`;
|
|
14880
|
+
byPath.set(nodePath, node);
|
|
14881
|
+
walk(Array.isArray(node.sub) ? node.sub : [], `${nodePath}.sub`);
|
|
14882
|
+
});
|
|
14883
|
+
};
|
|
14884
|
+
walk(Array.isArray(items) ? items : [], `${type}.${contentKey}`);
|
|
14885
|
+
}
|
|
14886
|
+
return byPath;
|
|
14887
|
+
}
|
|
14888
|
+
function lintNavConfigWork(work, errors, options = {}) {
|
|
14740
14889
|
if (work.domain !== void 0 && work.domain !== "nav-config") {
|
|
14741
14890
|
errors.push(`nav-config work domain must be nav-config, got ${JSON.stringify(work.domain)}.`);
|
|
14742
14891
|
}
|
|
@@ -14765,13 +14914,13 @@ function lintNavConfigWork(work, errors) {
|
|
|
14765
14914
|
errors.push(`nav-config ${type} requires name.`);
|
|
14766
14915
|
}
|
|
14767
14916
|
const items = Array.isArray(content[contentKey]) ? content[contentKey] : [];
|
|
14768
|
-
lintNavConfigNodes(type, items, `${type}.${contentKey}`, errors);
|
|
14917
|
+
lintNavConfigNodes(type, items, `${type}.${contentKey}`, errors, options);
|
|
14769
14918
|
} catch (error) {
|
|
14770
14919
|
errors.push(error instanceof Error ? error.message : String(error));
|
|
14771
14920
|
}
|
|
14772
14921
|
}
|
|
14773
14922
|
}
|
|
14774
|
-
function lintNavConfigNodes(type, nodes, pathPrefix, errors) {
|
|
14923
|
+
function lintNavConfigNodes(type, nodes, pathPrefix, errors, options = {}) {
|
|
14775
14924
|
const mobile = type === "navmenu_mobile" || type === "shortcut_mobile";
|
|
14776
14925
|
const shortcut = type === "shortcut" || type === "shortcut_mobile";
|
|
14777
14926
|
nodes.forEach((node, index) => {
|
|
@@ -14780,15 +14929,24 @@ function lintNavConfigNodes(type, nodes, pathPrefix, errors) {
|
|
|
14780
14929
|
errors.push(`${nodePath} must be an object.`);
|
|
14781
14930
|
return;
|
|
14782
14931
|
}
|
|
14932
|
+
const unchanged = options.baseline !== void 0 && navConfigNodeUnchanged(node, nodePath, options.baseline);
|
|
14783
14933
|
const name = typeof node.name === "string" ? node.name.trim() : "";
|
|
14784
14934
|
if (!name) {
|
|
14785
14935
|
errors.push(`${nodePath}.name must be a non-empty string.`);
|
|
14786
14936
|
}
|
|
14787
|
-
|
|
14788
|
-
|
|
14937
|
+
const exception = options.longNameExceptions?.get(nodePath);
|
|
14938
|
+
const exceptionApplies = Boolean(exception && exception.name === name);
|
|
14939
|
+
if (exception && !exceptionApplies) {
|
|
14940
|
+
errors.push(
|
|
14941
|
+
`${nodePath}.name is ${JSON.stringify(name)} but the long-name exception declares ${JSON.stringify(exception.name)}; keep the exception bound to the exact name it was reviewed for.`
|
|
14942
|
+
);
|
|
14943
|
+
}
|
|
14944
|
+
if (name.length > NAV_NAME_HANZI_LIMIT && !exceptionApplies && !unchanged) {
|
|
14945
|
+
errors.push(`${nodePath}.name exceeds the ${NAV_NAME_HANZI_LIMIT} Hanzi limit.`);
|
|
14789
14946
|
}
|
|
14790
14947
|
const icon = typeof node.icon === "string" ? node.icon.trim() : "";
|
|
14791
|
-
|
|
14948
|
+
const iconWellFormed = /^(ri ri_[A-Za-z0-9_-]+|el-icon-[A-Za-z0-9_-]+)$/.test(icon);
|
|
14949
|
+
if (!iconWellFormed && !unchanged) {
|
|
14792
14950
|
errors.push(`${nodePath}.icon must be a full icon class such as ri ri_home-5-line.`);
|
|
14793
14951
|
}
|
|
14794
14952
|
const nodePathValue = typeof node.path === "string" ? node.path.trim() : "";
|
|
@@ -14817,7 +14975,7 @@ function lintNavConfigNodes(type, nodes, pathPrefix, errors) {
|
|
|
14817
14975
|
if (shortcut && sub.length > 0) {
|
|
14818
14976
|
errors.push(`${nodePath}.sub must stay empty for shortcut configs.`);
|
|
14819
14977
|
}
|
|
14820
|
-
lintNavConfigNodes(type, sub, `${nodePath}.sub`, errors);
|
|
14978
|
+
lintNavConfigNodes(type, sub, `${nodePath}.sub`, errors, options);
|
|
14821
14979
|
});
|
|
14822
14980
|
}
|
|
14823
14981
|
async function collectNavConfigAggregate(profile, id) {
|
|
@@ -17407,6 +17565,7 @@ async function buildConfigSubmitPayload(domain, workFile, outFile, metaFile, opt
|
|
|
17407
17565
|
};
|
|
17408
17566
|
}
|
|
17409
17567
|
let ignoredPreexistingLintErrors = [];
|
|
17568
|
+
let flowTemplateLintOnlyEvidence;
|
|
17410
17569
|
if (domain === "flow-template" && options.allowPreexistingLintErrors) {
|
|
17411
17570
|
if (createMode) {
|
|
17412
17571
|
throw new Error("--allow-preexisting-lint-errors requires an exported edit baseline and cannot be used for create mode.");
|
|
@@ -17494,6 +17653,16 @@ async function buildConfigSubmitPayload(domain, workFile, outFile, metaFile, opt
|
|
|
17494
17653
|
throw new Error(`filter-template lint failed: ${errors.join("; ")}`);
|
|
17495
17654
|
}
|
|
17496
17655
|
}
|
|
17656
|
+
if (domain === "nav-config" && isRecord6(work)) {
|
|
17657
|
+
const errors = [];
|
|
17658
|
+
lintNavConfigWork(work, errors, {
|
|
17659
|
+
baseline: isRecord6(raw) ? raw : void 0,
|
|
17660
|
+
longNameExceptions: navConfigLongNameExceptions(work, errors)
|
|
17661
|
+
});
|
|
17662
|
+
if (errors.length) {
|
|
17663
|
+
throw new Error(`nav-config lint failed: ${errors.join("; ")}`);
|
|
17664
|
+
}
|
|
17665
|
+
}
|
|
17497
17666
|
if (domain === "step-detail-template" && isRecord6(work)) {
|
|
17498
17667
|
const errors = [];
|
|
17499
17668
|
const warnings = [];
|
|
@@ -17554,6 +17723,9 @@ async function buildConfigSubmitPayload(domain, workFile, outFile, metaFile, opt
|
|
|
17554
17723
|
if (domain === "flow-template" && options.publishLive) {
|
|
17555
17724
|
payload.publish_live = true;
|
|
17556
17725
|
}
|
|
17726
|
+
if (domain === "flow-template" && isRecord6(work)) {
|
|
17727
|
+
flowTemplateLintOnlyEvidence = buildFlowTemplateLintOnlyEvidence(work, payload);
|
|
17728
|
+
}
|
|
17557
17729
|
if (!Object.keys(payload).length) {
|
|
17558
17730
|
throw new Error(`Config build produced an empty payload for ${domain}.`);
|
|
17559
17731
|
}
|
|
@@ -17626,6 +17798,7 @@ async function buildConfigSubmitPayload(domain, workFile, outFile, metaFile, opt
|
|
|
17626
17798
|
runtime_proof_required: flowReportReferenceAudit.references.length > 0 || flowStepDetailRuntimeProofRequired(stepDetailReferenceAudit)
|
|
17627
17799
|
} : {},
|
|
17628
17800
|
...ignoredPreexistingLintErrors.length ? { ignored_preexisting_lint_errors: ignoredPreexistingLintErrors } : {},
|
|
17801
|
+
...flowTemplateLintOnlyEvidence ? { lint_only_evidence: flowTemplateLintOnlyEvidence } : {},
|
|
17629
17802
|
...listTemplateSafety ? { list_template_safety: listTemplateSafety } : {},
|
|
17630
17803
|
...pageTemplateScope ? { page_template_scope: pageTemplateScope } : {},
|
|
17631
17804
|
...pageTemplatePreviewManifest ? { preview_manifest: pageTemplatePreviewManifest } : {}
|
|
@@ -17778,6 +17951,7 @@ async function lintConfigWorkFile(file, options = {}) {
|
|
|
17778
17951
|
const value = await readJsonFile(file);
|
|
17779
17952
|
const flowTemplateBaseline = options.domain === "flow-template" ? await inferFlowTemplateBaselineFromWorkFile(file) : void 0;
|
|
17780
17953
|
const formTemplateBaseline = options.domain === "form-template" ? await inferFormTemplateBaselineFromWorkFile(file) : void 0;
|
|
17954
|
+
const navConfigBaseline = options.domain === "nav-config" || isRecord6(value) && isRecord6(value.configs) ? await inferTypedBaselineFromWorkFile(file, "nav-config") : void 0;
|
|
17781
17955
|
const errors = [];
|
|
17782
17956
|
const warnings = [];
|
|
17783
17957
|
let pluginLint;
|
|
@@ -17876,7 +18050,11 @@ async function lintConfigWorkFile(file, options = {}) {
|
|
|
17876
18050
|
lintConsoleTemplateWork(value, errors, warnings);
|
|
17877
18051
|
}
|
|
17878
18052
|
if (value.domain === "nav-config" || Object.prototype.hasOwnProperty.call(value, "configs")) {
|
|
17879
|
-
|
|
18053
|
+
const navWork = value;
|
|
18054
|
+
lintNavConfigWork(navWork, errors, {
|
|
18055
|
+
baseline: navConfigBaseline,
|
|
18056
|
+
longNameExceptions: navConfigLongNameExceptions(navWork, errors)
|
|
18057
|
+
});
|
|
17880
18058
|
}
|
|
17881
18059
|
if (isFlowTemplateWork(value)) {
|
|
17882
18060
|
const flowWork = value;
|
|
@@ -18540,21 +18718,23 @@ async function submitConfigDomain(config, profile, domain, id, submitFile, confi
|
|
|
18540
18718
|
let flowCategoryReferenceAudit;
|
|
18541
18719
|
if (domain === "flow-template") {
|
|
18542
18720
|
const lintExemptionVerified = await validateFlowTemplateSubmitLintExemption(submit);
|
|
18721
|
+
const hasLintOnlyEvidence = submit.lint_only_evidence !== void 0;
|
|
18722
|
+
const gateView = hasLintOnlyEvidence ? { ...submit.payload, bpmax_lint: readFlowTemplateLintOnlyDeclarations(submit) } : submit.payload;
|
|
18543
18723
|
if (!lintExemptionVerified) {
|
|
18544
|
-
validateFlowTemplateRemoteTemplateRefs(
|
|
18545
|
-
validateFlowTemplateExpectedChildFlows(
|
|
18546
|
-
validateFlowTemplateProjectAfterCreatePath(
|
|
18547
|
-
validateFlowTemplateStandardPageCreateFormTemplate(
|
|
18548
|
-
validateFlowTemplateStartConditionalJump(
|
|
18549
|
-
validateFlowTemplateApproveActionShape(
|
|
18550
|
-
validateFlowTemplatePluginRejectionControl(
|
|
18551
|
-
validateFlowTemplateUrgentReminder(
|
|
18552
|
-
validateFlowTemplateStandardConditionEditorRules(
|
|
18553
|
-
validateFlowTemplateCodeModeMessages(
|
|
18554
|
-
validateFlowTemplateRuntimeScripts(
|
|
18555
|
-
validateFlowTemplateFeishuChatPlugin(
|
|
18556
|
-
validateFlowTemplateProjectNameTemplate(
|
|
18557
|
-
validateFlowTemplateStandardFlowType(
|
|
18724
|
+
validateFlowTemplateRemoteTemplateRefs(gateView);
|
|
18725
|
+
validateFlowTemplateExpectedChildFlows(gateView);
|
|
18726
|
+
validateFlowTemplateProjectAfterCreatePath(gateView);
|
|
18727
|
+
validateFlowTemplateStandardPageCreateFormTemplate(gateView);
|
|
18728
|
+
validateFlowTemplateStartConditionalJump(gateView);
|
|
18729
|
+
validateFlowTemplateApproveActionShape(gateView);
|
|
18730
|
+
validateFlowTemplatePluginRejectionControl(gateView);
|
|
18731
|
+
validateFlowTemplateUrgentReminder(gateView);
|
|
18732
|
+
validateFlowTemplateStandardConditionEditorRules(gateView);
|
|
18733
|
+
validateFlowTemplateCodeModeMessages(gateView);
|
|
18734
|
+
validateFlowTemplateRuntimeScripts(gateView);
|
|
18735
|
+
validateFlowTemplateFeishuChatPlugin(gateView);
|
|
18736
|
+
validateFlowTemplateProjectNameTemplate(gateView);
|
|
18737
|
+
validateFlowTemplateStandardFlowType(gateView);
|
|
18558
18738
|
validateFlowTemplateStageStepCoverage(submit.payload);
|
|
18559
18739
|
}
|
|
18560
18740
|
validateFlowTemplateIdentityStandard(id, submit.payload);
|
|
@@ -18696,7 +18876,11 @@ async function submitConfigDomain(config, profile, domain, id, submitFile, confi
|
|
|
18696
18876
|
if (isRecord6(current)) {
|
|
18697
18877
|
validateNonDestructiveFormEdit(submit.payload, current);
|
|
18698
18878
|
}
|
|
18699
|
-
|
|
18879
|
+
validateFormTemplateSubmitPayloadWithBaseline(
|
|
18880
|
+
submit.payload,
|
|
18881
|
+
"edit",
|
|
18882
|
+
await readTypedBaselineFromMeta(submit.meta, "form-template")
|
|
18883
|
+
);
|
|
18700
18884
|
const safetyErrors = [];
|
|
18701
18885
|
validateFormTemplateEditSafety(submit.payload, current, safetyErrors);
|
|
18702
18886
|
if (safetyErrors.length) {
|
|
@@ -20411,7 +20595,8 @@ function assertSafeEnv(env) {
|
|
|
20411
20595
|
function renderConfigWorkspaceGuide(options) {
|
|
20412
20596
|
assertSafeEnv(options.env);
|
|
20413
20597
|
const { start, end } = configWorkspaceMarkers(options.env);
|
|
20414
|
-
const
|
|
20598
|
+
const capability = capabilityStatus(options.profile, "configuration.manage");
|
|
20599
|
+
const capabilityNotice = capability.status === "enabled" ? "" : capability.status === "disabled" ? "> \u5F53\u524D profile \u7684 API Key \u5DF2\u786E\u8BA4\u672A\u5F00\u542F\u914D\u7F6E\u80FD\u529B\u3002\u9700\u8981\u91CD\u65B0\u6388\u6743\u5E76\u5728\u6388\u6743\u9875\u624B\u52A8\u52FE\u9009\u201C\u5F00\u542F\u914D\u7F6E\u80FD\u529B\u201D\u540E\uFF0C\u624D\u80FD\u6267\u884C\u8FDC\u7AEF\u914D\u7F6E\u5199\u64CD\u4F5C\u3002\n" : "> \u672C\u5730\u672A\u8BB0\u5F55\u8BE5 profile \u7684\u914D\u7F6E\u80FD\u529B\uFF08unknown\uFF0C\u4E0D\u7B49\u4E8E\u5DF2\u5173\u95ED\uFF09\u3002\u8FDC\u7AEF\u5199\u64CD\u4F5C\u4EE5 typed `config ... build/submit` \u7684\u670D\u52A1\u7AEF\u80FD\u529B\u6821\u9A8C\u4E3A\u51C6\uFF1B`bpmax-cli capabilities refresh --profile <name> --format json` \u53EF\u5237\u65B0\u7F13\u5B58\u540E\u518D\u5224\u65AD\u3002\u4E0D\u8981\u4EC5\u51ED\u672C\u5730\u7F3A\u9879\u8981\u6C42\u91CD\u65B0\u6388\u6743\u3002\n";
|
|
20415
20600
|
const profileArg = shellQuote3(options.profileName);
|
|
20416
20601
|
const envArg = shellQuote3(options.env);
|
|
20417
20602
|
const commandPrefix3 = options.commandPrefix || "bpmax-cli";
|
|
@@ -20432,7 +20617,7 @@ function renderConfigWorkspaceGuide(options) {
|
|
|
20432
20617
|
- sysconfig user: \`${display(options.environment.username)}\`
|
|
20433
20618
|
- secrets: \`[REDACTED]\`
|
|
20434
20619
|
|
|
20435
|
-
${
|
|
20620
|
+
${capabilityNotice}
|
|
20436
20621
|
## \u76EE\u5F55\u8BF4\u660E
|
|
20437
20622
|
| Directory | Purpose |
|
|
20438
20623
|
| --- | --- |
|
|
@@ -21994,6 +22179,7 @@ function registerConfigCommands(program2) {
|
|
|
21994
22179
|
if (!target) {
|
|
21995
22180
|
throw new Error(`Profile "${name}" not found.`);
|
|
21996
22181
|
}
|
|
22182
|
+
const capability = capabilityStatus(target, "configuration.manage");
|
|
21997
22183
|
printResult(options.format, {
|
|
21998
22184
|
name,
|
|
21999
22185
|
config_path: getConfigPath(),
|
|
@@ -22001,7 +22187,11 @@ function registerConfigCommands(program2) {
|
|
|
22001
22187
|
workspace: target.workspace || DEFAULT_WORKSPACE,
|
|
22002
22188
|
language: target.language || DEFAULT_LANGUAGE,
|
|
22003
22189
|
api_key: maskApiKey(target.api_key),
|
|
22004
|
-
|
|
22190
|
+
// `false` means the authoritative source explicitly denied it; an
|
|
22191
|
+
// unrecorded local grant is `unknown`, not a denial.
|
|
22192
|
+
configuration_capability: capability.status === "enabled" ? true : capability.status === "disabled" ? false : null,
|
|
22193
|
+
configuration_capability_status: capability.status,
|
|
22194
|
+
configuration_capability_source: capability.source,
|
|
22005
22195
|
config_environments: Object.keys(target.config_environments || {}),
|
|
22006
22196
|
capabilities_probe: target.capabilities_probe || null,
|
|
22007
22197
|
plugin_skill_update_policy: target.plugin_skill_update_policy || "check",
|
|
@@ -22994,7 +23184,7 @@ var DEFAULT_REQUIRED_CAPABILITIES = [
|
|
|
22994
23184
|
function collect(value, previous) {
|
|
22995
23185
|
return [...previous, value];
|
|
22996
23186
|
}
|
|
22997
|
-
function
|
|
23187
|
+
function capabilityStatus2(name, clientCapabilities, serverCapabilities, cacheFresh) {
|
|
22998
23188
|
const clientSupported = clientCapabilities.has(name);
|
|
22999
23189
|
const server = serverCapabilities.get(name);
|
|
23000
23190
|
const serverGranted = cacheFresh && server?.enabled === true;
|
|
@@ -23022,7 +23212,7 @@ function registerDoctorCommands(program2) {
|
|
|
23022
23212
|
...DEFAULT_REQUIRED_CAPABILITIES,
|
|
23023
23213
|
...options.requireCapability ?? []
|
|
23024
23214
|
])].sort();
|
|
23025
|
-
const capabilities = required.map((name) =>
|
|
23215
|
+
const capabilities = required.map((name) => capabilityStatus2(
|
|
23026
23216
|
name,
|
|
23027
23217
|
clientCapabilities,
|
|
23028
23218
|
serverCapabilities,
|
|
@@ -40537,8 +40727,25 @@ function registerIssueCommands(program2, deps = {}) {
|
|
|
40537
40727
|
|
|
40538
40728
|
// src/core/icon-catalog.ts
|
|
40539
40729
|
import { readFile as readFile22 } from "fs/promises";
|
|
40730
|
+
import { existsSync as existsSync2 } from "fs";
|
|
40731
|
+
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
40540
40732
|
import path23 from "path";
|
|
40541
|
-
var
|
|
40733
|
+
var CATALOG_RELATIVE = path23.join("skills", "bpmax-icon-catalog", "assets", "ri-icons.json");
|
|
40734
|
+
function findCatalogFrom(start) {
|
|
40735
|
+
let current = path23.resolve(start);
|
|
40736
|
+
while (true) {
|
|
40737
|
+
const candidate = path23.join(current, CATALOG_RELATIVE);
|
|
40738
|
+
if (existsSync2(candidate)) return candidate;
|
|
40739
|
+
const parent = path23.dirname(current);
|
|
40740
|
+
if (parent === current) return void 0;
|
|
40741
|
+
current = parent;
|
|
40742
|
+
}
|
|
40743
|
+
}
|
|
40744
|
+
function resolveDefaultIconCatalog() {
|
|
40745
|
+
const packageRoot = path23.resolve(path23.dirname(fileURLToPath5(import.meta.url)), "..", "..");
|
|
40746
|
+
return findCatalogFrom(process.cwd()) ?? findCatalogFrom(packageRoot) ?? path23.resolve(process.cwd(), CATALOG_RELATIVE);
|
|
40747
|
+
}
|
|
40748
|
+
var DEFAULT_ICON_CATALOG = resolveDefaultIconCatalog();
|
|
40542
40749
|
async function loadRiIcons(source = process.env.BPMAX_ICON_CATALOG || DEFAULT_ICON_CATALOG) {
|
|
40543
40750
|
const text5 = await readFile22(source, "utf8");
|
|
40544
40751
|
if (source.endsWith(".json")) {
|
|
@@ -40562,21 +40769,21 @@ function iconName(iconClass) {
|
|
|
40562
40769
|
// src/commands/icon.ts
|
|
40563
40770
|
function registerIconCommands(program2) {
|
|
40564
40771
|
const icon = program2.command("icon").description("Query and validate icons from hpt-frontend ri_icon.ts");
|
|
40565
|
-
icon.command("search").description("Search available runtime icon classes").option("--query <text>", "Case-insensitive substring query", "").option("--limit <number>", "Maximum results", "100").option("--format <format>", "Output format", "json").action(async (options) => {
|
|
40772
|
+
icon.command("search").description("Search available runtime icon classes").option("--query <text>", "Case-insensitive substring query", "").option("--limit <number>", "Maximum results", "100").option("--profile <profile>", "Accepted for workspace consistency; icon catalog is local").option("--format <format>", "Output format", "json").action(async (options) => {
|
|
40566
40773
|
const all = await loadRiIcons();
|
|
40567
40774
|
const query = normalizeIconQuery(options.query);
|
|
40568
40775
|
const limit = Math.max(1, Number.parseInt(options.limit, 10) || 100);
|
|
40569
40776
|
const results = all.filter((item) => !query || item.toLowerCase().includes(query)).slice(0, limit);
|
|
40570
40777
|
printResult(options.format, { query, count: results.length, total: all.length, icons: results });
|
|
40571
40778
|
});
|
|
40572
|
-
icon.command("get <name>").description("Resolve one source name or runtime class").option("--format <format>", "Output format", "json").action(async (name, options) => {
|
|
40779
|
+
icon.command("get <name>").description("Resolve one source name or runtime class").option("--profile <profile>", "Accepted for workspace consistency; icon catalog is local").option("--format <format>", "Output format", "json").action(async (name, options) => {
|
|
40573
40780
|
const all = await loadRiIcons();
|
|
40574
40781
|
const candidate = name.trim().startsWith("ri ") ? name.trim() : `ri ${name.trim()}`;
|
|
40575
40782
|
const found = all.find((item) => item === candidate);
|
|
40576
40783
|
if (!found) throw new Error(`Icon not found: ${name}`);
|
|
40577
40784
|
printResult(options.format, { name: iconName(found), className: found });
|
|
40578
40785
|
});
|
|
40579
|
-
icon.command("validate [iconClass]").description("Validate a complete runtime icon class against the source catalog").option("--format <format>", "Output format", "json").option("--icon-class <className>", "Complete runtime icon class").action(async (value, options) => {
|
|
40786
|
+
icon.command("validate [iconClass]").description("Validate a complete runtime icon class against the source catalog").option("--format <format>", "Output format", "json").option("--icon-class <className>", "Complete runtime icon class").option("--profile <profile>", "Accepted for workspace consistency; icon catalog is local").action(async (value, options) => {
|
|
40580
40787
|
const iconClass = options.iconClass || value || "";
|
|
40581
40788
|
const all = await loadRiIcons();
|
|
40582
40789
|
const validFormat = /^ri ri_[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/.test(iconClass.trim());
|
|
@@ -43555,7 +43762,7 @@ function registerProjectCommands(program2) {
|
|
|
43555
43762
|
|
|
43556
43763
|
// src/commands/recipe.ts
|
|
43557
43764
|
import { spawn as spawn2 } from "child_process";
|
|
43558
|
-
import { fileURLToPath as
|
|
43765
|
+
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
43559
43766
|
|
|
43560
43767
|
// src/core/recipes.ts
|
|
43561
43768
|
import { access as access2, mkdir as mkdir16, readdir as readdir7, readFile as readFile24, writeFile as writeFile17 } from "fs/promises";
|
|
@@ -43799,7 +44006,7 @@ async function writeRecipeScaffold(options) {
|
|
|
43799
44006
|
|
|
43800
44007
|
// src/commands/recipe.ts
|
|
43801
44008
|
function currentCliInvocation() {
|
|
43802
|
-
const entry = process.argv[1] ||
|
|
44009
|
+
const entry = process.argv[1] || fileURLToPath6(import.meta.url);
|
|
43803
44010
|
return {
|
|
43804
44011
|
command: process.execPath,
|
|
43805
44012
|
argsPrefix: [entry]
|
|
@@ -45546,7 +45753,7 @@ function registerTaskbookCommands(program2) {
|
|
|
45546
45753
|
// src/commands/test-suite.ts
|
|
45547
45754
|
import { readFile as readFile26 } from "fs/promises";
|
|
45548
45755
|
import path26 from "path";
|
|
45549
|
-
import { fileURLToPath as
|
|
45756
|
+
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
45550
45757
|
function collect4(value, previous = []) {
|
|
45551
45758
|
previous.push(value);
|
|
45552
45759
|
return previous;
|
|
@@ -45580,7 +45787,7 @@ async function resolveE2eSkillSource(sourceSkill, agent) {
|
|
|
45580
45787
|
suggestion: "Run bpmax-cli update to install matching skills, or use --source-skill <repo>/skills/bpmax-e2e-flow-test-operator/SKILL.md for explicit source validation."
|
|
45581
45788
|
});
|
|
45582
45789
|
}
|
|
45583
|
-
const packageRoot = await resolvePackageRootFrom(
|
|
45790
|
+
const packageRoot = await resolvePackageRootFrom(fileURLToPath7(import.meta.url));
|
|
45584
45791
|
const packageSkill = path26.join(packageRoot, "skills", "bpmax-e2e-flow-test-operator", "SKILL.md");
|
|
45585
45792
|
const expectedHash = await skillBundleSha256(packageSkill);
|
|
45586
45793
|
const sources = await installedSkillSourcePaths("bpmax-e2e-flow-test-operator", agent);
|