bpmax-cli 0.1.44-beta.0 → 0.1.44-beta.10
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 +1630 -70
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
- package/scripts/install-skills.mjs +98 -0
- package/skills/bpmax-api-platform-editor/SKILL.md +1 -1
- package/skills/bpmax-console-template-editor/SKILL.md +1 -1
- package/skills/bpmax-dataset-field-template-editor/SKILL.md +3 -3
- package/skills/bpmax-dataset-template-editor/SKILL.md +3 -3
- package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +28 -2
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +26 -3
- package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +8 -0
- package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +9 -4
- package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +25 -0
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +26 -0
- package/skills/bpmax-filter-template-editor/SKILL.md +1 -1
- package/skills/bpmax-flow-template-editor/SKILL.md +25 -10
- package/skills/bpmax-flow-template-editor/references/flow-template-api-workflow.md +17 -2
- package/skills/bpmax-flow-template-editor/references/matrix-flow-form-nav-collaboration.md +2 -0
- package/skills/bpmax-form-template-editor/SKILL.md +31 -6
- package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +15 -5
- package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +1 -1
- package/skills/bpmax-form-template-editor/scripts/export_form_template.py +2 -0
- package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +17 -0
- package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +6 -17
- package/skills/bpmax-list-template-editor/SKILL.md +5 -1
- package/skills/bpmax-list-template-editor/references/content-config-shape.md +17 -0
- package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +9 -4
- package/skills/bpmax-list-template-editor/references/runtime-verified-workflow.md +17 -10
- package/skills/bpmax-list-template-editor/references/special-formats.md +17 -0
- package/skills/bpmax-memory-protocol/SKILL.md +72 -0
- package/skills/bpmax-nav-config-editor/SKILL.md +1 -1
- package/skills/bpmax-project-detail-template-editor/SKILL.md +1 -1
- package/skills/bpmax-role-editor/SKILL.md +2 -2
- package/skills/bpmax-user-mock-operator/SKILL.md +106 -0
- package/skills/bpmax-user-mock-operator/agents/openai.yaml +4 -0
- package/skills/bpmax-user-mock-operator/scripts/switch_user_identity.py +37 -0
- package/skills/bpmax-user-mock-operator/scripts/user_mock_operator_common.py +136 -0
- package/skills/bpmax-user-mock-operator/tests/test_user_mock_operator.py +138 -0
- package/skills/form-control-library/SKILL.md +1 -1
package/package.json
CHANGED
|
@@ -33,6 +33,10 @@ const agentGuidance = {
|
|
|
33
33
|
const agentGuidanceLines = Object.values(agentGuidance).flat().map((line) => `[bpmax-cli] ${line}`);
|
|
34
34
|
const stampPath = path.join(homedir(), '.bpmax', 'skills.stamp');
|
|
35
35
|
const openClawReminder = 'OpenClaw install already tries `openclaw skills install` and falls back to copying into ~/.openclaw/skills when needed. Do not manually copy skills unless this result reports a failure.';
|
|
36
|
+
const memoryGuidanceMarkers = {
|
|
37
|
+
start: '<!-- bpmax-cli:memory-guidance:start -->',
|
|
38
|
+
end: '<!-- bpmax-cli:memory-guidance:end -->',
|
|
39
|
+
};
|
|
36
40
|
|
|
37
41
|
const directoryTargets = [
|
|
38
42
|
{ agent: 'codex', root: path.join(homedir(), '.codex', 'skills') },
|
|
@@ -41,6 +45,14 @@ const directoryTargets = [
|
|
|
41
45
|
{ agent: 'agents', root: path.join(homedir(), '.agents', 'skills') },
|
|
42
46
|
{ agent: 'gemini', root: path.join(homedir(), '.gemini', 'skills') },
|
|
43
47
|
];
|
|
48
|
+
const globalGuidanceTargets = [
|
|
49
|
+
{ agent: 'codex', file: path.join(homedir(), '.codex', 'AGENTS.md') },
|
|
50
|
+
{ agent: 'agents', file: path.join(homedir(), '.agents', 'AGENTS.md') },
|
|
51
|
+
{ agent: 'claude', file: path.join(homedir(), '.claude', 'CLAUDE.md') },
|
|
52
|
+
{ agent: 'cc-switch', file: path.join(homedir(), '.cc-switch', 'AGENTS.md') },
|
|
53
|
+
{ agent: 'gemini', file: path.join(homedir(), '.gemini', 'GEMINI.md') },
|
|
54
|
+
{ agent: 'openclaw', file: path.join(homedir(), '.openclaw', 'AGENTS.md') },
|
|
55
|
+
];
|
|
44
56
|
|
|
45
57
|
function shouldRunAdapter(adapter) {
|
|
46
58
|
return !targetAgent || targetAgent === adapter;
|
|
@@ -105,6 +117,87 @@ async function installWithDirectoryTargets(skillNames) {
|
|
|
105
117
|
};
|
|
106
118
|
}
|
|
107
119
|
|
|
120
|
+
function renderMemoryGuidance(agent) {
|
|
121
|
+
const agentLabel = agent || '<agent>';
|
|
122
|
+
return `${memoryGuidanceMarkers.start}
|
|
123
|
+
# BPMAX Memory Guidance
|
|
124
|
+
|
|
125
|
+
- For non-trivial BPMAX configuration, flow, template, dataset, role, navigation, BBS, or e2e work, first use \`bpmax-memory-protocol\` or run \`bpmax-cli memory search --scope all --query "<workspace> <flow_type> <task>" --format json\`.
|
|
126
|
+
- Memory is isolated by the current API Key's bound agent. Do not pass or invent an agent id; for this runtime, treat the agent as \`${agentLabel}\`.
|
|
127
|
+
- After verified work, write only reusable \`decision\`, \`task_learning\`, \`anti_pattern\`, \`environmental\`, or \`convention\` memories. If work is incomplete, write only \`session_state\`.
|
|
128
|
+
- Never write API Key, Authorization, token, password, cookie, verification code, SMS code, phone number, full payloads, or large raw API responses to memory.
|
|
129
|
+
${memoryGuidanceMarkers.end}
|
|
130
|
+
`;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function upsertMarkedBlock(existing, block) {
|
|
134
|
+
const pattern = new RegExp(`${escapeRegExp(memoryGuidanceMarkers.start)}[\\s\\S]*?${escapeRegExp(memoryGuidanceMarkers.end)}\\n?`);
|
|
135
|
+
if (pattern.test(existing)) {
|
|
136
|
+
return existing.replace(pattern, block.endsWith('\n') ? block : `${block}\n`);
|
|
137
|
+
}
|
|
138
|
+
const prefix = existing.trimEnd();
|
|
139
|
+
return `${prefix}${prefix ? '\n\n' : ''}${block.endsWith('\n') ? block : `${block}\n`}`;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function escapeRegExp(value) {
|
|
143
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
async function writeGlobalMemoryGuidance() {
|
|
147
|
+
const targets = globalGuidanceTargets.filter((target) => !targetAgent || target.agent === targetAgent);
|
|
148
|
+
const updated = [];
|
|
149
|
+
const skipped = [];
|
|
150
|
+
for (const target of targets) {
|
|
151
|
+
const parentExists = await exists(path.dirname(target.file));
|
|
152
|
+
const explicitlyRequested = targetAgent === target.agent;
|
|
153
|
+
if (!parentExists && !explicitlyRequested) {
|
|
154
|
+
skipped.push({
|
|
155
|
+
agent: target.agent,
|
|
156
|
+
path: target.file,
|
|
157
|
+
reason: 'agent home not found',
|
|
158
|
+
});
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
if (!parentExists && explicitlyRequested) {
|
|
162
|
+
skipped.push({
|
|
163
|
+
agent: target.agent,
|
|
164
|
+
path: target.file,
|
|
165
|
+
reason: 'agent home not found; create the directory or add the memory guidance manually',
|
|
166
|
+
});
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
let existing = '';
|
|
170
|
+
try {
|
|
171
|
+
existing = await readFile(target.file, 'utf8');
|
|
172
|
+
} catch (error) {
|
|
173
|
+
if (error.code !== 'ENOENT') {
|
|
174
|
+
skipped.push({ agent: target.agent, path: target.file, reason: error.message });
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
const content = upsertMarkedBlock(existing, renderMemoryGuidance(target.agent));
|
|
179
|
+
if (content !== existing) {
|
|
180
|
+
await writeFile(target.file, content, 'utf8');
|
|
181
|
+
}
|
|
182
|
+
updated.push({
|
|
183
|
+
agent: target.agent,
|
|
184
|
+
path: target.file,
|
|
185
|
+
updated: content !== existing,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
if (targetAgent && !globalGuidanceTargets.some((target) => target.agent === targetAgent)) {
|
|
189
|
+
skipped.push({
|
|
190
|
+
agent: targetAgent,
|
|
191
|
+
reason: 'unknown agent; global memory guidance path was not guessed',
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
marker: 'bpmax-cli:memory-guidance',
|
|
196
|
+
updated,
|
|
197
|
+
skipped,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
108
201
|
async function listSkillNames() {
|
|
109
202
|
const entries = await readdir(sourceSkillsDir, { withFileTypes: true });
|
|
110
203
|
const skillNames = [];
|
|
@@ -333,6 +426,7 @@ async function main() {
|
|
|
333
426
|
await installWithOpenClawCli(skillNames),
|
|
334
427
|
await installWithAilySkillhub(skillNames),
|
|
335
428
|
];
|
|
429
|
+
const globalGuidance = await writeGlobalMemoryGuidance();
|
|
336
430
|
const installedCount = adapters.reduce((sum, item) => sum + item.installed.length + item.fallbacks.length, 0);
|
|
337
431
|
const failedCount = adapters.reduce((sum, item) => sum + item.failed.length, 0);
|
|
338
432
|
|
|
@@ -345,6 +439,7 @@ async function main() {
|
|
|
345
439
|
adapters,
|
|
346
440
|
agent: targetAgent || 'auto',
|
|
347
441
|
agent_guidance: agentGuidance,
|
|
442
|
+
global_guidance: globalGuidance,
|
|
348
443
|
message: 'No compatible local agent skill directories detected.',
|
|
349
444
|
next_action: adapters.map((item) => item.next_action).filter(Boolean).join(' '),
|
|
350
445
|
};
|
|
@@ -370,6 +465,7 @@ async function main() {
|
|
|
370
465
|
adapters,
|
|
371
466
|
agent: targetAgent || 'auto',
|
|
372
467
|
agent_guidance: agentGuidance,
|
|
468
|
+
global_guidance: globalGuidance,
|
|
373
469
|
next_action: failedCount > 0 ? 'Review failed adapter items and retry.' : '',
|
|
374
470
|
...(targetAgent === 'openclaw' ? { reminder: openClawReminder } : {}),
|
|
375
471
|
};
|
|
@@ -391,6 +487,8 @@ async function main() {
|
|
|
391
487
|
console.log(`- ${item.adapter || 'adapter'} ${item.skill}: failed (${item.stderr || item.stdout || item.error || `exit ${item.exitCode}`})`);
|
|
392
488
|
});
|
|
393
489
|
agentGuidanceLines.forEach((line) => console.log(line));
|
|
490
|
+
result.global_guidance.updated.forEach((item) => console.log(`[bpmax-cli] Updated memory guidance: ${item.path}`));
|
|
491
|
+
result.global_guidance.skipped.forEach((item) => console.log(`[bpmax-cli] Skipped memory guidance for ${item.agent}: ${item.reason}`));
|
|
394
492
|
}
|
|
395
493
|
return result;
|
|
396
494
|
}
|
|
@@ -62,7 +62,7 @@ description: "用于在 BPMAX 的系统集成页面中创建或编辑集成平
|
|
|
62
62
|
- `doc-debug` 层只负责导出上下文和记录验收结果,不替代浏览器真实调试。
|
|
63
63
|
|
|
64
64
|
## Mem0 协议
|
|
65
|
-
- 开始前先调用 [$
|
|
65
|
+
- 开始前先调用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),检索词至少包含:
|
|
66
66
|
- `platform_key`
|
|
67
67
|
- `instance_key`
|
|
68
68
|
- `api_key`
|
|
@@ -27,7 +27,7 @@ description: "用于在 BPMAX 的数据看板模板页面中创建或编辑看
|
|
|
27
27
|
- 如果需求涉及“按现有模板改一个版本”,应先识别当前模板或候选模板,而不是直接从零生成。
|
|
28
28
|
|
|
29
29
|
## Mem0 协议
|
|
30
|
-
- 开始前先调用 [$
|
|
30
|
+
- 开始前先调用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),检索词至少包含:
|
|
31
31
|
- `workspace`
|
|
32
32
|
- 模板 `id` / 模板名
|
|
33
33
|
- `data_set_id` / `search_temp_id`
|
|
@@ -7,7 +7,7 @@ description: "用于在 BPMAX 的数据集字段页面中创建、编辑、复
|
|
|
7
7
|
|
|
8
8
|
## 写入路径硬约束
|
|
9
9
|
- 执行前必须先运行 `bpmax-cli config adapters --format json` 核对 `dataset-field`;只有 `build_status` 和 `submit_status` 都是 `supported` 时才允许进入 build/submit。当前 typed CLI 通过 huanpingtong `/api/data_set_field*` 代理访问 bpmax-server `/data-set-field*` 运行态接口;若 adapter 显示 `blocked`,只能导出、编辑 work、lint 和形成变更建议,不得提交。
|
|
10
|
-
- 当前 bpmax-cli typed adapter
|
|
10
|
+
- 当前 bpmax-cli typed adapter 支持数据集字段的 `dataset-field export/lint/build/submit/create/delete/verify`,编辑提交路径为 huanpingtong `/api/data_set_field/:id`,新建提交路径为 huanpingtong `/api/data_set_field`,删除路径为 huanpingtong `/api/data_set_field/:id`,均代理到 bpmax-server 运行态接口。不得把旧脚本、raw API、页面 fetch 当作替代提交路径。
|
|
11
11
|
- 旧来源脚本 `scripts/submit*.py` 只保留为结构参考,默认会硬失败;不得用它们直调 BPMAX API。
|
|
12
12
|
- 不得用 `bpmax-cli api POST/PUT/DELETE /data_set_field*` 或其它 raw API 绕过 typed config submit。
|
|
13
13
|
|
|
@@ -30,7 +30,7 @@ description: "用于在 BPMAX 的数据集字段页面中创建、编辑、复
|
|
|
30
30
|
- 当前已激活配置仓库可作为远端配置镜像参考;检索现有字段模板时,优先基于该仓库的 `think_data_set_field`,不要只依赖浏览器里人工翻列表。
|
|
31
31
|
|
|
32
32
|
## Mem0 协议
|
|
33
|
-
- 开始前先调用 [$
|
|
33
|
+
- 开始前先调用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),检索词至少包含:
|
|
34
34
|
- `flow_type`
|
|
35
35
|
- `flow_key`
|
|
36
36
|
- 字段 `key` / 字段名 / 业务关键词
|
|
@@ -400,7 +400,7 @@ return JSON.parse(ctx.value);
|
|
|
400
400
|
- `classify`
|
|
401
401
|
|
|
402
402
|
### 7. 提交与回读
|
|
403
|
-
- 当前版本 `dataset-field` adapter
|
|
403
|
+
- 当前版本 `dataset-field` adapter 支持编辑、新建和删除单个字段。复制或批量生成字段必须拆分成可审查的单字段 work 文件、lint 结果和 submit payload,再通过 typed CLI 的 create/submit/delete 路径逐项执行;尚未提供批量快捷命令时,不得改用旧脚本直提。
|
|
404
404
|
|
|
405
405
|
- 旧 `submit_dataset_field.py` 只保留为结构参考,默认会硬失败;不得用它直写线上字段配置。
|
|
406
406
|
- 只有满足以下条件才允许真正执行提交请求:
|
|
@@ -7,7 +7,7 @@ description: "用于在 BPMAX 的数据集页面中创建、编辑、发布、
|
|
|
7
7
|
|
|
8
8
|
## 写入路径硬约束
|
|
9
9
|
- 执行前必须先运行 `bpmax-cli config adapters --format json` 核对 `dataset`;只有 `build_status` 和 `submit_status` 都是 `supported` 时才允许进入 build/submit。当前 typed CLI 通过 huanpingtong `/api/data_set*` 代理访问 bpmax-server `/data-set*` 运行态接口;若 adapter 显示 `blocked`,只能导出、编辑 work、lint 和形成变更建议,不得提交。
|
|
10
|
-
- 当前 bpmax-cli typed adapter
|
|
10
|
+
- 当前 bpmax-cli typed adapter 支持数据集的 `dataset export/lint/build/submit/verify`,编辑提交路径为 huanpingtong `/api/data_set/relationFields/:id`,新建提交路径为 huanpingtong `/api/data_set`,均代理到 bpmax-server 运行态接口。发布、暂停、取消刷新和索引刷新仍未纳入 typed adapter,不得把旧脚本、raw API、页面 fetch 当作替代提交路径。
|
|
11
11
|
- 旧来源脚本 `scripts/submit*.py` 只保留为结构参考,默认会硬失败;不得用它们直调 BPMAX API。
|
|
12
12
|
- 不得用 `bpmax-cli api POST/PUT/DELETE /data_set*` 或其它 raw API 绕过 typed config submit。
|
|
13
13
|
|
|
@@ -29,7 +29,7 @@ description: "用于在 BPMAX 的数据集页面中创建、编辑、发布、
|
|
|
29
29
|
- 当前已激活配置仓库可作为远端配置镜像参考;检索现有数据集模板时,优先基于该仓库的 `think_data_set` 和 `think_data_set_field`,不要只依赖浏览器里人工翻列表。
|
|
30
30
|
|
|
31
31
|
## Mem0 协议
|
|
32
|
-
- 开始前先调用 [$
|
|
32
|
+
- 开始前先调用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),检索词至少包含:
|
|
33
33
|
- `flow_type`
|
|
34
34
|
- `flow_key`
|
|
35
35
|
- 数据集名 / `custom_key`
|
|
@@ -501,7 +501,7 @@ export BPMAX_BASE_URL='https://<your-bpmax-host>'
|
|
|
501
501
|
- 如果没有变化,优先改走“新建正确数据集 + 迁移引用”的方案
|
|
502
502
|
|
|
503
503
|
### 6. 提交方式
|
|
504
|
-
- 当前版本只允许通过 typed CLI
|
|
504
|
+
- 当前版本只允许通过 typed CLI 创建或编辑 dataset 配置。`bpmax-cli config dataset submit` 在 `mode=create` 时使用 `/api/data_set` 新建,在编辑时使用 `/api/data_set/relationFields/:id` 更新数据集基础信息和字段关联;页面同域 `fetch`、页面 `$axios`、终端 `curl` 只能用于读取、抓契约或验证,不能作为提交主路径。
|
|
505
505
|
- 默认本地闭环顺序:
|
|
506
506
|
1. `export_dataset.py`
|
|
507
507
|
2. 必要时 `basic_table_audit.py` / `scan_custom_key_references.py`
|
|
@@ -11,6 +11,7 @@ description: "用于按 BPMAX 完整流程配置需求先调研、再出计划
|
|
|
11
11
|
- 只有用户明确要求的 `requested`,或为闭合需求不可避免的 `required-collateral`,才允许进入 work / submit / 线上 payload / 状态变更。
|
|
12
12
|
- `required-collateral` 必须逐项解释“不改会坏/会失真/会不闭合”的原因并取得确认;`out-of-scope` 一律不得提交或顺手混入。
|
|
13
13
|
- 不得以历史脏配置、顺手修复、统一风格、编辑器自动补字段、方便调试为理由修改需求外配置。
|
|
14
|
+
- 所有远端写入必须走 `bpmax-cli config ...` typed adapter。没有相关流程且用户要求创建时,优先评估 `config flow-app create`;如果当前 profile 缺 `config.flow_app.create`、`config.form_template.create`、`config.flow_template.create` 或 `config.workspace_flow.submit`,必须停止并要求补授权/升级 CLI,不得改用 raw API、页面 fetch 或旧 submit 脚本。
|
|
14
15
|
|
|
15
16
|
## 何时使用
|
|
16
17
|
- 用户要做一整套 BPMAX 流程相关配置,而不是单改某一个模板。
|
|
@@ -31,7 +32,17 @@ description: "用于按 BPMAX 完整流程配置需求先调研、再出计划
|
|
|
31
32
|
- 不直接开始执行。先把流程需求讲清楚,再把本次要做的配置面讲清楚,再看是否还缺高影响信息。
|
|
32
33
|
- 浏览器实时页面、实时接口返回、当前页面真实请求骨架优先级高于本地 `think_*` 配置镜像;本地仓库只作为候选检索和结构参考。
|
|
33
34
|
- 每完成一个配置面,默认先做该页面的浏览器侧回读验收,再进入下一面;不要把上一步的陈旧草稿或本地镜像误当成当前线上事实继续往下串。
|
|
34
|
-
-
|
|
35
|
+
- 新建主流程时必须通过 typed CLI 让平台创建流程壳,拿到 `flow<number>` 格式的真实 `flow_type` 后再继续配置;不得把业务名、测试 marker 或语义 key 拼成 `flow_type`。语义标识只能放在 `testMarker`、配置备注、测试 profile 或 metadata 中。
|
|
36
|
+
- “没有相关流程,需要创建新表单、新流程并绑定到工作区”时,默认首选端到端 typed 命令:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
bpmax-cli config flow-app create --workspace <workspace> --form-work <form-work-file> --flow-work <flow-work-file> --name <name>
|
|
40
|
+
bpmax-cli config flow-app create --workspace <workspace> --form-work <form-work-file> --flow-work <flow-work-file> --name <name> --confirm "create flow-app <name> in <workspace>"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- `flow-app create` 的 dry-run 必须展示完整 operation plan:创建表单、发布表单、创建流程壳、绑定 `data.meta.form_template=<published_id>`、保存/发布流程、绑定工作区、回读验证。缺任何关键步骤都不得确认执行。
|
|
44
|
+
- `flow-app create` 的 flow work 必须预置表单驱动发起默认基线:隐藏 `project.name` / `project.brief` / `project.plan_end_time`,启用 `meta.use_template_project_name = true`,并提供非空 `meta.project_name_template`。这是 typed CLI 写入前 gate,不是可选建议。
|
|
45
|
+
- 工作区绑定必须走 `PUT /workspace/workspace_flow` typed adapter,并在 `/workspace/by_key?key=<workspace>` 回读中确认新 `(flow_type, flow_key)` 存在。回读失败时不能宣布创建成功。
|
|
35
46
|
- 若用户选择“完整流程配置”,默认依次评估:
|
|
36
47
|
- 流程
|
|
37
48
|
- 表单
|
|
@@ -45,7 +56,7 @@ description: "用于按 BPMAX 完整流程配置需求先调研、再出计划
|
|
|
45
56
|
- 若首次同步因本地脏工作区失败,默认下一步尝试追加 `--allow-dirty` 重试;若重试任一步失败,立即停下并向用户说明冲突点,由用户决定是否继续。
|
|
46
57
|
|
|
47
58
|
## Mem0 协议
|
|
48
|
-
- 编排开始前先调用 [$
|
|
59
|
+
- 编排开始前先调用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),检索词至少包含:
|
|
49
60
|
- 业务名 / 流程名
|
|
50
61
|
- `flow_type`
|
|
51
62
|
- `flow_key`
|
|
@@ -89,6 +100,11 @@ description: "用于按 BPMAX 完整流程配置需求先调研、再出计划
|
|
|
89
100
|
- 导航配置
|
|
90
101
|
- 如果用户说“全部都做”,按完整流程配置处理。
|
|
91
102
|
- 如果用户只做一部分,只编排对应子 skill,不强行扩展到其他无关面。
|
|
103
|
+
- 如果用户要求“没有就新建”,计划中必须显式写出:
|
|
104
|
+
- 是否先检索并复用已有表单/流程
|
|
105
|
+
- 若没有可复用对象,是否使用 `flow-app create`
|
|
106
|
+
- 目标工作区绑定是否属于本次 `requested` 或 `required-collateral`
|
|
107
|
+
- 是否需要导航入口;没有明确要求菜单入口时,不默认写 nav-config
|
|
92
108
|
|
|
93
109
|
### 4. 补齐高影响缺口
|
|
94
110
|
- 根据用户回答,继续判断是否还缺这些高影响信息:
|
|
@@ -111,6 +127,7 @@ description: "用于按 BPMAX 完整流程配置需求先调研、再出计划
|
|
|
111
127
|
- 哪些子 skill 会被调用
|
|
112
128
|
- 哪些页面必须先在浏览器中打开
|
|
113
129
|
- 哪些地方以浏览器实时配置为准
|
|
130
|
+
- 新建场景使用哪个 typed create 命令、确认文本是什么、失败后停止在哪一步
|
|
114
131
|
|
|
115
132
|
### 6. 计划后的执行编排
|
|
116
133
|
- 用户切出计划模式并要求继续后,由同一个 skill 按计划推进。
|
|
@@ -126,6 +143,11 @@ description: "用于按 BPMAX 完整流程配置需求先调研、再出计划
|
|
|
126
143
|
- 最新配置同步:[$bpmax-config-latest](../bpmax-config-latest/SKILL.md)
|
|
127
144
|
- 若流程或表单需求依赖控件能力判断,先用 [$form-control-library](../form-control-library/SKILL.md)。
|
|
128
145
|
- 若某一步要求浏览器已打开特定页面,而当前页面不对,必须先让用户打开到正确页面,不要盲目继续。
|
|
146
|
+
- `flow-app create` 完成后,必须再执行工作区视角的只读验证:
|
|
147
|
+
- `bpmax-cli flow list --workspace <workspace> --format json`
|
|
148
|
+
- 结果中应能看到新建流程
|
|
149
|
+
- 打开目标工作区创建页确认表单加载
|
|
150
|
+
- 浏览器中表单如果打不开、空白或创建页报错,必须优先检查 Console 和 Network;如果错误指向 `form_template`、控件脚本、字段 schema 或表单模板发布态 ID,优先回到表单模板修复,不要先改流程或导航。
|
|
129
151
|
- 阶段性完成或被打断时,写一条 `session_state`,保证下轮能从当前编排状态继续。
|
|
130
152
|
|
|
131
153
|
## 停机点
|
|
@@ -134,6 +156,10 @@ description: "用于按 BPMAX 完整流程配置需求先调研、再出计划
|
|
|
134
156
|
- 缺少关键浏览器页面,且当前步骤无法脱离页面完成。
|
|
135
157
|
- 浏览器实时返回与本地镜像或既有假设严重冲突,需要用户确认线上事实为准。
|
|
136
158
|
- `bpmax-cli config latest pull <env>` 在正常执行和 `--allow-dirty` 重试后仍失败。
|
|
159
|
+
- 新建能力缺失:`config.flow_app.create`、`config.form_template.create`、`config.flow_template.create` 或 `config.workspace_flow.submit` 未授权/未发布到当前 CLI。
|
|
160
|
+
- `flow-app create` 任一步失败,必须停止并输出已创建资源、下一步恢复命令或清理建议;不得继续补 raw API。
|
|
161
|
+
- 工作区绑定回读缺失目标 `(flow_type, flow_key)`。
|
|
162
|
+
- 创建页表单打不开且 Console/Network 指向表单模板错误。
|
|
137
163
|
|
|
138
164
|
## 输出要求
|
|
139
165
|
- 在计划阶段,先输出:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "bpmax-e2e-flow-test-operator"
|
|
3
|
-
description: "用于在 BPMAX 中做全链路流程测试、场景回归、前置数据准备、失败复测和测试文档沉淀。只要用户提到“全链路测试”“端到端回归”“跑场景”“准备测试数据”“继续上次测试”“验证流程是否真正生效”“回归某条 BPMAX 流程”或等价表达,就应使用这个 skill。它默认先查 [$
|
|
3
|
+
description: "用于在 BPMAX 中做全链路流程测试、场景回归、前置数据准备、失败复测和测试文档沉淀。只要用户提到“全链路测试”“端到端回归”“跑场景”“准备测试数据”“继续上次测试”“验证流程是否真正生效”“回归某条 BPMAX 流程”或等价表达,就应使用这个 skill。它默认先查 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md) 和记忆状态,再最小化加载相关 BPMAX skill,优先复用 `.codex/skills/bpmax-e2e-flow-test-operator/scripts/` 里的状态脚本和文档脚本,尽量减少重复推理、重复试错和 token 消耗。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# BPMAX E2E Flow Test Operator
|
|
@@ -19,10 +19,12 @@ description: "用于在 BPMAX 中做全链路流程测试、场景回归、前
|
|
|
19
19
|
- 用户要延续上一次 BPMAX 测试,而不希望重新解释全部上下文。
|
|
20
20
|
|
|
21
21
|
## 核心原则
|
|
22
|
-
- 开始前先查 [$
|
|
22
|
+
- 开始前先查 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),不要直接重复试错。
|
|
23
23
|
- 浏览器实时页面、实时接口返回、最新 live/draft 配置优先于本地镜像。
|
|
24
24
|
- 若用户要求“线上跑完整链路”“真实验证用户路径”或等价目标,必须在真实运行页面完成发起、填单、选择、提交、审批、驳回、回退等关键动作;不得用脚本、控制台、手改 request body 或接口直调绕过界面。
|
|
25
|
+
- 浏览器 E2E 中如果发起页、审批页或详情页的表单打不开、白屏、字段不渲染、按钮不可用,第一步必须检查浏览器 Console 和 Network 里的真实报错;优先解决 `form_template` 加载、表单控件渲染、`lambda`、`customeValidate`、`sub_form` 绑定等表单模板相关错误,再排查流程、权限、数据或缓存问题。
|
|
25
26
|
- 只有在用户明确确认接受“非页面路径”后,才可以用脚本代替真实页面操作;确认前,脚本最多只用于摸底、状态记录、接口回读、证据补充和首次抓请求骨架,不得直接当成线上链路测试结论。
|
|
27
|
+
- 浏览器 E2E 涉及多角色时,使用 [$bpmax-user-mock-operator](../bpmax-user-mock-operator/SKILL.md) 切换当前浏览器身份;该能力只用于浏览器页面测试,不用于 API Key 冒充或 CLI 业务命令身份切换。
|
|
26
28
|
- 测试 H5 界面时,必须打开 `/m/#/...` H5 路由,并把页面可视区域(viewport)设置为 `412x844`;只允许调整页面 viewport,不要修改 Chrome/浏览器整个窗口的外层尺寸。
|
|
27
29
|
- 默认按“线上完整链路页面优先 / 非完整链路接口优先”分层推进:
|
|
28
30
|
- 线上完整链路:页面优先,必须走真实运行页真实操作;接口与脚本只做辅助,不替代用户路径
|
|
@@ -46,6 +48,7 @@ description: "用于在 BPMAX 中做全链路流程测试、场景回归、前
|
|
|
46
48
|
- [$bpmax-filter-template-editor](../bpmax-filter-template-editor/SKILL.md)
|
|
47
49
|
- [$bpmax-nav-config-editor](../bpmax-nav-config-editor/SKILL.md)
|
|
48
50
|
- [$form-control-library](../form-control-library/SKILL.md)
|
|
51
|
+
- [$bpmax-user-mock-operator](../bpmax-user-mock-operator/SKILL.md)
|
|
49
52
|
- [$feishu-doc-ops](/Users/yanghanwen/.codex/skills/feishu-doc-ops/SKILL.md)
|
|
50
53
|
- 优先把测试过程写入本地状态文件,而不是在对话里反复长篇复述。
|
|
51
54
|
- 每发现一个“可复现、可复用”的坑,优先更新对应来源 skill 的 `references/`,不要只记在当前会话里。
|
|
@@ -69,7 +72,7 @@ description: "用于在 BPMAX 中做全链路流程测试、场景回归、前
|
|
|
69
72
|
## 最小工作流
|
|
70
73
|
|
|
71
74
|
### 1. 先查记忆
|
|
72
|
-
- 任务开始前,先用 [$
|
|
75
|
+
- 任务开始前,先用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md) 搜索:
|
|
73
76
|
- 业务名
|
|
74
77
|
- `flow_type`
|
|
75
78
|
- 关联 `form_template` / `data_set` / `flow_page_template`
|
|
@@ -98,6 +101,26 @@ description: "用于在 BPMAX 中做全链路流程测试、场景回归、前
|
|
|
98
101
|
- 预期自动联动的项目类型
|
|
99
102
|
- 若发现依赖数据不足,优先补数据或重造样本,再开始场景;不要把“缺前置数据”误判成流程故障。
|
|
100
103
|
|
|
104
|
+
### 1.6 多角色浏览器身份切换
|
|
105
|
+
- 这一节只适用于浏览器 E2E 页面测试。不要把模拟用户身份用于 API Key、CLI 远端命令或非页面路径结论。
|
|
106
|
+
- 多角色场景必须先列出角色矩阵:
|
|
107
|
+
- 原始管理账号
|
|
108
|
+
- 目标角色
|
|
109
|
+
- 目标用户 id / 用户名
|
|
110
|
+
- 该角色要完成的浏览器动作
|
|
111
|
+
- 预期可见入口、按钮、表单或审批权限
|
|
112
|
+
- 切换角色时调用 [$bpmax-user-mock-operator](../bpmax-user-mock-operator/SKILL.md),然后必须验证当前身份:
|
|
113
|
+
- 优先调用 `/api/user/current` 或刷新页面确认当前用户名/头像/权限入口
|
|
114
|
+
- 验证失败时不得继续执行该角色的浏览器步骤
|
|
115
|
+
- 完成该角色动作后,记录:
|
|
116
|
+
- role
|
|
117
|
+
- target_user_id / target_user_name
|
|
118
|
+
- mocked 状态
|
|
119
|
+
- workspace
|
|
120
|
+
- 页面截图或关键 UI 证据
|
|
121
|
+
- project_id / step_id 等运行时样本
|
|
122
|
+
- 测试结束必须执行 unmock,并刷新页面验证恢复原始管理账号身份;没有完成恢复验证,不得结束多角色 E2E。
|
|
123
|
+
|
|
101
124
|
### 2. 初始化本地测试状态
|
|
102
125
|
- 用脚本初始化或续写测试状态:
|
|
103
126
|
|
|
@@ -31,3 +31,11 @@
|
|
|
31
31
|
|
|
32
32
|
原因:
|
|
33
33
|
- skill 已明确:凡是报告写“页面真实结果”,都必须有截图证据
|
|
34
|
+
|
|
35
|
+
## 5. 多角色身份切换与恢复
|
|
36
|
+
- 需要以发起人、审批人、查看人等不同用户身份验证页面行为时,必须在浏览器会话里完成 mock/unmock。
|
|
37
|
+
- mock 后必须刷新或调用 `/api/user/current` 验证当前身份。
|
|
38
|
+
- unmock 后必须验证已经恢复原始管理账号身份。
|
|
39
|
+
|
|
40
|
+
原因:
|
|
41
|
+
- 多角色结论证明的是“真实用户在页面里能否看见并完成动作”,不能只用接口调用成功替代。
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
1. 查记忆
|
|
6
6
|
2. 读当前 live/draft 与浏览器页
|
|
7
7
|
3. 确认前置数据
|
|
8
|
-
4.
|
|
9
|
-
5.
|
|
10
|
-
6.
|
|
11
|
-
7.
|
|
8
|
+
4. 若场景涉及多角色,先完成浏览器身份切换并验证当前身份
|
|
9
|
+
5. 执行场景
|
|
10
|
+
6. 记录样本 ID、关键接口、当前环节、业务字段、当前角色
|
|
11
|
+
7. 判定 `pass / fail / blocked`
|
|
12
|
+
8. 多角色场景结束后执行 unmock 并验证恢复原始身份
|
|
13
|
+
9. 如果失败,修最小问题后立刻复测当前场景
|
|
12
14
|
|
|
13
15
|
判定优先级:
|
|
14
16
|
- 运行时真实行为
|
|
@@ -17,3 +19,6 @@
|
|
|
17
19
|
- 编辑器草稿
|
|
18
20
|
- 本地镜像
|
|
19
21
|
|
|
22
|
+
多角色场景额外要求:
|
|
23
|
+
- 未验证当前浏览器身份,不得判定该角色场景通过
|
|
24
|
+
- 未恢复原始身份,不得结束本轮浏览器 E2E
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
- `endpoint_calls`
|
|
16
16
|
- `browser_only_steps`
|
|
17
17
|
- `runtime_bindings`
|
|
18
|
+
- `identity_steps`
|
|
19
|
+
- `role_contexts`
|
|
20
|
+
- `identity_cleanup`
|
|
18
21
|
- `next_step`
|
|
19
22
|
- `updated_at`
|
|
20
23
|
|
|
@@ -52,6 +55,28 @@
|
|
|
52
55
|
- `title`
|
|
53
56
|
- `reason`
|
|
54
57
|
|
|
58
|
+
`identity_steps` 每项建议包含:
|
|
59
|
+
- `role`
|
|
60
|
+
- `action`: `mock | verify | unmock`
|
|
61
|
+
- `target_user_id`
|
|
62
|
+
- `target_user_name`
|
|
63
|
+
- `workspace`
|
|
64
|
+
- `status`
|
|
65
|
+
- `evidence`
|
|
66
|
+
|
|
67
|
+
`role_contexts` 每项建议包含:
|
|
68
|
+
- `role`
|
|
69
|
+
- `user_id`
|
|
70
|
+
- `user_name`
|
|
71
|
+
- `expected_actions`
|
|
72
|
+
- `expected_visibility`
|
|
73
|
+
|
|
74
|
+
`identity_cleanup` 建议保存:
|
|
75
|
+
- `unmock_done`
|
|
76
|
+
- `restored_user`
|
|
77
|
+
- `verified_at`
|
|
78
|
+
- `evidence`
|
|
79
|
+
|
|
55
80
|
`runtime_bindings` 建议保存:
|
|
56
81
|
- 最近创建的项目 ID
|
|
57
82
|
- 最近回读的项目 ID
|
|
@@ -65,6 +65,32 @@ def main():
|
|
|
65
65
|
lines.append(f"- {item.get('title', '')}")
|
|
66
66
|
if item.get("reason"):
|
|
67
67
|
lines.append(f" - {item['reason']}")
|
|
68
|
+
if state.get("identity_steps") or state.get("role_contexts"):
|
|
69
|
+
lines.append("")
|
|
70
|
+
lines.append("### 2.5 多角色浏览器身份")
|
|
71
|
+
if state.get("role_contexts"):
|
|
72
|
+
lines.append("- 角色矩阵:")
|
|
73
|
+
for item in state.get("role_contexts", []):
|
|
74
|
+
lines.append(
|
|
75
|
+
f" - `{item.get('role', '')}`: `{item.get('user_name', '')}` / `{item.get('user_id', '')}`"
|
|
76
|
+
)
|
|
77
|
+
if item.get("expected_actions"):
|
|
78
|
+
lines.append(f" - 动作:{item['expected_actions']}")
|
|
79
|
+
if state.get("identity_steps"):
|
|
80
|
+
lines.append("- 身份切换记录:")
|
|
81
|
+
for item in state.get("identity_steps", []):
|
|
82
|
+
lines.append(
|
|
83
|
+
f" - `{item.get('action', '')}` `{item.get('role', '')}` "
|
|
84
|
+
f"`{item.get('target_user_id', '')}`: `{item.get('status', '')}`"
|
|
85
|
+
)
|
|
86
|
+
if item.get("evidence"):
|
|
87
|
+
lines.append(f" - 证据:{item['evidence']}")
|
|
88
|
+
if state.get("identity_cleanup"):
|
|
89
|
+
cleanup = state["identity_cleanup"]
|
|
90
|
+
lines.append(
|
|
91
|
+
f"- 恢复原始身份:`{cleanup.get('unmock_done', False)}`,"
|
|
92
|
+
f"当前账号:`{cleanup.get('restored_user', '')}`"
|
|
93
|
+
)
|
|
68
94
|
lines.append("")
|
|
69
95
|
lines.append("## 3. 给测试人员的操作手册")
|
|
70
96
|
lines.append("### 3.1 前置数据")
|
|
@@ -36,7 +36,7 @@ description: "用于在 BPMAX 的筛选器模板页面中创建、编辑、切
|
|
|
36
36
|
- 当前已激活配置仓库可作为远端配置镜像参考;检索现有筛选器模板时,优先基于该仓库的 `think_flow_page_template` 和 `think_flow`,不要只依赖浏览器里人工翻列表。
|
|
37
37
|
|
|
38
38
|
## Mem0 协议
|
|
39
|
-
- 开始前先调用 [$
|
|
39
|
+
- 开始前先调用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),检索词至少包含:
|
|
40
40
|
- `flow_type`
|
|
41
41
|
- `flow_key`
|
|
42
42
|
- 模板 `id` / 模板名
|
|
@@ -7,7 +7,8 @@ description: "用于在 BPMAX 流程编辑器中创建和编辑流程模板。
|
|
|
7
7
|
|
|
8
8
|
## 写入路径硬约束
|
|
9
9
|
- 执行前必须先运行 `bpmax-cli config adapters --format json` 核对 `flow-template`;只有 `build_status` 和 `submit_status` 都是 `supported` 时才允许进入 build/submit。当前若显示 `blocked`,只能导出、编辑 work、lint 和形成变更建议,不得提交。
|
|
10
|
-
- 在 bpmax-cli npm 分发包中,真实远端写操作只能走 `bpmax-cli config flow-template submit`。
|
|
10
|
+
- 在 bpmax-cli npm 分发包中,真实远端写操作只能走 typed CLI:编辑已有流程走 `bpmax-cli config flow-template submit`,新建主流程走 `bpmax-cli config flow-template create`。
|
|
11
|
+
- 新建主流程前必须确认当前 profile 具备 `config.flow_template.create`,且 `config adapters` 的 `flow-template.write_endpoints` 包含 `POST /api/flow/flow_type`。缺任一项就停止,不得改用 raw API、页面 fetch 或旧 submit 脚本。
|
|
11
12
|
- 旧来源脚本 `scripts/submit*.py` 只保留为结构参考,默认会硬失败;不得用它们直调 BPMAX API。
|
|
12
13
|
- 不得用 `bpmax-cli api POST/PUT/DELETE /flow*` 或其它 raw API 绕过 typed config submit。
|
|
13
14
|
|
|
@@ -34,7 +35,7 @@ export BPMAX_BASE_URL='https://<your-bpmax-host>'
|
|
|
34
35
|
- `BPMAX_BASE_URL` 只能取当前浏览器页面 origin,或最近一次同域请求的 origin;不要写死任何项目环境域名。
|
|
35
36
|
|
|
36
37
|
## Mem0 协议
|
|
37
|
-
- 开始前先调用 [$
|
|
38
|
+
- 开始前先调用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),检索词至少包含:
|
|
38
39
|
- 流程名 / 业务名
|
|
39
40
|
- `flow_type`
|
|
40
41
|
- `flow_key`
|
|
@@ -65,7 +66,8 @@ export BPMAX_BASE_URL='https://<your-bpmax-host>'
|
|
|
65
66
|
- 脚本回填前,必须按统一可读模式处理:抽取到 `scripts/<stem>/`,局部修改,再去除换行和多余缩进(保留语义,不做不可读压缩 / 混淆),最后写回 `work/<stem>.json` 对应字段。
|
|
66
67
|
- 对脚本字段的改动默认要求“最小 diff”:优先 patch 既有逻辑,不做无关变量改名、风格重排或整体重构。
|
|
67
68
|
- 提交前必须先通过 lint 合法性检查;至少包括结构 lint 与语义 lint,任一失败都不得提交。
|
|
68
|
-
- 线上模板引用硬门禁:`data.meta.form_template`、`data.meta.table_list_template`、`data.meta.table_filter_template`、`data.meta.step_detail_id`、`data.nodes[].form_template`、`data.nodes[].step_detail_id` 只允许当前环境远端数字 `id`;只要出现本地 `uuid` / 目录引用,即使原始线上草稿里已存在,也不得通过 `--allow-preexisting-lint-errors` 豁免。
|
|
69
|
+
- 线上模板引用硬门禁:`meta_form_id`、`data.meta.form_template`、`data.meta.table_list_template`、`data.meta.table_filter_template`、`data.meta.step_detail_id`、`data.nodes[].form_template`、`data.nodes[].step_detail_id` 只允许当前环境远端数字 `id`;只要出现本地 `uuid` / 目录引用,即使原始线上草稿里已存在,也不得通过 `--allow-preexisting-lint-errors` 豁免。
|
|
70
|
+
- typed CLI 主路径已覆盖同一硬门禁:`config flow-template lint/build/submit/create` 和 `config flow-app create` 都会在写入前阻断本地 `uuid`、目录引用或非数字的表单模板、列表模板、筛选器模板、环节详情模板引用。
|
|
69
71
|
- 脚本类查询硬门禁:凡是流程脚本或模板表达式里出现 ES dataset 相关查询,不得把 `data_set_id` 当查询入口;一经命中直接阻断提交。
|
|
70
72
|
- 脚本类查询默认口径:
|
|
71
73
|
- 前端表达式默认优先 `raw-es-search`
|
|
@@ -93,6 +95,7 @@ export BPMAX_BASE_URL='https://<your-bpmax-host>'
|
|
|
93
95
|
- 若需求涉及“环节填写表单”“审批时展示表单”“节点挂表单”,默认优先检查 `node.form_template`;不要把右侧面板里的“关联表单”文案误判成 `enable_relate_project_form`。
|
|
94
96
|
- 若需求涉及“环节详情模板”“开始+填写表单”“环节模板统一”,默认优先检查 `node.step_detail_id`;不要把本地配置仓库里的模板 `uuid` 直接写进线上 `/api/flow`,线上真实落盘通常是远端数字 `id`。
|
|
95
97
|
- 若流程属于“表单驱动发起”,默认把系统项目字段隐藏掉,并使用表单字段生成项目名称模板;除非用户明确要求保留系统项目名称/说明/计划完成时间字段。
|
|
98
|
+
- CLI gate 已硬性覆盖表单驱动新建流程:`flow-template create` 若声明 `data.meta.form_template`,以及 `flow-app create` 的所有新建流程,都必须让 `data.meta.hide_fields` 包含 `project.name` / `project.brief` / `project.plan_end_time`,同时设置 `meta.use_template_project_name = true` 和非空 `meta.project_name_template`;缺任一项会在 typed CLI 写入前阻断。
|
|
96
99
|
- 若用户是在配置“流程创建页”且没有明确指定打开方式,默认设置为整页模式;当前环境默认基线优先写成 `meta.project_create_mode = "standard"` 且 `meta.project_create_standard_mode = "page"`。
|
|
97
100
|
- 若用户没有明确说明环节负责人分配方式,默认优先配置为“项目负责人”,不要留空。
|
|
98
101
|
- 创建或修改流程时,必须系统检查脚本位点,不只看节点结构和流转前处理脚本;凡是字段、表单 key、团队/角色语义发生变化,都要同步检查受影响脚本。
|
|
@@ -128,7 +131,7 @@ export BPMAX_BASE_URL='https://<your-bpmax-host>'
|
|
|
128
131
|
- 对“批量改流程级开关”“只改创建模式/导入导出显隐”这类需求,默认只做 `data.meta` 差量修改;不要顺手重建节点、group 或页面模板引用。
|
|
129
132
|
- 用户目标若是“改完立即做真实回测”,默认基线优先取已发布 live 流程,不优先沿用线上已有草稿;避免把历史草稿脏改动一起带入新提交。
|
|
130
133
|
- 若本轮目标是修 live 流程并马上在线验证运行效果,不能停在“保存草稿”就去测;必须先把已确认的草稿正式发布,再用发布后的新样本复测。只有“纯编辑校对、暂不验证运行态”场景,才允许只保存草稿不发布。
|
|
131
|
-
-
|
|
134
|
+
- 若要发布主流程到 live,必须通过 typed CLI 的 `--publish-live` 路径执行;页面运行时 `FlowEditorDark.getSubmitData()` 只用于只读核对请求体骨架,不能据此手动调用 `PUT /api/flow`。
|
|
132
135
|
- 如果 `GET /api/flow` 在当前环境返回空壳、残缺数据或与编辑器显示不一致,优先改从页面运行时 `FlowEditorDark` 实例读取 `flowTypeKey`、`flowTypeName`、`updateTime` 和 `getSubmitData()`,不要继续猜接口返回结构。
|
|
133
136
|
- 当前页面已验证:`FlowEditorDark.getSubmitData()` 返回的是裸 `data` 骨架,不包含顶层 `name`;`name` / `updateTime` / `flowTypeKey` 需要从编辑器实例字段补齐。
|
|
134
137
|
- 当前环境已验证:当 `draft=1` 接口空壳且退回 `runtime_fallback` 时,导出脚本应继续从已发布 live `/api/flow` 补齐 `name` 和 `updateTime`,否则后续提交会因为缺少顶层字段而失真。
|
|
@@ -366,7 +369,7 @@ export BPMAX_BASE_URL='https://<your-bpmax-host>'
|
|
|
366
369
|
- 当前流程名称
|
|
367
370
|
|
|
368
371
|
### 3. 获取授权上下文
|
|
369
|
-
- 页面上下文只用于只读检查、运行态观察、抓取真实写契约和最终验收;真实远端写入必须回到 `bpmax-cli config flow-template submit`。
|
|
372
|
+
- 页面上下文只用于只读检查、运行态观察、抓取真实写契约和最终验收;真实远端写入必须回到 typed CLI。编辑走 `bpmax-cli config flow-template submit`,新建主流程走 `bpmax-cli config flow-template create`。
|
|
370
373
|
- 必要时读取:
|
|
371
374
|
- `document.cookie`
|
|
372
375
|
- `localStorage`
|
|
@@ -376,13 +379,17 @@ export BPMAX_BASE_URL='https://<your-bpmax-host>'
|
|
|
376
379
|
|
|
377
380
|
### 4. 识别创建还是编辑
|
|
378
381
|
- 如果用户是在一个现成流程上修改,按“编辑现有流程”处理。
|
|
379
|
-
-
|
|
380
|
-
1.
|
|
381
|
-
2.
|
|
382
|
-
3. `PUT /flow?flow_type=<
|
|
382
|
+
- 如果用户要新建主流程模板,按 typed CLI 创建链路执行:
|
|
383
|
+
1. 准备 flow work 文件,但不得手写语义化 `flow_type`
|
|
384
|
+
2. 先 dry-run:`bpmax-cli config flow-template create --work <work-file>`
|
|
385
|
+
3. 确认 operation plan 包含 `POST /flow/flow_type` 与 `PUT /flow?flow_type=<platform-flow-type>&publish=2`
|
|
386
|
+
4. 用户确认后执行:`bpmax-cli config flow-template create --work <work-file> --confirm "create flow-template <name>"`
|
|
387
|
+
5. CLI 必须从平台返回中取得 `flow<number>`,再保存草稿或按需 `--publish-live`
|
|
388
|
+
6. 如果 CLI 返回的不是 `flow<number>`,或 work 文件里出现自造主流程 `flow_type`,立即停止
|
|
383
389
|
- 如果用户要新建子流程,按子流程链路处理:
|
|
384
390
|
1. `POST /flow/sub`
|
|
385
391
|
2. `PUT /flow?key=<subKey>&publish=2`
|
|
392
|
+
- 当前 typed CLI 尚未补齐子流程 create 时,不得用 raw API 绕过;必须停止并说明缺少 typed 子流程 create 能力。
|
|
386
393
|
|
|
387
394
|
### 5. 读取当前远端数据
|
|
388
395
|
- 刷新或初始化时,优先拉草稿版本:
|
|
@@ -792,6 +799,7 @@ export BPMAX_BASE_URL='https://<your-bpmax-host>'
|
|
|
792
799
|
|
|
793
800
|
### 子流程创建
|
|
794
801
|
- `POST /flow/sub`
|
|
802
|
+
- 这是接口事实,不是执行许可;当前 CLI 若没有 typed 子流程 create 命令,必须停止,不能用 raw API 或页面 fetch 执行。
|
|
795
803
|
|
|
796
804
|
### 子流程保存草稿
|
|
797
805
|
- `PUT /flow?key=<key>&publish=2`
|
|
@@ -1036,8 +1044,15 @@ bpmax-cli config flow-template submit --id <id> --payload .codex/tmp/flow-templa
|
|
|
1036
1044
|
bpmax-cli config flow-template verify --id <id> --expect .codex/tmp/flow-template-editor/work/<file>.json
|
|
1037
1045
|
```
|
|
1038
1046
|
|
|
1047
|
+
新建主流程模板时使用 create 入口,不能通过 submit 自造 `flow_type`:
|
|
1048
|
+
|
|
1049
|
+
```bash
|
|
1050
|
+
bpmax-cli config flow-template create --work .codex/tmp/flow-template-editor/work/<create-file>.json
|
|
1051
|
+
bpmax-cli config flow-template create --work .codex/tmp/flow-template-editor/work/<create-file>.json --confirm "create flow-template <name>"
|
|
1052
|
+
```
|
|
1053
|
+
|
|
1039
1054
|
默认 build/submit 是保存草稿。需要发布到 live 运行态时,在 `build` 或 `submit` 增加 `--publish-live`;精确确认文本仍保持 `submit flow-template <id>`。
|
|
1040
1055
|
|
|
1041
1056
|
授权前置:当前 profile 必须通过校对码授权,并在授权页开启“配置能力”。如果 CLI 返回 capability 缺失,停止并让用户使用有管理权限的账号重新授权。
|
|
1042
1057
|
|
|
1043
|
-
旧来源中的 `scripts/` 和 `references/` 只作为字段结构、lint 规则和验收规则参考;真实远端写操作必须走
|
|
1058
|
+
旧来源中的 `scripts/` 和 `references/` 只作为字段结构、lint 规则和验收规则参考;真实远端写操作必须走 typed CLI,保留 dry-run、二次确认、审计和回读验证。create 能力缺失时不得退回旧脚本、raw API 或浏览器页面内 fetch。
|