bpmax-cli 0.1.43 → 0.1.44-beta.0

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.
Files changed (251) hide show
  1. package/README.md +3 -3
  2. package/dist/bin.js +3372 -453
  3. package/dist/bin.js.map +1 -1
  4. package/package.json +1 -1
  5. package/skills/bpmax-api-platform-editor/SKILL.md +321 -0
  6. package/skills/bpmax-api-platform-editor/agents/openai.yaml +4 -0
  7. package/skills/bpmax-api-platform-editor/references/api-doc-debug-workflow.md +34 -0
  8. package/skills/bpmax-api-platform-editor/references/api-proxy-shape.md +41 -0
  9. package/skills/bpmax-api-platform-editor/references/instance-config-shape.md +41 -0
  10. package/skills/bpmax-api-platform-editor/references/platform-api-map.md +52 -0
  11. package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +32 -0
  12. package/skills/bpmax-api-platform-editor/scripts/api_platform_editor_common.py +1276 -0
  13. package/skills/bpmax-api-platform-editor/scripts/build_submit_payload.py +64 -0
  14. package/skills/bpmax-api-platform-editor/scripts/capture_write_contract.py +40 -0
  15. package/skills/bpmax-api-platform-editor/scripts/export_layer_bundle.py +212 -0
  16. package/skills/bpmax-api-platform-editor/scripts/record_doc_debug_acceptance.py +62 -0
  17. package/skills/bpmax-api-platform-editor/scripts/submit_and_verify_layer.py +75 -0
  18. package/skills/bpmax-api-platform-editor/tests/test_api_platform_editor.py +287 -0
  19. package/skills/bpmax-auth/SKILL.md +6 -17
  20. package/skills/bpmax-builder-shared/SKILL.md +44 -0
  21. package/skills/bpmax-builder-shared/base_url.py +81 -0
  22. package/skills/bpmax-builder-shared/runtime-script-site-matrix.json +71 -0
  23. package/skills/bpmax-builder-shared/runtime-script-site-matrix.md +34 -0
  24. package/skills/bpmax-builder-shared/runtime-script-template-catalog.md +123 -0
  25. package/skills/bpmax-builder-shared/runtime_script_rules.py +272 -0
  26. package/skills/bpmax-builder-shared/skill_audit.py +374 -0
  27. package/skills/bpmax-builder-shared/template_script_hard_rules.py +280 -0
  28. package/skills/bpmax-builder-shared/tests/test_base_url.py +80 -0
  29. package/skills/bpmax-builder-shared/tests/test_runtime_script_rules.py +115 -0
  30. package/skills/bpmax-builder-shared/tests/test_skill_audit.py +231 -0
  31. package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +281 -0
  32. package/skills/bpmax-cli/SKILL.md +2 -0
  33. package/skills/bpmax-config-latest/SKILL.md +71 -0
  34. package/skills/bpmax-console-template-editor/SKILL.md +536 -0
  35. package/skills/bpmax-console-template-editor/agents/openai.yaml +4 -0
  36. package/skills/bpmax-console-template-editor/references/filter-integration.md +60 -0
  37. package/skills/bpmax-console-template-editor/references/lessons-from-resume-dashboard.md +114 -0
  38. package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +69 -0
  39. package/skills/bpmax-console-template-editor/references/module-catalog.md +100 -0
  40. package/skills/bpmax-console-template-editor/references/runtime-page-shape.md +91 -0
  41. package/skills/bpmax-console-template-editor/references/template-shape.md +149 -0
  42. package/skills/bpmax-console-template-editor/scripts/build_submit_payload.py +38 -0
  43. package/skills/bpmax-console-template-editor/scripts/confirm_console_template.py +33 -0
  44. package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +964 -0
  45. package/skills/bpmax-console-template-editor/scripts/export_console_template.py +99 -0
  46. package/skills/bpmax-console-template-editor/scripts/lint_console_template.py +46 -0
  47. package/skills/bpmax-console-template-editor/scripts/submit_console_template.py +99 -0
  48. package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +383 -0
  49. package/skills/bpmax-dataset-field-template-editor/SKILL.md +600 -0
  50. package/skills/bpmax-dataset-field-template-editor/references/create-request-gotchas.md +25 -0
  51. package/skills/bpmax-dataset-field-template-editor/references/field-classify-mapping.md +35 -0
  52. package/skills/bpmax-dataset-field-template-editor/references/nested-field-patterns.md +24 -0
  53. package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +61 -0
  54. package/skills/bpmax-dataset-field-template-editor/references/virtual-field-patterns.md +27 -0
  55. package/skills/bpmax-dataset-field-template-editor/references/work-file-to-submit-mapping.md +127 -0
  56. package/skills/bpmax-dataset-field-template-editor/scripts/build_submit_payload.py +67 -0
  57. package/skills/bpmax-dataset-field-template-editor/scripts/confirm_dataset_field.py +37 -0
  58. package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +784 -0
  59. package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +62 -0
  60. package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +104 -0
  61. package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +83 -0
  62. package/skills/bpmax-dataset-field-template-editor/scripts/lint_dataset_field_semantics.py +35 -0
  63. package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +95 -0
  64. package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +709 -0
  65. package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +59 -0
  66. package/skills/bpmax-dataset-template-editor/SKILL.md +779 -0
  67. package/skills/bpmax-dataset-template-editor/references/custom-key-usage-patterns.md +18 -0
  68. package/skills/bpmax-dataset-template-editor/references/dataset-script-runtime-matrix.md +73 -0
  69. package/skills/bpmax-dataset-template-editor/references/pre-process-script-authoring-guide.md +186 -0
  70. package/skills/bpmax-dataset-template-editor/references/pre-process-script-example-catalog.md +106 -0
  71. package/skills/bpmax-dataset-template-editor/references/runtime-gotchas.md +28 -0
  72. package/skills/bpmax-dataset-template-editor/references/runtime-verified-dataset-page-shape.md +47 -0
  73. package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +23 -0
  74. package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +97 -0
  75. package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +65 -0
  76. package/skills/bpmax-dataset-template-editor/scripts/build_submit_payload.py +38 -0
  77. package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +650 -0
  78. package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +155 -0
  79. package/skills/bpmax-dataset-template-editor/scripts/lint_dataset_template.py +42 -0
  80. package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +43 -0
  81. package/skills/bpmax-dataset-template-editor/scripts/scan_custom_key_references.py +27 -0
  82. package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +115 -0
  83. package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +52 -0
  84. package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +39 -0
  85. package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +373 -0
  86. package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +151 -0
  87. package/skills/bpmax-e2e-flow-config-orchestrator/agents/openai.yaml +4 -0
  88. package/skills/bpmax-e2e-flow-config-orchestrator/references/orchestration-matrix.md +60 -0
  89. package/skills/bpmax-e2e-flow-test-operator/SKILL.md +371 -0
  90. package/skills/bpmax-e2e-flow-test-operator/agents/openai.yaml +5 -0
  91. package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale.json +97 -0
  92. package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_final_v2.json +105 -0
  93. package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_main.json +36 -0
  94. package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_region.json +40 -0
  95. package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +33 -0
  96. package/skills/bpmax-e2e-flow-test-operator/references/failure-update-loop.md +17 -0
  97. package/skills/bpmax-e2e-flow-test-operator/references/filter-field-discovery.md +40 -0
  98. package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +19 -0
  99. package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +75 -0
  100. package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +107 -0
  101. package/skills/bpmax-e2e-flow-test-operator/references/skill-experience-coverage-matrix.md +29 -0
  102. package/skills/bpmax-e2e-flow-test-operator/references/stale-runtime-and-clean-sample-rules.md +54 -0
  103. package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +58 -0
  104. package/skills/bpmax-e2e-flow-test-operator/scripts/bpmax_session.py +287 -0
  105. package/skills/bpmax-e2e-flow-test-operator/scripts/dealer_sample_on_shelf_plan.json +59 -0
  106. package/skills/bpmax-e2e-flow-test-operator/scripts/dealer_sample_on_shelf_runner.py +687 -0
  107. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +95 -0
  108. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +288 -0
  109. package/skills/bpmax-e2e-flow-test-operator/scripts/flow_api_matrix.py +161 -0
  110. package/skills/bpmax-e2e-flow-test-operator/scripts/flow_filter_fields.py +138 -0
  111. package/skills/bpmax-e2e-flow-test-operator/scripts/flow_form_runtime.py +396 -0
  112. package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +341 -0
  113. package/skills/bpmax-e2e-flow-test-operator/scripts/flow_test_profile.py +185 -0
  114. package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +138 -0
  115. package/skills/bpmax-feishu-chat-flow-plugin-editor/SKILL.md +69 -0
  116. package/skills/bpmax-feishu-chat-flow-plugin-editor/agents/openai.yaml +4 -0
  117. package/skills/bpmax-feishu-chat-flow-plugin-editor/references/config-checklist.md +42 -0
  118. package/skills/bpmax-feishu-chat-flow-plugin-editor/references/config-recipes.md +38 -0
  119. package/skills/bpmax-feishu-chat-flow-plugin-editor/references/config-shape.md +86 -0
  120. package/skills/bpmax-feishu-chat-flow-plugin-editor/references/gate-lint.md +68 -0
  121. package/skills/bpmax-feishu-chat-flow-plugin-editor/references/hoocoo-patterns.md +39 -0
  122. package/skills/bpmax-feishu-chat-flow-plugin-editor/references/runtime-behavior.md +41 -0
  123. package/skills/bpmax-feishu-chat-flow-plugin-editor/references/script-authoring.md +110 -0
  124. package/skills/bpmax-feishu-chat-flow-plugin-editor/scripts/lint_feishu_chat_plugin.py +278 -0
  125. package/skills/bpmax-feishu-chat-flow-plugin-editor/tests/test_lint_feishu_chat_plugin.py +203 -0
  126. package/skills/bpmax-filter-template-editor/SKILL.md +564 -0
  127. package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +38 -0
  128. package/skills/bpmax-filter-template-editor/references/filter-and-flow-binding.md +57 -0
  129. package/skills/bpmax-filter-template-editor/references/filter-content-schema.md +141 -0
  130. package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +287 -0
  131. package/skills/bpmax-filter-template-editor/references/filter-runtime-patterns.md +115 -0
  132. package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +94 -0
  133. package/skills/bpmax-filter-template-editor/scripts/build_submit_payload.py +25 -0
  134. package/skills/bpmax-filter-template-editor/scripts/confirm_filter_template.py +22 -0
  135. package/skills/bpmax-filter-template-editor/scripts/export_filter_template.py +57 -0
  136. package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +348 -0
  137. package/skills/bpmax-filter-template-editor/scripts/init_create_filter_template.py +8 -0
  138. package/skills/bpmax-filter-template-editor/scripts/lint_filter_template_semantics.py +26 -0
  139. package/skills/bpmax-filter-template-editor/scripts/submit_filter_template.py +62 -0
  140. package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +231 -0
  141. package/skills/bpmax-flow-template-editor/SKILL.md +1043 -0
  142. package/skills/bpmax-flow-template-editor/agents/openai.yaml +4 -0
  143. package/skills/bpmax-flow-template-editor/references/before-next-step-script-runtime-gotchas.md +62 -0
  144. package/skills/bpmax-flow-template-editor/references/config-surfaces-and-placeholders.md +270 -0
  145. package/skills/bpmax-flow-template-editor/references/diff-strategy.md +67 -0
  146. package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +25 -0
  147. package/skills/bpmax-flow-template-editor/references/flow-template-api-workflow.md +159 -0
  148. package/skills/bpmax-flow-template-editor/references/intent-model.md +117 -0
  149. package/skills/bpmax-flow-template-editor/references/lessons-from-price-plan-flow.md +147 -0
  150. package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +97 -0
  151. package/skills/bpmax-flow-template-editor/references/matrix-flow-form-nav-collaboration.md +163 -0
  152. package/skills/bpmax-flow-template-editor/references/payload-checklist.md +133 -0
  153. package/skills/bpmax-flow-template-editor/references/project-create-runtime-gotchas.md +54 -0
  154. package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +149 -0
  155. package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +41 -0
  156. package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +155 -0
  157. package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +179 -0
  158. package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +91 -0
  159. package/skills/bpmax-flow-template-editor/references/script-review-hard-rules.md +93 -0
  160. package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +57 -0
  161. package/skills/bpmax-flow-template-editor/scripts/build_submit_payload.py +69 -0
  162. package/skills/bpmax-flow-template-editor/scripts/confirm_flow_template.py +52 -0
  163. package/skills/bpmax-flow-template-editor/scripts/export_flow_template.py +114 -0
  164. package/skills/bpmax-flow-template-editor/scripts/flow_template_editor_common.py +1084 -0
  165. package/skills/bpmax-flow-template-editor/scripts/submit_flow_template.py +159 -0
  166. package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +636 -0
  167. package/skills/bpmax-form-template-editor/SKILL.md +1074 -0
  168. package/skills/bpmax-form-template-editor/agents/openai.yaml +4 -0
  169. package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +193 -0
  170. package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +125 -0
  171. package/skills/bpmax-form-template-editor/references/payload-checklist.md +77 -0
  172. package/skills/bpmax-form-template-editor/references/sub-form-patterns.md +49 -0
  173. package/skills/bpmax-form-template-editor/scripts/build_submit_payload.py +37 -0
  174. package/skills/bpmax-form-template-editor/scripts/check_form_template_consistency.py +145 -0
  175. package/skills/bpmax-form-template-editor/scripts/confirm_form_template.py +67 -0
  176. package/skills/bpmax-form-template-editor/scripts/export_form_template.py +89 -0
  177. package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +1745 -0
  178. package/skills/bpmax-form-template-editor/scripts/lint_form_template_semantics.py +30 -0
  179. package/skills/bpmax-form-template-editor/scripts/record_runtime_acceptance.py +67 -0
  180. package/skills/bpmax-form-template-editor/scripts/submit_form_template.py +163 -0
  181. package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +1303 -0
  182. package/skills/bpmax-list-template-editor/SKILL.md +468 -0
  183. package/skills/bpmax-list-template-editor/agents/openai.yaml +4 -0
  184. package/skills/bpmax-list-template-editor/references/browser-page-contract.md +81 -0
  185. package/skills/bpmax-list-template-editor/references/content-config-shape.md +148 -0
  186. package/skills/bpmax-list-template-editor/references/dataset-field-mapping.md +60 -0
  187. package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +103 -0
  188. package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +102 -0
  189. package/skills/bpmax-list-template-editor/references/payload-checklist.md +47 -0
  190. package/skills/bpmax-list-template-editor/references/runtime-verified-workflow.md +140 -0
  191. package/skills/bpmax-list-template-editor/references/special-formats.md +394 -0
  192. package/skills/bpmax-list-template-editor/scripts/build_submit_payload.py +37 -0
  193. package/skills/bpmax-list-template-editor/scripts/confirm_list_template.py +33 -0
  194. package/skills/bpmax-list-template-editor/scripts/export_list_template.py +89 -0
  195. package/skills/bpmax-list-template-editor/scripts/fetch_data_set.py +34 -0
  196. package/skills/bpmax-list-template-editor/scripts/lint_list_template_semantics.py +54 -0
  197. package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +955 -0
  198. package/skills/bpmax-list-template-editor/scripts/record_acceptance.py +55 -0
  199. package/skills/bpmax-list-template-editor/scripts/submit_list_template.py +117 -0
  200. package/skills/bpmax-list-template-editor/tests/test_list_template_editor_common.py +441 -0
  201. package/skills/bpmax-nav-config-editor/SKILL.md +347 -0
  202. package/skills/bpmax-nav-config-editor/agents/openai.yaml +4 -0
  203. package/skills/bpmax-nav-config-editor/references/api-workflow.md +68 -0
  204. package/skills/bpmax-nav-config-editor/references/config-shape.md +78 -0
  205. package/skills/bpmax-nav-config-editor/references/icon-selection.md +83 -0
  206. package/skills/bpmax-nav-config-editor/references/path-mapping-rules.md +46 -0
  207. package/skills/bpmax-nav-config-editor/references/payload-checklist.md +41 -0
  208. package/skills/bpmax-nav-config-editor/references/runtime-probing.md +47 -0
  209. package/skills/bpmax-nav-config-editor/scripts/build_submit_payload.py +34 -0
  210. package/skills/bpmax-nav-config-editor/scripts/confirm_nav_config.py +32 -0
  211. package/skills/bpmax-nav-config-editor/scripts/export_nav_config.py +56 -0
  212. package/skills/bpmax-nav-config-editor/scripts/lint_nav_config_semantics.py +33 -0
  213. package/skills/bpmax-nav-config-editor/scripts/nav_config_editor_common.py +812 -0
  214. package/skills/bpmax-nav-config-editor/scripts/submit_nav_config.py +44 -0
  215. package/skills/bpmax-nav-config-editor/scripts/verify_nav_config.py +33 -0
  216. package/skills/bpmax-nav-config-editor/tests/test_nav_config_editor.py +358 -0
  217. package/skills/bpmax-nav-config-editor/tests/test_nav_config_editor_common.py +138 -0
  218. package/skills/bpmax-nav-config-editor/tests/test_nav_config_lint.py +58 -0
  219. package/skills/bpmax-nav-config-editor/tests/test_nav_config_submit_verify.py +51 -0
  220. package/skills/bpmax-project/SKILL.md +1 -1
  221. package/skills/bpmax-project-detail-template-editor/SKILL.md +329 -0
  222. package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +4 -0
  223. package/skills/bpmax-project-detail-template-editor/references/local-temp-workflow.md +59 -0
  224. package/skills/bpmax-project-detail-template-editor/references/module-catalog-and-config-notes.md +47 -0
  225. package/skills/bpmax-project-detail-template-editor/references/payload-checklist.md +33 -0
  226. package/skills/bpmax-project-detail-template-editor/references/project-detail-template-api-workflow.md +44 -0
  227. package/skills/bpmax-project-detail-template-editor/scripts/build_submit_payload.py +30 -0
  228. package/skills/bpmax-project-detail-template-editor/scripts/confirm_project_detail_template.py +33 -0
  229. package/skills/bpmax-project-detail-template-editor/scripts/export_project_detail_template.py +87 -0
  230. package/skills/bpmax-project-detail-template-editor/scripts/lint_project_detail_template_semantics.py +37 -0
  231. package/skills/bpmax-project-detail-template-editor/scripts/project_detail_template_editor_common.py +507 -0
  232. package/skills/bpmax-project-detail-template-editor/scripts/submit_project_detail_template.py +120 -0
  233. package/skills/bpmax-project-detail-template-editor/tests/test_project_detail_template_editor.py +369 -0
  234. package/skills/bpmax-role-editor/SKILL.md +251 -0
  235. package/skills/bpmax-role-editor/references/api-workflow.md +30 -0
  236. package/skills/bpmax-role-editor/references/runtime-page-shape.md +18 -0
  237. package/skills/bpmax-role-editor/references/work-file-mapping.md +32 -0
  238. package/skills/bpmax-role-editor/scripts/build_submit_payload.py +38 -0
  239. package/skills/bpmax-role-editor/scripts/confirm_role.py +33 -0
  240. package/skills/bpmax-role-editor/scripts/export_role.py +163 -0
  241. package/skills/bpmax-role-editor/scripts/lint_role_semantics.py +38 -0
  242. package/skills/bpmax-role-editor/scripts/role_editor_common.py +1231 -0
  243. package/skills/bpmax-role-editor/scripts/submit_role.py +144 -0
  244. package/skills/bpmax-role-editor/tests/test_role_editor.py +343 -0
  245. package/skills/bpmax-shared/SKILL.md +1 -1
  246. package/skills/form-control-library/SKILL.md +82 -0
  247. package/skills/form-control-library/agents/openai.yaml +4 -0
  248. package/skills/form-control-library/references/form-controls.md +199 -0
  249. package/skills/form-control-library/references/form-template-submit-schema.md +180 -0
  250. package/skills/form-control-library/references/group-select-runtime.md +191 -0
  251. package/skills/form-control-library/scripts/rebuild_form_control_library.py +55 -0
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ from pathlib import Path
6
+
7
+ from api_platform_editor_common import (
8
+ build_submit_bundle,
9
+ default_contract_path,
10
+ dump_json,
11
+ file_sha256,
12
+ load_json,
13
+ load_meta,
14
+ paths_for,
15
+ record_work_confirmation,
16
+ update_build_meta,
17
+ write_diff,
18
+ )
19
+
20
+
21
+ def parse_args() -> argparse.Namespace:
22
+ parser = argparse.ArgumentParser(description="Build final submit payload for api-platform layer")
23
+ parser.add_argument("--stem", required=True)
24
+ parser.add_argument("--actor", default="codex")
25
+ parser.add_argument("--confirm-work", action="store_true", help="Confirm current work payload before building submit")
26
+ parser.add_argument("--contract-file", help="Override captured contract file path")
27
+ return parser.parse_args()
28
+
29
+
30
+ def main() -> None:
31
+ args = parse_args()
32
+ paths = paths_for(args.stem)
33
+ meta = load_meta(paths["meta"])
34
+ if not meta:
35
+ raise SystemExit("submit build blocked: missing export meta")
36
+ if not args.confirm_work:
37
+ raise SystemExit("submit build blocked: pass --confirm-work after reviewing work payload")
38
+
39
+ record_work_confirmation(paths["meta"], actor=args.actor, work_path=paths["work"])
40
+ layer = str(meta["layer"])
41
+ mode = str(meta["mode"])
42
+ contract_path = Path(args.contract_file).resolve() if args.contract_file else default_contract_path(layer, mode)
43
+ if not contract_path.exists():
44
+ raise SystemExit(f"submit build blocked: missing captured contract file {contract_path}")
45
+
46
+ work = load_json(paths["work"])
47
+ contract = load_json(contract_path)
48
+ submit_bundle = build_submit_bundle(work, contract=contract)
49
+ dump_json(paths["submit"], submit_bundle)
50
+ write_diff(paths["submit_diff"], work, submit_bundle, "work", "submit")
51
+ validation = dict(submit_bundle.get("validation") or {})
52
+ validation["contractSha256"] = file_sha256(contract_path)
53
+ update_build_meta(
54
+ paths["meta"],
55
+ work_path=paths["work"],
56
+ submit_path=paths["submit"],
57
+ contract_path=contract_path,
58
+ validation=validation,
59
+ )
60
+ print(paths["submit"])
61
+
62
+
63
+ if __name__ == "__main__":
64
+ main()
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ from pathlib import Path
6
+
7
+ from api_platform_editor_common import VALID_MODES, build_write_contract, default_contract_path, dump_json
8
+
9
+
10
+ def parse_args() -> argparse.Namespace:
11
+ parser = argparse.ArgumentParser(description="Capture api-platform write contract from fetch/curl/HAR exports")
12
+ parser.add_argument("--layer", choices=("platform", "instance", "api"), required=True)
13
+ parser.add_argument("--mode", choices=sorted(VALID_MODES), required=True)
14
+ parser.add_argument("--source-file", required=True, help="Primary fetch/curl/HAR capture file")
15
+ parser.add_argument("--binding-source-file", help="Optional binding fetch/curl/HAR capture file for api layer")
16
+ parser.add_argument("--primary-match", help="Preferred URL substring when source-file is HAR")
17
+ parser.add_argument("--binding-match", help="Preferred URL substring when binding-source-file is HAR")
18
+ parser.add_argument("--output", help="Override output contract path")
19
+ return parser.parse_args()
20
+
21
+
22
+ def main() -> None:
23
+ args = parse_args()
24
+ primary_text = Path(args.source_file).read_text(encoding="utf-8")
25
+ binding_text = Path(args.binding_source_file).read_text(encoding="utf-8") if args.binding_source_file else None
26
+ contract = build_write_contract(
27
+ layer=args.layer,
28
+ mode=args.mode,
29
+ primary_capture_text=primary_text,
30
+ binding_capture_text=binding_text,
31
+ primary_match=args.primary_match,
32
+ binding_match=args.binding_match,
33
+ )
34
+ output = Path(args.output).resolve() if args.output else default_contract_path(args.layer, args.mode)
35
+ dump_json(output, contract)
36
+ print(output)
37
+
38
+
39
+ if __name__ == "__main__":
40
+ main()
@@ -0,0 +1,212 @@
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ from pathlib import Path
6
+
7
+ from api_platform_editor_common import (
8
+ VALID_LAYERS,
9
+ VALID_MODES,
10
+ build_client,
11
+ doc_debug_context_to_work,
12
+ dump_json,
13
+ extract_first_record,
14
+ extract_records,
15
+ instance_detail_to_work,
16
+ load_meta,
17
+ make_stem,
18
+ paths_for,
19
+ platform_detail_to_work,
20
+ api_detail_to_work,
21
+ write_diff,
22
+ write_export_meta,
23
+ )
24
+
25
+
26
+ def parse_args() -> argparse.Namespace:
27
+ parser = argparse.ArgumentParser(description="Export api-platform platform/instance/api/doc-debug bundle")
28
+ parser.add_argument("--layer", choices=sorted(VALID_LAYERS), required=True)
29
+ parser.add_argument("--mode", choices=sorted(VALID_MODES), default="update")
30
+ parser.add_argument("--workspace", required=True)
31
+ parser.add_argument("--platform-key", help="Platform key for platform/instance/api/doc-debug export")
32
+ parser.add_argument("--id", help="Remote instance/api id, or doc-debug api id")
33
+ parser.add_argument("--sample-id", help="Sample remote instance/api id for create mode")
34
+ parser.add_argument("--sample-platform-key", help="Sample platform key for create mode platform export")
35
+ parser.add_argument("--stem", help="Override artifact stem")
36
+ parser.add_argument("--doc-debug-stem", help="Optional linked doc-debug stem for instance/api runtime acceptance")
37
+ parser.add_argument("--base-url")
38
+ parser.add_argument("--browser-origin")
39
+ parser.add_argument("--cookie", default="")
40
+ return parser.parse_args()
41
+
42
+
43
+ def _require(value: str | None, message: str) -> str:
44
+ if not str(value or "").strip():
45
+ raise SystemExit(message)
46
+ return str(value).strip()
47
+
48
+
49
+ def main() -> None:
50
+ args = parse_args()
51
+ client = build_client(args)
52
+ layer = args.layer
53
+ mode = args.mode
54
+
55
+ platform_key = args.platform_key
56
+ remote_id = args.id
57
+ if layer == "platform":
58
+ if mode == "create":
59
+ sample_key = _require(args.sample_platform_key, "platform create export requires --sample-platform-key")
60
+ platform = extract_first_record(client.get_platform_by_key(sample_key))
61
+ platform_key = platform_key or sample_key
62
+ remote_id = None
63
+ else:
64
+ platform_key = _require(platform_key, "platform update export requires --platform-key")
65
+ platform = extract_first_record(client.get_platform_by_key(platform_key))
66
+ if not platform:
67
+ raise SystemExit("platform export failed: remote platform not found")
68
+ stem = args.stem or make_stem("platform", mode, platform_key=platform_key)
69
+ paths = paths_for(stem)
70
+ raw = platform
71
+ work = platform_detail_to_work(platform, mode=mode)
72
+ dump_json(paths["raw"], raw)
73
+ dump_json(paths["work"], work)
74
+ write_diff(paths["work_diff"], raw, work, "raw", "work")
75
+ write_export_meta(
76
+ paths["meta"],
77
+ stem=stem,
78
+ layer=layer,
79
+ mode=mode,
80
+ work_path=paths["work"],
81
+ workspace=args.workspace,
82
+ platform_key=platform_key,
83
+ platform_guid=platform.get("guid"),
84
+ remote_id=platform.get("id") if mode == "update" else None,
85
+ remote_guid=platform.get("guid") if mode == "update" else None,
86
+ browser_origin=args.browser_origin,
87
+ )
88
+ print(paths["work"])
89
+ return
90
+
91
+ platform_key = _require(platform_key, f"{layer} export requires --platform-key")
92
+ platform = extract_first_record(client.get_platform_by_key(platform_key))
93
+ if not platform:
94
+ raise SystemExit("export failed: remote platform not found")
95
+ platform_guid = str(platform.get("guid") or "")
96
+ if not platform_guid:
97
+ raise SystemExit("export failed: remote platform missing guid")
98
+
99
+ if layer == "instance":
100
+ selected_id = args.sample_id if mode == "create" else args.id
101
+ selected_id = _require(selected_id, f"instance {mode} export requires {'--sample-id' if mode == 'create' else '--id'}")
102
+ instance = extract_first_record(client.get_instance(selected_id))
103
+ if not instance:
104
+ raise SystemExit("instance export failed: remote instance not found")
105
+ stem = args.stem or make_stem("instance", mode, platform_key=platform_key, remote_id=selected_id)
106
+ paths = paths_for(stem)
107
+ raw = {"platform": platform, "instance": instance}
108
+ work = instance_detail_to_work(instance, mode=mode, stem=stem)
109
+ dump_json(paths["raw"], raw)
110
+ dump_json(paths["work"], work)
111
+ write_diff(paths["work_diff"], raw, work, "raw", "work")
112
+ write_export_meta(
113
+ paths["meta"],
114
+ stem=stem,
115
+ layer=layer,
116
+ mode=mode,
117
+ work_path=paths["work"],
118
+ workspace=args.workspace,
119
+ platform_key=platform_key,
120
+ platform_guid=platform_guid,
121
+ remote_id=instance.get("id") if mode == "update" else None,
122
+ remote_guid=instance.get("guid") if mode == "update" else None,
123
+ browser_origin=args.browser_origin,
124
+ doc_debug_stem=args.doc_debug_stem,
125
+ )
126
+ dump_json(paths["context"], {"platform": platform, "instances": extract_records(client.list_instances(platform_guid))})
127
+ print(paths["work"])
128
+ return
129
+
130
+ if layer == "api":
131
+ selected_id = args.sample_id if mode == "create" else args.id
132
+ selected_id = _require(selected_id, f"api {mode} export requires {'--sample-id' if mode == 'create' else '--id'}")
133
+ api_detail = extract_first_record(client.get_api(selected_id))
134
+ if not api_detail:
135
+ raise SystemExit("api export failed: remote api not found")
136
+ response_binding = extract_first_record(client.get_binding(str(api_detail.get("guid") or ""))) if api_detail.get("guid") else {}
137
+ instances = extract_records(client.list_instances(platform_guid))
138
+ stem = args.stem or make_stem("api", mode, platform_key=platform_key, remote_id=selected_id)
139
+ paths = paths_for(stem)
140
+ raw = {
141
+ "platform": platform,
142
+ "instances": instances,
143
+ "api_proxy": api_detail,
144
+ "response_binding": response_binding,
145
+ }
146
+ work = api_detail_to_work(api_detail, binding=response_binding, mode=mode, stem=stem)
147
+ dump_json(paths["raw"], raw)
148
+ dump_json(paths["work"], work)
149
+ write_diff(paths["work_diff"], raw, work, "raw", "work")
150
+ linked_doc_debug_stem = args.doc_debug_stem or make_stem("doc-debug", "update", platform_key=platform_key, remote_id=selected_id)
151
+ write_export_meta(
152
+ paths["meta"],
153
+ stem=stem,
154
+ layer=layer,
155
+ mode=mode,
156
+ work_path=paths["work"],
157
+ workspace=args.workspace,
158
+ platform_key=platform_key,
159
+ platform_guid=platform_guid,
160
+ remote_id=api_detail.get("id") if mode == "update" else None,
161
+ remote_guid=api_detail.get("guid") if mode == "update" else None,
162
+ browser_origin=args.browser_origin,
163
+ doc_debug_stem=linked_doc_debug_stem,
164
+ )
165
+ dump_json(paths["context"], {"platform": platform, "instances": instances})
166
+ print(paths["work"])
167
+ return
168
+
169
+ if layer != "doc-debug":
170
+ raise SystemExit(f"unsupported export layer: {layer}")
171
+
172
+ api_id = _require(args.id, "doc-debug export requires --id (api id)")
173
+ api_detail = extract_first_record(client.get_api(api_id))
174
+ if not api_detail:
175
+ raise SystemExit("doc-debug export failed: remote api not found")
176
+ instances = extract_records(client.list_instances(platform_guid))
177
+ stem = args.stem or make_stem("doc-debug", "update", platform_key=platform_key, remote_id=api_id)
178
+ paths = paths_for(stem)
179
+ raw = {
180
+ "platform": platform,
181
+ "api_proxy": api_detail,
182
+ "instances": instances,
183
+ }
184
+ work = doc_debug_context_to_work(
185
+ workspace=args.workspace,
186
+ platform_key=platform_key,
187
+ api_id=api_id,
188
+ api_key=str(api_detail.get("api_key") or ""),
189
+ base_url=client.base_url,
190
+ instance_candidates=instances,
191
+ )
192
+ dump_json(paths["raw"], raw)
193
+ dump_json(paths["work"], work)
194
+ write_diff(paths["work_diff"], raw, work, "raw", "work")
195
+ write_export_meta(
196
+ paths["meta"],
197
+ stem=stem,
198
+ layer=layer,
199
+ mode="update",
200
+ work_path=paths["work"],
201
+ workspace=args.workspace,
202
+ platform_key=platform_key,
203
+ platform_guid=platform_guid,
204
+ remote_id=api_id,
205
+ remote_guid=str(api_detail.get("guid") or ""),
206
+ browser_origin=args.browser_origin,
207
+ )
208
+ print(paths["work"])
209
+
210
+
211
+ if __name__ == "__main__":
212
+ main()
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import json
6
+ from pathlib import Path
7
+
8
+ from api_platform_editor_common import (
9
+ build_doc_debug_acceptance,
10
+ dump_json,
11
+ load_json,
12
+ load_meta,
13
+ paths_for,
14
+ persist_doc_debug_result,
15
+ )
16
+
17
+
18
+ def parse_args() -> argparse.Namespace:
19
+ parser = argparse.ArgumentParser(description="Record browser doc-debug acceptance result for api-platform changes")
20
+ parser.add_argument("--stem", required=True, help="Doc-debug export stem")
21
+ parser.add_argument("--target-stem", help="Optional api/instance target stem whose runtime acceptance should be completed")
22
+ parser.add_argument("--instance-key", required=True)
23
+ parser.add_argument("--api-args-json", help="Inline JSON for api_args")
24
+ parser.add_argument("--api-args-file", help="JSON file for api_args")
25
+ parser.add_argument("--response-summary", required=True)
26
+ parser.add_argument("--matched-expected", action="store_true")
27
+ parser.add_argument("--log-url")
28
+ return parser.parse_args()
29
+
30
+
31
+ def _load_api_args(args: argparse.Namespace) -> object:
32
+ if args.api_args_json:
33
+ return json.loads(args.api_args_json)
34
+ if args.api_args_file:
35
+ return load_json(Path(args.api_args_file))
36
+ raise SystemExit("doc-debug acceptance requires --api-args-json or --api-args-file")
37
+
38
+
39
+ def main() -> None:
40
+ args = parse_args()
41
+ paths = paths_for(args.stem)
42
+ work = load_json(paths["work"])
43
+ acceptance = build_doc_debug_acceptance(
44
+ work=work,
45
+ instance_key=args.instance_key,
46
+ api_args=_load_api_args(args),
47
+ response_summary=args.response_summary,
48
+ matched_expected=args.matched_expected,
49
+ log_url=args.log_url,
50
+ )
51
+ dump_json(paths["acceptance"], acceptance)
52
+ persist_doc_debug_result(paths["meta"], accepted=bool(args.matched_expected), acceptance_path=paths["acceptance"])
53
+ if args.target_stem:
54
+ target_paths = paths_for(args.target_stem)
55
+ target_meta = load_meta(target_paths["meta"])
56
+ if target_meta:
57
+ persist_doc_debug_result(target_paths["meta"], accepted=bool(args.matched_expected), acceptance_path=paths["acceptance"])
58
+ print(paths["acceptance"])
59
+
60
+
61
+ if __name__ == "__main__":
62
+ main()
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import sys
5
+
6
+ print(
7
+ "Legacy config submit scripts are disabled in bpmax-cli. Use `bpmax-cli config api-platform submit` so capability, dry-run, confirmation, audit, and baseline checks are enforced.",
8
+ file=sys.stderr,
9
+ )
10
+ sys.exit(2)
11
+
12
+ import argparse
13
+ from pathlib import Path
14
+
15
+ from api_platform_editor_common import (
16
+ build_client,
17
+ default_contract_path,
18
+ dump_json,
19
+ ensure_submission_allowed,
20
+ load_json,
21
+ load_meta,
22
+ paths_for,
23
+ persist_submission_meta,
24
+ record_submit_confirmation,
25
+ submit_layer,
26
+ )
27
+
28
+
29
+ def parse_args() -> argparse.Namespace:
30
+ parser = argparse.ArgumentParser(description="Submit and verify api-platform layer change")
31
+ parser.add_argument("--stem", required=True)
32
+ parser.add_argument("--actor", default="codex")
33
+ parser.add_argument("--confirm-submit", action="store_true", help="Confirm final submit payload before submit")
34
+ parser.add_argument("--contract-file", help="Override captured contract file path")
35
+ parser.add_argument("--base-url")
36
+ parser.add_argument("--browser-origin")
37
+ parser.add_argument("--cookie", default="")
38
+ return parser.parse_args()
39
+
40
+
41
+ def main() -> None:
42
+ args = parse_args()
43
+ paths = paths_for(args.stem)
44
+ meta = load_meta(paths["meta"])
45
+ if not meta:
46
+ raise SystemExit("submit blocked: missing export meta")
47
+ layer = str(meta["layer"])
48
+ mode = str(meta["mode"])
49
+ contract_path = Path(args.contract_file).resolve() if args.contract_file else default_contract_path(layer, mode)
50
+ if not args.confirm_submit:
51
+ raise SystemExit("submit blocked: pass --confirm-submit after reviewing submit payload")
52
+
53
+ record_submit_confirmation(paths["meta"], actor=args.actor, submit_path=paths["submit"])
54
+ ensure_submission_allowed(paths["meta"], paths["work"], paths["submit"], contract_path)
55
+
56
+ client = build_client(args)
57
+ submit_bundle = load_json(paths["submit"])
58
+ contract = load_json(contract_path)
59
+ result = submit_layer(client, meta=meta, contract=contract, submit_bundle=submit_bundle)
60
+ dump_json(paths["response"], result["response"])
61
+ dump_json(paths["readback"], result["readback"])
62
+ dump_json(paths["verify"], result["verify"])
63
+ dump_json(paths["drift"], {"status": result["status"], "mismatches": result["verify"].get("mismatches", [])})
64
+ persist_submission_meta(
65
+ paths["meta"],
66
+ remote_id=result.get("remoteId"),
67
+ remote_guid=result.get("remoteGuid"),
68
+ verification=result["verify"],
69
+ status=str(result["status"]),
70
+ )
71
+ print(paths["verify"])
72
+
73
+
74
+ if __name__ == "__main__":
75
+ main()