bpmax-cli 0.1.44-beta.8 → 0.1.44
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 +5 -3
- package/dist/bin.js +466 -4578
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
- package/scripts/install-skills.mjs +0 -98
- package/skills/bpmax-auth/SKILL.md +17 -6
- package/skills/bpmax-cli/SKILL.md +0 -2
- package/skills/bpmax-project/SKILL.md +2 -1
- package/skills/bpmax-shared/SKILL.md +1 -1
- package/skills/bpmax-api-platform-editor/SKILL.md +0 -321
- package/skills/bpmax-api-platform-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-api-platform-editor/references/api-doc-debug-workflow.md +0 -34
- package/skills/bpmax-api-platform-editor/references/api-proxy-shape.md +0 -41
- package/skills/bpmax-api-platform-editor/references/instance-config-shape.md +0 -41
- package/skills/bpmax-api-platform-editor/references/platform-api-map.md +0 -52
- package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +0 -32
- package/skills/bpmax-api-platform-editor/scripts/api_platform_editor_common.py +0 -1276
- package/skills/bpmax-api-platform-editor/scripts/build_submit_payload.py +0 -64
- package/skills/bpmax-api-platform-editor/scripts/capture_write_contract.py +0 -40
- package/skills/bpmax-api-platform-editor/scripts/export_layer_bundle.py +0 -212
- package/skills/bpmax-api-platform-editor/scripts/record_doc_debug_acceptance.py +0 -62
- package/skills/bpmax-api-platform-editor/scripts/submit_and_verify_layer.py +0 -75
- package/skills/bpmax-api-platform-editor/tests/test_api_platform_editor.py +0 -287
- package/skills/bpmax-builder-shared/SKILL.md +0 -44
- package/skills/bpmax-builder-shared/base_url.py +0 -81
- package/skills/bpmax-builder-shared/runtime-script-site-matrix.json +0 -71
- package/skills/bpmax-builder-shared/runtime-script-site-matrix.md +0 -34
- package/skills/bpmax-builder-shared/runtime-script-template-catalog.md +0 -123
- package/skills/bpmax-builder-shared/runtime_script_rules.py +0 -272
- package/skills/bpmax-builder-shared/skill_audit.py +0 -374
- package/skills/bpmax-builder-shared/template_script_hard_rules.py +0 -280
- package/skills/bpmax-builder-shared/tests/test_base_url.py +0 -80
- package/skills/bpmax-builder-shared/tests/test_runtime_script_rules.py +0 -115
- package/skills/bpmax-builder-shared/tests/test_skill_audit.py +0 -231
- package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +0 -281
- package/skills/bpmax-config-latest/SKILL.md +0 -71
- package/skills/bpmax-console-template-editor/SKILL.md +0 -536
- package/skills/bpmax-console-template-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-console-template-editor/references/filter-integration.md +0 -60
- package/skills/bpmax-console-template-editor/references/lessons-from-resume-dashboard.md +0 -114
- package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +0 -69
- package/skills/bpmax-console-template-editor/references/module-catalog.md +0 -100
- package/skills/bpmax-console-template-editor/references/runtime-page-shape.md +0 -91
- package/skills/bpmax-console-template-editor/references/template-shape.md +0 -149
- package/skills/bpmax-console-template-editor/scripts/build_submit_payload.py +0 -38
- package/skills/bpmax-console-template-editor/scripts/confirm_console_template.py +0 -33
- package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +0 -964
- package/skills/bpmax-console-template-editor/scripts/export_console_template.py +0 -99
- package/skills/bpmax-console-template-editor/scripts/lint_console_template.py +0 -46
- package/skills/bpmax-console-template-editor/scripts/submit_console_template.py +0 -99
- package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +0 -383
- package/skills/bpmax-dataset-field-template-editor/SKILL.md +0 -600
- package/skills/bpmax-dataset-field-template-editor/references/create-request-gotchas.md +0 -25
- package/skills/bpmax-dataset-field-template-editor/references/field-classify-mapping.md +0 -35
- package/skills/bpmax-dataset-field-template-editor/references/nested-field-patterns.md +0 -24
- package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +0 -61
- package/skills/bpmax-dataset-field-template-editor/references/virtual-field-patterns.md +0 -27
- package/skills/bpmax-dataset-field-template-editor/references/work-file-to-submit-mapping.md +0 -127
- package/skills/bpmax-dataset-field-template-editor/scripts/build_submit_payload.py +0 -67
- package/skills/bpmax-dataset-field-template-editor/scripts/confirm_dataset_field.py +0 -37
- package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +0 -784
- package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +0 -62
- package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +0 -104
- package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +0 -83
- package/skills/bpmax-dataset-field-template-editor/scripts/lint_dataset_field_semantics.py +0 -35
- package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +0 -95
- package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +0 -709
- package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +0 -59
- package/skills/bpmax-dataset-template-editor/SKILL.md +0 -779
- package/skills/bpmax-dataset-template-editor/references/custom-key-usage-patterns.md +0 -18
- package/skills/bpmax-dataset-template-editor/references/dataset-script-runtime-matrix.md +0 -73
- package/skills/bpmax-dataset-template-editor/references/pre-process-script-authoring-guide.md +0 -186
- package/skills/bpmax-dataset-template-editor/references/pre-process-script-example-catalog.md +0 -106
- package/skills/bpmax-dataset-template-editor/references/runtime-gotchas.md +0 -28
- package/skills/bpmax-dataset-template-editor/references/runtime-verified-dataset-page-shape.md +0 -47
- package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +0 -23
- package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +0 -97
- package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +0 -65
- package/skills/bpmax-dataset-template-editor/scripts/build_submit_payload.py +0 -38
- package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +0 -650
- package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +0 -155
- package/skills/bpmax-dataset-template-editor/scripts/lint_dataset_template.py +0 -42
- package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +0 -43
- package/skills/bpmax-dataset-template-editor/scripts/scan_custom_key_references.py +0 -27
- package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +0 -115
- package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +0 -52
- package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +0 -39
- package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +0 -373
- package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +0 -177
- package/skills/bpmax-e2e-flow-config-orchestrator/agents/openai.yaml +0 -4
- package/skills/bpmax-e2e-flow-config-orchestrator/references/orchestration-matrix.md +0 -60
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +0 -394
- package/skills/bpmax-e2e-flow-test-operator/agents/openai.yaml +0 -5
- package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale.json +0 -97
- package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_final_v2.json +0 -105
- package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_main.json +0 -36
- package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_region.json +0 -40
- package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +0 -41
- package/skills/bpmax-e2e-flow-test-operator/references/failure-update-loop.md +0 -17
- package/skills/bpmax-e2e-flow-test-operator/references/filter-field-discovery.md +0 -40
- package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +0 -24
- package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +0 -75
- package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +0 -107
- package/skills/bpmax-e2e-flow-test-operator/references/skill-experience-coverage-matrix.md +0 -29
- package/skills/bpmax-e2e-flow-test-operator/references/stale-runtime-and-clean-sample-rules.md +0 -54
- package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +0 -83
- package/skills/bpmax-e2e-flow-test-operator/scripts/bpmax_session.py +0 -287
- package/skills/bpmax-e2e-flow-test-operator/scripts/dealer_sample_on_shelf_plan.json +0 -59
- package/skills/bpmax-e2e-flow-test-operator/scripts/dealer_sample_on_shelf_runner.py +0 -687
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +0 -121
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +0 -288
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_api_matrix.py +0 -161
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_filter_fields.py +0 -138
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_form_runtime.py +0 -396
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +0 -341
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_test_profile.py +0 -185
- package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +0 -138
- package/skills/bpmax-feishu-chat-flow-plugin-editor/SKILL.md +0 -69
- package/skills/bpmax-feishu-chat-flow-plugin-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/config-checklist.md +0 -42
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/config-recipes.md +0 -38
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/config-shape.md +0 -86
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/gate-lint.md +0 -68
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/hoocoo-patterns.md +0 -39
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/runtime-behavior.md +0 -41
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/script-authoring.md +0 -110
- package/skills/bpmax-feishu-chat-flow-plugin-editor/scripts/lint_feishu_chat_plugin.py +0 -278
- package/skills/bpmax-feishu-chat-flow-plugin-editor/tests/test_lint_feishu_chat_plugin.py +0 -203
- package/skills/bpmax-filter-template-editor/SKILL.md +0 -564
- package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +0 -38
- package/skills/bpmax-filter-template-editor/references/filter-and-flow-binding.md +0 -57
- package/skills/bpmax-filter-template-editor/references/filter-content-schema.md +0 -141
- package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +0 -287
- package/skills/bpmax-filter-template-editor/references/filter-runtime-patterns.md +0 -115
- package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +0 -94
- package/skills/bpmax-filter-template-editor/scripts/build_submit_payload.py +0 -25
- package/skills/bpmax-filter-template-editor/scripts/confirm_filter_template.py +0 -22
- package/skills/bpmax-filter-template-editor/scripts/export_filter_template.py +0 -57
- package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +0 -348
- package/skills/bpmax-filter-template-editor/scripts/init_create_filter_template.py +0 -8
- package/skills/bpmax-filter-template-editor/scripts/lint_filter_template_semantics.py +0 -26
- package/skills/bpmax-filter-template-editor/scripts/submit_filter_template.py +0 -62
- package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +0 -231
- package/skills/bpmax-flow-template-editor/SKILL.md +0 -1058
- package/skills/bpmax-flow-template-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-flow-template-editor/references/before-next-step-script-runtime-gotchas.md +0 -62
- package/skills/bpmax-flow-template-editor/references/config-surfaces-and-placeholders.md +0 -270
- package/skills/bpmax-flow-template-editor/references/diff-strategy.md +0 -67
- package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +0 -25
- package/skills/bpmax-flow-template-editor/references/flow-template-api-workflow.md +0 -174
- package/skills/bpmax-flow-template-editor/references/intent-model.md +0 -117
- package/skills/bpmax-flow-template-editor/references/lessons-from-price-plan-flow.md +0 -147
- package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +0 -97
- package/skills/bpmax-flow-template-editor/references/matrix-flow-form-nav-collaboration.md +0 -165
- package/skills/bpmax-flow-template-editor/references/payload-checklist.md +0 -133
- package/skills/bpmax-flow-template-editor/references/project-create-runtime-gotchas.md +0 -54
- package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +0 -149
- package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +0 -41
- package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +0 -155
- package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +0 -179
- package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +0 -91
- package/skills/bpmax-flow-template-editor/references/script-review-hard-rules.md +0 -93
- package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +0 -57
- package/skills/bpmax-flow-template-editor/scripts/build_submit_payload.py +0 -69
- package/skills/bpmax-flow-template-editor/scripts/confirm_flow_template.py +0 -52
- package/skills/bpmax-flow-template-editor/scripts/export_flow_template.py +0 -114
- package/skills/bpmax-flow-template-editor/scripts/flow_template_editor_common.py +0 -1084
- package/skills/bpmax-flow-template-editor/scripts/submit_flow_template.py +0 -159
- package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +0 -636
- package/skills/bpmax-form-template-editor/SKILL.md +0 -1099
- package/skills/bpmax-form-template-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +0 -203
- package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +0 -125
- package/skills/bpmax-form-template-editor/references/payload-checklist.md +0 -77
- package/skills/bpmax-form-template-editor/references/sub-form-patterns.md +0 -49
- package/skills/bpmax-form-template-editor/scripts/build_submit_payload.py +0 -37
- package/skills/bpmax-form-template-editor/scripts/check_form_template_consistency.py +0 -145
- package/skills/bpmax-form-template-editor/scripts/confirm_form_template.py +0 -67
- package/skills/bpmax-form-template-editor/scripts/export_form_template.py +0 -91
- package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +0 -1762
- package/skills/bpmax-form-template-editor/scripts/lint_form_template_semantics.py +0 -30
- package/skills/bpmax-form-template-editor/scripts/record_runtime_acceptance.py +0 -67
- package/skills/bpmax-form-template-editor/scripts/submit_form_template.py +0 -163
- package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +0 -1292
- package/skills/bpmax-list-template-editor/SKILL.md +0 -468
- package/skills/bpmax-list-template-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-list-template-editor/references/browser-page-contract.md +0 -81
- package/skills/bpmax-list-template-editor/references/content-config-shape.md +0 -148
- package/skills/bpmax-list-template-editor/references/dataset-field-mapping.md +0 -60
- package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +0 -103
- package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +0 -102
- package/skills/bpmax-list-template-editor/references/payload-checklist.md +0 -47
- package/skills/bpmax-list-template-editor/references/runtime-verified-workflow.md +0 -140
- package/skills/bpmax-list-template-editor/references/special-formats.md +0 -394
- package/skills/bpmax-list-template-editor/scripts/build_submit_payload.py +0 -37
- package/skills/bpmax-list-template-editor/scripts/confirm_list_template.py +0 -33
- package/skills/bpmax-list-template-editor/scripts/export_list_template.py +0 -89
- package/skills/bpmax-list-template-editor/scripts/fetch_data_set.py +0 -34
- package/skills/bpmax-list-template-editor/scripts/lint_list_template_semantics.py +0 -54
- package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +0 -955
- package/skills/bpmax-list-template-editor/scripts/record_acceptance.py +0 -55
- package/skills/bpmax-list-template-editor/scripts/submit_list_template.py +0 -117
- package/skills/bpmax-list-template-editor/tests/test_list_template_editor_common.py +0 -441
- package/skills/bpmax-memory-protocol/SKILL.md +0 -72
- package/skills/bpmax-nav-config-editor/SKILL.md +0 -347
- package/skills/bpmax-nav-config-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-nav-config-editor/references/api-workflow.md +0 -68
- package/skills/bpmax-nav-config-editor/references/config-shape.md +0 -78
- package/skills/bpmax-nav-config-editor/references/icon-selection.md +0 -83
- package/skills/bpmax-nav-config-editor/references/path-mapping-rules.md +0 -46
- package/skills/bpmax-nav-config-editor/references/payload-checklist.md +0 -41
- package/skills/bpmax-nav-config-editor/references/runtime-probing.md +0 -47
- package/skills/bpmax-nav-config-editor/scripts/build_submit_payload.py +0 -34
- package/skills/bpmax-nav-config-editor/scripts/confirm_nav_config.py +0 -32
- package/skills/bpmax-nav-config-editor/scripts/export_nav_config.py +0 -56
- package/skills/bpmax-nav-config-editor/scripts/lint_nav_config_semantics.py +0 -33
- package/skills/bpmax-nav-config-editor/scripts/nav_config_editor_common.py +0 -812
- package/skills/bpmax-nav-config-editor/scripts/submit_nav_config.py +0 -44
- package/skills/bpmax-nav-config-editor/scripts/verify_nav_config.py +0 -33
- package/skills/bpmax-nav-config-editor/tests/test_nav_config_editor.py +0 -358
- package/skills/bpmax-nav-config-editor/tests/test_nav_config_editor_common.py +0 -138
- package/skills/bpmax-nav-config-editor/tests/test_nav_config_lint.py +0 -58
- package/skills/bpmax-nav-config-editor/tests/test_nav_config_submit_verify.py +0 -51
- package/skills/bpmax-project-detail-template-editor/SKILL.md +0 -329
- package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +0 -4
- package/skills/bpmax-project-detail-template-editor/references/local-temp-workflow.md +0 -59
- package/skills/bpmax-project-detail-template-editor/references/module-catalog-and-config-notes.md +0 -47
- package/skills/bpmax-project-detail-template-editor/references/payload-checklist.md +0 -33
- package/skills/bpmax-project-detail-template-editor/references/project-detail-template-api-workflow.md +0 -44
- package/skills/bpmax-project-detail-template-editor/scripts/build_submit_payload.py +0 -30
- package/skills/bpmax-project-detail-template-editor/scripts/confirm_project_detail_template.py +0 -33
- package/skills/bpmax-project-detail-template-editor/scripts/export_project_detail_template.py +0 -87
- package/skills/bpmax-project-detail-template-editor/scripts/lint_project_detail_template_semantics.py +0 -37
- package/skills/bpmax-project-detail-template-editor/scripts/project_detail_template_editor_common.py +0 -507
- package/skills/bpmax-project-detail-template-editor/scripts/submit_project_detail_template.py +0 -120
- package/skills/bpmax-project-detail-template-editor/tests/test_project_detail_template_editor.py +0 -369
- package/skills/bpmax-role-editor/SKILL.md +0 -251
- package/skills/bpmax-role-editor/references/api-workflow.md +0 -30
- package/skills/bpmax-role-editor/references/runtime-page-shape.md +0 -18
- package/skills/bpmax-role-editor/references/work-file-mapping.md +0 -32
- package/skills/bpmax-role-editor/scripts/build_submit_payload.py +0 -38
- package/skills/bpmax-role-editor/scripts/confirm_role.py +0 -33
- package/skills/bpmax-role-editor/scripts/export_role.py +0 -163
- package/skills/bpmax-role-editor/scripts/lint_role_semantics.py +0 -38
- package/skills/bpmax-role-editor/scripts/role_editor_common.py +0 -1231
- package/skills/bpmax-role-editor/scripts/submit_role.py +0 -144
- package/skills/bpmax-role-editor/tests/test_role_editor.py +0 -343
- package/skills/bpmax-user-mock-operator/SKILL.md +0 -106
- package/skills/bpmax-user-mock-operator/agents/openai.yaml +0 -4
- 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
- package/skills/form-control-library/SKILL.md +0 -82
- package/skills/form-control-library/agents/openai.yaml +0 -4
- package/skills/form-control-library/references/form-controls.md +0 -199
- package/skills/form-control-library/references/form-template-submit-schema.md +0 -180
- package/skills/form-control-library/references/group-select-runtime.md +0 -191
- package/skills/form-control-library/scripts/rebuild_form_control_library.py +0 -55
package/package.json
CHANGED
|
@@ -33,10 +33,6 @@ 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
|
-
};
|
|
40
36
|
|
|
41
37
|
const directoryTargets = [
|
|
42
38
|
{ agent: 'codex', root: path.join(homedir(), '.codex', 'skills') },
|
|
@@ -45,14 +41,6 @@ const directoryTargets = [
|
|
|
45
41
|
{ agent: 'agents', root: path.join(homedir(), '.agents', 'skills') },
|
|
46
42
|
{ agent: 'gemini', root: path.join(homedir(), '.gemini', 'skills') },
|
|
47
43
|
];
|
|
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
|
-
];
|
|
56
44
|
|
|
57
45
|
function shouldRunAdapter(adapter) {
|
|
58
46
|
return !targetAgent || targetAgent === adapter;
|
|
@@ -117,87 +105,6 @@ async function installWithDirectoryTargets(skillNames) {
|
|
|
117
105
|
};
|
|
118
106
|
}
|
|
119
107
|
|
|
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
|
-
|
|
201
108
|
async function listSkillNames() {
|
|
202
109
|
const entries = await readdir(sourceSkillsDir, { withFileTypes: true });
|
|
203
110
|
const skillNames = [];
|
|
@@ -426,7 +333,6 @@ async function main() {
|
|
|
426
333
|
await installWithOpenClawCli(skillNames),
|
|
427
334
|
await installWithAilySkillhub(skillNames),
|
|
428
335
|
];
|
|
429
|
-
const globalGuidance = await writeGlobalMemoryGuidance();
|
|
430
336
|
const installedCount = adapters.reduce((sum, item) => sum + item.installed.length + item.fallbacks.length, 0);
|
|
431
337
|
const failedCount = adapters.reduce((sum, item) => sum + item.failed.length, 0);
|
|
432
338
|
|
|
@@ -439,7 +345,6 @@ async function main() {
|
|
|
439
345
|
adapters,
|
|
440
346
|
agent: targetAgent || 'auto',
|
|
441
347
|
agent_guidance: agentGuidance,
|
|
442
|
-
global_guidance: globalGuidance,
|
|
443
348
|
message: 'No compatible local agent skill directories detected.',
|
|
444
349
|
next_action: adapters.map((item) => item.next_action).filter(Boolean).join(' '),
|
|
445
350
|
};
|
|
@@ -465,7 +370,6 @@ async function main() {
|
|
|
465
370
|
adapters,
|
|
466
371
|
agent: targetAgent || 'auto',
|
|
467
372
|
agent_guidance: agentGuidance,
|
|
468
|
-
global_guidance: globalGuidance,
|
|
469
373
|
next_action: failedCount > 0 ? 'Review failed adapter items and retry.' : '',
|
|
470
374
|
...(targetAgent === 'openclaw' ? { reminder: openClawReminder } : {}),
|
|
471
375
|
};
|
|
@@ -487,8 +391,6 @@ async function main() {
|
|
|
487
391
|
console.log(`- ${item.adapter || 'adapter'} ${item.skill}: failed (${item.stderr || item.stdout || item.error || `exit ${item.exitCode}`})`);
|
|
488
392
|
});
|
|
489
393
|
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}`));
|
|
492
394
|
}
|
|
493
395
|
return result;
|
|
494
396
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bpmax-auth
|
|
3
3
|
version: 1.0.0
|
|
4
|
-
description: Use when the user needs BPMAX device
|
|
4
|
+
description: Use when the user needs BPMAX device authorization, browser login, API key setup, auth status checks, logout, or diagnosis of browserless agent and localhost callback issues around bpmax-cli authentication.
|
|
5
5
|
metadata:
|
|
6
6
|
requires:
|
|
7
7
|
bins: ["bpmax-cli"]
|
|
@@ -11,7 +11,7 @@ metadata:
|
|
|
11
11
|
# auth
|
|
12
12
|
|
|
13
13
|
> **前置条件:** 先阅读 `../bpmax-shared/SKILL.md`。
|
|
14
|
-
> **登录约束:**
|
|
14
|
+
> **登录约束:** Agent/飞书/OpenClaw 类无浏览器环境优先使用 device flow;本地终端才使用浏览器 callback flow。
|
|
15
15
|
|
|
16
16
|
## 何时使用
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ metadata:
|
|
|
19
19
|
- 用户要登录 BPMAX
|
|
20
20
|
- 用户要检查当前 API Key 是否有效
|
|
21
21
|
- 用户要清空当前环境的登录状态
|
|
22
|
-
-
|
|
22
|
+
- 用户遇到浏览器桥接、权限不足、localhost 回调失败
|
|
23
23
|
|
|
24
24
|
## 命令
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ metadata:
|
|
|
27
27
|
bpmax-cli init --agent openclaw --channel feishu --url <BPMAX_URL> --name local --profile-scope <TRUSTED_RUNTIME_SCOPE> --format json
|
|
28
28
|
bpmax-cli --config-dir <config_dir_from_init> auth device complete --profile <profile_from_init> --session <device_code> --format json
|
|
29
29
|
bpmax-cli auth login --mode device --profile local
|
|
30
|
-
bpmax-cli auth login
|
|
30
|
+
bpmax-cli auth login
|
|
31
31
|
bpmax-cli auth status
|
|
32
32
|
bpmax-cli auth logout
|
|
33
33
|
```
|
|
@@ -39,7 +39,7 @@ bpmax-cli auth logout
|
|
|
39
39
|
- 只需要发起无浏览器授权:用 `auth device start`,把返回的 `message_card.authorization_url` 和 `message_card.user_code` 发给用户
|
|
40
40
|
- 用户确认短码后:优先执行返回的 `message_card.next_command`;不要从 `next_action` 自然语言里猜命令
|
|
41
41
|
- 后续授权状态只复制 `init` 返回的 `next_commands.auth_status`;不要自行把 profile 写成 `local`,也不要漏掉 `--config-dir`
|
|
42
|
-
-
|
|
42
|
+
- 本地终端可继续用 `auth login`
|
|
43
43
|
- 只想确认当前身份和连通性:`auth status`
|
|
44
44
|
- 只清空当前 profile 的本地 API Key:`auth logout`
|
|
45
45
|
|
|
@@ -61,9 +61,20 @@ bpmax-cli auth logout
|
|
|
61
61
|
- `authorization_pending` 代表用户还没确认,可稍后重试 `complete`
|
|
62
62
|
- `expired_token` 代表短码过期,应重新 `start`
|
|
63
63
|
|
|
64
|
+
## 浏览器 Callback 登录流程理解
|
|
65
|
+
|
|
66
|
+
`auth login` 的固定链路:
|
|
67
|
+
|
|
68
|
+
1. CLI 读取目标 profile 的 `origin`
|
|
69
|
+
2. CLI 启动本地一次性 `localhost` 回调服务
|
|
70
|
+
3. CLI 打开 `hpt-frontend` 的 CLI 登录桥接页
|
|
71
|
+
4. 页面复用 `huanpingtong-server` 现有 `/api/user_api_key` 机制获取或创建 `bpmax-cli` API Key
|
|
72
|
+
5. 页面通过 `POST /callback` 把 API Key 回传本地 CLI
|
|
73
|
+
6. CLI 校验 `state` 后落盘
|
|
74
|
+
|
|
64
75
|
## 常见问题
|
|
65
76
|
|
|
66
77
|
- 401/403:先检查 `origin`、`api_key`、当前 profile 是否正确
|
|
67
78
|
- 页面提示无权限:优先怀疑缺少 `user.api_key.manage`
|
|
68
|
-
-
|
|
79
|
+
- 浏览器已登录但 CLI 一直等待:检查本机 `localhost` 回调端口是否可达
|
|
69
80
|
- 需要切环境登录:显式传 `--profile <name>`
|
|
@@ -24,7 +24,6 @@ bpmax-cli init --agent <agent> --channel feishu --url "<BPMAX_URL>" --name local
|
|
|
24
24
|
- `init` 返回后,Agent 必须展示 `message_card.authorization_url` 和 `message_card.user_code` 给用户;用户确认短码后,逐字执行 `message_card.next_command`,不要从 `message_card.next_action` 自然语言里猜命令。
|
|
25
25
|
- `profile`、`config_dir` 的最终值只以 `init` JSON 返回为准;不要自行拼接或复用 `local`/共享 `~/.bpmax`。后续检查优先复制 `next_commands.profile_list/auth_status/bbs_list`,不要裸跑 `config profile list`、`auth status` 或 `bbs list`。
|
|
26
26
|
- 授权完成后,CLI 会基于当前 API Key 从 `huanpingtong-server` 探查可用 capability。不要假设所有命令可用;如果命令提示缺少 capability,先运行 `bpmax-cli --config-dir <config_dir> capabilities refresh --profile <profile> --format json`,仍缺失则停止并向用户说明当前账号无该 CLI 能力。
|
|
27
|
-
- 如果授权完成输出 `next_commands.config_workspace_init`,需要配置工作区时必须复制该命令并补齐 `<env>` 与 `--workspace-dir <dir>`。该命令会从 BPMAX 平台配置库读取 Git 地址和 sysconfigdiff 凭据,clone 或绑定本地 workspace,并生成 `AGENTS.md`;不要用 `config-env add` 手写配置库账号密码。
|
|
28
27
|
|
|
29
28
|
## 业务需求优先 BBS
|
|
30
29
|
|
|
@@ -38,7 +37,6 @@ bpmax-cli init --agent <agent> --channel feishu --url "<BPMAX_URL>" --name local
|
|
|
38
37
|
- 环境配置、全局参数、命令发现、原始 API 降级:先读 `../bpmax-shared/SKILL.md`
|
|
39
38
|
- 浏览器登录、API Key、认证状态:读 `../bpmax-auth/SKILL.md`
|
|
40
39
|
- 当前用户:读 `../bpmax-user/SKILL.md`
|
|
41
|
-
- 刷新配置库、同步最新配置、latest pull:读 `../bpmax-config-latest/SKILL.md`
|
|
42
40
|
- 流程列表、流程选项、流程详情:读 `../bpmax-flow/SKILL.md`
|
|
43
41
|
- 项目列表、项目详情、我的待办、最小创建:读 `../bpmax-project/SKILL.md`
|
|
44
42
|
- 环节推进、审批通过/拒绝、完成 step:读 `../bpmax-project/SKILL.md`,必须使用 `step context/actions/requirements/submit` 的安全链路
|
|
@@ -36,7 +36,7 @@ metadata:
|
|
|
36
36
|
- 不得从 `flow_type`、`flow_key`、host、workspace、路由片段重新拼接链接
|
|
37
37
|
- 不得把 CLI 输出的 URL 截断成 `.../project/create?flow_type=...`
|
|
38
38
|
- 如果最终要发送的链接与 CLI JSON 的 `url`/`pc_url` 不完全一致,停止回复链接并报告“无法生成带预填参数的创建页链接”
|
|
39
|
-
- 典型错误链接:`https://
|
|
39
|
+
- 典型错误链接:`https://yuanrongtest.yitaiyitai.com/w:oa/project/create?flow_type=flow322497069`。这种只有 `flow_type`、没有 `prefill_token` 或 `init_value` 的链接永远不能发给用户
|
|
40
40
|
|
|
41
41
|
## 安全创建流程
|
|
42
42
|
|
|
@@ -123,6 +123,7 @@ bpmax-cli step submit <step_id> --project-id <project_id> --action approve --lab
|
|
|
123
123
|
|
|
124
124
|
- 概览优先 `project list`
|
|
125
125
|
- 按候选人姓名、表单字段、流程内关键词定位项目时,优先 `project search`;该命令会走 `huanpingtong-server` 的 `/api/project/list` ES 模式,由 huanpingtong 侧 API Key 和权限上下文转发到 bpmax-server `/project/list`
|
|
126
|
+
- 全量分页扫描时,分页必须进入 `/project/list` body:新版 CLI 会把 `--page` / `--page-size` 合并为 body 中的 `page` / `page_size`;兼容旧版 CLI 时,直接把 `page` / `page_size` 写进 `--body` JSON。扫描必须记录每页项目 ID,发现连续页 ID 完全相同或 raw rows 大于 unique rows 很多时,立即判定分页可能失效,不得给出“未命中”结论。
|
|
126
127
|
- `es project-search` 只是兼容别名;新场景必须写 `project search`
|
|
127
128
|
- 不要向 `project search` 或 `es project-search` 传包含顶层 `body` 的 raw ES DTO;`huanpingtong-server` 没有公开 `/api/project/raw-es-search`,CLI 会在发请求前阻断
|
|
128
129
|
- 预算汇总、趋势分析等统计只能先使用 `/api/project/list` ES 模式能表达的查询体;确实需要 raw ES 聚合时,必须先让服务端增加明确公开接口,不能复用 `/api/project/<unknown>`
|
|
@@ -54,7 +54,7 @@ bpmax-cli auth status
|
|
|
54
54
|
- 如果当前 profile 没有可用 API Key:
|
|
55
55
|
- OpenClaw/Aily/飞书等无浏览器 Agent 场景,优先走 `bpmax-cli init --agent <agent> --channel feishu --url <BPMAX_URL> --profile-scope <TRUSTED_RUNTIME_SCOPE> --format json`
|
|
56
56
|
- Agent 多用户场景必须传 `--profile-scope <TRUSTED_RUNTIME_SCOPE>`;scope 必须来自可信 runtime metadata,不得由 LLM 猜测
|
|
57
|
-
-
|
|
57
|
+
- 本地终端场景才走 `auth login`
|
|
58
58
|
- 如果用户明确指定环境,始终显式加 `--profile <name>`
|
|
59
59
|
|
|
60
60
|
## Agent 初始化
|
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "bpmax-api-platform-editor"
|
|
3
|
-
description: "用于在 BPMAX 的系统集成页面中创建或编辑集成平台、实例配置和 API 代理配置,并通过系统 API 文档页完成标准调试闭环。只要用户提到“新建集成平台”“编辑集成平台”“编辑实例配置”“编辑接口代理”“调试系统API”“改 link_system 配置”“调试 api-docs/system_api”“构造 api_platform / api_platform_instance / api_proxy 数据”或等价表达,就应使用这个 skill。它优先复用当前浏览器登录态和真实页面请求骨架,结合本地 think_api_platform / think_api_proxy 镜像与线上页面事实,完成平台、实例、API、实体绑定相关配置的读取、修改、保存回读和文档页调试验证。"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# BPMAX API Platform Editor
|
|
7
|
-
|
|
8
|
-
## 写入路径硬约束
|
|
9
|
-
- 执行前必须先运行 `bpmax-cli config adapters --format json` 核对 `api-platform`;只有 `build_status` 和 `submit_status` 都是 `supported` 时才允许进入 build/submit。
|
|
10
|
-
- 当前 bpmax-cli typed adapter 支持 `platform:<platform_key>`、`instance:<id>`、`api:<id>` 三类分层导出、构建、dry-run、确认提交和回读 hash。
|
|
11
|
-
- 旧来源脚本 `scripts/submit*.py` 只保留为结构参考;不得用它们直调 BPMAX API。
|
|
12
|
-
- 不得用 `bpmax-cli api POST/PUT/DELETE /api_platform*` 或其它 raw API 绕过 typed config submit。
|
|
13
|
-
|
|
14
|
-
## 全局范围门禁
|
|
15
|
-
- 范围 gate 对本 skill 是强要求。任何会修改 BPMAX 配置、线上状态、本地提交体或最终结果的动作,都必须先归类为 `requested`、`required-collateral` 或 `out-of-scope`。
|
|
16
|
-
- 范围 gate 必须基于线上最新配置:分析或编辑配置前,先通过对应 workflow/API 拉取或读取远端最新状态;提交前再次确认本地 work/submit/payload 仍基于该最新远端基线,若线上配置已变化必须停止并重新对照。
|
|
17
|
-
- 只有用户明确要求的 `requested`,或为闭合需求不可避免的 `required-collateral`,才允许进入 work / submit / 线上 payload / 状态变更。
|
|
18
|
-
- `required-collateral` 必须逐项解释“不改会坏/会失真/会不闭合”的原因并取得确认;`out-of-scope` 一律不得提交或顺手混入。
|
|
19
|
-
- 不得以历史脏配置、顺手修复、统一风格、编辑器自动补字段、方便调试为理由修改需求外配置。
|
|
20
|
-
|
|
21
|
-
## 何时使用
|
|
22
|
-
- 用户已经在浏览器打开 BPMAX 系统集成页面、实例编辑页、API 编辑页或系统 API 文档调试页。
|
|
23
|
-
- 用户要新增、编辑或核对集成平台、实例、API 代理、响应映射。
|
|
24
|
-
- 用户希望直接复用当前登录态和页面上下文,不手动找鉴权。
|
|
25
|
-
- 用户要求把接口配置完后再在系统 API 文档页完成真实调试。
|
|
26
|
-
|
|
27
|
-
## 前置条件
|
|
28
|
-
- 用户必须先打开以下任一页面:
|
|
29
|
-
- `.../w:<workspace>/link_system`
|
|
30
|
-
- `.../w:<workspace>/link_system/detail?system=<platform_key>`
|
|
31
|
-
- `.../w:<workspace>/link_system/instance/edit?system=<platform_key>&id=<id>`
|
|
32
|
-
- `.../w:<workspace>/link_system/detail?system=<platform_key>&tab=apis`
|
|
33
|
-
- `.../w:<workspace>/link_system/api/edit?system=<platform_key>&id=<id>`
|
|
34
|
-
- `.../w:<workspace>/api-docs/system_api/<apiId>?system=<platform_key>`
|
|
35
|
-
- 编辑现有对象时,优先使用页面当前完整 URL,不要自行裁掉查询参数。
|
|
36
|
-
- 需求必须明确到至少一层对象:
|
|
37
|
-
- 平台
|
|
38
|
-
- 实例
|
|
39
|
-
- API
|
|
40
|
-
- API 调试
|
|
41
|
-
- 如果用户只说“改 D365 接口”,开始前先判断本次实际改动落在平台、实例还是 API。
|
|
42
|
-
|
|
43
|
-
## 脚本化闭环(第二阶段)
|
|
44
|
-
- 当前 skill 已补齐最小脚本化闭环,临时工件统一放在 `.codex/tmp/api-platform-editor/`:
|
|
45
|
-
- `contracts/`:浏览器 `copy as fetch/curl` 或 HAR 导出的真实写契约
|
|
46
|
-
- `raw/`、`work/`、`meta/`:导出线上对象、人工编辑工作副本、确认状态
|
|
47
|
-
- `submit/`:最终提交包
|
|
48
|
-
- `result/`:提交响应、回读、verify、doc-debug 验收记录
|
|
49
|
-
- `fragments/`:实例四段脚本、API schema/example/binding sidecar
|
|
50
|
-
- 当前标准顺序:
|
|
51
|
-
1. `bpmax-cli config api-platform export --id platform:<platform_key>|instance:<id>|api:<id> --profile <profile> --out <dir> --format json`
|
|
52
|
-
2. 修改 `work/` 和必要 fragments
|
|
53
|
-
3. `bpmax-cli config api-platform lint --work <work-file>`
|
|
54
|
-
4. `bpmax-cli config api-platform build --work <work-file> --meta <meta-file> --out <submit-file> --format json`
|
|
55
|
-
5. 先 dry-run:`bpmax-cli config api-platform submit --id <same-id> --payload <submit-file> --profile <profile> --format json`
|
|
56
|
-
6. 用户确认后再执行 `--confirm "submit api-platform <same-id>"`
|
|
57
|
-
7. 如果是实例或 API 变更,再执行文档页真实调试验收
|
|
58
|
-
- 当前仍必须保留浏览器参与的环节:
|
|
59
|
-
- 抓真实保存请求
|
|
60
|
-
- 在系统 API 文档页点击“发送请求”
|
|
61
|
-
- 最终页面刷新验收
|
|
62
|
-
- `doc-debug` 层只负责导出上下文和记录验收结果,不替代浏览器真实调试。
|
|
63
|
-
|
|
64
|
-
## Mem0 协议
|
|
65
|
-
- 开始前先调用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),检索词至少包含:
|
|
66
|
-
- `platform_key`
|
|
67
|
-
- `instance_key`
|
|
68
|
-
- `api_key`
|
|
69
|
-
- API 文档页 `id`
|
|
70
|
-
- 脚本、签名、调试、entity binding 等关键词
|
|
71
|
-
- 优先查这些历史信息:
|
|
72
|
-
- 某个平台已有实例和 API 骨架
|
|
73
|
-
- 某类实例脚本、签名、`datajson` 包装的稳定写法
|
|
74
|
-
- 某条 API 的参数 schema、调试样例和验收口径
|
|
75
|
-
- 完成配置修改并通过文档页调试后,再写回真正可复用的结论:
|
|
76
|
-
- `decision`:平台/实例/API 分层编辑策略、标准调试页规则
|
|
77
|
-
- `task_learning`:签名脚本、示例生成、调试参数选取、日志核对的稳定方法
|
|
78
|
-
- `anti_pattern`:只看本地镜像、把 API 编辑页调试区当标准页、未回读就认定保存成功
|
|
79
|
-
- 不要把整段脚本、整块 schema 或整条请求示例原样塞进 Mem0。
|
|
80
|
-
- 如果停在“已改配置但未完成文档页调试”或“调试失败待排查”,结束前写 `session_state`。
|
|
81
|
-
|
|
82
|
-
## 核心原则
|
|
83
|
-
- 优先复用当前浏览器页面的同域授权上下文,不要先假设有独立 API Key。
|
|
84
|
-
- 浏览器实时线上页面、实时接口返回、当前页面真实请求体优先于本地 `think_api_platform`、`think_api_proxy` 镜像;本地配置只作为候选和结构参考,不能覆盖线上事实。
|
|
85
|
-
- 平台、实例、API、实体绑定必须分层处理,不要把它们混成一份“总配置”。
|
|
86
|
-
- 已验证的读取接口优先级:
|
|
87
|
-
- 平台:`GET /api/api_platform`、`GET /api/api_platform/by_key/:platform_key`
|
|
88
|
-
- 实例:`GET /api/api_platform_instance`、`GET /api/api_platform_instance/:id`
|
|
89
|
-
- API:`GET /api/api_proxy`、`GET /api/api_proxy/:id`
|
|
90
|
-
- 扩展:`GET /api/api_proxy_entity_binding`、`GET /api/api_proxy_entity_binding/preset_functions`、`GET /api/entity`
|
|
91
|
-
- 调试统一走系统 API 文档页:
|
|
92
|
-
- `/w:<workspace>/api-docs/system_api/<apiId>?system=<platform_key>`
|
|
93
|
-
- 不把 API 编辑页里的调试区作为标准验收路径
|
|
94
|
-
- 只要涉及实例脚本、签名、`request_schema`、响应映射或示例变更,就必须在文档调试页复测。
|
|
95
|
-
- 实施保存时,先抓当前页面真实保存请求并落到 `contracts/<layer>.<mode>.json`,再用脚本 build/submit;不要预先硬编码未验证的写接口形状。
|
|
96
|
-
- 除非用户明确要求,线上验证结果不手动回写本地配置镜像;本地仓库只更新 skill 和文档。
|
|
97
|
-
|
|
98
|
-
## 工作流
|
|
99
|
-
|
|
100
|
-
### 1. 识别当前模式
|
|
101
|
-
- 读取当前页 URL。
|
|
102
|
-
- 如果是 `/link_system`,按平台列表页处理。
|
|
103
|
-
- 如果是 `/link_system/detail?system=...`,按平台详情页处理。
|
|
104
|
-
- 如果是 `/link_system/instance/edit?...`,按实例编辑页处理。
|
|
105
|
-
- 如果是 `/link_system/api/edit?...`,按 API 编辑页处理。
|
|
106
|
-
- 如果是 `/api-docs/system_api/<id>?system=...`,按文档调试页处理。
|
|
107
|
-
- 进入配置构造前,先按平台、实例、API 和调试目标检索一次 Mem0。
|
|
108
|
-
|
|
109
|
-
### 2. 获取授权上下文
|
|
110
|
-
- 浏览器页面上下文只用于只读检查、抓取真实写契约和最终页面验收;真实远端写入必须回到 `bpmax-cli config api-platform submit`。
|
|
111
|
-
- 必要时读取:
|
|
112
|
-
- `document.cookie`
|
|
113
|
-
- `localStorage`
|
|
114
|
-
- `sessionStorage`
|
|
115
|
-
- 当前页面最近的同域接口请求头
|
|
116
|
-
- 不得用页面内同域请求直接保存配置,也不得退化成终端 `curl` 手搓写请求。
|
|
117
|
-
|
|
118
|
-
### 3. 检索本地候选
|
|
119
|
-
- 只要需求涉及已有平台或已有 API,先检索本地镜像:
|
|
120
|
-
- `think_api_platform`
|
|
121
|
-
- `think_api_proxy`
|
|
122
|
-
- 检索方式优先:
|
|
123
|
-
- 平台名称
|
|
124
|
-
- `platform_key`
|
|
125
|
-
- `instance_key`
|
|
126
|
-
- `api_key`
|
|
127
|
-
- API 名称和路径关键词
|
|
128
|
-
- 输出时至少给出:
|
|
129
|
-
- 候选目录或唯一标识
|
|
130
|
-
- 为什么判断它可复用
|
|
131
|
-
- 本地镜像只能作为候选和对照,不得覆盖线上对象。
|
|
132
|
-
|
|
133
|
-
### 4. 读取线上配置
|
|
134
|
-
- 平台详情页至少读取:
|
|
135
|
-
- `GET /api/api_platform/by_key/:platform_key`
|
|
136
|
-
- `GET /api/api_platform_instance?api_platform_guid=<guid>`
|
|
137
|
-
- `GET /api/api_proxy?api_platform_guid=<guid>`
|
|
138
|
-
- 实例编辑页至少读取:
|
|
139
|
-
- `GET /api/api_platform/by_key/:platform_key`
|
|
140
|
-
- `GET /api/api_platform_instance/:id`
|
|
141
|
-
- API 编辑页至少读取:
|
|
142
|
-
- `GET /api/api_platform/by_key/:platform_key`
|
|
143
|
-
- `GET /api/api_proxy/:id`
|
|
144
|
-
- `GET /api/api_platform_instance?api_platform_guid=<guid>`
|
|
145
|
-
- `GET /api/api_proxy_entity_binding?q_proxy_guid=<guid>&q_direction=response`
|
|
146
|
-
- `GET /api/api_proxy_entity_binding/preset_functions`
|
|
147
|
-
- `GET /api/entity?page_size=1000`
|
|
148
|
-
- 文档调试页至少读取:
|
|
149
|
-
- `GET /api/api_platform/by_key/:platform_key`
|
|
150
|
-
- `GET /api/api_proxy/:id`
|
|
151
|
-
- `GET /api/api_platform_instance?api_platform_guid=<guid>`
|
|
152
|
-
- 需要关注的核心字段:
|
|
153
|
-
- 平台:`name`、`platform_key`、`category`、`description`、`icon`、`status`
|
|
154
|
-
- 实例:`name`、`instance_key`、`env_type`、`auth_type`、`config_schema`、四类脚本
|
|
155
|
-
- API:`api_key`、`name`、`method`、`path`、`request_schema`、`response_schema`、`request_example`、`response_example`
|
|
156
|
-
|
|
157
|
-
### 5. 构造目标 payload
|
|
158
|
-
- 以当前页面真实返回体或真实保存请求骨架为基准,不要从零伪造全量 schema。
|
|
159
|
-
- 平台层只改用户明确要求的字段:
|
|
160
|
-
- 名称
|
|
161
|
-
- `platform_key`
|
|
162
|
-
- 分类
|
|
163
|
-
- 描述
|
|
164
|
-
- 图标
|
|
165
|
-
- 状态
|
|
166
|
-
- 实例层重点维护:
|
|
167
|
-
- `config_schema.auth`
|
|
168
|
-
- `config_schema.baseUrl`
|
|
169
|
-
- `config_schema.timeout`
|
|
170
|
-
- `config_schema.maxRetries`
|
|
171
|
-
- `config_schema.defaultHeaders`
|
|
172
|
-
- `config_schema.customParams`
|
|
173
|
-
- `on_setup_script`
|
|
174
|
-
- `on_request_script`
|
|
175
|
-
- `on_response_script`
|
|
176
|
-
- `on_error_script`
|
|
177
|
-
- API 层重点维护:
|
|
178
|
-
- `method`
|
|
179
|
-
- `path`
|
|
180
|
-
- `request_schema.header`
|
|
181
|
-
- `request_schema.path_params`
|
|
182
|
-
- `request_schema.query_params`
|
|
183
|
-
- `request_schema.body_params`
|
|
184
|
-
- `response_schema`
|
|
185
|
-
- `request_example`
|
|
186
|
-
- `response_example`
|
|
187
|
-
- `description`
|
|
188
|
-
- 如果需求涉及响应映射:
|
|
189
|
-
- 同时读取并核对 `api_proxy_entity_binding`
|
|
190
|
-
- 不要只改 `response_schema` 就认定映射已经配置完成
|
|
191
|
-
- 如果需求涉及签名、`datajson`、表单包装或环境差异:
|
|
192
|
-
- 优先改实例脚本和环境参数
|
|
193
|
-
- 不要把实例特有逻辑硬塞进单条 API 定义里
|
|
194
|
-
|
|
195
|
-
### 6. 提交方式
|
|
196
|
-
- 平台、实例、API 的最终保存接口与 payload 形状,必须以当前页面真实保存请求为准。
|
|
197
|
-
- 写契约抓取脚本:
|
|
198
|
-
- `scripts/capture_write_contract.py`
|
|
199
|
-
- 对 `api` 层,如果同时改了 `api_proxy_entity_binding`,必须额外提供 binding 保存请求或 HAR 片段
|
|
200
|
-
- 在没有抓到真实保存请求前:
|
|
201
|
-
- 可以读取
|
|
202
|
-
- 可以分析
|
|
203
|
-
- 可以构造候选改动
|
|
204
|
-
- 但不要在 skill 文档里提前硬编码未验证写链路
|
|
205
|
-
- 标准保存链路必须走 typed CLI:
|
|
206
|
-
- `bpmax-cli config api-platform build/submit/verify`
|
|
207
|
-
- 提交前必须确认 submit payload 的 operation plan 只包含本次范围内的 platform / instance / api / response_binding 操作。
|
|
208
|
-
- API 创建且带响应映射时,执行顺序固定为:
|
|
209
|
-
- `api_proxy -> binding -> readback`
|
|
210
|
-
|
|
211
|
-
### 7. 标准调试闭环
|
|
212
|
-
- 配置修改后,必须按以下顺序验收:
|
|
213
|
-
1. 回读 `api_proxy` 或 `api_platform_instance`,确认改动已落库
|
|
214
|
-
2. 打开对应文档页 `/w:<workspace>/api-docs/system_api/<apiId>?system=<platform_key>`
|
|
215
|
-
3. 选择目标实例环境
|
|
216
|
-
4. 填写最小可验证参数
|
|
217
|
-
5. 点击“发送请求”
|
|
218
|
-
6. 核对返回结果、示例是否一致、脚本是否参与请求
|
|
219
|
-
7. 如有必要,再去调用日志页补证据
|
|
220
|
-
- 文档调试页当前已验证的行为:
|
|
221
|
-
- 不是静态说明页,会基于 `request_schema` 自动解析参数
|
|
222
|
-
- 环境下拉来自 `api_platform_instance`
|
|
223
|
-
- “发送请求”是标准调试动作入口
|
|
224
|
-
- 如果某类 API 依赖实例脚本做签名或 `datajson` 包装,必须用文档页真实调试验证脚本确实生效。
|
|
225
|
-
- 文档页验收记录统一落到:
|
|
226
|
-
- `scripts/record_doc_debug_acceptance.py`
|
|
227
|
-
- 缺少环境、最小参数或结果摘要时,不算完成。
|
|
228
|
-
|
|
229
|
-
## 输出要求
|
|
230
|
-
- 明确告诉用户本次改的是哪一层:
|
|
231
|
-
- 平台
|
|
232
|
-
- 实例
|
|
233
|
-
- API
|
|
234
|
-
- 响应映射
|
|
235
|
-
- 文档调试
|
|
236
|
-
- 明确告诉用户本次读到的核心接口。
|
|
237
|
-
- 如果抓到了真实保存请求,要明确说明保存是通过哪条真实页面链路完成的。
|
|
238
|
-
- 如果做了文档页调试,要明确说明:
|
|
239
|
-
- 用的是哪条文档页 URL
|
|
240
|
-
- 选择了哪个实例环境
|
|
241
|
-
- 传了哪些最小必要参数
|
|
242
|
-
- 返回是否符合预期
|
|
243
|
-
- 如果发现问题,要说明问题落在哪一层,以及后续是先修实例、先修 API,还是先修映射。
|
|
244
|
-
|
|
245
|
-
## Anti-pattern
|
|
246
|
-
- 在 API 编辑页看到调试区就直接把它当唯一验收页。
|
|
247
|
-
- 跳过文档调试页,不验证实例脚本是否真正参与请求。
|
|
248
|
-
- 只改本地镜像,不核对线上真实对象。
|
|
249
|
-
- 未抓真实保存请求,就先假设写接口路径和请求体形状。
|
|
250
|
-
- 只提交 `api_proxy`,却不提交或不回读 `api_proxy_entity_binding`。
|
|
251
|
-
- 把实例专属签名、认证、包装逻辑直接写死进 API schema。
|
|
252
|
-
- 只改 `response_schema`,却不核对 `api_proxy_entity_binding`。
|
|
253
|
-
|
|
254
|
-
## 参考资料
|
|
255
|
-
- 平台、实例、API 的已验证读链路与页面映射: [references/platform-api-map.md](./references/platform-api-map.md)
|
|
256
|
-
- 实例配置结构和脚本要点: [references/instance-config-shape.md](./references/instance-config-shape.md)
|
|
257
|
-
- API 代理结构、schema 与扩展依赖: [references/api-proxy-shape.md](./references/api-proxy-shape.md)
|
|
258
|
-
- 系统 API 文档页调试流程: [references/api-doc-debug-workflow.md](./references/api-doc-debug-workflow.md)
|
|
259
|
-
- 运行时工作流与验收顺序: [references/runtime-workflow.md](./references/runtime-workflow.md)
|
|
260
|
-
|
|
261
|
-
## 实战经验
|
|
262
|
-
|
|
263
|
-
### `system_api/18` 终端门店同步接口联调案例(2026-04-20)
|
|
264
|
-
- 文档页:`/w:store_mgr/api-docs/system_api/18?system=dynamic`
|
|
265
|
-
- API:`getTerminalStoreInfoSync`
|
|
266
|
-
- 最小验证参数:
|
|
267
|
-
- `feedbackLanguage=7`
|
|
268
|
-
- `operator=4947`
|
|
269
|
-
- `mdbm=CHN2026041400216`
|
|
270
|
-
- `pageNo=1`
|
|
271
|
-
- `pageSize=10`
|
|
272
|
-
- 开发环境 `d365_dev` 的文档页调试会命中 `POST /api/api_proxy/call`,但返回 `500`,错误是 `无法解析主机名,请检查网络连接`。
|
|
273
|
-
- 同一组参数切到测试环境 `d365_test` 后,`POST /api/api_proxy/call` 返回 `200`,前端传给代理层的请求体为:
|
|
274
|
-
- `{"platform_key":"dynamic","instance_key":"d365_test","api_key":"getTerminalStoreInfoSync","api_args":["7","4947","CHN2026041400216",1,10],"caller":"frontend_debug","call_mode":"direct"}`
|
|
275
|
-
- 文档页返回的 `debug_request` 证明实例脚本已真实参与请求转换,而不是只渲染示例:
|
|
276
|
-
- 上游 URL 变成 `https://test.rrip.roborock.com/rrip/oa216/api/cube/restful/interface/getModeDataPageList/getzdmdxxfy`
|
|
277
|
-
- 请求头包含运行时生成的 `sign`、`timestamp`、`ipaasAuthorization`
|
|
278
|
-
- 请求体被实例脚本包装为 `application/x-www-form-urlencoded` 的 `datajson=...`
|
|
279
|
-
- 测试环境返回业务数据,已确认包含 `mainTable.mdbm=CHN2026041400216`、`mdmc=刘文祥麻辣烫new` 以及 `detail1`、`detail2`。
|
|
280
|
-
- 结论:
|
|
281
|
-
- 文档调试页可以直接验证实例脚本、签名和包装逻辑是否真正生效。
|
|
282
|
-
- 开发环境失败不能直接判定 API 配置错误,要先区分是上游网络解析问题还是 schema / 脚本问题。
|
|
283
|
-
|
|
284
|
-
### `system_api/14` D365经销商查询接口联调案例(2026-04-20)
|
|
285
|
-
- 文档页:`/w:store_mgr/api-docs/system_api/14?system=dynamic`
|
|
286
|
-
- API:`D365经销商查询接口`
|
|
287
|
-
- 本次使用测试环境 `d365_test`,文档页环境名显示为 `D365接口-测试环境`。
|
|
288
|
-
- 最小验证参数:
|
|
289
|
-
- `pageSize=10`
|
|
290
|
-
- `pageIndex=1`
|
|
291
|
-
- `startTime` 留空
|
|
292
|
-
- `endTime` 留空
|
|
293
|
-
- `codeList` 留空
|
|
294
|
-
- 文档页会向代理层发送:
|
|
295
|
-
- `{"platform_key":"dynamic","instance_key":"d365_test","api_key":"rripCrmApiBasedatagetGetCrmAccountchannelPost","api_args":["",[],10,1,""],"caller":"frontend_debug","call_mode":"direct"}`
|
|
296
|
-
- `POST /api/api_proxy/call` 返回 `200`,说明文档页到平台代理链路可用,且实例脚本已经补齐请求头里的 `sign`、`timestamp`、`ipaasAuthorization`。
|
|
297
|
-
- 但上游业务返回 `isSuccess=false`,错误信息是 `startTime、endTime与codeList不能同时为空`;也就是说这条 API 不能只靠分页参数完成有效查询。
|
|
298
|
-
- 文档页的 `debug_request` 已确认上游请求是:
|
|
299
|
-
- `POST https://test.rrip.roborock.com/rrip/crm/api/BaseDataGet/get_crm_accountchannel`
|
|
300
|
-
- `Content-Type: application/json`
|
|
301
|
-
- 请求体为 `{"endTime":"","codeList":[],"pageSize":10,"pageIndex":1,"startTime":""}`
|
|
302
|
-
- 结论:
|
|
303
|
-
- 调试时不能只看 HTTP `200`,还必须继续核对响应体里的业务成功标志和错误消息。
|
|
304
|
-
- 对必填校验依赖“字段组合”而不是单字段 `required` 的 API,文档页最小验证参数应优先选择能越过业务校验的一组条件,而不是机械只填 schema 上标记必填的字段。
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
## bpmax-cli 统一执行入口
|
|
308
|
-
|
|
309
|
-
本 npm 分发版必须优先使用 typed CLI 命令,不要让 Agent 直接拼 raw API 或直接运行旧来源脚本提交配置。
|
|
310
|
-
|
|
311
|
-
```bash
|
|
312
|
-
bpmax-cli config api-platform export --id platform:<platform_key>|instance:<id>|api:<id> --out .codex/tmp/api-platform-editor
|
|
313
|
-
bpmax-cli config api-platform lint --work .codex/tmp/api-platform-editor/work/<file>.json
|
|
314
|
-
bpmax-cli config api-platform build --work .codex/tmp/api-platform-editor/work/<file>.json --meta .codex/tmp/api-platform-editor/meta/<file>.meta.json --out .codex/tmp/api-platform-editor/submit/<file>.json
|
|
315
|
-
bpmax-cli config api-platform submit --id <same-id> --payload .codex/tmp/api-platform-editor/submit/<file>.json
|
|
316
|
-
bpmax-cli config api-platform submit --id <same-id> --payload .codex/tmp/api-platform-editor/submit/<file>.json --confirm "submit api-platform <same-id>"
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
授权前置:当前 profile 必须通过校对码授权,并在授权页开启“配置能力”。如果 CLI 返回 capability 缺失,停止并让用户使用有管理权限的账号重新授权。
|
|
320
|
-
|
|
321
|
-
旧来源中的 `scripts/` 和 `references/` 只作为字段结构、lint 规则和验收规则参考;不得用旧脚本直写线上 API 平台配置。
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# API Doc Debug Workflow
|
|
2
|
-
|
|
3
|
-
## 标准调试页面
|
|
4
|
-
- 路径:`/w:<workspace>/api-docs/system_api/<apiId>?system=<platform_key>`
|
|
5
|
-
- 这是本 skill 的唯一标准调试页。
|
|
6
|
-
- API 编辑页的调试区只用于辅助观察,不作为默认验收路径。
|
|
7
|
-
|
|
8
|
-
## 当前已验证行为
|
|
9
|
-
- 页面会读取:
|
|
10
|
-
- `GET /api/api_platform/by_key/<platform_key>`
|
|
11
|
-
- `GET /api/api_proxy/<apiId>`
|
|
12
|
-
- `GET /api/api_platform_instance?api_platform_guid=<guid>`
|
|
13
|
-
- 页面会根据 `request_schema` 自动生成参数输入区。
|
|
14
|
-
- 环境下拉来自 `api_platform_instance`。
|
|
15
|
-
- “发送请求”按钮是标准调试入口。
|
|
16
|
-
|
|
17
|
-
## 调试顺序
|
|
18
|
-
1. 先完成 API 或实例配置修改。
|
|
19
|
-
2. 回读线上对象,确认变更已落库。
|
|
20
|
-
3. 打开文档调试页。
|
|
21
|
-
4. 选择目标实例环境。
|
|
22
|
-
5. 填入最小可验证参数。
|
|
23
|
-
6. 点击“发送请求”。
|
|
24
|
-
7. 核对返回结果、实例脚本副作用和必要日志。
|
|
25
|
-
|
|
26
|
-
## 参数选择原则
|
|
27
|
-
- 优先选最小但可通过验证的参数集。
|
|
28
|
-
- 如果 API 有必填分页参数,优先用最小分页值。
|
|
29
|
-
- 如果 API 依赖实例脚本补签名,不要在调试页手工模拟脚本生成字段,交给实例脚本完成。
|
|
30
|
-
|
|
31
|
-
## 常见反模式
|
|
32
|
-
- 把示例 JSON 看成“已调试通过”。
|
|
33
|
-
- 在编辑页调试区成功一次,就跳过文档页。
|
|
34
|
-
- 文档页没选对环境,却误判成 API 配置错误。
|