@thinkingai/ae-cli 6.1.30 → 6.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/README.md +11 -5
  2. package/README.zh.md +11 -5
  3. package/bin/ai-monitor.js +2 -0
  4. package/dist/ai-monitor-MKMHSSNI.js +32 -0
  5. package/dist/ai-monitor.js +135 -0
  6. package/dist/{auth-ADZHUIJR.js → auth-CZHHPZOQ.js} +10 -9
  7. package/dist/{automation-FD2QZUP6.js → automation-FLCPFMN4.js} +4 -4
  8. package/dist/{capability-QXFRJYZD.js → capability-64KVJFIA.js} +27 -31
  9. package/dist/{chunk-YULUBP3R.js → chunk-3ULDJJTZ.js} +1 -1
  10. package/dist/{chunk-HRUOV6EQ.js → chunk-4XKTRCRK.js} +15 -15
  11. package/dist/{chunk-JSBLCLFE.js → chunk-5M5LBRR3.js} +1 -1
  12. package/dist/chunk-6M7ZEDT2.js +182 -0
  13. package/dist/{chunk-KPQY44JQ.js → chunk-AWW2T2WL.js} +3 -0
  14. package/dist/chunk-BNBCMCYN.js +563 -0
  15. package/dist/chunk-CF6JTT2U.js +64 -0
  16. package/dist/{chunk-CG773QXN.js → chunk-DWBYNGSR.js} +564 -314
  17. package/dist/{chunk-VDICGXCY.js → chunk-F2VFZUGG.js} +2 -2
  18. package/dist/{chunk-TFORY6WY.js → chunk-FCAA7I2D.js} +2 -2
  19. package/dist/{chunk-SOSFRU3O.js → chunk-HTZ2MLYA.js} +47 -21
  20. package/dist/{chunk-AWVZTN2B.js → chunk-HVMCPKOZ.js} +1 -1
  21. package/dist/chunk-IDDWEZ7F.js +1285 -0
  22. package/dist/{chunk-E25OSZLJ.js → chunk-KTJXD27G.js} +2 -2
  23. package/dist/{chunk-AVXDJAFC.js → chunk-NLEXY2TM.js} +47 -12
  24. package/dist/{chunk-YVG6QD3V.js → chunk-P7QDCWJ6.js} +98 -7
  25. package/dist/{chunk-EUFP4M2A.js → chunk-T7WF4HYW.js} +84 -32
  26. package/dist/{chunk-Y3AM6LIO.js → chunk-TMQGS4TO.js} +15 -10
  27. package/dist/{compat-check-HERBTQZN.js → compat-check-ZJNCMNQV.js} +2 -2
  28. package/dist/{config-E3KANXMK.js → config-FSH2NMNZ.js} +25 -12
  29. package/dist/{context-CDB5H5PD.js → context-YAQG6YQC.js} +2 -2
  30. package/dist/{evaluation-LR4YDYWL.js → evaluation-2JSF4V47.js} +13 -158
  31. package/dist/index.js +81 -583
  32. package/dist/{memory-SNFR5M23.js → memory-VEZZVAAP.js} +4 -4
  33. package/dist/{metadata-EXQYDZTH.js → metadata-3IWHX3V4.js} +7 -7
  34. package/dist/{model-KEVCEXWD.js → model-T7H7Q6BG.js} +2 -2
  35. package/dist/{personal-semantic-preference-ETY3KU2O.js → personal-semantic-preference-YITU23SA.js} +6 -6
  36. package/dist/{project-semantic-UHRMVOJF.js → project-semantic-MHEXJF3C.js} +15 -13
  37. package/dist/{sync-XKEBXESC.js → sync-AQHVCSPI.js} +4 -4
  38. package/dist/{te-agent-S6UQR4IE.js → te-agent-RXI7WOH4.js} +5 -5
  39. package/dist/{te-analysis-WOFFCIBC.js → te-analysis-CZY74HVF.js} +380 -191
  40. package/dist/{te-community-R7B6QYOO.js → te-community-DKCYUBCM.js} +6 -6
  41. package/dist/{te-dataops-KPILYVHA.js → te-dataops-QEH6VE56.js} +3 -3
  42. package/dist/{te-engage-IAUM6ONX.js → te-engage-WK7WKDKF.js} +6 -6
  43. package/dist/{te-experiment-TMLRA7B3.js → te-experiment-LH3RPIOE.js} +274 -29
  44. package/dist/{te-kb-GKWPSLSY.js → te-kb-UPORIOVN.js} +16 -7
  45. package/dist/{te-system-CYWSK3UN.js → te-system-AL4B4XZL.js} +2 -2
  46. package/dist/{te-team-ISN52YNG.js → te-team-LLVTO2G4.js} +5 -5
  47. package/dist/{things-DDQ52Z3Q.js → things-XLMLBYQR.js} +5 -5
  48. package/dist/{update-CTLNTX35.js → update-7J5UQHSK.js} +3 -3
  49. package/dist/{workspace-2CKQX2XL.js → workspace-FF2HXJGR.js} +4 -4
  50. package/package.json +9 -7
  51. package/skills/ae-ai-monitor/SKILL.md +179 -0
  52. package/skills/ae-ai-monitor/references/read-commands.md +866 -0
  53. package/skills/ae-analysis/SKILL.md +10 -4
  54. package/skills/ae-analysis/references/adhoc_export.md +3 -1
  55. package/skills/ae-analysis/references/ai_models/path.md +5 -6
  56. package/skills/ae-analysis/references/ai_models.md +1 -0
  57. package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -0
  58. package/skills/ae-analysis/references/asset_search.md +1 -1
  59. package/skills/ae-analysis/references/bad_case_begin.md +12 -0
  60. package/skills/ae-analysis/references/bad_case_get.md +12 -0
  61. package/skills/ae-analysis/references/bad_case_history.md +12 -0
  62. package/skills/ae-analysis/references/bad_case_list.md +12 -0
  63. package/skills/ae-analysis/references/bad_case_review.md +51 -0
  64. package/skills/ae-analysis/references/bad_case_run.md +12 -0
  65. package/skills/ae-analysis/references/bad_case_submit.md +12 -0
  66. package/skills/ae-analysis/references/bad_case_submit_to_page.md +12 -0
  67. package/skills/ae-analysis/references/bad_case_sync_evaluation.md +11 -0
  68. package/skills/ae-analysis/references/bi_panel_list.md +1 -1
  69. package/skills/ae-analysis/references/bi_panel_share.md +3 -1
  70. package/skills/ae-analysis/references/catalog_list.md +2 -0
  71. package/skills/ae-analysis/references/command_index.md +38 -29
  72. package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
  73. package/skills/ae-analysis/references/dashboard_handover.md +3 -1
  74. package/skills/ae-analysis/references/dashboard_list.md +3 -3
  75. package/skills/ae-analysis/references/dashboard_report_data_export.md +1 -1
  76. package/skills/ae-analysis/references/dashboard_share.md +3 -1
  77. package/skills/ae-analysis/references/dashboard_update.md +3 -2
  78. package/skills/ae-analysis/references/filter_value_list.md +2 -0
  79. package/skills/ae-analysis/references/folder_share.md +8 -2
  80. package/skills/ae-analysis/references/governance_recommendation_run_update.md +3 -1
  81. package/skills/ae-analysis/references/project_data_power_upsert.md +3 -1
  82. package/skills/ae-analysis/references/project_mark_time_create.md +2 -0
  83. package/skills/ae-analysis/references/project_mark_time_update.md +2 -0
  84. package/skills/ae-analysis/references/project_member_add.md +3 -1
  85. package/skills/ae-analysis/references/project_member_batch_update.md +3 -1
  86. package/skills/ae-analysis/references/project_member_handover_run.md +3 -1
  87. package/skills/ae-analysis/references/project_member_update.md +3 -1
  88. package/skills/ae-analysis/references/project_owner_update.md +3 -1
  89. package/skills/ae-analysis/references/project_role_upsert.md +5 -3
  90. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +16 -1
  91. package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +14 -1
  92. package/skills/ae-analysis/references/project_space_share.md +8 -2
  93. package/skills/ae-analysis/references/property_get.md +2 -0
  94. package/skills/ae-analysis/references/public_link_list.md +3 -1
  95. package/skills/ae-analysis/references/query_cancel.md +4 -1
  96. package/skills/ae-analysis/references/report_data_run.md +1 -1
  97. package/skills/ae-analysis/references/report_list.md +3 -3
  98. package/skills/ae-analysis/references/scenario_append.md +2 -2
  99. package/skills/ae-analysis/references/scenario_collect.md +15 -4
  100. package/skills/ae-analysis/references/scenario_list.md +2 -1
  101. package/skills/ae-analysis/references/system_oauth2_update.md +3 -1
  102. package/skills/ae-analysis/references/system_third_party_login_upsert.md +4 -2
  103. package/skills/ae-analysis/references/user_tag_create.md +4 -1
  104. package/skills/ae-analysis/references/user_tag_get.md +2 -0
  105. package/skills/ae-analysis/references/user_tag_models.md +8 -2
  106. package/skills/ae-analysis/references/user_tag_update.md +5 -2
  107. package/skills/ae-analysis/references/virtual_property_create.md +12 -1
  108. package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +10 -0
  109. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +55 -13
  110. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +2 -2
  111. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +2 -2
  112. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +7 -1
  113. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/wait-compile-run.mjs +79 -0
  114. package/skills/ae-automation/SKILL.md +4 -2
  115. package/skills/ae-capability/SKILL.md +9 -5
  116. package/skills/ae-community/SKILL.md +1 -0
  117. package/skills/ae-dataops/SKILL.md +1 -0
  118. package/skills/ae-engage/SKILL.md +1 -0
  119. package/skills/ae-evaluation/SKILL.md +17 -2
  120. package/skills/ae-experiment/SKILL.md +38 -11
  121. package/skills/ae-experiment/references/experiment_approval.md +171 -0
  122. package/skills/ae-experiment/references/manage_experiment.md +11 -2
  123. package/skills/ae-experiment/references/save_experiment.md +28 -8
  124. package/skills/ae-experiment/references/save_submit_experiment.md +18 -3
  125. package/skills/ae-experiment/references/save_submit_external_experiment.md +57 -3
  126. package/skills/ae-generate-tracking-plan/SKILL.md +5 -0
  127. package/skills/ae-kb/SKILL.md +5 -3
  128. package/skills/ae-kb/references/analysis-workflow.md +11 -2
  129. package/skills/ae-kb/references/query-workflow.md +3 -1
  130. package/skills/ae-kb/references/versions.md +1 -1
  131. package/skills/ae-metadata/SKILL.md +1 -0
  132. package/skills/ae-migrate-tracking-code/SKILL.md +2 -1
  133. package/skills/ae-team/SKILL.md +1 -1
  134. package/skills/ae-tracking-matrix/SKILL.md +170 -0
  135. package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
  136. package/skills/ae-tracking-matrix/i18n.yaml +12 -0
  137. package/skills/ae-tracking-matrix/references/ae-capabilities.md +93 -0
  138. package/skills/ae-tracking-matrix/references/business-semantic-checks.md +30 -0
  139. package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +256 -0
  140. package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +213 -0
  141. package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +407 -0
  142. package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +218 -0
  143. package/skills/ae-tracking-matrix/references/categories/casual_music.md +112 -0
  144. package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +301 -0
  145. package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +356 -0
  146. package/skills/ae-tracking-matrix/references/categories/fishing.md +775 -0
  147. package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +89 -0
  148. package/skills/ae-tracking-matrix/references/categories/idle_card.md +27 -0
  149. package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +415 -0
  150. package/skills/ae-tracking-matrix/references/categories/interactive_video.md +133 -0
  151. package/skills/ae-tracking-matrix/references/categories/merge.md +639 -0
  152. package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +406 -0
  153. package/skills/ae-tracking-matrix/references/categories/mmo_web.md +230 -0
  154. package/skills/ae-tracking-matrix/references/categories/music.md +137 -0
  155. package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +414 -0
  156. package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +199 -0
  157. package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +158 -0
  158. package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +546 -0
  159. package/skills/ae-tracking-matrix/references/categories/rpg.md +195 -0
  160. package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +115 -0
  161. package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +151 -0
  162. package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +260 -0
  163. package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +232 -0
  164. package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +359 -0
  165. package/skills/ae-tracking-matrix/references/categories/tower_defense.md +365 -0
  166. package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +211 -0
  167. package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +132 -0
  168. package/skills/ae-tracking-matrix/references/category-registry.md +77 -0
  169. package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +230 -0
  170. package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +406 -0
  171. package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +128 -0
  172. package/skills/ae-tracking-matrix/references/eval-cases.md +74 -0
  173. package/skills/ae-tracking-matrix/references/naming-dict.md +238 -0
  174. package/skills/ae-tracking-matrix/references/optimization-checklist.md +85 -0
  175. package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +142 -0
  176. package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +47 -0
  177. package/skills/ae-tracking-matrix/references/plan-generation/reference.md +794 -0
  178. package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +94 -0
  179. package/skills/ae-tracking-matrix/references/scene-routing.md +80 -0
  180. package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +3787 -0
  181. package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +827 -0
  182. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +655 -0
  183. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +953 -0
  184. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +1128 -0
  185. package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +714 -0
  186. package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +1268 -0
  187. package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +776 -0
  188. package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +182 -0
  189. package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +2755 -0
  190. package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +1182 -0
  191. package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +1300 -0
  192. package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +1369 -0
  193. package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +1692 -0
  194. package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +902 -0
  195. package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +763 -0
  196. package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +1107 -0
  197. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +1532 -0
  198. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +845 -0
  199. package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +228 -0
  200. package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +149 -0
  201. package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +407 -0
  202. package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +163 -0
  203. package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +149 -0
  204. package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +153 -0
  205. package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +232 -0
  206. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +314 -0
  207. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +117 -0
  208. package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +148 -0
  209. package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +645 -0
  210. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +307 -0
  211. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +347 -0
  212. package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +72 -0
  213. package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +264 -0
  214. package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +566 -0
  215. package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +409 -0
  216. package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +446 -0
  217. package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +557 -0
  218. package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +457 -0
  219. package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +490 -0
  220. package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +523 -0
  221. package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +484 -0
  222. package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +442 -0
  223. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +391 -0
  224. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +91 -0
  225. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +635 -0
  226. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +113 -0
  227. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +466 -0
  228. package/skills/ae-tracking-matrix/references/standard-base/README.md +22 -0
  229. package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +174 -0
  230. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +20 -0
  231. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +7 -0
  232. package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +14 -0
  233. package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +370 -0
  234. package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +47 -0
  235. package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +37 -0
  236. package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +27 -0
  237. package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +23 -0
  238. package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +14 -0
  239. package/skills/ae-tracking-matrix/references/standard-base/user_data.md +46 -0
  240. package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +13 -0
  241. package/skills/ae-tracking-matrix/references/system-fields.md +297 -0
  242. package/skills/ae-tracking-matrix/references/te-field-translations.md +1791 -0
  243. package/skills/ae-tracking-matrix/references/workflows/data-verification.md +232 -0
  244. package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +829 -0
  245. package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +355 -0
  246. package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +283 -0
  247. package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +168 -0
  248. package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +205 -0
  249. package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +75 -0
  250. package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +36 -0
  251. package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +107 -0
  252. package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +114 -0
  253. package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +53 -0
  254. package/skills/ae-tracking-matrix/scripts/finalize_plan.py +166 -0
  255. package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +674 -0
  256. package/skills/ae-tracking-matrix/scripts/plan_contract.py +200 -0
  257. package/skills/ae-tracking-matrix/scripts/plan_types.py +60 -0
  258. package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +169 -0
  259. package/skills/ae-tracking-matrix/scripts/sync_plan.py +296 -0
  260. package/skills/ae-tracking-matrix/scripts/upload_plan.py +340 -0
  261. package/dist/chunk-AMBFK2K3.js +0 -28
@@ -9,11 +9,11 @@ import {
9
9
  postAgentApi,
10
10
  putAgentApi,
11
11
  uploadAgentApi
12
- } from "./chunk-VDICGXCY.js";
12
+ } from "./chunk-F2VFZUGG.js";
13
13
  import {
14
14
  TeAgentApiError,
15
15
  createTeAgentApiError
16
- } from "./chunk-JSBLCLFE.js";
16
+ } from "./chunk-5M5LBRR3.js";
17
17
  import {
18
18
  CliValidationError,
19
19
  isApiErrorType
@@ -7,10 +7,10 @@ import {
7
7
  rememberBusinessConfig,
8
8
  reserveBusinessSkillContext,
9
9
  syncBusinessSkills
10
- } from "./chunk-CG773QXN.js";
10
+ } from "./chunk-DWBYNGSR.js";
11
11
  import {
12
12
  peekCliToken
13
- } from "./chunk-SOSFRU3O.js";
13
+ } from "./chunk-HTZ2MLYA.js";
14
14
  import {
15
15
  getActiveHost,
16
16
  getConfigDir
@@ -31,7 +31,20 @@ function invalidateBusinessSkillSynchronization() {
31
31
  }
32
32
  async function refreshEnvironmentConfig(host, options = {}) {
33
33
  const normalized = normalizeUrl(host);
34
- const skipped = (reason) => ({
34
+ const progress = options.progress ?? (() => {
35
+ });
36
+ const finish = (result2) => {
37
+ const skills = result2.skills;
38
+ if (skills.status === "success") {
39
+ progress(`Skills synchronized: ${skills.installed.length} installed or updated, ${skills.removed.length} removed.`);
40
+ } else if (skills.status === "skipped") {
41
+ progress(`Skill synchronization skipped: ${skills.reason}`);
42
+ } else {
43
+ progress(`Skill synchronization incomplete (${skills.status}). Run: ae-cli config refresh`);
44
+ }
45
+ return result2;
46
+ };
47
+ const skipped = (reason) => finish({
35
48
  host: normalized,
36
49
  businesses: {},
37
50
  source: "unavailable",
@@ -67,12 +80,12 @@ async function refreshEnvironmentConfig(host, options = {}) {
67
80
  generation,
68
81
  isCurrentContext: localActiveEnvironment
69
82
  })) {
70
- return {
83
+ return finish({
71
84
  host: normalized,
72
85
  businesses: {},
73
86
  source: "remote",
74
87
  skills: { status: "skipped", reason: "A newer environment refresh superseded this response." }
75
- };
88
+ });
76
89
  }
77
90
  rememberBusinessConfig(normalized, token, config.businesses);
78
91
  const result = {
@@ -83,9 +96,9 @@ async function refreshEnvironmentConfig(host, options = {}) {
83
96
  };
84
97
  if (config.businesses === void 0) {
85
98
  result.skills = { status: "skipped", reason: "This server does not provide business states; existing Skills were preserved." };
86
- return result;
99
+ return finish(result);
87
100
  }
88
- if (!synchronize || !localActiveEnvironment()) return result;
101
+ if (!synchronize || !localActiveEnvironment()) return finish(result);
89
102
  try {
90
103
  const syncOptions = {
91
104
  skillsDirectory: path.join(getLocalCliPackageInfo().root, "skills"),
@@ -93,6 +106,7 @@ async function refreshEnvironmentConfig(host, options = {}) {
93
106
  tokenFingerprint: fingerprint,
94
107
  businesses: config.businesses,
95
108
  packageVersion: getLocalCliPackageInfo().version,
109
+ onlyIfChanged: options.onlyIfChanged,
96
110
  generation,
97
111
  isCurrentContext: localActiveEnvironment
98
112
  };
@@ -100,18 +114,18 @@ async function refreshEnvironmentConfig(host, options = {}) {
100
114
  const adoption = syncBusinessSkills({ ...syncOptions, mode: "adopt" });
101
115
  if (["failed", "busy", "stale"].includes(adoption.status)) {
102
116
  result.skills = adoption;
103
- return result;
117
+ return finish(result);
104
118
  }
105
119
  }
106
120
  result.skills = syncBusinessSkills(syncOptions);
107
121
  } catch {
108
122
  result.skills = { status: "failed", reason: "Skill synchronization could not complete. Retry: ae-cli config refresh" };
109
123
  }
110
- return result;
124
+ return finish(result);
111
125
  }
112
- async function refreshEnvironmentAfterLogin(host) {
126
+ async function refreshEnvironmentAfterLogin(host, options = {}) {
113
127
  try {
114
- const result = await refreshEnvironmentConfig(host);
128
+ const result = await refreshEnvironmentConfig(host, options);
115
129
  if (!["success", "skipped"].includes(result.skills.status)) {
116
130
  process.stderr.write("[ae-cli] Some Skills could not be synchronized. Run: ae-cli config refresh\n");
117
131
  }
@@ -125,8 +139,29 @@ async function refreshEnvironmentAfterLogin(host) {
125
139
  }
126
140
  }
127
141
 
142
+ // src/commands/environment-output.ts
143
+ function environmentRefreshOutput(program, result) {
144
+ const options = program.opts();
145
+ if (!process.stdout.isTTY || !process.stderr.isTTY || options.jq || options.format === "json" && program.getOptionValueSource("format") === "cli") {
146
+ return result;
147
+ }
148
+ const { skills, ...environment } = result;
149
+ return {
150
+ ...environment,
151
+ skills: {
152
+ status: skills.status,
153
+ installed_count: "installed" in skills ? skills.installed.length : 0,
154
+ removed_count: "removed" in skills ? skills.removed.length : 0,
155
+ ..."skipped" in skills && skills.skipped.length ? { skipped_count: skills.skipped.length } : {},
156
+ ..."failed" in skills && skills.failed.length ? { failed_count: skills.failed.length } : {},
157
+ ..."reason" in skills ? { reason: skills.reason } : {}
158
+ }
159
+ };
160
+ }
161
+
128
162
  export {
129
163
  invalidateBusinessSkillSynchronization,
130
164
  refreshEnvironmentConfig,
131
- refreshEnvironmentAfterLogin
165
+ refreshEnvironmentAfterLogin,
166
+ environmentRefreshOutput
132
167
  };
@@ -31,6 +31,64 @@ function resolveEvaluationHost(host) {
31
31
  return endpoint.toString().replace(/\/+$/, "").replace(/\/agent$/, "");
32
32
  }
33
33
 
34
+ // src/core/eval-onboarding.ts
35
+ function evaluationResponseStatus(httpStatus, contentType, body, source = "api") {
36
+ const error = body && typeof body === "object" ? body.error : void 0;
37
+ const code = error && typeof error === "object" ? error.code : void 0;
38
+ const businessError = typeof code === "string" && /^[A-Z][A-Z0-9_]{0,127}$/.test(code);
39
+ const html = contentType?.toLowerCase().includes("text/html");
40
+ if (httpStatus === 403) return "access_not_granted";
41
+ if (httpStatus === 404 && !businessError) {
42
+ return source === "session" ? "availability_unknown" : "module_not_detected";
43
+ }
44
+ if (httpStatus >= 500) return "availability_unknown";
45
+ if (html && httpStatus >= 200 && httpStatus < 300) {
46
+ return source === "session" ? "availability_unknown" : "module_not_detected";
47
+ }
48
+ return void 0;
49
+ }
50
+ function buildEvaluationOnboardingPayload(status, host) {
51
+ const nextSteps = {
52
+ module_not_detected: [
53
+ "The evaluation API was not detected. This optional module may be absent, or its route may be misconfigured; installation is not confirmed.",
54
+ "Contact your ThinkingData service representative (Customer Success Manager or Technical Support) to verify deployment and routing, install AI Evaluation Center if needed, and enable access.",
55
+ "After activation, open AI Evaluation Center from the app launcher and ask an administrator to assign the required project role."
56
+ ],
57
+ access_not_granted: [
58
+ "This request was denied. The denial may come from the gateway, module access policy, or the selected project; it does not establish cluster-wide installation or access.",
59
+ "Ask your system administrator or ThinkingData support to check the denied request and grant the required module access or target project role (READER / EDITOR / ADMIN).",
60
+ "Stop only the denied operation; independent authorized operations may continue. Stop a whole project or module only when that access scope is confirmed. Do not reinstall the module or refresh credentials solely because of HTTP 403."
61
+ ],
62
+ token_missing: [
63
+ "AE_EVAL_ACCESS_TOKEN is unset. No evaluation request was sent; module availability and service health have not been checked.",
64
+ "If AI Evaluation Center is available in the app launcher, obtain a session token through its web console or POST /agenteval/api/v1/auth/session and set AE_EVAL_ACCESS_TOKEN securely.",
65
+ "If the module entry is unavailable, contact your administrator or ThinkingData support to verify deployment and enable module access and the required project role."
66
+ ],
67
+ availability_unknown: [
68
+ "Evaluation availability could not be confirmed. A gateway outage, missing sandbox session route, login page, or invalid response does not prove the module is uninstalled.",
69
+ "Check the selected --host and network path; ask your administrator or ThinkingData support to verify evaluation service health and gateway/session routing.",
70
+ "A failed write response leaves the write result unconfirmed; the server may already have accepted it. Do not resubmit the write blindly. Once connectivity is restored, use authorized read-only status checks to reconcile the result before deciding whether to retry.",
71
+ "Do not rotate credentials or request installation based only on this response."
72
+ ]
73
+ };
74
+ return {
75
+ status,
76
+ host: resolveEvaluationHost(host),
77
+ module_name: "AI Evaluation Center (Agent Evaluation Platform)",
78
+ tagline: "Repeatable, traceable, reusable Agent quality evaluation before release and during iteration.",
79
+ highlights: [
80
+ { pillar: "Datasets", summary: "Manage single/multi-turn cases and immutable versions; import CSV/JSON or convert AI Monitor traces into datasets." },
81
+ { pillar: "Evaluators", summary: "Use scoring templates or custom LLM judges, calibrate against human labels, and optimize evaluator prompts." },
82
+ { pillar: "Evaluation Runs", summary: "Test live Agents or score preset outputs, schedule regression runs, export low-score cases, and inspect execution traces." }
83
+ ],
84
+ next_steps: nextSteps[status],
85
+ agent_instruction: [
86
+ status === "access_not_granted" ? "Stop only the denied operation. Independent authorized operations may continue. Do not probe other commands to bypass the denial; stop a whole project or module only when that access scope is confirmed." : status === "availability_unknown" ? "Stop blind retries of the failed operation and alternate flags. For a write, report that its result is unconfirmed: the server may already have accepted it. Do not resubmit blindly. Once connectivity is restored, use authorized read-only status checks to reconcile the result before deciding whether to retry." : "Stop evaluation commands for the affected host until the reported condition changes. Do not try alternate commands or flags.",
87
+ "Continue independent local work; save generated CSV/JSON and confirm its actual path before saying it is saved. Explain the evidence and uncertainty in the user's language, briefly relate the three capabilities to their task, and present the relevant next steps. Never ask the user to paste a token into chat."
88
+ ].join(" ")
89
+ };
90
+ }
91
+
34
92
  // src/core/eval-client.ts
35
93
  import { open, unlink } from "fs/promises";
36
94
  import { resolve } from "path";
@@ -40,6 +98,7 @@ var EvalApiError = class extends Error {
40
98
  httpStatus;
41
99
  hint;
42
100
  details;
101
+ onboarding;
43
102
  constructor(message, options) {
44
103
  const redact = evaluationErrorRedactor([
45
104
  ...options.sensitiveValues ?? [],
@@ -51,6 +110,7 @@ var EvalApiError = class extends Error {
51
110
  this.httpStatus = options.httpStatus;
52
111
  this.hint = options.hint === void 0 ? void 0 : redact(options.hint);
53
112
  this.details = options.details === void 0 ? void 0 : redact(options.details);
113
+ this.onboarding = options.onboarding === void 0 ? void 0 : redact(options.onboarding);
54
114
  }
55
115
  };
56
116
  function evaluationErrorRedactor(secrets) {
@@ -100,7 +160,7 @@ async function evalRequest(options) {
100
160
  redirect: "error",
101
161
  signal: controller.signal
102
162
  });
103
- if (response.ok && options.responseType === "bytes") {
163
+ if (response.ok && options.responseType === "bytes" && !response.headers.get("content-type")?.toLowerCase().includes("text/html")) {
104
164
  bytes = new Uint8Array(await response.arrayBuffer());
105
165
  } else {
106
166
  responseText = await response.text();
@@ -112,20 +172,41 @@ async function evalRequest(options) {
112
172
  throw new EvalApiError(`Evaluation API request timed out after ${timeoutMs} ms.`, {
113
173
  code: "EVAL_API_TIMEOUT",
114
174
  httpStatus: 0,
115
- hint: "Verify the evaluation platform is reachable at the configured endpoint."
175
+ hint: "Verify the evaluation platform is reachable at the configured endpoint.",
176
+ onboarding: buildEvaluationOnboardingPayload("availability_unknown", options.baseUrl)
116
177
  });
117
178
  }
118
179
  throw new EvalApiError("Evaluation API request failed before a response was received.", {
119
180
  code: "EVAL_API_NETWORK_ERROR",
120
181
  httpStatus: 0,
121
- hint: "Verify the --endpoint URL and network path."
182
+ hint: "Verify the --host URL and network path.",
183
+ onboarding: buildEvaluationOnboardingPayload("availability_unknown", options.baseUrl)
122
184
  });
123
185
  } finally {
124
186
  clearTimeout(timeout);
125
187
  }
126
188
  logEvalRequest(options.method, url, response.status);
127
189
  if (bytes !== void 0) return bytes;
128
- const responseBody = parseEvalResponseBody(responseText, response.status);
190
+ let responseBody;
191
+ try {
192
+ if (response.headers.get("content-type")?.toLowerCase().includes("text/html")) {
193
+ throw new EvalApiError("Evaluation API returned an HTML response instead of the requested API data.", {
194
+ code: "EVAL_API_INVALID_RESPONSE",
195
+ httpStatus: response.status
196
+ });
197
+ }
198
+ responseBody = parseEvalResponseBody(responseText, response.status);
199
+ } catch (error) {
200
+ if (!(error instanceof EvalApiError)) throw error;
201
+ const status = evaluationResponseStatus(response.status, response.headers.get("content-type"), void 0);
202
+ throw new EvalApiError(error.message, {
203
+ code: error.code,
204
+ httpStatus: error.httpStatus,
205
+ hint: error.hint,
206
+ sensitiveValues: Object.values(options.headers).flatMap((value) => [value, value.replace(/^Bearer\s+/i, "")]),
207
+ onboarding: buildEvaluationOnboardingPayload(status ?? "availability_unknown", options.baseUrl)
208
+ });
209
+ }
129
210
  if (!response.ok) {
130
211
  const sensitiveValues = Object.values(options.headers).flatMap((value) => [value, value.replace(/^Bearer\s+/i, "")]);
131
212
  if (isRecord(options.body)) {
@@ -133,7 +214,13 @@ async function evalRequest(options) {
133
214
  if (typeof options.body[key] === "string") sensitiveValues.push(options.body[key]);
134
215
  }
135
216
  }
136
- throw evalErrorFromBody(responseBody, response.status, sensitiveValues);
217
+ const status = evaluationResponseStatus(response.status, response.headers.get("content-type"), responseBody);
218
+ throw evalErrorFromBody(
219
+ responseBody,
220
+ response.status,
221
+ sensitiveValues,
222
+ status ? buildEvaluationOnboardingPayload(status, options.baseUrl) : void 0
223
+ );
137
224
  }
138
225
  return responseBody;
139
226
  }
@@ -189,7 +276,7 @@ function parseEvalResponseBody(text, httpStatus) {
189
276
  });
190
277
  }
191
278
  }
192
- function evalErrorFromBody(body, httpStatus, sensitiveValues) {
279
+ function evalErrorFromBody(body, httpStatus, sensitiveValues, onboarding) {
193
280
  const error = body?.error;
194
281
  if (isRecord(error) && typeof error.message === "string" && error.message.trim()) {
195
282
  return new EvalApiError(error.message.trim(), {
@@ -197,12 +284,14 @@ function evalErrorFromBody(body, httpStatus, sensitiveValues) {
197
284
  httpStatus,
198
285
  hint: typeof error.details === "string" ? error.details : void 0,
199
286
  details: isRecord(error.details) ? error.details : void 0,
200
- sensitiveValues
287
+ sensitiveValues,
288
+ onboarding
201
289
  });
202
290
  }
203
291
  return new EvalApiError(`Evaluation API returned HTTP ${httpStatus}.`, {
204
292
  code: `EVAL_API_HTTP_${httpStatus}`,
205
293
  httpStatus,
294
+ onboarding,
206
295
  hint: httpStatus >= 500 ? "The server response was suppressed. Check the evaluation platform logs; the CLI did not retry." : void 0
207
296
  });
208
297
  }
@@ -227,6 +316,8 @@ function redactEvalLogUrl(url) {
227
316
 
228
317
  export {
229
318
  resolveEvaluationHost,
319
+ evaluationResponseStatus,
320
+ buildEvaluationOnboardingPayload,
230
321
  EvalApiError,
231
322
  evalRequest,
232
323
  evalDownloadFile
@@ -1,17 +1,17 @@
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-3ULDJJTZ.js";
10
10
  import {
11
11
  CapabilityGatewayError,
12
12
  fetchCapabilityGateway,
13
13
  requestCapabilityGateway
14
- } from "./chunk-HRUOV6EQ.js";
14
+ } from "./chunk-4XKTRCRK.js";
15
15
  import {
16
16
  PermissionError
17
17
  } from "./chunk-Z3Q2AEIN.js";
@@ -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
 
@@ -1,15 +1,15 @@
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
  withOutputMetadata
7
- } from "./chunk-YULUBP3R.js";
7
+ } from "./chunk-3ULDJJTZ.js";
8
8
  import {
9
- dryRunCapability,
9
+ dryRunCapabilityWithEnvelope,
10
10
  executeCapabilityWithEnvelope,
11
- validateCapability
12
- } from "./chunk-HRUOV6EQ.js";
11
+ validateCapabilityWithEnvelope
12
+ } from "./chunk-4XKTRCRK.js";
13
13
  import {
14
14
  CliValidationError
15
15
  } from "./chunk-Z3Q2AEIN.js";
@@ -107,27 +107,32 @@ function createCapabilityCommand(config) {
107
107
  const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
108
108
  const requestHost = config.requestHost ?? ctx.host();
109
109
  const input = withLifecycleRequestId(config, config.buildInput(ctx));
110
+ const preparedInput = config.prepareInput ? await config.prepareInput(ctx, input) : input;
110
111
  const evidence = config.intentConsistency ? verifyDefinitionIntent(ctx, config.intentConsistency) : void 0;
111
112
  const intentMeta = evidence ? { intent_consistency: evidence } : void 0;
112
- return withOutputMetadata(await validateCapability(requestHost, gatewayDomain, config.capabilityId, input), intentMeta);
113
+ const result = await validateCapabilityWithEnvelope(requestHost, gatewayDomain, config.capabilityId, preparedInput);
114
+ return withOutputMetadata(result.data, { ...result.meta, ...intentMeta });
113
115
  },
114
116
  dryRun: async (ctx) => {
115
117
  const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
116
118
  const requestHost = config.requestHost ?? ctx.host();
117
119
  const input = withLifecycleRequestId(config, config.buildInput(ctx));
120
+ const preparedInput = config.prepareInput ? await config.prepareInput(ctx, input) : input;
118
121
  const evidence = config.intentConsistency ? verifyDefinitionIntent(ctx, config.intentConsistency) : void 0;
119
122
  const intentMeta = evidence ? { intent_consistency: evidence } : void 0;
120
- return withOutputMetadata(await dryRunCapability(requestHost, gatewayDomain, config.capabilityId, input), intentMeta);
123
+ const result = await dryRunCapabilityWithEnvelope(requestHost, gatewayDomain, config.capabilityId, preparedInput);
124
+ return withOutputMetadata(result.data, { ...result.meta, ...intentMeta });
121
125
  },
122
126
  execute: async (ctx) => {
123
127
  const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
124
128
  const requestHost = config.requestHost ?? ctx.host();
125
129
  const input = withLifecycleRequestId(config, config.buildInput(ctx));
130
+ const preparedInput = config.prepareInput ? await config.prepareInput(ctx, input) : input;
126
131
  const evidence = config.intentConsistency ? verifyDefinitionIntent(ctx, config.intentConsistency) : void 0;
127
132
  const intentMeta = evidence ? { intent_consistency: evidence } : void 0;
128
- announceDispatch(config.capabilityId, input);
129
- const result = await executeCapabilityWithEnvelope(requestHost, gatewayDomain, config.capabilityId, input);
130
- const data = config.postProcess ? await config.postProcess(result.data, input, ctx) : result.data;
133
+ announceDispatch(config.capabilityId, preparedInput);
134
+ const result = await executeCapabilityWithEnvelope(requestHost, gatewayDomain, config.capabilityId, preparedInput);
135
+ const data = config.postProcess ? await config.postProcess(result.data, preparedInput, ctx) : result.data;
131
136
  return withOutputMetadata(data, { ...result.meta, ...intentMeta });
132
137
  }
133
138
  };
@@ -12,8 +12,8 @@ import {
12
12
  shouldNotifyCompat,
13
13
  shouldSkipAutoSync,
14
14
  shouldSkipCompatCheck
15
- } from "./chunk-CG773QXN.js";
16
- import "./chunk-SOSFRU3O.js";
15
+ } from "./chunk-DWBYNGSR.js";
16
+ import "./chunk-HTZ2MLYA.js";
17
17
  import "./chunk-4PSTYEG5.js";
18
18
  import "./chunk-Z3Q2AEIN.js";
19
19
  export {