@thinkingai/ae-cli 6.0.57 → 6.0.60

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 (257) hide show
  1. package/README.md +10 -5
  2. package/README.zh.md +10 -5
  3. package/bin/ai-monitor.js +2 -0
  4. package/dist/ai-monitor-FCXSLHAP.js +32 -0
  5. package/dist/ai-monitor.js +135 -0
  6. package/dist/{auth-YEIJLBFY.js → auth-ATK2SLEV.js} +12 -11
  7. package/dist/{automation-NAR5DDGL.js → automation-FLCPFMN4.js} +5 -5
  8. package/dist/{capability-P7DD4Q73.js → capability-6KTSOI7L.js} +32 -36
  9. package/dist/{chunk-JCWM2TYP.js → chunk-2ETRY2CU.js} +16 -16
  10. package/dist/{chunk-IN7KKL6K.js → chunk-2F64AZYH.js} +1 -1
  11. package/dist/{chunk-JNVVJ273.js → chunk-4PSTYEG5.js} +5 -10
  12. package/dist/{chunk-QEMQKVHW.js → chunk-5E7MTTFN.js} +3 -3
  13. package/dist/{chunk-RJHGDWSC.js → chunk-5M5LBRR3.js} +2 -2
  14. package/dist/chunk-6M7ZEDT2.js +182 -0
  15. package/dist/{chunk-KPQY44JQ.js → chunk-AWW2T2WL.js} +3 -0
  16. package/dist/chunk-AXTO4FTM.js +1285 -0
  17. package/dist/{chunk-TKVVACEJ.js → chunk-BEYLCUZX.js} +17 -12
  18. package/dist/chunk-CF6JTT2U.js +64 -0
  19. package/dist/{chunk-N6XBLRB7.js → chunk-F2VFZUGG.js} +2 -2
  20. package/dist/{chunk-ZGIYG473.js → chunk-HSZAIPUX.js} +48 -13
  21. package/dist/{chunk-H3K5UGYC.js → chunk-HTZ2MLYA.js} +48 -22
  22. package/dist/{chunk-QZUVLFNR.js → chunk-HVMCPKOZ.js} +1 -1
  23. package/dist/{chunk-7JAVT5TK.js → chunk-KTJXD27G.js} +2 -2
  24. package/dist/{chunk-TULINOLS.js → chunk-LOR4IA26.js} +565 -315
  25. package/dist/{chunk-YVG6QD3V.js → chunk-P7QDCWJ6.js} +98 -7
  26. package/dist/{chunk-7ABK2PEJ.js → chunk-SDKW6LYE.js} +88 -36
  27. package/dist/{chunk-752BSLZC.js → chunk-VJUXKVRE.js} +1 -1
  28. package/dist/chunk-VRMGHQKE.js +556 -0
  29. package/dist/{compat-check-PMEGUPZU.js → compat-check-XD2U7PZ2.js} +3 -3
  30. package/dist/{config-VWVPR4WW.js → config-U3GDWU6E.js} +26 -13
  31. package/dist/{context-F6FCGTF3.js → context-YAQG6YQC.js} +3 -3
  32. package/dist/{data-integration-6UAZO4GG.js → data-integration-QE37EQ3A.js} +1 -1
  33. package/dist/{evaluation-4LO2O4AF.js → evaluation-2JSF4V47.js} +13 -158
  34. package/dist/index.js +87 -582
  35. package/dist/{memory-HHPX3NF2.js → memory-WEB27VI6.js} +8 -8
  36. package/dist/{metadata-HEQQEEG3.js → metadata-7FYE4234.js} +8 -8
  37. package/dist/{model-7UHGWYVR.js → model-T7H7Q6BG.js} +3 -3
  38. package/dist/{personal-semantic-preference-V4L6ZWR2.js → personal-semantic-preference-O6VXM74A.js} +7 -7
  39. package/dist/{project-semantic-NKHKJX6M.js → project-semantic-2GGFJWW6.js} +16 -14
  40. package/dist/{sync-ZJMXCRIN.js → sync-ULBB7WO5.js} +5 -5
  41. package/dist/{te-agent-WBKIFEQD.js → te-agent-6RMF7LUV.js} +6 -6
  42. package/dist/{te-analysis-ADX7RKO4.js → te-analysis-HSYC7GNV.js} +383 -194
  43. package/dist/{te-community-PREDRXG3.js → te-community-FLKZGQKB.js} +10 -10
  44. package/dist/{te-dataops-ITWJHO2U.js → te-dataops-OQQGTCUA.js} +5 -5
  45. package/dist/{te-engage-VE2NUH5V.js → te-engage-RIEBHL5T.js} +10 -10
  46. package/dist/{te-kb-WSMOW7WS.js → te-kb-4HG2FMHJ.js} +19 -10
  47. package/dist/{te-system-YM657FKO.js → te-system-AL4B4XZL.js} +3 -3
  48. package/dist/{te-team-T2WRLOOD.js → te-team-5O4UVUWE.js} +6 -6
  49. package/dist/{things-6QOMFXOG.js → things-TSJ64GBT.js} +6 -6
  50. package/dist/{update-I4MOUYOX.js → update-Q5LURAWV.js} +4 -4
  51. package/dist/{workspace-LYDAP647.js → workspace-FF2HXJGR.js} +5 -5
  52. package/package.json +8 -6
  53. package/skills/ae-ai-monitor/SKILL.md +179 -0
  54. package/skills/ae-ai-monitor/references/read-commands.md +866 -0
  55. package/skills/ae-analysis/SKILL.md +10 -4
  56. package/skills/ae-analysis/references/adhoc_export.md +3 -1
  57. package/skills/ae-analysis/references/ai_models.md +1 -0
  58. package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -0
  59. package/skills/ae-analysis/references/asset_search.md +1 -1
  60. package/skills/ae-analysis/references/bad_case_begin.md +12 -0
  61. package/skills/ae-analysis/references/bad_case_get.md +12 -0
  62. package/skills/ae-analysis/references/bad_case_history.md +12 -0
  63. package/skills/ae-analysis/references/bad_case_list.md +12 -0
  64. package/skills/ae-analysis/references/bad_case_review.md +51 -0
  65. package/skills/ae-analysis/references/bad_case_run.md +12 -0
  66. package/skills/ae-analysis/references/bad_case_submit.md +12 -0
  67. package/skills/ae-analysis/references/bad_case_submit_to_page.md +12 -0
  68. package/skills/ae-analysis/references/bad_case_sync_evaluation.md +11 -0
  69. package/skills/ae-analysis/references/bi_panel_list.md +1 -1
  70. package/skills/ae-analysis/references/bi_panel_share.md +3 -1
  71. package/skills/ae-analysis/references/catalog_list.md +2 -0
  72. package/skills/ae-analysis/references/command_index.md +38 -29
  73. package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
  74. package/skills/ae-analysis/references/dashboard_handover.md +3 -1
  75. package/skills/ae-analysis/references/dashboard_list.md +3 -3
  76. package/skills/ae-analysis/references/dashboard_report_data_export.md +1 -1
  77. package/skills/ae-analysis/references/dashboard_share.md +3 -1
  78. package/skills/ae-analysis/references/dashboard_update.md +3 -2
  79. package/skills/ae-analysis/references/filter_value_list.md +2 -0
  80. package/skills/ae-analysis/references/folder_share.md +8 -2
  81. package/skills/ae-analysis/references/governance_recommendation_run_update.md +3 -1
  82. package/skills/ae-analysis/references/project_data_power_upsert.md +3 -1
  83. package/skills/ae-analysis/references/project_mark_time_create.md +2 -0
  84. package/skills/ae-analysis/references/project_mark_time_update.md +2 -0
  85. package/skills/ae-analysis/references/project_member_add.md +3 -1
  86. package/skills/ae-analysis/references/project_member_batch_update.md +3 -1
  87. package/skills/ae-analysis/references/project_member_handover_run.md +3 -1
  88. package/skills/ae-analysis/references/project_member_update.md +3 -1
  89. package/skills/ae-analysis/references/project_owner_update.md +3 -1
  90. package/skills/ae-analysis/references/project_role_upsert.md +5 -3
  91. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +16 -1
  92. package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +14 -1
  93. package/skills/ae-analysis/references/project_space_share.md +8 -2
  94. package/skills/ae-analysis/references/property_get.md +2 -0
  95. package/skills/ae-analysis/references/public_link_list.md +3 -1
  96. package/skills/ae-analysis/references/query_cancel.md +4 -1
  97. package/skills/ae-analysis/references/report_data_run.md +1 -1
  98. package/skills/ae-analysis/references/report_list.md +3 -3
  99. package/skills/ae-analysis/references/scenario_append.md +2 -2
  100. package/skills/ae-analysis/references/scenario_collect.md +15 -4
  101. package/skills/ae-analysis/references/scenario_list.md +2 -1
  102. package/skills/ae-analysis/references/system_oauth2_update.md +3 -1
  103. package/skills/ae-analysis/references/system_third_party_login_upsert.md +4 -2
  104. package/skills/ae-analysis/references/user_tag_create.md +4 -1
  105. package/skills/ae-analysis/references/user_tag_get.md +2 -0
  106. package/skills/ae-analysis/references/user_tag_models.md +8 -2
  107. package/skills/ae-analysis/references/user_tag_update.md +5 -2
  108. package/skills/ae-analysis/references/virtual_property_create.md +12 -1
  109. package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +10 -0
  110. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +55 -13
  111. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +2 -2
  112. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +2 -2
  113. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +7 -1
  114. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/wait-compile-run.mjs +79 -0
  115. package/skills/ae-automation/SKILL.md +4 -2
  116. package/skills/ae-capability/SKILL.md +9 -5
  117. package/skills/ae-community/SKILL.md +1 -0
  118. package/skills/ae-dataops/SKILL.md +1 -0
  119. package/skills/ae-engage/SKILL.md +1 -0
  120. package/skills/ae-evaluation/SKILL.md +17 -2
  121. package/skills/ae-generate-tracking-plan/SKILL.md +5 -0
  122. package/skills/ae-kb/SKILL.md +9 -5
  123. package/skills/ae-kb/references/analysis-workflow.md +11 -2
  124. package/skills/ae-kb/references/query-workflow.md +9 -6
  125. package/skills/ae-kb/references/versions.md +1 -1
  126. package/skills/ae-kb-discovery/SKILL.md +15 -6
  127. package/skills/ae-metadata/SKILL.md +1 -0
  128. package/skills/ae-migrate-tracking-code/SKILL.md +2 -1
  129. package/skills/ae-team/SKILL.md +1 -1
  130. package/skills/ae-tracking-matrix/SKILL.md +170 -0
  131. package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
  132. package/skills/ae-tracking-matrix/i18n.yaml +12 -0
  133. package/skills/ae-tracking-matrix/references/ae-capabilities.md +93 -0
  134. package/skills/ae-tracking-matrix/references/business-semantic-checks.md +30 -0
  135. package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +256 -0
  136. package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +213 -0
  137. package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +407 -0
  138. package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +218 -0
  139. package/skills/ae-tracking-matrix/references/categories/casual_music.md +112 -0
  140. package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +301 -0
  141. package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +356 -0
  142. package/skills/ae-tracking-matrix/references/categories/fishing.md +775 -0
  143. package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +89 -0
  144. package/skills/ae-tracking-matrix/references/categories/idle_card.md +27 -0
  145. package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +415 -0
  146. package/skills/ae-tracking-matrix/references/categories/interactive_video.md +133 -0
  147. package/skills/ae-tracking-matrix/references/categories/merge.md +639 -0
  148. package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +406 -0
  149. package/skills/ae-tracking-matrix/references/categories/mmo_web.md +230 -0
  150. package/skills/ae-tracking-matrix/references/categories/music.md +137 -0
  151. package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +414 -0
  152. package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +199 -0
  153. package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +158 -0
  154. package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +546 -0
  155. package/skills/ae-tracking-matrix/references/categories/rpg.md +195 -0
  156. package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +115 -0
  157. package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +151 -0
  158. package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +260 -0
  159. package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +232 -0
  160. package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +359 -0
  161. package/skills/ae-tracking-matrix/references/categories/tower_defense.md +365 -0
  162. package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +211 -0
  163. package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +132 -0
  164. package/skills/ae-tracking-matrix/references/category-registry.md +77 -0
  165. package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +230 -0
  166. package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +406 -0
  167. package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +128 -0
  168. package/skills/ae-tracking-matrix/references/eval-cases.md +74 -0
  169. package/skills/ae-tracking-matrix/references/naming-dict.md +238 -0
  170. package/skills/ae-tracking-matrix/references/optimization-checklist.md +85 -0
  171. package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +142 -0
  172. package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +47 -0
  173. package/skills/ae-tracking-matrix/references/plan-generation/reference.md +794 -0
  174. package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +94 -0
  175. package/skills/ae-tracking-matrix/references/scene-routing.md +80 -0
  176. package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +3787 -0
  177. package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +827 -0
  178. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +655 -0
  179. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +953 -0
  180. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +1128 -0
  181. package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +714 -0
  182. package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +1268 -0
  183. package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +776 -0
  184. package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +182 -0
  185. package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +2755 -0
  186. package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +1182 -0
  187. package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +1300 -0
  188. package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +1369 -0
  189. package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +1692 -0
  190. package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +902 -0
  191. package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +763 -0
  192. package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +1107 -0
  193. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +1532 -0
  194. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +845 -0
  195. package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +228 -0
  196. package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +149 -0
  197. package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +407 -0
  198. package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +163 -0
  199. package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +149 -0
  200. package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +153 -0
  201. package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +232 -0
  202. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +314 -0
  203. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +117 -0
  204. package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +148 -0
  205. package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +645 -0
  206. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +307 -0
  207. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +347 -0
  208. package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +72 -0
  209. package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +264 -0
  210. package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +566 -0
  211. package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +409 -0
  212. package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +446 -0
  213. package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +557 -0
  214. package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +457 -0
  215. package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +490 -0
  216. package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +523 -0
  217. package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +484 -0
  218. package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +442 -0
  219. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +391 -0
  220. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +91 -0
  221. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +635 -0
  222. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +113 -0
  223. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +466 -0
  224. package/skills/ae-tracking-matrix/references/standard-base/README.md +22 -0
  225. package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +174 -0
  226. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +20 -0
  227. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +7 -0
  228. package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +14 -0
  229. package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +370 -0
  230. package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +47 -0
  231. package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +37 -0
  232. package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +27 -0
  233. package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +23 -0
  234. package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +14 -0
  235. package/skills/ae-tracking-matrix/references/standard-base/user_data.md +46 -0
  236. package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +13 -0
  237. package/skills/ae-tracking-matrix/references/system-fields.md +297 -0
  238. package/skills/ae-tracking-matrix/references/te-field-translations.md +1791 -0
  239. package/skills/ae-tracking-matrix/references/workflows/data-verification.md +232 -0
  240. package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +829 -0
  241. package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +355 -0
  242. package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +283 -0
  243. package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +168 -0
  244. package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +205 -0
  245. package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +75 -0
  246. package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +36 -0
  247. package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +107 -0
  248. package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +114 -0
  249. package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +53 -0
  250. package/skills/ae-tracking-matrix/scripts/finalize_plan.py +166 -0
  251. package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +674 -0
  252. package/skills/ae-tracking-matrix/scripts/plan_contract.py +200 -0
  253. package/skills/ae-tracking-matrix/scripts/plan_types.py +60 -0
  254. package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +169 -0
  255. package/skills/ae-tracking-matrix/scripts/sync_plan.py +296 -0
  256. package/skills/ae-tracking-matrix/scripts/upload_plan.py +340 -0
  257. 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,
@@ -19,61 +16,55 @@ import {
19
16
  writeDraftXlsx
20
17
  } from "./chunk-72NJKS7O.js";
21
18
  import "./chunk-QVRIDN42.js";
22
- import {
23
- EvalApiError
24
- } from "./chunk-YVG6QD3V.js";
25
19
  import "./chunk-OAWPT7VP.js";
26
20
  import "./chunk-JEUXDY3B.js";
27
- import {
28
- TeAgentApiError,
29
- TeAgentCredentialsError
30
- } from "./chunk-RJHGDWSC.js";
31
- import {
32
- CapabilityGatewayError,
33
- executeCapability,
34
- uploadInputFileBytes
35
- } from "./chunk-JCWM2TYP.js";
36
21
  import {
37
22
  resolveHost
38
- } from "./chunk-IN7KKL6K.js";
23
+ } from "./chunk-2F64AZYH.js";
24
+ import {
25
+ configureBusinessCommands,
26
+ parseProgram,
27
+ runCommand
28
+ } from "./chunk-VRMGHQKE.js";
29
+ import "./chunk-CF6JTT2U.js";
30
+ import "./chunk-5M5LBRR3.js";
31
+ import "./chunk-P7QDCWJ6.js";
39
32
  import {
40
33
  printError,
41
34
  printOutput
42
- } from "./chunk-752BSLZC.js";
35
+ } from "./chunk-VJUXKVRE.js";
36
+ import {
37
+ executeCapability,
38
+ uploadInputFileBytes
39
+ } from "./chunk-2ETRY2CU.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-TULINOLS.js";
52
+ shouldSkipAutoSync,
53
+ syncRefreshedBusinessSkills
54
+ } from "./chunk-LOR4IA26.js";
59
55
  import {
60
- CredentialStoreUnreadableError,
61
56
  SecureStoreAuthError,
62
57
  getCliToken,
63
58
  peekCliToken
64
- } from "./chunk-H3K5UGYC.js";
59
+ } from "./chunk-HTZ2MLYA.js";
65
60
  import {
66
61
  getActiveHost,
67
62
  getConfigDir,
68
63
  safeJsonParse
69
- } from "./chunk-JNVVJ273.js";
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,408 +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(err.type, message, err.hint ?? capabilityGatewayHint(err), err.code, err.meta);
309
- } else if (err instanceof CommunityReportError) {
310
- printError("api", message, err.hint, err.code, err.meta, { log: false });
311
- } else if (err instanceof LocalDataUploadError) {
312
- printError("api", message, err.hint, err.code, err.meta, { log: false });
313
- } else if (err instanceof CredentialStoreUnreadableError || err instanceof ExternalCliTokenError) {
314
- printError("config", message, err.hint, err.code);
315
- } else if (err instanceof EvalApiError) {
316
- printError("api", message, err.hint, err.code, void 0, { log: false });
317
- } else if (err instanceof SecureStoreAuthError) {
318
- printError("auth", message, "Run: ae-cli auth login", err.code);
319
- } else if (err instanceof TeAgentApiError) {
320
- if (err.status === 403) {
321
- printError("permission", message, err.hint, err.code, void 0, { details: err.details });
322
- } else if (err.status === 401) {
323
- printError("auth", message, err.hint ?? "Run: ae-cli auth login", err.code, void 0, { details: err.details });
324
- } else {
325
- const presentation = teAgentApiErrorPresentation(err);
326
- printError(
327
- err.errorType,
328
- presentation.message ?? message,
329
- presentation.hint ?? err.hint,
330
- presentation.code ?? err.code,
331
- presentation.meta,
332
- { details: err.details }
333
- );
334
- }
335
- } else if (looksLikeAuthFailure(message)) {
336
- printError("auth", message, "Run: ae-cli auth login");
337
- } else {
338
- printError("api", message);
339
- }
340
- process.exit(1);
341
- }
342
- }
343
- function stringFlagValidationError(flag, value) {
344
- if (flag.type !== "string") return void 0;
345
- if (flag.minLength !== void 0 && value.length < flag.minLength) {
346
- return { message: `--${flag.name} must contain at least ${flag.minLength} characters` };
347
- }
348
- if (flag.maxLength !== void 0 && value.length > flag.maxLength) {
349
- return { message: `--${flag.name} must not exceed ${flag.maxLength} characters (got: ${value.length})` };
350
- }
351
- if (flag.pattern !== void 0 && !new RegExp(flag.pattern).test(value)) {
352
- return { message: `--${flag.name} has an invalid format`, hint: `Expected pattern: ${flag.pattern}` };
353
- }
354
- return void 0;
355
- }
356
- function capabilityGatewayHint(err) {
357
- 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")) {
358
- 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.";
359
- }
360
- const compatExtra = formatCapabilityMissCompatHint();
361
- if (err.code === "CAPABILITY_NOT_FOUND") {
362
- 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.";
363
- return compatExtra ? `${base}
364
- ${compatExtra}` : base;
365
- }
366
- if (err.httpStatus === 404 && !err.code) {
367
- const base = "The current host returned 404 for this capability route. Do not keep retrying the same command; verify the backend route/capability deployment.";
368
- return compatExtra ? `${base}
369
- ${compatExtra}` : base;
370
- }
371
- return void 0;
372
- }
373
- function looksLikeAuthFailure(message) {
374
- const m = message.toLowerCase();
375
- if (m.includes("403") || m.includes("forbidden") || m.includes("permission")) return false;
376
- 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");
377
- }
378
- function createRuntimeContext(cmd, opts, globalOpts) {
379
- let _communityReportModule = null;
380
- async function getCommunityReportClient() {
381
- if (!_communityReportModule) {
382
- _communityReportModule = await import("./community-report-client-TJVCLZ3K.js");
383
- }
384
- return _communityReportModule;
385
- }
386
- let _localDataUploadModule = null;
387
- async function getLocalDataUploadClient() {
388
- if (!_localDataUploadModule) {
389
- _localDataUploadModule = await import("./local-data-upload-client-KCMG6J62.js");
390
- }
391
- return _localDataUploadModule;
392
- }
393
- const ctx = {
394
- has(name) {
395
- return Object.prototype.hasOwnProperty.call(opts, camelCase(name));
396
- },
397
- str(name) {
398
- return String(opts[camelCase(name)] ?? "");
399
- },
400
- num(name) {
401
- const val = opts[camelCase(name)];
402
- return val !== void 0 ? Number(val) : 0;
403
- },
404
- optionalNum(name) {
405
- const val = opts[camelCase(name)];
406
- if (val === void 0 || val === null || val === "") return void 0;
407
- return Number(val);
408
- },
409
- int64(name) {
410
- const val = opts[camelCase(name)];
411
- if (val === void 0 || val === null || val === "") return 0n;
412
- return BigInt(String(val));
413
- },
414
- optionalInt64(name) {
415
- const val = opts[camelCase(name)];
416
- if (val === void 0 || val === null || val === "") return void 0;
417
- return BigInt(String(val));
418
- },
419
- bool(name) {
420
- return Boolean(opts[camelCase(name)]);
421
- },
422
- optionalBool(name) {
423
- const val = opts[camelCase(name)];
424
- return typeof val === "boolean" ? val : void 0;
425
- },
426
- json(name) {
427
- const val = opts[camelCase(name)];
428
- if (val === void 0 || val === null) return void 0;
429
- if (typeof val === "object") return val;
430
- try {
431
- return safeJsonParse(String(val));
432
- } catch {
433
- if (cmd.flags.some((flag) => flag.name === name && flag.sensitive)) {
434
- throw new CliValidationError(`Invalid JSON for --${name}.`, {
435
- hint: "Provide valid JSON with quoted keys and strings. Sensitive input is omitted from diagnostics."
436
- });
437
- }
438
- printError("validation", `Invalid JSON for --${name}: ${val}`);
439
- process.exit(1);
440
- }
441
- },
442
- list(name) {
443
- const val = opts[camelCase(name)];
444
- if (Array.isArray(val)) return val.map(String);
445
- if (val === void 0 || val === null) return [];
446
- return [String(val)];
447
- },
448
- async communityReport(endpoint, rawBody) {
449
- const client = await getCommunityReportClient();
450
- return client.communityReport(endpoint, rawBody);
451
- },
452
- async localDataUpload(endpoint, rawBody, options) {
453
- const client = await getLocalDataUploadClient();
454
- return client.localDataUpload(endpoint, rawBody, options);
455
- },
456
- hostOverride() {
457
- return globalOpts.host;
458
- },
459
- host() {
460
- if (cmd.service === "kb" && ["+list", "+index", "+grep", "+read"].includes(cmd.command)) {
461
- const context = readKbExecutionContext();
462
- if (context) return globalOpts.host || context.origin;
463
- }
464
- if (globalOpts.host) return globalOpts.host;
465
- return getActiveHost();
466
- },
467
- mcpUrl() {
468
- return globalOpts.mcpUrl;
469
- },
470
- service() {
471
- return cmd.service;
472
- },
473
- async out(data) {
474
- await printOutput(data, globalOpts.format, globalOpts.jq, { redactErrors: cmd.sensitiveOutput });
475
- }
476
- };
477
- return ctx;
478
- }
479
- function camelCase(str) {
480
- return str.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
481
- }
482
- async function confirm(message) {
483
- const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
484
- return new Promise((resolve3) => {
485
- rl.question(`${message} [y/N] `, (answer) => {
486
- rl.close();
487
- resolve3(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
488
- });
489
- });
490
- }
491
-
492
81
  // src/framework/register.ts
493
82
  function registerCommands(program2, commands) {
494
83
  const byService = /* @__PURE__ */ new Map();
@@ -666,7 +255,17 @@ async function runFeatureConfigCheck(hostOverride, argv = process.argv) {
666
255
  if (!host) return void 0;
667
256
  const token = peekCliToken(host);
668
257
  if (!token) return void 0;
669
- 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));
670
269
  } catch {
671
270
  return void 0;
672
271
  }
@@ -1348,6 +947,25 @@ function assertInputFilePath(path5, optionName = "--in") {
1348
947
 
1349
948
  // src/commands/tracking/plan.ts
1350
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
+ }
1351
969
  function registerPlan(cmd, rootProgram) {
1352
970
  cmd.description("manage AE tracking plans");
1353
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) => {
@@ -1429,12 +1047,13 @@ function registerPlan(cmd, rootProgram) {
1429
1047
  }
1430
1048
  }
1431
1049
  });
1432
- 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) => {
1433
1051
  assertInputFilePath(opts.draft, "--draft");
1434
1052
  assertInputFilePath(opts.xlsx, "--xlsx");
1435
1053
  const host = resolveTrackingHost(rootProgram, opts);
1436
- let client = await createTrackingClient(host);
1437
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);
1438
1057
  if (!opts.replace) {
1439
1058
  console.log(t("plan.checking_conflicts"));
1440
1059
  try {
@@ -1563,8 +1182,9 @@ function registerPlan(cmd, rootProgram) {
1563
1182
  console.log(t("plan.archived_to", { path: dest }));
1564
1183
  console.log(t("plan.draft_updated_archived", { stamp }));
1565
1184
  });
1566
- 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) => {
1567
1186
  const host = resolveTrackingHost(rootProgram, opts);
1187
+ if (await previewPlanWrite(rootProgram, host, opts.project)) return;
1568
1188
  const client = await createTrackingClient(host);
1569
1189
  const res = await client.deleteProgram(opts.project);
1570
1190
  console.log(JSON.stringify(res, null, 2));
@@ -2449,76 +2069,6 @@ function getOrCreateCommand(parent, name, description) {
2449
2069
  return parent.command(name).description(description);
2450
2070
  }
2451
2071
 
2452
- // src/framework/program-lifecycle.ts
2453
- async function parseProgram(program2, argv = process.argv) {
2454
- try {
2455
- await program2.parseAsync(normalizeSubcommandVersionOption(program2, argv));
2456
- } catch (error) {
2457
- if (error instanceof BusinessDisabledError) {
2458
- printError("permission", error.message, error.hint, error.code);
2459
- process.exitCode = 1;
2460
- return;
2461
- }
2462
- if (!(error instanceof CredentialStoreUnreadableError) && !(error instanceof ExternalCliTokenError)) throw error;
2463
- printError("config", error.message, error.hint, error.code);
2464
- process.exitCode = 1;
2465
- }
2466
- }
2467
- function normalizeSubcommandVersionOption(program2, argv) {
2468
- const normalized = [...argv];
2469
- let current = program2;
2470
- for (let index = 2; index < normalized.length; index += 1) {
2471
- const token = normalized[index];
2472
- if (token === "--") {
2473
- break;
2474
- }
2475
- if (token.startsWith("-")) {
2476
- if (token === "--version" && current !== program2 && hasRequiredVersionOption(current)) {
2477
- const value = normalized[index + 1];
2478
- if (value && !value.startsWith("-")) {
2479
- normalized.splice(index, 2, `--version=${value}`);
2480
- } else {
2481
- normalized[index] = "--version=";
2482
- }
2483
- continue;
2484
- }
2485
- if (!token.includes("=")) {
2486
- const option = findOption(current, token);
2487
- if (option?.required) {
2488
- index += 1;
2489
- } else if (option?.optional) {
2490
- const value = normalized[index + 1];
2491
- if (value && !value.startsWith("-")) {
2492
- index += 1;
2493
- }
2494
- }
2495
- }
2496
- continue;
2497
- }
2498
- const child = current.commands.find(
2499
- (command) => command.name() === token || command.aliases().includes(token)
2500
- );
2501
- if (child) {
2502
- current = child;
2503
- }
2504
- }
2505
- return normalized;
2506
- }
2507
- function hasRequiredVersionOption(command) {
2508
- return command.options.some((option) => option.long === "--version" && option.required);
2509
- }
2510
- function findOption(command, flag) {
2511
- let current = command;
2512
- while (current) {
2513
- const option = current.options.find((candidate) => candidate.long === flag || candidate.short === flag);
2514
- if (option) {
2515
- return option;
2516
- }
2517
- current = current.parent;
2518
- }
2519
- return void 0;
2520
- }
2521
-
2522
2072
  // src/commands/install.ts
2523
2073
  function registerInstall(program2) {
2524
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) => {
@@ -2564,57 +2114,6 @@ function registerInstall(program2) {
2564
2114
  });
2565
2115
  }
2566
2116
 
2567
- // src/framework/business-filter.ts
2568
- import { Help } from "commander";
2569
- function commandPath(command) {
2570
- const result = [];
2571
- for (let current = command; current?.parent; current = current.parent) {
2572
- result.unshift(current.name());
2573
- }
2574
- return result;
2575
- }
2576
- function configureBusinessCommands(program2, options = {}) {
2577
- const readStates = options.readStates ?? (() => readCurrentBusinessConfig(options.hostOverride));
2578
- const isVisible = (command) => {
2579
- const business = businessForCommand(commandPath(command));
2580
- return !business || readStates()[business] !== false;
2581
- };
2582
- const helpConfiguration = {
2583
- visibleCommands(command) {
2584
- return Help.prototype.visibleCommands.call(this, command).filter(isVisible);
2585
- },
2586
- formatHelp(command, helper) {
2587
- if (!isVisible(command)) {
2588
- const business = businessForCommand(commandPath(command));
2589
- return `The '${business}' business is not enabled for the current environment.
2590
- Run: ae-cli config refresh
2591
- `;
2592
- }
2593
- return Help.prototype.formatHelp.call(this, command, helper);
2594
- }
2595
- };
2596
- const configureHelp = (command) => {
2597
- command.configureHelp(helpConfiguration);
2598
- command.commands.forEach(configureHelp);
2599
- };
2600
- configureHelp(program2);
2601
- program2.on("beforeAllHelp", (context) => {
2602
- if (isVisible(context.command)) return;
2603
- const business = businessForCommand(commandPath(context.command));
2604
- context.write(`The '${business}' business is not enabled for the current environment.
2605
- Run: ae-cli config refresh
2606
- `);
2607
- context.write = () => {
2608
- };
2609
- });
2610
- program2.hook("preAction", async (_root, actionCommand) => {
2611
- const business = businessForCommand(commandPath(actionCommand));
2612
- if (!business) return;
2613
- const opts = actionCommand.optsWithGlobals();
2614
- await (options.assertEnabled ?? assertBusinessEnabled)(business, opts.host ?? options.hostOverride);
2615
- });
2616
- }
2617
-
2618
2117
  // src/index.ts
2619
2118
  var require2 = createRequire(import.meta.url);
2620
2119
  var pkg = require2("../package.json");
@@ -2640,105 +2139,111 @@ function warnLoadFailure(label, err) {
2640
2139
  async function loadCommands() {
2641
2140
  const commands = [];
2642
2141
  try {
2643
- const teAnalysis = await import("./te-analysis-ADX7RKO4.js");
2142
+ const teAnalysis = await import("./te-analysis-HSYC7GNV.js");
2644
2143
  commands.push(...teAnalysis.default);
2645
2144
  } catch (err) {
2646
2145
  warnLoadFailure("domain te-analysis", err);
2647
2146
  }
2648
2147
  try {
2649
- const engage = await import("./te-engage-VE2NUH5V.js");
2148
+ const engage = await import("./te-engage-RIEBHL5T.js");
2650
2149
  commands.push(...engage.default);
2651
2150
  } catch (err) {
2652
2151
  warnLoadFailure("domain te-engage", err);
2653
2152
  }
2654
2153
  try {
2655
- const community = await import("./te-community-PREDRXG3.js");
2154
+ const community = await import("./te-community-FLKZGQKB.js");
2656
2155
  commands.push(...community.default);
2657
2156
  } catch (err) {
2658
2157
  warnLoadFailure("domain te-community", err);
2659
2158
  }
2660
2159
  try {
2661
- const dataops = await import("./te-dataops-ITWJHO2U.js");
2160
+ const dataops = await import("./te-dataops-OQQGTCUA.js");
2662
2161
  commands.push(...dataops.default);
2663
2162
  } catch (err) {
2664
2163
  warnLoadFailure("domain te-dataops", err);
2665
2164
  }
2666
2165
  try {
2667
- const teKb = await import("./te-kb-WSMOW7WS.js");
2166
+ const teKb = await import("./te-kb-4HG2FMHJ.js");
2668
2167
  commands.push(...teKb.default);
2669
2168
  } catch (err) {
2670
2169
  warnLoadFailure("domain te-kb", err);
2671
2170
  }
2672
2171
  try {
2673
- const teTeam = await import("./te-team-T2WRLOOD.js");
2172
+ const teTeam = await import("./te-team-5O4UVUWE.js");
2674
2173
  commands.push(...teTeam.default);
2675
2174
  } catch (err) {
2676
2175
  warnLoadFailure("domain te-team", err);
2677
2176
  }
2678
2177
  try {
2679
- const teAgent = await import("./te-agent-WBKIFEQD.js");
2178
+ const teAgent = await import("./te-agent-6RMF7LUV.js");
2680
2179
  commands.push(...teAgent.default);
2681
2180
  } catch (err) {
2682
2181
  warnLoadFailure("domain te-agent", err);
2683
2182
  }
2684
2183
  try {
2685
- const memory = await import("./memory-HHPX3NF2.js");
2184
+ const memory = await import("./memory-WEB27VI6.js");
2686
2185
  commands.push(...memory.default);
2687
2186
  } catch (err) {
2688
2187
  warnLoadFailure("domain memory", err);
2689
2188
  }
2690
- const automation = await import("./automation-NAR5DDGL.js");
2189
+ const automation = await import("./automation-FLCPFMN4.js");
2691
2190
  commands.push(...automation.default);
2692
2191
  try {
2693
- const things = await import("./things-6QOMFXOG.js");
2192
+ const things = await import("./things-TSJ64GBT.js");
2694
2193
  commands.push(...things.default);
2695
2194
  } catch (err) {
2696
2195
  warnLoadFailure("domain things", err);
2697
2196
  }
2698
2197
  try {
2699
- const workspace = await import("./workspace-LYDAP647.js");
2198
+ const workspace = await import("./workspace-FF2HXJGR.js");
2700
2199
  commands.push(...workspace.default);
2701
2200
  } catch (err) {
2702
2201
  warnLoadFailure("domain workspace", err);
2703
2202
  }
2704
2203
  try {
2705
- const teSystem = await import("./te-system-YM657FKO.js");
2204
+ const teSystem = await import("./te-system-AL4B4XZL.js");
2706
2205
  commands.push(...teSystem.default);
2707
2206
  } catch (err) {
2708
2207
  warnLoadFailure("domain te-system", err);
2709
2208
  }
2710
2209
  try {
2711
- const metadata = await import("./metadata-HEQQEEG3.js");
2210
+ const metadata = await import("./metadata-7FYE4234.js");
2712
2211
  commands.push(...metadata.default);
2713
2212
  } catch (err) {
2714
2213
  warnLoadFailure("domain metadata", err);
2715
2214
  }
2716
2215
  try {
2717
- const personalSemanticPreference = await import("./personal-semantic-preference-V4L6ZWR2.js");
2216
+ const personalSemanticPreference = await import("./personal-semantic-preference-O6VXM74A.js");
2718
2217
  commands.push(...personalSemanticPreference.default);
2719
2218
  } catch (err) {
2720
2219
  warnLoadFailure("domain personal-semantic-preference", err);
2721
2220
  }
2722
2221
  try {
2723
- const projectSemantic = await import("./project-semantic-NKHKJX6M.js");
2222
+ const projectSemantic = await import("./project-semantic-2GGFJWW6.js");
2724
2223
  commands.push(...projectSemantic.default);
2725
2224
  } catch (err) {
2726
2225
  warnLoadFailure("domain project-semantic", err);
2727
2226
  }
2728
2227
  try {
2729
- const dataIntegration = await import("./data-integration-6UAZO4GG.js");
2228
+ const dataIntegration = await import("./data-integration-QE37EQ3A.js");
2730
2229
  commands.push(...dataIntegration.default);
2731
2230
  } catch (err) {
2732
2231
  warnLoadFailure("domain data-integration", err);
2733
2232
  }
2734
2233
  try {
2735
- const context = await import("./context-F6FCGTF3.js");
2234
+ const context = await import("./context-YAQG6YQC.js");
2736
2235
  commands.push(...context.default);
2737
2236
  } catch (err) {
2738
2237
  warnLoadFailure("domain context", err);
2739
2238
  }
2740
2239
  try {
2741
- const evaluation = await import("./evaluation-4LO2O4AF.js");
2240
+ const aiMonitor = await import("./ai-monitor-FCXSLHAP.js");
2241
+ commands.push(...aiMonitor.default);
2242
+ } catch (err) {
2243
+ warnLoadFailure("domain ai-monitor", err);
2244
+ }
2245
+ try {
2246
+ const evaluation = await import("./evaluation-2JSF4V47.js");
2742
2247
  commands.push(...evaluation.default);
2743
2248
  } catch (err) {
2744
2249
  warnLoadFailure("domain evaluation", err);
@@ -2747,7 +2252,7 @@ async function loadCommands() {
2747
2252
  }
2748
2253
  async function registerAuthCommands() {
2749
2254
  try {
2750
- const { registerAuth } = await import("./auth-YEIJLBFY.js");
2255
+ const { registerAuth } = await import("./auth-ATK2SLEV.js");
2751
2256
  registerAuth(program);
2752
2257
  } catch (err) {
2753
2258
  warnLoadFailure("auth commands", err);
@@ -2755,7 +2260,7 @@ async function registerAuthCommands() {
2755
2260
  }
2756
2261
  async function registerConfigCommands() {
2757
2262
  try {
2758
- const { registerConfig } = await import("./config-VWVPR4WW.js");
2263
+ const { registerConfig } = await import("./config-U3GDWU6E.js");
2759
2264
  registerConfig(program);
2760
2265
  } catch (err) {
2761
2266
  warnLoadFailure("config commands", err);
@@ -2763,7 +2268,7 @@ async function registerConfigCommands() {
2763
2268
  }
2764
2269
  async function registerCapabilityCommands() {
2765
2270
  try {
2766
- const { registerCapability } = await import("./capability-P7DD4Q73.js");
2271
+ const { registerCapability } = await import("./capability-6KTSOI7L.js");
2767
2272
  registerCapability(program);
2768
2273
  } catch (err) {
2769
2274
  warnLoadFailure("capability commands", err);
@@ -2771,7 +2276,7 @@ async function registerCapabilityCommands() {
2771
2276
  }
2772
2277
  async function registerSyncCommand() {
2773
2278
  try {
2774
- const { registerSync } = await import("./sync-ZJMXCRIN.js");
2279
+ const { registerSync } = await import("./sync-ULBB7WO5.js");
2775
2280
  registerSync(program);
2776
2281
  } catch (err) {
2777
2282
  warnLoadFailure("sync commands", err);
@@ -2779,7 +2284,7 @@ async function registerSyncCommand() {
2779
2284
  }
2780
2285
  async function registerModelCommand() {
2781
2286
  try {
2782
- const { registerModel } = await import("./model-7UHGWYVR.js");
2287
+ const { registerModel } = await import("./model-T7H7Q6BG.js");
2783
2288
  registerModel(program);
2784
2289
  } catch (err) {
2785
2290
  warnLoadFailure("model commands", err);
@@ -2787,7 +2292,7 @@ async function registerModelCommand() {
2787
2292
  }
2788
2293
  async function registerUpdateCommand() {
2789
2294
  try {
2790
- const { registerUpdate } = await import("./update-I4MOUYOX.js");
2295
+ const { registerUpdate } = await import("./update-Q5LURAWV.js");
2791
2296
  registerUpdate(program);
2792
2297
  } catch (err) {
2793
2298
  warnLoadFailure("update commands", err);