@thinkingai/ae-cli 6.1.30 → 6.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/README.md +16 -7
  2. package/README.zh.md +18 -7
  3. package/bin/ai-monitor.js +2 -0
  4. package/bin/runtime-capabilities.json +1 -1
  5. package/dist/ai-monitor-OHTSU6SV.js +33 -0
  6. package/dist/ai-monitor.js +136 -0
  7. package/dist/{auth-ADZHUIJR.js → auth-2MOK4OI6.js} +24 -14
  8. package/dist/{automation-FD2QZUP6.js → automation-6L6IAYRK.js} +6 -7
  9. package/dist/{capability-QXFRJYZD.js → capability-EMIHQJA3.js} +31 -34
  10. package/dist/{chunk-OAWPT7VP.js → chunk-2I5SZ5DS.js} +2 -2
  11. package/dist/{chunk-HRUOV6EQ.js → chunk-4IQYPWCX.js} +22 -21
  12. package/dist/{chunk-EUFP4M2A.js → chunk-7DHSB3FL.js} +85 -33
  13. package/dist/{chunk-4PSTYEG5.js → chunk-AMURHMS3.js} +11 -7
  14. package/dist/{chunk-KPQY44JQ.js → chunk-AWW2T2WL.js} +3 -0
  15. package/dist/chunk-BQFLABJQ.js +186 -0
  16. package/dist/{chunk-E25OSZLJ.js → chunk-COOMXFUG.js} +3 -3
  17. package/dist/{chunk-AVXDJAFC.js → chunk-DWAG2QJM.js} +52 -15
  18. package/dist/{chunk-CG773QXN.js → chunk-E3ONSFUN.js} +528 -299
  19. package/dist/chunk-EFGUBGA6.js +64 -0
  20. package/dist/chunk-EWVEAERM.js +563 -0
  21. package/dist/{chunk-VDICGXCY.js → chunk-HIMOBNEY.js} +2 -2
  22. package/dist/{chunk-JEUXDY3B.js → chunk-HQED4YB4.js} +1 -1
  23. package/dist/{chunk-2F64AZYH.js → chunk-KA5WKR5P.js} +2 -2
  24. package/dist/{chunk-TFORY6WY.js → chunk-KD5UC33N.js} +23 -9
  25. package/dist/{chunk-YVG6QD3V.js → chunk-LFJ7N36I.js} +103 -8
  26. package/dist/chunk-NNK3JBH4.js +60 -0
  27. package/dist/{chunk-YULUBP3R.js → chunk-O45NOIWR.js} +2 -2
  28. package/dist/{chunk-SOSFRU3O.js → chunk-PLNS5J33.js} +58 -26
  29. package/dist/chunk-PUSFEC6B.js +29 -0
  30. package/dist/{chunk-Z3Q2AEIN.js → chunk-R2SVAO4G.js} +14 -2
  31. package/dist/{chunk-Y3AM6LIO.js → chunk-RC3PPCYD.js} +16 -11
  32. package/dist/{chunk-AWVZTN2B.js → chunk-THTROEGD.js} +1 -1
  33. package/dist/{chunk-QVRIDN42.js → chunk-UCMO4LKL.js} +2 -2
  34. package/dist/{chunk-JSBLCLFE.js → chunk-VLOGOM7N.js} +13 -7
  35. package/dist/{chunk-72NJKS7O.js → chunk-XZDKAR4N.js} +4 -4
  36. package/dist/chunk-YE6MJB5V.js +1285 -0
  37. package/dist/{community-report-client-TJVCLZ3K.js → community-report-client-ULRNXLQV.js} +1 -1
  38. package/dist/{compat-check-HERBTQZN.js → compat-check-CADG7GND.js} +5 -4
  39. package/dist/{config-E3KANXMK.js → config-PFD3KWQG.js} +28 -14
  40. package/dist/{context-CDB5H5PD.js → context-SOQDFZIB.js} +8 -6
  41. package/dist/{data-integration-QE37EQ3A.js → data-integration-UNJ7EPW2.js} +6 -6
  42. package/dist/{evaluation-LR4YDYWL.js → evaluation-Q3AIGFOG.js} +14 -159
  43. package/dist/index.js +95 -593
  44. package/dist/{local-data-upload-client-KCMG6J62.js → local-data-upload-client-YTWMAAGE.js} +1 -1
  45. package/dist/{memory-SNFR5M23.js → memory-HKNGUIPK.js} +6 -7
  46. package/dist/{metadata-EXQYDZTH.js → metadata-GFWR5ZHC.js} +11 -10
  47. package/dist/{model-KEVCEXWD.js → model-NAKQWK4W.js} +4 -5
  48. package/dist/{personal-semantic-preference-ETY3KU2O.js → personal-semantic-preference-JCTKXLC3.js} +46 -15
  49. package/dist/{project-semantic-UHRMVOJF.js → project-semantic-B2NWQOKK.js} +19 -16
  50. package/dist/{sync-XKEBXESC.js → sync-UQH4J4BD.js} +9 -9
  51. package/dist/{te-agent-S6UQR4IE.js → te-agent-L6EYFQCC.js} +303 -17
  52. package/dist/{te-analysis-WOFFCIBC.js → te-analysis-U7NNOY66.js} +397 -203
  53. package/dist/{te-community-R7B6QYOO.js → te-community-3UQEW3KD.js} +14 -12
  54. package/dist/{te-dataops-KPILYVHA.js → te-dataops-SUNYXF5G.js} +13 -11
  55. package/dist/{te-engage-IAUM6ONX.js → te-engage-KMXZJ2KN.js} +10 -9
  56. package/dist/{te-experiment-TMLRA7B3.js → te-experiment-IEYKP6VC.js} +477 -45
  57. package/dist/{te-kb-GKWPSLSY.js → te-kb-MT3V5ZMH.js} +78 -18
  58. package/dist/{te-system-CYWSK3UN.js → te-system-F4ZU2HRQ.js} +6 -7
  59. package/dist/{te-team-ISN52YNG.js → te-team-M6E6XQ5H.js} +9 -8
  60. package/dist/{things-DDQ52Z3Q.js → things-FRLBZV2Z.js} +9 -8
  61. package/dist/{update-CTLNTX35.js → update-NULYHVE6.js} +8 -6
  62. package/dist/{workspace-2CKQX2XL.js → workspace-Z7L33OBQ.js} +6 -7
  63. package/package.json +13 -8
  64. package/skills/ae-agent/SKILL.md +19 -5
  65. package/skills/ae-agent/references/a2a.md +103 -0
  66. package/skills/ae-agent/references/command_index.md +11 -0
  67. package/skills/ae-ai-monitor/SKILL.md +179 -0
  68. package/skills/ae-ai-monitor/references/read-commands.md +866 -0
  69. package/skills/ae-analysis/SKILL.md +43 -25
  70. package/skills/ae-analysis/references/adhoc_export.md +3 -1
  71. package/skills/ae-analysis/references/ai_models/path.md +5 -6
  72. package/skills/ae-analysis/references/ai_models.md +1 -0
  73. package/skills/ae-analysis/references/analysis_data_retrieval.md +1 -1
  74. package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -0
  75. package/skills/ae-analysis/references/asset_authentication_export.md +1 -1
  76. package/skills/ae-analysis/references/asset_authentication_update.md +6 -2
  77. package/skills/ae-analysis/references/asset_search.md +1 -1
  78. package/skills/ae-analysis/references/bad_case_begin.md +12 -0
  79. package/skills/ae-analysis/references/bad_case_get.md +12 -0
  80. package/skills/ae-analysis/references/bad_case_history.md +12 -0
  81. package/skills/ae-analysis/references/bad_case_list.md +12 -0
  82. package/skills/ae-analysis/references/bad_case_review.md +51 -0
  83. package/skills/ae-analysis/references/bad_case_run.md +12 -0
  84. package/skills/ae-analysis/references/bad_case_submit.md +12 -0
  85. package/skills/ae-analysis/references/bad_case_submit_to_page.md +12 -0
  86. package/skills/ae-analysis/references/bad_case_sync_evaluation.md +11 -0
  87. package/skills/ae-analysis/references/bi_panel_list.md +1 -1
  88. package/skills/ae-analysis/references/bi_panel_share.md +3 -1
  89. package/skills/ae-analysis/references/catalog_list.md +2 -0
  90. package/skills/ae-analysis/references/command_index.md +44 -35
  91. package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
  92. package/skills/ae-analysis/references/dashboard_handover.md +3 -1
  93. package/skills/ae-analysis/references/dashboard_list.md +3 -3
  94. package/skills/ae-analysis/references/dashboard_report_data_export.md +1 -1
  95. package/skills/ae-analysis/references/dashboard_share.md +3 -1
  96. package/skills/ae-analysis/references/dashboard_update.md +3 -2
  97. package/skills/ae-analysis/references/filter_value_list.md +2 -0
  98. package/skills/ae-analysis/references/folder_share.md +8 -2
  99. package/skills/ae-analysis/references/governance_recommendation_export.md +2 -2
  100. package/skills/ae-analysis/references/governance_recommendation_run_update.md +3 -1
  101. package/skills/ae-analysis/references/personal_semantic_preference_add.md +9 -1
  102. package/skills/ae-analysis/references/personal_semantic_preference_delete.md +2 -0
  103. package/skills/ae-analysis/references/personal_semantic_preference_get.md +2 -0
  104. package/skills/ae-analysis/references/personal_semantic_preference_list.md +10 -2
  105. package/skills/ae-analysis/references/personal_semantic_preference_update.md +8 -0
  106. package/skills/ae-analysis/references/project_data_power_upsert.md +3 -1
  107. package/skills/ae-analysis/references/project_mark_time_create.md +2 -0
  108. package/skills/ae-analysis/references/project_mark_time_update.md +2 -0
  109. package/skills/ae-analysis/references/project_member_add.md +3 -1
  110. package/skills/ae-analysis/references/project_member_batch_update.md +3 -1
  111. package/skills/ae-analysis/references/project_member_handover_run.md +3 -1
  112. package/skills/ae-analysis/references/project_member_update.md +3 -1
  113. package/skills/ae-analysis/references/project_owner_update.md +8 -2
  114. package/skills/ae-analysis/references/project_role_upsert.md +5 -3
  115. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +16 -1
  116. package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +14 -1
  117. package/skills/ae-analysis/references/project_space_share.md +8 -2
  118. package/skills/ae-analysis/references/property_get.md +2 -0
  119. package/skills/ae-analysis/references/public_link_list.md +3 -1
  120. package/skills/ae-analysis/references/query_cancel.md +4 -1
  121. package/skills/ae-analysis/references/report_data_run.md +1 -1
  122. package/skills/ae-analysis/references/report_list.md +3 -3
  123. package/skills/ae-analysis/references/scenario_append.md +2 -2
  124. package/skills/ae-analysis/references/scenario_collect.md +15 -4
  125. package/skills/ae-analysis/references/scenario_evaluation.md +17 -1
  126. package/skills/ae-analysis/references/scenario_list.md +7 -7
  127. package/skills/ae-analysis/references/system_oauth2_update.md +3 -1
  128. package/skills/ae-analysis/references/system_third_party_login_upsert.md +4 -2
  129. package/skills/ae-analysis/references/user_tag_create.md +4 -1
  130. package/skills/ae-analysis/references/user_tag_get.md +2 -0
  131. package/skills/ae-analysis/references/user_tag_models.md +8 -2
  132. package/skills/ae-analysis/references/user_tag_update.md +5 -2
  133. package/skills/ae-analysis/references/virtual_property_create.md +12 -1
  134. package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +10 -0
  135. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +55 -13
  136. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +2 -2
  137. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +2 -2
  138. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +7 -1
  139. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/wait-compile-run.mjs +79 -0
  140. package/skills/ae-automation/SKILL.md +4 -2
  141. package/skills/ae-capability/SKILL.md +16 -8
  142. package/skills/ae-community/SKILL.md +1 -0
  143. package/skills/ae-dataops/SKILL.md +1 -0
  144. package/skills/ae-engage/SKILL.md +1 -0
  145. package/skills/ae-evaluation/SKILL.md +17 -2
  146. package/skills/ae-experiment/SKILL.md +69 -13
  147. package/skills/ae-experiment/references/experiment_approval.md +229 -0
  148. package/skills/ae-experiment/references/manage_experiment.md +15 -2
  149. package/skills/ae-experiment/references/manage_traffic_domains.md +131 -0
  150. package/skills/ae-experiment/references/query_experiment_detail.md +8 -0
  151. package/skills/ae-experiment/references/query_experiment_list.md +6 -0
  152. package/skills/ae-experiment/references/save_experiment.md +56 -10
  153. package/skills/ae-experiment/references/save_metric.md +29 -2
  154. package/skills/ae-experiment/references/save_submit_experiment.md +22 -3
  155. package/skills/ae-experiment/references/save_submit_external_experiment.md +59 -3
  156. package/skills/ae-experiment/references/save_traffic_layer.md +17 -1
  157. package/skills/ae-generate-tracking-plan/SKILL.md +5 -0
  158. package/skills/ae-kb/SKILL.md +8 -4
  159. package/skills/ae-kb/references/analysis-workflow.md +11 -2
  160. package/skills/ae-kb/references/publication.md +45 -0
  161. package/skills/ae-kb/references/query-workflow.md +3 -1
  162. package/skills/ae-kb/references/versions.md +1 -1
  163. package/skills/ae-metadata/SKILL.md +1 -0
  164. package/skills/ae-migrate-tracking-code/SKILL.md +2 -1
  165. package/skills/ae-team/SKILL.md +1 -1
  166. package/skills/ae-tracking-matrix/SKILL.md +170 -0
  167. package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
  168. package/skills/ae-tracking-matrix/i18n.yaml +12 -0
  169. package/skills/ae-tracking-matrix/references/ae-capabilities.md +93 -0
  170. package/skills/ae-tracking-matrix/references/business-semantic-checks.md +30 -0
  171. package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +256 -0
  172. package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +213 -0
  173. package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +407 -0
  174. package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +218 -0
  175. package/skills/ae-tracking-matrix/references/categories/casual_music.md +112 -0
  176. package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +301 -0
  177. package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +356 -0
  178. package/skills/ae-tracking-matrix/references/categories/fishing.md +775 -0
  179. package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +89 -0
  180. package/skills/ae-tracking-matrix/references/categories/idle_card.md +27 -0
  181. package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +415 -0
  182. package/skills/ae-tracking-matrix/references/categories/interactive_video.md +133 -0
  183. package/skills/ae-tracking-matrix/references/categories/merge.md +639 -0
  184. package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +406 -0
  185. package/skills/ae-tracking-matrix/references/categories/mmo_web.md +230 -0
  186. package/skills/ae-tracking-matrix/references/categories/music.md +137 -0
  187. package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +414 -0
  188. package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +199 -0
  189. package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +158 -0
  190. package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +546 -0
  191. package/skills/ae-tracking-matrix/references/categories/rpg.md +195 -0
  192. package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +115 -0
  193. package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +151 -0
  194. package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +260 -0
  195. package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +232 -0
  196. package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +359 -0
  197. package/skills/ae-tracking-matrix/references/categories/tower_defense.md +365 -0
  198. package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +211 -0
  199. package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +132 -0
  200. package/skills/ae-tracking-matrix/references/category-registry.md +77 -0
  201. package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +230 -0
  202. package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +406 -0
  203. package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +128 -0
  204. package/skills/ae-tracking-matrix/references/eval-cases.md +74 -0
  205. package/skills/ae-tracking-matrix/references/naming-dict.md +238 -0
  206. package/skills/ae-tracking-matrix/references/optimization-checklist.md +85 -0
  207. package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +142 -0
  208. package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +47 -0
  209. package/skills/ae-tracking-matrix/references/plan-generation/reference.md +794 -0
  210. package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +94 -0
  211. package/skills/ae-tracking-matrix/references/scene-routing.md +80 -0
  212. package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +3787 -0
  213. package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +827 -0
  214. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +655 -0
  215. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +953 -0
  216. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +1128 -0
  217. package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +714 -0
  218. package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +1268 -0
  219. package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +776 -0
  220. package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +182 -0
  221. package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +2755 -0
  222. package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +1182 -0
  223. package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +1300 -0
  224. package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +1369 -0
  225. package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +1692 -0
  226. package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +902 -0
  227. package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +763 -0
  228. package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +1107 -0
  229. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +1532 -0
  230. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +845 -0
  231. package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +228 -0
  232. package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +149 -0
  233. package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +407 -0
  234. package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +163 -0
  235. package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +149 -0
  236. package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +153 -0
  237. package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +232 -0
  238. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +314 -0
  239. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +117 -0
  240. package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +148 -0
  241. package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +645 -0
  242. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +307 -0
  243. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +347 -0
  244. package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +72 -0
  245. package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +264 -0
  246. package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +566 -0
  247. package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +409 -0
  248. package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +446 -0
  249. package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +557 -0
  250. package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +457 -0
  251. package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +490 -0
  252. package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +523 -0
  253. package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +484 -0
  254. package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +442 -0
  255. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +391 -0
  256. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +91 -0
  257. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +635 -0
  258. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +113 -0
  259. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +466 -0
  260. package/skills/ae-tracking-matrix/references/standard-base/README.md +22 -0
  261. package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +174 -0
  262. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +20 -0
  263. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +7 -0
  264. package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +14 -0
  265. package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +370 -0
  266. package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +47 -0
  267. package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +37 -0
  268. package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +27 -0
  269. package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +23 -0
  270. package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +14 -0
  271. package/skills/ae-tracking-matrix/references/standard-base/user_data.md +46 -0
  272. package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +13 -0
  273. package/skills/ae-tracking-matrix/references/system-fields.md +297 -0
  274. package/skills/ae-tracking-matrix/references/te-field-translations.md +1791 -0
  275. package/skills/ae-tracking-matrix/references/workflows/data-verification.md +232 -0
  276. package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +829 -0
  277. package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +355 -0
  278. package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +283 -0
  279. package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +168 -0
  280. package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +205 -0
  281. package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +75 -0
  282. package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +36 -0
  283. package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +107 -0
  284. package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +114 -0
  285. package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +53 -0
  286. package/skills/ae-tracking-matrix/scripts/finalize_plan.py +166 -0
  287. package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +674 -0
  288. package/skills/ae-tracking-matrix/scripts/plan_contract.py +200 -0
  289. package/skills/ae-tracking-matrix/scripts/plan_types.py +60 -0
  290. package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +169 -0
  291. package/skills/ae-tracking-matrix/scripts/sync_plan.py +296 -0
  292. package/skills/ae-tracking-matrix/scripts/upload_plan.py +340 -0
  293. package/dist/chunk-AMBFK2K3.js +0 -28
  294. package/dist/chunk-Y74WTIKJ.js +0 -10
@@ -1,22 +1,23 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
+ resolveHost
4
+ } from "./chunk-KA5WKR5P.js";
5
+ import {
6
+ confirmHighRiskWrite,
3
7
  normalizeRiskLevel,
4
8
  requiresConfirmation
5
- } from "./chunk-AMBFK2K3.js";
6
- import {
7
- resolveHost
8
- } from "./chunk-2F64AZYH.js";
9
+ } from "./chunk-EFGUBGA6.js";
9
10
  import {
10
11
  findGatewayDomain,
11
12
  listCapabilityDiscoveryPrefixes,
12
13
  listRegisteredCapabilityDomains,
13
14
  resolveGatewayDomain
14
- } from "./chunk-KPQY44JQ.js";
15
+ } from "./chunk-AWW2T2WL.js";
15
16
  import {
16
17
  printError,
17
18
  printOutput,
18
19
  withOutputMetadata
19
- } from "./chunk-YULUBP3R.js";
20
+ } from "./chunk-O45NOIWR.js";
20
21
  import {
21
22
  CapabilityGatewayError,
22
23
  dryRunCapabilityWithEnvelope,
@@ -25,29 +26,27 @@ import {
25
26
  inspectCapabilityWithEnvelope,
26
27
  listCapabilitiesWithEnvelope,
27
28
  validateCapabilityWithEnvelope
28
- } from "./chunk-HRUOV6EQ.js";
29
- import "./chunk-Y74WTIKJ.js";
29
+ } from "./chunk-4IQYPWCX.js";
30
+ import "./chunk-NNK3JBH4.js";
30
31
  import {
31
32
  assertBusinessEnabled,
32
33
  businessForCapability,
33
34
  readBusinessConfigForExecution,
34
35
  readCurrentBusinessConfig
35
- } from "./chunk-CG773QXN.js";
36
+ } from "./chunk-E3ONSFUN.js";
37
+ import "./chunk-PUSFEC6B.js";
36
38
  import {
37
39
  CredentialStoreUnreadableError,
38
40
  SecureStoreAuthError
39
- } from "./chunk-SOSFRU3O.js";
41
+ } from "./chunk-PLNS5J33.js";
40
42
  import {
41
43
  parseJsonRequest
42
- } from "./chunk-4PSTYEG5.js";
44
+ } from "./chunk-AMURHMS3.js";
43
45
  import {
44
46
  CliValidationError,
45
47
  ExternalCliTokenError,
46
48
  PermissionError
47
- } from "./chunk-Z3Q2AEIN.js";
48
-
49
- // src/commands/capability/index.ts
50
- import * as readline from "readline";
49
+ } from "./chunk-R2SVAO4G.js";
51
50
 
52
51
  // src/commands/capability/helpers.ts
53
52
  import { readFileSync } from "fs";
@@ -212,7 +211,7 @@ function registerCapability(program) {
212
211
  capability.command("list").description("List capability summaries in a domain").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").option("--project-id <project-id>", "Filter by project membership, permissions, and enabled features").action(async (opts) => {
213
212
  await executeAndPrint(program, async (host) => {
214
213
  const business = businessForCapability(opts.domain);
215
- const businesses = business ? await readBusinessConfigForExecution(host) : readCurrentBusinessConfig(host);
214
+ const businesses = business ? await readBusinessConfigForExecution(host, !program.opts().host) : readCurrentBusinessConfig(host);
216
215
  const gatewayDomain = resolveCapabilityListDomain(opts.domain, businesses);
217
216
  const projectId = parseOptionalProjectId(opts.projectId);
218
217
  if (business && businesses[business] === false) {
@@ -239,7 +238,7 @@ function registerCapability(program) {
239
238
  ).option("--project-id <project-id>", "Filter by project membership, permissions, and enabled features").action(async (query, opts) => {
240
239
  await executeAndPrint(program, async (host) => {
241
240
  const business = businessForCapability(opts.domain);
242
- const businesses = business ? await readBusinessConfigForExecution(host) : readCurrentBusinessConfig(host);
241
+ const businesses = business ? await readBusinessConfigForExecution(host, !program.opts().host) : readCurrentBusinessConfig(host);
243
242
  const gatewayDomain = resolveCapabilityListDomain(opts.domain, businesses);
244
243
  const projectId = parseOptionalProjectId(opts.projectId);
245
244
  if (business && businesses[business] === false) {
@@ -264,7 +263,7 @@ function registerCapability(program) {
264
263
  capability.command("inspect").description("Inspect one capability schema, risk, auth, and output metadata").argument("<capability-id>", "Capability ID, such as analysis.report.list").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--project-id <project-id>", "Check availability in a project before returning metadata").action(async (capabilityId, opts) => {
265
264
  await executeAndPrint(program, async (host) => {
266
265
  assertCapabilityIsNotRetired(capabilityId);
267
- await assertCapabilityBusinessEnabled(capabilityId, host);
266
+ await assertCapabilityBusinessEnabled(capabilityId, host, program.opts().host);
268
267
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
269
268
  return gatewayOutput(await inspectCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseOptionalProjectId(opts.projectId)), host);
270
269
  });
@@ -277,7 +276,7 @@ function registerCapability(program) {
277
276
  ).argument("<capability-id>", "Capability ID, such as metadata.data_table.sql_write").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--input <json-or-path>", "Input JSON object, file path, @<path>, or - for stdin").action(async (capabilityId, opts) => {
278
277
  await executeAndPrint(program, async (host) => {
279
278
  assertCapabilityIsNotRetired(capabilityId);
280
- await assertCapabilityBusinessEnabled(capabilityId, host);
279
+ await assertCapabilityBusinessEnabled(capabilityId, host, program.opts().host);
281
280
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
282
281
  return gatewayOutput(await validateCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseCapabilityInput(opts.input)), host);
283
282
  });
@@ -301,7 +300,7 @@ Examples:
301
300
  ).argument("<capability-id>", "Capability ID, such as analysis.query.export").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--input <json-or-path>", "Input JSON object, file path, @<path>, or - for stdin").action(async (capabilityId, opts) => {
302
301
  await executeAndPrint(program, async (host) => {
303
302
  assertCapabilityIsNotRetired(capabilityId);
304
- await assertCapabilityBusinessEnabled(capabilityId, host);
303
+ await assertCapabilityBusinessEnabled(capabilityId, host, program.opts().host);
305
304
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
306
305
  return gatewayOutput(await dryRunCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseCapabilityInput(opts.input)), host);
307
306
  });
@@ -315,7 +314,7 @@ Examples:
315
314
  capability.command("run").description("Execute one capability by ID").argument("<capability-id>", "Capability ID, such as analysis.report.list").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--input <json-or-path>", "Input JSON object, file path, @<path>, or - for stdin").action(async (capabilityId, opts) => {
316
315
  await executeAndPrint(program, async (host, globalOpts) => {
317
316
  assertCapabilityIsNotRetired(capabilityId);
318
- await assertCapabilityBusinessEnabled(capabilityId, host);
317
+ await assertCapabilityBusinessEnabled(capabilityId, host, program.opts().host);
319
318
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
320
319
  const input = parseCapabilityInput(opts.input);
321
320
  if (globalOpts.validate && globalOpts.dryRun) {
@@ -334,7 +333,7 @@ Examples:
334
333
  const metadata = await inspectCapability(host, gatewayDomain, capabilityId);
335
334
  const risk = normalizeRiskLevel(typeof metadata?.risk === "string" ? metadata.risk : void 0);
336
335
  if (requiresConfirmation(risk)) {
337
- const confirmed = await confirm(`This capability is marked ${risk} (${capabilityId}). Continue?`);
336
+ const confirmed = await confirmHighRiskWrite(`This capability is marked ${risk} (${capabilityId}). Continue?`);
338
337
  if (!confirmed) {
339
338
  process.stderr.write("Aborted.\n");
340
339
  return void 0;
@@ -351,8 +350,8 @@ Examples:
351
350
  ae-cli capability run analysis.dashboard.list --input input.json`
352
351
  );
353
352
  }
354
- async function assertCapabilityBusinessEnabled(capabilityId, host) {
355
- await assertBusinessEnabled(businessForCapability(capabilityId), host);
353
+ async function assertCapabilityBusinessEnabled(capabilityId, host, hostOverride) {
354
+ await assertBusinessEnabled(businessForCapability(capabilityId), host, !hostOverride);
356
355
  }
357
356
  function gatewayOutput(envelope, host) {
358
357
  return withOutputMetadata(withPageUrl(envelope.data, host), envelope.meta);
@@ -406,7 +405,14 @@ function printCapabilityError(error, host) {
406
405
  return;
407
406
  }
408
407
  if (error instanceof PermissionError) {
409
- printError("permission", error.message, error.hint, error.code);
408
+ printError(
409
+ "permission",
410
+ error.message,
411
+ error.hint,
412
+ error.code,
413
+ withPageUrl(error.meta, host),
414
+ { details: error.details }
415
+ );
410
416
  return;
411
417
  }
412
418
  if (error instanceof CapabilityGatewayError) {
@@ -416,15 +422,6 @@ function printCapabilityError(error, host) {
416
422
  const message = error instanceof Error ? error.message : String(error);
417
423
  printError("api", message);
418
424
  }
419
- async function confirm(message) {
420
- const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
421
- return new Promise((resolve) => {
422
- rl.question(`${message} [y/N] `, (answer) => {
423
- rl.close();
424
- resolve(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
425
- });
426
- });
427
- }
428
425
  export {
429
426
  registerCapability
430
427
  };
@@ -5,14 +5,14 @@ import {
5
5
  require_node,
6
6
  require_process_nextick_args,
7
7
  require_util
8
- } from "./chunk-JEUXDY3B.js";
8
+ } from "./chunk-HQED4YB4.js";
9
9
  import {
10
10
  __commonJS,
11
11
  __esm,
12
12
  __export,
13
13
  __require,
14
14
  __toCommonJS
15
- } from "./chunk-Z3Q2AEIN.js";
15
+ } from "./chunk-R2SVAO4G.js";
16
16
 
17
17
  // node_modules/readdir-glob/node_modules/minimatch/lib/path.js
18
18
  var require_path = __commonJS({
@@ -1,20 +1,21 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
- internalCallSourceHeaders
4
- } from "./chunk-Y74WTIKJ.js";
3
+ sourceLoggedFetch
4
+ } from "./chunk-NNK3JBH4.js";
5
5
  import {
6
6
  SecureStoreAuthError,
7
7
  clearCliTokenCache,
8
- getCliToken
9
- } from "./chunk-SOSFRU3O.js";
8
+ getCliToken,
9
+ internalCallSourceHeaders
10
+ } from "./chunk-PLNS5J33.js";
10
11
  import {
11
12
  safeJsonParse,
12
13
  stringifyJsonRequest
13
- } from "./chunk-4PSTYEG5.js";
14
+ } from "./chunk-AMURHMS3.js";
14
15
  import {
15
16
  PermissionError,
16
17
  externalCliTokenRequestOptions
17
- } from "./chunk-Z3Q2AEIN.js";
18
+ } from "./chunk-R2SVAO4G.js";
18
19
 
19
20
  // src/core/cli-agent-context.ts
20
21
  import { readFileSync, statSync } from "fs";
@@ -285,7 +286,7 @@ function buildCapabilityGatewayUrl(host, domain, pathAfterV1, queryParams = {},
285
286
  const base = host.replace(/\/+$/, "");
286
287
  const cleanDomain = domain.replace(/^\/+|\/+$/g, "");
287
288
  const cleanPath = pathAfterV1.replace(/^\/+|\/+$/g, "");
288
- const gatewayPrefix = cleanDomain === "" ? `/api/cli/${apiVersion}` : `/api/cli/${cleanDomain}/${apiVersion}`;
289
+ const gatewayPrefix = cleanDomain === "ai-monitor" ? "/ai-monitor/api/cli/v1" : cleanDomain === "" ? `/api/cli/${apiVersion}` : `/api/cli/${cleanDomain}/${apiVersion}`;
289
290
  const url = new URL(`${base}${gatewayPrefix}/${cleanPath}`);
290
291
  for (const [key, value] of Object.entries(queryParams)) {
291
292
  if (value !== void 0 && value !== null) {
@@ -426,7 +427,7 @@ async function throwCapabilityHttpError(resp) {
426
427
  }
427
428
  throw error;
428
429
  }
429
- async function requestOnce(url, method, token, body, accept = "application/json", includeClientContextInBody = true) {
430
+ async function requestOnce(url, method, token, body, accept = "application/json", includeClientContextInBody = true, signal) {
430
431
  const agentContext = readCliAgentContext();
431
432
  const headers = {
432
433
  "cli-token": token,
@@ -439,10 +440,10 @@ async function requestOnce(url, method, token, body, accept = "application/json"
439
440
  headers["Content-Type"] = "application/json";
440
441
  init.body = stringifyJsonRequest(includeClientContextInBody ? withCliAgentContextBody(body, agentContext) : body);
441
442
  }
442
- return fetch(url, { ...init, ...externalCliTokenRequestOptions(url) });
443
+ return sourceLoggedFetch(url, { ...init, ...externalCliTokenRequestOptions(url), signal });
443
444
  }
444
445
  async function requestMultipartOnce(url, token, form) {
445
- return fetch(url, {
446
+ return sourceLoggedFetch(url, {
446
447
  method: "POST",
447
448
  ...externalCliTokenRequestOptions(url),
448
449
  headers: {
@@ -458,12 +459,12 @@ async function callGateway(host, domain, pathAfterV1, method, body, queryParams
458
459
  }
459
460
  async function callGatewayWithEnvelope(host, domain, pathAfterV1, method, body, queryParams = {}, options = {}) {
460
461
  const url = buildCapabilityGatewayUrl(options.apiBaseUrl ?? host, domain, pathAfterV1, queryParams, options.apiVersion);
461
- const token = await getCliToken(host);
462
- let resp = await requestOnce(url, method, token, body, "application/json", options.includeClientContextInBody);
462
+ const token = await getCliToken(host, options.signal);
463
+ let resp = await requestOnce(url, method, token, body, "application/json", options.includeClientContextInBody, options.signal);
463
464
  if (resp.status === 401 && options.retryOnUnauthorized === true) {
464
465
  await resp.body?.cancel();
465
466
  clearCliTokenCache(host);
466
- resp = await requestOnce(url, method, await getCliToken(host), body, "application/json", options.includeClientContextInBody);
467
+ resp = await requestOnce(url, method, await getCliToken(host, options.signal), body, "application/json", options.includeClientContextInBody, options.signal);
467
468
  }
468
469
  if (resp.status === 403) {
469
470
  const error = await permissionError(resp);
@@ -482,10 +483,10 @@ async function callGatewayWithEnvelope(host, domain, pathAfterV1, method, body,
482
483
  isCommunityGatewayRequest(domain, pathAfterV1)
483
484
  );
484
485
  }
485
- async function fetchCapabilityGateway(host, domain, pathAfterV1, method = "GET", body, accept = "application/json") {
486
- const url = buildCapabilityGatewayUrl(host, domain, pathAfterV1);
487
- const token = await getCliToken(host);
488
- const resp = await requestOnce(url, method, token, body, accept);
486
+ async function fetchCapabilityGateway(host, domain, pathAfterV1, method = "GET", body, accept = "application/json", options = {}) {
487
+ const url = buildCapabilityGatewayUrl(options.apiBaseUrl ?? host, domain, pathAfterV1, {}, options.apiVersion);
488
+ const token = await getCliToken(host, options.signal);
489
+ const resp = await requestOnce(url, method, token, body, accept, options.includeClientContextInBody, options.signal);
489
490
  if (resp.status === 403) {
490
491
  const error = await permissionError(resp);
491
492
  if (isInvalidCliTokenMessage(error.message)) {
@@ -498,15 +499,15 @@ async function fetchCapabilityGateway(host, domain, pathAfterV1, method = "GET",
498
499
  }
499
500
  return resp;
500
501
  }
501
- async function requestCapabilityGateway(host, domain, pathAfterV1, method = "GET", body) {
502
- const resp = await fetchCapabilityGateway(host, domain, pathAfterV1, method, body);
502
+ async function requestCapabilityGateway(host, domain, pathAfterV1, method = "GET", body, options = {}) {
503
+ const resp = await fetchCapabilityGateway(host, domain, pathAfterV1, method, body, "application/json", options);
503
504
  return unwrapCapabilityEnvelope(
504
505
  parseCapabilityResponse(await resp.text()),
505
506
  isCommunityGatewayRequest(domain, pathAfterV1)
506
507
  );
507
508
  }
508
- async function requestCapabilityGatewayWithEnvelope(host, domain, pathAfterV1, method = "GET", body) {
509
- const resp = await fetchCapabilityGateway(host, domain, pathAfterV1, method, body);
509
+ async function requestCapabilityGatewayWithEnvelope(host, domain, pathAfterV1, method = "GET", body, options = {}) {
510
+ const resp = await fetchCapabilityGateway(host, domain, pathAfterV1, method, body, "application/json", options);
510
511
  return parseCapabilityEnvelope(
511
512
  parseCapabilityResponse(await resp.text()),
512
513
  isCommunityGatewayRequest(domain, pathAfterV1)
@@ -1,20 +1,20 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  resolveGatewayDomain
4
- } from "./chunk-KPQY44JQ.js";
4
+ } from "./chunk-AWW2T2WL.js";
5
5
  import {
6
6
  readOutputMetadata,
7
7
  unwrapOutputData,
8
8
  withOutputMetadata
9
- } from "./chunk-YULUBP3R.js";
9
+ } from "./chunk-O45NOIWR.js";
10
10
  import {
11
11
  CapabilityGatewayError,
12
12
  fetchCapabilityGateway,
13
13
  requestCapabilityGateway
14
- } from "./chunk-HRUOV6EQ.js";
14
+ } from "./chunk-4IQYPWCX.js";
15
15
  import {
16
16
  PermissionError
17
- } from "./chunk-Z3Q2AEIN.js";
17
+ } from "./chunk-R2SVAO4G.js";
18
18
 
19
19
  // src/core/analysis-async-artifact.ts
20
20
  import { randomBytes } from "crypto";
@@ -141,16 +141,59 @@ async function waitForAnalysisRun(host, runId, options = {}) {
141
141
  let lastState = "";
142
142
  let materializationStartedAt;
143
143
  let descriptor = options.initialDescriptor;
144
+ let lastDescriptor = descriptor;
145
+ const lifecycleDeadline = () => materializationStartedAt === void 0 ? deadline : Math.min(deadline, materializationStartedAt + MATERIALIZATION_GRACE_MS);
146
+ const checkWaitBoundary = () => {
147
+ throwIfAborted(options.signal, runId);
148
+ if (now() < Math.min(clientDeadline, lifecycleDeadline())) return;
149
+ if (clientDeadline <= lifecycleDeadline()) {
150
+ throw waitError(
151
+ `Stopped waiting after ${waitTimeoutSeconds} seconds for run ${runId}. The remote run was not canceled.`,
152
+ "ASYNC_WAIT_TIMEOUT",
153
+ runId,
154
+ void 0,
155
+ lastDescriptor,
156
+ { wait_timeout_seconds: waitTimeoutSeconds }
157
+ );
158
+ }
159
+ throw waitError(
160
+ `Stopped waiting because the server-declared deadline for run ${runId} was reached. The remote run was not canceled.`,
161
+ "ASYNC_WAIT_DEADLINE_REACHED",
162
+ runId,
163
+ void 0,
164
+ lastDescriptor
165
+ );
166
+ };
144
167
  while (true) {
145
168
  throwIfAborted(options.signal, runId);
146
169
  if (descriptor !== void 0 && descriptorRunStatus(descriptor) === void 0) {
147
170
  descriptor = void 0;
148
171
  }
149
172
  if (descriptor === void 0) {
173
+ checkWaitBoundary();
174
+ const controller = new AbortController();
175
+ const onAbort = () => controller.abort(options.signal?.reason);
176
+ options.signal?.addEventListener("abort", onAbort, { once: true });
177
+ if (options.signal?.aborted) onAbort();
178
+ const signal = controller.signal;
179
+ const timer = setTimeout(() => controller.abort(), Math.max(1, Math.ceil(Math.min(clientDeadline, lifecycleDeadline()) - now())));
150
180
  try {
151
- descriptor = asDescriptor(await inspect(host, runId));
181
+ descriptor = asDescriptor(await abortableRequest(inspect(host, runId, signal), signal));
182
+ checkWaitBoundary();
183
+ lastDescriptor = descriptor;
152
184
  transientFailures = 0;
153
185
  } catch (error) {
186
+ checkWaitBoundary();
187
+ if (controller.signal.aborted) {
188
+ throw waitError(
189
+ "The local inspect wait ended. The remote run was not canceled.",
190
+ clientDeadline <= lifecycleDeadline() ? "ASYNC_WAIT_TIMEOUT" : "ASYNC_WAIT_DEADLINE_REACHED",
191
+ runId,
192
+ error,
193
+ lastDescriptor,
194
+ clientDeadline <= lifecycleDeadline() ? { wait_timeout_seconds: waitTimeoutSeconds } : {}
195
+ );
196
+ }
154
197
  if (error instanceof PermissionError) throw error;
155
198
  if (error instanceof CapabilityGatewayError && error.httpStatus === 404) {
156
199
  throw new CapabilityGatewayError(
@@ -169,9 +212,13 @@ async function waitForAnalysisRun(host, runId, options = {}) {
169
212
  error
170
213
  );
171
214
  }
172
- await sleep(delayMs, options.signal);
215
+ await sleep(Math.min(delayMs, Math.max(0, Math.min(clientDeadline, lifecycleDeadline()) - now())), options.signal);
216
+ checkWaitBoundary();
173
217
  delayMs = nextDelay(delayMs);
174
218
  continue;
219
+ } finally {
220
+ clearTimeout(timer);
221
+ options.signal?.removeEventListener("abort", onAbort);
175
222
  }
176
223
  }
177
224
  deadline = Math.min(deadline, deriveDeadline(descriptor, startedAt));
@@ -217,27 +264,8 @@ async function waitForAnalysisRun(host, runId, options = {}) {
217
264
  if (runStatus === "SUCCEEDED" && materializationStartedAt === void 0) {
218
265
  materializationStartedAt = now();
219
266
  }
220
- const lifecycleDeadline = materializationStartedAt === void 0 ? deadline : Math.min(deadline, materializationStartedAt + MATERIALIZATION_GRACE_MS);
221
- const effectiveDeadline = Math.min(clientDeadline, lifecycleDeadline);
222
- if (now() >= effectiveDeadline) {
223
- if (clientDeadline <= lifecycleDeadline) {
224
- throw waitError(
225
- `Stopped waiting after ${waitTimeoutSeconds} seconds for run ${runId}. The remote run was not canceled.`,
226
- "ASYNC_WAIT_TIMEOUT",
227
- runId,
228
- void 0,
229
- descriptor,
230
- { wait_timeout_seconds: waitTimeoutSeconds }
231
- );
232
- }
233
- throw waitError(
234
- `Stopped waiting because the server-declared deadline for run ${runId} was reached. The remote run was not canceled.`,
235
- "ASYNC_WAIT_DEADLINE_REACHED",
236
- runId,
237
- void 0,
238
- descriptor
239
- );
240
- }
267
+ checkWaitBoundary();
268
+ const effectiveDeadline = Math.min(clientDeadline, lifecycleDeadline());
241
269
  await sleep(Math.min(delayMs, Math.max(0, effectiveDeadline - now())), options.signal);
242
270
  delayMs = nextDelay(delayMs);
243
271
  descriptor = void 0;
@@ -247,7 +275,13 @@ async function downloadAnalysisArtifact(host, runId, artifactId, output, options
247
275
  const outputPath = resolve(output);
248
276
  await assertOutputPathAvailable(outputPath, options.force, { run_id: runId, artifact_id: artifactId });
249
277
  if (options.ensureReady !== false) {
250
- const descriptor = await inspectAnalysisRun(host, runId);
278
+ let descriptor;
279
+ try {
280
+ descriptor = await abortableRequest(inspectAnalysisRun(host, runId, options.signal), options.signal);
281
+ } catch (error) {
282
+ throwIfAborted(options.signal, runId);
283
+ throw error;
284
+ }
251
285
  ensureCompletedDescriptor(descriptor, runId, artifactId);
252
286
  }
253
287
  await mkdir(dirname(outputPath), { recursive: true });
@@ -258,7 +292,7 @@ async function downloadAnalysisArtifact(host, runId, artifactId, output, options
258
292
  let tempPresent = false;
259
293
  try {
260
294
  throwIfAborted(options.signal, runId);
261
- const response = await fetchArtifact(host, runId, artifactId);
295
+ const response = await abortableRequest(fetchArtifact(host, runId, artifactId, options.signal), options.signal);
262
296
  if (!response.body) {
263
297
  throw protocolError("Artifact download response has no body.", runId);
264
298
  }
@@ -363,11 +397,14 @@ async function withInterruptSignal(operation, runId) {
363
397
  process.removeListener("SIGINT", onInterrupt);
364
398
  }
365
399
  }
366
- async function inspectAnalysisRun(host, runId) {
400
+ async function inspectAnalysisRun(host, runId, signal) {
367
401
  return asDescriptor(await requestCapabilityGateway(
368
402
  host,
369
403
  resolveGatewayDomain("analysis"),
370
- `runs/${encodeURIComponent(runId)}`
404
+ `runs/${encodeURIComponent(runId)}`,
405
+ "GET",
406
+ void 0,
407
+ { signal }
371
408
  ));
372
409
  }
373
410
  function ensureCompletedDescriptor(descriptor, runId, artifactId) {
@@ -508,6 +545,20 @@ function isTransientPollError(error) {
508
545
  function throwIfAborted(signal, runId) {
509
546
  if (signal?.aborted) throw interruptedError(runId);
510
547
  }
548
+ async function abortableRequest(request, signal) {
549
+ if (!signal) return request;
550
+ let onAbort = () => void 0;
551
+ const aborted = new Promise((_resolve, reject) => {
552
+ onAbort = () => reject(signal.reason ?? new DOMException("The operation was aborted", "AbortError"));
553
+ if (signal.aborted) onAbort();
554
+ else signal.addEventListener("abort", onAbort, { once: true });
555
+ });
556
+ try {
557
+ return await Promise.race([request, aborted]);
558
+ } finally {
559
+ signal.removeEventListener("abort", onAbort);
560
+ }
561
+ }
511
562
  async function abortableSleep(milliseconds, signal) {
512
563
  if (milliseconds <= 0) return;
513
564
  await new Promise((resolveSleep, reject) => {
@@ -538,14 +589,15 @@ async function pathExists(path) {
538
589
  function artifactPath(runId, artifactId) {
539
590
  return `runs/${encodeURIComponent(runId)}/artifacts/${encodeURIComponent(artifactId)}/download`;
540
591
  }
541
- function fetchArtifact(host, runId, artifactId) {
592
+ function fetchArtifact(host, runId, artifactId, signal) {
542
593
  return fetchCapabilityGateway(
543
594
  host,
544
595
  resolveGatewayDomain("analysis"),
545
596
  artifactPath(runId, artifactId),
546
597
  "GET",
547
598
  void 0,
548
- "application/octet-stream"
599
+ "application/octet-stream",
600
+ { signal }
549
601
  );
550
602
  }
551
603
 
@@ -3,7 +3,7 @@ import {
3
3
  logger,
4
4
  normalizeUrl,
5
5
  readExternalCliToken
6
- } from "./chunk-Z3Q2AEIN.js";
6
+ } from "./chunk-R2SVAO4G.js";
7
7
 
8
8
  // src/core/sandbox-runtime.ts
9
9
  import { homedir } from "os";
@@ -26,19 +26,22 @@ function getSandboxCliTokenFilePath() {
26
26
  return join(getSandboxAeConfigDir(), "cli-token.json");
27
27
  }
28
28
  function isAeSandboxRuntime() {
29
+ return getAeSandboxDetectionReason() !== "not_detected";
30
+ }
31
+ function getAeSandboxDetectionReason() {
29
32
  if (process.env.SANDBOX_RUNTIME_ROOT) {
30
- return true;
33
+ return "runtime_root_env";
31
34
  }
32
35
  if (process.platform !== "linux") {
33
- return false;
36
+ return "not_detected";
34
37
  }
35
38
  try {
36
39
  if (fs.existsSync(getSandboxCliTokenFilePath())) {
37
- return true;
40
+ return "cli_token_file";
38
41
  }
39
42
  } catch {
40
43
  }
41
- return false;
44
+ return "not_detected";
42
45
  }
43
46
 
44
47
  // src/core/config.ts
@@ -285,12 +288,13 @@ function getConfigDir() {
285
288
  }
286
289
 
287
290
  export {
291
+ getSandboxRuntimeRoot,
292
+ isAeSandboxRuntime,
293
+ getAeSandboxDetectionReason,
288
294
  safeJsonParse,
289
295
  safeReadJsonFile,
290
296
  stringifyJsonRequest,
291
297
  parseJsonRequest,
292
- getSandboxRuntimeRoot,
293
- isAeSandboxRuntime,
294
298
  readSandboxCliTokenEntry,
295
299
  getFallbackCliToken,
296
300
  loadConfig,
@@ -28,6 +28,9 @@ function listCapabilityDiscoveryPrefixes(cliService) {
28
28
  return [...new Set(rawPrefixes.map((prefix) => prefix.trim().toLowerCase()).filter(Boolean).map((prefix) => prefix.endsWith(".") ? prefix : `${prefix}.`))];
29
29
  }
30
30
  function resolveGatewayDomain(cliService, override) {
31
+ if (cliService === "ai-monitor") {
32
+ return "ai-monitor";
33
+ }
31
34
  const envDomain = envGatewayDomain(cliService);
32
35
  if (envDomain !== void 0) {
33
36
  return envDomain;