@thinkingai/ae-cli 6.1.30 → 6.1.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 (294) hide show
  1. package/README.md +16 -7
  2. package/README.zh.md +18 -7
  3. package/bin/ai-monitor.js +2 -0
  4. package/bin/runtime-capabilities.json +1 -1
  5. package/dist/ai-monitor-OHTSU6SV.js +33 -0
  6. package/dist/ai-monitor.js +136 -0
  7. package/dist/{auth-ADZHUIJR.js → auth-2MOK4OI6.js} +24 -14
  8. package/dist/{automation-FD2QZUP6.js → automation-6L6IAYRK.js} +6 -7
  9. package/dist/{capability-QXFRJYZD.js → capability-EMIHQJA3.js} +31 -34
  10. package/dist/{chunk-OAWPT7VP.js → chunk-2I5SZ5DS.js} +2 -2
  11. package/dist/{chunk-HRUOV6EQ.js → chunk-4IQYPWCX.js} +22 -21
  12. package/dist/{chunk-EUFP4M2A.js → chunk-7DHSB3FL.js} +85 -33
  13. package/dist/{chunk-4PSTYEG5.js → chunk-AMURHMS3.js} +11 -7
  14. package/dist/{chunk-KPQY44JQ.js → chunk-AWW2T2WL.js} +3 -0
  15. package/dist/chunk-BQFLABJQ.js +186 -0
  16. package/dist/{chunk-E25OSZLJ.js → chunk-COOMXFUG.js} +3 -3
  17. package/dist/{chunk-AVXDJAFC.js → chunk-DWAG2QJM.js} +52 -15
  18. package/dist/{chunk-CG773QXN.js → chunk-E3ONSFUN.js} +528 -299
  19. package/dist/chunk-EFGUBGA6.js +64 -0
  20. package/dist/chunk-EWVEAERM.js +563 -0
  21. package/dist/{chunk-VDICGXCY.js → chunk-HIMOBNEY.js} +2 -2
  22. package/dist/{chunk-JEUXDY3B.js → chunk-HQED4YB4.js} +1 -1
  23. package/dist/{chunk-2F64AZYH.js → chunk-KA5WKR5P.js} +2 -2
  24. package/dist/{chunk-TFORY6WY.js → chunk-KD5UC33N.js} +23 -9
  25. package/dist/{chunk-YVG6QD3V.js → chunk-LFJ7N36I.js} +103 -8
  26. package/dist/chunk-NNK3JBH4.js +60 -0
  27. package/dist/{chunk-YULUBP3R.js → chunk-O45NOIWR.js} +2 -2
  28. package/dist/{chunk-SOSFRU3O.js → chunk-PLNS5J33.js} +58 -26
  29. package/dist/chunk-PUSFEC6B.js +29 -0
  30. package/dist/{chunk-Z3Q2AEIN.js → chunk-R2SVAO4G.js} +14 -2
  31. package/dist/{chunk-Y3AM6LIO.js → chunk-RC3PPCYD.js} +16 -11
  32. package/dist/{chunk-AWVZTN2B.js → chunk-THTROEGD.js} +1 -1
  33. package/dist/{chunk-QVRIDN42.js → chunk-UCMO4LKL.js} +2 -2
  34. package/dist/{chunk-JSBLCLFE.js → chunk-VLOGOM7N.js} +13 -7
  35. package/dist/{chunk-72NJKS7O.js → chunk-XZDKAR4N.js} +4 -4
  36. package/dist/chunk-YE6MJB5V.js +1285 -0
  37. package/dist/{community-report-client-TJVCLZ3K.js → community-report-client-ULRNXLQV.js} +1 -1
  38. package/dist/{compat-check-HERBTQZN.js → compat-check-CADG7GND.js} +5 -4
  39. package/dist/{config-E3KANXMK.js → config-PFD3KWQG.js} +28 -14
  40. package/dist/{context-CDB5H5PD.js → context-SOQDFZIB.js} +8 -6
  41. package/dist/{data-integration-QE37EQ3A.js → data-integration-UNJ7EPW2.js} +6 -6
  42. package/dist/{evaluation-LR4YDYWL.js → evaluation-Q3AIGFOG.js} +14 -159
  43. package/dist/index.js +95 -593
  44. package/dist/{local-data-upload-client-KCMG6J62.js → local-data-upload-client-YTWMAAGE.js} +1 -1
  45. package/dist/{memory-SNFR5M23.js → memory-HKNGUIPK.js} +6 -7
  46. package/dist/{metadata-EXQYDZTH.js → metadata-GFWR5ZHC.js} +11 -10
  47. package/dist/{model-KEVCEXWD.js → model-NAKQWK4W.js} +4 -5
  48. package/dist/{personal-semantic-preference-ETY3KU2O.js → personal-semantic-preference-JCTKXLC3.js} +46 -15
  49. package/dist/{project-semantic-UHRMVOJF.js → project-semantic-B2NWQOKK.js} +19 -16
  50. package/dist/{sync-XKEBXESC.js → sync-UQH4J4BD.js} +9 -9
  51. package/dist/{te-agent-S6UQR4IE.js → te-agent-L6EYFQCC.js} +303 -17
  52. package/dist/{te-analysis-WOFFCIBC.js → te-analysis-U7NNOY66.js} +397 -203
  53. package/dist/{te-community-R7B6QYOO.js → te-community-3UQEW3KD.js} +14 -12
  54. package/dist/{te-dataops-KPILYVHA.js → te-dataops-SUNYXF5G.js} +13 -11
  55. package/dist/{te-engage-IAUM6ONX.js → te-engage-KMXZJ2KN.js} +10 -9
  56. package/dist/{te-experiment-TMLRA7B3.js → te-experiment-IEYKP6VC.js} +477 -45
  57. package/dist/{te-kb-GKWPSLSY.js → te-kb-MT3V5ZMH.js} +78 -18
  58. package/dist/{te-system-CYWSK3UN.js → te-system-F4ZU2HRQ.js} +6 -7
  59. package/dist/{te-team-ISN52YNG.js → te-team-M6E6XQ5H.js} +9 -8
  60. package/dist/{things-DDQ52Z3Q.js → things-FRLBZV2Z.js} +9 -8
  61. package/dist/{update-CTLNTX35.js → update-NULYHVE6.js} +8 -6
  62. package/dist/{workspace-2CKQX2XL.js → workspace-Z7L33OBQ.js} +6 -7
  63. package/package.json +13 -8
  64. package/skills/ae-agent/SKILL.md +19 -5
  65. package/skills/ae-agent/references/a2a.md +103 -0
  66. package/skills/ae-agent/references/command_index.md +11 -0
  67. package/skills/ae-ai-monitor/SKILL.md +179 -0
  68. package/skills/ae-ai-monitor/references/read-commands.md +866 -0
  69. package/skills/ae-analysis/SKILL.md +43 -25
  70. package/skills/ae-analysis/references/adhoc_export.md +3 -1
  71. package/skills/ae-analysis/references/ai_models/path.md +5 -6
  72. package/skills/ae-analysis/references/ai_models.md +1 -0
  73. package/skills/ae-analysis/references/analysis_data_retrieval.md +1 -1
  74. package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -0
  75. package/skills/ae-analysis/references/asset_authentication_export.md +1 -1
  76. package/skills/ae-analysis/references/asset_authentication_update.md +6 -2
  77. package/skills/ae-analysis/references/asset_search.md +1 -1
  78. package/skills/ae-analysis/references/bad_case_begin.md +12 -0
  79. package/skills/ae-analysis/references/bad_case_get.md +12 -0
  80. package/skills/ae-analysis/references/bad_case_history.md +12 -0
  81. package/skills/ae-analysis/references/bad_case_list.md +12 -0
  82. package/skills/ae-analysis/references/bad_case_review.md +51 -0
  83. package/skills/ae-analysis/references/bad_case_run.md +12 -0
  84. package/skills/ae-analysis/references/bad_case_submit.md +12 -0
  85. package/skills/ae-analysis/references/bad_case_submit_to_page.md +12 -0
  86. package/skills/ae-analysis/references/bad_case_sync_evaluation.md +11 -0
  87. package/skills/ae-analysis/references/bi_panel_list.md +1 -1
  88. package/skills/ae-analysis/references/bi_panel_share.md +3 -1
  89. package/skills/ae-analysis/references/catalog_list.md +2 -0
  90. package/skills/ae-analysis/references/command_index.md +44 -35
  91. package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
  92. package/skills/ae-analysis/references/dashboard_handover.md +3 -1
  93. package/skills/ae-analysis/references/dashboard_list.md +3 -3
  94. package/skills/ae-analysis/references/dashboard_report_data_export.md +1 -1
  95. package/skills/ae-analysis/references/dashboard_share.md +3 -1
  96. package/skills/ae-analysis/references/dashboard_update.md +3 -2
  97. package/skills/ae-analysis/references/filter_value_list.md +2 -0
  98. package/skills/ae-analysis/references/folder_share.md +8 -2
  99. package/skills/ae-analysis/references/governance_recommendation_export.md +2 -2
  100. package/skills/ae-analysis/references/governance_recommendation_run_update.md +3 -1
  101. package/skills/ae-analysis/references/personal_semantic_preference_add.md +9 -1
  102. package/skills/ae-analysis/references/personal_semantic_preference_delete.md +2 -0
  103. package/skills/ae-analysis/references/personal_semantic_preference_get.md +2 -0
  104. package/skills/ae-analysis/references/personal_semantic_preference_list.md +10 -2
  105. package/skills/ae-analysis/references/personal_semantic_preference_update.md +8 -0
  106. package/skills/ae-analysis/references/project_data_power_upsert.md +3 -1
  107. package/skills/ae-analysis/references/project_mark_time_create.md +2 -0
  108. package/skills/ae-analysis/references/project_mark_time_update.md +2 -0
  109. package/skills/ae-analysis/references/project_member_add.md +3 -1
  110. package/skills/ae-analysis/references/project_member_batch_update.md +3 -1
  111. package/skills/ae-analysis/references/project_member_handover_run.md +3 -1
  112. package/skills/ae-analysis/references/project_member_update.md +3 -1
  113. package/skills/ae-analysis/references/project_owner_update.md +8 -2
  114. package/skills/ae-analysis/references/project_role_upsert.md +5 -3
  115. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +16 -1
  116. package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +14 -1
  117. package/skills/ae-analysis/references/project_space_share.md +8 -2
  118. package/skills/ae-analysis/references/property_get.md +2 -0
  119. package/skills/ae-analysis/references/public_link_list.md +3 -1
  120. package/skills/ae-analysis/references/query_cancel.md +4 -1
  121. package/skills/ae-analysis/references/report_data_run.md +1 -1
  122. package/skills/ae-analysis/references/report_list.md +3 -3
  123. package/skills/ae-analysis/references/scenario_append.md +2 -2
  124. package/skills/ae-analysis/references/scenario_collect.md +15 -4
  125. package/skills/ae-analysis/references/scenario_evaluation.md +17 -1
  126. package/skills/ae-analysis/references/scenario_list.md +7 -7
  127. package/skills/ae-analysis/references/system_oauth2_update.md +3 -1
  128. package/skills/ae-analysis/references/system_third_party_login_upsert.md +4 -2
  129. package/skills/ae-analysis/references/user_tag_create.md +4 -1
  130. package/skills/ae-analysis/references/user_tag_get.md +2 -0
  131. package/skills/ae-analysis/references/user_tag_models.md +8 -2
  132. package/skills/ae-analysis/references/user_tag_update.md +5 -2
  133. package/skills/ae-analysis/references/virtual_property_create.md +12 -1
  134. package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +10 -0
  135. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +55 -13
  136. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +2 -2
  137. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +2 -2
  138. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +7 -1
  139. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/wait-compile-run.mjs +79 -0
  140. package/skills/ae-automation/SKILL.md +4 -2
  141. package/skills/ae-capability/SKILL.md +16 -8
  142. package/skills/ae-community/SKILL.md +1 -0
  143. package/skills/ae-dataops/SKILL.md +1 -0
  144. package/skills/ae-engage/SKILL.md +1 -0
  145. package/skills/ae-evaluation/SKILL.md +17 -2
  146. package/skills/ae-experiment/SKILL.md +69 -13
  147. package/skills/ae-experiment/references/experiment_approval.md +229 -0
  148. package/skills/ae-experiment/references/manage_experiment.md +15 -2
  149. package/skills/ae-experiment/references/manage_traffic_domains.md +131 -0
  150. package/skills/ae-experiment/references/query_experiment_detail.md +8 -0
  151. package/skills/ae-experiment/references/query_experiment_list.md +6 -0
  152. package/skills/ae-experiment/references/save_experiment.md +56 -10
  153. package/skills/ae-experiment/references/save_metric.md +29 -2
  154. package/skills/ae-experiment/references/save_submit_experiment.md +22 -3
  155. package/skills/ae-experiment/references/save_submit_external_experiment.md +59 -3
  156. package/skills/ae-experiment/references/save_traffic_layer.md +17 -1
  157. package/skills/ae-generate-tracking-plan/SKILL.md +5 -0
  158. package/skills/ae-kb/SKILL.md +8 -4
  159. package/skills/ae-kb/references/analysis-workflow.md +11 -2
  160. package/skills/ae-kb/references/publication.md +45 -0
  161. package/skills/ae-kb/references/query-workflow.md +3 -1
  162. package/skills/ae-kb/references/versions.md +1 -1
  163. package/skills/ae-metadata/SKILL.md +1 -0
  164. package/skills/ae-migrate-tracking-code/SKILL.md +2 -1
  165. package/skills/ae-team/SKILL.md +1 -1
  166. package/skills/ae-tracking-matrix/SKILL.md +170 -0
  167. package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
  168. package/skills/ae-tracking-matrix/i18n.yaml +12 -0
  169. package/skills/ae-tracking-matrix/references/ae-capabilities.md +93 -0
  170. package/skills/ae-tracking-matrix/references/business-semantic-checks.md +30 -0
  171. package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +256 -0
  172. package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +213 -0
  173. package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +407 -0
  174. package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +218 -0
  175. package/skills/ae-tracking-matrix/references/categories/casual_music.md +112 -0
  176. package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +301 -0
  177. package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +356 -0
  178. package/skills/ae-tracking-matrix/references/categories/fishing.md +775 -0
  179. package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +89 -0
  180. package/skills/ae-tracking-matrix/references/categories/idle_card.md +27 -0
  181. package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +415 -0
  182. package/skills/ae-tracking-matrix/references/categories/interactive_video.md +133 -0
  183. package/skills/ae-tracking-matrix/references/categories/merge.md +639 -0
  184. package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +406 -0
  185. package/skills/ae-tracking-matrix/references/categories/mmo_web.md +230 -0
  186. package/skills/ae-tracking-matrix/references/categories/music.md +137 -0
  187. package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +414 -0
  188. package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +199 -0
  189. package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +158 -0
  190. package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +546 -0
  191. package/skills/ae-tracking-matrix/references/categories/rpg.md +195 -0
  192. package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +115 -0
  193. package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +151 -0
  194. package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +260 -0
  195. package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +232 -0
  196. package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +359 -0
  197. package/skills/ae-tracking-matrix/references/categories/tower_defense.md +365 -0
  198. package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +211 -0
  199. package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +132 -0
  200. package/skills/ae-tracking-matrix/references/category-registry.md +77 -0
  201. package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +230 -0
  202. package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +406 -0
  203. package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +128 -0
  204. package/skills/ae-tracking-matrix/references/eval-cases.md +74 -0
  205. package/skills/ae-tracking-matrix/references/naming-dict.md +238 -0
  206. package/skills/ae-tracking-matrix/references/optimization-checklist.md +85 -0
  207. package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +142 -0
  208. package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +47 -0
  209. package/skills/ae-tracking-matrix/references/plan-generation/reference.md +794 -0
  210. package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +94 -0
  211. package/skills/ae-tracking-matrix/references/scene-routing.md +80 -0
  212. package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +3787 -0
  213. package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +827 -0
  214. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +655 -0
  215. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +953 -0
  216. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +1128 -0
  217. package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +714 -0
  218. package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +1268 -0
  219. package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +776 -0
  220. package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +182 -0
  221. package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +2755 -0
  222. package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +1182 -0
  223. package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +1300 -0
  224. package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +1369 -0
  225. package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +1692 -0
  226. package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +902 -0
  227. package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +763 -0
  228. package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +1107 -0
  229. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +1532 -0
  230. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +845 -0
  231. package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +228 -0
  232. package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +149 -0
  233. package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +407 -0
  234. package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +163 -0
  235. package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +149 -0
  236. package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +153 -0
  237. package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +232 -0
  238. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +314 -0
  239. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +117 -0
  240. package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +148 -0
  241. package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +645 -0
  242. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +307 -0
  243. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +347 -0
  244. package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +72 -0
  245. package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +264 -0
  246. package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +566 -0
  247. package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +409 -0
  248. package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +446 -0
  249. package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +557 -0
  250. package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +457 -0
  251. package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +490 -0
  252. package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +523 -0
  253. package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +484 -0
  254. package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +442 -0
  255. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +391 -0
  256. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +91 -0
  257. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +635 -0
  258. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +113 -0
  259. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +466 -0
  260. package/skills/ae-tracking-matrix/references/standard-base/README.md +22 -0
  261. package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +174 -0
  262. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +20 -0
  263. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +7 -0
  264. package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +14 -0
  265. package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +370 -0
  266. package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +47 -0
  267. package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +37 -0
  268. package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +27 -0
  269. package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +23 -0
  270. package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +14 -0
  271. package/skills/ae-tracking-matrix/references/standard-base/user_data.md +46 -0
  272. package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +13 -0
  273. package/skills/ae-tracking-matrix/references/system-fields.md +297 -0
  274. package/skills/ae-tracking-matrix/references/te-field-translations.md +1791 -0
  275. package/skills/ae-tracking-matrix/references/workflows/data-verification.md +232 -0
  276. package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +829 -0
  277. package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +355 -0
  278. package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +283 -0
  279. package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +168 -0
  280. package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +205 -0
  281. package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +75 -0
  282. package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +36 -0
  283. package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +107 -0
  284. package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +114 -0
  285. package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +53 -0
  286. package/skills/ae-tracking-matrix/scripts/finalize_plan.py +166 -0
  287. package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +674 -0
  288. package/skills/ae-tracking-matrix/scripts/plan_contract.py +200 -0
  289. package/skills/ae-tracking-matrix/scripts/plan_types.py +60 -0
  290. package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +169 -0
  291. package/skills/ae-tracking-matrix/scripts/sync_plan.py +296 -0
  292. package/skills/ae-tracking-matrix/scripts/upload_plan.py +340 -0
  293. package/dist/chunk-AMBFK2K3.js +0 -28
  294. package/dist/chunk-Y74WTIKJ.js +0 -10
@@ -1,4 +1,7 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ evalApi
4
+ } from "./chunk-BQFLABJQ.js";
2
5
  import {
3
6
  assertOutputPathAvailable,
4
7
  clientWaitTimeoutSeconds,
@@ -7,19 +10,23 @@ import {
7
10
  waitForAnalysisRun,
8
11
  withAsyncArtifactLifecycle,
9
12
  withInterruptSignal
10
- } from "./chunk-EUFP4M2A.js";
13
+ } from "./chunk-7DHSB3FL.js";
14
+ import {
15
+ EvalApiError
16
+ } from "./chunk-LFJ7N36I.js";
11
17
  import {
12
18
  createCapabilityCommand,
13
19
  definitionIntentSnapshotFlag,
14
20
  modelDefinitionIntentSnapshotFlag
15
- } from "./chunk-Y3AM6LIO.js";
21
+ } from "./chunk-RC3PPCYD.js";
16
22
  import {
17
23
  registerCapabilityGatewayRoute,
18
24
  resolveGatewayDomain
19
- } from "./chunk-KPQY44JQ.js";
25
+ } from "./chunk-AWW2T2WL.js";
20
26
  import {
27
+ unwrapOutputData,
21
28
  withOutputMetadata
22
- } from "./chunk-YULUBP3R.js";
29
+ } from "./chunk-O45NOIWR.js";
23
30
  import {
24
31
  CapabilityGatewayError,
25
32
  buildCapabilityGatewayUrl,
@@ -33,16 +40,17 @@ import {
33
40
  uploadInputFile,
34
41
  validateCapability,
35
42
  validateCapabilityWithEnvelope
36
- } from "./chunk-HRUOV6EQ.js";
37
- import "./chunk-Y74WTIKJ.js";
38
- import "./chunk-CG773QXN.js";
43
+ } from "./chunk-4IQYPWCX.js";
44
+ import "./chunk-NNK3JBH4.js";
45
+ import "./chunk-E3ONSFUN.js";
46
+ import "./chunk-PUSFEC6B.js";
39
47
  import {
40
48
  getCliToken
41
- } from "./chunk-SOSFRU3O.js";
42
- import "./chunk-4PSTYEG5.js";
49
+ } from "./chunk-PLNS5J33.js";
50
+ import "./chunk-AMURHMS3.js";
43
51
  import {
44
52
  CliValidationError
45
- } from "./chunk-Z3Q2AEIN.js";
53
+ } from "./chunk-R2SVAO4G.js";
46
54
 
47
55
  // src/commands/te-analysis/capability-shared.ts
48
56
  var ANALYSIS_GATEWAY_CLI_SERVICES = /* @__PURE__ */ new Set(["project", "system"]);
@@ -51,12 +59,12 @@ var analysisDataExportRoutingHelp = "Routing: use export for full, unknown-size,
51
59
  function createAnalysisCapabilityCommand(config) {
52
60
  const cliPath = resolveAnalysisGatewayCliPath(config);
53
61
  const { asyncArtifact, ...coreConfig } = config;
54
- const command = createCapabilityCommand({
62
+ const command2 = createCapabilityCommand({
55
63
  ...coreConfig,
56
64
  ...cliPath,
57
65
  gatewayDomain: "analysis"
58
66
  });
59
- return asyncArtifact ? withAsyncArtifactLifecycle(command, typeof asyncArtifact === "object" ? asyncArtifact : void 0) : command;
67
+ return asyncArtifact ? withAsyncArtifactLifecycle(command2, typeof asyncArtifact === "object" ? asyncArtifact : void 0) : command2;
60
68
  }
61
69
  function resolveAnalysisGatewayCliPath(config) {
62
70
  const [capabilityService, capabilityResource, capabilityAction, ...extraSegments] = config.capabilityId.split(".");
@@ -73,32 +81,32 @@ function resolveAnalysisGatewayCliPath(config) {
73
81
  );
74
82
  }
75
83
  const resource = capabilityResource.replaceAll("_", "-");
76
- const command = capabilityAction.replaceAll("_", "-");
84
+ const command2 = capabilityAction.replaceAll("_", "-");
77
85
  const expectedLegacyResource = `${capabilityService} ${resource}`;
78
- if (config.resource !== expectedLegacyResource || config.command !== command) {
86
+ if (config.resource !== expectedLegacyResource || config.command !== command2) {
79
87
  throw new Error(
80
- `Capability '${config.capabilityId}' must map to ae-cli ${capabilityService} ${resource} ${command}.`
88
+ `Capability '${config.capabilityId}' must map to ae-cli ${capabilityService} ${resource} ${command2}.`
81
89
  );
82
90
  }
83
- return { cliService: capabilityService, resource, command };
91
+ return { cliService: capabilityService, resource, command: command2 };
84
92
  }
85
93
  function createAnalysisMetaCapabilityCommand(config) {
86
94
  const { asyncArtifact, ...coreConfig } = config;
87
- const command = createCapabilityCommand({
95
+ const command2 = createCapabilityCommand({
88
96
  ...coreConfig,
89
97
  cliService: "analysis-meta",
90
98
  gatewayDomain: "analysis"
91
99
  });
92
- return asyncArtifact ? withAsyncArtifactLifecycle(command, typeof asyncArtifact === "object" ? asyncArtifact : void 0) : command;
100
+ return asyncArtifact ? withAsyncArtifactLifecycle(command2, typeof asyncArtifact === "object" ? asyncArtifact : void 0) : command2;
93
101
  }
94
102
  function createAnalysisGovernanceCapabilityCommand(config) {
95
103
  const { asyncArtifact, ...coreConfig } = config;
96
- const command = createCapabilityCommand({
104
+ const command2 = createCapabilityCommand({
97
105
  ...coreConfig,
98
106
  cliService: "analysis-governance",
99
107
  gatewayDomain: "analysis"
100
108
  });
101
- return asyncArtifact ? withAsyncArtifactLifecycle(command, typeof asyncArtifact === "object" ? asyncArtifact : void 0) : command;
109
+ return asyncArtifact ? withAsyncArtifactLifecycle(command2, typeof asyncArtifact === "object" ? asyncArtifact : void 0) : command2;
102
110
  }
103
111
  var projectIdFlag = {
104
112
  name: "project-id",
@@ -184,6 +192,12 @@ var directoryOffsetFlag = {
184
192
  alias: "o",
185
193
  min: 0
186
194
  };
195
+ var manageableOnlyFlag = {
196
+ name: "manageable-only",
197
+ type: "boolean",
198
+ required: false,
199
+ desc: "Restrict the list to assets the current user can edit or manage. Defaults to all readable assets."
200
+ };
187
201
  var certificationScopeFlag = {
188
202
  name: "certification-scope",
189
203
  type: "string",
@@ -281,6 +295,7 @@ function reportListInput(ctx) {
281
295
  return compactInput({
282
296
  ...listInput(ctx),
283
297
  model_types: optionalJson(ctx, "model-types"),
298
+ manageable_only: optionalBoolean(ctx, "manageable-only"),
284
299
  certification_scope: certificationScopeInput(ctx)
285
300
  });
286
301
  }
@@ -816,7 +831,7 @@ var metadataEventUpdate = createAnalysisMetaCapabilityCommand({
816
831
  { name: "remark", type: "string", required: false, desc: "Event remark." }
817
832
  ],
818
833
  risk: "write",
819
- buildInput: (ctx) => compactInput({ ...projectInput(ctx), event_name: ctx.str("event-name"), event_desc: optionalString(ctx, "event-desc"), remark: optionalString(ctx, "remark") })
834
+ buildInput: (ctx) => compactInput({ ...projectInput(ctx), event_name: ctx.str("event-name"), event_desc: optionalString(ctx, "event-desc"), remark: optionalStringPreserveEmpty(ctx, "remark") })
820
835
  });
821
836
 
822
837
  // src/commands/te-analysis/meta/event/relation-update.ts
@@ -1015,7 +1030,7 @@ var metadataPropertyUpdate = createAnalysisMetaCapabilityCommand({
1015
1030
  { name: "prop-remark", type: "string", required: false, desc: "Property remark." }
1016
1031
  ],
1017
1032
  risk: "write",
1018
- buildInput: (ctx) => compactInput({ ...projectInput(ctx), table_type: ctx.str("table-type"), prop_name: ctx.str("prop-name"), prop_desc: optionalString(ctx, "prop-desc"), prop_remark: optionalString(ctx, "prop-remark") })
1033
+ buildInput: (ctx) => compactInput({ ...projectInput(ctx), table_type: ctx.str("table-type"), prop_name: ctx.str("prop-name"), prop_desc: optionalString(ctx, "prop-desc"), prop_remark: optionalStringPreserveEmpty(ctx, "prop-remark") })
1019
1034
  });
1020
1035
 
1021
1036
  // src/commands/te-analysis/meta/property/relation-update.ts
@@ -1223,7 +1238,7 @@ var metadataVirtualPropertyCreate = createAnalysisMetaCapabilityCommand({
1223
1238
  { name: "properties", type: "json", required: false, desc: "Dependent property JSON array." },
1224
1239
  { name: "sql-event-relation-type", type: "string", required: false, desc: "relation_default, relation_always, or relation_by_setting." },
1225
1240
  { name: "related-events", type: "json", required: false, desc: "Related events JSON array when using relation_by_setting." },
1226
- { name: "tag-date-policies", type: "json", required: false, desc: "Optional tag date policies JSON array." },
1241
+ { name: "tag-date-policies", type: "json", required: false, desc: "Event SQL tag policies: [{tag_name,cluster_date_policy,specified_cluster_date?}]. LATEST or AUTO omit the date; SPECIFIED requires yyyy-MM-dd." },
1227
1242
  { name: "replace-remark", type: "string", required: false, desc: "Replacement remark." },
1228
1243
  { name: "replace-suggestion", type: "string", required: false, desc: "Replacement suggestion." }
1229
1244
  ],
@@ -1275,7 +1290,7 @@ var metadataVirtualPropertySqlRuleUpdate = createAnalysisMetaCapabilityCommand({
1275
1290
  { name: "properties", type: "json", required: false, desc: "Dependent property JSON array." },
1276
1291
  { name: "sql-event-relation-type", type: "string", required: false, desc: "relation_default, relation_always, or relation_by_setting." },
1277
1292
  { name: "related-events", type: "json", required: false, desc: "Related events JSON array when using relation_by_setting." },
1278
- { name: "tag-date-policies", type: "json", required: false, desc: "Optional tag date policies JSON array." },
1293
+ { name: "tag-date-policies", type: "json", required: false, desc: "Event SQL tag policies: [{tag_name,cluster_date_policy,specified_cluster_date?}]. LATEST or AUTO omit the date; SPECIFIED requires yyyy-MM-dd." },
1279
1294
  { name: "replace-remark", type: "string", required: false, desc: "Replacement remark." },
1280
1295
  { name: "replace-suggestion", type: "string", required: false, desc: "Replacement suggestion." }
1281
1296
  ],
@@ -1462,7 +1477,7 @@ var metadataMetricUpdate = createAnalysisMetaCapabilityCommand({
1462
1477
  metric_id: ctx.num("metric-id"),
1463
1478
  metric_name: optionalString(ctx, "metric-name"),
1464
1479
  metric_desc: optionalString(ctx, "metric-desc"),
1465
- metric_remark: optionalString(ctx, "metric-remark"),
1480
+ metric_remark: optionalStringPreserveEmpty(ctx, "metric-remark"),
1466
1481
  metric_mode: optionalMetricMode(ctx),
1467
1482
  metric_events: optionalJson(ctx, "metric-events"),
1468
1483
  metric_params: optionalJson(ctx, "metric-params")
@@ -2459,12 +2474,12 @@ async function planBoundedExpansion(ctx, input) {
2459
2474
  let finalExport = {};
2460
2475
  let finalLimit = DEFAULT_LIMIT;
2461
2476
  let stopReason = "top_100_inspected";
2462
- for (const limit of EXPANSION_LIMITS) {
2463
- const exported = await exportRecommendationMaterial(ctx, input, limit);
2477
+ for (const limit2 of EXPANSION_LIMITS) {
2478
+ const exported = await exportRecommendationMaterial(ctx, input, limit2);
2464
2479
  finalExport = exported.data;
2465
- const summary = summarizeExport(exported.data, limit);
2480
+ const summary = summarizeExport(exported.data, limit2);
2466
2481
  attempts.push(summary);
2467
- finalLimit = limit;
2482
+ finalLimit = limit2;
2468
2483
  const pendingAssets = numberValue(summary.pending_asset_candidates);
2469
2484
  const pendingWorkUnits = numberValue(summary.pending_work_units);
2470
2485
  const hasMore = summary.has_more === true;
@@ -2492,12 +2507,12 @@ async function planBoundedExpansion(ctx, input) {
2492
2507
  finalExport
2493
2508
  };
2494
2509
  }
2495
- function exportRecommendationMaterial(ctx, input, limit) {
2510
+ function exportRecommendationMaterial(ctx, input, limit2) {
2496
2511
  return executeCapabilityWithEnvelope(
2497
2512
  ctx.host(),
2498
2513
  gatewayDomain(),
2499
2514
  EXPORT_CAPABILITY_ID,
2500
- compactInput({ ...input, limit, include_completed: false })
2515
+ compactInput({ ...input, limit: limit2, include_completed: false })
2501
2516
  );
2502
2517
  }
2503
2518
  function summarizeExport(result, requestedLimit) {
@@ -2520,12 +2535,12 @@ function countPendingAssetCandidates(workUnits) {
2520
2535
  const seen = /* @__PURE__ */ new Set();
2521
2536
  for (const unit of workUnits) {
2522
2537
  for (const candidate of array(record(unit).asset_candidates)) {
2523
- const item = record(candidate);
2524
- if (item.actionable !== true || item.action_state !== "PENDING") {
2538
+ const item2 = record(candidate);
2539
+ if (item2.actionable !== true || item2.action_state !== "PENDING") {
2525
2540
  continue;
2526
2541
  }
2527
- const type = stringValue(item.resource_type);
2528
- const key = stringValue(item.resource_key);
2542
+ const type = stringValue(item2.resource_type);
2543
+ const key = stringValue(item2.resource_key);
2529
2544
  if (type && key) {
2530
2545
  seen.add(`${type}|${key}`);
2531
2546
  }
@@ -2629,13 +2644,13 @@ function autoReviewReason(reason) {
2629
2644
  }
2630
2645
  function autoReviewItemsWithDisplayReason(items) {
2631
2646
  return array(items).map((value) => {
2632
- const item = record(value);
2647
+ const item2 = record(value);
2633
2648
  const copy = {
2634
- ...item,
2635
- semantic_duplicate_targets: semanticDuplicateTargetsFromReason(stringValue(item.reason) ?? "")
2649
+ ...item2,
2650
+ semantic_duplicate_targets: semanticDuplicateTargetsFromReason(stringValue(item2.reason) ?? "")
2636
2651
  };
2637
- if (item.decision !== "APPROVE") {
2638
- copy.display_reason = autoReviewDisplayReason(item);
2652
+ if (item2.decision !== "APPROVE") {
2653
+ copy.display_reason = autoReviewDisplayReason(item2);
2639
2654
  }
2640
2655
  return copy;
2641
2656
  });
@@ -2754,7 +2769,7 @@ function semanticDuplicateTargetsFromReason(reason) {
2754
2769
  return array(decodeReasonPayload(encoded).targets);
2755
2770
  }
2756
2771
  function listIncludes(value, expected) {
2757
- return array(value).some((item) => item === expected);
2772
+ return array(value).some((item2) => item2 === expected);
2758
2773
  }
2759
2774
  function buildManualReviewHandoff(autoReviewResult, exportResult) {
2760
2775
  const result = record(autoReviewResult);
@@ -2800,7 +2815,7 @@ function buildManualReviewHandoff(autoReviewResult, exportResult) {
2800
2815
  });
2801
2816
  }
2802
2817
  const pageReviewItems = buildPageReviewItems(handoffItems, candidates, relations, decisions);
2803
- const pageReviewIds = new Set(pageReviewItems.map((item) => stringValue(item.client_item_id)).filter(Boolean));
2818
+ const pageReviewIds = new Set(pageReviewItems.map((item2) => stringValue(item2.client_item_id)).filter(Boolean));
2804
2819
  return {
2805
2820
  schema_version: "1.0",
2806
2821
  handoff_type: "auto_review_uncertified_assets_to_page_review",
@@ -2816,10 +2831,10 @@ function buildManualReviewHandoff(autoReviewResult, exportResult) {
2816
2831
  skipped: result.skipped,
2817
2832
  overflow: result.overflow,
2818
2833
  approved_items: autoCertifiedItems,
2819
- skipped_items: handoffItems.map((item) => ({
2820
- target_ref: record(item.target_ref),
2821
- display_name: item.display_name,
2822
- manual_review_reason: item.manual_review_reason
2834
+ skipped_items: handoffItems.map((item2) => ({
2835
+ target_ref: record(item2.target_ref),
2836
+ display_name: item2.display_name,
2837
+ manual_review_reason: item2.manual_review_reason
2823
2838
  }))
2824
2839
  },
2825
2840
  auto_certified_items: autoCertifiedItems,
@@ -2848,8 +2863,8 @@ function buildPageReviewItems(handoffItems, candidates, relations, decisions) {
2848
2863
  const id = stringValue(candidate.client_item_id);
2849
2864
  if (id) byId.set(id, candidate);
2850
2865
  }
2851
- for (const item of handoffItems) {
2852
- const id = stringValue(item.client_item_id);
2866
+ for (const item2 of handoffItems) {
2867
+ const id = stringValue(item2.client_item_id);
2853
2868
  if (id) requiredIds.add(id);
2854
2869
  }
2855
2870
  let changed = true;
@@ -2864,7 +2879,7 @@ function buildPageReviewItems(handoffItems, candidates, relations, decisions) {
2864
2879
  }
2865
2880
  }
2866
2881
  }
2867
- const handoffById = new Map(handoffItems.map((item) => [stringValue(item.client_item_id), item]).filter((entry) => !!entry[0]));
2882
+ const handoffById = new Map(handoffItems.map((item2) => [stringValue(item2.client_item_id), item2]).filter((entry) => !!entry[0]));
2868
2883
  return candidates.map(record).filter((candidate) => {
2869
2884
  const id = stringValue(candidate.client_item_id);
2870
2885
  return id !== void 0 && requiredIds.has(id);
@@ -2880,15 +2895,15 @@ function buildPageReviewItems(handoffItems, candidates, relations, decisions) {
2880
2895
  });
2881
2896
  }
2882
2897
  function markContextCandidate(candidate, decision) {
2883
- const item = { ...candidate };
2884
- item.manual_review_context = true;
2885
- item.manual_review_reason = "\u8BE5\u8D44\u4EA7\u7528\u4E8E\u4FDD\u7559\u81EA\u52A8\u53D1\u73B0\u9875\u9762\u7684\u7236\u5B50\u5C42\u7EA7\u548C\u6765\u6E90\u4E0A\u4E0B\u6587\uFF0C\u4E0D\u4F5C\u4E3A\u672C\u6B21\u4EBA\u5DE5\u5BA1\u6838\u5BF9\u8C61\u3002";
2898
+ const item2 = { ...candidate };
2899
+ item2.manual_review_context = true;
2900
+ item2.manual_review_reason = "\u8BE5\u8D44\u4EA7\u7528\u4E8E\u4FDD\u7559\u81EA\u52A8\u53D1\u73B0\u9875\u9762\u7684\u7236\u5B50\u5C42\u7EA7\u548C\u6765\u6E90\u4E0A\u4E0B\u6587\uFF0C\u4E0D\u4F5C\u4E3A\u672C\u6B21\u4EBA\u5DE5\u5BA1\u6838\u5BF9\u8C61\u3002";
2886
2901
  if (decision?.decision === "APPROVE" && decision.landing_status === "APPLIED") {
2887
- item.auto_review_decision = decision.raw;
2888
- item.auto_review_context_reason = autoReviewDisplayReason(decision.raw, candidate);
2889
- item.evidence_snapshot = markEvidenceAuthenticated(record(candidate.evidence_snapshot));
2902
+ item2.auto_review_decision = decision.raw;
2903
+ item2.auto_review_context_reason = autoReviewDisplayReason(decision.raw, candidate);
2904
+ item2.evidence_snapshot = markEvidenceAuthenticated(record(candidate.evidence_snapshot));
2890
2905
  }
2891
- return item;
2906
+ return item2;
2892
2907
  }
2893
2908
  function markEvidenceAuthenticated(evidence) {
2894
2909
  const snapshot = { ...evidence };
@@ -2901,21 +2916,21 @@ function markEvidenceAuthenticated(evidence) {
2901
2916
  function decisionsByAsset(value) {
2902
2917
  const result = /* @__PURE__ */ new Map();
2903
2918
  for (const itemValue of array(value)) {
2904
- const item = record(itemValue);
2905
- if (item.item_type !== "asset") {
2919
+ const item2 = record(itemValue);
2920
+ if (item2.item_type !== "asset") {
2906
2921
  continue;
2907
2922
  }
2908
- const type = stringValue(item.resource_type);
2909
- const key = stringValue(item.resource_key);
2923
+ const type = stringValue(item2.resource_type);
2924
+ const key = stringValue(item2.resource_key);
2910
2925
  if (!type || !key) {
2911
2926
  continue;
2912
2927
  }
2913
2928
  const assetKey = `${type}|${key}`;
2914
2929
  result.set(assetKey, {
2915
2930
  assetKey,
2916
- decision: stringValue(item.decision) ?? "",
2917
- landing_status: stringValue(item.landing_status) ?? "",
2918
- raw: item
2931
+ decision: stringValue(item2.decision) ?? "",
2932
+ landing_status: stringValue(item2.landing_status) ?? "",
2933
+ raw: item2
2919
2934
  });
2920
2935
  }
2921
2936
  return result;
@@ -3253,8 +3268,8 @@ var agentReviewSubmitToPage = createAnalysisMetaCapabilityCommand({
3253
3268
  });
3254
3269
  function validateInput(input) {
3255
3270
  const items = array2(input.items, "items").map((value) => {
3256
- const item = object(value, "items[]");
3257
- fields(item, [
3271
+ const item2 = object(value, "items[]");
3272
+ fields(item2, [
3258
3273
  "client_item_id",
3259
3274
  "target_ref",
3260
3275
  "action_type",
@@ -3264,10 +3279,10 @@ function validateInput(input) {
3264
3279
  "source_link",
3265
3280
  "evidence_links"
3266
3281
  ], "items[]");
3267
- if (typeof item.client_item_id !== "string" || !item.client_item_id.trim()) {
3282
+ if (typeof item2.client_item_id !== "string" || !item2.client_item_id.trim()) {
3268
3283
  throw new Error("items[].client_item_id must be a nonempty string.");
3269
3284
  }
3270
- const target = object(item.target_ref, "items[].target_ref");
3285
+ const target = object(item2.target_ref, "items[].target_ref");
3271
3286
  const targetType = typeof target.type === "string" ? target.type.trim() : "";
3272
3287
  const targetKey = typeof target.key === "string" ? target.key.trim() : "";
3273
3288
  if (!targetType || !targetKey) {
@@ -3276,21 +3291,21 @@ function validateInput(input) {
3276
3291
  if (!supportedTargetTypes.has(targetType)) {
3277
3292
  throw new Error("items[].target_ref.type must be one of dashboard, report, event, event_prop, user_prop, user_tag, user_cluster, metric.");
3278
3293
  }
3279
- const proposal = object(item.proposal_payload, "items[].proposal_payload");
3294
+ const proposal = object(item2.proposal_payload, "items[].proposal_payload");
3280
3295
  fields(proposal, ["authentication_status"], "items[].proposal_payload");
3281
- if (item.action_type !== "CERTIFY" || proposal.authentication_status !== 1) {
3296
+ if (item2.action_type !== "CERTIFY" || proposal.authentication_status !== 1) {
3282
3297
  throw new Error("Only CERTIFY with authentication_status=1 is supported by the review page.");
3283
3298
  }
3284
- const aiSummary = object(item.ai_summary, "items[].ai_summary");
3285
- const evidenceSnapshot = object(item.evidence_snapshot, "items[].evidence_snapshot");
3286
- validateItemAiSummary(aiSummary, `items[${String(item.client_item_id)}].ai_summary`);
3299
+ const aiSummary = object(item2.ai_summary, "items[].ai_summary");
3300
+ const evidenceSnapshot = object(item2.evidence_snapshot, "items[].evidence_snapshot");
3301
+ validateItemAiSummary(aiSummary, `items[${String(item2.client_item_id)}].ai_summary`);
3287
3302
  if (targetType === "report") {
3288
- validateReportAnalysis(aiSummary, evidenceSnapshot, `items[${String(item.client_item_id)}]`);
3303
+ validateReportAnalysis(aiSummary, evidenceSnapshot, `items[${String(item2.client_item_id)}]`);
3289
3304
  }
3290
- validateEvidenceLinks(item);
3291
- return item;
3305
+ validateEvidenceLinks(item2);
3306
+ return item2;
3292
3307
  });
3293
- unique(items.map((item) => item.client_item_id), "client_item_id");
3308
+ unique(items.map((item2) => item2.client_item_id), "client_item_id");
3294
3309
  fields(input, [
3295
3310
  "project_id",
3296
3311
  "review_type",
@@ -3305,7 +3320,7 @@ function validateInput(input) {
3305
3320
  "items"
3306
3321
  ], "submit-to-page input");
3307
3322
  object(input.ai_summary, "ai_summary");
3308
- validatePresentation(object(input.presentation_snapshot, "presentation_snapshot"), new Set(items.map((item) => item.client_item_id)));
3323
+ validatePresentation(object(input.presentation_snapshot, "presentation_snapshot"), new Set(items.map((item2) => item2.client_item_id)));
3309
3324
  if (input.review_type !== "ASSET_GOVERNANCE" || input.schema_version !== "1.0") {
3310
3325
  throw new Error("submit-to-page input requires review_type=ASSET_GOVERNANCE and schema_version=1.0.");
3311
3326
  }
@@ -3365,11 +3380,11 @@ function resolvesAnalysisPath(analysis, path) {
3365
3380
  }
3366
3381
  return index === suffix.length;
3367
3382
  }
3368
- function validateEvidenceLinks(item) {
3369
- const sourceLink = typeof item.source_link === "string" && item.source_link.trim();
3383
+ function validateEvidenceLinks(item2) {
3384
+ const sourceLink = typeof item2.source_link === "string" && item2.source_link.trim();
3370
3385
  let evidenceLink = false;
3371
- if ("evidence_links" in item) {
3372
- evidenceLink = array2(item.evidence_links, "items[].evidence_links").some((value) => {
3386
+ if ("evidence_links" in item2) {
3387
+ evidenceLink = array2(item2.evidence_links, "items[].evidence_links").some((value) => {
3373
3388
  const link = object(value, "items[].evidence_links[]");
3374
3389
  return typeof link.url === "string" && !!link.url.trim();
3375
3390
  });
@@ -3393,16 +3408,16 @@ function validatePresentation(presentation, itemIds) {
3393
3408
  throw new Error("presentation_snapshot.topics[].groups[] requires nonempty string id and name.");
3394
3409
  }
3395
3410
  for (const itemValue of array2(group.items, "presentation_snapshot.topics[].groups[].items")) {
3396
- const item = object(itemValue, "presentation_snapshot.topics[].groups[].items[]");
3397
- if (typeof item.id !== "string" || !item.id.trim()) {
3411
+ const item2 = object(itemValue, "presentation_snapshot.topics[].groups[].items[]");
3412
+ if (typeof item2.id !== "string" || !item2.id.trim()) {
3398
3413
  throw new Error("presentation_snapshot display items require nonempty string id.");
3399
3414
  }
3400
- if (!itemIds.has(item.id)) {
3415
+ if (!itemIds.has(item2.id)) {
3401
3416
  throw new Error("presentation_snapshot references an unknown client_item_id.");
3402
3417
  }
3403
- displayed.add(item.id);
3404
- topicItemIds.add(item.id);
3405
- groupItemIds.add(item.id);
3418
+ displayed.add(item2.id);
3419
+ topicItemIds.add(item2.id);
3420
+ groupItemIds.add(item2.id);
3406
3421
  }
3407
3422
  if (group.semantic_basis !== void 0) {
3408
3423
  const basis = object(group.semantic_basis, "presentation_snapshot.topics[].groups[].semantic_basis");
@@ -3538,9 +3553,9 @@ var agentReviewList = createAnalysisMetaCapabilityCommand({
3538
3553
  risk: "read",
3539
3554
  flags: [projectFlag, { name: "limit", type: "number", min: 1, max: 500, default: 20, desc: "Maximum recent batches, from 1 to 500. Default: 20." }],
3540
3555
  buildInput: (ctx) => {
3541
- const limit = ctx.str("limit") === "" ? 20 : ctx.num("limit");
3542
- if (!Number.isInteger(limit) || limit < 1 || limit > 500) throw new Error("--limit must be an integer from 1 to 500.");
3543
- return { ...projectInput2(ctx), limit };
3556
+ const limit2 = ctx.str("limit") === "" ? 20 : ctx.num("limit");
3557
+ if (!Number.isInteger(limit2) || limit2 < 1 || limit2 > 500) throw new Error("--limit must be an integer from 1 to 500.");
3558
+ return { ...projectInput2(ctx), limit: limit2 };
3544
3559
  }
3545
3560
  });
3546
3561
  var agentReviewDetail = createAnalysisMetaCapabilityCommand({
@@ -4048,7 +4063,7 @@ function normalizeRef(value, index) {
4048
4063
  function validateStringArray(ctx, name, allowed) {
4049
4064
  const value = optionalJson(ctx, name);
4050
4065
  if (value === void 0) return;
4051
- if (!Array.isArray(value) || value.length === 0 || value.some((item) => typeof item !== "string" || !allowed.has(item))) {
4066
+ if (!Array.isArray(value) || value.length === 0 || value.some((item2) => typeof item2 !== "string" || !allowed.has(item2))) {
4052
4067
  throw new CliValidationError(`--${name} must be a non-empty JSON array of supported values`);
4053
4068
  }
4054
4069
  }
@@ -4119,7 +4134,7 @@ var expectedSnapshotHashFlag = {
4119
4134
  name: "expected-snapshot-hash",
4120
4135
  type: "string",
4121
4136
  required: false,
4122
- desc: "Optional snapshot_hash from the export sidecar. A mismatch rejects the whole update."
4137
+ desc: "Deprecated compatibility no-op. Project snapshots are not checked; only specified assets are updated."
4123
4138
  };
4124
4139
  var analysisGovernanceAssetAuthenticationUpdate = createAnalysisGovernanceCapabilityCommand({
4125
4140
  resource: "asset-authentication",
@@ -4137,13 +4152,17 @@ var analysisGovernanceAssetAuthenticationUpdate = createAnalysisGovernanceCapabi
4137
4152
  requestIdFlag
4138
4153
  ],
4139
4154
  risk: "write",
4140
- buildInput: (ctx) => compactInput({
4141
- project_id: ctx.num("project-id"),
4142
- authentication_status: ctx.num("authentication-status"),
4143
- asset_refs: assetRefsInput(ctx),
4144
- expected_snapshot_hash: optionalString(ctx, "expected-snapshot-hash"),
4145
- request_id: optionalString(ctx, "request-id")
4146
- })
4155
+ buildInput: (ctx) => {
4156
+ if (optionalString(ctx, "expected-snapshot-hash") !== void 0) {
4157
+ process.stderr.write("Warning: --expected-snapshot-hash is deprecated and ignored. Only the specified assets are updated; project snapshots are not checked.\n");
4158
+ }
4159
+ return compactInput({
4160
+ project_id: ctx.num("project-id"),
4161
+ authentication_status: ctx.num("authentication-status"),
4162
+ asset_refs: assetRefsInput(ctx),
4163
+ request_id: optionalString(ctx, "request-id")
4164
+ });
4165
+ }
4147
4166
  });
4148
4167
 
4149
4168
  // src/commands/te-analysis/governance/index.ts
@@ -4179,10 +4198,11 @@ var reportList = createAnalysisCapabilityCommand({
4179
4198
  resource: "report",
4180
4199
  command: "list",
4181
4200
  capabilityId: "analysis.report.list",
4182
- description: "List analysis reports the current user can edit or manage. Read-only reports are excluded; use analysis asset search for readable asset discovery.",
4201
+ description: "List readable reports. For management workflows use --manageable-only. Use analysis asset search for asset discovery.",
4183
4202
  flags: [
4184
4203
  projectIdFlag,
4185
4204
  queriesFlag,
4205
+ manageableOnlyFlag,
4186
4206
  fieldsFlag,
4187
4207
  reportModelTypesFlag,
4188
4208
  reportListLimitFlag,
@@ -4259,7 +4279,7 @@ var REPORT_WRITE_MODEL_TYPE_VALUES = [
4259
4279
  "tag"
4260
4280
  ];
4261
4281
  var REPORT_WRITE_MODEL_DESCRIPTION = `${AI_MODEL_DESCRIPTION} Report create/update also supports tag for saved tag report data; use tag as the AI-facing spelling.`;
4262
- var AI_DEFINITION_DESCRIPTION = 'Event metrics: omit optional display_name unless the target command schema explicitly supports it. Funnel step filters use event_property_name (not field) and string-array values, including "true"/"false" for boolean properties. For tag/cluster filters, cluster_date_policy accepts LATEST (default), AUTO (match the computed result for each analysis date), or SPECIFIED (requires specified_cluster_date in yyyy-MM-dd format). AI-facing model definition JSON. Do not pass raw QP, events, event_view, visual_view, or analysis_query. Distribution filters must be attached to the corresponding distribution_metrics[].filters; do not use top-level filters or relation. For path definitions, global filters support user_property, cluster, and tag only; event_property is not supported. session_unit accepts second (1..999), minute (1..999), or hour (1..24). Do not use day; express one day as session_interval=24 and session_unit=hour. Session analysis is a different model: it cuts sessions with session_interval plus interval_unit (second and minute 1..999, hour 1..24), required unless cut_mode=session_id, and its metrics must match view_mode. For SQL, a simple query is {"sql":"select ..."}; raw variables use ${name}, while typed params use ${Text:name}, ${Selector:name}, or ${PartDate:name}. PartDate expands to a complete predicate, so write WHERE ${PartDate:d}, not a column followed by the placeholder. A part_date parameter may set boolean use_timezone; it defaults to false and controls whether that parameter uses the query effective timezone. Selector value must match one options[].value. Trino identifiers containing #, $, @, spaces, punctuation, or a reserved word must be delimited with double quotes, for example SELECT "#user_id", "$part_event", "end" FROM ...; single quotes are string literals. For multiline SQL JSON, the decoded sql value must contain a real line break; do not submit a literal \\n sequence outside quoted SQL text. Queries against an event table must include a date-partition predicate on the quoted "$part_date" column, for example WHERE "$part_date" BETWEEN \'2026-07-01\' AND \'2026-07-07\'; the backend rejects event-table SQL without it. The CLI preserves SQL text and never auto-quotes identifiers.';
4282
+ var AI_DEFINITION_DESCRIPTION = 'Event metrics: omit optional display_name unless the target command schema explicitly supports it. Funnel step filters use event_property_name (not field) and string-array values, including "true"/"false" for boolean properties. For tag/cluster filters and groups, put the policy beside field. For tags, AUTO and SPECIFIED require has_history_versions=true from analysis-meta catalog list. Only local SPECIFIED dates must match user-tag get --include-history-dates true. cluster_date_policy accepts LATEST (default), AUTO (match the computed result for each analysis date), or SPECIFIED (requires specified_cluster_date in yyyy-MM-dd format). AI-facing model definition JSON. Do not pass raw QP, events, event_view, visual_view, or analysis_query. Distribution filters must be attached to the corresponding distribution_metrics[].filters; do not use top-level filters or relation. For path definitions, global filters support user_property, cluster, and tag only; event_property is not supported. session_interval must be a positive integer; session_unit accepts second (1..3600), minute (1..1440), hour (1..168), or day (1..180). Session analysis is a different model: it cuts sessions with session_interval plus interval_unit (second and minute 1..999, hour 1..24), required unless cut_mode=session_id, and its metrics must match view_mode. For SQL, a simple query is {"sql":"select ..."}; raw variables use ${name}, while typed params use ${Text:name}, ${Selector:name}, or ${PartDate:name}. PartDate expands to a complete predicate, so write WHERE ${PartDate:d}, not a column followed by the placeholder. A part_date parameter may set boolean use_timezone; it defaults to false and controls whether that parameter uses the query effective timezone. Selector value must match one options[].value. Trino identifiers containing #, $, @, spaces, punctuation, or a reserved word must be delimited with double quotes, for example SELECT "#user_id", "$part_event", "end" FROM ...; single quotes are string literals. For multiline SQL JSON, the decoded sql value must contain a real line break; do not submit a literal \\n sequence outside quoted SQL text. Queries against an event table must include a date-partition predicate on the quoted "$part_date" column, for example WHERE "$part_date" BETWEEN \'2026-07-01\' AND \'2026-07-07\'; the backend rejects event-table SQL without it. The CLI preserves SQL text and never auto-quotes identifiers.';
4263
4283
  var REPORT_WRITE_DEFINITION_DESCRIPTION = `${AI_DEFINITION_DESCRIPTION} Saved funnel definitions may set optional funnel.steps[].display_name; report get returns it and report create/update preserves it. Saved-report filters may contain one compound group level only; every item inside that group must be a leaf without another items array. Historical deeper trees remain readable but cannot be written back as a definition. For model_type=tag, pass a tag report intent such as {"tag":{"tag_name":"vip_users","time_range":{"mode":"recent","unit":"day","value":7}}}. Tags are supported for report create/update and report data, not ad-hoc analysis.`;
4264
4284
  function aiModelTypeFlag(required) {
4265
4285
  return {
@@ -4286,7 +4306,7 @@ function validateFunnelStepFilters(modelType, definition) {
4286
4306
  if (!Array.isArray(filter.items) || filter.items.length === 0) {
4287
4307
  errors.push(`${location}.items: use a non-empty array of event-property filters or nested groups.`);
4288
4308
  } else {
4289
- filter.items.forEach((item, index) => visit(item, `${location}.items[${index}]`));
4309
+ filter.items.forEach((item2, index) => visit(item2, `${location}.items[${index}]`));
4290
4310
  }
4291
4311
  return;
4292
4312
  }
@@ -4386,12 +4406,12 @@ function validateReportPresentation(ctx) {
4386
4406
  function validateSeries(value) {
4387
4407
  if (!Array.isArray(value)) throw new Error("--presentation.series must be an array; [] resets all series.");
4388
4408
  const indexes = /* @__PURE__ */ new Set();
4389
- for (const [position, item] of value.entries()) {
4409
+ for (const [position, item2] of value.entries()) {
4390
4410
  const path = `--presentation.series[${position}]`;
4391
- if (!item || typeof item !== "object" || Array.isArray(item) || Object.keys(item).length !== 3 || Object.keys(item).some((key) => !["metric_index", "type", "axis"].includes(key))) {
4411
+ if (!item2 || typeof item2 !== "object" || Array.isArray(item2) || Object.keys(item2).length !== 3 || Object.keys(item2).some((key) => !["metric_index", "type", "axis"].includes(key))) {
4392
4412
  throw new Error(`${path} requires only metric_index, type, and axis, all three required.`);
4393
4413
  }
4394
- const series = item;
4414
+ const series = item2;
4395
4415
  if (typeof series.metric_index !== "number" || !Number.isInteger(series.metric_index) || series.metric_index < 1) {
4396
4416
  throw new Error(`${path}.metric_index must be a positive 1-based integer position in definition.metrics.`);
4397
4417
  }
@@ -4549,12 +4569,12 @@ async function withSqlSelectorRuntimeErrorHint(operation) {
4549
4569
  throw enrichSqlSelectorRuntimeError(error);
4550
4570
  }
4551
4571
  }
4552
- function withSqlSelectorRuntimeDiagnostics(command) {
4553
- const validateInput2 = command.validateInput;
4554
- const dryRun = command.dryRun;
4555
- const execute = command.execute;
4572
+ function withSqlSelectorRuntimeDiagnostics(command2) {
4573
+ const validateInput2 = command2.validateInput;
4574
+ const dryRun = command2.dryRun;
4575
+ const execute = command2.execute;
4556
4576
  return {
4557
- ...command,
4577
+ ...command2,
4558
4578
  ...validateInput2 ? { validateInput: (ctx) => withSqlSelectorRuntimeErrorHint(() => validateInput2(ctx)) } : {},
4559
4579
  ...dryRun ? { dryRun: (ctx) => withSqlSelectorRuntimeErrorHint(() => dryRun(ctx)) } : {},
4560
4580
  execute: (ctx) => withSqlSelectorRuntimeErrorHint(() => execute(ctx))
@@ -4740,10 +4760,11 @@ var dashboardList = createAnalysisCapabilityCommand({
4740
4760
  resource: "dashboard",
4741
4761
  command: "list",
4742
4762
  capabilityId: "analysis.dashboard.list",
4743
- description: "List dashboards the current user can update or manage. Read-only dashboards are excluded; use analysis asset search for readable asset discovery.",
4763
+ description: "List readable dashboards. For management workflows use --manageable-only. Use analysis asset search for asset discovery.",
4744
4764
  flags: [
4745
4765
  projectIdFlag,
4746
4766
  queriesFlag,
4767
+ manageableOnlyFlag,
4747
4768
  {
4748
4769
  name: "fields",
4749
4770
  type: "json",
@@ -4759,6 +4780,7 @@ var dashboardList = createAnalysisCapabilityCommand({
4759
4780
  validate: validateQueriesFlag,
4760
4781
  buildInput: (ctx) => compactInput({
4761
4782
  ...listInput(ctx),
4783
+ manageable_only: optionalBoolean(ctx, "manageable-only"),
4762
4784
  certification_scope: certificationScopeInput(ctx)
4763
4785
  })
4764
4786
  });
@@ -4825,7 +4847,7 @@ var dashboardUpdate = createAnalysisCapabilityCommand({
4825
4847
  { name: "note-id", type: "number", required: false, desc: "Dashboard note ID. Omit to create a new note attached to the dashboard." },
4826
4848
  { name: "note-title", type: "string", required: false, desc: "Dashboard note title. Defaults to empty on create; omitted values are preserved on update." },
4827
4849
  { name: "description", type: "string", required: false, desc: "Dashboard note description. Defaults to empty on create; omitted values are preserved on update." },
4828
- { name: "ui-config", type: "string", required: false, desc: "Dashboard or note UI config string. Omitted note style is preserved on update." },
4850
+ { name: "ui-config", type: "string", required: false, desc: "Note UI config string. Omitted note style is preserved on update. Retained as a deprecated no-op for settings." },
4829
4851
  { name: "filter-name", type: "string", required: false, desc: "Saved filter name. Required with --operation default-filter or personal-default-filter." },
4830
4852
  { name: "filter", type: "json", required: false, desc: 'Saved filter in snake_case QP form: root junction_kind (and/or) and ta_filters array; SIMPLE conditions use filter_type="SIMPLE", column_name, table_type ("0" event, "1" user, "2" cluster/tag), select_type, calcu_symbol (C00 equals), and ftv. Do not use metadata table names or property_name/values. Common validates the QP format; ae-cli forwards it without local QP validation. Required with --operation default-filter, personal-default-filter, or business-filter. Pass {"junction_kind":"and","ta_filters":[]} to clear a business filter.' },
4831
4853
  payloadFlag
@@ -4876,7 +4898,7 @@ var dashboardShare = createAnalysisCapabilityCommand({
4876
4898
  { name: "member-authorities", type: "json", required: false, desc: 'Complete user authority map: {"<numeric_user_id>":"READ|EDIT|CREATOR|MAINTAIN"}. An empty object removes all directly shared users.' },
4877
4899
  payloadFlag
4878
4900
  ],
4879
- risk: "write",
4901
+ risk: "high-risk-write",
4880
4902
  buildInput: (ctx) => compactInput({
4881
4903
  ...projectInput(ctx),
4882
4904
  dashboard_id: ctx.num("dashboard-id"),
@@ -4910,7 +4932,7 @@ var dashboardHandover = createAnalysisCapabilityCommand({
4910
4932
  { name: "dashboard-ids", type: "json", required: true, desc: "Dashboard ID array." },
4911
4933
  { name: "to-user-id", type: "number", required: true, desc: "Target user ID." }
4912
4934
  ],
4913
- risk: "write",
4935
+ risk: "high-risk-write",
4914
4936
  buildInput: (ctx) => ({
4915
4937
  ...projectInput(ctx),
4916
4938
  dashboard_ids: jsonArray(ctx, "dashboard-ids"),
@@ -5212,13 +5234,14 @@ var dashboardReportDataExport = createAnalysisCapabilityCommand({
5212
5234
  clusterQueryScopeFlag,
5213
5235
  slaveClusterIdFlag,
5214
5236
  { name: "zone-offset", type: "number", required: false, desc: reportDataZoneOffsetDescription },
5237
+ { name: "use-cache", type: "boolean", required: false, desc: "Deprecated compatibility no-op. Exports always bypass query cache; true and false are accepted without changing execution." },
5215
5238
  { name: "request-id", type: "string", required: false, desc: "Optional cli_<32 lowercase hex> request ID. Generated when omitted." },
5216
5239
  asyncTimeoutSecondsFlag,
5217
5240
  { name: "artifact-format", type: "string", required: false, desc: "Artifact format. Only jsonl is supported." }
5218
5241
  ],
5219
5242
  risk: "read",
5220
5243
  validate: validateClusterQueryRouting,
5221
- buildInput: (ctx) => dashboardReportDataInput(ctx, false)
5244
+ buildInput: dashboardReportDataInput
5222
5245
  });
5223
5246
 
5224
5247
  // src/commands/te-analysis/dashboard-report-data/index.ts
@@ -5238,7 +5261,7 @@ var queryCancel = createAnalysisCapabilityCommand({
5238
5261
  { name: "run-id", type: "string", required: true, desc: "Async run ID returned by an export capability." },
5239
5262
  { name: "reason", type: "string", required: false, desc: "Optional cancellation reason." }
5240
5263
  ],
5241
- risk: "write",
5264
+ risk: "high-risk-write",
5242
5265
  buildInput: (ctx) => compactInput({
5243
5266
  run_id: ctx.str("run-id"),
5244
5267
  reason: optionalString(ctx, "reason")
@@ -5573,7 +5596,7 @@ var adhocRunFlags = [
5573
5596
  analysisModelPreviewRowsFlag
5574
5597
  ];
5575
5598
  var adhocExportFlags = [
5576
- ...adhocBaseFlags,
5599
+ ...adhocBaseFlags.map((flag) => flag.name === "use-cache" ? { ...flag, desc: "Deprecated compatibility no-op. Exports always bypass query cache; true and false are accepted without changing execution." } : flag),
5577
5600
  artifactFormatFlag,
5578
5601
  asyncTimeoutSecondsFlag
5579
5602
  ];
@@ -5759,7 +5782,7 @@ function dailyReportUpdateFlags() {
5759
5782
  { name: "enable-slack", type: "boolean", required: false, desc: "Whether scheduled Slack delivery is enabled." },
5760
5783
  ...destinationFlags,
5761
5784
  { name: "send-date", type: "string", required: false, desc: "Scheduled weekdays, comma-separated 1..7." },
5762
- { name: "send-time", type: "string", required: false, desc: "Scheduled send time, HH:mm." },
5785
+ { name: "send-time", type: "string", required: false, desc: "Scheduled whole hours: hour or HH:00, optionally comma-separated, for example 9 or 09:00,18:00." },
5763
5786
  { name: "enable-send", type: "boolean", required: false, desc: "Whether scheduled sending is enabled." }
5764
5787
  ];
5765
5788
  }
@@ -5958,7 +5981,7 @@ var biPanelShare = createAnalysisCapabilityCommand({
5958
5981
  capabilityId: "analysis.bi_panel.share",
5959
5982
  description: "Modify BI panel sharing members.",
5960
5983
  flags: [projectIdFlag, { name: "panel-id", type: "number", required: true, desc: "BI panel ID." }, payloadFlag],
5961
- risk: "write",
5984
+ risk: "high-risk-write",
5962
5985
  buildInput: (ctx) => compactInput({
5963
5986
  ...projectInput(ctx),
5964
5987
  panel_id: ctx.num("panel-id"),
@@ -6982,6 +7005,12 @@ var autoRefreshCronFlag = {
6982
7005
  desc: "Optional Quartz cron expression for an existing enabled auto-refresh schedule. This does not enable auto refresh."
6983
7006
  };
6984
7007
  var tagAutoRefreshFlags = [
7008
+ {
7009
+ name: "enable-history-tag-backup",
7010
+ type: "boolean",
7011
+ required: false,
7012
+ desc: "Save historical tag versions during scheduled refresh. Enabling requires periodic refresh. Omit on update to preserve the setting."
7013
+ },
6985
7014
  {
6986
7015
  name: "enable-auto-refresh",
6987
7016
  type: "boolean",
@@ -7102,10 +7131,10 @@ var groupColFlag = {
7102
7131
  required: true,
7103
7132
  desc: "Exact statistic value or bucket from history-tag-data results to drill down into."
7104
7133
  };
7105
- function capability(resource, command, capabilityId, description, flags, risk, buildInput2, options = {}) {
7134
+ function capability(resource, command2, capabilityId, description, flags, risk, buildInput2, options = {}) {
7106
7135
  return createAnalysisCapabilityCommand({
7107
7136
  resource,
7108
- command,
7137
+ command: command2,
7109
7138
  capabilityId,
7110
7139
  description,
7111
7140
  flags,
@@ -7114,14 +7143,14 @@ function capability(resource, command, capabilityId, description, flags, risk, b
7114
7143
  ...options
7115
7144
  });
7116
7145
  }
7117
- function idImportCapability(command) {
7118
- const originalValidate = command.validate;
7119
- const originalValidateInput = command.validateInput;
7120
- const originalDryRun = command.dryRun;
7121
- const originalExecute = command.execute;
7146
+ function idImportCapability(command2) {
7147
+ const originalValidate = command2.validate;
7148
+ const originalValidateInput = command2.validateInput;
7149
+ const originalDryRun = command2.dryRun;
7150
+ const originalExecute = command2.execute;
7122
7151
  return {
7123
- ...command,
7124
- flags: command.flags.flatMap((flag) => flag.name === "input-file-id" ? [inputFileFlag, flag] : [flag]),
7152
+ ...command2,
7153
+ flags: command2.flags.flatMap((flag) => flag.name === "input-file-id" ? [inputFileFlag, flag] : [flag]),
7125
7154
  validate: (ctx) => {
7126
7155
  originalValidate?.(ctx);
7127
7156
  const sources = ["input-file", "input-file-id", "file-content"].filter((name) => ctx.str(name).trim() !== "");
@@ -7152,7 +7181,7 @@ function idImportCapability(command) {
7152
7181
  },
7153
7182
  {
7154
7183
  method: "POST",
7155
- url: `${ctx.host()}/api/cli/${resolveGatewayDomain("analysis")}/v1/capabilities/${command.capabilityId}/dry-run`,
7184
+ url: buildCapabilityGatewayUrl(ctx.host(), resolveGatewayDomain("analysis"), `capabilities/${command2.capabilityId}/dry-run`),
7156
7185
  body: {
7157
7186
  input_file_id: "<input_file_id returned by upload step>",
7158
7187
  note: "The remaining command flags are sent unchanged after upload."
@@ -7247,6 +7276,7 @@ function clusterWriteInput(ctx, create) {
7247
7276
  function tagWriteInput(ctx, create) {
7248
7277
  const definitionRequest = optionalJson(ctx, "definition-request");
7249
7278
  validateDefinitionRequest(create, definitionRequest);
7279
+ const backup = optionalBoolean(ctx, "enable-history-tag-backup");
7250
7280
  const enabled = optionalBoolean(ctx, "enable-auto-refresh");
7251
7281
  const cron = optionalString(ctx, "auto-refresh-cron");
7252
7282
  const schedule = optionalJson(ctx, "auto-refresh-schedule");
@@ -7256,6 +7286,9 @@ function tagWriteInput(ctx, create) {
7256
7286
  if (enabled === false && (cron !== void 0 || schedule !== void 0)) {
7257
7287
  throw new Error("Cannot set a schedule with --enable-auto-refresh false");
7258
7288
  }
7289
+ if (backup === true && (enabled === false || create && schedule === void 0 && cron === void 0)) {
7290
+ throw new Error("Enabling history tag backup requires periodic refresh with a schedule");
7291
+ }
7259
7292
  if (create && enabled === true && cron === void 0 && schedule === void 0) {
7260
7293
  throw new Error("Enabling auto refresh on create requires --auto-refresh-schedule or --auto-refresh-cron");
7261
7294
  }
@@ -7268,6 +7301,7 @@ function tagWriteInput(ctx, create) {
7268
7301
  remark: create ? void 0 : optionalString(ctx, "remark"),
7269
7302
  zone_offset: optionalNumber(ctx, "zone-offset"),
7270
7303
  enable_auto_refresh: enabled,
7304
+ enable_history_tag_backup: backup,
7271
7305
  auto_refresh_cron: cron,
7272
7306
  auto_refresh_schedule: schedule,
7273
7307
  entity_id: create ? optionalNumber(ctx, "entity-id") : void 0
@@ -7510,10 +7544,12 @@ var commands42 = [
7510
7544
  ),
7511
7545
  capability("user-tag", "get", "analysis.user_tag.get", "Get user tag details by exact tag_name values.", [
7512
7546
  projectIdFlag,
7547
+ { name: "include-history-dates", type: "boolean", desc: "Include selectable local dates. Cross-source dates are not enumerated." },
7513
7548
  { name: "tag-names", type: "json", required: true, desc: "JSON array of exact tag_name values." }
7514
7549
  ], "read", (ctx) => ({
7515
7550
  project_id: ctx.num("project-id"),
7516
- tag_names: ctx.json("tag-names")
7551
+ tag_names: ctx.json("tag-names"),
7552
+ ...compactInput({ include_history_dates: optionalBoolean(ctx, "include-history-dates") })
7517
7553
  })),
7518
7554
  capability("user-tag-member", "list", "analysis.user_tag_member.list", `Run a bounded user tag member query. ${memberDataRunRoutingHelp}`, [
7519
7555
  tagNameFlag,
@@ -7532,7 +7568,10 @@ var commands42 = [
7532
7568
  tagDefinitionRequestFlag,
7533
7569
  authenticatedOnlyFlag,
7534
7570
  zoneOffsetFlag2,
7535
- entityIdFlag,
7571
+ {
7572
+ ...entityIdFlag,
7573
+ desc: "For SQL tags, explicitly pass the project entity that receives the tag. Resolve it with project entity list/get and verify the first SQL column identifies that entity. Matching SQL types alone are insufficient."
7574
+ },
7536
7575
  ...tagAutoRefreshFlags
7537
7576
  ], "write", (ctx) => tagWriteInput(ctx, true)),
7538
7577
  capability("user-tag", "update", "analysis.user_tag.update", "Update a user tag. Pass only fields that should change.", [
@@ -7747,7 +7786,7 @@ var inputFileInspect = {
7747
7786
  risk: "read",
7748
7787
  dryRun: (ctx) => ({
7749
7788
  method: "GET",
7750
- url: `${ctx.host()}/api/cli/${resolveGatewayDomain("analysis")}/v1/input-files/${ctx.str("input-file-id")}`
7789
+ url: buildCapabilityGatewayUrl(ctx.host(), resolveGatewayDomain("analysis"), `input-files/${ctx.str("input-file-id")}`)
7751
7790
  }),
7752
7791
  execute: async (ctx) => {
7753
7792
  const inputFileId = ctx.str("input-file-id");
@@ -7758,7 +7797,7 @@ var inputFileInspect = {
7758
7797
  );
7759
7798
  return {
7760
7799
  ...result,
7761
- inspect_path: `/api/cli/analysis/v1/input-files/${inputFileId}`,
7800
+ inspect_path: new URL(buildCapabilityGatewayUrl(ctx.host(), resolveGatewayDomain("analysis"), `input-files/${inputFileId}`)).pathname,
7762
7801
  inspect_command: `ae-cli analysis input-file inspect --input-file-id ${inputFileId}`
7763
7802
  };
7764
7803
  }
@@ -7809,7 +7848,7 @@ var inputFileUpload = {
7809
7848
  const inputFileId = result?.input_file_id ?? result?.inputFileId;
7810
7849
  return {
7811
7850
  ...result,
7812
- inspect_path: typeof inputFileId === "string" ? `/api/cli/analysis/v1/input-files/${inputFileId}` : result?.inspect_path,
7851
+ inspect_path: typeof inputFileId === "string" ? new URL(buildCapabilityGatewayUrl(ctx.host(), resolveGatewayDomain("analysis"), `input-files/${inputFileId}`)).pathname : result?.inspect_path,
7813
7852
  inspect_command: typeof inputFileId === "string" ? `ae-cli analysis input-file inspect --input-file-id ${inputFileId}` : void 0
7814
7853
  };
7815
7854
  }
@@ -7902,7 +7941,7 @@ var projectDataPowerUpsert = createAnalysisCapabilityCommand({
7902
7941
  projectIdFlag,
7903
7942
  requiredPayloadFlag
7904
7943
  ],
7905
- risk: "write",
7944
+ risk: "high-risk-write",
7906
7945
  buildInput: (ctx) => compactInput({
7907
7946
  project_id: ctx.num("project-id"),
7908
7947
  payload: ctx.json("payload")
@@ -8193,8 +8232,8 @@ var projectMarkTimeCreate = createAnalysisCapabilityCommand({
8193
8232
  flags: [
8194
8233
  projectIdFlag,
8195
8234
  { name: "marked-at", type: "string", required: true, desc: "Marker timestamp, for example yyyy-MM-dd HH:mm." },
8196
- { name: "zone-offset", type: "number", required: false, desc: "Marker time zone offset." },
8197
- { name: "content", type: "string", required: true, desc: "Marker content." },
8235
+ { name: "zone-offset", type: "number", required: false, desc: "Marker time zone offset. When project time zones are enabled, fixed offsets are -12..14 and 99 preserves stored local time. Omit for the project default." },
8236
+ { name: "content", type: "string", required: true, desc: "Marker content, at most 200 characters." },
8198
8237
  { name: "is-visible", type: "number", required: false, desc: "Whether the marker is visible. 1 visible, 0 hidden." }
8199
8238
  ],
8200
8239
  risk: "write",
@@ -8260,8 +8299,8 @@ var projectMarkTimeUpdate = createAnalysisCapabilityCommand({
8260
8299
  projectIdFlag,
8261
8300
  { name: "mark-time-id", type: "number", required: true, desc: "Date marker ID." },
8262
8301
  { name: "marked-at", type: "string", required: true, desc: "Marker timestamp, for example yyyy-MM-dd HH:mm." },
8263
- { name: "zone-offset", type: "number", required: false, desc: "Marker time zone offset." },
8264
- { name: "content", type: "string", required: true, desc: "Marker content." },
8302
+ { name: "zone-offset", type: "number", required: false, desc: "Marker time zone offset. When project time zones are enabled, fixed offsets are -12..14 and 99 preserves stored local time. Omit for the project default." },
8303
+ { name: "content", type: "string", required: true, desc: "Marker content, at most 200 characters." },
8265
8304
  { name: "is-visible", type: "number", required: false, desc: "Whether the marker is visible. 1 visible, 0 hidden." }
8266
8305
  ],
8267
8306
  risk: "write",
@@ -8300,7 +8339,7 @@ var projectMemberAdd = createAnalysisCapabilityCommand({
8300
8339
  desc: "Member add type: 0 creates a company member from project management; 1 adds an existing company member. Type 0 may be disabled by company configuration."
8301
8340
  }
8302
8341
  ],
8303
- risk: "write",
8342
+ risk: "high-risk-write",
8304
8343
  buildInput: (ctx) => compactInput({
8305
8344
  project_id: ctx.num("project-id"),
8306
8345
  payload: ctx.json("payload"),
@@ -8318,7 +8357,7 @@ var projectMemberBatchUpdate = createAnalysisCapabilityCommand({
8318
8357
  projectIdFlag,
8319
8358
  requiredPayloadFlag
8320
8359
  ],
8321
- risk: "write",
8360
+ risk: "high-risk-write",
8322
8361
  buildInput: (ctx) => compactInput({
8323
8362
  project_id: ctx.num("project-id"),
8324
8363
  payload: ctx.json("payload")
@@ -8389,7 +8428,7 @@ var projectMemberUpdate = createAnalysisCapabilityCommand({
8389
8428
  requiredPayloadFlag,
8390
8429
  { name: "target-user-id", type: "number", required: true, desc: "Target user ID." }
8391
8430
  ],
8392
- risk: "write",
8431
+ risk: "high-risk-write",
8393
8432
  buildInput: (ctx) => compactInput({
8394
8433
  project_id: ctx.num("project-id"),
8395
8434
  payload: ctx.json("payload"),
@@ -8633,7 +8672,7 @@ var projectMemberHandoverRun = createAnalysisCapabilityCommand({
8633
8672
  projectIdFlag,
8634
8673
  requiredPayloadFlag
8635
8674
  ],
8636
- risk: "write",
8675
+ risk: "high-risk-write",
8637
8676
  buildInput: (ctx) => compactInput({
8638
8677
  project_id: ctx.num("project-id"),
8639
8678
  payload: ctx.json("payload")
@@ -8677,11 +8716,11 @@ var projectOwnerUpdate = createAnalysisCapabilityCommand({
8677
8716
  flags: [
8678
8717
  projectIdFlag,
8679
8718
  { name: "company-id", type: "number", required: true, desc: "Company ID." },
8680
- { name: "owner-user-id", type: "number", required: false, desc: "New owner user ID. Omit to only downgrade existing owner." },
8719
+ { name: "owner-user-id", type: "number", required: false, desc: "New owner user ID. Common treats a company root as company-admin management. Omit for the same behavior; the existing owner is downgraded." },
8681
8720
  { name: "project-name", type: "string", required: false, desc: "Optional project name update." },
8682
8721
  { name: "project-remark", type: "string", required: false, desc: "Optional project remark update." }
8683
8722
  ],
8684
- risk: "write",
8723
+ risk: "high-risk-write",
8685
8724
  buildInput: (ctx) => compactInput({
8686
8725
  project_id: ctx.num("project-id"),
8687
8726
  company_id: ctx.num("company-id"),
@@ -8828,7 +8867,7 @@ var projectRoleUpsert = createAnalysisCapabilityCommand({
8828
8867
  desc: "Role payload with role_func_list object items containing function_name and has_power (0 or 1)."
8829
8868
  }
8830
8869
  ],
8831
- risk: "write",
8870
+ risk: "high-risk-write",
8832
8871
  buildInput: (ctx) => compactInput({
8833
8872
  project_id: ctx.num("project-id"),
8834
8873
  payload: ctx.json("payload")
@@ -8949,78 +8988,78 @@ var projectTimezoneUpdate = createAnalysisCapabilityCommand({
8949
8988
  ],
8950
8989
  risk: "write",
8951
8990
  buildInput: (ctx) => {
8952
- const item = ctx.str("item").toLowerCase();
8991
+ const item2 = ctx.str("item").toLowerCase();
8953
8992
  const payload = ctx.json("payload");
8954
- validateTimezonePayload(item, payload);
8993
+ validateTimezonePayload(item2, payload);
8955
8994
  return compactInput({
8956
8995
  project_id: ctx.num("project-id"),
8957
8996
  payload,
8958
- item
8997
+ item: item2
8959
8998
  });
8960
8999
  }
8961
9000
  });
8962
- function validateTimezonePayload(item, payload) {
8963
- if (!TIMEZONE_ITEMS.includes(item)) {
9001
+ function validateTimezonePayload(item2, payload) {
9002
+ if (!TIMEZONE_ITEMS.includes(item2)) {
8964
9003
  throw new CliValidationError(
8965
9004
  "--item must be timezone_toggle, zone_offset, user_timezone, or project_timezone_display.",
8966
9005
  { code: "INVALID_TIMEZONE_ITEM" }
8967
9006
  );
8968
9007
  }
8969
9008
  if (!isObject(payload)) {
8970
- throw invalidPayload(item, "must be a JSON object");
9009
+ throw invalidPayload(item2, "must be a JSON object");
8971
9010
  }
8972
- switch (item) {
9011
+ switch (item2) {
8973
9012
  case "timezone_toggle":
8974
9013
  if (typeof payload.toggle !== "boolean") {
8975
- throw invalidPayload(item, "requires boolean field toggle", '{"toggle":true}');
9014
+ throw invalidPayload(item2, "requires boolean field toggle", '{"toggle":true}');
8976
9015
  }
8977
- allowOnly(payload, item, ["toggle"]);
9016
+ allowOnly(payload, item2, ["toggle"]);
8978
9017
  return;
8979
9018
  case "zone_offset":
8980
9019
  if (typeof payload.column_name !== "string") {
8981
- throw invalidPayload(item, "requires string field column_name", '{"column_name":"#zone_offset"}');
9020
+ throw invalidPayload(item2, "requires string field column_name", '{"column_name":"#zone_offset"}');
8982
9021
  }
8983
- allowOnly(payload, item, ["column_name"]);
9022
+ allowOnly(payload, item2, ["column_name"]);
8984
9023
  return;
8985
9024
  case "user_timezone":
8986
9025
  if (typeof payload.column_name !== "string" || payload.column_name.length === 0) {
8987
- throw invalidPayload(item, "requires non-empty string field column_name", '{"column_name":"user_timezone"}');
9026
+ throw invalidPayload(item2, "requires non-empty string field column_name", '{"column_name":"user_timezone"}');
8988
9027
  }
8989
9028
  if (payload.codetable !== void 0 && typeof payload.codetable !== "string") {
8990
- throw invalidPayload(item, "optional field codetable must be a string", '{"column_name":"user_timezone","codetable":"timezone_code_table"}');
9029
+ throw invalidPayload(item2, "optional field codetable must be a string", '{"column_name":"user_timezone","codetable":"timezone_code_table"}');
8991
9030
  }
8992
- allowOnly(payload, item, ["column_name", "codetable"]);
9031
+ allowOnly(payload, item2, ["column_name", "codetable"]);
8993
9032
  return;
8994
9033
  case "project_timezone_display":
8995
- validateDisplayTimezones(payload.display_timezones, item);
8996
- allowOnly(payload, item, ["display_timezones"]);
9034
+ validateDisplayTimezones(payload.display_timezones, item2);
9035
+ allowOnly(payload, item2, ["display_timezones"]);
8997
9036
  }
8998
9037
  }
8999
- function validateDisplayTimezones(value, item) {
9038
+ function validateDisplayTimezones(value, item2) {
9000
9039
  if (!Array.isArray(value) || value.length === 0) {
9001
- throw invalidPayload(item, "requires non-empty array field display_timezones", '{"display_timezones":[{"timezone":8,"is_default":true}]}');
9040
+ throw invalidPayload(item2, "requires non-empty array field display_timezones", '{"display_timezones":[{"timezone":8,"is_default":true}]}');
9002
9041
  }
9003
9042
  for (const entry of value) {
9004
9043
  if (!isObject(entry)) {
9005
- throw invalidPayload(item, "display_timezones entries must be objects", '{"display_timezones":[{"timezone":8,"is_default":true}]}');
9044
+ throw invalidPayload(item2, "display_timezones entries must be objects", '{"display_timezones":[{"timezone":8,"is_default":true}]}');
9006
9045
  }
9007
- allowOnly(entry, item, ["timezone", "is_default"]);
9046
+ allowOnly(entry, item2, ["timezone", "is_default"]);
9008
9047
  if (!Number.isInteger(entry.timezone) || !(entry.timezone >= -12 && entry.timezone <= 14 || entry.timezone === 99)) {
9009
- throw invalidPayload(item, "display_timezones[].timezone must be an integer from -12 through 14, or 99 for no fixed display timezone");
9048
+ throw invalidPayload(item2, "display_timezones[].timezone must be an integer from -12 through 14, or 99 for no fixed display timezone");
9010
9049
  }
9011
9050
  if (entry.is_default !== void 0 && typeof entry.is_default !== "boolean") {
9012
- throw invalidPayload(item, "display_timezones[].is_default must be a boolean when provided");
9051
+ throw invalidPayload(item2, "display_timezones[].is_default must be a boolean when provided");
9013
9052
  }
9014
9053
  }
9015
9054
  }
9016
- function allowOnly(payload, item, fields2) {
9055
+ function allowOnly(payload, item2, fields2) {
9017
9056
  if (Object.keys(payload).some((field) => !fields2.includes(field))) {
9018
- throw invalidPayload(item, `supports only fields ${fields2.join(", ")}`);
9057
+ throw invalidPayload(item2, `supports only fields ${fields2.join(", ")}`);
9019
9058
  }
9020
9059
  }
9021
- function invalidPayload(item, reason, example) {
9060
+ function invalidPayload(item2, reason, example) {
9022
9061
  return new CliValidationError(
9023
- `--payload for --item ${item} ${reason}.`,
9062
+ `--payload for --item ${item2} ${reason}.`,
9024
9063
  {
9025
9064
  code: "INVALID_TIMEZONE_PAYLOAD",
9026
9065
  hint: example === void 0 ? void 0 : `Use: --payload '${example}'`
@@ -9090,12 +9129,12 @@ var project_default = commands67;
9090
9129
  // src/commands/te-analysis/tracking/shared.ts
9091
9130
  function createTrackingCapabilityCommand(config) {
9092
9131
  const { asyncArtifact, ...coreConfig } = config;
9093
- const command = createCapabilityCommand({
9132
+ const command2 = createCapabilityCommand({
9094
9133
  ...coreConfig,
9095
9134
  cliService: "tracking",
9096
9135
  gatewayDomain: "analysis"
9097
9136
  });
9098
- return asyncArtifact ? withAsyncArtifactLifecycle(command) : command;
9137
+ return asyncArtifact ? withAsyncArtifactLifecycle(command2) : command2;
9099
9138
  }
9100
9139
  var eventsFlag = {
9101
9140
  name: "events",
@@ -9559,20 +9598,20 @@ function definitions(candidates, kind) {
9559
9598
  function existingDefinitions(value, nameField, displayNameField) {
9560
9599
  if (!Array.isArray(value)) return [];
9561
9600
  const rows = [];
9562
- for (const item of value) {
9563
- if (!isRecord2(item)) continue;
9564
- const name = nonEmptyString(item[nameField]);
9601
+ for (const item2 of value) {
9602
+ if (!isRecord2(item2)) continue;
9603
+ const name = nonEmptyString(item2[nameField]);
9565
9604
  if (!name) continue;
9566
9605
  rows.push({
9567
9606
  name,
9568
- displayName: nonEmptyString(item[displayNameField])
9607
+ displayName: nonEmptyString(item2[displayNameField])
9569
9608
  });
9570
9609
  }
9571
9610
  return rows;
9572
9611
  }
9573
9612
  function buildGroup(type, source, existing) {
9574
9613
  const existingByName = new Map(
9575
- existing.map((item) => [item.name, item.displayName])
9614
+ existing.map((item2) => [item2.name, item2.displayName])
9576
9615
  );
9577
9616
  const items = [];
9578
9617
  const skippedExisting = [];
@@ -10361,6 +10400,26 @@ var alert_notice_config_default = commands82;
10361
10400
  // src/commands/te-analysis/system/shared.ts
10362
10401
  import { readFileSync as readFileSync3, statSync as statSync3 } from "fs";
10363
10402
  var secretValues = /* @__PURE__ */ new WeakMap();
10403
+ var backendConfirmationCapabilities = /* @__PURE__ */ new Set([
10404
+ "system.member_status.update",
10405
+ "system.member_project.batch_update",
10406
+ "system.member_password.reset",
10407
+ "system.member.delete",
10408
+ "system.role.upsert",
10409
+ "system.role.delete",
10410
+ "system.admin.upsert",
10411
+ "system.admin_function.update",
10412
+ "system.admin.remove",
10413
+ "system.seat.update",
10414
+ "system.mfa.update",
10415
+ "system.member_mfa.unbind",
10416
+ "system.query_task.cancel",
10417
+ "system.query_alert_rule.update",
10418
+ "system.ops_alert_contact.delete",
10419
+ "system.smtp.delete",
10420
+ "system.receiver_address.delete",
10421
+ "system.third_party_login.disable"
10422
+ ]);
10364
10423
  var companyIdField = {
10365
10424
  flag: "company-id",
10366
10425
  input: "company_id",
@@ -10409,7 +10468,7 @@ function defineSystemCommand(spec) {
10409
10468
  risk: spec.risk,
10410
10469
  validate: (ctx) => {
10411
10470
  validateSecretSources(ctx, secrets);
10412
- const input = buildSystemInput(ctx, fields2, [], spec.risk);
10471
+ const input = buildSystemInput(ctx, fields2, [], spec.capabilityId);
10413
10472
  for (const secret of secrets) {
10414
10473
  if (ctx.str(`${secret.flag}-file`) || ctx.bool(`${secret.flag}-stdin`)) {
10415
10474
  input[secret.input] = "<provided>";
@@ -10419,7 +10478,7 @@ function defineSystemCommand(spec) {
10419
10478
  spec.validate?.(ctx, input);
10420
10479
  },
10421
10480
  buildInput: (ctx) => {
10422
- const input = buildSystemInput(ctx, fields2, secrets, spec.risk);
10481
+ const input = buildSystemInput(ctx, fields2, secrets, spec.capabilityId);
10423
10482
  validateFields(fields2, input);
10424
10483
  validateSecretSources(ctx, secrets);
10425
10484
  spec.validate?.(ctx, input);
@@ -10456,7 +10515,7 @@ function secretFlags(secret) {
10456
10515
  }
10457
10516
  ];
10458
10517
  }
10459
- function buildSystemInput(ctx, fields2, secrets, risk) {
10518
+ function buildSystemInput(ctx, fields2, secrets, capabilityId) {
10460
10519
  const input = {};
10461
10520
  for (const field of fields2) {
10462
10521
  const value = fieldValue(ctx, field);
@@ -10466,7 +10525,7 @@ function buildSystemInput(ctx, fields2, secrets, risk) {
10466
10525
  const value = secretValue(ctx, secret);
10467
10526
  if (value !== void 0) input[secret.input] = secret.transform ? secret.transform(value) : value;
10468
10527
  }
10469
- if (risk === "high-risk-write") input.yes = true;
10528
+ if (backendConfirmationCapabilities.has(capabilityId)) input.yes = true;
10470
10529
  return compactInput(input);
10471
10530
  }
10472
10531
  function fieldValue(ctx, field) {
@@ -10550,12 +10609,12 @@ function requireArrayObjects(input, name, requiredKeys) {
10550
10609
  const value = input[name];
10551
10610
  if (value === void 0) return;
10552
10611
  if (!Array.isArray(value)) throw validation(`${snakeToFlag(name)} must be a JSON array.`);
10553
- value.forEach((item, index) => {
10554
- if (!item || typeof item !== "object" || Array.isArray(item)) {
10612
+ value.forEach((item2, index) => {
10613
+ if (!item2 || typeof item2 !== "object" || Array.isArray(item2)) {
10555
10614
  throw validation(`${snakeToFlag(name)} item ${index + 1} must be an object.`);
10556
10615
  }
10557
10616
  for (const key of requiredKeys) {
10558
- if (!(key in item)) {
10617
+ if (!(key in item2)) {
10559
10618
  throw validation(`${snakeToFlag(name)} item ${index + 1} is missing ${key}.`);
10560
10619
  }
10561
10620
  }
@@ -10742,7 +10801,7 @@ var systemConfigurationCommands = [
10742
10801
  command: "upsert",
10743
10802
  capabilityId: "system.third_party_login.upsert",
10744
10803
  description: "Create or update a third-party login configuration using protected secret sources.",
10745
- risk: "write",
10804
+ risk: "high-risk-write",
10746
10805
  fields: [
10747
10806
  loginType,
10748
10807
  { flag: "app-id", type: "string", required: true, desc: "Provider application ID." },
@@ -10779,7 +10838,7 @@ var systemConfigurationCommands = [
10779
10838
  command: "update",
10780
10839
  capabilityId: "system.oauth2.update",
10781
10840
  description: "Enable or disable company OAuth2 login.",
10782
- risk: "write",
10841
+ risk: "high-risk-write",
10783
10842
  fields: [
10784
10843
  { flag: "enable-oauth2", type: "boolean", required: true, desc: "Target OAuth2 login state." }
10785
10844
  ]
@@ -11197,17 +11256,17 @@ var systemMonitoringCommands = [
11197
11256
  throw validation("--delete-ids must contain positive integers.");
11198
11257
  }
11199
11258
  const upserts = input.upserts;
11200
- for (const [index, item] of (upserts ?? []).entries()) {
11201
- const metric = Number(item.metric_content);
11202
- const wheelMinutes = Number(item.wheel_minutes);
11203
- const wheelInterval = Number(item.wheel_interval);
11204
- const threshold = Number(item.threshold);
11259
+ for (const [index, item2] of (upserts ?? []).entries()) {
11260
+ const metric = Number(item2.metric_content);
11261
+ const wheelMinutes = Number(item2.wheel_minutes);
11262
+ const wheelInterval = Number(item2.wheel_interval);
11263
+ const threshold = Number(item2.threshold);
11205
11264
  if (![1, 2, 3].includes(metric) || !Number.isInteger(wheelMinutes) || wheelMinutes < 1 || wheelMinutes > 1440 || !Number.isInteger(wheelInterval) || wheelInterval < 1 || wheelInterval > 1e3 || !Number.isFinite(threshold) || threshold < 0) {
11206
11265
  throw validation(`--upserts item ${index + 1} contains an invalid metric/window/threshold.`);
11207
11266
  }
11208
11267
  }
11209
11268
  const deleted = new Set((deleteIds ?? []).map(Number));
11210
- if ((upserts ?? []).some((item) => item.rule_id !== void 0 && deleted.has(Number(item.rule_id)))) {
11269
+ if ((upserts ?? []).some((item2) => item2.rule_id !== void 0 && deleted.has(Number(item2.rule_id)))) {
11211
11270
  throw validation("The same rule_id cannot appear in both --upserts and --delete-ids.");
11212
11271
  }
11213
11272
  }
@@ -11243,7 +11302,7 @@ var systemMonitoringCommands = [
11243
11302
  if (input.on_status === void 0) throw validation("--on-status is required when creating a contact.");
11244
11303
  requireAtLeastOne(
11245
11304
  input,
11246
- ["mail_address", "mobile", ...contactWebhookSecrets.map((item) => item.input)],
11305
+ ["mail_address", "mobile", ...contactWebhookSecrets.map((item2) => item2.input)],
11247
11306
  "Provide at least one delivery target when creating a contact."
11248
11307
  );
11249
11308
  }
@@ -11602,11 +11661,11 @@ var commonFlags2 = [
11602
11661
  { name: "query-path", type: "json", desc: "1..64 ordered references: [{capability_id,invocation_id?,client_request_id?,purpose?}]. Prefer only returned meta.invocation_id; fallback to returned gateway meta.client_request_id, never business request_id. One analysis data-query step required. Inputs/status/timing come from existing call telemetry. Never include query results." },
11603
11662
  { name: "project-id", type: "number", desc: "Source analysis project. Collection is skipped if omitted or the project has not explicitly enabled scenario samples." }
11604
11663
  ];
11605
- function withProjectCollectionPolicy(command) {
11664
+ function withProjectCollectionPolicy(command2) {
11606
11665
  return {
11607
- ...command,
11666
+ ...command2,
11608
11667
  execute: async (ctx) => {
11609
- const input = scenarioInput(ctx, command.command === "append");
11668
+ const input = scenarioInput(ctx, command2.command === "append");
11610
11669
  const skipped = (reason) => withOutputMetadata({
11611
11670
  accepted: false,
11612
11671
  skipped: true,
@@ -11615,9 +11674,9 @@ function withProjectCollectionPolicy(command) {
11615
11674
  ...input.answer_id ? { answer_id: input.answer_id } : {},
11616
11675
  ...input.entry_id ? { entry_id: input.entry_id } : {},
11617
11676
  ...input.target_answer_id ? { target_answer_id: input.target_answer_id } : {},
11618
- event_name: command.command === "append" ? "cli_analysis_scenario_entry" : "cli_analysis_scenario",
11677
+ event_name: command2.command === "append" ? "cli_analysis_scenario_entry" : "cli_analysis_scenario",
11619
11678
  delivery: "best_effort"
11620
- }, { capability_id: command.capabilityId });
11679
+ }, { capability_id: command2.capabilityId });
11621
11680
  if (input.project_id === void 0) return skipped("PROJECT_REQUIRED");
11622
11681
  try {
11623
11682
  const policy = await executeCapabilityWithEnvelope(ctx.host(), "analysis", "project.info.get", {
@@ -11629,7 +11688,7 @@ function withProjectCollectionPolicy(command) {
11629
11688
  } catch {
11630
11689
  return skipped("PROJECT_COLLECTION_CONFIG_UNAVAILABLE");
11631
11690
  }
11632
- return command.execute(ctx);
11691
+ return command2.execute(ctx);
11633
11692
  }
11634
11693
  };
11635
11694
  }
@@ -11718,7 +11777,7 @@ var scenarioList = createAnalysisCapabilityCommand({
11718
11777
  buildInput: scenarioListInput
11719
11778
  });
11720
11779
  function scenarioGetInput(ctx) {
11721
- const { limit, offset, ...input } = scenarioListInput(ctx);
11780
+ const { limit: limit2, offset, ...input } = scenarioListInput(ctx);
11722
11781
  for (const key of ["open-id", "agent-session-id", "question-id"]) {
11723
11782
  input[key.replaceAll("-", "_")] = text2(ctx.str(key), key, 191);
11724
11783
  }
@@ -11740,6 +11799,140 @@ var scenarioGet = createAnalysisCapabilityCommand({
11740
11799
  });
11741
11800
  var scenario_default = [scenarioBegin, scenarioCollect, scenarioAppend, scenarioList, scenarioGet];
11742
11801
 
11802
+ // src/commands/te-analysis/bad-case/evaluation-sync.ts
11803
+ async function syncBadCaseEvaluation(ctx, projectId, value) {
11804
+ const item2 = value;
11805
+ if (!item2?.evaluation || !["PENDING", "ERROR"].includes(item2.evaluation.state)) return value;
11806
+ const common = (action, input = {}) => executeCapability(ctx.host(), "analysis", `analysis.bad_case.${action}`, { project_id: projectId, ...input });
11807
+ let report;
11808
+ try {
11809
+ const config = await common("evaluation_config");
11810
+ if (!config?.initialized || config.te_project_id !== String(projectId) || !config.dataset_id)
11811
+ throw new EvalApiError("Initialize this project evaluation configuration first.", { code: "NOT_INITIALIZED", httpStatus: 0 });
11812
+ const version = Number(item2.version);
11813
+ if (!Number.isSafeInteger(version) || version <= 0)
11814
+ throw new EvalApiError("Invalid source version.", { code: "INVALID_RESPONSE", httpStatus: 0 });
11815
+ const active = item2.review_state === "APPROVED";
11816
+ const result = await evalApi(
11817
+ ctx,
11818
+ "PUT",
11819
+ `/semantic-evaluation/datasets/${encodeURIComponent(config.dataset_id)}/cases/${encodeURIComponent(item2.id)}`,
11820
+ void 0,
11821
+ {
11822
+ version,
11823
+ active,
11824
+ question: item2.evidence_snapshot.question,
11825
+ answer: item2.evidence_snapshot.answer,
11826
+ reason: item2.ai_summary.reason,
11827
+ supplement: item2.review?.supplement || ""
11828
+ },
11829
+ { teProjectId: String(projectId) }
11830
+ );
11831
+ if (result?.source_version !== version || typeof result.case_id !== "string" || (active ? !/^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$/.test(result.case_id) : result.case_id !== ""))
11832
+ throw new EvalApiError("Invalid synchronization response.", { code: "INVALID_RESPONSE", httpStatus: 0 });
11833
+ report = { state: "SYNCED", case_id: result.case_id };
11834
+ } catch (error) {
11835
+ const code = error instanceof EvalApiError ? error.code : "";
11836
+ report = { state: "ERROR", error_code: ["NOT_INITIALIZED", "INVALID_RESPONSE"].includes(code) ? code : error instanceof EvalApiError && error.httpStatus === 403 ? "FORBIDDEN" : error instanceof EvalApiError && (error.httpStatus === 401 || code === "EVAL_ACCESS_TOKEN_MISSING") ? "UNAUTHORIZED" : "AE_SYNC_FAILED" };
11837
+ }
11838
+ try {
11839
+ return await common("evaluation_result", { item_id: item2.id, version: item2.version, ...report });
11840
+ } catch {
11841
+ try {
11842
+ return await common("get", { item_id: item2.id });
11843
+ } catch {
11844
+ return { ...item2, evaluation: { state: "PENDING" } };
11845
+ }
11846
+ }
11847
+ }
11848
+
11849
+ // src/commands/te-analysis/bad-case/index.ts
11850
+ import { readFileSync as readFileSync4 } from "fs";
11851
+ var project = { name: "project-id", type: "number", required: true, desc: "Project owner or administrator access is required." };
11852
+ var request = { name: "client-request-id", type: "string", required: true, desc: "Stable request ID; preserve on retries." };
11853
+ var item = { name: "item-id", type: "string", required: true, desc: "Bad Case item ID as a decimal string." };
11854
+ var batch = { name: "batch-id", type: "string", required: true, desc: "Discovery batch ID returned by begin." };
11855
+ var limit = { name: "limit", type: "number", desc: "Page size, 1..100. Follow pagination until complete." };
11856
+ function badCaseInput(action, flags, ctx) {
11857
+ const input = {};
11858
+ for (const flag of flags) {
11859
+ if (flag.name === "input-file") continue;
11860
+ const value = ctx.str(flag.name);
11861
+ if (!value && !flag.required) continue;
11862
+ if (!value && flag.required) throw new CliValidationError(`${flag.name} is required.`);
11863
+ if (flag.type === "number") {
11864
+ const number = Number(value);
11865
+ const minimum = flag.name === "offset" ? 0 : 1;
11866
+ const maximum = flag.name === "limit" ? 100 : 2147483647;
11867
+ if (!Number.isInteger(number) || number < minimum || number > maximum) throw new CliValidationError(`${flag.name} must be an integer between ${minimum} and ${maximum}.`);
11868
+ input[flag.name.replaceAll("-", "_")] = number;
11869
+ } else if (flag.type === "boolean") {
11870
+ if (!["true", "false"].includes(value)) throw new CliValidationError(`${flag.name} must be true or false.`);
11871
+ input[flag.name.replaceAll("-", "_")] = value === "true";
11872
+ } else {
11873
+ if (["item-id", "batch-id", "after-id", "version"].includes(flag.name) && (!/^\d+$/.test(value) || BigInt(value) > 9223372036854775807n)) throw new CliValidationError(`${flag.name} must be a nonnegative 64-bit integer string.`);
11874
+ input[flag.name.replaceAll("-", "_")] = value;
11875
+ }
11876
+ }
11877
+ if (action === "review" && !["APPROVE", "REJECT", "REVOKE"].includes(String(input.decision))) throw new CliValidationError("decision must be APPROVE, REJECT or REVOKE.");
11878
+ if (action === "run" && !["HEARTBEAT", "FAILED"].includes(String(input.action))) throw new CliValidationError("action must be HEARTBEAT or FAILED.");
11879
+ if (action === "submit") {
11880
+ let packet;
11881
+ try {
11882
+ packet = JSON.parse(readFileSync4(ctx.str("input-file"), "utf8"));
11883
+ } catch {
11884
+ throw new CliValidationError("input-file must be a readable JSON file.");
11885
+ }
11886
+ if (!packet || typeof packet !== "object" || Array.isArray(packet) || Object.keys(packet).some((key) => key !== "candidates") || !("candidates" in packet) || !Array.isArray(packet.candidates) || packet.candidates.length > 200) {
11887
+ throw new CliValidationError("The file must contain only candidates: an array of at most 200 occurrences. Empty batches are allowed.");
11888
+ }
11889
+ const seen = /* @__PURE__ */ new Set();
11890
+ const roots = /* @__PURE__ */ new Set();
11891
+ for (const candidate of packet.candidates) {
11892
+ if (!candidate || typeof candidate !== "object" || !candidate.candidate_id || seen.has(candidate.candidate_id)) throw new CliValidationError("Every occurrence needs a unique candidate_id.");
11893
+ seen.add(candidate.candidate_id);
11894
+ if (candidate.duplicate_of) {
11895
+ if (candidate.duplicate_item_id || !roots.has(candidate.duplicate_of) || !candidate.dedup_reason) throw new CliValidationError("duplicate_of needs an earlier canonical candidate and dedup_reason.");
11896
+ } else {
11897
+ roots.add(candidate.candidate_id);
11898
+ if (candidate.duplicate_item_id ? !candidate.dedup_reason : !["INCORRECT", "INCOMPLETE"].includes(candidate.issue_type) || !candidate.reason) throw new CliValidationError("Provide a supported issue_type and reason, or a historical duplicate_item_id and dedup_reason.");
11899
+ }
11900
+ if (!candidate.source || ["open_id", "agent_session_id", "question_id", "answer_id", "days", "end_time"].some((key) => !candidate.source[key])) throw new CliValidationError("Each source must preserve the exact scenario identity and scan window.");
11901
+ }
11902
+ input.candidates = packet.candidates;
11903
+ }
11904
+ return input;
11905
+ }
11906
+ function command(action, description, flags, read = false) {
11907
+ return createAnalysisCapabilityCommand({
11908
+ resource: "bad-case",
11909
+ command: action,
11910
+ capabilityId: `analysis.bad_case.${action.replaceAll("-", "_")}`,
11911
+ description,
11912
+ risk: read ? "read" : "write",
11913
+ flags: [project, ...flags],
11914
+ buildInput: (ctx) => badCaseInput(action, [project, ...flags], ctx),
11915
+ ...action === "review" ? { postProcess: (result, input, ctx) => syncBadCaseEvaluation(ctx, Number(input.project_id), result) } : {}
11916
+ });
11917
+ }
11918
+ var badCaseBegin = command("begin", "Begin a project-serialized discovery batch. Renew its 15-minute lease every minute; preserve request ID on retry.", [request, { name: "source-task-id", type: "string", desc: "Actual scheduled task ID, if known." }]);
11919
+ var badCaseRun = command("run", "Heartbeat or fail the current discovery. Failure never deletes earlier cases.", [batch, { name: "action", type: "string", required: true, desc: "HEARTBEAT or FAILED." }]);
11920
+ var badCaseHistory = command("history", "Read all historical cases for Agent semantic deduplication, including pending, approved, rejected and CLI-only cases.", [limit, { name: "after-id", type: "string", desc: "Follow next_after_id until has_more=false. Default 0." }], true);
11921
+ var badCaseSubmit = command("submit", "Submit Agent-assessed and semantically deduplicated occurrences from a JSON file. Saves a batch even when all occurrences are duplicates. Never approves.", [batch, { name: "input-file", type: "string", required: true, desc: "JSON file containing {candidates:[...]}; follow bad_case_review.md for new and duplicate occurrence shapes." }, { name: "submit-to-page", type: "boolean", desc: "Explicitly publish new and reused pending cases for page review. Default false for the CLI-only workflow." }]);
11922
+ var badCaseList = command("list", "List saved Bad Cases across all batches, including CLI-only cases.", [limit, { name: "offset", type: "number", desc: "Zero-based offset; default 0." }, { name: "query", type: "string", desc: "Search question or discovery reason." }, { name: "state", type: "string", desc: "PENDING, APPROVED or REJECTED; omit for all." }], true);
11923
+ var badCaseGet = command("get", "Read the reviewed question, answer, CLI calls and optional human supplement.", [item], true);
11924
+ var badCaseReview = command("review", "Record an explicit human decision, then synchronize the saved case directly with AE. A saved review remains successful if synchronization fails; inspect evaluation.state and retry with sync-evaluation.", [item, request, { name: "version", type: "string", required: true, desc: "Exact version returned by get." }, { name: "decision", type: "string", required: true, desc: "APPROVE or REJECT a pending case; REVOKE an approved or rejected case to PENDING. Only as explicitly directed by the human." }, { name: "supplement", type: "string", sensitive: true, desc: "Optional correct answer, evidence or caveats. Omit when revoking rejection to preserve its supplement." }]);
11925
+ var badCaseSubmitToPage = command("submit-to-page", "Publish an existing pending case for page review without copying it or changing its review state.", [item, request]);
11926
+ var badCaseSyncEvaluation = {
11927
+ ...badCaseGet,
11928
+ command: "sync-evaluation",
11929
+ capabilityId: void 0,
11930
+ risk: "write",
11931
+ description: "Retry AE synchronization using the latest saved review. Does not change the review decision; reports synchronization state.",
11932
+ execute: async (ctx) => syncBadCaseEvaluation(ctx, Number(ctx.str("project-id")), unwrapOutputData(await badCaseGet.execute(ctx)))
11933
+ };
11934
+ var bad_case_default = [badCaseBegin, badCaseRun, badCaseHistory, badCaseSubmit, badCaseList, badCaseGet, badCaseReview, badCaseSubmitToPage, badCaseSyncEvaluation];
11935
+
11743
11936
  // src/commands/te-analysis/index.ts
11744
11937
  registerCapabilityGatewayRoute("analysis", { gatewayDomain: "analysis" });
11745
11938
  registerCapabilityGatewayRoute("project", { gatewayDomain: "analysis" });
@@ -11789,7 +11982,8 @@ var baseCommands = [
11789
11982
  ...alert_notice_config_default,
11790
11983
  ...system_default,
11791
11984
  ...feedback_default,
11792
- ...scenario_default
11985
+ ...scenario_default,
11986
+ ...bad_case_default
11793
11987
  ];
11794
11988
  var commands84 = [...baseCommands];
11795
11989
  var te_analysis_default = commands84;