@thinkingai/ae-cli 6.1.19 → 6.1.21

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 (370) hide show
  1. package/README.md +96 -38
  2. package/README.zh.md +96 -38
  3. package/dist/{auth-QPEVVBKT.js → auth-XZNXFRJS.js} +236 -127
  4. package/dist/{capability-ASI62I4A.js → capability-FYTU3X6L.js} +80 -37
  5. package/dist/{chunk-QL6R6TSK.js → chunk-4NRCTUZJ.js} +27045 -477
  6. package/dist/{chunk-JYMGHGCE.js → chunk-57RRFUEZ.js} +42 -15
  7. package/dist/chunk-6ZIQV5GW.js +26 -0
  8. package/dist/{chunk-KZ6ZHF5J.js → chunk-7FTTULED.js} +14 -14
  9. package/dist/chunk-7XGFSUOM.js +623 -0
  10. package/dist/chunk-CCS66K4K.js +155 -0
  11. package/dist/{chunk-B5HMQAOM.js → chunk-DVMLWQD4.js} +8 -186
  12. package/dist/{chunk-KEWVSO64.js → chunk-DX5CDO34.js} +28 -18
  13. package/dist/chunk-EQ255HKO.js +38248 -0
  14. package/dist/{chunk-6QK7SYYY.js → chunk-HBGADCKA.js} +29 -37
  15. package/dist/{chunk-GJXRF7Y6.js → chunk-HFGZGYCG.js} +54 -81
  16. package/dist/chunk-JOCDD4ON.js +15 -0
  17. package/dist/{chunk-TKHSULJT.js → chunk-KPQY44JQ.js} +6 -0
  18. package/dist/{chunk-FR2EDAQM.js → chunk-MAPZ7VB6.js} +90 -2
  19. package/dist/chunk-V2NUHPXF.js +196 -0
  20. package/dist/{chunk-S5PONFBM.js → chunk-VYXXOKYS.js} +9 -9
  21. package/dist/{community-report-client-6OL6GBQW.js → community-report-client-CU22W53K.js} +2 -4
  22. package/dist/{config-XNMACCKX.js → config-XO3LI3SA.js} +8 -9
  23. package/dist/context-IFJI3LIT.js +46 -0
  24. package/dist/{data-integration-4NZGZ45E.js → data-integration-HNGUKFIC.js} +55 -44
  25. package/dist/index.js +122 -112
  26. package/dist/{local-data-upload-client-EFHDLXFG.js → local-data-upload-client-GTRIT64F.js} +4 -5
  27. package/dist/{memory-HBJQ2GC5.js → memory-QGPSNCQS.js} +4 -6
  28. package/dist/{metadata-62EWBEIG.js → metadata-DI5BMYFU.js} +8 -10
  29. package/dist/{model-BHLJ2QMT.js → model-RNPQXIBI.js} +4 -6
  30. package/dist/{personal-semantic-preference-JBVMAI7L.js → personal-semantic-preference-5C3WUXFI.js} +11 -10
  31. package/dist/{project-semantic-BQ4MPUS5.js → project-semantic-3LF6Q6JZ.js} +29 -25
  32. package/dist/{sync-MUWPRM5I.js → sync-O45NXEQY.js} +7 -8
  33. package/dist/{te-agent-WQZTMEK4.js → te-agent-K5MSPNHJ.js} +393 -90
  34. package/dist/{te-analysis-MNCG65LU.js → te-analysis-AISWCOOZ.js} +1175 -377
  35. package/dist/{te-community-BNE6KREL.js → te-community-4OYU3BDA.js} +10 -33
  36. package/dist/{te-dataops-TXLKM2W6.js → te-dataops-NFIPB6FX.js} +19 -20
  37. package/dist/{te-engage-TPKLRVTL.js → te-engage-BAM3GBFX.js} +13 -15
  38. package/dist/{te-experiment-6BYKTCY7.js → te-experiment-GUTZXZ5Z.js} +132 -16
  39. package/dist/te-kb-3TS73NO6.js +1992 -0
  40. package/dist/{te-system-44LZJDTQ.js → te-system-STMHLS5J.js} +12 -9
  41. package/dist/{te-team-XMP47YXE.js → te-team-3I5AOX3N.js} +6 -8
  42. package/dist/{update-UODFOZ4P.js → update-RZXLPCRH.js} +7 -8
  43. package/package.json +29 -19
  44. package/skills/ae-agent/SKILL.md +30 -13
  45. package/skills/ae-agent/references/agent-distribution.md +94 -0
  46. package/skills/ae-agent/references/approval-request.md +4 -0
  47. package/skills/ae-agent/references/command_index.md +9 -2
  48. package/skills/ae-agent/references/create-automation.md +20 -2
  49. package/skills/ae-agent/references/get-agent-context.md +70 -0
  50. package/skills/ae-agent/references/list-automations.md +18 -3
  51. package/skills/ae-agent/references/list-mcp-credentials.md +1 -1
  52. package/skills/ae-agent/references/mcp-token.md +3 -3
  53. package/skills/ae-agent/references/set-mcp-credential.md +0 -1
  54. package/skills/ae-agent/references/update-automation.md +18 -0
  55. package/skills/ae-analysis/SKILL.md +101 -79
  56. package/skills/ae-analysis/references/adhoc_export.md +11 -18
  57. package/skills/ae-analysis/references/adhoc_run.md +17 -7
  58. package/skills/ae-analysis/references/agent_review_detail.md +11 -0
  59. package/skills/ae-analysis/references/agent_review_evidence.md +46 -0
  60. package/skills/ae-analysis/references/agent_review_list.md +9 -0
  61. package/skills/ae-analysis/references/agent_review_preflight.md +96 -0
  62. package/skills/ae-analysis/references/agent_review_priorities_comparisons.md +76 -0
  63. package/skills/ae-analysis/references/agent_review_records.md +9 -0
  64. package/skills/ae-analysis/references/agent_review_retry.md +12 -0
  65. package/skills/ae-analysis/references/agent_review_review.md +16 -0
  66. package/skills/ae-analysis/references/agent_review_submit_to_page.md +184 -0
  67. package/skills/ae-analysis/references/ai_models/attribution.md +29 -0
  68. package/skills/ae-analysis/references/ai_models/distribution.md +40 -0
  69. package/skills/ae-analysis/references/ai_models/event.md +108 -0
  70. package/skills/ae-analysis/references/ai_models/funnel.md +46 -0
  71. package/skills/ae-analysis/references/ai_models/heat_map.md +26 -0
  72. package/skills/ae-analysis/references/ai_models/interval.md +20 -0
  73. package/skills/ae-analysis/references/ai_models/path.md +38 -0
  74. package/skills/ae-analysis/references/ai_models/prop_analysis.md +39 -0
  75. package/skills/ae-analysis/references/ai_models/rank_list.md +25 -0
  76. package/skills/ae-analysis/references/ai_models/retention.md +70 -0
  77. package/skills/ae-analysis/references/ai_models/revenue.md +28 -0
  78. package/skills/ae-analysis/references/ai_models/sql.md +74 -0
  79. package/skills/ae-analysis/references/ai_models/tag.md +19 -0
  80. package/skills/ae-analysis/references/ai_models.md +32 -453
  81. package/skills/ae-analysis/references/alert_create.md +7 -7
  82. package/skills/ae-analysis/references/alert_delete.md +4 -6
  83. package/skills/ae-analysis/references/alert_detail_list.md +7 -9
  84. package/skills/ae-analysis/references/alert_get.md +5 -7
  85. package/skills/ae-analysis/references/alert_job_list.md +4 -6
  86. package/skills/ae-analysis/references/alert_list.md +6 -8
  87. package/skills/ae-analysis/references/alert_notice_config_list.md +4 -6
  88. package/skills/ae-analysis/references/alert_start.md +5 -7
  89. package/skills/ae-analysis/references/alert_stop.md +5 -7
  90. package/skills/ae-analysis/references/alert_update.md +8 -8
  91. package/skills/ae-analysis/references/analysis_data_export.md +72 -0
  92. package/skills/ae-analysis/references/analysis_data_retrieval.md +32 -196
  93. package/skills/ae-analysis/references/analysis_gateway_assets.md +23 -180
  94. package/skills/ae-analysis/references/analysis_interpretation.md +37 -17
  95. package/skills/ae-analysis/references/asset_abnormal_get.md +0 -1
  96. package/skills/ae-analysis/references/asset_abnormal_list.md +0 -1
  97. package/skills/ae-analysis/references/asset_authentication_export.md +4 -0
  98. package/skills/ae-analysis/references/asset_authentication_list.md +7 -1
  99. package/skills/ae-analysis/references/asset_authentication_update.md +5 -1
  100. package/skills/ae-analysis/references/asset_batch_dashboard_schedule_freeze.md +8 -6
  101. package/skills/ae-analysis/references/asset_batch_delete.md +6 -6
  102. package/skills/ae-analysis/references/asset_batch_disable_auto_backup.md +4 -5
  103. package/skills/ae-analysis/references/asset_batch_disable_auto_update.md +5 -6
  104. package/skills/ae-analysis/references/asset_batch_handover.md +4 -5
  105. package/skills/ae-analysis/references/asset_batch_info_export.md +4 -5
  106. package/skills/ae-analysis/references/asset_batch_sql_export.md +5 -6
  107. package/skills/ae-analysis/references/asset_dependency_list.md +4 -5
  108. package/skills/ae-analysis/references/asset_export.md +4 -5
  109. package/skills/ae-analysis/references/asset_impact_list.md +5 -9
  110. package/skills/ae-analysis/references/asset_lineage_get.md +5 -6
  111. package/skills/ae-analysis/references/asset_list.md +4 -5
  112. package/skills/ae-analysis/references/asset_query_history_list.md +4 -8
  113. package/skills/ae-analysis/references/asset_recent_list.md +0 -1
  114. package/skills/ae-analysis/references/asset_search.md +12 -9
  115. package/skills/ae-analysis/references/asset_url_get.md +3 -4
  116. package/skills/ae-analysis/references/bi_panel_copy.md +2 -2
  117. package/skills/ae-analysis/references/bi_panel_page_data_export.md +4 -12
  118. package/skills/ae-analysis/references/bi_panel_page_data_run.md +2 -0
  119. package/skills/ae-analysis/references/catalog_export.md +4 -17
  120. package/skills/ae-analysis/references/catalog_list.md +4 -4
  121. package/skills/ae-analysis/references/check_delete.md +5 -7
  122. package/skills/ae-analysis/references/check_export.md +11 -11
  123. package/skills/ae-analysis/references/check_get.md +8 -10
  124. package/skills/ae-analysis/references/check_list.md +4 -6
  125. package/skills/ae-analysis/references/check_retry.md +8 -10
  126. package/skills/ae-analysis/references/check_run.md +2 -4
  127. package/skills/ae-analysis/references/command_index.md +46 -28
  128. package/skills/ae-analysis/references/cross_source_config.md +84 -0
  129. package/skills/ae-analysis/references/dashboard_report_data_export.md +5 -13
  130. package/skills/ae-analysis/references/dashboard_report_data_run.md +1 -1
  131. package/skills/ae-analysis/references/dashboard_update.md +15 -4
  132. package/skills/ae-analysis/references/datatable_columns_get.md +0 -1
  133. package/skills/ae-analysis/references/datatable_influence_list.md +0 -1
  134. package/skills/ae-analysis/references/datatable_version_get.md +0 -1
  135. package/skills/ae-analysis/references/datatable_version_list.md +0 -1
  136. package/skills/ae-analysis/references/debug_device_add.md +1 -2
  137. package/skills/ae-analysis/references/drilldown_entities_export.md +3 -3
  138. package/skills/ae-analysis/references/drilldown_events_export.md +3 -2
  139. package/skills/ae-analysis/references/drilldown_user_events_export.md +2 -2
  140. package/skills/ae-analysis/references/entity_detail_export.md +3 -2
  141. package/skills/ae-analysis/references/entity_detail_run.md +1 -0
  142. package/skills/ae-analysis/references/event_blacklist_add.md +5 -7
  143. package/skills/ae-analysis/references/event_blacklist_list.md +4 -6
  144. package/skills/ae-analysis/references/event_blacklist_update.md +6 -8
  145. package/skills/ae-analysis/references/event_changelog_list.md +0 -1
  146. package/skills/ae-analysis/references/event_create.md +0 -1
  147. package/skills/ae-analysis/references/event_detail_export.md +3 -2
  148. package/skills/ae-analysis/references/event_detail_run.md +1 -0
  149. package/skills/ae-analysis/references/event_export.md +0 -1
  150. package/skills/ae-analysis/references/event_get.md +0 -1
  151. package/skills/ae-analysis/references/event_hide_update.md +0 -1
  152. package/skills/ae-analysis/references/event_influence_list.md +0 -1
  153. package/skills/ae-analysis/references/event_list.md +0 -1
  154. package/skills/ae-analysis/references/event_property_bundle_export.md +5 -14
  155. package/skills/ae-analysis/references/event_property_bundle_import.md +2 -6
  156. package/skills/ae-analysis/references/event_relation_update.md +0 -1
  157. package/skills/ae-analysis/references/event_update.md +0 -1
  158. package/skills/ae-analysis/references/exchange_config_update.md +0 -1
  159. package/skills/ae-analysis/references/exchange_rate_refresh.md +0 -1
  160. package/skills/ae-analysis/references/exchange_rule_list.md +0 -1
  161. package/skills/ae-analysis/references/exchange_rule_update.md +0 -1
  162. package/skills/ae-analysis/references/exchange_rule_validate.md +0 -1
  163. package/skills/ae-analysis/references/governance_recommendation_decisions.md +23 -0
  164. package/skills/ae-analysis/references/governance_recommendation_export.md +108 -0
  165. package/skills/ae-analysis/references/governance_recommendation_submit.md +41 -0
  166. package/skills/ae-analysis/references/history_tag_data_drilldown_export.md +4 -4
  167. package/skills/ae-analysis/references/history_tag_data_export.md +3 -3
  168. package/skills/ae-analysis/references/ingest_error_list.md +7 -9
  169. package/skills/ae-analysis/references/ingest_summary.md +6 -8
  170. package/skills/ae-analysis/references/live_data_export.md +10 -10
  171. package/skills/ae-analysis/references/live_data_list.md +7 -9
  172. package/skills/ae-analysis/references/metadata_resolution.md +78 -0
  173. package/skills/ae-analysis/references/metric_export.md +0 -1
  174. package/skills/ae-analysis/references/metric_get.md +0 -1
  175. package/skills/ae-analysis/references/metric_list.md +4 -5
  176. package/skills/ae-analysis/references/metric_update.md +0 -1
  177. package/skills/ae-analysis/references/operation_record_export.md +4 -5
  178. package/skills/ae-analysis/references/operation_record_list.md +4 -5
  179. package/skills/ae-analysis/references/personal_semantic_preference_list.md +18 -1
  180. package/skills/ae-analysis/references/plan_change_log_export.md +10 -10
  181. package/skills/ae-analysis/references/plan_change_log_list.md +4 -6
  182. package/skills/ae-analysis/references/plan_delete_items.md +2 -4
  183. package/skills/ae-analysis/references/plan_export.md +9 -9
  184. package/skills/ae-analysis/references/plan_generate.md +2 -4
  185. package/skills/ae-analysis/references/plan_get.md +4 -6
  186. package/skills/ae-analysis/references/plan_import_excel.md +6 -8
  187. package/skills/ae-analysis/references/plan_save_items.md +2 -4
  188. package/skills/ae-analysis/references/plan_sync_from_meta.md +4 -6
  189. package/skills/ae-analysis/references/project_access_detail_get.md +0 -1
  190. package/skills/ae-analysis/references/project_data_power_get.md +0 -1
  191. package/skills/ae-analysis/references/project_data_power_list.md +0 -1
  192. package/skills/ae-analysis/references/project_data_power_upsert.md +0 -1
  193. package/skills/ae-analysis/references/project_entity_create.md +0 -1
  194. package/skills/ae-analysis/references/project_entity_event_list.md +0 -1
  195. package/skills/ae-analysis/references/project_entity_get.md +0 -1
  196. package/skills/ae-analysis/references/project_entity_list.md +0 -1
  197. package/skills/ae-analysis/references/project_entity_update.md +0 -1
  198. package/skills/ae-analysis/references/project_function_list.md +0 -1
  199. package/skills/ae-analysis/references/project_info_get.md +0 -1
  200. package/skills/ae-analysis/references/project_info_list.md +0 -1
  201. package/skills/ae-analysis/references/project_info_update.md +0 -1
  202. package/skills/ae-analysis/references/project_mark_time_create.md +0 -1
  203. package/skills/ae-analysis/references/project_mark_time_list.md +0 -1
  204. package/skills/ae-analysis/references/project_mark_time_update.md +0 -1
  205. package/skills/ae-analysis/references/project_member_add.md +6 -5
  206. package/skills/ae-analysis/references/project_member_batch_update.md +0 -1
  207. package/skills/ae-analysis/references/project_member_candidate_list.md +4 -3
  208. package/skills/ae-analysis/references/project_member_handover_run.md +2 -3
  209. package/skills/ae-analysis/references/project_member_list.md +0 -1
  210. package/skills/ae-analysis/references/project_member_receiver_list.md +0 -1
  211. package/skills/ae-analysis/references/project_member_update.md +0 -1
  212. package/skills/ae-analysis/references/project_owner_update.md +0 -1
  213. package/skills/ae-analysis/references/project_permission_binding_list.md +0 -1
  214. package/skills/ae-analysis/references/project_role_function_list.md +0 -1
  215. package/skills/ae-analysis/references/project_role_get.md +0 -1
  216. package/skills/ae-analysis/references/project_role_list.md +0 -1
  217. package/skills/ae-analysis/references/project_role_upsert.md +32 -2
  218. package/skills/ae-analysis/references/project_role_user_list.md +0 -1
  219. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +214 -0
  220. package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +93 -0
  221. package/skills/ae-analysis/references/project_timezone_get.md +0 -1
  222. package/skills/ae-analysis/references/project_timezone_overview.md +0 -1
  223. package/skills/ae-analysis/references/project_timezone_update.md +0 -1
  224. package/skills/ae-analysis/references/project_user_id_items_update.md +0 -1
  225. package/skills/ae-analysis/references/property_changelog_list.md +0 -1
  226. package/skills/ae-analysis/references/property_create.md +0 -1
  227. package/skills/ae-analysis/references/property_export.md +0 -1
  228. package/skills/ae-analysis/references/property_get.md +0 -1
  229. package/skills/ae-analysis/references/property_hide_update.md +0 -1
  230. package/skills/ae-analysis/references/property_influence_list.md +0 -1
  231. package/skills/ae-analysis/references/property_list.md +3 -4
  232. package/skills/ae-analysis/references/property_related_events.md +0 -1
  233. package/skills/ae-analysis/references/property_relation_update.md +0 -1
  234. package/skills/ae-analysis/references/property_update.md +0 -1
  235. package/skills/ae-analysis/references/report_create.md +4 -2
  236. package/skills/ae-analysis/references/report_data_export.md +11 -9
  237. package/skills/ae-analysis/references/report_data_run.md +14 -7
  238. package/skills/ae-analysis/references/report_get.md +5 -3
  239. package/skills/ae-analysis/references/report_list.md +2 -0
  240. package/skills/ae-analysis/references/report_update.md +5 -3
  241. package/skills/ae-analysis/references/rule_create.md +5 -6
  242. package/skills/ae-analysis/references/rule_delete.md +5 -5
  243. package/skills/ae-analysis/references/rule_list.md +3 -4
  244. package/skills/ae-analysis/references/rule_schema.md +3 -4
  245. package/skills/ae-analysis/references/rule_update.md +5 -6
  246. package/skills/ae-analysis/references/sdk_sample_generate.md +2 -4
  247. package/skills/ae-analysis/references/sql_table_columns.md +1 -1
  248. package/skills/ae-analysis/references/super_metadata_batch_create.md +1 -1
  249. package/skills/ae-analysis/references/super_metadata_batch_edit.md +1 -1
  250. package/skills/ae-analysis/references/system_member_add.md +1 -2
  251. package/skills/ae-analysis/references/system_member_status_update.md +1 -1
  252. package/skills/ae-analysis/references/system_ops_alert_contact_list.md +1 -1
  253. package/skills/ae-analysis/references/system_ops_alert_contact_test.md +0 -1
  254. package/skills/ae-analysis/references/system_query_monitor_overview.md +3 -3
  255. package/skills/ae-analysis/references/system_query_task_export.md +4 -14
  256. package/skills/ae-analysis/references/system_query_task_get.md +1 -1
  257. package/skills/ae-analysis/references/system_query_task_list.md +5 -6
  258. package/skills/ae-analysis/references/system_receiver_address_upsert.md +3 -3
  259. package/skills/ae-analysis/references/system_receiver_detection_get.md +1 -1
  260. package/skills/ae-analysis/references/system_third_party_login_disable.md +1 -1
  261. package/skills/ae-analysis/references/system_usage_trend_export.md +3 -12
  262. package/skills/ae-analysis/references/user_cluster_list.md +1 -1
  263. package/skills/ae-analysis/references/user_cluster_member_export.md +4 -4
  264. package/skills/ae-analysis/references/user_tag_create.md +23 -1
  265. package/skills/ae-analysis/references/user_tag_list.md +1 -1
  266. package/skills/ae-analysis/references/user_tag_member_export.md +4 -4
  267. package/skills/ae-analysis/references/user_tag_models.md +9 -1
  268. package/skills/ae-analysis/references/user_tag_update.md +14 -2
  269. package/skills/ae-analysis/references/virtual_event_create.md +10 -5
  270. package/skills/ae-analysis/references/virtual_event_get.md +0 -1
  271. package/skills/ae-analysis/references/virtual_property_create.md +0 -1
  272. package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +0 -1
  273. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +1054 -0
  274. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +112 -0
  275. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +30 -0
  276. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/generate-build-ir.mjs +2735 -0
  277. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/package-wiki-source-zip.mjs +376 -0
  278. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/plan-kb-source-sync.mjs +264 -0
  279. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/precompiled-source.mjs +49 -0
  280. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/upload-kb-sources-concurrently.mjs +200 -0
  281. package/skills/ae-analysis/scripts/read_results.py +197 -0
  282. package/skills/ae-analysis-global/SKILL.md +1 -1
  283. package/skills/ae-capability/SKILL.md +1 -1
  284. package/skills/ae-community/SKILL.md +1 -1
  285. package/skills/ae-current-context/SKILL.md +53 -0
  286. package/skills/ae-data-integration/SKILL.md +6 -4
  287. package/skills/ae-data-integration/references/dimension-routing.md +36 -0
  288. package/skills/ae-data-integration/references/lark-bitable-source.md +288 -0
  289. package/skills/ae-data-integration/references/lark-sheet-source.md +130 -0
  290. package/skills/ae-data-integration/references/local-analysis.md +2 -0
  291. package/skills/ae-data-integration/references/manual-export-source.md +83 -0
  292. package/skills/ae-data-integration/references/reuse.md +2 -0
  293. package/skills/ae-data-integration/references/sink-upload.md +32 -0
  294. package/skills/ae-data-integration/references/source-inspect.md +1 -1
  295. package/skills/ae-data-integration/references/tracking-plan.md +5 -2
  296. package/skills/ae-data-integration/references/transform.md +1 -1
  297. package/skills/ae-data-integration/references/ue-mapping.md +7 -4
  298. package/skills/ae-data-integration/references/ue-routing.md +17 -1
  299. package/skills/ae-data-integration-helper/SKILL.md +5 -5
  300. package/skills/ae-data-integration-helper/references/android_sdk_faq.md +3 -3
  301. package/skills/ae-data-integration-helper/references/c_sdk_faq.md +3 -3
  302. package/skills/ae-data-integration-helper/references/cocoscreator_sdk_faq.md +1 -1
  303. package/skills/ae-data-integration-helper/references/cpp_server_sdk_faq.md +3 -3
  304. package/skills/ae-data-integration-helper/references/ios_sdk_faq.md +1 -1
  305. package/skills/ae-data-integration-helper/references/java_sdk_faq.md +3 -3
  306. package/skills/ae-data-integration-helper/references/javascript_sdk_faq.md +1 -1
  307. package/skills/ae-data-integration-helper/references/logbus2_guide.md +1 -1
  308. package/skills/ae-data-integration-helper/references/logbus2_parser_plugin.md +2 -2
  309. package/skills/ae-data-integration-helper/references/minigame_sdk_faq.md +2 -2
  310. package/skills/ae-data-integration-helper/references/miniprogram_sdk_faq.md +1 -1
  311. package/skills/ae-data-integration-helper/references/python_sdk_faq.md +2 -2
  312. package/skills/ae-data-integration-helper/references/restful_api_notes.md +2 -2
  313. package/skills/ae-data-integration-helper/references/sdk_log_guide.md +3 -3
  314. package/skills/ae-data-integration-helper/references/sdk_usage_notes.md +11 -11
  315. package/skills/ae-data-integration-helper/references/unity_sdk_faq.md +1 -1
  316. package/skills/ae-dataops/SKILL.md +1 -1
  317. package/skills/ae-engage/SKILL.md +4 -3
  318. package/skills/ae-engage/references/build-task-save-guide.md +3 -0
  319. package/skills/ae-engage/references/flow-metric-update.md +115 -1
  320. package/skills/ae-engage/references/save-flow.md +3 -0
  321. package/skills/ae-engage/references/save-task.md +21 -0
  322. package/skills/ae-engage/references/task-metric-update.md +151 -0
  323. package/skills/ae-experiment/SKILL.md +14 -7
  324. package/skills/ae-experiment/references/save_submit_external_experiment.md +52 -0
  325. package/skills/ae-experiment-design/SKILL.md +3 -3
  326. package/skills/ae-experiment-design/references/platform-operations.md +1 -1
  327. package/skills/ae-experiment-insight/SKILL.md +2 -2
  328. package/skills/ae-experiment-insight/references/platform-operations.md +1 -1
  329. package/skills/ae-generate-tracking-code/SKILL.md +2 -1
  330. package/skills/ae-generate-tracking-code/references/client-sdk-insert.md +1 -1
  331. package/skills/ae-generate-tracking-code/references/datax-config.md +1 -1
  332. package/skills/ae-generate-tracking-code/references/logbus-config.md +1 -1
  333. package/skills/ae-generate-tracking-code/references/modes.md +1 -1
  334. package/skills/ae-generate-tracking-code/references/server-sdk-insert.md +5 -5
  335. package/skills/ae-generate-tracking-code/references/snippet-delivery.md +3 -3
  336. package/skills/ae-generate-tracking-plan/SKILL.md +27 -15
  337. package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +1 -1
  338. package/skills/ae-generate-tracking-plan/references/te-api.md +1 -0
  339. package/skills/ae-generate-tracking-plan/references/xlsx-schema.md +3 -2
  340. package/skills/ae-kb/SKILL.md +147 -37
  341. package/skills/ae-kb/references/analysis-workflow.md +292 -0
  342. package/skills/ae-kb/references/query-workflow.md +59 -29
  343. package/skills/ae-kb/references/source-mutations.md +95 -0
  344. package/skills/ae-kb/references/versions.md +46 -0
  345. package/skills/ae-kb-discovery/SKILL.md +5 -1
  346. package/skills/ae-metadata/SKILL.md +1 -1
  347. package/skills/ae-migrate-tracking-code/SKILL.md +195 -0
  348. package/skills/ae-migrate-tracking-code/references/ae-preset-properties.md +76 -0
  349. package/skills/ae-migrate-tracking-code/references/ir.md +167 -0
  350. package/skills/ae-migrate-tracking-code/references/mapping-framework.md +112 -0
  351. package/skills/ae-migrate-tracking-code/references/providers/README.md +58 -0
  352. package/skills/ae-migrate-tracking-code/references/providers/amplitude.md +208 -0
  353. package/skills/ae-migrate-tracking-code/references/providers/firebase.md +160 -0
  354. package/skills/ae-migrate-tracking-code/references/providers/ga4.md +92 -0
  355. package/skills/ae-migrate-tracking-code/references/providers/mixpanel.md +150 -0
  356. package/skills/ae-migrate-tracking-code/references/providers/sensors-data.md +146 -0
  357. package/skills/ae-project-semantic/SKILL.md +1 -1
  358. package/skills/ae-system/SKILL.md +5 -5
  359. package/skills/ae-team/SKILL.md +2 -2
  360. package/skills/ae-use-agent/SKILL.md +42 -0
  361. package/skills/ae-use-agent/references/local-agent.md +114 -0
  362. package/dist/auth-UMJAA72O.js +0 -15
  363. package/dist/chunk-533JK3YX.js +0 -72
  364. package/dist/chunk-DKEXH6Q5.js +0 -72
  365. package/dist/chunk-O6K2ODUE.js +0 -318
  366. package/dist/chunk-RWXIXOZG.js +0 -326
  367. package/dist/client-N7NGZUNI.js +0 -204
  368. package/dist/te-kb-BUD6N3NI.js +0 -1222
  369. package/skills/ae-agent/references/auto-provision-mcp-credentials.md +0 -57
  370. package/skills/ae-analysis/metadata_resolution.md +0 -184
@@ -0,0 +1,155 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ dryRunCapability,
4
+ executeCapabilityWithEnvelope,
5
+ validateCapability
6
+ } from "./chunk-HFGZGYCG.js";
7
+ import {
8
+ resolveGatewayDomain
9
+ } from "./chunk-KPQY44JQ.js";
10
+ import {
11
+ withOutputMetadata
12
+ } from "./chunk-DX5CDO34.js";
13
+ import {
14
+ CliValidationError
15
+ } from "./chunk-MAPZ7VB6.js";
16
+
17
+ // src/core/definition-intent.ts
18
+ import { createHash } from "crypto";
19
+ var definitionIntentSnapshotFlag = {
20
+ name: "intent-snapshot",
21
+ type: "json",
22
+ required: false,
23
+ desc: 'Optional user-confirmed intent snapshot: {"schema_version":1,"requirement":"...","definition":{...}}. ae-cli rejects drift between this snapshot and the final definition before validate, dry-run, or execute. The snapshot is not sent to the Gateway.'
24
+ };
25
+ var modelDefinitionIntentSnapshotFlag = {
26
+ name: "intent-snapshot",
27
+ type: "json",
28
+ required: false,
29
+ desc: 'Optional user-confirmed intent snapshot: {"schema_version":1,"requirement":"...","model_type":"event","definition":{...}}. ae-cli rejects drift between this snapshot and the final model-type/definition before validate, dry-run, or execute. The snapshot is not sent to the Gateway.'
30
+ };
31
+ function verifyDefinitionIntent(ctx, config) {
32
+ const snapshotFlag = config.snapshotFlag ?? "intent-snapshot";
33
+ const snapshot = ctx.json(snapshotFlag);
34
+ if (snapshot === void 0) return void 0;
35
+ if (!isRecord(snapshot) || snapshot.schema_version !== 1) {
36
+ throw mismatch("Intent snapshot must be an object with schema_version=1.");
37
+ }
38
+ if (typeof snapshot.requirement !== "string" || snapshot.requirement.trim().length === 0) {
39
+ throw mismatch("Intent snapshot requirement must be a non-empty string.");
40
+ }
41
+ if (!Object.prototype.hasOwnProperty.call(snapshot, "definition")) {
42
+ throw mismatch("Intent snapshot must include definition.");
43
+ }
44
+ const definitionFlag = config.definitionFlag ?? "definition";
45
+ const finalDefinition = ctx.json(definitionFlag);
46
+ if (finalDefinition === void 0 || !jsonEqual(snapshot.definition, finalDefinition)) {
47
+ throw mismatch("Final definition does not match the user-confirmed intent snapshot.");
48
+ }
49
+ if (config.modelTypeFlag) {
50
+ const finalModelType = ctx.str(config.modelTypeFlag);
51
+ if (typeof snapshot.model_type !== "string" || snapshot.model_type !== finalModelType) {
52
+ throw mismatch("Final model type does not match the user-confirmed intent snapshot.");
53
+ }
54
+ }
55
+ return {
56
+ checked: true,
57
+ matched: true,
58
+ schema_version: 1,
59
+ snapshot_sha256: createHash("sha256").update(canonicalJson(snapshot)).digest("hex")
60
+ };
61
+ }
62
+ function mismatch(message) {
63
+ return new CliValidationError(message, {
64
+ code: "DEFINITION_INTENT_MISMATCH",
65
+ hint: "Rebuild the final definition from the confirmed snapshot, or ask the user to confirm a new snapshot."
66
+ });
67
+ }
68
+ function jsonEqual(left, right) {
69
+ return canonicalJson(left) === canonicalJson(right);
70
+ }
71
+ function canonicalJson(value) {
72
+ if (Array.isArray(value)) {
73
+ return `[${value.map(canonicalJson).join(",")}]`;
74
+ }
75
+ if (isRecord(value)) {
76
+ return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson(value[key])}`).join(",")}}`;
77
+ }
78
+ const encoded = JSON.stringify(value);
79
+ return encoded === void 0 ? "null" : encoded;
80
+ }
81
+ function isRecord(value) {
82
+ return value !== null && typeof value === "object" && !Array.isArray(value);
83
+ }
84
+
85
+ // src/core/capability-command.ts
86
+ import { randomBytes } from "crypto";
87
+ function createCapabilityCommand(config) {
88
+ return {
89
+ service: config.cliService,
90
+ resource: config.resource,
91
+ command: config.command,
92
+ capabilityId: config.capabilityId,
93
+ description: config.description,
94
+ helpText: config.helpText,
95
+ flags: config.flags,
96
+ risk: config.risk,
97
+ validate: config.validate || config.intentConsistency ? (ctx) => {
98
+ config.validate?.(ctx);
99
+ if (config.intentConsistency) verifyDefinitionIntent(ctx, config.intentConsistency);
100
+ } : void 0,
101
+ preflight: (ctx) => {
102
+ config.buildInput(ctx);
103
+ },
104
+ validateInput: async (ctx) => {
105
+ const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
106
+ const requestHost = config.requestHost ?? ctx.host();
107
+ const input = withLifecycleRequestId(config, config.buildInput(ctx));
108
+ const evidence = config.intentConsistency ? verifyDefinitionIntent(ctx, config.intentConsistency) : void 0;
109
+ const intentMeta = evidence ? { intent_consistency: evidence } : void 0;
110
+ return withOutputMetadata(await validateCapability(requestHost, gatewayDomain, config.capabilityId, input), intentMeta);
111
+ },
112
+ dryRun: async (ctx) => {
113
+ const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
114
+ const requestHost = config.requestHost ?? ctx.host();
115
+ const input = withLifecycleRequestId(config, config.buildInput(ctx));
116
+ const evidence = config.intentConsistency ? verifyDefinitionIntent(ctx, config.intentConsistency) : void 0;
117
+ const intentMeta = evidence ? { intent_consistency: evidence } : void 0;
118
+ return withOutputMetadata(await dryRunCapability(requestHost, gatewayDomain, config.capabilityId, input), intentMeta);
119
+ },
120
+ execute: async (ctx) => {
121
+ const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
122
+ const requestHost = config.requestHost ?? ctx.host();
123
+ const input = withLifecycleRequestId(config, config.buildInput(ctx));
124
+ const evidence = config.intentConsistency ? verifyDefinitionIntent(ctx, config.intentConsistency) : void 0;
125
+ const intentMeta = evidence ? { intent_consistency: evidence } : void 0;
126
+ announceDispatch(config.capabilityId, input);
127
+ const result = await executeCapabilityWithEnvelope(requestHost, gatewayDomain, config.capabilityId, input);
128
+ const data = config.postProcess ? await config.postProcess(result.data, input, ctx) : result.data;
129
+ return withOutputMetadata(data, { ...result.meta, ...intentMeta });
130
+ }
131
+ };
132
+ }
133
+ function withLifecycleRequestId(config, input) {
134
+ if (!config.flags.some((flag) => flag.name === "request-id")) {
135
+ return input;
136
+ }
137
+ const supplied = input.request_id;
138
+ const requestId = typeof supplied === "string" && supplied.length > 0 ? supplied : `cli_${randomBytes(16).toString("hex")}`;
139
+ return { ...input, request_id: requestId };
140
+ }
141
+ function announceDispatch(capabilityId, input) {
142
+ if (typeof input.request_id !== "string") {
143
+ return;
144
+ }
145
+ process.stderr.write(
146
+ `[ae-cli] dispatching capability=${capabilityId} request_id=${input.request_id}
147
+ `
148
+ );
149
+ }
150
+
151
+ export {
152
+ definitionIntentSnapshotFlag,
153
+ modelDefinitionIntentSnapshotFlag,
154
+ createCapabilityCommand
155
+ };
@@ -1,64 +1,15 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ require_inherits,
4
+ require_isarray,
5
+ require_node,
6
+ require_process_nextick_args,
7
+ require_util
8
+ } from "./chunk-V2NUHPXF.js";
2
9
  import {
3
10
  __commonJS,
4
11
  __require
5
- } from "./chunk-FR2EDAQM.js";
6
-
7
- // node_modules/process-nextick-args/index.js
8
- var require_process_nextick_args = __commonJS({
9
- "node_modules/process-nextick-args/index.js"(exports, module) {
10
- "use strict";
11
- if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) {
12
- module.exports = { nextTick };
13
- } else {
14
- module.exports = process;
15
- }
16
- function nextTick(fn, arg1, arg2, arg3) {
17
- if (typeof fn !== "function") {
18
- throw new TypeError('"callback" argument must be a function');
19
- }
20
- var len = arguments.length;
21
- var args, i;
22
- switch (len) {
23
- case 0:
24
- case 1:
25
- return process.nextTick(fn);
26
- case 2:
27
- return process.nextTick(function afterTickOne() {
28
- fn.call(null, arg1);
29
- });
30
- case 3:
31
- return process.nextTick(function afterTickTwo() {
32
- fn.call(null, arg1, arg2);
33
- });
34
- case 4:
35
- return process.nextTick(function afterTickThree() {
36
- fn.call(null, arg1, arg2, arg3);
37
- });
38
- default:
39
- args = new Array(len - 1);
40
- i = 0;
41
- while (i < args.length) {
42
- args[i++] = arguments[i];
43
- }
44
- return process.nextTick(function afterTick() {
45
- fn.apply(null, args);
46
- });
47
- }
48
- }
49
- }
50
- });
51
-
52
- // node_modules/isarray/index.js
53
- var require_isarray = __commonJS({
54
- "node_modules/isarray/index.js"(exports, module) {
55
- "use strict";
56
- var toString = {}.toString;
57
- module.exports = Array.isArray || function(arr) {
58
- return toString.call(arr) == "[object Array]";
59
- };
60
- }
61
- });
12
+ } from "./chunk-MAPZ7VB6.js";
62
13
 
63
14
  // node_modules/jszip/node_modules/readable-stream/lib/internal/streams/stream.js
64
15
  var require_stream = __commonJS({
@@ -126,125 +77,6 @@ var require_safe_buffer = __commonJS({
126
77
  }
127
78
  });
128
79
 
129
- // node_modules/core-util-is/lib/util.js
130
- var require_util = __commonJS({
131
- "node_modules/core-util-is/lib/util.js"(exports) {
132
- "use strict";
133
- function isArray(arg) {
134
- if (Array.isArray) {
135
- return Array.isArray(arg);
136
- }
137
- return objectToString(arg) === "[object Array]";
138
- }
139
- exports.isArray = isArray;
140
- function isBoolean(arg) {
141
- return typeof arg === "boolean";
142
- }
143
- exports.isBoolean = isBoolean;
144
- function isNull(arg) {
145
- return arg === null;
146
- }
147
- exports.isNull = isNull;
148
- function isNullOrUndefined(arg) {
149
- return arg == null;
150
- }
151
- exports.isNullOrUndefined = isNullOrUndefined;
152
- function isNumber(arg) {
153
- return typeof arg === "number";
154
- }
155
- exports.isNumber = isNumber;
156
- function isString(arg) {
157
- return typeof arg === "string";
158
- }
159
- exports.isString = isString;
160
- function isSymbol(arg) {
161
- return typeof arg === "symbol";
162
- }
163
- exports.isSymbol = isSymbol;
164
- function isUndefined(arg) {
165
- return arg === void 0;
166
- }
167
- exports.isUndefined = isUndefined;
168
- function isRegExp(re) {
169
- return objectToString(re) === "[object RegExp]";
170
- }
171
- exports.isRegExp = isRegExp;
172
- function isObject(arg) {
173
- return typeof arg === "object" && arg !== null;
174
- }
175
- exports.isObject = isObject;
176
- function isDate(d) {
177
- return objectToString(d) === "[object Date]";
178
- }
179
- exports.isDate = isDate;
180
- function isError(e) {
181
- return objectToString(e) === "[object Error]" || e instanceof Error;
182
- }
183
- exports.isError = isError;
184
- function isFunction(arg) {
185
- return typeof arg === "function";
186
- }
187
- exports.isFunction = isFunction;
188
- function isPrimitive(arg) {
189
- return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol
190
- typeof arg === "undefined";
191
- }
192
- exports.isPrimitive = isPrimitive;
193
- exports.isBuffer = __require("buffer").Buffer.isBuffer;
194
- function objectToString(o) {
195
- return Object.prototype.toString.call(o);
196
- }
197
- }
198
- });
199
-
200
- // node_modules/inherits/inherits_browser.js
201
- var require_inherits_browser = __commonJS({
202
- "node_modules/inherits/inherits_browser.js"(exports, module) {
203
- "use strict";
204
- if (typeof Object.create === "function") {
205
- module.exports = function inherits(ctor, superCtor) {
206
- if (superCtor) {
207
- ctor.super_ = superCtor;
208
- ctor.prototype = Object.create(superCtor.prototype, {
209
- constructor: {
210
- value: ctor,
211
- enumerable: false,
212
- writable: true,
213
- configurable: true
214
- }
215
- });
216
- }
217
- };
218
- } else {
219
- module.exports = function inherits(ctor, superCtor) {
220
- if (superCtor) {
221
- ctor.super_ = superCtor;
222
- var TempCtor = function() {
223
- };
224
- TempCtor.prototype = superCtor.prototype;
225
- ctor.prototype = new TempCtor();
226
- ctor.prototype.constructor = ctor;
227
- }
228
- };
229
- }
230
- }
231
- });
232
-
233
- // node_modules/inherits/inherits.js
234
- var require_inherits = __commonJS({
235
- "node_modules/inherits/inherits.js"(exports, module) {
236
- "use strict";
237
- try {
238
- util = __require("util");
239
- if (typeof util.inherits !== "function") throw "";
240
- module.exports = util.inherits;
241
- } catch (e) {
242
- module.exports = require_inherits_browser();
243
- }
244
- var util;
245
- }
246
- });
247
-
248
80
  // node_modules/jszip/node_modules/readable-stream/lib/internal/streams/BufferList.js
249
81
  var require_BufferList = __commonJS({
250
82
  "node_modules/jszip/node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports, module) {
@@ -392,14 +224,6 @@ var require_destroy = __commonJS({
392
224
  }
393
225
  });
394
226
 
395
- // node_modules/util-deprecate/node.js
396
- var require_node = __commonJS({
397
- "node_modules/util-deprecate/node.js"(exports, module) {
398
- "use strict";
399
- module.exports = __require("util").deprecate;
400
- }
401
- });
402
-
403
227
  // node_modules/jszip/node_modules/readable-stream/lib/_stream_writable.js
404
228
  var require_stream_writable = __commonJS({
405
229
  "node_modules/jszip/node_modules/readable-stream/lib/_stream_writable.js"(exports, module) {
@@ -9746,7 +9570,5 @@ var require_lib3 = __commonJS({
9746
9570
  });
9747
9571
 
9748
9572
  export {
9749
- require_inherits,
9750
- require_node,
9751
9573
  require_lib3 as require_lib
9752
9574
  };
@@ -1,19 +1,16 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  peekCliToken
4
- } from "./chunk-RWXIXOZG.js";
5
- import {
6
- getToken
7
- } from "./chunk-O6K2ODUE.js";
4
+ } from "./chunk-7XGFSUOM.js";
8
5
  import {
9
6
  getActiveHost,
10
7
  getConfigDir,
11
8
  isAeSandboxRuntime,
12
9
  normalizeUrl
13
- } from "./chunk-KZ6ZHF5J.js";
10
+ } from "./chunk-7FTTULED.js";
14
11
  import {
15
12
  logger
16
- } from "./chunk-FR2EDAQM.js";
13
+ } from "./chunk-MAPZ7VB6.js";
17
14
 
18
15
  // src/core/version-sync.ts
19
16
  import { spawnSync } from "child_process";
@@ -650,20 +647,12 @@ function shouldSkipAutoSync(argv = process.argv) {
650
647
  async function fetchCliConfig(host, cliToken) {
651
648
  const url = new URL(CLI_CONFIG_PATH, host.endsWith("/") ? host : `${host}/`);
652
649
  url.searchParams.set("cli-token", cliToken);
653
- const headers = { Accept: "application/json" };
654
- try {
655
- const accessToken = await getToken(host);
656
- if (accessToken) {
657
- headers.Authorization = `bearer ${accessToken}`;
658
- }
659
- } catch {
660
- }
661
650
  const controller = new AbortController();
662
651
  const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
663
652
  try {
664
653
  const resp = await fetch(url.toString(), {
665
654
  signal: controller.signal,
666
- headers
655
+ headers: { Accept: "application/json" }
667
656
  });
668
657
  if (!resp.ok) return null;
669
658
  const body = await resp.json();
@@ -904,6 +893,13 @@ var KNOWN_ARRAY_FIELDS = [
904
893
  var OUTPUT_METADATA = /* @__PURE__ */ Symbol("ae-cli-output-metadata");
905
894
  function withOutputMetadata(data, meta) {
906
895
  if (!meta || Object.keys(meta).length === 0) return data;
896
+ if (isOutputWithMetadata(data)) {
897
+ return {
898
+ [OUTPUT_METADATA]: true,
899
+ data: data.data,
900
+ meta: { ...data.meta, ...meta }
901
+ };
902
+ }
907
903
  return {
908
904
  [OUTPUT_METADATA]: true,
909
905
  data,
@@ -936,7 +932,7 @@ function formatTable(data) {
936
932
  const table2 = new Table({ head: headers, wordWrap: true });
937
933
  for (const row of data.rows) {
938
934
  const values = Array.isArray(row) ? row : [row];
939
- table2.push(headers.map((_, index) => {
935
+ table2.push(headers.map((_header, index) => {
940
936
  const value = values[index];
941
937
  if (value === void 0 || value === null) return "";
942
938
  if (typeof value === "object") return JSON.stringify(value);
@@ -978,7 +974,8 @@ async function applyJq(data, expr) {
978
974
  const message = err instanceof JqError ? err.message : err?.message || String(err);
979
975
  const error = new Error(`Invalid --jq expression: ${message}`);
980
976
  error.type = "validation";
981
- error.hint = "Use standard jq syntax, e.g. .status or {status,pendingQuestion}";
977
+ error.code = "OUTPUT_PROJECTION_FAILED";
978
+ error.hint = "The command completed. Original data and metadata are preserved in stdout; fix the jq expression locally without executing the command again. --jq applies to the command data before envelope wrapping.";
982
979
  throw error;
983
980
  }
984
981
  if (results.length === 0) return null;
@@ -1026,7 +1023,20 @@ function printError(type, message, hint, code, meta, options = {}) {
1026
1023
  }
1027
1024
  }
1028
1025
  async function printOutput(data, format, jqExpr) {
1029
- process.stdout.write(await formatOutput(data, format, jqExpr) + "\n");
1026
+ try {
1027
+ process.stdout.write(await formatOutput(data, format, jqExpr) + "\n");
1028
+ } catch (error) {
1029
+ if (error?.code === "OUTPUT_PROJECTION_FAILED") {
1030
+ const recovery = JSON.parse(formatError("validation", error.message, error.hint, error.code, readOutputMetadata(data)));
1031
+ await new Promise((resolve, reject) => {
1032
+ process.stdout.write(
1033
+ JSON.stringify({ ...recovery, data: unwrapOutputData(data) }, null, 2) + "\n",
1034
+ (error2) => error2 ? reject(error2) : resolve()
1035
+ );
1036
+ });
1037
+ }
1038
+ throw error;
1039
+ }
1030
1040
  }
1031
1041
 
1032
1042
  export {