bpmax-cli 0.2.1-beta.8 → 0.2.1-beta.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -7
- package/dist/bin.js +41819 -11180
- package/dist/bin.js.map +1 -1
- package/package.json +12 -5
- package/scripts/install-skills.mjs +27 -60
- package/scripts/run-source-cli.mjs +145 -0
- package/skills/bpmax-ai-taskbook/SKILL.md +13 -1
- package/skills/bpmax-ai-taskbook/references/blueprint-taskbook-gates.md +121 -0
- package/skills/bpmax-ai-taskbook/references/taskbook-template.md +42 -2
- package/skills/bpmax-api-platform-editor/SKILL.md +24 -31
- package/skills/bpmax-api-platform-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-api-platform-editor/references/platform-api-map.md +2 -2
- package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +3 -3
- package/skills/bpmax-approval-matrix/SKILL.md +54 -2
- package/skills/bpmax-blueprint-doc-workflow/SKILL.md +15 -2
- package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +8 -0
- package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +13 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-modeling-review.xml +23 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-paragraph-flow-details.xml +27 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +45 -28
- package/skills/bpmax-blueprint-doc-workflow/references/source-traceability-and-flow-modeling.md +115 -0
- package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +386 -5
- package/skills/bpmax-bug-reporting/SKILL.md +72 -0
- package/skills/bpmax-builder-shared/SKILL.md +1 -0
- package/skills/bpmax-builder-shared/configuration-impact-review.md +76 -0
- package/skills/bpmax-builder-shared/template_script_hard_rules.py +3 -1
- package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +16 -0
- package/skills/bpmax-business-skill/SKILL.md +3 -1
- package/skills/bpmax-cli/SKILL.md +46 -0
- package/skills/bpmax-config-latest/SKILL.md +4 -0
- package/skills/bpmax-console-template-editor/SKILL.md +113 -523
- package/skills/bpmax-console-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-console-template-editor/references/full-detail-guide.md +45 -0
- package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +13 -12
- package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +299 -78
- package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +344 -30
- package/skills/bpmax-dataset-field-template-editor/SKILL.md +131 -594
- package/skills/bpmax-dataset-field-template-editor/references/full-detail-guide.md +570 -0
- package/skills/bpmax-dataset-field-template-editor/references/nested-field-patterns.md +8 -8
- package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +1 -1
- package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +11 -77
- package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +4 -57
- package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +2 -0
- package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +4 -78
- package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +3 -89
- package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +14 -0
- package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +2 -0
- package/skills/bpmax-dataset-template-editor/SKILL.md +123 -778
- package/skills/bpmax-dataset-template-editor/references/dataset-script-runtime-matrix.md +11 -0
- package/skills/bpmax-dataset-template-editor/references/full-detail-guide.md +753 -0
- package/skills/bpmax-dataset-template-editor/references/runtime-gotchas.md +12 -0
- package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +1 -0
- package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +2 -2
- package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +9 -90
- package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +1 -2
- package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +8 -1
- package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +6 -40
- package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +18 -4
- package/skills/bpmax-e2e-flow-config-orchestrator/agents/openai.yaml +2 -2
- package/skills/bpmax-e2e-flow-config-orchestrator/references/orchestration-matrix.md +13 -9
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +174 -546
- package/skills/bpmax-e2e-flow-test-operator/agents/openai.yaml +2 -3
- package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +181 -15
- package/skills/bpmax-e2e-flow-test-operator/references/browser-action-dsl.md +167 -0
- package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +15 -7
- package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +589 -0
- package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +12 -8
- package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +4 -4
- package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +1 -1
- package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +3 -1
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +7 -5
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +2 -2
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +5 -1
- package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +71 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/SKILL.md +64 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/agents/openai.yaml +7 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/automation-generation-pipeline.md +33 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/autonomous-execution.md +40 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/batch-generation-and-execution.md +17 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/browser-action-runner.md +19 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/browser-recording-and-replay.md +95 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/form-script-generation.md +41 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/identity-and-failure-routing.md +90 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/multi-request-mutation.md +9 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/scenario-coverage-generation.md +17 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/scoped-execution.md +13 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/step-restartability-and-state.md +23 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/test-assets-and-evidence.md +9 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/test-data-and-selector-contract.md +51 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/test-preflight-and-confirmation.md +32 -0
- package/skills/bpmax-filter-template-editor/SKILL.md +114 -551
- package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +18 -18
- package/skills/bpmax-filter-template-editor/references/filter-content-schema.md +21 -0
- package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +29 -26
- package/skills/bpmax-filter-template-editor/references/filter-runtime-patterns.md +19 -2
- package/skills/bpmax-filter-template-editor/references/full-detail-guide.md +56 -0
- package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +10 -9
- package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +7 -57
- package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +4 -48
- package/skills/bpmax-flow/SKILL.md +2 -0
- package/skills/bpmax-flow-detail-template-editor/SKILL.md +53 -0
- package/skills/bpmax-flow-template-editor/SKILL.md +129 -1123
- package/skills/bpmax-flow-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-flow-template-editor/references/diff-strategy.md +3 -3
- package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +9 -9
- package/skills/bpmax-flow-template-editor/references/flow-template-api-workflow.md +2 -1
- package/skills/bpmax-flow-template-editor/references/full-detail-guide.md +1158 -0
- package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +1 -1
- package/skills/bpmax-flow-template-editor/references/payload-checklist.md +2 -0
- package/skills/bpmax-flow-template-editor/references/project-create-runtime-gotchas.md +17 -0
- package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +8 -3
- package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +7 -7
- package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +2 -2
- package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +12 -2
- package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +7 -23
- package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +1 -1
- package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +19 -75
- package/skills/bpmax-form-template-editor/SKILL.md +138 -1151
- package/skills/bpmax-form-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-form-template-editor/references/dynamic-field-state.md +167 -0
- package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +51 -51
- package/skills/bpmax-form-template-editor/references/full-detail-guide.md +1115 -0
- package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +4 -4
- package/skills/bpmax-form-template-editor/references/payload-checklist.md +3 -1
- package/skills/bpmax-form-template-editor/references/sub-form-patterns.md +6 -0
- package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +8 -0
- package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +42 -19
- package/skills/bpmax-functional-test-design/LICENSE.upstream +24 -0
- package/skills/bpmax-functional-test-design/SKILL.md +80 -0
- package/skills/bpmax-functional-test-design/agents/openai.yaml +4 -0
- package/skills/bpmax-functional-test-design/references/bpmax-test-suite-output.md +95 -0
- package/skills/bpmax-functional-test-design/references/decision-table-testing.md +50 -0
- package/skills/bpmax-functional-test-design/references/domain-testing.md +43 -0
- package/skills/bpmax-functional-test-design/references/state-transition-testing.md +47 -0
- package/skills/bpmax-functional-test-design/references/technique-selection.md +38 -0
- package/skills/bpmax-functional-test-design/references/use-case-testing.md +55 -0
- package/skills/bpmax-group-model-editor/SKILL.md +24 -0
- package/skills/bpmax-home-portal-editor/SKILL.md +81 -0
- package/skills/bpmax-icon-catalog/SKILL.md +18 -0
- package/skills/bpmax-icon-catalog/agents/openai.yaml +4 -0
- package/skills/bpmax-icon-catalog/assets/ri-icons.json +3140 -0
- package/skills/bpmax-icon-catalog/references/source-contract.md +3 -0
- package/skills/bpmax-list-template-editor/SKILL.md +131 -466
- package/skills/bpmax-list-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-list-template-editor/references/content-config-shape.md +16 -4
- package/skills/bpmax-list-template-editor/references/full-detail-guide.md +461 -0
- package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +6 -9
- package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +1 -1
- package/skills/bpmax-list-template-editor/references/runtime-verified-workflow.md +50 -2
- package/skills/bpmax-list-template-editor/references/special-formats.md +5 -2
- package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +9 -78
- package/skills/bpmax-memory-protocol/SKILL.md +7 -6
- package/skills/bpmax-nav-config-editor/SKILL.md +14 -17
- package/skills/bpmax-nav-config-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-nav-config-editor/references/api-workflow.md +2 -2
- package/skills/bpmax-nav-config-editor/references/runtime-probing.md +11 -12
- package/skills/bpmax-page-composition-template-editor/SKILL.md +315 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/catalog.json +41 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/full-capability-workbench.json +294 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/project-detail-step-panel.json +184 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/project-list-quick-process.json +177 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/project-operations-dashboard.json +400 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/project-operations-visual-light.json +214 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/step-related-projects.json +184 -0
- package/skills/bpmax-page-composition-template-editor/references/resource-api.md +9 -0
- package/skills/bpmax-plugin-config/SKILL.md +55 -5
- package/skills/bpmax-project/SKILL.md +37 -1
- package/skills/bpmax-project-detail-template-editor/SKILL.md +13 -39
- package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-role-editor/SKILL.md +11 -30
- package/skills/bpmax-shared/SKILL.md +19 -9
- package/skills/bpmax-team-editor/SKILL.md +27 -0
- package/skills/bpmax-ui-ux-audit/LICENSE.upstream +23 -0
- package/skills/bpmax-ui-ux-audit/SKILL.md +42 -0
- package/skills/bpmax-ui-ux-audit/agents/openai.yaml +4 -0
- package/skills/bpmax-ui-ux-audit/references/audit-framework.md +39 -0
- package/skills/bpmax-ui-ux-audit/references/bpmax-ux-findings.md +56 -0
- package/skills/bpmax-user/SKILL.md +33 -1
- package/skills/bpmax-user-mock-operator/SKILL.md +58 -56
- package/skills/bpmax-user-mock-operator/agents/openai.yaml +2 -2
- package/skills/bpmax-user-mock-operator/scripts/chrome_identity_bridge.mjs +1766 -0
- package/skills/bpmax-user-model-editor/SKILL.md +24 -0
- package/skills/bpmax-workspace-editor/SKILL.md +1 -0
- package/skills/form-control-library/references/form-template-submit-schema.md +3 -1
- package/skills/bpmax-user-mock-operator/scripts/switch_user_identity.py +0 -37
- package/skills/bpmax-user-mock-operator/scripts/user_mock_operator_common.py +0 -136
- package/skills/bpmax-user-mock-operator/tests/test_user_mock_operator.py +0 -138
|
@@ -4,13 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
import copy
|
|
5
5
|
import hashlib
|
|
6
6
|
import json
|
|
7
|
-
import os
|
|
8
7
|
import sys
|
|
9
|
-
import ssl
|
|
10
|
-
import urllib.error
|
|
11
|
-
import urllib.parse
|
|
12
|
-
import urllib.request
|
|
13
|
-
from dataclasses import dataclass
|
|
14
8
|
from datetime import datetime, timezone
|
|
15
9
|
from difflib import unified_diff
|
|
16
10
|
from pathlib import Path
|
|
@@ -20,7 +14,6 @@ from typing import Any, Dict, Iterable, Optional
|
|
|
20
14
|
SHARED_SKILL_ROOT = Path(__file__).resolve().parents[2] / "bpmax-builder-shared"
|
|
21
15
|
if str(SHARED_SKILL_ROOT) not in sys.path:
|
|
22
16
|
sys.path.insert(0, str(SHARED_SKILL_ROOT))
|
|
23
|
-
from base_url import DEFAULT_BASE_URL, resolve_base_url
|
|
24
17
|
|
|
25
18
|
DEFAULT_LANGUAGE = "zhCN"
|
|
26
19
|
REPO_ROOT = Path(__file__).resolve().parents[4]
|
|
@@ -62,6 +55,11 @@ HIGH_RISK_REASONS = {
|
|
|
62
55
|
"image_preview_column",
|
|
63
56
|
"data_set_switch",
|
|
64
57
|
}
|
|
58
|
+
LEGACY_NETWORK_DISABLED_MESSAGE = (
|
|
59
|
+
"Legacy list-template network scripts are disabled in bpmax-cli. "
|
|
60
|
+
"Use `bpmax-cli config list-template export|lint|build|submit|create|delete|verify` "
|
|
61
|
+
"so profile, capability, dry-run, confirmation, audit, and baseline checks are enforced."
|
|
62
|
+
)
|
|
65
63
|
|
|
66
64
|
from template_script_hard_rules import scan_named_script_surfaces
|
|
67
65
|
|
|
@@ -877,79 +875,12 @@ def extract_template_id(payload: Any) -> int | None:
|
|
|
877
875
|
return None
|
|
878
876
|
|
|
879
877
|
|
|
880
|
-
@dataclass
|
|
881
|
-
class ApiClient:
|
|
882
|
-
base_url: str
|
|
883
|
-
workspace: str
|
|
884
|
-
language: str
|
|
885
|
-
cookie_header: str
|
|
886
|
-
timeout: float
|
|
887
|
-
insecure: bool = False
|
|
888
|
-
|
|
889
|
-
def _build_url(self, path: str) -> str:
|
|
890
|
-
suffix = f"$workspace={urllib.parse.quote(self.workspace)}&$language={urllib.parse.quote(self.language)}"
|
|
891
|
-
joiner = "&" if "?" in path else "?"
|
|
892
|
-
return self.base_url.rstrip("/") + path + joiner + suffix
|
|
893
|
-
|
|
894
|
-
def request(self, method: str, path: str, body: Optional[dict] = None) -> dict:
|
|
895
|
-
headers = {
|
|
896
|
-
"content-type": "application/json",
|
|
897
|
-
"cookie": self.cookie_header,
|
|
898
|
-
"accept": "application/json, text/plain, */*",
|
|
899
|
-
}
|
|
900
|
-
data = None if body is None else json.dumps(body, ensure_ascii=False).encode("utf-8")
|
|
901
|
-
req = urllib.request.Request(self._build_url(path), data=data, headers=headers, method=method)
|
|
902
|
-
context = ssl._create_unverified_context() if self.insecure else None
|
|
903
|
-
try:
|
|
904
|
-
with urllib.request.urlopen(req, timeout=self.timeout, context=context) as resp:
|
|
905
|
-
raw = resp.read().decode("utf-8", "replace")
|
|
906
|
-
except urllib.error.HTTPError as err:
|
|
907
|
-
raw = err.read().decode("utf-8", "replace")
|
|
908
|
-
raise SystemExit(f"HTTP {err.code} {path}: {raw}") from err
|
|
909
|
-
except urllib.error.URLError as err:
|
|
910
|
-
raise SystemExit(f"Request failed {path}: {err}") from err
|
|
911
|
-
payload = json.loads(raw)
|
|
912
|
-
if payload.get("code") != 0:
|
|
913
|
-
raise SystemExit(f"API error {path}: {payload}")
|
|
914
|
-
return payload
|
|
915
|
-
|
|
916
|
-
def get_flow_page_template(self, template_id: Any) -> dict:
|
|
917
|
-
return self.request("GET", f"/api/flow_page_template/{template_id}")
|
|
918
|
-
|
|
919
|
-
def create_flow_page_template(self, body: Dict[str, Any]) -> dict:
|
|
920
|
-
return self.request("POST", "/api/flow_page_template", body)
|
|
921
|
-
|
|
922
|
-
def update_flow_page_template(self, template_id: Any, body: Dict[str, Any]) -> dict:
|
|
923
|
-
return self.request("PUT", f"/api/flow_page_template/{template_id}", body)
|
|
924
|
-
|
|
925
|
-
def get_data_set_list(self, *, flow_type: str, flow_key: str = "") -> list[Dict[str, Any]]:
|
|
926
|
-
payload = self.request("GET", f"/bpmax/data-set?flow_type={urllib.parse.quote(flow_type)}&flow_key={urllib.parse.quote(flow_key)}")
|
|
927
|
-
data = payload.get("data")
|
|
928
|
-
if not isinstance(data, list):
|
|
929
|
-
raise SystemExit("unexpected /bpmax/data-set response: data is not a list")
|
|
930
|
-
return data
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
def resolve_cookie_header(value: Optional[str]) -> str:
|
|
934
|
-
cookie = value or os.environ.get("BPMAX_COOKIE_HEADER", "")
|
|
935
|
-
if not cookie:
|
|
936
|
-
raise SystemExit("missing cookie header: pass --cookie-header or set BPMAX_COOKIE_HEADER")
|
|
937
|
-
return cookie
|
|
938
|
-
|
|
939
|
-
|
|
940
878
|
def resolve_workspace(value: Optional[str]) -> str:
|
|
941
|
-
workspace = value or
|
|
879
|
+
workspace = value or ""
|
|
942
880
|
if not workspace:
|
|
943
|
-
raise SystemExit("missing workspace: pass --workspace
|
|
881
|
+
raise SystemExit("missing workspace: pass --workspace")
|
|
944
882
|
return workspace
|
|
945
883
|
|
|
946
884
|
|
|
947
|
-
def build_client(args: Any) ->
|
|
948
|
-
|
|
949
|
-
base_url=resolve_base_url(getattr(args, "base_url", None)),
|
|
950
|
-
workspace=resolve_workspace(getattr(args, "workspace", None)),
|
|
951
|
-
language=getattr(args, "language", DEFAULT_LANGUAGE),
|
|
952
|
-
cookie_header=resolve_cookie_header(getattr(args, "cookie_header", None)),
|
|
953
|
-
timeout=float(getattr(args, "timeout", 30)),
|
|
954
|
-
insecure=bool(getattr(args, "insecure", False)),
|
|
955
|
-
)
|
|
885
|
+
def build_client(args: Any) -> None:
|
|
886
|
+
raise SystemExit(LEGACY_NETWORK_DISABLED_MESSAGE)
|
|
@@ -13,7 +13,9 @@ Memory is isolated by the API Key's bound agent. The CLI only chooses scope:
|
|
|
13
13
|
|
|
14
14
|
- `user`: current BPMAX user + current agent
|
|
15
15
|
- `organization`: current organization + current agent
|
|
16
|
-
- `all`: search
|
|
16
|
+
- `all`: search both user and organization scopes
|
|
17
|
+
|
|
18
|
+
当前 memory 后端只支持 `status`、`search`、`add`。`list/get/update/delete` 会在 capability 中标记为 `adapter_not_implemented`,不得绕过 capability 直接调用旧 Mem0 路径。当前后端也不支持 metadata filters 或独立 metadata 持久化;需要保留的类型、domain 和对象身份应简洁写入 memory 文本本身。
|
|
17
19
|
|
|
18
20
|
## Start Of Work
|
|
19
21
|
|
|
@@ -30,7 +32,7 @@ Good queries include the business name, workspace, `flow_type`, template/data-se
|
|
|
30
32
|
|
|
31
33
|
## Write Back
|
|
32
34
|
|
|
33
|
-
Only write reusable conclusions.
|
|
35
|
+
Only write reusable conclusions. Prefix the text with one of these stable types:
|
|
34
36
|
|
|
35
37
|
- `decision`: durable design or implementation decision
|
|
36
38
|
- `task_learning`: verified method that should be reused
|
|
@@ -41,8 +43,7 @@ Only write reusable conclusions. Prefer these metadata types:
|
|
|
41
43
|
|
|
42
44
|
```bash
|
|
43
45
|
bpmax-cli memory add --profile <profile> --scope user \
|
|
44
|
-
--text "<short reusable learning>" \
|
|
45
|
-
--metadata '{"type":"task_learning","domain":"flow-template","workspace":"store_mgr","flow_type":"flow_xxx","project_id":"bpmax"}' \
|
|
46
|
+
--text "type=task_learning; domain=flow-template; flow_type=flow_xxx; <short reusable learning>" \
|
|
46
47
|
--format json
|
|
47
48
|
```
|
|
48
49
|
|
|
@@ -54,8 +55,7 @@ When pausing, switching threads, or approaching context limits, write a short `s
|
|
|
54
55
|
|
|
55
56
|
```bash
|
|
56
57
|
bpmax-cli memory add --profile <profile> --scope user \
|
|
57
|
-
--text "goal=<goal>; done=<done>; files=<key files>; next=<next step>" \
|
|
58
|
-
--metadata '{"type":"session_state","project_id":"bpmax","tags":["handoff"]}' \
|
|
58
|
+
--text "type=session_state; goal=<goal>; done=<done>; files=<key files>; next=<next step>" \
|
|
59
59
|
--format json
|
|
60
60
|
```
|
|
61
61
|
|
|
@@ -66,6 +66,7 @@ bpmax-cli memory add --profile <profile> --scope user \
|
|
|
66
66
|
- If memory is unavailable, continue the task and note that memory lookup/writeback failed.
|
|
67
67
|
- Do not use raw Mem0 URLs, curl, Python helper scripts, or environment variables from old per-environment skills.
|
|
68
68
|
- Do not pass `--agent`; `bpmax-cli memory` intentionally has no agent option.
|
|
69
|
+
- Do not pass `--filters` or rely on `--metadata` for retrieval until the platform capability explicitly reports metadata support.
|
|
69
70
|
|
|
70
71
|
## Output
|
|
71
72
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "bpmax-nav-config-editor"
|
|
3
|
-
description: "
|
|
3
|
+
description: "用于通过 bpmax-cli typed config 创建或编辑 BPMAX PC导航、PC快捷入口、H5导航、H5快捷入口。只要用户提到“工作区导航配置”“导航管理”“PC导航”“H5导航”“快捷入口”“按需求改导航”“提交导航配置”“让 Codex 根据需求构造 navmenu / shortcut / navmenu_mobile / shortcut_mobile 配置”或等价表达,就应使用这个 skill。它要求 Codex 通过 typed CLI 读取四类导航配置、权限点与回读 hash,构造并提交配置,最后用接口回读确认最新结果。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# BPMAX Nav Config Editor
|
|
@@ -20,13 +20,13 @@ description: "用于在 BPMAX 的工作区导航配置页面中创建或编辑 P
|
|
|
20
20
|
- 不得以历史脏配置、顺手修复、统一风格、编辑器自动补字段、方便调试为理由修改需求外配置。
|
|
21
21
|
|
|
22
22
|
## 何时使用
|
|
23
|
-
-
|
|
23
|
+
- 用户需要通过 bpmax-cli typed config 管理 BPMAX 导航配置。
|
|
24
24
|
- 用户要新增、删除、改名、改路径、改权限、改可见范围、调整顺序。
|
|
25
25
|
- 用户要一次性生成一套 PC / H5 导航与快捷入口配置。
|
|
26
|
-
-
|
|
26
|
+
- 用户需要使用当前 CLI profile、capability 和线上回读结果完成配置闭环。
|
|
27
27
|
|
|
28
28
|
## 前置条件
|
|
29
|
-
-
|
|
29
|
+
- 先通过 CLI profile/capability 和目标参数确认类似对象:
|
|
30
30
|
- `.../w:<workspace>/workspaceConfiguration/<workspace>?nav=navs&id=<id>`
|
|
31
31
|
- 用户需要明确说明:
|
|
32
32
|
- 是改现有导航,还是生成一整套导航建议
|
|
@@ -55,14 +55,13 @@ description: "用于在 BPMAX 的工作区导航配置页面中创建或编辑 P
|
|
|
55
55
|
- 如果停在“只改完一个 tab 但四类尚未全量回读”“权限范围待人工确认”等状态,结束前写 `session_state`。
|
|
56
56
|
|
|
57
57
|
## 核心原则
|
|
58
|
-
-
|
|
58
|
+
- 优先使用 bpmax-cli typed config 的当前 profile/auth/capability,不得把页面会话凭据作为配置读取或写入凭据。
|
|
59
59
|
- 当前默认闭环:
|
|
60
60
|
- `bpmax-cli config nav-config export -> 修改 work -> lint -> build -> submit dry-run -> 用户确认 -> submit --confirm -> 回读 hash -> 浏览器验收`
|
|
61
61
|
- 本地工件固定落在 `.codex/tmp/nav-config-editor/{raw,work,meta,submit,diffs,result}`
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
- `
|
|
65
|
-
- 非 `zhCN` 语言时的 `POST /api/i18n/config/apply`
|
|
62
|
+
- 页面只保留这几类只读验收职责,不作为配置凭据或写入路径:
|
|
63
|
+
- 真实可选 icon 展示核对
|
|
64
|
+
- 非 `zhCN` 语言下的文案展示核对
|
|
66
65
|
- 最终导航管理页、PC 工作区首页、H5 首页验收
|
|
67
66
|
- 四类配置是一个整体:
|
|
68
67
|
- `navmenu`
|
|
@@ -110,14 +109,11 @@ description: "用于在 BPMAX 的工作区导航配置页面中创建或编辑 P
|
|
|
110
109
|
- 配置 id
|
|
111
110
|
- 进入统一入口模型前,先按工作区、入口名和权限模型检索一次 Mem0。
|
|
112
111
|
|
|
113
|
-
### 2.
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
- 同域网络请求
|
|
119
|
-
- `NavManagement` 组件实例和 `submitData()` 现在主要用于:
|
|
120
|
-
- 读取线上真实结构
|
|
112
|
+
### 2. 获取 CLI 上下文
|
|
113
|
+
- 使用当前 `bpmax-cli` profile、capability 和线上 readback 作为授权与事实来源。
|
|
114
|
+
- 浏览器页面只用于只读验收导航可见性和入口跳转;真实远端写入必须回到 `bpmax-cli config nav-config submit`。
|
|
115
|
+
- 不读取或复用浏览器 Cookie、浏览器存储、手工请求头或旧脚本环境变量。
|
|
116
|
+
- `NavManagement` 组件实例和 `submitData()` 只作为历史结构参考,不作为配置写入路径。
|
|
121
117
|
- 辅助定位 icon / 权限 / 页面行为
|
|
122
118
|
- 最终刷新回页验收
|
|
123
119
|
- 不得把 `submitData()` 或脚本直提 `/api/configuration` 当作提交路径;它们只用于理解页面结构和验收行为,真实写入必须走 typed CLI。
|
|
@@ -188,6 +184,7 @@ description: "用于在 BPMAX 的工作区导航配置页面中创建或编辑 P
|
|
|
188
184
|
- 如果用户提供的是跨工作区路径,默认不擅自改写 workspace 前缀。
|
|
189
185
|
|
|
190
186
|
### 7. Icon 规则
|
|
187
|
+
- 开始选 icon 前必须读取 `../bpmax-icon-catalog/SKILL.md`,先用 `bpmax-cli icon search` 获取候选并用 `icon validate` 校验;只提交 catalog 返回的完整 class。
|
|
191
188
|
- 不要凭源码文件名或历史配置猜 icon 格式。
|
|
192
189
|
- 必须优先以当前页面弹窗里的图标选择器为准,直接读取界面上实际可选的 icon。
|
|
193
190
|
- 当前页面实际可选图标来自 `IconPicker` 弹窗,而不是旧版 `iconList` 下拉。
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "BPMAX Nav Config Editor"
|
|
3
|
-
short_description: "
|
|
4
|
-
default_prompt: "使用 $bpmax-nav-config-editor
|
|
3
|
+
short_description: "通过 bpmax-cli typed config 创建或编辑 BPMAX 工作区导航配置"
|
|
4
|
+
default_prompt: "使用 $bpmax-nav-config-editor 通过 bpmax-cli typed config 创建或编辑 BPMAX 工作区导航配置,并用回读验证确认结果。"
|
|
@@ -62,9 +62,9 @@ GET /api/group/sub_groups?group_ids=<id1,id2>&with_full_info=0
|
|
|
62
62
|
其他三类仅替换 `type` 和 `content` 字段名。
|
|
63
63
|
|
|
64
64
|
## 推荐调用顺序
|
|
65
|
-
1.
|
|
65
|
+
1. 从 typed CLI export/readback 读取四类配置和 baseline hash。
|
|
66
66
|
2. 在本地 work 文件中同时更新四类数据。
|
|
67
67
|
3. 执行 `bpmax-cli config nav-config lint/build/submit`,先 dry-run,再用精确 `--confirm` 正式提交。
|
|
68
68
|
4. 提交后回读四类配置,并在浏览器首页点击入口验证。
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
页面提交函数、页面请求或直接 `POST/PUT /api/configuration` 只可用于理解历史页面行为,不得作为真实写入路径。
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
- `formatNavigationData`
|
|
18
18
|
- `validateData`
|
|
19
19
|
|
|
20
|
-
##
|
|
21
|
-
|
|
20
|
+
## 页面结构观察方式
|
|
21
|
+
页面组件结构只用于理解历史运行态和做只读验收,不作为配置读取或写入路径。配置事实必须来自 `bpmax-cli config nav-config export/verify/readback`。
|
|
22
|
+
1. 如需排查页面展示差异,可从 `window.$nuxt` 向下找组件树。
|
|
22
23
|
2. 识别 `NavManagement` 组件。
|
|
23
|
-
3.
|
|
24
|
+
3. 仅作为只读观察线索读取:
|
|
24
25
|
- `vm._setupState.list`
|
|
25
26
|
- `vm._setupState.tabList`
|
|
26
27
|
- `vm._setupState.submitData`
|
|
@@ -34,14 +35,12 @@
|
|
|
34
35
|
- 不要只读页面上展示出来的文本再反推 JSON。
|
|
35
36
|
|
|
36
37
|
## 推荐执行方式
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
- 一次性替换对应数组
|
|
43
|
-
- 再调用 `submitData()`
|
|
38
|
+
- 小改动和大改动都必须走 typed CLI:
|
|
39
|
+
- `bpmax-cli config nav-config export`
|
|
40
|
+
- 修改 work 文件
|
|
41
|
+
- `lint -> build -> submit dry-run -> submit --confirm -> verify/readback`
|
|
42
|
+
- 页面组件里的 `list.value`、数组替换和 `submitData()` 只作为历史反例和结构观察线索,不得作为配置写入路径。
|
|
44
43
|
|
|
45
44
|
## 回读
|
|
46
|
-
-
|
|
47
|
-
-
|
|
45
|
+
- 提交成功后使用 typed CLI verify/readback 回读四类配置。
|
|
46
|
+
- 页面只用于只读确认导航管理页、PC 工作区首页和 H5 首页展示。
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bpmax-page-composition-template-editor
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: "Use typed bpmax-cli when creating, editing, previewing, exporting, submitting, verifying, or managing static resources for the independent BPMAX composition-template type."
|
|
5
|
+
metadata:
|
|
6
|
+
requires:
|
|
7
|
+
bins: ["bpmax-cli"]
|
|
8
|
+
cliHelp: "bpmax-cli config page-template --help"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# BPMAX Page Composition Template Editor
|
|
12
|
+
|
|
13
|
+
用于新的独立 `page-composition-template` 类型。它使用 `think_page_composition_template` 和 `/api/page_composition_template`,不得改写旧的 `flow_page_template`、列表、详情或控制台模板。
|
|
14
|
+
|
|
15
|
+
## 适用范围
|
|
16
|
+
|
|
17
|
+
- 页面模板的 export、lint、impact、preview、build、submit、verify 和 readback。
|
|
18
|
+
- 页面模板专属静态资源(图片、字体、Less/CSS、JSON、JavaScript)的上传、登记、列表、引用和删除保护。
|
|
19
|
+
- 页面模板方法注入:模板可直接调用 `data.methods` 中的白名单方法,context/query/action 可通过 `transform`/`prepare` 引用方法。
|
|
20
|
+
- 跨 `project-list`、`project-detail`、`step-process`、`custom` 入口的运行验证。
|
|
21
|
+
|
|
22
|
+
旧 `flow_page_template type=4` 看板必须使用 `bpmax-console-template-editor`,不要用本 skill 代替它。
|
|
23
|
+
|
|
24
|
+
## 页面模板预设
|
|
25
|
+
|
|
26
|
+
业务样例预设由本 skill 维护,平台前端只提供通用编辑器和运行时,不内置业务样例。预设位于 `examples/presets/`,包括项目运营看板、项目列表、项目详情和环节处理等可复用起点。
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
bpmax-cli config page-template preset list --format json
|
|
30
|
+
bpmax-cli config page-template preset export \
|
|
31
|
+
--id project-operations-visual-light \
|
|
32
|
+
--out page-template.work.json \
|
|
33
|
+
--format json
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`preset export` 只写出本地 page-template work JSON,不访问服务端,也不会提交配置。导出后必须按标准闭环执行:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
lint → preview → build → submit dry-run → verify
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
预设可以复制后修改名称、Key、查询、方法、资源和渲染内容;不要直接修改已提交模板来代替新的预设文件。新增业务样例时,在 `examples/presets/` 增加 JSON 并同步 `catalog.json`,不要把业务 HTML、Less 或查询重新写回平台前端。
|
|
43
|
+
|
|
44
|
+
## 资源工作流
|
|
45
|
+
|
|
46
|
+
1. 先确认当前 profile、配置工作区和 `config.page_template.asset.*` capability;不要把 API key、cookie 或本地敏感路径写进 work、报告或 skill。
|
|
47
|
+
2. 对已有模板执行:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
bpmax-cli config page-template asset-upload \
|
|
51
|
+
--template-id <id> --file <path> --kind asset|script \
|
|
52
|
+
--work <page-template-work.json> --out-work <page-template-work-with-asset.json> \
|
|
53
|
+
--profile <profile> --format json
|
|
54
|
+
bpmax-cli config page-template asset-list --template-id <id> --profile <profile> --format json
|
|
55
|
+
bpmax-cli config page-template asset-delete --asset-id <asset-id> --profile <profile> --format json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
3. 上传成功必须同时核对返回的 URL、名称、MIME、大小、SHA-256 和模板归属;`--work` 只在取得服务端 URL 后追加 `template.resources`,不能猜 URL。
|
|
59
|
+
4. 在 `render.template`、`render.style` 或数据声明中引用资源 URL 后,先 lint/preview,再 build/submit;Less 的 `url(...)` 只能引用已登记资源,禁止外部未登记地址、`@import`、脚本标签和危险表达式。
|
|
60
|
+
5. 方法资源必须是已登记、带 SHA-256 的 ESM `.mjs`;方法签名为 `export function name(ctx, ...args)`,模板调用时只写 `name(args)`,不能访问 Vue `this` 或浏览器全局对象。
|
|
61
|
+
6. Inline 方法只能使用受控纯函数体;禁止 DOM、网络、动态代码、Vue 实例和全局对象。context transform 必须同步,query transform/action prepare 可按声明使用异步方法。
|
|
62
|
+
7. 删除前先从最新模板 readback 检查引用。服务端返回引用冲突时保持资源和模板不变,记录可恢复动作:先移除模板引用并重新提交,再删除资源。
|
|
63
|
+
8. 二进制浏览器上传需要真实 `FileUpload`/chooser 证据;CLI multipart 上传成功不能替代浏览器 E2E 或业务验收。
|
|
64
|
+
|
|
65
|
+
## 标准配置闭环
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
bpmax-cli config page-template export --id <id> --out <dir> --profile <profile> --format json
|
|
69
|
+
bpmax-cli config page-template lint --work <dir>/work/<file>.json --profile <profile> --format json
|
|
70
|
+
bpmax-cli config page-template impact --raw <dir>/raw/<file>.json --work <dir>/work/<file>.json --out <dir>/result/impact.json --profile <profile> --format json
|
|
71
|
+
bpmax-cli config page-template preview --work <dir>/work/<file>.json --out <dir>/preview --mode mock --format json
|
|
72
|
+
bpmax-cli config page-template build --work <dir>/work/<file>.json --meta <dir>/meta/<file>.meta.json --preview-manifest <dir>/preview/preview.manifest.json --boundary-manifest <dir>/result/scope.json --out <dir>/submit/<file>.json --profile <profile> --format json
|
|
73
|
+
bpmax-cli config page-template submit --id <id> --payload <dir>/submit/<file>.json --profile <profile> --format json
|
|
74
|
+
bpmax-cli config page-template verify --id <id> --expect <dir>/work/<file>.json --profile <profile> --format json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 编辑范围门禁(edit 必需)
|
|
78
|
+
|
|
79
|
+
编辑已有模板时,`build` 必须传 `--boundary-manifest`,声明本次只允许修改的 JSON 路径;新建(`mode: "create"`)不需要。
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"schema_version": 1,
|
|
84
|
+
"change_type": "page-template-scope",
|
|
85
|
+
"allowed_paths": ["/template/render/template"],
|
|
86
|
+
"forbidden_paths": ["/key", "/template/data/queries"],
|
|
87
|
+
"rationale": "只修改页面标题文案"
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- 路径为 JSON Pointer;`/a/b` 与 `/a/b/**` 都覆盖其子路径。`/` 和 `/template` 被视为过宽而拒绝;`/id`、`/uuid` 默认禁止修改。
|
|
92
|
+
- build 用导出的 raw 基线(hash 必须等于 `meta.base_hash`)做两层比对:raw→work 的字面修改,和 canonical(raw)→payload 的提交变化。每个变化被分为 `requested`(在 allowed 内)、`required_collateral`(由已请求修改推导出的字段,例如 `render.style` 变化导致的 `render.css`)或 `out_of_scope`。只要存在 `out_of_scope` 或命中 `forbidden_paths`,build 以 `[page_template_scope_exceeded]` 阻断并列出路径。
|
|
93
|
+
- 结果写入 submit 文件的 `page_template_scope`,绑定 `raw_hash` 和 `payload_hash`。非 dry-run 的 edit submit 缺少该产物、产物与 payload 不一致或含越界路径时,以 `[page_template_scope_artifact_required]` 在远端请求前阻断。
|
|
94
|
+
- 越界时先撤回无关修改;确实需要改的字段才加入 `allowed_paths`,不要用放宽路径绕过门禁。
|
|
95
|
+
|
|
96
|
+
带有 `build --preview-manifest` 生成且仍与 canonical payload hash 匹配的 page-template submit payload,会复用该 manifest 作为确认凭据,因此不再要求重复传入 `--confirm`。显式传入 `--dry-run` 始终只输出计划、不写远端;缺少或过期 manifest 的真实写入会在远端请求前阻断。若额外传入 `--confirm`,其值必须与目标对象匹配,否则在远端请求前拒绝。
|
|
97
|
+
|
|
98
|
+
## 数据层查询引擎(默认 ES)
|
|
99
|
+
|
|
100
|
+
`template.data.queries.<name>.engine` 只允许 `es`、`sql`、`api`,CLI 在 lint/build/preview 时规范化并写入 canonical payload、lint 结果 `page_template_queries` 和 `data-trace.json` 的 `query_engines`。
|
|
101
|
+
|
|
102
|
+
- `/project/list` 默认走 ES:必须声明 `params.data_set_key`(优先)或 `params.data_set_id`;只写 `engine: "es"` 时 CLI 补全 `resource: "/project/list"`。
|
|
103
|
+
- ES `/project/list` 只能使用 `POST`,省略 `method` 时 CLI 在 canonical payload 中补为 `POST`,显式 `GET` 会被拒绝。运行时也会拒绝 ES `GET`,避免请求体丢失;明确声明 SQL 的兼容查询不受此 ES 约束。
|
|
104
|
+
- ES 项目列表必须带分页参数;CLI canonical payload 会补全 `params.page: 1` 和 `params.page_size: 20`,显式提供时保留调用方值。运行时把这两个字段放到请求 query string(服务端 `Pagination` 从 query 校验),其余 ES DTO 放在 POST body;旧模板也会使用同样的只读默认值,避免服务端返回“无效的页码”。
|
|
105
|
+
- ES 行字段可能使用 `__id`、`__owner_id`、`__create_time` 或业务字段 JSON 字符串,而页面能力读取通用字段。可在查询上声明安全的 `row_mapping` 点路径,运行时会保留原始 ES 行并补出页面字段;例如:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"row_mapping": {
|
|
110
|
+
"id": "__id",
|
|
111
|
+
"name": "lcbh.value",
|
|
112
|
+
"owner_id": "__owner_id",
|
|
113
|
+
"owner_name": "__project_owner.name",
|
|
114
|
+
"create_time": "__create_time",
|
|
115
|
+
"current_step_name": "current_step_name"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
`row_mapping` 只允许安全的字段点路径,不能执行表达式;CLI lint/build 会规范为 snake_case 的 `row_mapping` 并拒绝非法路径。模板应优先使用这些通用字段,业务字段仍可从原始 ES 行读取。
|
|
121
|
+
|
|
122
|
+
服务端筛选字段也必须在列表查询上显式声明,并保持逻辑控件名与 ES 字段的映射稳定。只允许 `status`、`keyword`、`owner` 和 `created_date` 四个逻辑键;`createdDate` 仅作为输入兼容别名,lint/build 会规范为 `created_date`。字段值只能是安全的 ES 点路径,不能写表达式或从当前结果行推导:
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"filterMode": "server",
|
|
127
|
+
"filterGroup": "dashboard",
|
|
128
|
+
"filter_fields": {
|
|
129
|
+
"status": "status",
|
|
130
|
+
"keyword": "xmmc1",
|
|
131
|
+
"owner": "__owner_id",
|
|
132
|
+
"created_date": "__create_time"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
`filter_fields` 只能用于 `engine: "es"` 的 `/project/list` 查询,并应与对应聚合查询使用同一个 `filterGroup`。筛选按钮提交后,运行时会把逻辑控件转换为受控的 term/wildcard/range ES 查询并刷新整组查询;不要把 `filter_fields` 放在聚合查询、SQL 查询或客户端查询体中。CLI lint 会拒绝未知逻辑键、危险字段路径、重复的 `created_date`/`createdDate` 声明和未声明 `filterMode: "server"` 的映射。
|
|
138
|
+
|
|
139
|
+
交互筛选的 `filterGroup` 必须是稳定的字母开头名称(例如 `dashboard`)。为避免刷新时列表和聚合失去同步,带 `filterGroup` 的 `/project/list` 查询必须同时声明 `filterMode: "server"` 和完整的 `filter_fields`;聚合查询使用相同的 `filterGroup`。固定的 `params.query` 在受控字段上只能使用 `term` 或 `terms`,不能使用 `raw`、`range`、`wildcard` 等无法与用户输入安全求交的条件;这类配置会在 lint 阶段失败,而不是等到点击筛选后才报错。只有没有列表成员的聚合组会给出 `page_template.filter.group_list_missing` warning,因为它没有可供交互刷新挂载的列表查询。
|
|
140
|
+
- 服务端只在请求体含 `data_set_id|data_set_key|query|is_select_all|_source|aggs` 时走 ES。未声明 engine 且不含这些字段的 `/project/list` 查询会被 lint 拒绝(`page_template.query.implicit_sql`),不能静默走 SQL。
|
|
141
|
+
- ES 查询没有 fixture 回退;空结果或请求失败要按实际数据展示空态或错误,不能用样例行冒充 ES 结果。
|
|
142
|
+
- 确需 SQL(例如跨多个业务流程、没有统一数据集)时显式写 `engine: "sql"` 并填写 `reason`;`sql` 查询不得携带 ES 字段。不要为跨流程看板凭空指定某个数据集。
|
|
143
|
+
- 自定义接口使用 `engine: "api"`,不得指向 `/project/list`。
|
|
144
|
+
- 数据集 key/id 必须来自真实配置 readback(如 `bpmax-cli config dataset export` 或 `project search` 验证有数据),不能猜测。
|
|
145
|
+
|
|
146
|
+
### ES 聚合查询
|
|
147
|
+
|
|
148
|
+
看板的全量 KPI、状态分布、负责人分布和时间趋势必须由服务端 ES 聚合生成,不能从 `page_size=20` 的 `projectRows` 在浏览器逐行统计。使用受控的 `/project/aggregate` 查询,并与列表查询通过相同的 `filterGroup` 绑定:
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"projects": {
|
|
153
|
+
"engine": "es",
|
|
154
|
+
"resource": "/project/list",
|
|
155
|
+
"method": "POST",
|
|
156
|
+
"filterMode": "server",
|
|
157
|
+
"filterGroup": "dashboard",
|
|
158
|
+
"filter_fields": {
|
|
159
|
+
"status": "status",
|
|
160
|
+
"keyword": "xmmc1",
|
|
161
|
+
"owner": "__owner_id",
|
|
162
|
+
"created_date": "__create_time"
|
|
163
|
+
},
|
|
164
|
+
"params": {
|
|
165
|
+
"data_set_key": "main",
|
|
166
|
+
"flow_type": "flow636354625",
|
|
167
|
+
"flow_key": ""
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"dashboardStats": {
|
|
171
|
+
"engine": "es",
|
|
172
|
+
"mode": "aggregate",
|
|
173
|
+
"resource": "/project/aggregate",
|
|
174
|
+
"method": "POST",
|
|
175
|
+
"params": {
|
|
176
|
+
"data_set_key": "main",
|
|
177
|
+
"flow_type": "flow636354625",
|
|
178
|
+
"flow_key": ""
|
|
179
|
+
},
|
|
180
|
+
"aggs": {
|
|
181
|
+
"by_status": { "type": "terms", "field": "status", "size": 8 },
|
|
182
|
+
"by_owner": { "type": "terms", "field": "__owner_id", "size": 20 },
|
|
183
|
+
"by_month": {
|
|
184
|
+
"type": "date_histogram",
|
|
185
|
+
"field": "__create_time",
|
|
186
|
+
"calendar_interval": "month"
|
|
187
|
+
},
|
|
188
|
+
"total_projects": { "type": "value_count", "field": "__id" }
|
|
189
|
+
},
|
|
190
|
+
"filterGroup": "dashboard"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
约定和限制:
|
|
196
|
+
|
|
197
|
+
- 聚合查询必须显式使用 `engine: "es"`、`mode: "aggregate"`、`resource: "/project/aggregate"` 和 `POST`,并提供真实数据集 `data_set_key` 或 `data_set_id`。使用 `data_set_key` 时必须能从配置或当前路由得到字符串 `flow_type` 和 `flow_key`(主流程的 `flow_key` 可以是空字符串);CLI lint 会在配置未写死流程范围时发出 `page_template.query.dataset_scope` warning,服务端仍会拒绝缺少流程范围的请求。
|
|
198
|
+
- 聚合查询参数只能包含数据集选择器(`data_set_key` 或 `data_set_id` 二选一)、流程范围(`flow_type`、`flow_key`)和受控的 `query`;不能传 `is_select_all`、分页、排序、hook、`_source` 或任意 ES DSL。
|
|
199
|
+
- 支持 `terms`、`date_histogram`、`sum`、`avg`、`min`、`max`、`stats`、`cardinality`、`value_count`。字段必须是安全的点路径;`terms.size` 不得超过 100,`terms.min_doc_count` 只接受 0–1000000 的整数,聚合总节点数和嵌套深度由 CLI 限制。
|
|
200
|
+
- 指标聚合(`sum`、`avg`、`min`、`max`、`stats`、`cardinality`、`value_count`)不能再包含子聚合;同一节点不能同时使用 `aggs` 和 `aggregations`。列表查询中的 `params.aggs`/`params.aggregations` 会被拒绝,因为列表接口不会执行这些统计,必须使用独立的 `mode: "aggregate"` 查询。
|
|
201
|
+
- 不得配置 `script`、`runtime_mappings`、任意 `query/body/dsl`、原始 `aggregations` 或客户端指定的 ES index。数据集、工作区、项目可见性、负责人和权限过滤由服务端解析并执行。
|
|
202
|
+
- 列表查询和聚合查询使用相同的 `filterGroup`。筛选按钮触发该组的服务端刷新,聚合请求不携带分页参数;刷新后图表和 KPI 必须继续读取聚合响应。
|
|
203
|
+
- `/project/aggregate` 返回标准化 `aggregations`。模板方法可以读取 `queryAggregations('dashboardStats')`,但不应以当前分页行数推导全量指标;空聚合和 ES 错误必须显示可恢复空态/错误态。
|
|
204
|
+
- `page-chart` 绑定聚合时应显式传入 `:aggregation="dashboardAggregations.by_status"` 等值;聚合为空表示真实的空态,组件不会回退到当前页 rows。状态桶可传 `:aggregation-labels="statusLabels"`,负责人 ID 桶可用 `aggregation-label-prefix="负责人 "` 或由模板提供独立、完整的负责人字典。`__project_owner` 是 nested 字段,不能直接作为这九种公开聚合的 terms field;若必须展示全量负责人名称,应先提供受控字典查询或由服务端返回 `key_as_string`,不能把当前 20 行当作全量字典。
|
|
205
|
+
- 运行时刷新失败会保留上次成功的列表、KPI 和聚合结果,并暴露错误与重试入口;模板仍应提供明确的刷新/重试操作,不得把错误伪装成空数据。
|
|
206
|
+
- CLI lint 会输出 `page_template_queries` 的 `mode` 和聚合摘要;preview 的 `data-trace.json` 只记录聚合名称、类型、字段和深度,不记录完整结果或源码。修改聚合定义后必须重新 lint、preview、build,旧 manifest 会因 canonical hash 失效。
|
|
207
|
+
|
|
208
|
+
聚合配置完成后按以下顺序验证,并使用真实数据集 readback 确认字段 mapping:
|
|
209
|
+
|
|
210
|
+
```text
|
|
211
|
+
lint → preview --mode mock → build → submit --dry-run → verify → 运行页只读检查
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### 筛选器选项必须独立于查询结果
|
|
215
|
+
|
|
216
|
+
状态、类型、负责人等筛选器的可选项是业务枚举或独立字典,不能从当前查询结果、分页结果或已筛选结果动态生成。否则服务端筛选返回 0 行或少量行时,下拉选项会错误地消失。
|
|
217
|
+
|
|
218
|
+
对于项目状态筛选,使用运行时提供的稳定 `statusOptions`,或在模板中写入完整的静态选项列表:
|
|
219
|
+
|
|
220
|
+
```vue
|
|
221
|
+
<el-select v-model="filterStatus">
|
|
222
|
+
<el-option
|
|
223
|
+
v-for="status in statusOptions"
|
|
224
|
+
:key="status.key"
|
|
225
|
+
:label="status.label"
|
|
226
|
+
:value="status.key"
|
|
227
|
+
/>
|
|
228
|
+
</el-select>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
禁止使用 `projectRows`、`filteredProjectRows`、`paginatedProjectRows`、`statusRows` 或 `queryRows(...)` 作为状态选项的 `v-for` 来源,也不要在 `data.methods` 中覆盖保留的 `statusOptions` 方法。CLI lint 会以 `page_template.filter.options_dynamic` 拒绝这类配置;lint 输出的 `page_template_filters.status.options_must_be_static=true` 是该约定的可审计证据。修改模板后必须重新执行 lint/preview/build,不能只修改运行时数据来掩盖选项缺失。
|
|
232
|
+
|
|
233
|
+
预览只能生成 mock 或 live-readonly 证据;真实写入只能走 typed CLI,并必须使用锁定的 canonical payload。HTTP 200、preview 或 build 不能单独证明运行态或业务验收。
|
|
234
|
+
|
|
235
|
+
方法示例:
|
|
236
|
+
|
|
237
|
+
```json
|
|
238
|
+
{
|
|
239
|
+
"data": {
|
|
240
|
+
"methods": {
|
|
241
|
+
"formatOwner": {
|
|
242
|
+
"source": "inline",
|
|
243
|
+
"mode": "sync",
|
|
244
|
+
"permissions": [],
|
|
245
|
+
"code": "return value && value.owner_name ? value.owner_name : '未分配';"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## 页面模板查询的数据源约定
|
|
253
|
+
|
|
254
|
+
页面模板中的项目列表查询默认使用 Elasticsearch。配置时建议显式声明 `engine: "es"`;带 ES 字段的 `/project/list` 即使省略 engine,CLI 也会规范为 ES。通过 `params.data_set_key`(优先)或经 readback 验证的 `params.data_set_id` 指定数据集:
|
|
255
|
+
|
|
256
|
+
```json
|
|
257
|
+
{
|
|
258
|
+
"projects": {
|
|
259
|
+
"engine": "es",
|
|
260
|
+
"resource": "/project/list",
|
|
261
|
+
"method": "POST",
|
|
262
|
+
"params": {
|
|
263
|
+
"data_set_key": "main",
|
|
264
|
+
"flow_type": "flow636354625",
|
|
265
|
+
"flow_key": "",
|
|
266
|
+
"with_step": 1
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
`data_set_key` 与流程身份共同确定 ES index;跨流程页面可以省略流程身份,由运行时从当前页面路由补齐,但 lint 会提示必须验证该绑定。裸 `/project/list` 会落到 SQL,页面模板 lint 将其拒绝。只有有明确理由的跨流程查询才允许 `engine: "sql"`,并应填写 `reason`。
|
|
273
|
+
|
|
274
|
+
## 测试与审查
|
|
275
|
+
|
|
276
|
+
资源至少覆盖:可支持扩展名、空文件、超过 10MB、未知 MIME、模板归属隔离、列表回读、URL 在模板/Less/数据中的引用、引用资源删除保护、未引用资源删除、重复刷新和失败恢复。UX 审查先使用 `bpmax-functional-test-design`,再使用 `bpmax-ui-ux-audit`;每个当前运行确认的问题登记为 P0–P3 BUG,并执行:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
bpmax-cli test-suite lint-report --root .ai_test/report/<run> --format json
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
未完成 FileUpload chooser、权限矩阵、正式 submit/readback 或 business acceptance 时,只报告 `partial`,不得升级为 `pass`。
|
|
283
|
+
|
|
284
|
+
## 页面模板图标约定
|
|
285
|
+
|
|
286
|
+
页面模板中的按钮、输入框和状态操作应优先使用平台已有的 Element UI 组件,并使用平台图标目录中的完整 Remix Icon class。图标选择必须先查询和校验,不能凭名称猜测:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
bpmax-cli icon search --query refresh --format json
|
|
290
|
+
bpmax-cli icon get ri_refresh-line --format json
|
|
291
|
+
bpmax-cli icon validate "ri ri_refresh-line" --format json
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
运行时 class 必须包含 `ri` 前缀和下划线名称,例如 `ri ri_refresh-line`、`ri ri_search-line`;不能使用缺少前缀的 `ri_refresh-line`,不得将 Remix 名称直接改成 `el-icon-*`;同一业务操作组优先统一为 Remix line 风格。可用图标来自随 CLI 发布的 `skills/bpmax-icon-catalog/assets/ri-icons.json`(Remix Icon line/fill 图标集合),`bpmax-cli icon search/get/validate` 是配置时的唯一查询和校验入口。
|
|
295
|
+
|
|
296
|
+
当前前端图标库与边界:
|
|
297
|
+
|
|
298
|
+
| 图标库 | class / 用法 | 校验与选型 |
|
|
299
|
+
| --- | --- | --- |
|
|
300
|
+
| Remix Icon(首选) | 完整 `ri ri_<name>`,优先 `line` | `bpmax-cli icon search/get/validate` 使用分发 catalog;真实页面仍须检查 CSS/字体加载和字形 |
|
|
301
|
+
| Element UI 2 内置图标 | `el-icon-*`,可使用 `el-button icon`、`el-input prefix-icon`;loading 由组件自动处理 | 不属于 Remix catalog;使用当前 Element UI 提供的类名并核对实际渲染,不用 `icon validate` 声称已校验 |
|
|
302
|
+
| BPMAX / Untitled UI 字体图标 | `bp-i-*`(前端已有 `bp-iconfont/style.css`) | 不属于 Remix catalog;仅沿用当前样式表中可验证的类名,不猜新名称 |
|
|
303
|
+
|
|
304
|
+
无需为平台已有图标另外上传 JS 或字体,也不要默认引入外部 CDN 图标库。若命令从配置 workspace 执行提示 catalog 路径不存在,可使用 `BPMAX_ICON_CATALOG` 指向当前 CLI 分发的 `skills/bpmax-icon-catalog/assets/ri-icons.json` 后重试;不要绕过集合校验。
|
|
305
|
+
|
|
306
|
+
Vue 模板示例:
|
|
307
|
+
|
|
308
|
+
```vue
|
|
309
|
+
<el-button type="default" size="small" :loading="dashboardRefreshing" :disabled="dashboardRefreshing" @click="refreshAll" aria-label="刷新数据">
|
|
310
|
+
<i v-if="!dashboardRefreshing" class="ri ri_refresh-line" aria-hidden="true"></i>
|
|
311
|
+
<span>刷新数据</span>
|
|
312
|
+
</el-button>
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
图标应放在对应操作控件内部;保留可读文字或 `aria-label`,确保图标不是唯一信息。筛选器、刷新等页面操作应保持 Element UI 的 loading/disabled 状态,并通过既有 capability、查询或刷新方法执行,不在模板中直接发起请求。
|