@thinkingai/ae-cli 6.0.31 → 6.0.33

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 (255) hide show
  1. package/README.md +3 -2
  2. package/README.zh.md +3 -2
  3. package/dist/{auth-MEJ642P4.js → auth-ENM3FE6L.js} +3 -2
  4. package/dist/{auth-7H3HAAJ3.js → auth-UPGUOKTW.js} +13 -6
  5. package/dist/{capability-SEH3JWLN.js → capability-AJC5CBRT.js} +50 -18
  6. package/dist/{capability-SQ2IWKP3.js → capability-TQ5KU5Q6.js} +50 -18
  7. package/dist/chunk-24BAVOX3.js +51 -0
  8. package/dist/{chunk-MDJGDI6K.js → chunk-3KI3RRXX.js} +5 -5
  9. package/dist/{chunk-PKRD2IEM.js → chunk-3P3562ZX.js} +9 -7
  10. package/dist/{chunk-R77JT7XD.js → chunk-4Q5TNP4Q.js} +4 -4
  11. package/dist/{chunk-TKQJQXWT.js → chunk-6CHYBI64.js} +7 -4
  12. package/dist/{chunk-6LEYLOV3.js → chunk-CPVTECJ3.js} +9 -7
  13. package/dist/{chunk-KCA6BA5D.js → chunk-DB4Q3ANU.js} +5 -3
  14. package/dist/{chunk-2NDGFQHW.js → chunk-E7UXXHO3.js} +11 -3
  15. package/dist/{chunk-I4A62X3N.js → chunk-HQ2A7ITL.js} +23 -14
  16. package/dist/chunk-IMMGMU54.js +674 -0
  17. package/dist/{chunk-AJTH7LT3.js → chunk-IR4ZLVPW.js} +4 -2
  18. package/dist/{chunk-N2QORU5D.js → chunk-ISY6HMHM.js} +7 -4
  19. package/dist/{chunk-KGJQCYVC.js → chunk-LCXU3AAT.js} +4 -2
  20. package/dist/chunk-LYVNONC4.js +86 -0
  21. package/dist/{chunk-DYOS6YY7.js → chunk-RGXCNC4N.js} +23 -14
  22. package/dist/{chunk-YCLVYFK7.js → chunk-V6FR6WTW.js} +45 -87
  23. package/dist/chunk-VTWMIC5L.js +27 -0
  24. package/dist/{cli-token-TVQRSE46.js → cli-token-4SBMXAUK.js} +6 -3
  25. package/dist/{client-2643Z5AG.js → client-PP5FETMW.js} +4 -3
  26. package/dist/community-report-client-KK2QBANO.js +145 -0
  27. package/dist/{config-7UZWDE74.js → config-RCCGHHYA.js} +6 -3
  28. package/dist/index.js +541 -234
  29. package/dist/{metadata-W6JFFMBA.js → metadata-3M5F2AED.js} +15 -14
  30. package/dist/{metadata-X62TKIVK.js → metadata-W2MEOI4Z.js} +15 -14
  31. package/dist/{model-T3KZJWLW.js → model-OYQLXCQY.js} +3 -2
  32. package/dist/{raw-CN542NGT.js → raw-TPB7KSZO.js} +6 -4
  33. package/dist/{sync-ERNHDPB5.js → sync-EFJKFZK2.js} +6 -3
  34. package/dist/{te-agent-FCCWUDTJ.js → te-agent-K2OWMZXT.js} +3 -2
  35. package/dist/{te-analysis-NJGNWZFC.js → te-analysis-I73ZS4NK.js} +2196 -120
  36. package/dist/{te-analysis-YGV5V5EX.js → te-analysis-Q7AZCDU4.js} +2196 -120
  37. package/dist/te-common-ST3QPSXJ.js +61 -0
  38. package/dist/te-common-WSLIKKPC.js +61 -0
  39. package/dist/te-community-WXGB6IOX.js +1659 -0
  40. package/dist/te-community-X2AHXGCA.js +1659 -0
  41. package/dist/{te-dataops-ZNJBQ6VT.js → te-dataops-MJV54MNY.js} +10 -8
  42. package/dist/{te-dataops-F36T656A.js → te-dataops-OA7I6HBG.js} +10 -8
  43. package/dist/te-engage-GJRVQMK3.js +3895 -0
  44. package/dist/te-engage-JIXX3WBI.js +3895 -0
  45. package/dist/{te-kb-NT33UHAE.js → te-kb-CIZXRWMO.js} +105 -23
  46. package/dist/{te-meta-VKWNAWO4.js → te-meta-Q4L6EE3Q.js} +8 -240
  47. package/dist/{te-meta-MAAUHFQO.js → te-meta-VHCN4Q62.js} +8 -240
  48. package/dist/{te-team-OKCOX7OE.js → te-team-PDKKW7Q5.js} +7 -6
  49. package/dist/tracking/i18n/resources/cli/en.json +4 -3
  50. package/dist/tracking/i18n/resources/cli/ja.json +4 -3
  51. package/dist/tracking/i18n/resources/cli/ko.json +4 -3
  52. package/dist/tracking/i18n/resources/cli/zh.json +4 -3
  53. package/package.json +6 -2
  54. package/skills/ae-agent/SKILL.md +2 -1
  55. package/skills/ae-analysis/SKILL.md +21 -7
  56. package/skills/ae-analysis/references/adhoc_export.md +5 -6
  57. package/skills/ae-analysis/references/adhoc_run.md +7 -9
  58. package/skills/ae-analysis/references/ai_models.md +17 -1
  59. package/skills/ae-analysis/references/alert_create.md +25 -0
  60. package/skills/ae-analysis/references/alert_definition_schema_get.md +24 -0
  61. package/skills/ae-analysis/references/alert_delete.md +26 -0
  62. package/skills/ae-analysis/references/alert_detail_list.md +27 -0
  63. package/skills/ae-analysis/references/alert_get.md +25 -0
  64. package/skills/ae-analysis/references/alert_job_list.md +24 -0
  65. package/skills/ae-analysis/references/alert_list.md +27 -0
  66. package/skills/ae-analysis/references/alert_notice_config_list.md +24 -0
  67. package/skills/ae-analysis/references/alert_start.md +25 -0
  68. package/skills/ae-analysis/references/alert_stop.md +25 -0
  69. package/skills/ae-analysis/references/alert_update.md +26 -0
  70. package/skills/ae-analysis/references/analysis_data_retrieval.md +11 -11
  71. package/skills/ae-analysis/references/analysis_drilldown_contract.md +93 -0
  72. package/skills/ae-analysis/references/analysis_gateway_assets.md +9 -8
  73. package/skills/ae-analysis/references/asset_url_get.md +4 -3
  74. package/skills/ae-analysis/references/bi_panel_create.md +3 -3
  75. package/skills/ae-analysis/references/bi_panel_page_data_export.md +2 -2
  76. package/skills/ae-analysis/references/bi_panel_page_data_run.md +1 -1
  77. package/skills/ae-analysis/references/check_delete.md +27 -0
  78. package/skills/ae-analysis/references/check_export.md +27 -0
  79. package/skills/ae-analysis/references/check_get.md +27 -0
  80. package/skills/ae-analysis/references/check_list.md +24 -0
  81. package/skills/ae-analysis/references/check_retry.md +27 -0
  82. package/skills/ae-analysis/references/check_run.md +25 -0
  83. package/skills/ae-analysis/references/command_index.md +114 -46
  84. package/skills/ae-analysis/references/create_entity.md +2 -2
  85. package/skills/ae-analysis/references/dashboard_create.md +3 -3
  86. package/skills/ae-analysis/references/dashboard_daily_report_send.md +1 -0
  87. package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
  88. package/skills/ae-analysis/references/dashboard_report_data_export.md +4 -4
  89. package/skills/ae-analysis/references/dashboard_report_data_run.md +4 -4
  90. package/skills/ae-analysis/references/drilldown_entities_export.md +26 -0
  91. package/skills/ae-analysis/references/drilldown_entities_run.md +33 -0
  92. package/skills/ae-analysis/references/drilldown_events_export.md +21 -0
  93. package/skills/ae-analysis/references/drilldown_events_run.md +23 -0
  94. package/skills/ae-analysis/references/drilldown_user_events_export.md +6 -3
  95. package/skills/ae-analysis/references/drilldown_user_events_run.md +6 -6
  96. package/skills/ae-analysis/references/entity_detail_export.md +2 -0
  97. package/skills/ae-analysis/references/entity_detail_run.md +8 -1
  98. package/skills/ae-analysis/references/event_blacklist_add.md +25 -0
  99. package/skills/ae-analysis/references/event_blacklist_list.md +24 -0
  100. package/skills/ae-analysis/references/event_blacklist_update.md +26 -0
  101. package/skills/ae-analysis/references/event_detail_export.md +2 -0
  102. package/skills/ae-analysis/references/event_detail_run.md +2 -0
  103. package/skills/ae-analysis/references/event_list.md +10 -2
  104. package/skills/ae-analysis/references/ingest_error_list.md +27 -0
  105. package/skills/ae-analysis/references/ingest_summary.md +26 -0
  106. package/skills/ae-analysis/references/list_entities.md +1 -1
  107. package/skills/ae-analysis/references/live_data_export.md +27 -0
  108. package/skills/ae-analysis/references/live_data_list.md +27 -0
  109. package/skills/ae-analysis/references/metric_create.md +13 -4
  110. package/skills/ae-analysis/references/metric_delete.md +7 -0
  111. package/skills/ae-analysis/references/metric_get.md +6 -0
  112. package/skills/ae-analysis/references/metric_list.md +16 -3
  113. package/skills/ae-analysis/references/metric_update.md +12 -1
  114. package/skills/ae-analysis/references/plan_change_log_export.md +27 -0
  115. package/skills/ae-analysis/references/plan_change_log_list.md +24 -0
  116. package/skills/ae-analysis/references/plan_delete_items.md +30 -0
  117. package/skills/ae-analysis/references/plan_export.md +26 -0
  118. package/skills/ae-analysis/references/plan_generate.md +27 -0
  119. package/skills/ae-analysis/references/plan_get.md +24 -0
  120. package/skills/ae-analysis/references/plan_import_excel.md +26 -0
  121. package/skills/ae-analysis/references/plan_save_items.md +27 -0
  122. package/skills/ae-analysis/references/plan_sync_from_meta.md +24 -0
  123. package/skills/ae-analysis/references/project_access_detail_get.md +23 -0
  124. package/skills/ae-analysis/references/project_data_power_delete.md +26 -0
  125. package/skills/ae-analysis/references/project_data_power_get.md +24 -0
  126. package/skills/ae-analysis/references/project_data_power_list.md +23 -0
  127. package/skills/ae-analysis/references/project_data_power_upsert.md +24 -0
  128. package/skills/ae-analysis/references/project_entity_create.md +27 -0
  129. package/skills/ae-analysis/references/project_entity_delete.md +25 -0
  130. package/skills/ae-analysis/references/project_entity_event_list.md +24 -0
  131. package/skills/ae-analysis/references/project_entity_get.md +24 -0
  132. package/skills/ae-analysis/references/project_entity_list.md +28 -0
  133. package/skills/ae-analysis/references/project_entity_update.md +28 -0
  134. package/skills/ae-analysis/references/project_function_list.md +24 -0
  135. package/skills/ae-analysis/references/project_info_get.md +23 -0
  136. package/skills/ae-analysis/references/project_info_list.md +26 -0
  137. package/skills/ae-analysis/references/project_info_update.md +25 -0
  138. package/skills/ae-analysis/references/project_mark_time_create.md +27 -0
  139. package/skills/ae-analysis/references/project_mark_time_delete.md +25 -0
  140. package/skills/ae-analysis/references/project_mark_time_list.md +28 -0
  141. package/skills/ae-analysis/references/project_mark_time_update.md +28 -0
  142. package/skills/ae-analysis/references/project_member_add.md +25 -0
  143. package/skills/ae-analysis/references/project_member_batch_update.md +24 -0
  144. package/skills/ae-analysis/references/project_member_candidate_list.md +25 -0
  145. package/skills/ae-analysis/references/project_member_handover_export.md +27 -0
  146. package/skills/ae-analysis/references/project_member_handover_run.md +24 -0
  147. package/skills/ae-analysis/references/project_member_import.md +25 -0
  148. package/skills/ae-analysis/references/project_member_list.md +23 -0
  149. package/skills/ae-analysis/references/project_member_receiver_list.md +23 -0
  150. package/skills/ae-analysis/references/project_member_remove.md +26 -0
  151. package/skills/ae-analysis/references/project_member_update.md +25 -0
  152. package/skills/ae-analysis/references/project_owner_update.md +27 -0
  153. package/skills/ae-analysis/references/project_permission_binding_list.md +24 -0
  154. package/skills/ae-analysis/references/project_receive_status_update.md +25 -0
  155. package/skills/ae-analysis/references/project_role_delete.md +26 -0
  156. package/skills/ae-analysis/references/project_role_function_list.md +27 -0
  157. package/skills/ae-analysis/references/project_role_get.md +24 -0
  158. package/skills/ae-analysis/references/project_role_list.md +25 -0
  159. package/skills/ae-analysis/references/project_role_upsert.md +24 -0
  160. package/skills/ae-analysis/references/project_role_user_list.md +24 -0
  161. package/skills/ae-analysis/references/project_timezone_get.md +23 -0
  162. package/skills/ae-analysis/references/project_timezone_overview.md +23 -0
  163. package/skills/ae-analysis/references/project_timezone_update.md +25 -0
  164. package/skills/ae-analysis/references/project_user_id_items_update.md +24 -0
  165. package/skills/ae-analysis/references/property_list.md +21 -6
  166. package/skills/ae-analysis/references/public_link_create.md +1 -1
  167. package/skills/ae-analysis/references/query_create_result_cluster.md +15 -32
  168. package/skills/ae-analysis/references/report_create.md +1 -1
  169. package/skills/ae-analysis/references/report_data_export.md +5 -3
  170. package/skills/ae-analysis/references/report_data_run.md +13 -3
  171. package/skills/ae-analysis/references/report_get.md +2 -0
  172. package/skills/ae-analysis/references/report_update.md +1 -1
  173. package/skills/ae-analysis/references/sdk_sample_generate.md +24 -0
  174. package/skills/ae-analysis/references/user_cluster_create.md +5 -1
  175. package/skills/ae-analysis/references/user_cluster_create_id.md +2 -0
  176. package/skills/ae-analysis/references/user_cluster_get.md +4 -0
  177. package/skills/ae-analysis/references/user_cluster_refresh.md +4 -2
  178. package/skills/ae-analysis/references/user_cluster_update.md +5 -1
  179. package/skills/ae-analysis/references/user_cluster_update_id.md +2 -0
  180. package/skills/ae-analysis/references/user_tag_create.md +5 -1
  181. package/skills/ae-analysis/references/user_tag_create_id.md +2 -0
  182. package/skills/ae-analysis/references/user_tag_get.md +4 -0
  183. package/skills/ae-analysis/references/user_tag_refresh.md +4 -2
  184. package/skills/ae-analysis/references/user_tag_update.md +5 -1
  185. package/skills/ae-analysis/references/user_tag_update_id.md +2 -0
  186. package/skills/ae-analysis/references/virtual_event_create.md +22 -3
  187. package/skills/ae-analysis/references/virtual_property_create.md +23 -2
  188. package/skills/ae-analysis-global/SKILL.md +2 -0
  189. package/skills/ae-capability/SKILL.md +7 -5
  190. package/skills/ae-community/SKILL.md +72 -8
  191. package/skills/ae-community/references/community-chat-analysis.md +341 -0
  192. package/skills/ae-community/references/community-data-report.md +301 -0
  193. package/skills/ae-dataops/SKILL.md +2 -1
  194. package/skills/ae-engage/SKILL.md +204 -8
  195. package/skills/ae-engage/references/activity-activity-type.md +42 -0
  196. package/skills/ae-engage/references/activity-activity.md +70 -0
  197. package/skills/ae-engage/references/activity-approval.md +53 -0
  198. package/skills/ae-engage/references/activity-task.md +87 -0
  199. package/skills/ae-engage/references/activity-topic.md +98 -0
  200. package/skills/ae-engage/references/approval-approver-delete.md +26 -0
  201. package/skills/ae-engage/references/channel-test-send.md +37 -0
  202. package/skills/ae-engage/references/channel-touch-limits-batch-update.md +28 -0
  203. package/skills/ae-engage/references/channel-touch-limits-save.md +37 -0
  204. package/skills/ae-engage/references/channel-touch-limits-toggle.md +28 -0
  205. package/skills/ae-engage/references/channel-update-config.md +36 -0
  206. package/skills/ae-engage/references/client-param.md +58 -0
  207. package/skills/ae-engage/references/common-metric.md +75 -0
  208. package/skills/ae-engage/references/config-table.md +92 -0
  209. package/skills/ae-engage/references/engage-scene-config-item.md +69 -0
  210. package/skills/ae-engage/references/operation-log-query.md +1 -1
  211. package/skills/ae-engage/references/preset-event.md +42 -0
  212. package/skills/ae-engage/references/push-language.md +39 -0
  213. package/skills/ae-engage/references/scene-config-channel.md +58 -0
  214. package/skills/ae-engage/references/scene-config-group.md +62 -0
  215. package/skills/ae-engage/references/scene-config-item.md +68 -0
  216. package/skills/ae-engage/references/scene-config-metric.md +79 -0
  217. package/skills/ae-engage/references/scene-config-param.md +72 -0
  218. package/skills/ae-engage/references/scene-preset-metric.md +45 -0
  219. package/skills/ae-engage/references/scene-strategy.md +47 -0
  220. package/skills/ae-engage/references/scene-template.md +71 -0
  221. package/skills/ae-engage/references/{ops-delete.md → task-delete.md} +3 -3
  222. package/skills/ae-engage/references/whitelist.md +72 -0
  223. package/skills/ae-engage/references/workbench-workbench.md +48 -0
  224. package/skills/ae-generate-tracking-code/SKILL.md +4 -4
  225. package/skills/ae-generate-tracking-plan/SKILL.md +140 -16
  226. package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +98 -33
  227. package/skills/ae-generate-tracking-plan/references/te-api.md +1 -1
  228. package/skills/ae-generate-tracking-plan/references/xlsx-schema.md +16 -14
  229. package/skills/ae-kb/SKILL.md +36 -9
  230. package/skills/ae-metadata/SKILL.md +3 -2
  231. package/skills/ae-metadata/references/metadata_event_get.md +4 -4
  232. package/skills/ae-metadata/references/metadata_property_dimension_table_bind_existing.md +1 -1
  233. package/skills/ae-metadata/references/metadata_property_get.md +4 -4
  234. package/skills/ae-team/SKILL.md +2 -1
  235. package/dist/chunk-NOO24N7W.js +0 -11
  236. package/dist/chunk-TNW2CI4W.js +0 -129
  237. package/dist/te-common-5NJLF3XG.js +0 -130
  238. package/dist/te-common-7VTJZPII.js +0 -130
  239. package/dist/te-community-PEZ2VEF7.js +0 -687
  240. package/dist/te-community-TSKJ652U.js +0 -687
  241. package/dist/te-engage-BUWVSSSK.js +0 -1912
  242. package/dist/te-engage-EPE3QKDE.js +0 -1912
  243. package/skills/ae-analysis/references/create_metric.md +0 -58
  244. package/skills/ae-analysis/references/create_virtual_event.md +0 -60
  245. package/skills/ae-analysis/references/create_virtual_property.md +0 -69
  246. package/skills/ae-analysis/references/delete_metric.md +0 -32
  247. package/skills/ae-analysis/references/drilldown_users_export.md +0 -17
  248. package/skills/ae-analysis/references/drilldown_users_run.md +0 -61
  249. package/skills/ae-analysis/references/get_metric.md +0 -38
  250. package/skills/ae-analysis/references/get_resource_url.md +0 -33
  251. package/skills/ae-analysis/references/list_events.md +0 -46
  252. package/skills/ae-analysis/references/list_metrics.md +0 -52
  253. package/skills/ae-analysis/references/list_properties.md +0 -47
  254. package/skills/ae-analysis/references/update_metric.md +0 -58
  255. package/dist/{chunk-HL2AJQ4Q.js → chunk-PTE56QPL.js} +3 -3
@@ -0,0 +1,47 @@
1
+ # engage-scene strategy
2
+
3
+ > Capability ids: `engage-scene.strategy.{create,update,log,batch-copy}` · Domain: `engage`.
4
+
5
+ 场景管理 / 配置中心 - 配置项策略管理。create/update 使用 `--payload` 直传后端 DTO(原生 camelCase 结构),`project_id` 会注入 payload。
6
+
7
+ ## Commands
8
+
9
+ ```bash
10
+ # Create a config strategy (draft)
11
+ ae-cli engage-scene strategy create --project-id <project_id> \
12
+ --payload '{"configId":"cfg-1","templateId":"tpl-1","strategyName":"s1", ...}'
13
+
14
+ # Update a config strategy
15
+ ae-cli engage-scene strategy update --project-id <project_id> \
16
+ --payload '{"strategyUuid":"uuid-1","strategyName":"s2", ...}'
17
+
18
+ # Query a strategy's log
19
+ ae-cli engage-scene strategy log --project-id <project_id> --strategy-uuid <uuid>
20
+
21
+ # Batch-copy strategies
22
+ ae-cli engage-scene strategy batch-copy --project-id <project_id> --config-id <config_id> \
23
+ --strategy-ids '["s1","s2"]' [--op-mode batch]
24
+ ```
25
+
26
+ ## Parameters
27
+
28
+ | Command | Required flags | Notes |
29
+ |---|---|---|
30
+ | create | `--project-id`, `--payload` | payload = `ConfigStrategyAddDTO`. |
31
+ | update | `--project-id`, `--payload` | payload = `ConfigStrategyModifyDTO` (`strategyUuid` + fields). |
32
+ | log | `--project-id`, `--strategy-uuid` | read. |
33
+ | batch-copy | `--project-id`, `--config-id`, `--strategy-ids` | `--op-mode` optional (default `batch`). |
34
+
35
+ ## Output
36
+
37
+ - `create`: `data.strategy_uuid`.
38
+ - `update`: `data.success`.
39
+ - `log`: `data.log`.
40
+ - `batch-copy`: `data.result`.
41
+
42
+ ## Decision Rules
43
+
44
+ - Discover real strategy UUIDs / config IDs first; never invent IDs.
45
+ - **`create` requires an enabled template** on the same config item. Enable workflow: `config-param batch-add` → `template create` → `template update` (non-empty `config[]` with real `paramId`) → `template update-status --status 1`. Otherwise `create` returns `TEMPLATE_ENABLE`.
46
+ - `create` output field is `data.strategy_uuid` (not `strategy_id`).
47
+ - Save-and-submit and strategy test-send are not exposed via `engage-scene` CLI; use legacy `engage +manage_strategy` or the product UI.
@@ -0,0 +1,71 @@
1
+ # engage-scene template
2
+
3
+ > Capability ids: `engage-scene.template.{list,get,create,update,update-status,delete}` · Domain: `engage`.
4
+
5
+ 场景管理 / 配置中心 - 配置项模板管理。create/update 使用 `--payload` 直传后端 DTO(原生 camelCase 结构),`project_id` 会注入 payload。
6
+
7
+ ## Commands
8
+
9
+ ```bash
10
+ # List templates of a config item
11
+ ae-cli engage-scene template list --project-id <project_id> --config-id <config_id>
12
+
13
+ # Get a template's detail
14
+ ae-cli engage-scene template get --project-id <project_id> --config-id <config_id> --template-id <template_id>
15
+
16
+ # Create a template
17
+ ae-cli engage-scene template create --project-id <project_id> \
18
+ --payload '{"configId":"cfg-1","templateId":"tpl-1","templateName":"t1","remark":""}'
19
+
20
+ # Update a template (bind config-item params into template.config — required before enable)
21
+ ae-cli engage-scene template update --project-id <project_id> \
22
+ --payload '{
23
+ "configId":"cfg-1",
24
+ "templateId":"tpl-1",
25
+ "templateName":"t1",
26
+ "config":[{
27
+ "paramId":48,
28
+ "paramName":"title",
29
+ "paramDisplayName":"标题",
30
+ "paramType":"STRING",
31
+ "paramSubType":"SHORT_TEXT",
32
+ "isRequired":1,
33
+ "defaultValue":"hello"
34
+ }]
35
+ }'
36
+
37
+ # Enable / disable a template (only after config[] is non-empty)
38
+ ae-cli engage-scene template update-status \
39
+ --project-id <project_id> --config-id <config_id> --template-id <template_id> --status <1|0>
40
+
41
+ # Delete a template (high-risk)
42
+ ae-cli engage-scene template delete --project-id <project_id> --config-id <config_id> --template-id <template_id> --yes
43
+ ```
44
+
45
+ ## Parameters
46
+
47
+ | Command | Required flags | Notes |
48
+ |---|---|---|
49
+ | list | `--project-id`, `--config-id` | read. |
50
+ | get | `--project-id`, `--config-id`, `--template-id` | read. |
51
+ | create | `--project-id`, `--payload` | payload = `ConfigTemplateAddDTO`. |
52
+ | update | `--project-id`, `--payload` | payload = `ConfigTemplateModifyDTO`. |
53
+ | update-status | `--project-id`, `--config-id`, `--template-id`, `--status` | status 1 enable / 0 disable. |
54
+ | delete | `--project-id`, `--config-id`, `--template-id` | high-risk. |
55
+
56
+ `template update-status --validate` and `--dry-run` perform the same read-only business preflight as execution. They reject incomplete template fields, missing dependency configuration, unsupported status transitions, and status values other than `0` or `1` before any template state is changed.
57
+
58
+ ## Output
59
+
60
+ - `list`: `data.items` + `data.total`.
61
+ - `get`: `data.template`.
62
+ - `create` / `update` / `update-status` / `delete`: `data.success`.
63
+
64
+ ## Decision Rules
65
+
66
+ - `delete` is `high-risk-write`; requires `--yes` and does not support dry-run.
67
+ - Discover real template IDs with `list`/`get` first; never invent IDs.
68
+ - **`create` requires `templateId` in payload** (unique within config item, <=80 chars), not only `templateName`.
69
+ - **Enable workflow:** (1) `config-param batch-add` on the config item → (2) `template create` → (3) **`template update` with non-empty `config[]`** referencing real `paramId` values from `config-param list` → (4) `template update-status --status 1`. Skipping step 3 returns `TEMPLATE_FIELDS_INCOMPLETE`.
70
+ - Enabling a template is a prerequisite for `strategy create` on the same config (`TEMPLATE_ENABLE` if template disabled).
71
+ - Template test-send is not exposed via `engage-scene` CLI; use the product UI.
@@ -1,11 +1,11 @@
1
- # engage-task ops delete
1
+ # engage-task task delete
2
2
 
3
3
  Delete an engagement task. High-risk write; requires `--yes` to skip confirmation.
4
4
 
5
- > Capability id: `engage-task.ops.delete` · Domain: `engage`.
5
+ > Capability id: `engage-task.task.delete` · Domain: `engage`.
6
6
 
7
7
  ```bash
8
- ae-cli engage-task ops delete --project-id <project-id> --task-id <task-id> --yes
8
+ ae-cli engage-task task delete --project-id <project-id> --task-id <task-id> --yes
9
9
  ```
10
10
 
11
11
  ## Parameters
@@ -0,0 +1,72 @@
1
+ # engage-setting whitelist
2
+
3
+ > Capability ids: `engage-setting.whitelist.{add,update,delete,verify}` · Domain: `engage`.
4
+
5
+ ## Commands
6
+
7
+ ```bash
8
+ # Add whitelist entries
9
+ ae-cli engage-setting whitelist add \
10
+ --project-id <project_id> --prop-code <prop_code> --column-name <column_name> \
11
+ --column-type <column_type> \
12
+ --whitelist-list '[{"entity_id":"u1","source_value":"v1","note_name":"n"}]'
13
+
14
+ # Update a whitelist entry's note name
15
+ ae-cli engage-setting whitelist update --project-id <project_id> --whitelist-id <id> --note-name <name>
16
+
17
+ # Delete whitelist entries (high-risk)
18
+ ae-cli engage-setting whitelist delete --project-id <project_id> --whitelist-ids '["wl-1","wl-2"]' --yes
19
+
20
+ # Verify property values against the whitelist
21
+ ae-cli engage-setting whitelist verify \
22
+ --project-id <project_id> --prop-code <prop_code> --column-type <column_type> \
23
+ --whitelist-prop-list '["v1","v2"]'
24
+ ```
25
+
26
+ ## Parameters
27
+
28
+ ### add
29
+
30
+ | Parameter | Required | Description |
31
+ |---|---|---|
32
+ | `--project-id` / `-p` | Yes | Numeric project ID. |
33
+ | `--prop-code` | Yes | Associated user property code. |
34
+ | `--column-name` | Yes | Associated user property field name. |
35
+ | `--column-type` | Yes | Associated user property field type. |
36
+ | `--whitelist-list` | Yes | JSON array of entries (`entity_id`, `source_value`, `note_name`). |
37
+
38
+ ### update
39
+
40
+ | Parameter | Required | Description |
41
+ |---|---|---|
42
+ | `--project-id` / `-p` | Yes | Numeric project ID. |
43
+ | `--whitelist-id` | Yes | Whitelist entry ID to modify. |
44
+ | `--note-name` | No | New note name. |
45
+
46
+ ### delete
47
+
48
+ | Parameter | Required | Description |
49
+ |---|---|---|
50
+ | `--project-id` / `-p` | Yes | Numeric project ID. |
51
+ | `--whitelist-ids` | Yes | JSON array of whitelist entry IDs. |
52
+
53
+ ### verify
54
+
55
+ | Parameter | Required | Description |
56
+ |---|---|---|
57
+ | `--project-id` / `-p` | Yes | Numeric project ID. |
58
+ | `--prop-code` | Yes | Associated user property code. |
59
+ | `--column-type` | Yes | Associated user property field type. |
60
+ | `--whitelist-prop-list` | Yes | JSON array of property values to verify. |
61
+
62
+ ## Output
63
+
64
+ - `add`: `data.success_num` — number of entries successfully added.
65
+ - `update` / `delete`: `data.success` — whether the operation succeeded.
66
+ - `verify`: `data.items` (verified entries with `entity_id`, `source_value`, `note_name`, `fail_msg`) and `data.total`.
67
+
68
+ ## Decision Rules
69
+
70
+ - Use these commands when the user asks to add / edit / delete / verify project whitelist entries.
71
+ - Discover existing whitelist IDs with `ae-cli engage +whitelist_list --project_id <project_id>` first; never invent IDs.
72
+ - `delete` is `high-risk-write` and requires `--yes` (or interactive confirmation).
@@ -0,0 +1,48 @@
1
+ # engage-workbench workbench
2
+
3
+ > Capability ids: `engage-workbench.workbench.{list,add,update,delete}` · Domain: `engage`.
4
+
5
+ 工作台 - 工作台指标卡槽(workbench slot)管理。每个用户在每个项目下最多 4 个指标卡;卡槽按当前登录用户隔离,`update`/`delete` 只能操作本人卡槽。首次 `list` 会自动初始化 4 个默认卡槽。
6
+
7
+ ## Commands
8
+
9
+ ```bash
10
+ # List the current user's workbench metric slots
11
+ ae-cli engage-workbench workbench list --project-id <project_id>
12
+
13
+ # Add a metric slot (metric + date range + order)
14
+ ae-cli engage-workbench workbench add --project-id <project_id> \
15
+ --metric-type <metric_type> --date-type <date_type> [--order-id <1-4>]
16
+
17
+ # Update a slot (own slot only)
18
+ ae-cli engage-workbench workbench update --project-id <project_id> \
19
+ --slot-id <slot_id> --metric-type <metric_type> --date-type <date_type> [--order-id <1-4>]
20
+
21
+ # Delete a slot (own slot only, high-risk)
22
+ ae-cli engage-workbench workbench delete --project-id <project_id> --slot-id <slot_id> --yes
23
+ ```
24
+
25
+ ## Parameters
26
+
27
+ | Command | Required flags | Notes |
28
+ |---|---|---|
29
+ | list | `--project-id` / `-p` | read; auto-inits 4 defaults on first access. |
30
+ | add | `--project-id`, `--metric-type`, `--date-type` | write; `--order-id` optional (1-4); max 4 slots. |
31
+ | update | `--project-id`, `--slot-id`, `--metric-type`, `--date-type` | write; own slot only; `--order-id` optional. |
32
+ | delete | `--project-id`, `--slot-id` | high-risk; requires `--yes`; no dry-run; soft-delete. |
33
+
34
+ - `--metric-type`: `WorkbenchSlotMetricTypeEnum` code (1-12), e.g. 1=PLAN, 2=PUSH_SUCCESS_PERSON, 5=NEW_USER_COUNT.
35
+ - `--date-type`: `WorkbenchSlotDateTypeEnum` code (1-13), e.g. 8=LAST_7_DAYS, 10=LAST_30_DAYS, 11=CURRENT.
36
+
37
+ ## Output
38
+
39
+ - `list`: `data.slots` (array of slot cards: `slot_id`, `metric_code`, `metric_name`, `date_code`, `date_name`, `value`, `order_id`, `status`, ...).
40
+ - `add` / `update`: `data.slot` (the created/updated slot card).
41
+ - `delete`: `data.success`.
42
+
43
+ ## Decision Rules
44
+
45
+ - Discover real `slot_id` via `list` first; never invent slot IDs.
46
+ - The same `(metric_type, date_type)` combination cannot be added twice for the same user+project.
47
+ - `add` fails once the user already has 4 slots; remove one with `delete` first.
48
+ - `delete` is `high-risk-write`; it requires `--yes` and does not support dry-run.
@@ -118,15 +118,15 @@ First, check if both `.ae-cli/draft.json` and `.ae-cli/draft.xlsx` exist:
118
118
  - Reference: tracking plan document (Feishu: https://www.feishu.cn/docx/Jt0VdhNB6oSJ4TxISs1cq2Ebnmg)
119
119
 
120
120
  2. **If you already have a tracking plan**
121
- - Provide the xlsx file path and use `ae-cli tracking code import-xlsx` to import
121
+ - Provide the xlsx file path and use `ae-cli tracking code import-template --template` to import
122
122
  - Or place the xlsx file at `.ae-cli/draft.xlsx` and re-run
123
123
 
124
- **If xlsx file exists** (provided via `ae-cli tracking code import-xlsx` or placed at `.ae-cli/draft.xlsx`):
124
+ **If xlsx file exists** (provided via `ae-cli tracking code import-template --template` or placed at `.ae-cli/draft.xlsx`):
125
125
 
126
126
  **Step 1: Parse the xlsx file**
127
127
 
128
128
  ```bash
129
- ae-cli tracking code import-xlsx --xlsx <xlsx-path> --out .ae-cli/draft.json
129
+ ae-cli tracking code import-template --template <xlsx-path> --out .ae-cli/draft.json
130
130
  ```
131
131
 
132
132
  This command:
@@ -155,7 +155,7 @@ This command:
155
155
  - `服务端` / `server` → server-only collection, parsed as `platform: "server"`
156
156
  - `客户端,服务端` / `client,server` / `服务端,客户端` / `server,client` → both platforms, parsed as `platform: "both"`
157
157
 
158
- **Internal representation**: xlsx "Platform" column values are parsed by `ae-cli tracking code import-xlsx` into internal `platform` field values:
158
+ **Internal representation**: xlsx "Platform" column values are parsed by `ae-cli tracking code import-template --template` into internal `platform` field values:
159
159
  - `client` → client-side collection
160
160
  - `server` → server-side collection
161
161
  - `both` → both platforms
@@ -9,7 +9,8 @@ description: "Interactive generation of an AE tracking plan and upload. Trigger
9
9
  > English input → English reply; Chinese input → Chinese reply; Japanese input → Japanese reply.
10
10
  > If uncertain, default to English.
11
11
  > This applies to all output: section titles, phase names, template prompts, example text, option lists, etc.
12
- > **⚠️ CRITICAL: Template localization is CLI-owned. Do NOT manually translate imported template content with the model. Use the `src/tracking` i18n pipeline by setting `AE_LANG=<user_lang>`, writing `draft.meta.lang`, and regenerating through `ae-cli tracking code import-template` / `ae-cli tracking plan draft`.**
12
+ > **⚠️ CRITICAL: Template localization is CLI-owned. Do NOT manually translate imported template content with the model. Use the `src/tracking/i18n` module as the source of truth by setting `AE_LANG=<user_lang>`, writing `draft.meta.lang`, and regenerating through `ae-cli tracking code import-template` / `ae-cli tracking plan draft`.**
13
+ > **Before changing any template-owned localized label, first look up the corresponding translation in `src/tracking/i18n` (for example `resources/xlsx/sheets.ts`, `resources/xlsx/headers.ts`, `resources/xlsx/types.ts`, and `resources/cli/*.json`). If no matching translation exists there, preserve the imported text and ask before rewriting business semantics.**
13
14
  > Do NOT copy Chinese text verbatim from this document into English/Japanese replies unless it is an identifier, template name needed for CLI import, or original source material quoted for traceability.
14
15
 
15
16
  ## Terminology Glossary
@@ -32,8 +33,9 @@ description: "Interactive generation of an AE tracking plan and upload. Trigger
32
33
  | 用户属性 | User Property | Property on the user profile (persistent state) |
33
34
  | 预置属性 | Preset Property | System property prefixed with `#` (`#device_id`, `#time`, etc.) |
34
35
  | 自动采集事件 | Auto-track Event | SDK auto-collected events (`ta_app_start`, `ta_page_show`, etc.) |
35
- | 系统事件 | System Event | Auto-track event tag category |
36
- | 业务事件 | Business Event | Custom business event tag category |
36
+ | 系统事件 | System Event | event_tag value reserved for SDK auto-track events (`ta_*`). One of two non-module tags (together with 基础事件). |
37
+ | 基础事件 | Basic | event_tag value for account-level lifecycle/progression events (register, login, level_up, create_role, etc.). Not tied to any functional module. |
38
+ | 功能模块 | Functional Module | event_tag value for feature-specific business events; identifies which module the event belongs to (e.g. Battle, Shop, Ads, Payment, Basic) |
37
39
  | SDK 集成模式 | SDK Integration Mode | `client_only` / `server_only` / `both` / `none` |
38
40
  | 客户端平台 | Client Platform | Android, iOS, Web, Unity, Mini-program, etc. |
39
41
  | 服务端语言 | Server Language | Java, Python, Go, Node.js, PHP, etc. |
@@ -53,7 +55,7 @@ description: "Interactive generation of an AE tracking plan and upload. Trigger
53
55
  | xlsx 格式契约 | xlsx Format Contract | Column rules for AE-compatible Excel generation |
54
56
  | draft.json | draft.json | Internal intermediate representation (JSON) of the tracking plan |
55
57
  | display_name | Display Name | Human-readable name in the user's language |
56
- | event_tag | Event Tag | Category label for grouping events |
58
+ | event_tag | Event Tag | Functional module the event belongs to (e.g. Battle, Shop, Ads, Payment). Auto-track events use "System Event". |
57
59
  | snake_case | snake_case | Canonical naming format: `lowercase_with_underscores` |
58
60
 
59
61
  ## When to Trigger
@@ -72,6 +74,7 @@ Phase 0 → 1 → 2 → 3 → 4, do not skip steps.
72
74
  > property `display_name`, property `desc`, etc.) should be generated in the **user's input language**.
73
75
  > For imported templates, do NOT translate those fields manually. Template sheet names, headers, property type display values,
74
76
  > CLI messages, and auto-track/i18n-owned labels must come from `src/tracking/i18n` via `AE_LANG=<user_lang>` and `draft.meta.lang`.
77
+ > When a localized label is needed, inspect `src/tracking/i18n` and use the existing resource key/value; do not invent translations from the model.
75
78
  > If template business text needs localization and the CLI/i18n resources do not provide it, preserve the imported text and ask the user before rewriting business semantics.
76
79
  > Only identifier fields like `event_name`, `prop_name` remain in English snake_case (canonical format).
77
80
  > This skill only cares about command behavior, not internal implementation.
@@ -86,7 +89,7 @@ Phase 0 → 1 → 2 → 3 → 4, do not skip steps.
86
89
  > All subsequent CLI commands must be prefixed with `AE_LANG=<user_lang>` to ensure CLI output and generated xlsx headers match the user's language.
87
90
  > When uploading the xlsx, pass `--lang <user_lang>` as well; it must match `draft.meta.lang` / the generated xlsx language.
88
91
 
89
- Collect the following **4 items** sequentially, **do NOT ask all at once**:
92
+ Collect the following **5 items** sequentially, **do NOT ask all at once**:
90
93
 
91
94
  ### Item 1 — Application Scenario
92
95
 
@@ -109,8 +112,9 @@ Choose your source material (up to 2):
109
112
  2 - Detailed description (conversational) — Describe app business flow, core features, user behaviors, monetization model, etc.
110
113
  3 - Codebase (local project path; hidden in sandbox) — Analyze source code to extract events and properties
111
114
  4 - Pre-built template (built-in industry and game genre templates) — Select a built-in template
115
+ 5 - Modify existing tracking plan (local AE format xlsx file) — Import an existing tracking plan xlsx as baseline for modification; can be combined with Product doc / Description / Codebase, but NOT with Pre-built template
112
116
 
113
- Reply with number(s), e.g. 1 or 1,4. Select up to 2.
117
+ Reply with number(s), e.g. 1,5 or 4. Select up to 2.
114
118
  ```
115
119
 
116
120
  If in a sandbox environment, ask exactly:
@@ -121,8 +125,9 @@ Choose your source material (up to 2):
121
125
  1 - Product document (sandbox workspace path, uploaded attachment, URL, image file, or folder) — Extract events and properties from product docs; supports md/pdf/docx/URL/images (png/jpg/jpeg/webp). You can attach/upload relevant files here.
122
126
  2 - Detailed description (conversational) — Describe app business flow, core features, user behaviors, monetization model, etc.
123
127
  3 - Pre-built template (built-in industry and game genre templates) — Select a built-in template
128
+ 4 - Modify existing tracking plan (sandbox workspace path) — Import an existing tracking plan xlsx as baseline for modification; can be combined with Product doc / Description, but NOT with Pre-built template
124
129
 
125
- Reply with number(s), e.g. 1 or 1,3. Select up to 2.
130
+ Reply with number(s), e.g. 1,4 or 3. Select up to 2.
126
131
  ```
127
132
 
128
133
  Do not rewrite this source material list as unnumbered bullets, cards, or prose. The user must be able to reply with the visible numbers.
@@ -145,9 +150,11 @@ Based on user selection, determine source material type and record to `meta.sour
145
150
  | Description only | `chat` | Construct events in Draft phase based on description |
146
151
  | Codebase only | `codebase` | Scan source code, extract events/properties from business logic |
147
152
  | Template only | `template` | Provide built-in template selection |
148
- | Any two-item combo | Join two types with `_` | First as baseline, second as supplement (priority: template codebase prd → chat) |
153
+ | Existing plan only | `existing_plan` | Import xlsx as baseline (see "Modify Existing Tracking Plan Flow" below) |
154
+ | Any two-item combo | Join two types with `_` | First as baseline, second as supplement (priority: existing_plan → template → codebase → prd → chat) |
155
+ | Existing plan + Pre-built template | **NOT allowed** | Both provide event baselines; semantic conflict |
149
156
 
150
- **Follow-up questions** (ask in selection order):
157
+ **Follow-up questions** (ask in follow-up order defined in Multi-Source Combination Rules below):
151
158
  - Product doc → if not in a sandbox environment, ask exactly:
152
159
  ```text
153
160
  What is the product document path?
@@ -174,6 +181,49 @@ Based on user selection, determine source material type and record to `meta.sour
174
181
  - Detailed description → If too vague, follow up on core features, user behaviors, business flows, monetization
175
182
  - Codebase → ask **"What is the project directory path?"**, then scan source to extract business logic
176
183
  - Pre-built template → display matching templates for user confirmation
184
+ - Modify existing tracking plan → ask **"Please provide the xlsx file path of your existing tracking plan"**, then follow the flow below
185
+
186
+ **Modify Existing Tracking Plan Flow** (when user selects this option):
187
+
188
+ 1. **Import**: Ask user for the file path, then immediately import:
189
+ ```bash
190
+ AE_LANG=<user_lang> ae-cli tracking code import-template --template <path> --out .ae-cli/draft.json
191
+ ```
192
+ 2. **Check result**:
193
+ - If CLI errors (file not found / parse failure) → report error, ask user to fix the file and retry
194
+ - If `draft.json` has `events` array empty → 🛑 **Severe: No AE-format sheets found** (missing `#` prefix sheets like `#事件数据`). Tell user the file does not appear to be an AE tracking plan xlsx. User must fix the original file and re-import.
195
+ 3. **Content validation** (when events are non-empty):
196
+ ```bash
197
+ AE_LANG=<user_lang> ae-cli tracking plan validate --in .ae-cli/draft.json --fix
198
+ ```
199
+ 4. **Handle validation results by severity**:
200
+ - If validate passes with **no issues at all** → skip to Step 5.
201
+
202
+ | Severity | Examples | Handling | User Action |
203
+ |---|---|---|---|
204
+ | 🔧 **Minor** (auto-fixable) | `display_name` duplicate, `array_row` sub-property inconsistency, event name duplicate | `--fix` auto-fixes, writes to `draft.json`. Inform user of what was fixed. | None (informed) |
205
+ | ⚠️ **Medium** (needs confirmation) | snake_case violation, property name duplicate, invalid property type, nested property parent is not a composite type | List each issue with current value → suggested fix. User confirms item by item before writing to `draft.json`. | Confirm each fix |
206
+ | 🛑 **Severe** | File cannot be parsed, or events array is empty after import | Reject. Tell user the specific issue. User fixes **original file** and re-imports. | Fix original file |
207
+
208
+ **Medium issue confirmation format**:
209
+ ```
210
+ ⚠️ The following content needs to be fixed:
211
+
212
+ | # | Issue | Location | Current | Suggested |
213
+ |---|-------|----------|---------|------------|
214
+ | 1 | snake_case | event_name | UserLogin | user_login |
215
+ | 2 | snake_case | prop_name | vipLevel | vip_level |
216
+ | 3 | invalid type | property "level" | integer | number |
217
+
218
+ Apply all suggested fixes? ok / specify per item / skip
219
+ ```
220
+ - `ok` → apply all suggested fixes to `draft.json`
221
+ - `specify per item` → confirm each item one by one
222
+ - `skip` → keep current values, handle in Refine phase later
223
+
224
+ ⚠️ **Never modify the user's original xlsx file.** All changes go into `draft.json`.
225
+
226
+ 5. **Re-validate** after fixes → loop until clean, then continue to the next follow-up question (if combined with another source material), or Item 3 (if existing_plan is the only source).
177
227
 
178
228
  **Codebase analysis flow** (when source_type includes `codebase`):
179
229
 
@@ -194,9 +244,11 @@ After source material is confirmed, **must** process business dimension info bas
194
244
  | source_type | Handling |
195
245
  |---|---|
196
246
  | `template` | Directly display template's inherited business dimensions; skip detailed inference |
247
+ | `existing_plan` | Infer business dimensions from existing plan content (analyze event modules, payment events, currency properties); follow up on missing items; event injection preview |
197
248
  | `prd` / `codebase` / `chat` | Infer business dimensions → follow up on missing items → event injection preview |
249
+ | Combo (e.g. `template_prd`) | See detailed rules below — baseline source's method is primary, supplementary source contributes additional context |
198
250
 
199
- **If source_type = template**:
251
+ **If source_type is template or starts with template_** (covers `template`, `template_prd`, `template_codebase`, `template_chat`):
200
252
 
201
253
  Display template's preset business dimensions:
202
254
 
@@ -213,6 +265,27 @@ Confirm using these business dimensions? ok / modify
213
265
 
214
266
  - User `ok` → proceed to next step
215
267
  - User says "modify" → switch to prd/chat flow for user to supplement
268
+ - For combos (e.g. `template_prd`): after confirming template dimensions, also note any supplementary insights from `prd`/`chat` as context for Phase 1.2.
269
+
270
+ **If source_type includes existing_plan**:
271
+
272
+ Infer business dimensions from the imported plan content:
273
+
274
+ 1. **Analyze existing events**: Examine `event_tag` values to identify functional modules (e.g. events tagged "Battle" → 战斗 module). Examine event names for payment/ad-related patterns to infer revenue model.
275
+ 2. **Inference display**: Format inference results as a summary:
276
+ ```
277
+ Business Dimension (inferred from existing plan: <filename>)
278
+
279
+ Revenue Model: <inferred from payment/ad events>
280
+ Core Loop: <inferred from event flow>
281
+ Functional Entries: <inferred from event_tag values>
282
+ Currency System: <inferred from currency-related properties>
283
+
284
+ Confirm these business dimensions? ok / modify
285
+ ```
286
+ 3. **Follow up missing**: Only ask about items that could not be inferred
287
+ 4. **Event injection preview**: Show suggested injected event modules (only add events not already in the plan); user `ok` to proceed
288
+ - For combos (e.g. `existing_plan_prd`): after confirming dimensions from the plan, also note any supplementary insights from `prd`/`chat` as context for Phase 1.2.
216
289
 
217
290
  **If source_type is prd / codebase / chat**:
218
291
 
@@ -222,7 +295,7 @@ Confirm using these business dimensions? ok / modify
222
295
 
223
296
  Platform validation: Use `business-dimension-mapping.md` Chapter 5 decision rules to check if injected events' platform assignments are reasonable.
224
297
 
225
- **Template matching** (prd / codebase / chat scenarios, optional):
298
+ **Template matching** (prd / codebase / chat scenarios, optional; **NOT applicable to existing_plan or template scenarios**):
226
299
 
227
300
  After business dimension confirmation, auto-detect matching templates based on app type:
228
301
  ```bash
@@ -231,6 +304,51 @@ AE_LANG=<user_lang> ae-cli tracking plan list-templates --json
231
304
 
232
305
  Show matching templates to user for confirmation. Confirmed templates serve as baseline and participate in Phase 1 event merging.
233
306
 
307
+ ### Multi-Source Combination Rules (when user selects 2 source materials)
308
+
309
+ **Follow-up Order** (Phase 0 questioning sequence):
310
+
311
+ Do **not** follow user's selection order. Instead, use this order:
312
+
313
+ ```
314
+ existing_plan(blocking validation, always first)→ codebase/prd(user's selection order)→ chat → template
315
+ ```
316
+
317
+ Rationale:
318
+ - `existing_plan` must go first — import + validate may require the user to fix their file; processing it early avoids wasted context
319
+ - `codebase` / `prd` — directly reflect actual business requirements, prioritized over generic descriptions and templates
320
+ - `chat` — conversational description, supplements business context
321
+ - `template` — generic industry template, least specific to the user's business
322
+
323
+ Source material processing happens primarily in Phase 1.2 (Merge Source Materials). The one exception is `existing_plan`: it is imported and validated in Phase 0 because user-provided files may need fixing before proceeding. All other sources are processed in Phase 1.2 per their standard flow.
324
+
325
+ Merge priority (Phase 1.2): `existing_plan → template → codebase → prd → chat → autotrack`
326
+ Earlier sources take precedence — same-name events keep the earlier version, later sources only add new events or merge `prop_names` without overwriting.
327
+
328
+ **Business Dimension Inference (combined scenarios)**:
329
+
330
+ Use the baseline source's inference method as primary. Supplementary sources (especially prd/chat) may contribute additional information — present a merged view for user confirmation.
331
+
332
+ **Valid Combinations**:
333
+
334
+ > The "Baseline" column identifies which source has higher merge priority (see Phase 1.2 merge order), which may differ from the user's selection order. Follow-up questioning uses the fixed order in "Multi-Source Combination Rules" above, not the user's selection order.
335
+
336
+ | Baseline | Supplementary | Phase 0 for supplementary |
337
+ |---|---|---|
338
+ | existing_plan | codebase | Collect path + quick tech stack detection |
339
+ | existing_plan | prd | Collect path |
340
+ | existing_plan | chat | Collect description; participates in dimension inference |
341
+ | template | codebase | Collect path + quick tech stack detection; template matching/import deferred to Phase 1.2 |
342
+ | template | prd | Collect path; template matching/import deferred to Phase 1.2 |
343
+ | template | chat | Collect description |
344
+ | codebase | prd | Collect path |
345
+ | codebase | chat | Collect description |
346
+ | prd | chat | Collect description |
347
+ | codebase | template | Same as template+codebase row above (template is baseline per merge priority) |
348
+ | prd | template | Same as template+prd row above (template is baseline per merge priority) |
349
+
350
+ **Forbidden**: `existing_plan + template` (both provide event baselines; semantic conflict).
351
+
234
352
  **Record business dimension info to `meta.business_dimension`**:
235
353
  ```json
236
354
  "business_dimension": {
@@ -491,15 +609,19 @@ Draft
491
609
 
492
610
  ### 1.2 Merge Source Materials
493
611
 
494
- Priority from low to high: **template → codebase → prd → chat → autotrack**
612
+ Merge order: **existing_plan template → codebase → prd → chat → autotrack**
495
613
 
614
+ Earlier sources take precedence — same-name events keep the earlier version, later sources only add new events or merge `prop_names` without overwriting.
615
+
616
+ - **existing_plan**: Already imported and validated in Phase 0 (see "Modify Existing Tracking Plan Flow"). Events are in draft.json as the baseline; each item marked `source: "existing_plan"`. Higher-priority sources supplement with new events only; same-name events keep the existing_plan version.
496
617
  - **template**: User-selected industry template (see "Template Lookup Convention" below) as baseline; each item marked `source: "template"`
497
618
  - Templates are resolved by ae-cli from the ae-cli package root and user template directory
498
619
  - Import command: `AE_LANG=<user_lang> ae-cli tracking code import-template --template-name "<template name>" --out .ae-cli/draft.json`
499
620
  - ⚠️ **Must validate immediately after template import** (see Phase 1.6); template content may not be fully correct
500
621
  - ⚠️ **Do not manually translate template content after import**: Do NOT read draft.json and model-translate `display_name`, `event_desc`, `event_tag`, or property `display_name`/`desc`. Keep imported business content as produced by the CLI/template reader unless the user explicitly asks for semantic rewriting.
501
- - ⚠️ **Use `src/tracking` i18n for localization owned by the CLI**: `AE_LANG=<user_lang>` + `draft.meta.lang` control CLI messages, xlsx sheet names, xlsx headers, property type display values, and auto-track/i18n-owned labels. If these are wrong, regenerate with the intended locale instead of editing labels by hand.
502
- - ⚠️ **event_tag is not free-form model translation**: Do not manually map `业务事件`/`系统事件` to another language. Preserve template tags, or rely on `src/tracking` i18n/autotrack generation for system labels when the CLI owns them.
622
+ - ⚠️ **Use `src/tracking/i18n` for localization owned by the CLI**: `AE_LANG=<user_lang>` + `draft.meta.lang` control CLI messages, xlsx sheet names, xlsx headers, property type display values, and auto-track/i18n-owned labels. If these are wrong, inspect the existing translations under `src/tracking/i18n`, then regenerate with the intended locale instead of editing labels by hand.
623
+ - ⚠️ **No model-invented translations for template labels**: When replacing or explaining a localized template-owned label, use the exact value from `src/tracking/i18n` resources. If no corresponding resource exists, preserve the template text and ask the user before changing semantics.
624
+ - ⚠️ **event_tag is not free-form model translation**: Do not manually map `业务事件`/`系统事件` to another language. Preserve template tags, or rely on `src/tracking/i18n` and autotrack generation for system labels when the CLI owns them.
503
625
  - **codebase**: Scan project source directory, extract events/properties from business logic; **same-name events merge prop_names without overwriting existing fields**; new items `source: "codebase"`
504
626
  - **prd**: Read all user-provided product documents (md / pdf / docx / URL / images), extract events and properties from each file; **same-name events merge prop_names without overwriting existing fields**; image files analyzed via multimodal interpretation of UI elements and interaction flows; all new items `source: "prd"`
505
627
  - **prd path is a folder**: Recursively scan all files in the directory:
@@ -654,6 +776,8 @@ AE_LANG=<user_lang> ae-cli tracking plan draft --in .ae-cli/draft.json --out .ae
654
776
 
655
777
  **Note**: Display names can be the same across different property pools (e.g. `vip_level` can be both an event property and a user property).
656
778
 
779
+ > **Relationship to Phase 0 existing_plan validation**: The underlying rule engine is the same, but Phase 0 uses **interactive 3-tier** (Minor/Medium/Severe) because the user is present to confirm each fix. Phase 1.6 uses **batch 2-tier** (auto-fixable / manual-fix-needed) because it runs as part of the automated draft generation. Rules that are "Medium (needs confirmation)" in Phase 0 appear as "❌ Manual fix needed" here — the same rule, just without the interactive prompt.
780
+
657
781
  ### 1.7 Show Summary
658
782
 
659
783
  Display to user via markdown table: event count / event property pool size / super property count / user property count; show deliverable paths.
@@ -673,7 +797,7 @@ Run the following command to dynamically discover available templates:
673
797
  AE_LANG=<user_lang> ae-cli tracking plan list-templates --json
674
798
  ```
675
799
 
676
- **Language rules**: Template names and template business content must not be model-translated. Use localized names only when they are returned by the CLI / `src/tracking` i18n resources. If `list-templates --json` only returns the original template `name`, display that name as-is and keep it unchanged for import.
800
+ **Language rules**: Template names and template business content must not be model-translated. Use localized names only when they are returned by the CLI or found in `src/tracking/i18n` resources. If `list-templates --json` only returns the original template `name`, display that name as-is and keep it unchanged for import. Before presenting or modifying any localized template-owned label, look it up in `src/tracking/i18n`; do not invent a translation.
677
801
 
678
802
  Built-in templates are resolved by ae-cli from the ae-cli package root. User templates are resolved from the ae-cli user template directory. Do **not** manually construct `./tracking-plan-template/...` paths from the user's current workspace.
679
803
 
@@ -1116,7 +1240,7 @@ AE_LANG=<user_lang> ae-cli tracking plan upload --project <projectId> --xlsx .ae
1116
1240
  - **With `--replace`**: Delete existing project plan first then upload (when user chooses "Replace", or severe conflict switches to replace)
1117
1241
  - **Without `--replace`**: AE merge-by-name merge (no conflicts, or advisory only with user confirmation to append)
1118
1242
 
1119
- Upload language is controlled locally by `AE_LANG`, `--lang`, or `draft.meta.lang`. Do not call AE user language config APIs and do not use `--switch-lang`. If the xlsx language is wrong, regenerate the xlsx with the intended language before uploading:
1243
+ Upload commands MUST pass `--lang <user_lang>` explicitly. `--lang` must match the generated xlsx language and `draft.meta.lang`; `AE_LANG` is only used for CLI messages and xlsx regeneration context. Do not call AE user language config APIs and do not use `--switch-lang`. If the xlsx language is wrong, regenerate the xlsx with the intended language before uploading:
1120
1244
  ```bash
1121
1245
  AE_LANG=<user_lang> ae-cli tracking plan draft --in .ae-cli/draft.json --out .ae-cli/draft.xlsx
1122
1246
  AE_LANG=<user_lang> ae-cli tracking plan upload --project <projectId> --xlsx .ae-cli/draft.xlsx --draft .ae-cli/draft.json --lang <user_lang> [--replace]