@thinkingai/ae-cli 6.0.58 → 6.0.61

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 (281) hide show
  1. package/README.md +14 -6
  2. package/README.zh.md +16 -6
  3. package/bin/ai-monitor.js +2 -0
  4. package/bin/runtime-capabilities.json +1 -1
  5. package/dist/ai-monitor-NUKSJPLE.js +33 -0
  6. package/dist/ai-monitor.js +136 -0
  7. package/dist/{auth-A5OO4VS4.js → auth-MVAEBGBP.js} +24 -15
  8. package/dist/{automation-FD2QZUP6.js → automation-6L6IAYRK.js} +6 -7
  9. package/dist/{capability-SKI4GHF4.js → capability-74N7AN5X.js} +35 -38
  10. package/dist/{chunk-OAWPT7VP.js → chunk-2I5SZ5DS.js} +2 -2
  11. package/dist/{chunk-QWSA3EOD.js → chunk-7WBCSJL6.js} +23 -9
  12. package/dist/{chunk-4PSTYEG5.js → chunk-AMURHMS3.js} +11 -7
  13. package/dist/{chunk-KPQY44JQ.js → chunk-AWW2T2WL.js} +3 -0
  14. package/dist/chunk-BQFLABJQ.js +186 -0
  15. package/dist/{chunk-E25OSZLJ.js → chunk-COOMXFUG.js} +3 -3
  16. package/dist/chunk-EFGUBGA6.js +64 -0
  17. package/dist/{chunk-HQCY3QCA.js → chunk-H35VDOAE.js} +18 -13
  18. package/dist/{chunk-VDICGXCY.js → chunk-HIMOBNEY.js} +2 -2
  19. package/dist/{chunk-JEUXDY3B.js → chunk-HQED4YB4.js} +1 -1
  20. package/dist/chunk-HRFYYEXR.js +1285 -0
  21. package/dist/{chunk-UYJMEHAF.js → chunk-JZY6WWAP.js} +22 -21
  22. package/dist/{chunk-2F64AZYH.js → chunk-KA5WKR5P.js} +2 -2
  23. package/dist/{chunk-YVG6QD3V.js → chunk-LFJ7N36I.js} +103 -8
  24. package/dist/{chunk-EEARZNHE.js → chunk-LPKIMGIU.js} +89 -37
  25. package/dist/chunk-NNK3JBH4.js +60 -0
  26. package/dist/{chunk-WMDO53YK.js → chunk-OTZ4JQDU.js} +2 -2
  27. package/dist/{chunk-SOSFRU3O.js → chunk-PLNS5J33.js} +58 -26
  28. package/dist/chunk-PUSFEC6B.js +29 -0
  29. package/dist/{chunk-Z3Q2AEIN.js → chunk-R2SVAO4G.js} +14 -2
  30. package/dist/{chunk-K2Z7QHDR.js → chunk-RB26WNLM.js} +52 -15
  31. package/dist/chunk-SVNED423.js +556 -0
  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-GBSACKFB.js → chunk-XPARQSYS.js} +528 -299
  36. package/dist/{chunk-72NJKS7O.js → chunk-XZDKAR4N.js} +4 -4
  37. package/dist/{community-report-client-TJVCLZ3K.js → community-report-client-ULRNXLQV.js} +1 -1
  38. package/dist/{compat-check-WFEKVLTH.js → compat-check-W4XC27RG.js} +5 -4
  39. package/dist/{config-U4I7X25P.js → config-264GB6C7.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 +98 -589
  44. package/dist/{local-data-upload-client-KCMG6J62.js → local-data-upload-client-YTWMAAGE.js} +1 -1
  45. package/dist/{memory-SNFR5M23.js → memory-ZLTTULZK.js} +9 -10
  46. package/dist/{metadata-6QM6EED5.js → metadata-EN2IWCDI.js} +11 -10
  47. package/dist/{model-KEVCEXWD.js → model-NAKQWK4W.js} +4 -5
  48. package/dist/{personal-semantic-preference-7VXQPP2N.js → personal-semantic-preference-UGN67KTN.js} +46 -15
  49. package/dist/{project-semantic-PSEPYH2L.js → project-semantic-5OP3YPZD.js} +19 -16
  50. package/dist/{sync-22ACDK5Z.js → sync-LDJQZRQH.js} +9 -9
  51. package/dist/{te-agent-BJ36B4QI.js → te-agent-WNNAD4AJ.js} +303 -17
  52. package/dist/{te-analysis-WQ6D6YG4.js → te-analysis-KIMH6AGU.js} +399 -205
  53. package/dist/{te-community-VRWMFGI6.js → te-community-P7NNBVCS.js} +17 -15
  54. package/dist/{te-dataops-YTLFTTW7.js → te-dataops-ZRKSG4R7.js} +13 -11
  55. package/dist/{te-engage-V2QW7TIC.js → te-engage-PVBVNRSU.js} +13 -12
  56. package/dist/{te-kb-4AQLISDR.js → te-kb-W7PRC7QN.js} +80 -20
  57. package/dist/{te-system-CYWSK3UN.js → te-system-F4ZU2HRQ.js} +6 -7
  58. package/dist/{te-team-6ELNGBWT.js → te-team-5ONMRGKF.js} +9 -8
  59. package/dist/{things-HFWLGCUH.js → things-PFENSIF4.js} +9 -8
  60. package/dist/{update-3CRVVHV5.js → update-EUZ4GNND.js} +8 -6
  61. package/dist/{workspace-2CKQX2XL.js → workspace-Z7L33OBQ.js} +6 -7
  62. package/package.json +12 -7
  63. package/skills/ae-agent/SKILL.md +19 -5
  64. package/skills/ae-agent/references/a2a.md +103 -0
  65. package/skills/ae-agent/references/command_index.md +11 -0
  66. package/skills/ae-ai-monitor/SKILL.md +179 -0
  67. package/skills/ae-ai-monitor/references/read-commands.md +866 -0
  68. package/skills/ae-analysis/SKILL.md +43 -25
  69. package/skills/ae-analysis/references/adhoc_export.md +3 -1
  70. package/skills/ae-analysis/references/ai_models.md +1 -0
  71. package/skills/ae-analysis/references/analysis_data_retrieval.md +1 -1
  72. package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -0
  73. package/skills/ae-analysis/references/asset_authentication_export.md +1 -1
  74. package/skills/ae-analysis/references/asset_authentication_update.md +6 -2
  75. package/skills/ae-analysis/references/asset_search.md +1 -1
  76. package/skills/ae-analysis/references/bad_case_begin.md +12 -0
  77. package/skills/ae-analysis/references/bad_case_get.md +12 -0
  78. package/skills/ae-analysis/references/bad_case_history.md +12 -0
  79. package/skills/ae-analysis/references/bad_case_list.md +12 -0
  80. package/skills/ae-analysis/references/bad_case_review.md +51 -0
  81. package/skills/ae-analysis/references/bad_case_run.md +12 -0
  82. package/skills/ae-analysis/references/bad_case_submit.md +12 -0
  83. package/skills/ae-analysis/references/bad_case_submit_to_page.md +12 -0
  84. package/skills/ae-analysis/references/bad_case_sync_evaluation.md +11 -0
  85. package/skills/ae-analysis/references/bi_panel_list.md +1 -1
  86. package/skills/ae-analysis/references/bi_panel_share.md +3 -1
  87. package/skills/ae-analysis/references/catalog_list.md +2 -0
  88. package/skills/ae-analysis/references/command_index.md +44 -35
  89. package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
  90. package/skills/ae-analysis/references/dashboard_handover.md +3 -1
  91. package/skills/ae-analysis/references/dashboard_list.md +3 -3
  92. package/skills/ae-analysis/references/dashboard_report_data_export.md +1 -1
  93. package/skills/ae-analysis/references/dashboard_share.md +3 -1
  94. package/skills/ae-analysis/references/dashboard_update.md +3 -2
  95. package/skills/ae-analysis/references/filter_value_list.md +2 -0
  96. package/skills/ae-analysis/references/folder_share.md +8 -2
  97. package/skills/ae-analysis/references/governance_recommendation_export.md +2 -2
  98. package/skills/ae-analysis/references/governance_recommendation_run_update.md +3 -1
  99. package/skills/ae-analysis/references/personal_semantic_preference_add.md +9 -1
  100. package/skills/ae-analysis/references/personal_semantic_preference_delete.md +2 -0
  101. package/skills/ae-analysis/references/personal_semantic_preference_get.md +2 -0
  102. package/skills/ae-analysis/references/personal_semantic_preference_list.md +10 -2
  103. package/skills/ae-analysis/references/personal_semantic_preference_update.md +8 -0
  104. package/skills/ae-analysis/references/project_data_power_upsert.md +3 -1
  105. package/skills/ae-analysis/references/project_mark_time_create.md +2 -0
  106. package/skills/ae-analysis/references/project_mark_time_update.md +2 -0
  107. package/skills/ae-analysis/references/project_member_add.md +3 -1
  108. package/skills/ae-analysis/references/project_member_batch_update.md +3 -1
  109. package/skills/ae-analysis/references/project_member_handover_run.md +3 -1
  110. package/skills/ae-analysis/references/project_member_update.md +3 -1
  111. package/skills/ae-analysis/references/project_owner_update.md +8 -2
  112. package/skills/ae-analysis/references/project_role_upsert.md +5 -3
  113. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +16 -1
  114. package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +14 -1
  115. package/skills/ae-analysis/references/project_space_share.md +8 -2
  116. package/skills/ae-analysis/references/property_get.md +2 -0
  117. package/skills/ae-analysis/references/public_link_list.md +3 -1
  118. package/skills/ae-analysis/references/query_cancel.md +4 -1
  119. package/skills/ae-analysis/references/report_data_run.md +1 -1
  120. package/skills/ae-analysis/references/report_list.md +3 -3
  121. package/skills/ae-analysis/references/scenario_append.md +2 -2
  122. package/skills/ae-analysis/references/scenario_collect.md +15 -4
  123. package/skills/ae-analysis/references/scenario_evaluation.md +17 -1
  124. package/skills/ae-analysis/references/scenario_list.md +7 -7
  125. package/skills/ae-analysis/references/system_oauth2_update.md +3 -1
  126. package/skills/ae-analysis/references/system_third_party_login_upsert.md +4 -2
  127. package/skills/ae-analysis/references/user_tag_create.md +4 -1
  128. package/skills/ae-analysis/references/user_tag_get.md +2 -0
  129. package/skills/ae-analysis/references/user_tag_models.md +8 -2
  130. package/skills/ae-analysis/references/user_tag_update.md +5 -2
  131. package/skills/ae-analysis/references/virtual_property_create.md +12 -1
  132. package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +10 -0
  133. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +55 -13
  134. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +2 -2
  135. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +2 -2
  136. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +7 -1
  137. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/wait-compile-run.mjs +79 -0
  138. package/skills/ae-automation/SKILL.md +4 -2
  139. package/skills/ae-capability/SKILL.md +16 -8
  140. package/skills/ae-community/SKILL.md +1 -0
  141. package/skills/ae-dataops/SKILL.md +1 -0
  142. package/skills/ae-engage/SKILL.md +1 -0
  143. package/skills/ae-evaluation/SKILL.md +17 -2
  144. package/skills/ae-generate-tracking-plan/SKILL.md +5 -0
  145. package/skills/ae-kb/SKILL.md +8 -4
  146. package/skills/ae-kb/references/analysis-workflow.md +11 -2
  147. package/skills/ae-kb/references/publication.md +45 -0
  148. package/skills/ae-kb/references/query-workflow.md +3 -1
  149. package/skills/ae-kb/references/versions.md +1 -1
  150. package/skills/ae-metadata/SKILL.md +1 -0
  151. package/skills/ae-migrate-tracking-code/SKILL.md +2 -1
  152. package/skills/ae-team/SKILL.md +1 -1
  153. package/skills/ae-tracking-matrix/SKILL.md +170 -0
  154. package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
  155. package/skills/ae-tracking-matrix/i18n.yaml +12 -0
  156. package/skills/ae-tracking-matrix/references/ae-capabilities.md +93 -0
  157. package/skills/ae-tracking-matrix/references/business-semantic-checks.md +30 -0
  158. package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +256 -0
  159. package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +213 -0
  160. package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +407 -0
  161. package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +218 -0
  162. package/skills/ae-tracking-matrix/references/categories/casual_music.md +112 -0
  163. package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +301 -0
  164. package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +356 -0
  165. package/skills/ae-tracking-matrix/references/categories/fishing.md +775 -0
  166. package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +89 -0
  167. package/skills/ae-tracking-matrix/references/categories/idle_card.md +27 -0
  168. package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +415 -0
  169. package/skills/ae-tracking-matrix/references/categories/interactive_video.md +133 -0
  170. package/skills/ae-tracking-matrix/references/categories/merge.md +639 -0
  171. package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +406 -0
  172. package/skills/ae-tracking-matrix/references/categories/mmo_web.md +230 -0
  173. package/skills/ae-tracking-matrix/references/categories/music.md +137 -0
  174. package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +414 -0
  175. package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +199 -0
  176. package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +158 -0
  177. package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +546 -0
  178. package/skills/ae-tracking-matrix/references/categories/rpg.md +195 -0
  179. package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +115 -0
  180. package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +151 -0
  181. package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +260 -0
  182. package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +232 -0
  183. package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +359 -0
  184. package/skills/ae-tracking-matrix/references/categories/tower_defense.md +365 -0
  185. package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +211 -0
  186. package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +132 -0
  187. package/skills/ae-tracking-matrix/references/category-registry.md +77 -0
  188. package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +230 -0
  189. package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +406 -0
  190. package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +128 -0
  191. package/skills/ae-tracking-matrix/references/eval-cases.md +74 -0
  192. package/skills/ae-tracking-matrix/references/naming-dict.md +238 -0
  193. package/skills/ae-tracking-matrix/references/optimization-checklist.md +85 -0
  194. package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +142 -0
  195. package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +47 -0
  196. package/skills/ae-tracking-matrix/references/plan-generation/reference.md +794 -0
  197. package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +94 -0
  198. package/skills/ae-tracking-matrix/references/scene-routing.md +80 -0
  199. package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +3787 -0
  200. package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +827 -0
  201. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +655 -0
  202. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +953 -0
  203. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +1128 -0
  204. package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +714 -0
  205. package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +1268 -0
  206. package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +776 -0
  207. package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +182 -0
  208. package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +2755 -0
  209. package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +1182 -0
  210. package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +1300 -0
  211. package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +1369 -0
  212. package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +1692 -0
  213. package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +902 -0
  214. package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +763 -0
  215. package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +1107 -0
  216. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +1532 -0
  217. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +845 -0
  218. package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +228 -0
  219. package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +149 -0
  220. package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +407 -0
  221. package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +163 -0
  222. package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +149 -0
  223. package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +153 -0
  224. package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +232 -0
  225. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +314 -0
  226. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +117 -0
  227. package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +148 -0
  228. package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +645 -0
  229. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +307 -0
  230. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +347 -0
  231. package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +72 -0
  232. package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +264 -0
  233. package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +566 -0
  234. package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +409 -0
  235. package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +446 -0
  236. package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +557 -0
  237. package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +457 -0
  238. package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +490 -0
  239. package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +523 -0
  240. package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +484 -0
  241. package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +442 -0
  242. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +391 -0
  243. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +91 -0
  244. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +635 -0
  245. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +113 -0
  246. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +466 -0
  247. package/skills/ae-tracking-matrix/references/standard-base/README.md +22 -0
  248. package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +174 -0
  249. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +20 -0
  250. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +7 -0
  251. package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +14 -0
  252. package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +370 -0
  253. package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +47 -0
  254. package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +37 -0
  255. package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +27 -0
  256. package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +23 -0
  257. package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +14 -0
  258. package/skills/ae-tracking-matrix/references/standard-base/user_data.md +46 -0
  259. package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +13 -0
  260. package/skills/ae-tracking-matrix/references/system-fields.md +297 -0
  261. package/skills/ae-tracking-matrix/references/te-field-translations.md +1791 -0
  262. package/skills/ae-tracking-matrix/references/workflows/data-verification.md +232 -0
  263. package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +829 -0
  264. package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +355 -0
  265. package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +283 -0
  266. package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +168 -0
  267. package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +205 -0
  268. package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +75 -0
  269. package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +36 -0
  270. package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +107 -0
  271. package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +114 -0
  272. package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +53 -0
  273. package/skills/ae-tracking-matrix/scripts/finalize_plan.py +166 -0
  274. package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +674 -0
  275. package/skills/ae-tracking-matrix/scripts/plan_contract.py +200 -0
  276. package/skills/ae-tracking-matrix/scripts/plan_types.py +60 -0
  277. package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +169 -0
  278. package/skills/ae-tracking-matrix/scripts/sync_plan.py +296 -0
  279. package/skills/ae-tracking-matrix/scripts/upload_plan.py +340 -0
  280. package/dist/chunk-AMBFK2K3.js +0 -28
  281. package/dist/chunk-Y74WTIKJ.js +0 -10
@@ -1,14 +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";
9
+ } from "./chunk-EFGUBGA6.js";
6
10
  import {
7
11
  findGatewayDomain,
8
12
  listCapabilityDiscoveryPrefixes,
9
13
  listRegisteredCapabilityDomains,
10
14
  resolveGatewayDomain
11
- } from "./chunk-KPQY44JQ.js";
15
+ } from "./chunk-AWW2T2WL.js";
16
+ import {
17
+ printError,
18
+ printOutput,
19
+ withOutputMetadata
20
+ } from "./chunk-OTZ4JQDU.js";
12
21
  import {
13
22
  CapabilityGatewayError,
14
23
  dryRunCapabilityWithEnvelope,
@@ -17,37 +26,27 @@ import {
17
26
  inspectCapabilityWithEnvelope,
18
27
  listCapabilitiesWithEnvelope,
19
28
  validateCapabilityWithEnvelope
20
- } from "./chunk-UYJMEHAF.js";
21
- import {
22
- resolveHost
23
- } from "./chunk-2F64AZYH.js";
24
- import {
25
- printError,
26
- printOutput,
27
- withOutputMetadata
28
- } from "./chunk-WMDO53YK.js";
29
- import "./chunk-Y74WTIKJ.js";
29
+ } from "./chunk-JZY6WWAP.js";
30
+ import "./chunk-NNK3JBH4.js";
30
31
  import {
31
32
  assertBusinessEnabled,
32
33
  businessForCapability,
33
34
  readBusinessConfigForExecution,
34
35
  readCurrentBusinessConfig
35
- } from "./chunk-GBSACKFB.js";
36
+ } from "./chunk-XPARQSYS.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) {
@@ -236,7 +235,7 @@ function registerCapability(program) {
236
235
  capability.command("search").description("Search capability IDs and descriptions in a domain").argument("<query>", "Case-insensitive search terms").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 (query, opts) => {
237
236
  await executeAndPrint(program, async (host) => {
238
237
  const business = businessForCapability(opts.domain);
239
- const businesses = business ? await readBusinessConfigForExecution(host) : readCurrentBusinessConfig(host);
238
+ const businesses = business ? await readBusinessConfigForExecution(host, !program.opts().host) : readCurrentBusinessConfig(host);
240
239
  const gatewayDomain = resolveCapabilityListDomain(opts.domain, businesses);
241
240
  const projectId = parseOptionalProjectId(opts.projectId);
242
241
  if (business && businesses[business] === false) {
@@ -261,7 +260,7 @@ function registerCapability(program) {
261
260
  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) => {
262
261
  await executeAndPrint(program, async (host) => {
263
262
  assertCapabilityIsNotRetired(capabilityId);
264
- await assertCapabilityBusinessEnabled(capabilityId, host);
263
+ await assertCapabilityBusinessEnabled(capabilityId, host, program.opts().host);
265
264
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
266
265
  return gatewayOutput(await inspectCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseOptionalProjectId(opts.projectId)), host);
267
266
  });
@@ -274,7 +273,7 @@ function registerCapability(program) {
274
273
  ).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) => {
275
274
  await executeAndPrint(program, async (host) => {
276
275
  assertCapabilityIsNotRetired(capabilityId);
277
- await assertCapabilityBusinessEnabled(capabilityId, host);
276
+ await assertCapabilityBusinessEnabled(capabilityId, host, program.opts().host);
278
277
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
279
278
  return gatewayOutput(await validateCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseCapabilityInput(opts.input)), host);
280
279
  });
@@ -298,7 +297,7 @@ Examples:
298
297
  ).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) => {
299
298
  await executeAndPrint(program, async (host) => {
300
299
  assertCapabilityIsNotRetired(capabilityId);
301
- await assertCapabilityBusinessEnabled(capabilityId, host);
300
+ await assertCapabilityBusinessEnabled(capabilityId, host, program.opts().host);
302
301
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
303
302
  return gatewayOutput(await dryRunCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseCapabilityInput(opts.input)), host);
304
303
  });
@@ -312,7 +311,7 @@ Examples:
312
311
  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) => {
313
312
  await executeAndPrint(program, async (host, globalOpts) => {
314
313
  assertCapabilityIsNotRetired(capabilityId);
315
- await assertCapabilityBusinessEnabled(capabilityId, host);
314
+ await assertCapabilityBusinessEnabled(capabilityId, host, program.opts().host);
316
315
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
317
316
  const input = parseCapabilityInput(opts.input);
318
317
  if (globalOpts.validate && globalOpts.dryRun) {
@@ -331,7 +330,7 @@ Examples:
331
330
  const metadata = await inspectCapability(host, gatewayDomain, capabilityId);
332
331
  const risk = normalizeRiskLevel(typeof metadata?.risk === "string" ? metadata.risk : void 0);
333
332
  if (requiresConfirmation(risk)) {
334
- const confirmed = await confirm(`This capability is marked ${risk} (${capabilityId}). Continue?`);
333
+ const confirmed = await confirmHighRiskWrite(`This capability is marked ${risk} (${capabilityId}). Continue?`);
335
334
  if (!confirmed) {
336
335
  process.stderr.write("Aborted.\n");
337
336
  return void 0;
@@ -348,8 +347,8 @@ Examples:
348
347
  ae-cli capability run analysis.dashboard.list --input input.json`
349
348
  );
350
349
  }
351
- async function assertCapabilityBusinessEnabled(capabilityId, host) {
352
- await assertBusinessEnabled(businessForCapability(capabilityId), host);
350
+ async function assertCapabilityBusinessEnabled(capabilityId, host, hostOverride) {
351
+ await assertBusinessEnabled(businessForCapability(capabilityId), host, !hostOverride);
353
352
  }
354
353
  function gatewayOutput(envelope, host) {
355
354
  return withOutputMetadata(withPageUrl(envelope.data, host), envelope.meta);
@@ -403,7 +402,14 @@ function printCapabilityError(error, host) {
403
402
  return;
404
403
  }
405
404
  if (error instanceof PermissionError) {
406
- printError("permission", error.message, error.hint, error.code);
405
+ printError(
406
+ "permission",
407
+ error.message,
408
+ error.hint,
409
+ error.code,
410
+ withPageUrl(error.meta, host),
411
+ { details: error.details }
412
+ );
407
413
  return;
408
414
  }
409
415
  if (error instanceof CapabilityGatewayError) {
@@ -413,15 +419,6 @@ function printCapabilityError(error, host) {
413
419
  const message = error instanceof Error ? error.message : String(error);
414
420
  printError("api", message);
415
421
  }
416
- async function confirm(message) {
417
- const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
418
- return new Promise((resolve) => {
419
- rl.question(`${message} [y/N] `, (answer) => {
420
- rl.close();
421
- resolve(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
422
- });
423
- });
424
- }
425
422
  export {
426
423
  registerCapability
427
424
  };
@@ -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,21 +1,23 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  CapabilityGatewayError
4
- } from "./chunk-UYJMEHAF.js";
4
+ } from "./chunk-JZY6WWAP.js";
5
5
  import {
6
6
  SecureStoreAuthError,
7
- getCliToken
8
- } from "./chunk-SOSFRU3O.js";
7
+ getCliToken,
8
+ internalCallSourceHeaders
9
+ } from "./chunk-PLNS5J33.js";
9
10
  import {
10
11
  safeJsonParse
11
- } from "./chunk-4PSTYEG5.js";
12
+ } from "./chunk-AMURHMS3.js";
12
13
  import {
13
14
  PermissionError,
14
15
  externalCliTokenRequestOptions,
15
16
  isKbQueryPath,
16
17
  kbReadHeaders,
18
+ readExternalCliToken,
17
19
  readKbExecutionContext
18
- } from "./chunk-Z3Q2AEIN.js";
20
+ } from "./chunk-R2SVAO4G.js";
19
21
 
20
22
  // src/core/mcp-access.ts
21
23
  function buildUrl(host, path, params = {}) {
@@ -174,6 +176,7 @@ function parseKbResponse(resp, text, options = {}) {
174
176
  async function fetchWithCliToken(input, init, cliToken, options = {}) {
175
177
  const headers = new Headers(init.headers);
176
178
  headers.set("cli-token", cliToken);
179
+ for (const [name, value] of Object.entries(internalCallSourceHeaders())) headers.set(name, value);
177
180
  const resp = await fetch(input, { ...init, headers, ...externalCliTokenRequestOptions(input) });
178
181
  if (options.responseType === "empty" && resp.status === 204) return null;
179
182
  if (options.responseType === "bytes" && resp.ok) {
@@ -218,19 +221,20 @@ async function requestWithCliToken(host, input, init, options) {
218
221
  }
219
222
  async function getAuthHeaders(ctx) {
220
223
  const cliToken = await getCliToken(ctx.host());
221
- return { "cli-token": cliToken };
224
+ return { "cli-token": cliToken, ...internalCallSourceHeaders() };
222
225
  }
223
226
  async function kbApi(ctx, method, path, params = {}, body, options = {}) {
224
227
  const upperMethod = method.toUpperCase();
228
+ const isAsk = upperMethod === "POST" && /^\/(?:agent\/)?api\/external\/knowledge-bases\/ask$/.test(path);
225
229
  const isQuery = isKbQueryPath(upperMethod, path);
226
230
  const execution = isQuery ? readKbExecutionContext() : void 0;
227
231
  const host = execution ? ctx.hostOverride?.() || execution.origin : ctx.host();
228
232
  const selectedHost = execution && !ctx.hostOverride ? ctx.host() : host;
229
233
  const url = buildUrl(selectedHost, path, params);
230
- const queryHeaders = isQuery ? kbReadHeaders(url, ctx.str("read-context")) : void 0;
234
+ const queryHeaders = isQuery || isAsk && ctx.str("read-context") ? kbReadHeaders(url, ctx.str("read-context")) : void 0;
231
235
  const init = {
232
236
  method: upperMethod,
233
- headers: { "Content-Type": "application/json", ...queryHeaders },
237
+ headers: { "Content-Type": "application/json", ...queryHeaders, ...internalCallSourceHeaders() },
234
238
  body: upperMethod === "GET" ? void 0 : JSON.stringify(body ?? {})
235
239
  };
236
240
  if (execution) {
@@ -240,13 +244,23 @@ async function kbApi(ctx, method, path, params = {}, body, options = {}) {
240
244
  let code = "KB_READ_CONTEXT_REQUEST_FAILED";
241
245
  try {
242
246
  const value = responseErrorMetadata(safeJsonParse(text)).code;
243
- if (value?.startsWith("KB_READ_CONTEXT_")) code = value;
247
+ if (value && /^KB_(READ_CONTEXT|CANDIDATE)_/.test(value)) code = value;
244
248
  } catch {
245
249
  }
246
250
  throw new KbHttpError(code, code, response.status);
247
251
  }
248
252
  return parseKbResponse(response, text, { ...options, redactErrorDetails: true });
249
253
  }
254
+ if (upperMethod === "POST" && /^\/(?:agent\/)?api\/external\/knowledge-bases\/(read|grep|index)$/.test(path)) {
255
+ const task = readExternalCliToken(host)?.taskContext;
256
+ if (task) init.headers = {
257
+ ...init.headers,
258
+ "X-Task-CLI-Grant": task.grant,
259
+ "X-Task-CLI-Execution": task.executionId,
260
+ "X-Task-CLI-Company": task.companyId,
261
+ "X-Task-CLI-Sandbox": task.sandboxId
262
+ };
263
+ }
250
264
  return requestWithCliToken(
251
265
  host,
252
266
  url,
@@ -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;
@@ -0,0 +1,186 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ EvalApiError,
4
+ buildEvaluationOnboardingPayload,
5
+ evalDownloadFile,
6
+ evalRequest,
7
+ evaluationResponseStatus,
8
+ resolveEvaluationHost
9
+ } from "./chunk-LFJ7N36I.js";
10
+ import {
11
+ getCliToken,
12
+ internalCallSourceHeaders
13
+ } from "./chunk-PLNS5J33.js";
14
+ import {
15
+ isAeSandboxRuntime
16
+ } from "./chunk-AMURHMS3.js";
17
+ import {
18
+ CliValidationError,
19
+ externalCliTokenRequestOptions,
20
+ readExternalCliToken
21
+ } from "./chunk-R2SVAO4G.js";
22
+
23
+ // src/core/eval-session.ts
24
+ var SESSION_PATH = "/api/sandbox/agent/evaluation/session";
25
+ async function requestSandboxEvaluationSession(host, cliToken, teProjectId, fetchImpl = fetch) {
26
+ const url = `${resolveEvaluationHost(host)}/agent${SESSION_PATH}`;
27
+ const credentialOptions = externalCliTokenRequestOptions(url);
28
+ const signal = AbortSignal.timeout(3e4);
29
+ let response;
30
+ let body;
31
+ try {
32
+ response = await fetchImpl(url, {
33
+ ...credentialOptions,
34
+ method: "POST",
35
+ headers: { Accept: "application/json", "Content-Type": "application/json", "cli-token": cliToken, ...internalCallSourceHeaders() },
36
+ body: JSON.stringify(teProjectId ? { te_project_id: teProjectId } : {}),
37
+ redirect: "error",
38
+ signal
39
+ });
40
+ try {
41
+ body = await response.json();
42
+ } catch (error) {
43
+ if (signal.aborted) throw error;
44
+ body = void 0;
45
+ }
46
+ } catch {
47
+ throw new EvalApiError(signal.aborted ? "Evaluation session request timed out." : "Evaluation session request failed; redirects are not allowed.", {
48
+ code: signal.aborted ? "EVAL_SANDBOX_SESSION_TIMEOUT" : "EVAL_SANDBOX_SESSION_NETWORK_ERROR",
49
+ httpStatus: 0,
50
+ hint: "Verify that the AE Host serves the session endpoint directly without redirects.",
51
+ onboarding: buildEvaluationOnboardingPayload("availability_unknown", host)
52
+ });
53
+ }
54
+ if (!response.ok || typeof body?.session_token !== "string" || !body.session_token) {
55
+ const status = evaluationResponseStatus(response.status, response.headers.get("content-type"), body, "session") ?? (response.ok || response.status === 404 || body === void 0 ? "availability_unknown" : void 0);
56
+ throw new EvalApiError(
57
+ typeof body?.error === "string" ? body.error : "Unable to obtain an evaluation session from the sandbox gateway.",
58
+ {
59
+ code: "EVAL_SANDBOX_SESSION_FAILED",
60
+ httpStatus: response.status,
61
+ onboarding: status ? buildEvaluationOnboardingPayload(status, host) : void 0,
62
+ sensitiveValues: [cliToken, typeof body?.session_token === "string" ? body.session_token : ""],
63
+ hint: response.status === 400 ? "Set AE_EVAL_TE_PROJECT_ID when the CLI token is authorized for multiple TE projects." : "Verify that the sandbox gateway and Agent Evaluation service are configured."
64
+ }
65
+ );
66
+ }
67
+ return body.session_token;
68
+ }
69
+
70
+ // src/commands/evaluation/shared.ts
71
+ var EVAL_API_PREFIX = "/agenteval/api/v1";
72
+ function evalFlags() {
73
+ return [
74
+ {
75
+ name: "endpoint",
76
+ type: "string",
77
+ sensitive: true,
78
+ desc: `Deprecated: must match the current AE Host. Independent endpoint overrides are unsupported; use --host to select the AE Host instead.`
79
+ }
80
+ ];
81
+ }
82
+ function resolveEvalBaseUrl(ctx, environment = process.env) {
83
+ const baseUrl = resolveEvaluationHost(ctx.host());
84
+ for (const configured of [ctx.str("endpoint").trim(), environment.AE_EVAL_BASE_URL?.trim()]) {
85
+ if (!configured) continue;
86
+ const legacyBaseUrl = configured.replace(/\/+$/, "").replace(/(\/agenteval\/api\/v1|\/agenteval)$/, "");
87
+ if (resolveEvaluationHost(legacyBaseUrl) !== baseUrl) {
88
+ throw new CliValidationError("Independent evaluation endpoint overrides are unsupported.", {
89
+ code: "EVAL_ENDPOINT_OVERRIDE_UNSUPPORTED",
90
+ hint: "Remove --endpoint and AE_EVAL_BASE_URL; select the evaluation AE Host with --host instead."
91
+ });
92
+ }
93
+ }
94
+ return baseUrl;
95
+ }
96
+ function evalPathId(ctx, name = "id") {
97
+ const value = ctx.str(name);
98
+ if (!/^[a-zA-Z0-9_-]+$/.test(value)) {
99
+ throw new CliValidationError(`--${name} must be a resource ID containing only letters, digits, hyphens, or underscores.`, {
100
+ code: "EVAL_RESOURCE_ID_INVALID"
101
+ });
102
+ }
103
+ return encodeURIComponent(value);
104
+ }
105
+ function evalHeaders(environment = process.env, onboarding) {
106
+ const accessToken = environment.AE_EVAL_ACCESS_TOKEN?.trim();
107
+ if (!accessToken) {
108
+ throw new EvalApiError("AE_EVAL_ACCESS_TOKEN is not set.", {
109
+ code: "EVAL_ACCESS_TOKEN_MISSING",
110
+ httpStatus: 0,
111
+ hint: "Export AE_EVAL_ACCESS_TOKEN with an Agent Evaluation platform session token (POST /agenteval/api/v1/auth/session on the platform web console).",
112
+ onboarding
113
+ });
114
+ }
115
+ return { Authorization: `Bearer ${accessToken}` };
116
+ }
117
+ async function resolveEvalHeaders(ctx, environment = process.env, teProjectId) {
118
+ if (readExternalCliToken(ctx.host())?.taskContext && environment.AE_EVAL_ACCESS_TOKEN?.trim())
119
+ throw new CliValidationError("Managed executions must use the current user evaluation session, not AE_EVAL_ACCESS_TOKEN.", { code: "EVAL_MANAGED_TOKEN_OVERRIDE" });
120
+ if (environment.AE_EVAL_ACCESS_TOKEN?.trim()) return evalHeaders(environment);
121
+ if (!isAeSandboxRuntime()) {
122
+ const baseUrl = resolveEvalBaseUrl(ctx, environment);
123
+ return evalHeaders(environment, buildEvaluationOnboardingPayload("token_missing", baseUrl));
124
+ }
125
+ const cliToken = await getCliToken(ctx.host());
126
+ const sessionToken = await requestSandboxEvaluationSession(
127
+ ctx.host(),
128
+ cliToken,
129
+ teProjectId ?? environment.AE_EVAL_TE_PROJECT_ID?.trim()
130
+ );
131
+ return { Authorization: `Bearer ${sessionToken}` };
132
+ }
133
+ async function evalDownload(ctx, path, output) {
134
+ return evalDownloadFile({
135
+ baseUrl: resolveEvalBaseUrl(ctx),
136
+ headers: await resolveEvalHeaders(ctx),
137
+ method: "GET",
138
+ path: `${EVAL_API_PREFIX}${path}`
139
+ }, output);
140
+ }
141
+ async function evalApi(ctx, method, path, params, body, options = {}) {
142
+ return evalRequest({
143
+ baseUrl: resolveEvalBaseUrl(ctx),
144
+ headers: await resolveEvalHeaders(ctx, process.env, options.teProjectId),
145
+ method,
146
+ path: `${EVAL_API_PREFIX}${path}`,
147
+ params,
148
+ body,
149
+ idempotencyKey: options.idempotencyKey
150
+ });
151
+ }
152
+ function evalDryRun(ctx, method, path, params, body, options = {}) {
153
+ return {
154
+ method,
155
+ url: `${resolveEvalBaseUrl(ctx)}${EVAL_API_PREFIX}${path}`,
156
+ params,
157
+ body,
158
+ ...options.idempotencyKey ? { headers: { "Idempotency-Key": options.idempotencyKey } } : {}
159
+ };
160
+ }
161
+ function idFlag(desc = "Resource UUID") {
162
+ return { name: "id", type: "string", required: true, desc };
163
+ }
164
+ function lockVersionFlag(resource) {
165
+ return {
166
+ name: "lock-version",
167
+ type: "number",
168
+ required: true,
169
+ min: 0,
170
+ desc: `Current ${resource} lock_version (optimistic lock); each successful mutation increments it`
171
+ };
172
+ }
173
+ function idAndLockFlags(idDesc, resource) {
174
+ return [idFlag(idDesc), lockVersionFlag(resource)];
175
+ }
176
+
177
+ export {
178
+ evalFlags,
179
+ evalPathId,
180
+ evalDownload,
181
+ evalApi,
182
+ evalDryRun,
183
+ idFlag,
184
+ lockVersionFlag,
185
+ idAndLockFlags
186
+ };
@@ -9,15 +9,15 @@ import {
9
9
  postAgentApi,
10
10
  putAgentApi,
11
11
  uploadAgentApi
12
- } from "./chunk-VDICGXCY.js";
12
+ } from "./chunk-HIMOBNEY.js";
13
13
  import {
14
14
  TeAgentApiError,
15
15
  createTeAgentApiError
16
- } from "./chunk-JSBLCLFE.js";
16
+ } from "./chunk-VLOGOM7N.js";
17
17
  import {
18
18
  CliValidationError,
19
19
  isApiErrorType
20
- } from "./chunk-Z3Q2AEIN.js";
20
+ } from "./chunk-R2SVAO4G.js";
21
21
 
22
22
  // src/commands/workspace/client.ts
23
23
  var DEFAULT_TE_CLAUDE_BASE_PATH = "/agent";
@@ -0,0 +1,64 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ CliValidationError
4
+ } from "./chunk-R2SVAO4G.js";
5
+
6
+ // src/core/capability-risk.ts
7
+ var HIGH_RISK_LEVELS = /* @__PURE__ */ new Set(["high-risk-write"]);
8
+ function normalizeRiskLevel(risk) {
9
+ switch (risk) {
10
+ case "read":
11
+ return "read";
12
+ case "high-risk-write":
13
+ return "high-risk-write";
14
+ case "delete":
15
+ return "high-risk-write";
16
+ case "create":
17
+ case "update":
18
+ case "write":
19
+ return "write";
20
+ default:
21
+ return "write";
22
+ }
23
+ }
24
+ function requiresConfirmation(risk) {
25
+ return HIGH_RISK_LEVELS.has(normalizeRiskLevel(risk));
26
+ }
27
+
28
+ // src/framework/confirmation.ts
29
+ import * as readline from "readline";
30
+ function canPromptForConfirmation(input = process.stdin, output = process.stderr) {
31
+ return input.isTTY === true && output.isTTY === true;
32
+ }
33
+ async function confirmHighRiskWrite(message, input = process.stdin, output = process.stderr) {
34
+ if (!canPromptForConfirmation(input, output)) {
35
+ throw new CliValidationError("Non-interactive high-risk writes require global --yes.", {
36
+ code: "CONFIRMATION_REQUIRED",
37
+ hint: "After explicit authorization, retry with the global --yes flag."
38
+ });
39
+ }
40
+ const rl = readline.createInterface({ input, output });
41
+ return new Promise((resolve) => {
42
+ let settled = false;
43
+ const settle = (confirmed) => {
44
+ if (settled) return;
45
+ settled = true;
46
+ rl.removeListener("close", closed);
47
+ rl.removeListener("SIGINT", closed);
48
+ rl.close();
49
+ resolve(confirmed);
50
+ };
51
+ const closed = () => settle(false);
52
+ rl.once("close", closed);
53
+ rl.once("SIGINT", closed);
54
+ rl.question(`${message} [y/N] `, (answer) => {
55
+ settle(["y", "yes"].includes(answer.trim().toLowerCase()));
56
+ });
57
+ });
58
+ }
59
+
60
+ export {
61
+ normalizeRiskLevel,
62
+ requiresConfirmation,
63
+ confirmHighRiskWrite
64
+ };