bpmax-cli 0.2.1-beta.7 → 0.2.1-beta.70
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 +20 -7
- package/dist/bin.js +40326 -12576
- package/dist/bin.js.map +1 -1
- package/package.json +10 -5
- package/scripts/install-skills.mjs +27 -60
- package/scripts/run-source-cli.mjs +145 -0
- package/skills/bpmax-ai-taskbook/SKILL.md +12 -0
- package/skills/bpmax-ai-taskbook/references/blueprint-taskbook-gates.md +120 -0
- package/skills/bpmax-ai-taskbook/references/taskbook-template.md +41 -1
- 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 +44 -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 +122 -1084
- 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 +1157 -0
- package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +1 -1
- 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-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 +128 -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 +5 -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-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 +7 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "bpmax-role-editor"
|
|
3
|
-
description: "
|
|
3
|
+
description: "用于通过 bpmax-cli typed config 创建或编辑 BPMAX 角色。只要用户提到“配角色”“编辑角色权限”“新增角色”“改系统权限/自定义权限/流程权限/成员管理”“提交角色配置”或等价表达,就应使用这个 skill。它使用 typed CLI profile 和真实线上接口回读,走本地临时文件 + gate 检查 + typed CLI submit + 回读验收的闭环。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# BPMAX Role Editor
|
|
@@ -19,7 +19,7 @@ description: "用于在 BPMAX 的角色配置页面创建或编辑角色。只
|
|
|
19
19
|
- 不得以历史脏配置、顺手修复、统一风格、编辑器自动补字段、方便调试为理由修改需求外配置。
|
|
20
20
|
|
|
21
21
|
## 何时使用
|
|
22
|
-
-
|
|
22
|
+
- 用户需要通过 bpmax-cli typed config 管理 BPMAX 角色配置。
|
|
23
23
|
- 用户要新建角色或编辑已有角色
|
|
24
24
|
- 用户要调整:
|
|
25
25
|
- 角色基础信息
|
|
@@ -66,19 +66,9 @@ description: "用于在 BPMAX 的角色配置页面创建或编辑角色。只
|
|
|
66
66
|
- 不要把“入口能不能看到”“筛选器默认条件”误当成角色列表权限;涉及服务端特殊数据可见性时,跳转到 [`bpmax-dataset-template-editor`](../bpmax-dataset-template-editor/SKILL.md) 的 `pre_process_script` 方法。
|
|
67
67
|
|
|
68
68
|
## 前置条件
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
- 当前工作区
|
|
73
|
-
- 默认环境变量:
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
export BPMAX_BASE_URL='https://<current-browser-origin>'
|
|
77
|
-
export BPMAX_COOKIE_HEADER='foo=bar; baz=qux'
|
|
78
|
-
export BPMAX_WORKSPACE='store_mgr'
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
- `BPMAX_BASE_URL` 优先使用当前浏览器页面 origin;如果没有显式提供,bpmax-builder-shared `base_url` 会按 [AGENTS.md](../../../AGENTS.md) 里的仓库默认 origin 兜底。
|
|
69
|
+
- 使用当前 `bpmax-cli` profile、capability 和线上 readback 作为授权与事实来源。
|
|
70
|
+
- 浏览器页面只用于只读验收角色可见性和权限表现;真实远端写入必须回到 `bpmax-cli config role submit`。
|
|
71
|
+
- 不读取或复用浏览器 Cookie、浏览器存储、手工请求头或旧脚本环境变量。
|
|
82
72
|
- 不要在 skill 文档或脚本里再写死任何项目环境域名。
|
|
83
73
|
|
|
84
74
|
## Mem0 协议
|
|
@@ -102,26 +92,13 @@ export BPMAX_WORKSPACE='store_mgr'
|
|
|
102
92
|
- 编辑已有角色:
|
|
103
93
|
|
|
104
94
|
```bash
|
|
105
|
-
|
|
106
|
-
[[ -x "$PYTHON_BIN" ]] || PYTHON_BIN=./.venv/bin/python
|
|
107
|
-
[[ -x "$PYTHON_BIN" ]] || PYTHON_BIN=python3
|
|
108
|
-
|
|
109
|
-
"$PYTHON_BIN" .codex/skills/bpmax-role-editor/scripts/export_role.py \
|
|
110
|
-
--role-id 895023449 \
|
|
111
|
-
--workspace store_mgr \
|
|
112
|
-
--cookie-header "$BPMAX_COOKIE_HEADER"
|
|
95
|
+
bpmax-cli config role export --id <role-id> --out .codex/tmp/role-editor --profile <profile> --format json
|
|
113
96
|
```
|
|
114
97
|
|
|
115
98
|
- 新建角色 skeleton:
|
|
116
99
|
|
|
117
100
|
```bash
|
|
118
|
-
|
|
119
|
-
--create-skeleton \
|
|
120
|
-
--workspace store_mgr \
|
|
121
|
-
--name "新角色" \
|
|
122
|
-
--key new_role \
|
|
123
|
-
--intro "角色说明" \
|
|
124
|
-
--cookie-header "$BPMAX_COOKIE_HEADER"
|
|
101
|
+
bpmax-cli config role export --create --out .codex/tmp/role-editor --profile <profile> --format json
|
|
125
102
|
```
|
|
126
103
|
|
|
127
104
|
### 2. 本地 work 文件
|
|
@@ -14,31 +14,41 @@ metadata:
|
|
|
14
14
|
|
|
15
15
|
## 命令发现
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
若提供了 `BPMAX_CLI_HOME`,必须优先使用该源码 checkout,不能因为 PATH 中存在旧版全局命令而回退。源码入口会在需要时自动构建,并在执行命令前把 bundled Skills 同步到当前源码版本:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
20
|
+
node "$BPMAX_CLI_HOME/scripts/run-source-cli.mjs" --help
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
在 `bpmax-cli` 源码仓库内开发或联调时,先执行一次 `npm link`。之后 bare `bpmax-cli` 会链接到同一个源码入口,迁移脚本中的子进程也会自动使用当前源码:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
|
|
26
|
+
npm link
|
|
27
|
+
bpmax-cli --version
|
|
27
28
|
```
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
若没有 `BPMAX_CLI_HOME`,才允许使用 PATH 中的已安装命令:
|
|
30
31
|
|
|
31
32
|
```bash
|
|
32
|
-
|
|
33
|
-
npm --prefix "$BPMAX_CLI_HOME" run build
|
|
33
|
+
bpmax-cli --help
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
后文默认直接写 `bpmax-cli
|
|
36
|
+
后文默认直接写 `bpmax-cli`。设置了 `BPMAX_CLI_HOME` 但没有执行 `npm link` 时,把所有命令前缀替换成:
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
node "$BPMAX_CLI_HOME/
|
|
39
|
+
node "$BPMAX_CLI_HOME/scripts/run-source-cli.mjs" ...
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
禁止在同一次迁移中混用源码 CLI、旧全局 CLI 和不同版本 Skills。开始迁移前必须确认 `--version` 与 `$BPMAX_CLI_HOME/package.json` 一致,且命令输出不再出现 Skills out-of-sync notice。
|
|
43
|
+
|
|
44
|
+
## Agent 更新通知
|
|
45
|
+
|
|
46
|
+
- 所有 Agent、OpenClaw、Aily、Codex 和自动化调用都必须读取 CLI 返回的 `_notice`,不能只读取业务字段。
|
|
47
|
+
- `_notice.update` 表示当前安装渠道存在更高版本;beta 安装跟踪 `beta`,稳定安装跟踪 `latest`。先展示 `current/latest/channel`,再执行返回的 `next_command`。
|
|
48
|
+
- `_notice.skills` 表示 bundled Skills 未安装或与 CLI 不匹配;必须先执行返回的 `next_command` 完成同步。
|
|
49
|
+
- JSON 对象中的通知位于 `_notice`;JSON 数组、NDJSON、table、pretty 和命令错误中的通知通过 stderr 输出。Agent 必须同时读取 stdout 和 stderr。
|
|
50
|
+
- 更新失败时停止后续配置提交和正式 E2E,并向用户展示结构化错误;不得静默忽略更新提示或继续使用旧 lint/Skill。
|
|
51
|
+
|
|
42
52
|
## 开始前检查
|
|
43
53
|
|
|
44
54
|
任何 BPMAX CLI 场景都先做两步。本地终端可直接运行;Agent/飞书/OpenClaw/Aily 等多用户运行时必须使用 `init` 返回的 `next_commands.profile_list` 和 `next_commands.auth_status`,不要裸跑共享配置命令:
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bpmax-team-editor
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: "Use when creating or editing BPMAX teams and organization hierarchy through the bpmax-cli typed team adapter."
|
|
5
|
+
metadata:
|
|
6
|
+
requires:
|
|
7
|
+
bins: ["bpmax-cli"]
|
|
8
|
+
cliHelp: "bpmax-cli config team --help"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# BPMAX Team Editor
|
|
12
|
+
|
|
13
|
+
先阅读 `../bpmax-shared/SKILL.md`。团队配置必须在已初始化的 BPMAX 配置目录中,通过 typed CLI 完成。
|
|
14
|
+
|
|
15
|
+
## 标准链路
|
|
16
|
+
|
|
17
|
+
1. `bpmax-cli config team export --id <id> --out <dir> --profile <profile> --format json`
|
|
18
|
+
2. 只修改 work 文件中的 `name`、`intro`、`parent_id`、`model_id`、`permission`、`admin_users` 或 `meta_form`;导出的 `platform_id` 必须原样保留。
|
|
19
|
+
3. 运行 `lint`、`build`,审阅 dry-run 后再 `submit --id <id> --confirm "submit team <id>"`。
|
|
20
|
+
4. 运行 `verify --id <id>`,确认父级、模型、权限和管理员回读一致。
|
|
21
|
+
|
|
22
|
+
## 硬门禁
|
|
23
|
+
|
|
24
|
+
- `parent_id` 不得指向自身;调整层级前必须确认目标父团队存在且不会形成环。
|
|
25
|
+
- 不得修改 `path`、`organization_id`、`platform_*`、`is_del`、时间戳等服务端或外部同步字段。已有 `platform_id` 是只读身份字段,删除或改变都会被 build/submit 硬阻断;create 也不得手工指定。
|
|
26
|
+
- 不得直接修改 `think_group` 文件代替 typed submit。
|
|
27
|
+
- 删除前必须确认没有子团队、成员或业务对象仍依赖该团队;平台拒绝时不得绕过。
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Adapted from https://github.com/EliaAlberti/ux-audit-skill at commit 76eb1ab73560c90275823395fda52c3ca4ea8b2b.
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026 Elia Alberti
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bpmax-ui-ux-audit
|
|
3
|
+
description: Use when auditing BPMAX forms, lists, details, approval pages, responsive pages, or end-to-end journeys for usability, accessibility, error recovery, visual hierarchy, interaction clarity, or cross-page consistency; also use during BPMAX flow design and before reporting E2E completion.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# BPMAX UI/UX Audit
|
|
7
|
+
|
|
8
|
+
Audit the user journey with current-run(本轮)page or screenshot evidence. Every confirmed experience issue is a product `classification: BUG`, not optional polish.
|
|
9
|
+
|
|
10
|
+
## Hard gates
|
|
11
|
+
|
|
12
|
+
- Use `bpmax-functional-test-design` first to establish user goals, actors, paths, states, boundaries, and expected outcomes. UX review supplements functional coverage; it does not replace it.
|
|
13
|
+
- Inspect every in-scope surface actually reached in this run. Record unvisited or unavailable surfaces as not evaluated.
|
|
14
|
+
- Base each finding on a named current-run page, screenshot, DOM snapshot, or interaction observation. 不得编造 DOM、键盘、焦点、读屏、动画、延迟或响应式事实。
|
|
15
|
+
- Keep evidence under `.ai_test/report/<run>/`. Historical evidence may inform investigation but cannot prove the current result.
|
|
16
|
+
- Classify every confirmed issue as `BUG` with `P0|P1|P2|P3`, user impact, reproduction steps, evidence, heuristic references, recommendation, and `open|fixed|verified` status.
|
|
17
|
+
- Do not automatically install Python or image packages. Use available image/view capabilities for annotations; if unavailable, keep the textual finding and state that annotation was not produced.
|
|
18
|
+
- Run `bpmax-cli test-suite lint-report --root .ai_test/report/<run> --format json` before any complete E2E conclusion.
|
|
19
|
+
|
|
20
|
+
## Audit workflow
|
|
21
|
+
|
|
22
|
+
1. Define the journey goal, actors, platform, current run, and evaluated surfaces from the functional cases.
|
|
23
|
+
2. Review each surface in four passes: goal completion, framework heuristics, recurring checks, and journey-level consistency.
|
|
24
|
+
3. Separate visible facts from unavailable interaction properties. Capture a new screenshot or structured browser evidence when a claim needs proof.
|
|
25
|
+
4. Merge duplicate symptoms into one BUG when they share a cause and recommendation; list every affected surface.
|
|
26
|
+
5. Write `ux-findings.json` using `references/bpmax-ux-findings.md`.
|
|
27
|
+
6. Update the scenario report metadata and findings section. Re-test fixed BUGs and change status to `verified` only with new current-run evidence.
|
|
28
|
+
7. Apply the result gate and run `lint-report`.
|
|
29
|
+
|
|
30
|
+
## Result gate
|
|
31
|
+
|
|
32
|
+
- Unresolved P0/P1 BUG present: `result: fail`.
|
|
33
|
+
- Only unresolved P2/P3 BUGs present: `result: pass-with-warnings`.
|
|
34
|
+
- No unresolved UX BUG and all other E2E gates pass: `result: pass`.
|
|
35
|
+
- Audit incomplete or blocked: only `partial` or `blocked`.
|
|
36
|
+
|
|
37
|
+
Never downgrade a BUG to “suggestion”, “observation”, or “polish” to obtain a passing result.
|
|
38
|
+
|
|
39
|
+
## References
|
|
40
|
+
|
|
41
|
+
- Read `references/audit-framework.md` for the review passes, named heuristics, and recurring checks.
|
|
42
|
+
- Read `references/bpmax-ux-findings.md` for the JSON contract, evidence rules, severity mapping, and report metadata.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# BPMAX UX audit framework
|
|
2
|
+
|
|
3
|
+
## Four review passes
|
|
4
|
+
|
|
5
|
+
1. **Goal walk:** follow the functional case as the stated actor. Identify friction, ambiguity, dead ends, lost work, and unclear completion.
|
|
6
|
+
2. **Framework sweep:** cite the smallest relevant named rule. Prefer Nielsen, Norman, WCAG, content design, and established behavioral laws over generic taste.
|
|
7
|
+
3. **Recurring checks:** use stable labels so repeated defects are classified consistently.
|
|
8
|
+
4. **Journey review:** compare pages for terminology, action placement, status visibility, progress, memory load, and recovery continuity.
|
|
9
|
+
|
|
10
|
+
## Core heuristics
|
|
11
|
+
|
|
12
|
+
- **Nielsen:** system status, real-world language, user control, consistency, error prevention, recognition over recall, efficiency, minimalism, error recovery(错误恢复), and contextual help.
|
|
13
|
+
- **Norman:** discoverability, signifiers, mapping, feedback, constraints, affordances, and a coherent conceptual model.
|
|
14
|
+
- **WCAG:** color is not the only signal; text and controls have sufficient contrast; headings and labels are descriptive; targets are usable; errors are identified with corrective guidance; navigation/components stay consistent.
|
|
15
|
+
- **Behavioral laws:** apply Hick's Law to ungrouped choices, Fitts's Law to target size and distance, Miller's Law to memory load, Jakob's Law to convention drift, and Peak-End to the worst moment and final confirmation.
|
|
16
|
+
- **Content design:** use plain language, one term per concept, verb-first actions, honest expectations, scannable structure, and errors that say what happened and how to recover.
|
|
17
|
+
|
|
18
|
+
## Recurring checks
|
|
19
|
+
|
|
20
|
+
| ID | Check |
|
|
21
|
+
|---|---|
|
|
22
|
+
| CTA-AMBIGUITY | The next action or its consequence is unclear. |
|
|
23
|
+
| DEAD-END | An empty, error, or terminal state has no recovery or exit. |
|
|
24
|
+
| ERROR-VAGUE | The error does not explain cause and recovery. |
|
|
25
|
+
| FORM-FRICTION | Labels, formats, defaults, validation, or field order add avoidable effort. |
|
|
26
|
+
| STATUS-BLIND | Current state, progress, save state, or completion is not visible. |
|
|
27
|
+
| PATTERN-DRIFT | The same concept or action changes wording, position, or behavior across pages. |
|
|
28
|
+
| ACCESS-FOCUS | 键盘焦点不可见、顺序异常或操作无法通过键盘完成;只有本轮交互证据才能确认。 |
|
|
29
|
+
| TARGET-SIZE | A control is too small or crowded for reliable activation. |
|
|
30
|
+
| HIERARCHY-FLAT | Primary, secondary, and dangerous actions lack visual priority. |
|
|
31
|
+
| RECALL-TAX | Users must remember data from an earlier surface to continue. |
|
|
32
|
+
|
|
33
|
+
## Evidence calibration
|
|
34
|
+
|
|
35
|
+
- Static screenshots can prove visible text, hierarchy, spacing, grouping, color-only signaling, and visible states.
|
|
36
|
+
- Live interaction evidence is required for keyboard focus, focus order, latency, loading behavior, preserved input, error recovery, and action consequences.
|
|
37
|
+
- Borderline contrast requires a measurement note; do not invent a ratio.
|
|
38
|
+
- Illegible text is evidence of illegibility, not permission to guess the wording.
|
|
39
|
+
- A positive observation may be documented separately, but it is not a finding and does not offset a BUG.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# BPMAX UX finding contract
|
|
2
|
+
|
|
3
|
+
Write one `ux-findings.json` in the current `.ai_test/report/<run>/` directory:
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"version": 1,
|
|
8
|
+
"run_id": "20260723-001",
|
|
9
|
+
"scenario_id": "expense-approval",
|
|
10
|
+
"audit_status": "completed",
|
|
11
|
+
"evaluated_surfaces": ["create form", "approval detail"],
|
|
12
|
+
"findings": [
|
|
13
|
+
{
|
|
14
|
+
"bug_id": "UX-BUG-001",
|
|
15
|
+
"classification": "BUG",
|
|
16
|
+
"severity": "P2",
|
|
17
|
+
"title": "错误提示没有恢复方法",
|
|
18
|
+
"surface": "create form",
|
|
19
|
+
"user_impact": "用户无法判断如何完成提交",
|
|
20
|
+
"reproduction_steps": ["打开创建页", "输入非法金额并提交"],
|
|
21
|
+
"heuristic_refs": ["Nielsen #9", "WCAG 3.3.3"],
|
|
22
|
+
"evidence": ["screenshots/C001-S002.png"],
|
|
23
|
+
"recommendation": "说明有效范围,并把焦点保留在错误字段",
|
|
24
|
+
"status": "open"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Required rules
|
|
31
|
+
|
|
32
|
+
- `version` is `1`; `audit_status` is `completed|blocked`.
|
|
33
|
+
- A completed audit has at least one `evaluated_surfaces` entry. An audit can complete with an empty `findings` array.
|
|
34
|
+
- Every finding has `classification: "BUG"`, severity `P0|P1|P2|P3`, non-empty reproduction steps, heuristic references, evidence, recommendation, and status `open|fixed|verified`.
|
|
35
|
+
- Evidence paths are relative to the current run, point to ordinary PNG/JSON/HTML/TXT/Markdown files, and must be registered or referenced by the current execution manifest. Directories, `ux-findings.json` self-references, stale files, and unregistered copied artifacts are invalid.
|
|
36
|
+
- `verified` requires a non-empty `retest_evidence` array whose registered current-run files are different from and newer than the original `evidence`. `fixed` without retest remains unresolved.
|
|
37
|
+
- `ux_bug_counts` counts unresolved `open|fixed` BUGs by severity. A correctly verified BUG remains in `findings` for traceability but is excluded from the active counts and outcome gate.
|
|
38
|
+
|
|
39
|
+
## Scenario report metadata
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
test_design_skill: bpmax-functional-test-design
|
|
43
|
+
ux_audit_skill: bpmax-ui-ux-audit
|
|
44
|
+
ux_audit_status: completed
|
|
45
|
+
ux_findings: ux-findings.json
|
|
46
|
+
ux_bug_counts: P0=0,P1=0,P2=1,P3=0
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Severity and outcome
|
|
50
|
+
|
|
51
|
+
- Unresolved P0/P1: blocks release or materially prevents/corrupts the journey; final result is `fail`.
|
|
52
|
+
- Unresolved P2/P3 only: result is `pass-with-warnings`; retain evidence, remediation, and retest status.
|
|
53
|
+
- Zero unresolved BUGs: result may be `pass` when functional and browser gates also pass.
|
|
54
|
+
- Audit unavailable or incomplete: result is `partial` or `blocked`.
|
|
55
|
+
|
|
56
|
+
Run `bpmax-cli test-suite lint-report` after updating both files. The lint result must agree with `ux-findings.json`; manually written prose is not a substitute.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bpmax-user
|
|
3
3
|
version: 1.0.0
|
|
4
|
-
description: Use when the user needs to
|
|
4
|
+
description: Use when the user needs to query, resolve, create, or safely edit BPMAX organization users and identity relations through typed bpmax-cli commands.
|
|
5
5
|
metadata:
|
|
6
6
|
requires:
|
|
7
7
|
bins: ["bpmax-cli"]
|
|
@@ -16,6 +16,24 @@ metadata:
|
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
bpmax-cli user current --format json
|
|
19
|
+
bpmax-cli user search --query "<姓名或工号>" --active-only --profile <profile> --format json
|
|
20
|
+
bpmax-cli user resolve --name "<姓名>" --employee-no "<工号>" --profile <profile> --format json
|
|
21
|
+
bpmax-cli user readback --id <user_id> --profile <profile> --format json
|
|
22
|
+
bpmax-cli organization department search --query "<部门名称>" --profile <profile> --format json
|
|
23
|
+
bpmax-cli organization department readback --id <group_id> --profile <profile> --format json
|
|
24
|
+
bpmax-cli organization department memberships --user-id <user_id> --profile <profile> --format json
|
|
25
|
+
bpmax-cli organization main-department --user-id <user_id> --profile <profile> --format json
|
|
26
|
+
bpmax-cli organization branch --user-id <user_id> --profile <profile> --format json
|
|
27
|
+
bpmax-cli organization position --user-id <user_id> --profile <profile> --format json
|
|
28
|
+
bpmax-cli organization direct-superior --user-id <user_id> --profile <profile> --format json
|
|
29
|
+
bpmax-cli organization superior-chain --user-id <user_id> --levels 20 --profile <profile> --format json
|
|
30
|
+
bpmax-cli organization readback --user-id <user_id> --profile <profile> --format json
|
|
31
|
+
bpmax-cli config user export --id <user_id> --out <dir> --profile <profile> --format json
|
|
32
|
+
bpmax-cli config user lint --work <work.json> --profile <profile> --format json
|
|
33
|
+
bpmax-cli config user build --work <work.json> --meta <meta.json> --out <submit.json> --profile <profile> --format json
|
|
34
|
+
bpmax-cli config user submit --id <user_id> --payload <submit.json> --profile <profile> --format json
|
|
35
|
+
bpmax-cli config user verify --id <user_id> --expect <work.json> --profile <profile> --format json
|
|
36
|
+
bpmax-cli config user delete --id <user_id> --profile <profile> --format json
|
|
19
37
|
```
|
|
20
38
|
|
|
21
39
|
## 何时使用
|
|
@@ -23,9 +41,23 @@ bpmax-cli user current --format json
|
|
|
23
41
|
- 用户想确认当前登录账号
|
|
24
42
|
- 要在执行其他 BPMAX 操作前验证身份
|
|
25
43
|
- 要检查某个 profile 实际连到哪个环境、哪个用户
|
|
44
|
+
- WEWF 迁移、固定审批人或矩阵规则需要将姓名/工号精确绑定到 BPMAX 用户 ID
|
|
45
|
+
- 需要确认用户未删除且处于有效在职状态
|
|
46
|
+
- 需要将申请人映射到所属部门、岗位、直属上级或连续上级
|
|
47
|
+
- 需要检查主部门、分部是否具备平台权威字段,而不是依赖数组顺序或名称猜测
|
|
26
48
|
|
|
27
49
|
## 规则
|
|
28
50
|
|
|
29
51
|
- 默认优先 `--format json`
|
|
30
52
|
- 若只是判断登录是否生效,`user current` 比原始 `api GET /user/current` 更优先
|
|
31
53
|
- 若用户明确指定环境,显式加 `--profile <name>`
|
|
54
|
+
- 固定人绑定优先同时提供姓名和工号。`user resolve` 匹配多人、未匹配或用户失效时必须停止,不得凭姓名选第一个。
|
|
55
|
+
- typed 输出只保留 ID、姓名、工号、组织、状态和角色摘要,不应默认输出手机号或头像 URL。
|
|
56
|
+
- `organization department memberships` 以平台 `user_group` 关系为权威;`position` 以 `user.title` 为权威;直属与连续直属上级以 `user.leader_id` 为权威。
|
|
57
|
+
- `main-department` 不得把第一个部门当主部门;平台未返回主部门字段时必须输出 `platform_authority_required`。
|
|
58
|
+
- `branch` 不得按部门名称或固定层级猜测分部;平台未提供分部类型/标识时只返回候选祖先并明确要求平台改造。
|
|
59
|
+
- 用户配置必须在已初始化的 BPMAX 配置目录中走 `config user` typed 链路;不得直接修改 `think_user`,也不得使用 raw API 写用户。
|
|
60
|
+
- 导出和普通输出不得包含手机号、头像、密码、Cookie、会话、IP 或登录时间。手机号只允许在 `mode=create` work 中显式提供,且 dry-run 输出必须脱敏。
|
|
61
|
+
- 创建用户至少需要姓名、手机号和一个角色 ID;编辑关系时 `group_ids`、`role_ids`、`modelList` 必须使用精确 typed readback 得到的 ID。
|
|
62
|
+
- `hide_in_contact` 当前平台接口未实现,不得写入 work 或 submit payload;CLI lint/build 会硬阻断。
|
|
63
|
+
- `leader_id` 不得指向用户自身;状态只允许 0、1、2。删除前必须确认没有进行中项目或待办依赖该用户。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "bpmax-user-mock-operator"
|
|
3
|
-
description: "用于 BPMAX
|
|
3
|
+
description: "用于 BPMAX E2E 测试中的受控用户身份切换。正式回放/运行由 scenario runner 在 Playwright session 中自动 ensure/release actor;录制阶段才使用 Chrome Control 身份桥。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# BPMAX User Mock Operator
|
|
@@ -8,20 +8,20 @@ description: "用于 BPMAX 浏览器 E2E 测试中的用户身份切换。只要
|
|
|
8
8
|
## 使用范围
|
|
9
9
|
- 本 skill 只用于“浏览器 E2E 测试中的用户身份切换”。
|
|
10
10
|
- 目标是让同一浏览器会话在完整页面链路中切到发起人、审批人、查看人等角色,验证真实 UI 可见性、按钮、表单和流转。
|
|
11
|
-
- 不用于普通 CLI API 调用身份切换,不用于 API Key impersonation
|
|
11
|
+
- 不用于普通 CLI API 调用身份切换,不用于 API Key impersonation。正式回放和运行只使用 `bpmax-cli e2e scenario execute`;Chrome identity bridge 只服务于 automation 录制。
|
|
12
12
|
- 不修改 BPMAX 平台权限、角色配置、本地 `think_*` 镜像或配置提交体。
|
|
13
13
|
|
|
14
14
|
## 何时使用
|
|
15
15
|
- E2E 场景需要用不同用户在浏览器里发起、审批、驳回、查看或验证权限。
|
|
16
16
|
- 当前浏览器已登录一个具备模拟用户权限的管理账号,需要临时 mock 到目标用户。
|
|
17
17
|
- 测试结束后需要 unmock,恢复原管理账号身份。
|
|
18
|
-
- 用户只给了姓名但没有给 `user_id`
|
|
18
|
+
- 用户只给了姓名但没有给 `user_id` 时,使用 `bpmax-cli user resolve/readback` 精确解析;不得进入普通用户管理页人工搜索模拟入口。
|
|
19
19
|
|
|
20
20
|
## 前置条件
|
|
21
21
|
- 浏览器里已有可用 BPMAX 登录态。
|
|
22
|
-
-
|
|
22
|
+
- 原始账号必须满足平台当前 `canMockUserIdentity` 契约:超管、`organization.admin` 或 `user.mock` 任一成立。身份桥会先读取当前页面脱敏 userInfo 做权限预检;无法证明时只能继续到平台真实按钮/服务端门禁,任何拒绝都必须 fail closed。
|
|
23
23
|
- 已确认 workspace、目标用户 `user_id`、目标测试角色。
|
|
24
|
-
-
|
|
24
|
+
- 身份步骤必须同时绑定目标业务 route。切换完成后直接回到当前待办、项目或办理页面,不把用户管理页暴露为测试流程中的探索步骤。
|
|
25
25
|
|
|
26
26
|
## Memory 协议
|
|
27
27
|
- 开始前先调用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),检索词至少包含:
|
|
@@ -35,72 +35,74 @@ description: "用于 BPMAX 浏览器 E2E 测试中的用户身份切换。只要
|
|
|
35
35
|
- 某类角色切换后的页面权限验证方式
|
|
36
36
|
- 不要写入 Cookie、Authorization、API Key、手机号、验证码、密码或完整接口响应。
|
|
37
37
|
|
|
38
|
-
##
|
|
39
|
-
- 进入模拟:`PUT /api/user/<user_id>`,body `{"mock": 1}`
|
|
40
|
-
- 退出模拟:`PUT /api/user/<user_id>`,body `{"unmock": 1}`
|
|
41
|
-
- query 需要带 `$workspace=<workspace>&$language=<language>`
|
|
42
|
-
- 请求头复用当前浏览器登录态:
|
|
43
|
-
- `Cookie`
|
|
44
|
-
- `Origin`
|
|
45
|
-
- `Referer`
|
|
46
|
-
- `x-href`
|
|
47
|
-
- `Content-Type: application/json`
|
|
38
|
+
## 正式回放与运行
|
|
48
39
|
|
|
49
|
-
|
|
40
|
+
正式 identity step 只声明 `identity_transport=phase_bound`、精确 `user_id`、actor 和目标 route。scenario runner 自动完成:
|
|
50
41
|
|
|
51
|
-
|
|
42
|
+
- 当前 Playwright 身份回读。
|
|
43
|
+
- 目标用户 typed readback 与有效状态校验。
|
|
44
|
+
- 当前身份已匹配时直接复用;不匹配时执行一次 mock。
|
|
45
|
+
- 写后身份回读、目标 route 刷新、截图和 lease 更新。
|
|
46
|
+
- actor 变化、case 收口或 run 清理时 release,并确认恢复原用户。
|
|
47
|
+
|
|
48
|
+
Agent不得把正式 identity step 拆成 prepare、Chrome helper 和 complete,也不得在普通用户管理页寻找“模拟”按钮。独立 status 只在用例本身验证身份展示时使用,不是 mock 的固定前置步骤。
|
|
49
|
+
|
|
50
|
+
## Chrome 录制身份桥
|
|
51
|
+
|
|
52
|
+
新建或修复 automation 的录制阶段,使用同一个 review 范围内 recording session。mock 与 unmock 可以放在不同 evidence 子目录,但必须共享 `--recording-session` 根目录和唯一 `identity-lease.json`:
|
|
52
53
|
|
|
53
54
|
```bash
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
--
|
|
60
|
-
--
|
|
61
|
-
--workspace <workspace> \
|
|
62
|
-
--base-url <bpmax_origin> \
|
|
63
|
-
--cookie-header "$BPMAX_COOKIE_HEADER"
|
|
55
|
+
bpmax-cli e2e identity browser mock --recording-session <recording-root> \
|
|
56
|
+
--user-id <target_user_id> --evidence-dir <recording-root>/identity/mock \
|
|
57
|
+
--profile <profile> --href-path <target-business-route> --format json
|
|
58
|
+
|
|
59
|
+
bpmax-cli e2e identity browser unmock --recording-session <recording-root> \
|
|
60
|
+
--evidence-dir <recording-root>/identity/unmock \
|
|
61
|
+
--profile <profile> --href-path <target-business-route> --format json
|
|
64
62
|
```
|
|
65
63
|
|
|
66
|
-
|
|
64
|
+
`status/mock/unmock` 返回 `result=browser_action_required` 后,必须优先使用 `chrome:control-chrome`,在专用 BPMAX 标签页调用:
|
|
67
65
|
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
--base-url <bpmax_origin> \
|
|
74
|
-
--cookie-header "$BPMAX_COOKIE_HEADER"
|
|
66
|
+
```js
|
|
67
|
+
const { executeChromeIdentityBridge } = await import(
|
|
68
|
+
'<当前 bpmax-user-mock-operator skill 目录>/scripts/chrome_identity_bridge.mjs'
|
|
69
|
+
);
|
|
70
|
+
await executeChromeIdentityBridge({ tab, requestFile: '<request.json>' });
|
|
75
71
|
```
|
|
76
72
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
73
|
+
helper 返回后必须立即执行 `bpmax-cli e2e identity browser complete --request <request.json> --format json`,以验收 readback、登记证据并推进 lease。mock complete 成功后才能录制业务步骤;unmock complete 成功且 lease 为 `released` 后才能结束录制。
|
|
74
|
+
|
|
75
|
+
身份桥包含页面路由、精确用户筛选和写后身份回读,浏览器控制调用必须提供至少 180 秒执行预算。调用超时或控制通道中断时不得重跑 mock;先检查 recording session 根目录的 `identity-lease.json`,按 readback-first 方式 resolve。
|
|
76
|
+
|
|
77
|
+
helper 只能执行固定 UI 动作:读取当前身份、按 typed readback 姓名筛选、核对唯一行内用户 ID、点击该行“模拟”、点击导航菜单“退出模拟”。动作文字会在页面 DOM 中自动识别中文、英文和日文版本,不要求 request 语言与当前 UI 语言一致。身份 ID 优先来自 Vuex;只有 `/userProfileEditor?id=<user_id>` 或带当前工作区前缀的 `/w:<workspace>/userProfileEditor?id=<user_id>` 这类已确认用户资料路由可以作为兜底,项目办理页等业务路由中的 `id` 永远不能作为用户 ID。只有姓名而没有可信 ID 时必须阻断,不能形成 status/mock 成功证据。helper 不会读取浏览器 Cookie、localStorage 或密码,也不会开放任意接口请求。
|
|
78
|
+
|
|
79
|
+
## 身份工作流
|
|
80
|
+
1. 记录原始管理账号、workspace、当前页面和目标测试角色;使用 `bpmax-cli user resolve` 或 typed user readback 精确解析目标用户,不得凭姓名猜 ID。browser mock 会再次按 `user_id` 回读有效状态和姓名。
|
|
81
|
+
2. 用例只在 actor 首次变化时安排 `runner=identity` ensure 步骤;相同 actor 的连续业务步骤复用当前身份。
|
|
82
|
+
3. 录制阶段由 Chrome helper 执行页面模拟;正式阶段由 scenario runner 在 Playwright session 中自动执行,不需要 Agent进入用户管理页。
|
|
83
|
+
4. 在浏览器中执行该角色的真实动作:发起、填写、提交、审批、驳回、查看或权限验证。每个角色保留独立页面证据。
|
|
84
|
+
5. 使用 run cleanup/finally 编排。无论业务步骤成功、失败还是被阻塞,都必须按同一 lease release actor。
|
|
85
|
+
6. 只有 `readback_confirmed=true`、页面截图显示恢复原账号、`identity-lease.json` 状态为 `released`,才能结束多角色测试。
|
|
86
|
+
|
|
87
|
+
如果 helper 已完成录制 mock、但 Agent 在 complete 前中断,恢复时不得重跑 mock;继续使用同一个 recording session 和 lease 先回读,再 complete 或 release。禁止新建 diagnostic evidence 目录绕过原 lease。
|
|
88
|
+
|
|
89
|
+
mock 成功后 CLI 会建立带 TTL 的恢复租约。异常发生在同一次 helper 调用内时会立即尝试 unmock;跨步骤恢复必须由 Agent 的 `finally` 执行正式 unmock。Chrome Control 的单次执行环境不提供可靠后台计时器,因此 TTL 到期只会硬阻断叠加 mock 并要求先恢复原身份,不能把它描述成“后台一定会自动点击退出模拟”。报告 lint 会阻断 active/uncertain lease 的通过结论。
|
|
90
|
+
|
|
91
|
+
显式 `--diagnostic` 使用旧 Cookie transport 时,如果当前 readback 已是 `mock=true`,CLI 会先恢复原始账号再切换下一目标用户。仅当旧服务端因 `/user/current` 缺少 `organization.admin` 返回明确 403 时,才改用当前模拟用户的数字 ID 调用兼容恢复接口;其他错误继续硬阻断。
|
|
95
92
|
|
|
96
93
|
## 硬门禁
|
|
97
94
|
- 没有确认当前浏览器身份前,不得声称该角色浏览器 E2E 已通过。
|
|
98
95
|
- 没有执行 unmock 和恢复验证前,不得结束多角色测试。
|
|
96
|
+
- mock 自身必须包含当前身份前读和写后回读;不再要求独立 status。每个实际 mock 必须最终 release,身份步骤一行只能执行一个 operation。
|
|
99
97
|
- 不得把 mock 后的 Cookie/API 响应用作普通 API Key 或 CLI 业务命令身份。
|
|
100
98
|
- 不得把浏览器抓包中的 Cookie 或 Authorization 写入报告、memory、AGENTS.md 或 git。
|
|
99
|
+
- 正式用例缺少 execution manifest/case step 时必须在远程 mock 前硬阻断。`--diagnostic` 只能排障,不能记为 pass evidence。
|
|
100
|
+
- 每次 mock/unmock 由平台写入审计日志;目标用户必须与原始操作人同组织。
|
|
101
|
+
- 原有 `bpmax-cli e2e identity status|mock|unmock` Cookie transport 仅保留显式 `--diagnostic` 排障;不得绑定 execution manifest/case/step,也不能作为正式 identity pass evidence。
|
|
101
102
|
|
|
102
103
|
## 常见问题
|
|
103
|
-
-
|
|
104
|
+
- 页面跳登录:当前 Chrome 登录态已失效,停止本轮 request,登录后重新生成,不能复用过期 request。
|
|
105
|
+
- “模拟”按钮不存在:确认精确用户行、用户状态和原始账号权限;不得改用页面内 fetch 或 Cookie 注入绕过。
|
|
104
106
|
- HTTP 200 但业务 `code` 非 0:以后端返回的 JSON 错误为准,不要继续执行页面测试。
|
|
105
|
-
-
|
|
106
|
-
- 目标用户 id
|
|
107
|
+
- 页面身份未变化:helper 必须返回 readback mismatch 并立即尝试 unmock;不得重复点击“模拟”。
|
|
108
|
+
- 目标用户 id 不确定:使用 typed user resolve/readback,不要凭姓名猜 id,也不要进入用户管理页探索。
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "BPMAX User Mock Operator"
|
|
3
|
-
short_description: "在 BPMAX
|
|
4
|
-
default_prompt: "使用 $bpmax-user-mock-operator 根据当前 BPMAX
|
|
3
|
+
short_description: "在 BPMAX E2E 测试中切换或退出模拟用户身份"
|
|
4
|
+
default_prompt: "使用 $bpmax-user-mock-operator 根据当前 BPMAX E2E 会话,为测试切换或退出模拟用户身份。"
|