@thinkingai/ae-cli 6.1.30 → 6.1.32

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 (261) hide show
  1. package/README.md +11 -5
  2. package/README.zh.md +11 -5
  3. package/bin/ai-monitor.js +2 -0
  4. package/dist/ai-monitor-MKMHSSNI.js +32 -0
  5. package/dist/ai-monitor.js +135 -0
  6. package/dist/{auth-ADZHUIJR.js → auth-CZHHPZOQ.js} +10 -9
  7. package/dist/{automation-FD2QZUP6.js → automation-FLCPFMN4.js} +4 -4
  8. package/dist/{capability-QXFRJYZD.js → capability-64KVJFIA.js} +27 -31
  9. package/dist/{chunk-YULUBP3R.js → chunk-3ULDJJTZ.js} +1 -1
  10. package/dist/{chunk-HRUOV6EQ.js → chunk-4XKTRCRK.js} +15 -15
  11. package/dist/{chunk-JSBLCLFE.js → chunk-5M5LBRR3.js} +1 -1
  12. package/dist/chunk-6M7ZEDT2.js +182 -0
  13. package/dist/{chunk-KPQY44JQ.js → chunk-AWW2T2WL.js} +3 -0
  14. package/dist/chunk-BNBCMCYN.js +563 -0
  15. package/dist/chunk-CF6JTT2U.js +64 -0
  16. package/dist/{chunk-CG773QXN.js → chunk-DWBYNGSR.js} +564 -314
  17. package/dist/{chunk-VDICGXCY.js → chunk-F2VFZUGG.js} +2 -2
  18. package/dist/{chunk-TFORY6WY.js → chunk-FCAA7I2D.js} +2 -2
  19. package/dist/{chunk-SOSFRU3O.js → chunk-HTZ2MLYA.js} +47 -21
  20. package/dist/{chunk-AWVZTN2B.js → chunk-HVMCPKOZ.js} +1 -1
  21. package/dist/chunk-IDDWEZ7F.js +1285 -0
  22. package/dist/{chunk-E25OSZLJ.js → chunk-KTJXD27G.js} +2 -2
  23. package/dist/{chunk-AVXDJAFC.js → chunk-NLEXY2TM.js} +47 -12
  24. package/dist/{chunk-YVG6QD3V.js → chunk-P7QDCWJ6.js} +98 -7
  25. package/dist/{chunk-EUFP4M2A.js → chunk-T7WF4HYW.js} +84 -32
  26. package/dist/{chunk-Y3AM6LIO.js → chunk-TMQGS4TO.js} +15 -10
  27. package/dist/{compat-check-HERBTQZN.js → compat-check-ZJNCMNQV.js} +2 -2
  28. package/dist/{config-E3KANXMK.js → config-FSH2NMNZ.js} +25 -12
  29. package/dist/{context-CDB5H5PD.js → context-YAQG6YQC.js} +2 -2
  30. package/dist/{evaluation-LR4YDYWL.js → evaluation-2JSF4V47.js} +13 -158
  31. package/dist/index.js +81 -583
  32. package/dist/{memory-SNFR5M23.js → memory-VEZZVAAP.js} +4 -4
  33. package/dist/{metadata-EXQYDZTH.js → metadata-3IWHX3V4.js} +7 -7
  34. package/dist/{model-KEVCEXWD.js → model-T7H7Q6BG.js} +2 -2
  35. package/dist/{personal-semantic-preference-ETY3KU2O.js → personal-semantic-preference-YITU23SA.js} +6 -6
  36. package/dist/{project-semantic-UHRMVOJF.js → project-semantic-MHEXJF3C.js} +15 -13
  37. package/dist/{sync-XKEBXESC.js → sync-AQHVCSPI.js} +4 -4
  38. package/dist/{te-agent-S6UQR4IE.js → te-agent-RXI7WOH4.js} +5 -5
  39. package/dist/{te-analysis-WOFFCIBC.js → te-analysis-CZY74HVF.js} +380 -191
  40. package/dist/{te-community-R7B6QYOO.js → te-community-DKCYUBCM.js} +6 -6
  41. package/dist/{te-dataops-KPILYVHA.js → te-dataops-QEH6VE56.js} +3 -3
  42. package/dist/{te-engage-IAUM6ONX.js → te-engage-WK7WKDKF.js} +6 -6
  43. package/dist/{te-experiment-TMLRA7B3.js → te-experiment-LH3RPIOE.js} +274 -29
  44. package/dist/{te-kb-GKWPSLSY.js → te-kb-UPORIOVN.js} +16 -7
  45. package/dist/{te-system-CYWSK3UN.js → te-system-AL4B4XZL.js} +2 -2
  46. package/dist/{te-team-ISN52YNG.js → te-team-LLVTO2G4.js} +5 -5
  47. package/dist/{things-DDQ52Z3Q.js → things-XLMLBYQR.js} +5 -5
  48. package/dist/{update-CTLNTX35.js → update-7J5UQHSK.js} +3 -3
  49. package/dist/{workspace-2CKQX2XL.js → workspace-FF2HXJGR.js} +4 -4
  50. package/package.json +9 -7
  51. package/skills/ae-ai-monitor/SKILL.md +179 -0
  52. package/skills/ae-ai-monitor/references/read-commands.md +866 -0
  53. package/skills/ae-analysis/SKILL.md +10 -4
  54. package/skills/ae-analysis/references/adhoc_export.md +3 -1
  55. package/skills/ae-analysis/references/ai_models/path.md +5 -6
  56. package/skills/ae-analysis/references/ai_models.md +1 -0
  57. package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -0
  58. package/skills/ae-analysis/references/asset_search.md +1 -1
  59. package/skills/ae-analysis/references/bad_case_begin.md +12 -0
  60. package/skills/ae-analysis/references/bad_case_get.md +12 -0
  61. package/skills/ae-analysis/references/bad_case_history.md +12 -0
  62. package/skills/ae-analysis/references/bad_case_list.md +12 -0
  63. package/skills/ae-analysis/references/bad_case_review.md +51 -0
  64. package/skills/ae-analysis/references/bad_case_run.md +12 -0
  65. package/skills/ae-analysis/references/bad_case_submit.md +12 -0
  66. package/skills/ae-analysis/references/bad_case_submit_to_page.md +12 -0
  67. package/skills/ae-analysis/references/bad_case_sync_evaluation.md +11 -0
  68. package/skills/ae-analysis/references/bi_panel_list.md +1 -1
  69. package/skills/ae-analysis/references/bi_panel_share.md +3 -1
  70. package/skills/ae-analysis/references/catalog_list.md +2 -0
  71. package/skills/ae-analysis/references/command_index.md +38 -29
  72. package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
  73. package/skills/ae-analysis/references/dashboard_handover.md +3 -1
  74. package/skills/ae-analysis/references/dashboard_list.md +3 -3
  75. package/skills/ae-analysis/references/dashboard_report_data_export.md +1 -1
  76. package/skills/ae-analysis/references/dashboard_share.md +3 -1
  77. package/skills/ae-analysis/references/dashboard_update.md +3 -2
  78. package/skills/ae-analysis/references/filter_value_list.md +2 -0
  79. package/skills/ae-analysis/references/folder_share.md +8 -2
  80. package/skills/ae-analysis/references/governance_recommendation_run_update.md +3 -1
  81. package/skills/ae-analysis/references/project_data_power_upsert.md +3 -1
  82. package/skills/ae-analysis/references/project_mark_time_create.md +2 -0
  83. package/skills/ae-analysis/references/project_mark_time_update.md +2 -0
  84. package/skills/ae-analysis/references/project_member_add.md +3 -1
  85. package/skills/ae-analysis/references/project_member_batch_update.md +3 -1
  86. package/skills/ae-analysis/references/project_member_handover_run.md +3 -1
  87. package/skills/ae-analysis/references/project_member_update.md +3 -1
  88. package/skills/ae-analysis/references/project_owner_update.md +3 -1
  89. package/skills/ae-analysis/references/project_role_upsert.md +5 -3
  90. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +16 -1
  91. package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +14 -1
  92. package/skills/ae-analysis/references/project_space_share.md +8 -2
  93. package/skills/ae-analysis/references/property_get.md +2 -0
  94. package/skills/ae-analysis/references/public_link_list.md +3 -1
  95. package/skills/ae-analysis/references/query_cancel.md +4 -1
  96. package/skills/ae-analysis/references/report_data_run.md +1 -1
  97. package/skills/ae-analysis/references/report_list.md +3 -3
  98. package/skills/ae-analysis/references/scenario_append.md +2 -2
  99. package/skills/ae-analysis/references/scenario_collect.md +15 -4
  100. package/skills/ae-analysis/references/scenario_list.md +2 -1
  101. package/skills/ae-analysis/references/system_oauth2_update.md +3 -1
  102. package/skills/ae-analysis/references/system_third_party_login_upsert.md +4 -2
  103. package/skills/ae-analysis/references/user_tag_create.md +4 -1
  104. package/skills/ae-analysis/references/user_tag_get.md +2 -0
  105. package/skills/ae-analysis/references/user_tag_models.md +8 -2
  106. package/skills/ae-analysis/references/user_tag_update.md +5 -2
  107. package/skills/ae-analysis/references/virtual_property_create.md +12 -1
  108. package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +10 -0
  109. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +55 -13
  110. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +2 -2
  111. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +2 -2
  112. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +7 -1
  113. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/wait-compile-run.mjs +79 -0
  114. package/skills/ae-automation/SKILL.md +4 -2
  115. package/skills/ae-capability/SKILL.md +9 -5
  116. package/skills/ae-community/SKILL.md +1 -0
  117. package/skills/ae-dataops/SKILL.md +1 -0
  118. package/skills/ae-engage/SKILL.md +1 -0
  119. package/skills/ae-evaluation/SKILL.md +17 -2
  120. package/skills/ae-experiment/SKILL.md +38 -11
  121. package/skills/ae-experiment/references/experiment_approval.md +171 -0
  122. package/skills/ae-experiment/references/manage_experiment.md +11 -2
  123. package/skills/ae-experiment/references/save_experiment.md +28 -8
  124. package/skills/ae-experiment/references/save_submit_experiment.md +18 -3
  125. package/skills/ae-experiment/references/save_submit_external_experiment.md +57 -3
  126. package/skills/ae-generate-tracking-plan/SKILL.md +5 -0
  127. package/skills/ae-kb/SKILL.md +5 -3
  128. package/skills/ae-kb/references/analysis-workflow.md +11 -2
  129. package/skills/ae-kb/references/query-workflow.md +3 -1
  130. package/skills/ae-kb/references/versions.md +1 -1
  131. package/skills/ae-metadata/SKILL.md +1 -0
  132. package/skills/ae-migrate-tracking-code/SKILL.md +2 -1
  133. package/skills/ae-team/SKILL.md +1 -1
  134. package/skills/ae-tracking-matrix/SKILL.md +170 -0
  135. package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
  136. package/skills/ae-tracking-matrix/i18n.yaml +12 -0
  137. package/skills/ae-tracking-matrix/references/ae-capabilities.md +93 -0
  138. package/skills/ae-tracking-matrix/references/business-semantic-checks.md +30 -0
  139. package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +256 -0
  140. package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +213 -0
  141. package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +407 -0
  142. package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +218 -0
  143. package/skills/ae-tracking-matrix/references/categories/casual_music.md +112 -0
  144. package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +301 -0
  145. package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +356 -0
  146. package/skills/ae-tracking-matrix/references/categories/fishing.md +775 -0
  147. package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +89 -0
  148. package/skills/ae-tracking-matrix/references/categories/idle_card.md +27 -0
  149. package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +415 -0
  150. package/skills/ae-tracking-matrix/references/categories/interactive_video.md +133 -0
  151. package/skills/ae-tracking-matrix/references/categories/merge.md +639 -0
  152. package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +406 -0
  153. package/skills/ae-tracking-matrix/references/categories/mmo_web.md +230 -0
  154. package/skills/ae-tracking-matrix/references/categories/music.md +137 -0
  155. package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +414 -0
  156. package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +199 -0
  157. package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +158 -0
  158. package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +546 -0
  159. package/skills/ae-tracking-matrix/references/categories/rpg.md +195 -0
  160. package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +115 -0
  161. package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +151 -0
  162. package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +260 -0
  163. package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +232 -0
  164. package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +359 -0
  165. package/skills/ae-tracking-matrix/references/categories/tower_defense.md +365 -0
  166. package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +211 -0
  167. package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +132 -0
  168. package/skills/ae-tracking-matrix/references/category-registry.md +77 -0
  169. package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +230 -0
  170. package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +406 -0
  171. package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +128 -0
  172. package/skills/ae-tracking-matrix/references/eval-cases.md +74 -0
  173. package/skills/ae-tracking-matrix/references/naming-dict.md +238 -0
  174. package/skills/ae-tracking-matrix/references/optimization-checklist.md +85 -0
  175. package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +142 -0
  176. package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +47 -0
  177. package/skills/ae-tracking-matrix/references/plan-generation/reference.md +794 -0
  178. package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +94 -0
  179. package/skills/ae-tracking-matrix/references/scene-routing.md +80 -0
  180. package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +3787 -0
  181. package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +827 -0
  182. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +655 -0
  183. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +953 -0
  184. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +1128 -0
  185. package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +714 -0
  186. package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +1268 -0
  187. package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +776 -0
  188. package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +182 -0
  189. package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +2755 -0
  190. package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +1182 -0
  191. package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +1300 -0
  192. package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +1369 -0
  193. package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +1692 -0
  194. package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +902 -0
  195. package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +763 -0
  196. package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +1107 -0
  197. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +1532 -0
  198. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +845 -0
  199. package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +228 -0
  200. package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +149 -0
  201. package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +407 -0
  202. package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +163 -0
  203. package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +149 -0
  204. package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +153 -0
  205. package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +232 -0
  206. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +314 -0
  207. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +117 -0
  208. package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +148 -0
  209. package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +645 -0
  210. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +307 -0
  211. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +347 -0
  212. package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +72 -0
  213. package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +264 -0
  214. package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +566 -0
  215. package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +409 -0
  216. package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +446 -0
  217. package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +557 -0
  218. package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +457 -0
  219. package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +490 -0
  220. package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +523 -0
  221. package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +484 -0
  222. package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +442 -0
  223. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +391 -0
  224. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +91 -0
  225. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +635 -0
  226. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +113 -0
  227. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +466 -0
  228. package/skills/ae-tracking-matrix/references/standard-base/README.md +22 -0
  229. package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +174 -0
  230. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +20 -0
  231. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +7 -0
  232. package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +14 -0
  233. package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +370 -0
  234. package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +47 -0
  235. package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +37 -0
  236. package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +27 -0
  237. package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +23 -0
  238. package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +14 -0
  239. package/skills/ae-tracking-matrix/references/standard-base/user_data.md +46 -0
  240. package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +13 -0
  241. package/skills/ae-tracking-matrix/references/system-fields.md +297 -0
  242. package/skills/ae-tracking-matrix/references/te-field-translations.md +1791 -0
  243. package/skills/ae-tracking-matrix/references/workflows/data-verification.md +232 -0
  244. package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +829 -0
  245. package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +355 -0
  246. package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +283 -0
  247. package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +168 -0
  248. package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +205 -0
  249. package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +75 -0
  250. package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +36 -0
  251. package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +107 -0
  252. package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +114 -0
  253. package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +53 -0
  254. package/skills/ae-tracking-matrix/scripts/finalize_plan.py +166 -0
  255. package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +674 -0
  256. package/skills/ae-tracking-matrix/scripts/plan_contract.py +200 -0
  257. package/skills/ae-tracking-matrix/scripts/plan_types.py +60 -0
  258. package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +169 -0
  259. package/skills/ae-tracking-matrix/scripts/sync_plan.py +296 -0
  260. package/skills/ae-tracking-matrix/scripts/upload_plan.py +340 -0
  261. package/dist/chunk-AMBFK2K3.js +0 -28
package/dist/index.js CHANGED
@@ -1,7 +1,4 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
- import {
3
- requiresConfirmation
4
- } from "./chunk-AMBFK2K3.js";
5
2
  import {
6
3
  allHeaderNames,
7
4
  allSheetNames,
@@ -21,59 +18,53 @@ import {
21
18
  import "./chunk-QVRIDN42.js";
22
19
  import "./chunk-OAWPT7VP.js";
23
20
  import "./chunk-JEUXDY3B.js";
24
- import {
25
- EvalApiError
26
- } from "./chunk-YVG6QD3V.js";
27
21
  import {
28
22
  resolveHost
29
23
  } from "./chunk-2F64AZYH.js";
30
24
  import {
31
- TeAgentApiError,
32
- TeAgentCredentialsError
33
- } from "./chunk-JSBLCLFE.js";
25
+ configureBusinessCommands,
26
+ parseProgram,
27
+ runCommand
28
+ } from "./chunk-BNBCMCYN.js";
29
+ import "./chunk-CF6JTT2U.js";
30
+ import "./chunk-5M5LBRR3.js";
31
+ import "./chunk-P7QDCWJ6.js";
34
32
  import {
35
33
  printError,
36
34
  printOutput
37
- } from "./chunk-YULUBP3R.js";
35
+ } from "./chunk-3ULDJJTZ.js";
38
36
  import {
39
- CapabilityGatewayError,
40
37
  executeCapability,
41
38
  uploadInputFileBytes
42
- } from "./chunk-HRUOV6EQ.js";
39
+ } from "./chunk-4XKTRCRK.js";
43
40
  import "./chunk-Y74WTIKJ.js";
44
41
  import {
45
- BusinessDisabledError,
46
- assertBusinessEnabled,
47
- businessForCommand,
42
+ beginBusinessSkillRefresh,
48
43
  failInstallation,
49
44
  fetchCliConfig,
50
- formatCapabilityMissCompatHint,
51
45
  getLocalCliPackageInfo,
52
46
  installVersion,
47
+ isBusinessSkillRefreshCurrent,
53
48
  newInstallationReport,
54
- readCurrentBusinessConfig,
49
+ rememberBusinessConfig,
55
50
  resolveKbAutoDiscoveryFeature,
56
51
  runHostCompatCheck,
57
- shouldSkipAutoSync
58
- } from "./chunk-CG773QXN.js";
52
+ shouldSkipAutoSync,
53
+ syncRefreshedBusinessSkills
54
+ } from "./chunk-DWBYNGSR.js";
59
55
  import {
60
- CredentialStoreUnreadableError,
61
56
  SecureStoreAuthError,
62
57
  getCliToken,
63
58
  peekCliToken
64
- } from "./chunk-SOSFRU3O.js";
59
+ } from "./chunk-HTZ2MLYA.js";
65
60
  import {
66
61
  getActiveHost,
67
62
  getConfigDir,
68
63
  safeJsonParse
69
64
  } from "./chunk-4PSTYEG5.js";
70
65
  import {
71
- CliApiError,
72
66
  CliValidationError,
73
- CommunityReportError,
74
67
  ExternalCliTokenError,
75
- LocalDataUploadError,
76
- PermissionError,
77
68
  externalCliTokenRequestOptions,
78
69
  kbExecutionContextRequired,
79
70
  logger,
@@ -87,415 +78,6 @@ import { Command as CommanderCommand, Option } from "commander";
87
78
  import { createRequire } from "module";
88
79
  import { constants as osConstants } from "os";
89
80
 
90
- // src/framework/runner.ts
91
- import * as readline from "readline";
92
- function missingRequiredFlagsError(cmdName, missing) {
93
- const names = missing.map((flag) => `--${flag.name}`);
94
- const message = missing.length === 1 ? `Missing required flag: ${names[0]}` : `Missing required flags: ${names.join(", ")}`;
95
- const hintParts = missing.map((flag) => flag.hint?.trim()).filter((hint2) => Boolean(hint2));
96
- const hint = hintParts.length > 0 ? hintParts.join(" ") : `Usage: ae-cli ${cmdName} ${names.map((name) => `${name} <value>`).join(" ")}`;
97
- return { message, hint };
98
- }
99
- function canPromptForConfirmation(input = process.stdin, output = process.stderr) {
100
- return input.isTTY === true && output.isTTY === true;
101
- }
102
- function readSkillCurrentVersion(body) {
103
- if (!body || typeof body !== "object" || Array.isArray(body)) return void 0;
104
- const currentVersion = body.currentVersion;
105
- if (typeof currentVersion !== "string") return void 0;
106
- return /^(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(currentVersion) ? currentVersion : void 0;
107
- }
108
- function teAgentApiErrorPresentation(err) {
109
- if (err.code === "SKILL_VERSION_CONFLICT") {
110
- const currentVersion = readSkillCurrentVersion(err.body);
111
- return {
112
- message: "The Skill content changed, and the new version must be greater than the current version.",
113
- code: err.code,
114
- hint: currentVersion ? `Retry with --version set to a major.minor version greater than ${currentVersion}.` : "Retry with --version set to a major.minor version greater than the current Skill version.",
115
- ...currentVersion ? { meta: { currentVersion } } : {}
116
- };
117
- }
118
- if (err.code === "SKILL_HISTORY_CONFLICT") {
119
- return {
120
- message: "The Skill cannot be safely updated right now.",
121
- code: err.code,
122
- hint: "The Skill cannot be safely updated right now. Please contact your administrator."
123
- };
124
- }
125
- return {};
126
- }
127
- async function runCommand(cmd, opts, globalOpts) {
128
- try {
129
- const ctx = createRuntimeContext(cmd, opts, globalOpts);
130
- const cmdName = cmd.resource ? `${cmd.service} ${cmd.resource} ${cmd.command}` : `${cmd.service} ${cmd.command}`;
131
- logger.command(
132
- cmdName,
133
- opts,
134
- cmd.flags.filter((flag) => flag.sensitive).map((flag) => flag.name)
135
- );
136
- const missingRequired = cmd.flags.filter((flag) => {
137
- if (!flag.required) return false;
138
- const val = opts[camelCase(flag.name)];
139
- if (flag.variadic) return !Array.isArray(val) || val.length === 0;
140
- return val === void 0 || val === null || val === "";
141
- });
142
- if (missingRequired.length > 0) {
143
- const { message, hint } = missingRequiredFlagsError(cmdName, missingRequired);
144
- printError("validation", message, hint);
145
- process.exit(1);
146
- }
147
- if (cmd.validate && cmd.service !== "community") {
148
- cmd.validate(ctx);
149
- }
150
- const LIMIT_FLAG_PATTERNS = [/limit/i, /page_size/i, /pagesize/i, /row_limit/i, /block_limit/i, /top[-_]?k/i];
151
- for (const flag of cmd.flags) {
152
- const val = opts[camelCase(flag.name)];
153
- if (flag.variadic) continue;
154
- if (flag.type === "boolean") {
155
- if (val !== void 0 && typeof val !== "boolean") {
156
- printError("validation", `Invalid boolean for --${flag.name}: ${val}. Use true/false.`);
157
- process.exit(1);
158
- }
159
- continue;
160
- }
161
- if (flag.type === "int64") {
162
- if (val === void 0 || val === null || val === "") continue;
163
- const raw = String(val);
164
- if (!/^-?(?:0|[1-9]\d*)$/.test(raw)) {
165
- printError("validation", `--${flag.name} must be a base-10 integer (got: ${val})`);
166
- process.exit(1);
167
- }
168
- const parsed = BigInt(raw);
169
- const minInt64 = -(1n << 63n);
170
- const maxInt64 = (1n << 63n) - 1n;
171
- if (parsed < minInt64 || parsed > maxInt64) {
172
- printError("validation", `--${flag.name} must fit in a signed 64-bit integer (got: ${val})`);
173
- process.exit(1);
174
- }
175
- if (flag.min !== void 0 && parsed < BigInt(flag.min)) {
176
- printError("validation", `--${flag.name} must be at least ${flag.min} (got: ${val})`);
177
- process.exit(1);
178
- }
179
- if (flag.max !== void 0 && parsed > BigInt(flag.max)) {
180
- printError("validation", `--${flag.name} must be at most ${flag.max} (got: ${val})`);
181
- process.exit(1);
182
- }
183
- continue;
184
- }
185
- if (flag.type !== "number") continue;
186
- if (flag.variadic) continue;
187
- if (val === void 0 || val === null || val === "") continue;
188
- const num = Number(val);
189
- if (!Number.isFinite(num)) {
190
- printError("validation", `--${flag.name} must be a number (got: ${val})`);
191
- process.exit(1);
192
- }
193
- const isLimitFlag = LIMIT_FLAG_PATTERNS.some((p) => p.test(flag.name)) || cmd.service === "community" && /page[-_]?(?:size|num)|row[-_]?limit/i.test(flag.name);
194
- if (isLimitFlag) {
195
- const min = flag.min ?? 1;
196
- const max = flag.max ?? 1e4;
197
- if (!Number.isInteger(num) || num < min || num > max) {
198
- printError("validation", `--${flag.name} must be an integer between ${min} and ${max} (got: ${val})`);
199
- process.exit(1);
200
- }
201
- } else if (flag.min !== void 0 || flag.max !== void 0) {
202
- const min = flag.min ?? Number.NEGATIVE_INFINITY;
203
- const max = flag.max ?? Number.POSITIVE_INFINITY;
204
- if (num < min || num > max) {
205
- const lower = flag.min === void 0 ? "-Infinity" : String(min);
206
- const upper = flag.max === void 0 ? "Infinity" : String(max);
207
- printError("validation", `--${flag.name} must be a number between ${lower} and ${upper} (got: ${val})`);
208
- process.exit(1);
209
- }
210
- }
211
- }
212
- for (const flag of cmd.flags) {
213
- if (flag.type !== "string") continue;
214
- if (flag.variadic) continue;
215
- const val = opts[camelCase(flag.name)];
216
- if (val === void 0 || val === null || val === "") continue;
217
- const error = stringFlagValidationError(flag, String(val));
218
- if (error) {
219
- printError("validation", error.message, error.hint);
220
- process.exit(1);
221
- }
222
- }
223
- if (cmd.validate && cmd.service === "community") {
224
- cmd.validate(ctx);
225
- }
226
- if (globalOpts.validate && globalOpts.dryRun) {
227
- printError(
228
- "validation",
229
- "Cannot combine --validate and --dry-run.",
230
- "Use --validate to fix parameters; use --dry-run as the pre-execution confirmation."
231
- );
232
- process.exit(1);
233
- }
234
- if (globalOpts.validate) {
235
- if (cmd.validateInput) {
236
- const validateResult = await cmd.validateInput(ctx);
237
- await printOutput(validateResult, globalOpts.format, globalOpts.jq);
238
- } else if (cmd.service === "community") {
239
- throw new CliValidationError(`--validate is not supported for ${cmdName}`, {
240
- hint: "Run without --validate, or inspect the underlying capability for server validation."
241
- });
242
- } else {
243
- await printOutput(
244
- { message: "No --validate implementation for this command (capability gateway commands only)" },
245
- globalOpts.format
246
- );
247
- }
248
- return;
249
- }
250
- if (globalOpts.dryRun) {
251
- if (cmd.dryRun) {
252
- const dryResult = await cmd.dryRun(ctx);
253
- await printOutput(dryResult, globalOpts.format, globalOpts.jq);
254
- } else if (cmd.service === "community") {
255
- throw new CliValidationError(`--dry-run is not supported for ${cmdName}`, {
256
- hint: "Run the read-only command without --dry-run; this command has no request preview."
257
- });
258
- } else {
259
- await printOutput({ message: "No dry-run implementation for this command" }, globalOpts.format);
260
- }
261
- return;
262
- }
263
- if (requiresConfirmation(cmd.risk)) {
264
- cmd.preflight?.(ctx);
265
- if (!globalOpts.yes) {
266
- if (!canPromptForConfirmation()) {
267
- throw new CliValidationError(
268
- "Non-interactive high-risk writes require global --yes.",
269
- {
270
- code: "CONFIRMATION_REQUIRED",
271
- hint: "After explicit authorization, retry with the global --yes flag."
272
- }
273
- );
274
- }
275
- const confirmed = await confirm(`This is a high-risk-write operation (${cmdName}). Continue?`);
276
- if (!confirmed) {
277
- process.stderr.write("Aborted.\n");
278
- process.exit(0);
279
- }
280
- }
281
- }
282
- const result = await cmd.execute(ctx);
283
- await ctx.out(result);
284
- } catch (err) {
285
- if (err?.type === "validation" && typeof err?.hint === "string" && String(err.message || "").includes("--jq")) {
286
- printError("validation", err.message, err.hint, err.code);
287
- process.exit(1);
288
- }
289
- const message = err.message || String(err);
290
- if (!(err instanceof CommunityReportError) && !(err instanceof EvalApiError)) {
291
- if (!(err instanceof LocalDataUploadError)) logger.error(`Command failed: ${message}`);
292
- }
293
- if (err instanceof CliValidationError) {
294
- printError(
295
- "validation",
296
- message,
297
- err.hint,
298
- err.code,
299
- err.location ? { location: err.location } : void 0
300
- );
301
- } else if (err instanceof TeAgentCredentialsError) {
302
- printError("config", message, err.hint);
303
- } else if (err instanceof PermissionError) {
304
- printError("permission", message, err.hint, err.code, err.meta, { details: err.details });
305
- } else if (err instanceof CliApiError) {
306
- printError("api", message, err.hint, err.code, err.meta);
307
- } else if (err instanceof CapabilityGatewayError) {
308
- printError(
309
- err.type,
310
- message,
311
- err.hint ?? capabilityGatewayHint(err),
312
- err.code,
313
- err.meta,
314
- { details: err.details }
315
- );
316
- } else if (err instanceof CommunityReportError) {
317
- printError("api", message, err.hint, err.code, err.meta, { log: false });
318
- } else if (err instanceof LocalDataUploadError) {
319
- printError("api", message, err.hint, err.code, err.meta, { log: false });
320
- } else if (err instanceof CredentialStoreUnreadableError || err instanceof ExternalCliTokenError) {
321
- printError("config", message, err.hint, err.code);
322
- } else if (err instanceof EvalApiError) {
323
- printError("api", message, err.hint, err.code, void 0, { log: false });
324
- } else if (err instanceof SecureStoreAuthError) {
325
- printError("auth", message, "Run: ae-cli auth login", err.code);
326
- } else if (err instanceof TeAgentApiError) {
327
- if (err.status === 403) {
328
- printError("permission", message, err.hint, err.code, void 0, { details: err.details });
329
- } else if (err.status === 401) {
330
- printError("auth", message, err.hint ?? "Run: ae-cli auth login", err.code, void 0, { details: err.details });
331
- } else {
332
- const presentation = teAgentApiErrorPresentation(err);
333
- printError(
334
- err.errorType,
335
- presentation.message ?? message,
336
- presentation.hint ?? err.hint,
337
- presentation.code ?? err.code,
338
- presentation.meta,
339
- { details: err.details }
340
- );
341
- }
342
- } else if (looksLikeAuthFailure(message)) {
343
- printError("auth", message, "Run: ae-cli auth login");
344
- } else {
345
- printError("api", message);
346
- }
347
- process.exit(1);
348
- }
349
- }
350
- function stringFlagValidationError(flag, value) {
351
- if (flag.type !== "string") return void 0;
352
- if (flag.minLength !== void 0 && value.length < flag.minLength) {
353
- return { message: `--${flag.name} must contain at least ${flag.minLength} characters` };
354
- }
355
- if (flag.maxLength !== void 0 && value.length > flag.maxLength) {
356
- return { message: `--${flag.name} must not exceed ${flag.maxLength} characters (got: ${value.length})` };
357
- }
358
- if (flag.pattern !== void 0 && !new RegExp(flag.pattern).test(value)) {
359
- return { message: `--${flag.name} has an invalid format`, hint: `Expected pattern: ${flag.pattern}` };
360
- }
361
- return void 0;
362
- }
363
- function capabilityGatewayHint(err) {
364
- if (err.code === "UPLOAD_NOT_EXIST" && (err.meta?.capability_id === "engage-setting.config-table.save" || err.meta?.capability_id === "engage-setting.config-table.update-data")) {
365
- return "Run config-table upload first with the same --project-id and --request-id, then retry this command within 10 minutes. The upload cache is consumed after a successful save/update.";
366
- }
367
- const compatExtra = formatCapabilityMissCompatHint();
368
- if (err.code === "CAPABILITY_NOT_FOUND") {
369
- const base = "The current host does not expose this capability. Do not retry with different parameters; use a supported command path or ask the platform/backend owner to enable the capability.";
370
- return compatExtra ? `${base}
371
- ${compatExtra}` : base;
372
- }
373
- if (err.httpStatus === 404 && !err.code) {
374
- const base = "The current host returned 404 for this capability route. Do not keep retrying the same command; verify the backend route/capability deployment. If --host points directly to a local Common service instead of the deployed gateway, scope AE_CLI_CAPABILITY_GATEWAY_DOMAIN= to this command so it uses /api/cli/v1.";
375
- return compatExtra ? `${base}
376
- ${compatExtra}` : base;
377
- }
378
- return void 0;
379
- }
380
- function looksLikeAuthFailure(message) {
381
- const m = message.toLowerCase();
382
- if (m.includes("403") || m.includes("forbidden") || m.includes("permission")) return false;
383
- return m.includes("401") || m.includes("unauthorized") || m.includes("session expired") || m.includes("invalid access token") || m.includes("-1001") || m.includes("\u767B\u5F55") || m.includes("ae-cli auth login");
384
- }
385
- function createRuntimeContext(cmd, opts, globalOpts) {
386
- let _communityReportModule = null;
387
- async function getCommunityReportClient() {
388
- if (!_communityReportModule) {
389
- _communityReportModule = await import("./community-report-client-TJVCLZ3K.js");
390
- }
391
- return _communityReportModule;
392
- }
393
- let _localDataUploadModule = null;
394
- async function getLocalDataUploadClient() {
395
- if (!_localDataUploadModule) {
396
- _localDataUploadModule = await import("./local-data-upload-client-KCMG6J62.js");
397
- }
398
- return _localDataUploadModule;
399
- }
400
- const ctx = {
401
- has(name) {
402
- return Object.prototype.hasOwnProperty.call(opts, camelCase(name));
403
- },
404
- str(name) {
405
- return String(opts[camelCase(name)] ?? "");
406
- },
407
- num(name) {
408
- const val = opts[camelCase(name)];
409
- return val !== void 0 ? Number(val) : 0;
410
- },
411
- optionalNum(name) {
412
- const val = opts[camelCase(name)];
413
- if (val === void 0 || val === null || val === "") return void 0;
414
- return Number(val);
415
- },
416
- int64(name) {
417
- const val = opts[camelCase(name)];
418
- if (val === void 0 || val === null || val === "") return 0n;
419
- return BigInt(String(val));
420
- },
421
- optionalInt64(name) {
422
- const val = opts[camelCase(name)];
423
- if (val === void 0 || val === null || val === "") return void 0;
424
- return BigInt(String(val));
425
- },
426
- bool(name) {
427
- return Boolean(opts[camelCase(name)]);
428
- },
429
- optionalBool(name) {
430
- const val = opts[camelCase(name)];
431
- return typeof val === "boolean" ? val : void 0;
432
- },
433
- json(name) {
434
- const val = opts[camelCase(name)];
435
- if (val === void 0 || val === null) return void 0;
436
- if (typeof val === "object") return val;
437
- try {
438
- return safeJsonParse(String(val));
439
- } catch {
440
- if (cmd.flags.some((flag) => flag.name === name && flag.sensitive)) {
441
- throw new CliValidationError(`Invalid JSON for --${name}.`, {
442
- hint: "Provide valid JSON with quoted keys and strings. Sensitive input is omitted from diagnostics."
443
- });
444
- }
445
- printError("validation", `Invalid JSON for --${name}: ${val}`);
446
- process.exit(1);
447
- }
448
- },
449
- list(name) {
450
- const val = opts[camelCase(name)];
451
- if (Array.isArray(val)) return val.map(String);
452
- if (val === void 0 || val === null) return [];
453
- return [String(val)];
454
- },
455
- async communityReport(endpoint, rawBody) {
456
- const client = await getCommunityReportClient();
457
- return client.communityReport(endpoint, rawBody);
458
- },
459
- async localDataUpload(endpoint, rawBody, options) {
460
- const client = await getLocalDataUploadClient();
461
- return client.localDataUpload(endpoint, rawBody, options);
462
- },
463
- hostOverride() {
464
- return globalOpts.host;
465
- },
466
- host() {
467
- if (cmd.service === "kb" && ["+list", "+index", "+grep", "+read"].includes(cmd.command)) {
468
- const context = readKbExecutionContext();
469
- if (context) return globalOpts.host || context.origin;
470
- }
471
- if (globalOpts.host) return globalOpts.host;
472
- return getActiveHost();
473
- },
474
- mcpUrl() {
475
- return globalOpts.mcpUrl;
476
- },
477
- service() {
478
- return cmd.service;
479
- },
480
- async out(data) {
481
- await printOutput(data, globalOpts.format, globalOpts.jq, { redactErrors: cmd.sensitiveOutput });
482
- }
483
- };
484
- return ctx;
485
- }
486
- function camelCase(str) {
487
- return str.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
488
- }
489
- async function confirm(message) {
490
- const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
491
- return new Promise((resolve3) => {
492
- rl.question(`${message} [y/N] `, (answer) => {
493
- rl.close();
494
- resolve3(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
495
- });
496
- });
497
- }
498
-
499
81
  // src/framework/register.ts
500
82
  function registerCommands(program2, commands) {
501
83
  const byService = /* @__PURE__ */ new Map();
@@ -673,7 +255,17 @@ async function runFeatureConfigCheck(hostOverride, argv = process.argv) {
673
255
  if (!host) return void 0;
674
256
  const token = peekCliToken(host);
675
257
  if (!token) return void 0;
676
- return await resolveKbAutoDiscoveryFeature(host, token, () => fetchCliConfig(host, token));
258
+ let refresh;
259
+ return await resolveKbAutoDiscoveryFeature(host, token, async () => {
260
+ refresh = beginBusinessSkillRefresh(host, token, !hostOverride);
261
+ const remote = await fetchCliConfig(host, token);
262
+ if (!isBusinessSkillRefreshCurrent(refresh)) return null;
263
+ if (remote) {
264
+ rememberBusinessConfig(host, token, remote.businesses);
265
+ syncRefreshedBusinessSkills(refresh, remote.businesses);
266
+ }
267
+ return remote;
268
+ }, () => isBusinessSkillRefreshCurrent(refresh));
677
269
  } catch {
678
270
  return void 0;
679
271
  }
@@ -1355,6 +947,25 @@ function assertInputFilePath(path5, optionName = "--in") {
1355
947
 
1356
948
  // src/commands/tracking/plan.ts
1357
949
  var MAX_FIX_RETRIES = 3;
950
+ var PLAN_PREVIEW_HELP = "Local --dry-run preview: show the target and operations without changing the plan.";
951
+ async function previewPlanWrite(program2, host, projectId, upload) {
952
+ const { dryRun, validate, format, jq } = program2.opts();
953
+ if (validate) {
954
+ throw new CliValidationError(dryRun ? "Cannot combine --validate and --dry-run." : "--validate is not supported for plan writes. Use --dry-run to preview the operation.");
955
+ }
956
+ if (!dryRun) return false;
957
+ const operations = [];
958
+ if (!upload || upload.replace) operations.push("delete_entire_plan");
959
+ if (upload) operations.push("upload_xlsx", "save_plan");
960
+ await printOutput({
961
+ dry_run: true,
962
+ host,
963
+ project_id: projectId,
964
+ operations,
965
+ ...upload && { xlsx: upload.xlsx }
966
+ }, format, jq);
967
+ return true;
968
+ }
1358
969
  function registerPlan(cmd, rootProgram) {
1359
970
  cmd.description("manage AE tracking plans");
1360
971
  cmd.command("draft").description("Generate xlsx from draft.json (inject autotrack events; use --fix to auto-repair validation errors)").requiredOption("--in <path>", "draft JSON input").requiredOption("--out <path>", "xlsx output").option("--fix", "auto fix validation errors", false).action(async (opts) => {
@@ -1436,12 +1047,13 @@ function registerPlan(cmd, rootProgram) {
1436
1047
  }
1437
1048
  }
1438
1049
  });
1439
- cmd.command("upload").description("Upload xlsx tracking plan to AE (conflict check, auto-fix retry)").requiredOption("-p, --project <id>", "AE projectId", (v) => parseInt(v, 10)).requiredOption("--xlsx <path>", "xlsx file").requiredOption("--draft <path>", "draft JSON (for auto-fix)").option("--host <url>", HOST_OPTION_DESC).option("--lang <locale>", "xlsx language: zh / en / ja / ko").option("--replace", "delete existing plan first", false).option("--auto-fix", "auto fix upload errors and retry", true).action(async (opts) => {
1050
+ cmd.command("upload").addHelpText("after", PLAN_PREVIEW_HELP).description("Upload xlsx tracking plan to AE (conflict check, auto-fix retry)").requiredOption("-p, --project <id>", "AE projectId", (v) => parseInt(v, 10)).requiredOption("--xlsx <path>", "xlsx file").requiredOption("--draft <path>", "draft JSON (for auto-fix)").option("--host <url>", HOST_OPTION_DESC).option("--lang <locale>", "xlsx language: zh / en / ja / ko").option("--replace", "delete existing plan first", false).option("--auto-fix", "auto fix upload errors and retry", true).action(async (opts) => {
1440
1051
  assertInputFilePath(opts.draft, "--draft");
1441
1052
  assertInputFilePath(opts.xlsx, "--xlsx");
1442
1053
  const host = resolveTrackingHost(rootProgram, opts);
1443
- let client = await createTrackingClient(host);
1444
1054
  const draftPre = JSON.parse(await readFile(opts.draft, "utf8"));
1055
+ if (await previewPlanWrite(rootProgram, host, opts.project, opts)) return;
1056
+ let client = await createTrackingClient(host);
1445
1057
  if (!opts.replace) {
1446
1058
  console.log(t("plan.checking_conflicts"));
1447
1059
  try {
@@ -1570,8 +1182,9 @@ function registerPlan(cmd, rootProgram) {
1570
1182
  console.log(t("plan.archived_to", { path: dest }));
1571
1183
  console.log(t("plan.draft_updated_archived", { stamp }));
1572
1184
  });
1573
- cmd.command("delete").description("Delete the entire tracking plan from an AE project").requiredOption("-p, --project <id>", "AE projectId", (v) => parseInt(v, 10)).option("--host <url>", HOST_OPTION_DESC).action(async (opts) => {
1185
+ cmd.command("delete").addHelpText("after", PLAN_PREVIEW_HELP).description("Delete the entire tracking plan from an AE project").requiredOption("-p, --project <id>", "AE projectId", (v) => parseInt(v, 10)).option("--host <url>", HOST_OPTION_DESC).action(async (opts) => {
1574
1186
  const host = resolveTrackingHost(rootProgram, opts);
1187
+ if (await previewPlanWrite(rootProgram, host, opts.project)) return;
1575
1188
  const client = await createTrackingClient(host);
1576
1189
  const res = await client.deleteProgram(opts.project);
1577
1190
  console.log(JSON.stringify(res, null, 2));
@@ -2456,76 +2069,6 @@ function getOrCreateCommand(parent, name, description) {
2456
2069
  return parent.command(name).description(description);
2457
2070
  }
2458
2071
 
2459
- // src/framework/program-lifecycle.ts
2460
- async function parseProgram(program2, argv = process.argv) {
2461
- try {
2462
- await program2.parseAsync(normalizeSubcommandVersionOption(program2, argv));
2463
- } catch (error) {
2464
- if (error instanceof BusinessDisabledError) {
2465
- printError("permission", error.message, error.hint, error.code);
2466
- process.exitCode = 1;
2467
- return;
2468
- }
2469
- if (!(error instanceof CredentialStoreUnreadableError) && !(error instanceof ExternalCliTokenError)) throw error;
2470
- printError("config", error.message, error.hint, error.code);
2471
- process.exitCode = 1;
2472
- }
2473
- }
2474
- function normalizeSubcommandVersionOption(program2, argv) {
2475
- const normalized = [...argv];
2476
- let current = program2;
2477
- for (let index = 2; index < normalized.length; index += 1) {
2478
- const token = normalized[index];
2479
- if (token === "--") {
2480
- break;
2481
- }
2482
- if (token.startsWith("-")) {
2483
- if (token === "--version" && current !== program2 && hasRequiredVersionOption(current)) {
2484
- const value = normalized[index + 1];
2485
- if (value && !value.startsWith("-")) {
2486
- normalized.splice(index, 2, `--version=${value}`);
2487
- } else {
2488
- normalized[index] = "--version=";
2489
- }
2490
- continue;
2491
- }
2492
- if (!token.includes("=")) {
2493
- const option = findOption(current, token);
2494
- if (option?.required) {
2495
- index += 1;
2496
- } else if (option?.optional) {
2497
- const value = normalized[index + 1];
2498
- if (value && !value.startsWith("-")) {
2499
- index += 1;
2500
- }
2501
- }
2502
- }
2503
- continue;
2504
- }
2505
- const child = current.commands.find(
2506
- (command) => command.name() === token || command.aliases().includes(token)
2507
- );
2508
- if (child) {
2509
- current = child;
2510
- }
2511
- }
2512
- return normalized;
2513
- }
2514
- function hasRequiredVersionOption(command) {
2515
- return command.options.some((option) => option.long === "--version" && option.required);
2516
- }
2517
- function findOption(command, flag) {
2518
- let current = command;
2519
- while (current) {
2520
- const option = current.options.find((candidate) => candidate.long === flag || candidate.short === flag);
2521
- if (option) {
2522
- return option;
2523
- }
2524
- current = current.parent;
2525
- }
2526
- return void 0;
2527
- }
2528
-
2529
2072
  // src/commands/install.ts
2530
2073
  function registerInstall(program2) {
2531
2074
  program2.command("install").description("Install and verify this CLI distribution and its matching global Skills").option("--host <url>", "Check authentication for this AE host after installation").addHelpText("after", "\nExamples:\n npx @thinkingai/ae-cli@latest install\n ae-cli install --dry-run --format json\n ae-cli install --host https://your-ae-host.example.com\n\nSkills are installed globally in ~/.agents/skills with client adaptation handled automatically.\nGlobal options: --dry-run, --format json|table. Supports macOS, Linux, and native Windows.\n").action(async (opts) => {
@@ -2571,57 +2114,6 @@ function registerInstall(program2) {
2571
2114
  });
2572
2115
  }
2573
2116
 
2574
- // src/framework/business-filter.ts
2575
- import { Help } from "commander";
2576
- function commandPath(command) {
2577
- const result = [];
2578
- for (let current = command; current?.parent; current = current.parent) {
2579
- result.unshift(current.name());
2580
- }
2581
- return result;
2582
- }
2583
- function configureBusinessCommands(program2, options = {}) {
2584
- const readStates = options.readStates ?? (() => readCurrentBusinessConfig(options.hostOverride));
2585
- const isVisible = (command) => {
2586
- const business = businessForCommand(commandPath(command));
2587
- return !business || readStates()[business] !== false;
2588
- };
2589
- const helpConfiguration = {
2590
- visibleCommands(command) {
2591
- return Help.prototype.visibleCommands.call(this, command).filter(isVisible);
2592
- },
2593
- formatHelp(command, helper) {
2594
- if (!isVisible(command)) {
2595
- const business = businessForCommand(commandPath(command));
2596
- return `The '${business}' business is not enabled for the current environment.
2597
- Run: ae-cli config refresh
2598
- `;
2599
- }
2600
- return Help.prototype.formatHelp.call(this, command, helper);
2601
- }
2602
- };
2603
- const configureHelp = (command) => {
2604
- command.configureHelp(helpConfiguration);
2605
- command.commands.forEach(configureHelp);
2606
- };
2607
- configureHelp(program2);
2608
- program2.on("beforeAllHelp", (context) => {
2609
- if (isVisible(context.command)) return;
2610
- const business = businessForCommand(commandPath(context.command));
2611
- context.write(`The '${business}' business is not enabled for the current environment.
2612
- Run: ae-cli config refresh
2613
- `);
2614
- context.write = () => {
2615
- };
2616
- });
2617
- program2.hook("preAction", async (_root, actionCommand) => {
2618
- const business = businessForCommand(commandPath(actionCommand));
2619
- if (!business) return;
2620
- const opts = actionCommand.optsWithGlobals();
2621
- await (options.assertEnabled ?? assertBusinessEnabled)(business, opts.host ?? options.hostOverride);
2622
- });
2623
- }
2624
-
2625
2117
  // src/index.ts
2626
2118
  var require2 = createRequire(import.meta.url);
2627
2119
  var pkg = require2("../package.json");
@@ -2647,93 +2139,93 @@ function warnLoadFailure(label, err) {
2647
2139
  async function loadCommands() {
2648
2140
  const commands = [];
2649
2141
  try {
2650
- const teAnalysis = await import("./te-analysis-WOFFCIBC.js");
2142
+ const teAnalysis = await import("./te-analysis-CZY74HVF.js");
2651
2143
  commands.push(...teAnalysis.default);
2652
2144
  } catch (err) {
2653
2145
  warnLoadFailure("domain te-analysis", err);
2654
2146
  }
2655
2147
  try {
2656
- const engage = await import("./te-engage-IAUM6ONX.js");
2148
+ const engage = await import("./te-engage-WK7WKDKF.js");
2657
2149
  commands.push(...engage.default);
2658
2150
  } catch (err) {
2659
2151
  warnLoadFailure("domain te-engage", err);
2660
2152
  }
2661
2153
  try {
2662
- const experiment = await import("./te-experiment-TMLRA7B3.js");
2154
+ const experiment = await import("./te-experiment-LH3RPIOE.js");
2663
2155
  commands.push(...experiment.default);
2664
2156
  } catch (err) {
2665
2157
  warnLoadFailure("domain te-experiment", err);
2666
2158
  }
2667
2159
  try {
2668
- const community = await import("./te-community-R7B6QYOO.js");
2160
+ const community = await import("./te-community-DKCYUBCM.js");
2669
2161
  commands.push(...community.default);
2670
2162
  } catch (err) {
2671
2163
  warnLoadFailure("domain te-community", err);
2672
2164
  }
2673
2165
  try {
2674
- const dataops = await import("./te-dataops-KPILYVHA.js");
2166
+ const dataops = await import("./te-dataops-QEH6VE56.js");
2675
2167
  commands.push(...dataops.default);
2676
2168
  } catch (err) {
2677
2169
  warnLoadFailure("domain te-dataops", err);
2678
2170
  }
2679
2171
  try {
2680
- const teKb = await import("./te-kb-GKWPSLSY.js");
2172
+ const teKb = await import("./te-kb-UPORIOVN.js");
2681
2173
  commands.push(...teKb.default);
2682
2174
  } catch (err) {
2683
2175
  warnLoadFailure("domain te-kb", err);
2684
2176
  }
2685
2177
  try {
2686
- const teTeam = await import("./te-team-ISN52YNG.js");
2178
+ const teTeam = await import("./te-team-LLVTO2G4.js");
2687
2179
  commands.push(...teTeam.default);
2688
2180
  } catch (err) {
2689
2181
  warnLoadFailure("domain te-team", err);
2690
2182
  }
2691
2183
  try {
2692
- const teAgent = await import("./te-agent-S6UQR4IE.js");
2184
+ const teAgent = await import("./te-agent-RXI7WOH4.js");
2693
2185
  commands.push(...teAgent.default);
2694
2186
  } catch (err) {
2695
2187
  warnLoadFailure("domain te-agent", err);
2696
2188
  }
2697
2189
  try {
2698
- const memory = await import("./memory-SNFR5M23.js");
2190
+ const memory = await import("./memory-VEZZVAAP.js");
2699
2191
  commands.push(...memory.default);
2700
2192
  } catch (err) {
2701
2193
  warnLoadFailure("domain memory", err);
2702
2194
  }
2703
- const automation = await import("./automation-FD2QZUP6.js");
2195
+ const automation = await import("./automation-FLCPFMN4.js");
2704
2196
  commands.push(...automation.default);
2705
2197
  try {
2706
- const things = await import("./things-DDQ52Z3Q.js");
2198
+ const things = await import("./things-XLMLBYQR.js");
2707
2199
  commands.push(...things.default);
2708
2200
  } catch (err) {
2709
2201
  warnLoadFailure("domain things", err);
2710
2202
  }
2711
2203
  try {
2712
- const workspace = await import("./workspace-2CKQX2XL.js");
2204
+ const workspace = await import("./workspace-FF2HXJGR.js");
2713
2205
  commands.push(...workspace.default);
2714
2206
  } catch (err) {
2715
2207
  warnLoadFailure("domain workspace", err);
2716
2208
  }
2717
2209
  try {
2718
- const teSystem = await import("./te-system-CYWSK3UN.js");
2210
+ const teSystem = await import("./te-system-AL4B4XZL.js");
2719
2211
  commands.push(...teSystem.default);
2720
2212
  } catch (err) {
2721
2213
  warnLoadFailure("domain te-system", err);
2722
2214
  }
2723
2215
  try {
2724
- const metadata = await import("./metadata-EXQYDZTH.js");
2216
+ const metadata = await import("./metadata-3IWHX3V4.js");
2725
2217
  commands.push(...metadata.default);
2726
2218
  } catch (err) {
2727
2219
  warnLoadFailure("domain metadata", err);
2728
2220
  }
2729
2221
  try {
2730
- const personalSemanticPreference = await import("./personal-semantic-preference-ETY3KU2O.js");
2222
+ const personalSemanticPreference = await import("./personal-semantic-preference-YITU23SA.js");
2731
2223
  commands.push(...personalSemanticPreference.default);
2732
2224
  } catch (err) {
2733
2225
  warnLoadFailure("domain personal-semantic-preference", err);
2734
2226
  }
2735
2227
  try {
2736
- const projectSemantic = await import("./project-semantic-UHRMVOJF.js");
2228
+ const projectSemantic = await import("./project-semantic-MHEXJF3C.js");
2737
2229
  commands.push(...projectSemantic.default);
2738
2230
  } catch (err) {
2739
2231
  warnLoadFailure("domain project-semantic", err);
@@ -2745,13 +2237,19 @@ async function loadCommands() {
2745
2237
  warnLoadFailure("domain data-integration", err);
2746
2238
  }
2747
2239
  try {
2748
- const context = await import("./context-CDB5H5PD.js");
2240
+ const context = await import("./context-YAQG6YQC.js");
2749
2241
  commands.push(...context.default);
2750
2242
  } catch (err) {
2751
2243
  warnLoadFailure("domain context", err);
2752
2244
  }
2753
2245
  try {
2754
- const evaluation = await import("./evaluation-LR4YDYWL.js");
2246
+ const aiMonitor = await import("./ai-monitor-MKMHSSNI.js");
2247
+ commands.push(...aiMonitor.default);
2248
+ } catch (err) {
2249
+ warnLoadFailure("domain ai-monitor", err);
2250
+ }
2251
+ try {
2252
+ const evaluation = await import("./evaluation-2JSF4V47.js");
2755
2253
  commands.push(...evaluation.default);
2756
2254
  } catch (err) {
2757
2255
  warnLoadFailure("domain evaluation", err);
@@ -2760,7 +2258,7 @@ async function loadCommands() {
2760
2258
  }
2761
2259
  async function registerAuthCommands() {
2762
2260
  try {
2763
- const { registerAuth } = await import("./auth-ADZHUIJR.js");
2261
+ const { registerAuth } = await import("./auth-CZHHPZOQ.js");
2764
2262
  registerAuth(program);
2765
2263
  } catch (err) {
2766
2264
  warnLoadFailure("auth commands", err);
@@ -2768,7 +2266,7 @@ async function registerAuthCommands() {
2768
2266
  }
2769
2267
  async function registerConfigCommands() {
2770
2268
  try {
2771
- const { registerConfig } = await import("./config-E3KANXMK.js");
2269
+ const { registerConfig } = await import("./config-FSH2NMNZ.js");
2772
2270
  registerConfig(program);
2773
2271
  } catch (err) {
2774
2272
  warnLoadFailure("config commands", err);
@@ -2776,7 +2274,7 @@ async function registerConfigCommands() {
2776
2274
  }
2777
2275
  async function registerCapabilityCommands() {
2778
2276
  try {
2779
- const { registerCapability } = await import("./capability-QXFRJYZD.js");
2277
+ const { registerCapability } = await import("./capability-64KVJFIA.js");
2780
2278
  registerCapability(program);
2781
2279
  } catch (err) {
2782
2280
  warnLoadFailure("capability commands", err);
@@ -2784,7 +2282,7 @@ async function registerCapabilityCommands() {
2784
2282
  }
2785
2283
  async function registerSyncCommand() {
2786
2284
  try {
2787
- const { registerSync } = await import("./sync-XKEBXESC.js");
2285
+ const { registerSync } = await import("./sync-AQHVCSPI.js");
2788
2286
  registerSync(program);
2789
2287
  } catch (err) {
2790
2288
  warnLoadFailure("sync commands", err);
@@ -2792,7 +2290,7 @@ async function registerSyncCommand() {
2792
2290
  }
2793
2291
  async function registerModelCommand() {
2794
2292
  try {
2795
- const { registerModel } = await import("./model-KEVCEXWD.js");
2293
+ const { registerModel } = await import("./model-T7H7Q6BG.js");
2796
2294
  registerModel(program);
2797
2295
  } catch (err) {
2798
2296
  warnLoadFailure("model commands", err);
@@ -2800,7 +2298,7 @@ async function registerModelCommand() {
2800
2298
  }
2801
2299
  async function registerUpdateCommand() {
2802
2300
  try {
2803
- const { registerUpdate } = await import("./update-CTLNTX35.js");
2301
+ const { registerUpdate } = await import("./update-7J5UQHSK.js");
2804
2302
  registerUpdate(program);
2805
2303
  } catch (err) {
2806
2304
  warnLoadFailure("update commands", err);