@thinkingai/ae-cli 6.0.31 → 6.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/README.md +3 -2
  2. package/README.zh.md +3 -2
  3. package/dist/{auth-MEJ642P4.js → auth-ENM3FE6L.js} +3 -2
  4. package/dist/{auth-7H3HAAJ3.js → auth-UPGUOKTW.js} +13 -6
  5. package/dist/{capability-SEH3JWLN.js → capability-AJC5CBRT.js} +50 -18
  6. package/dist/{capability-SQ2IWKP3.js → capability-TQ5KU5Q6.js} +50 -18
  7. package/dist/chunk-24BAVOX3.js +51 -0
  8. package/dist/{chunk-MDJGDI6K.js → chunk-3KI3RRXX.js} +5 -5
  9. package/dist/{chunk-PKRD2IEM.js → chunk-3P3562ZX.js} +9 -7
  10. package/dist/{chunk-R77JT7XD.js → chunk-4Q5TNP4Q.js} +4 -4
  11. package/dist/{chunk-TKQJQXWT.js → chunk-6CHYBI64.js} +7 -4
  12. package/dist/{chunk-6LEYLOV3.js → chunk-CPVTECJ3.js} +9 -7
  13. package/dist/{chunk-KCA6BA5D.js → chunk-DB4Q3ANU.js} +5 -3
  14. package/dist/{chunk-2NDGFQHW.js → chunk-E7UXXHO3.js} +11 -3
  15. package/dist/{chunk-I4A62X3N.js → chunk-HQ2A7ITL.js} +23 -14
  16. package/dist/chunk-IMMGMU54.js +674 -0
  17. package/dist/{chunk-AJTH7LT3.js → chunk-IR4ZLVPW.js} +4 -2
  18. package/dist/{chunk-N2QORU5D.js → chunk-ISY6HMHM.js} +7 -4
  19. package/dist/{chunk-KGJQCYVC.js → chunk-LCXU3AAT.js} +4 -2
  20. package/dist/chunk-LYVNONC4.js +86 -0
  21. package/dist/{chunk-DYOS6YY7.js → chunk-RGXCNC4N.js} +23 -14
  22. package/dist/{chunk-YCLVYFK7.js → chunk-V6FR6WTW.js} +45 -87
  23. package/dist/chunk-VTWMIC5L.js +27 -0
  24. package/dist/{cli-token-TVQRSE46.js → cli-token-4SBMXAUK.js} +6 -3
  25. package/dist/{client-2643Z5AG.js → client-PP5FETMW.js} +4 -3
  26. package/dist/community-report-client-KK2QBANO.js +145 -0
  27. package/dist/{config-7UZWDE74.js → config-RCCGHHYA.js} +6 -3
  28. package/dist/index.js +541 -234
  29. package/dist/{metadata-W6JFFMBA.js → metadata-3M5F2AED.js} +15 -14
  30. package/dist/{metadata-X62TKIVK.js → metadata-W2MEOI4Z.js} +15 -14
  31. package/dist/{model-T3KZJWLW.js → model-OYQLXCQY.js} +3 -2
  32. package/dist/{raw-CN542NGT.js → raw-TPB7KSZO.js} +6 -4
  33. package/dist/{sync-ERNHDPB5.js → sync-EFJKFZK2.js} +6 -3
  34. package/dist/{te-agent-FCCWUDTJ.js → te-agent-K2OWMZXT.js} +3 -2
  35. package/dist/{te-analysis-NJGNWZFC.js → te-analysis-I73ZS4NK.js} +2196 -120
  36. package/dist/{te-analysis-YGV5V5EX.js → te-analysis-Q7AZCDU4.js} +2196 -120
  37. package/dist/te-common-ST3QPSXJ.js +61 -0
  38. package/dist/te-common-WSLIKKPC.js +61 -0
  39. package/dist/te-community-WXGB6IOX.js +1659 -0
  40. package/dist/te-community-X2AHXGCA.js +1659 -0
  41. package/dist/{te-dataops-ZNJBQ6VT.js → te-dataops-MJV54MNY.js} +10 -8
  42. package/dist/{te-dataops-F36T656A.js → te-dataops-OA7I6HBG.js} +10 -8
  43. package/dist/te-engage-GJRVQMK3.js +3895 -0
  44. package/dist/te-engage-JIXX3WBI.js +3895 -0
  45. package/dist/{te-kb-NT33UHAE.js → te-kb-CIZXRWMO.js} +105 -23
  46. package/dist/{te-meta-VKWNAWO4.js → te-meta-Q4L6EE3Q.js} +8 -240
  47. package/dist/{te-meta-MAAUHFQO.js → te-meta-VHCN4Q62.js} +8 -240
  48. package/dist/{te-team-OKCOX7OE.js → te-team-PDKKW7Q5.js} +7 -6
  49. package/dist/tracking/i18n/resources/cli/en.json +4 -3
  50. package/dist/tracking/i18n/resources/cli/ja.json +4 -3
  51. package/dist/tracking/i18n/resources/cli/ko.json +4 -3
  52. package/dist/tracking/i18n/resources/cli/zh.json +4 -3
  53. package/package.json +6 -2
  54. package/skills/ae-agent/SKILL.md +2 -1
  55. package/skills/ae-analysis/SKILL.md +21 -7
  56. package/skills/ae-analysis/references/adhoc_export.md +5 -6
  57. package/skills/ae-analysis/references/adhoc_run.md +7 -9
  58. package/skills/ae-analysis/references/ai_models.md +17 -1
  59. package/skills/ae-analysis/references/alert_create.md +25 -0
  60. package/skills/ae-analysis/references/alert_definition_schema_get.md +24 -0
  61. package/skills/ae-analysis/references/alert_delete.md +26 -0
  62. package/skills/ae-analysis/references/alert_detail_list.md +27 -0
  63. package/skills/ae-analysis/references/alert_get.md +25 -0
  64. package/skills/ae-analysis/references/alert_job_list.md +24 -0
  65. package/skills/ae-analysis/references/alert_list.md +27 -0
  66. package/skills/ae-analysis/references/alert_notice_config_list.md +24 -0
  67. package/skills/ae-analysis/references/alert_start.md +25 -0
  68. package/skills/ae-analysis/references/alert_stop.md +25 -0
  69. package/skills/ae-analysis/references/alert_update.md +26 -0
  70. package/skills/ae-analysis/references/analysis_data_retrieval.md +11 -11
  71. package/skills/ae-analysis/references/analysis_drilldown_contract.md +93 -0
  72. package/skills/ae-analysis/references/analysis_gateway_assets.md +9 -8
  73. package/skills/ae-analysis/references/asset_url_get.md +4 -3
  74. package/skills/ae-analysis/references/bi_panel_create.md +3 -3
  75. package/skills/ae-analysis/references/bi_panel_page_data_export.md +2 -2
  76. package/skills/ae-analysis/references/bi_panel_page_data_run.md +1 -1
  77. package/skills/ae-analysis/references/check_delete.md +27 -0
  78. package/skills/ae-analysis/references/check_export.md +27 -0
  79. package/skills/ae-analysis/references/check_get.md +27 -0
  80. package/skills/ae-analysis/references/check_list.md +24 -0
  81. package/skills/ae-analysis/references/check_retry.md +27 -0
  82. package/skills/ae-analysis/references/check_run.md +25 -0
  83. package/skills/ae-analysis/references/command_index.md +114 -46
  84. package/skills/ae-analysis/references/create_entity.md +2 -2
  85. package/skills/ae-analysis/references/dashboard_create.md +3 -3
  86. package/skills/ae-analysis/references/dashboard_daily_report_send.md +1 -0
  87. package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
  88. package/skills/ae-analysis/references/dashboard_report_data_export.md +4 -4
  89. package/skills/ae-analysis/references/dashboard_report_data_run.md +4 -4
  90. package/skills/ae-analysis/references/drilldown_entities_export.md +26 -0
  91. package/skills/ae-analysis/references/drilldown_entities_run.md +33 -0
  92. package/skills/ae-analysis/references/drilldown_events_export.md +21 -0
  93. package/skills/ae-analysis/references/drilldown_events_run.md +23 -0
  94. package/skills/ae-analysis/references/drilldown_user_events_export.md +6 -3
  95. package/skills/ae-analysis/references/drilldown_user_events_run.md +6 -6
  96. package/skills/ae-analysis/references/entity_detail_export.md +2 -0
  97. package/skills/ae-analysis/references/entity_detail_run.md +8 -1
  98. package/skills/ae-analysis/references/event_blacklist_add.md +25 -0
  99. package/skills/ae-analysis/references/event_blacklist_list.md +24 -0
  100. package/skills/ae-analysis/references/event_blacklist_update.md +26 -0
  101. package/skills/ae-analysis/references/event_detail_export.md +2 -0
  102. package/skills/ae-analysis/references/event_detail_run.md +2 -0
  103. package/skills/ae-analysis/references/event_list.md +10 -2
  104. package/skills/ae-analysis/references/ingest_error_list.md +27 -0
  105. package/skills/ae-analysis/references/ingest_summary.md +26 -0
  106. package/skills/ae-analysis/references/list_entities.md +1 -1
  107. package/skills/ae-analysis/references/live_data_export.md +27 -0
  108. package/skills/ae-analysis/references/live_data_list.md +27 -0
  109. package/skills/ae-analysis/references/metric_create.md +13 -4
  110. package/skills/ae-analysis/references/metric_delete.md +7 -0
  111. package/skills/ae-analysis/references/metric_get.md +6 -0
  112. package/skills/ae-analysis/references/metric_list.md +16 -3
  113. package/skills/ae-analysis/references/metric_update.md +12 -1
  114. package/skills/ae-analysis/references/plan_change_log_export.md +27 -0
  115. package/skills/ae-analysis/references/plan_change_log_list.md +24 -0
  116. package/skills/ae-analysis/references/plan_delete_items.md +30 -0
  117. package/skills/ae-analysis/references/plan_export.md +26 -0
  118. package/skills/ae-analysis/references/plan_generate.md +27 -0
  119. package/skills/ae-analysis/references/plan_get.md +24 -0
  120. package/skills/ae-analysis/references/plan_import_excel.md +26 -0
  121. package/skills/ae-analysis/references/plan_save_items.md +27 -0
  122. package/skills/ae-analysis/references/plan_sync_from_meta.md +24 -0
  123. package/skills/ae-analysis/references/project_access_detail_get.md +23 -0
  124. package/skills/ae-analysis/references/project_data_power_delete.md +26 -0
  125. package/skills/ae-analysis/references/project_data_power_get.md +24 -0
  126. package/skills/ae-analysis/references/project_data_power_list.md +23 -0
  127. package/skills/ae-analysis/references/project_data_power_upsert.md +24 -0
  128. package/skills/ae-analysis/references/project_entity_create.md +27 -0
  129. package/skills/ae-analysis/references/project_entity_delete.md +25 -0
  130. package/skills/ae-analysis/references/project_entity_event_list.md +24 -0
  131. package/skills/ae-analysis/references/project_entity_get.md +24 -0
  132. package/skills/ae-analysis/references/project_entity_list.md +28 -0
  133. package/skills/ae-analysis/references/project_entity_update.md +28 -0
  134. package/skills/ae-analysis/references/project_function_list.md +24 -0
  135. package/skills/ae-analysis/references/project_info_get.md +23 -0
  136. package/skills/ae-analysis/references/project_info_list.md +26 -0
  137. package/skills/ae-analysis/references/project_info_update.md +25 -0
  138. package/skills/ae-analysis/references/project_mark_time_create.md +27 -0
  139. package/skills/ae-analysis/references/project_mark_time_delete.md +25 -0
  140. package/skills/ae-analysis/references/project_mark_time_list.md +28 -0
  141. package/skills/ae-analysis/references/project_mark_time_update.md +28 -0
  142. package/skills/ae-analysis/references/project_member_add.md +25 -0
  143. package/skills/ae-analysis/references/project_member_batch_update.md +24 -0
  144. package/skills/ae-analysis/references/project_member_candidate_list.md +25 -0
  145. package/skills/ae-analysis/references/project_member_handover_export.md +27 -0
  146. package/skills/ae-analysis/references/project_member_handover_run.md +24 -0
  147. package/skills/ae-analysis/references/project_member_import.md +25 -0
  148. package/skills/ae-analysis/references/project_member_list.md +23 -0
  149. package/skills/ae-analysis/references/project_member_receiver_list.md +23 -0
  150. package/skills/ae-analysis/references/project_member_remove.md +26 -0
  151. package/skills/ae-analysis/references/project_member_update.md +25 -0
  152. package/skills/ae-analysis/references/project_owner_update.md +27 -0
  153. package/skills/ae-analysis/references/project_permission_binding_list.md +24 -0
  154. package/skills/ae-analysis/references/project_receive_status_update.md +25 -0
  155. package/skills/ae-analysis/references/project_role_delete.md +26 -0
  156. package/skills/ae-analysis/references/project_role_function_list.md +27 -0
  157. package/skills/ae-analysis/references/project_role_get.md +24 -0
  158. package/skills/ae-analysis/references/project_role_list.md +25 -0
  159. package/skills/ae-analysis/references/project_role_upsert.md +24 -0
  160. package/skills/ae-analysis/references/project_role_user_list.md +24 -0
  161. package/skills/ae-analysis/references/project_timezone_get.md +23 -0
  162. package/skills/ae-analysis/references/project_timezone_overview.md +23 -0
  163. package/skills/ae-analysis/references/project_timezone_update.md +25 -0
  164. package/skills/ae-analysis/references/project_user_id_items_update.md +24 -0
  165. package/skills/ae-analysis/references/property_list.md +21 -6
  166. package/skills/ae-analysis/references/public_link_create.md +1 -1
  167. package/skills/ae-analysis/references/query_create_result_cluster.md +15 -32
  168. package/skills/ae-analysis/references/report_create.md +1 -1
  169. package/skills/ae-analysis/references/report_data_export.md +5 -3
  170. package/skills/ae-analysis/references/report_data_run.md +13 -3
  171. package/skills/ae-analysis/references/report_get.md +2 -0
  172. package/skills/ae-analysis/references/report_update.md +1 -1
  173. package/skills/ae-analysis/references/sdk_sample_generate.md +24 -0
  174. package/skills/ae-analysis/references/user_cluster_create.md +5 -1
  175. package/skills/ae-analysis/references/user_cluster_create_id.md +2 -0
  176. package/skills/ae-analysis/references/user_cluster_get.md +4 -0
  177. package/skills/ae-analysis/references/user_cluster_refresh.md +4 -2
  178. package/skills/ae-analysis/references/user_cluster_update.md +5 -1
  179. package/skills/ae-analysis/references/user_cluster_update_id.md +2 -0
  180. package/skills/ae-analysis/references/user_tag_create.md +5 -1
  181. package/skills/ae-analysis/references/user_tag_create_id.md +2 -0
  182. package/skills/ae-analysis/references/user_tag_get.md +4 -0
  183. package/skills/ae-analysis/references/user_tag_refresh.md +4 -2
  184. package/skills/ae-analysis/references/user_tag_update.md +5 -1
  185. package/skills/ae-analysis/references/user_tag_update_id.md +2 -0
  186. package/skills/ae-analysis/references/virtual_event_create.md +22 -3
  187. package/skills/ae-analysis/references/virtual_property_create.md +23 -2
  188. package/skills/ae-analysis-global/SKILL.md +2 -0
  189. package/skills/ae-capability/SKILL.md +7 -5
  190. package/skills/ae-community/SKILL.md +72 -8
  191. package/skills/ae-community/references/community-chat-analysis.md +341 -0
  192. package/skills/ae-community/references/community-data-report.md +301 -0
  193. package/skills/ae-dataops/SKILL.md +2 -1
  194. package/skills/ae-engage/SKILL.md +204 -8
  195. package/skills/ae-engage/references/activity-activity-type.md +42 -0
  196. package/skills/ae-engage/references/activity-activity.md +70 -0
  197. package/skills/ae-engage/references/activity-approval.md +53 -0
  198. package/skills/ae-engage/references/activity-task.md +87 -0
  199. package/skills/ae-engage/references/activity-topic.md +98 -0
  200. package/skills/ae-engage/references/approval-approver-delete.md +26 -0
  201. package/skills/ae-engage/references/channel-test-send.md +37 -0
  202. package/skills/ae-engage/references/channel-touch-limits-batch-update.md +28 -0
  203. package/skills/ae-engage/references/channel-touch-limits-save.md +37 -0
  204. package/skills/ae-engage/references/channel-touch-limits-toggle.md +28 -0
  205. package/skills/ae-engage/references/channel-update-config.md +36 -0
  206. package/skills/ae-engage/references/client-param.md +58 -0
  207. package/skills/ae-engage/references/common-metric.md +75 -0
  208. package/skills/ae-engage/references/config-table.md +92 -0
  209. package/skills/ae-engage/references/engage-scene-config-item.md +69 -0
  210. package/skills/ae-engage/references/operation-log-query.md +1 -1
  211. package/skills/ae-engage/references/preset-event.md +42 -0
  212. package/skills/ae-engage/references/push-language.md +39 -0
  213. package/skills/ae-engage/references/scene-config-channel.md +58 -0
  214. package/skills/ae-engage/references/scene-config-group.md +62 -0
  215. package/skills/ae-engage/references/scene-config-item.md +68 -0
  216. package/skills/ae-engage/references/scene-config-metric.md +79 -0
  217. package/skills/ae-engage/references/scene-config-param.md +72 -0
  218. package/skills/ae-engage/references/scene-preset-metric.md +45 -0
  219. package/skills/ae-engage/references/scene-strategy.md +47 -0
  220. package/skills/ae-engage/references/scene-template.md +71 -0
  221. package/skills/ae-engage/references/{ops-delete.md → task-delete.md} +3 -3
  222. package/skills/ae-engage/references/whitelist.md +72 -0
  223. package/skills/ae-engage/references/workbench-workbench.md +48 -0
  224. package/skills/ae-generate-tracking-code/SKILL.md +4 -4
  225. package/skills/ae-generate-tracking-plan/SKILL.md +140 -16
  226. package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +98 -33
  227. package/skills/ae-generate-tracking-plan/references/te-api.md +1 -1
  228. package/skills/ae-generate-tracking-plan/references/xlsx-schema.md +16 -14
  229. package/skills/ae-kb/SKILL.md +36 -9
  230. package/skills/ae-metadata/SKILL.md +3 -2
  231. package/skills/ae-metadata/references/metadata_event_get.md +4 -4
  232. package/skills/ae-metadata/references/metadata_property_dimension_table_bind_existing.md +1 -1
  233. package/skills/ae-metadata/references/metadata_property_get.md +4 -4
  234. package/skills/ae-team/SKILL.md +2 -1
  235. package/dist/chunk-NOO24N7W.js +0 -11
  236. package/dist/chunk-TNW2CI4W.js +0 -129
  237. package/dist/te-common-5NJLF3XG.js +0 -130
  238. package/dist/te-common-7VTJZPII.js +0 -130
  239. package/dist/te-community-PEZ2VEF7.js +0 -687
  240. package/dist/te-community-TSKJ652U.js +0 -687
  241. package/dist/te-engage-BUWVSSSK.js +0 -1912
  242. package/dist/te-engage-EPE3QKDE.js +0 -1912
  243. package/skills/ae-analysis/references/create_metric.md +0 -58
  244. package/skills/ae-analysis/references/create_virtual_event.md +0 -60
  245. package/skills/ae-analysis/references/create_virtual_property.md +0 -69
  246. package/skills/ae-analysis/references/delete_metric.md +0 -32
  247. package/skills/ae-analysis/references/drilldown_users_export.md +0 -17
  248. package/skills/ae-analysis/references/drilldown_users_run.md +0 -61
  249. package/skills/ae-analysis/references/get_metric.md +0 -38
  250. package/skills/ae-analysis/references/get_resource_url.md +0 -33
  251. package/skills/ae-analysis/references/list_events.md +0 -46
  252. package/skills/ae-analysis/references/list_metrics.md +0 -52
  253. package/skills/ae-analysis/references/list_properties.md +0 -47
  254. package/skills/ae-analysis/references/update_metric.md +0 -58
  255. package/dist/{chunk-HL2AJQ4Q.js → chunk-PTE56QPL.js} +3 -3
package/README.md CHANGED
@@ -95,7 +95,7 @@ ae-cli auth logout
95
95
  | `community` | 10+ | Community analysis: posts search, sentiment analysis, topic trends, livestream data |
96
96
  | `analysis_common` | 2 | Cross-module common constraints: resource link completion, project ID gate |
97
97
  | `team` | 14 | AI Agent Team: manage teams (list/create/update/delete/ai-generate/templates/projects) and execute TeamRuns (start/watch/chat/reply/cancel/result/artifacts) |
98
- | `kb` | 10 | Knowledge base lifecycle: query / new / add (md/dir/url) / schema / compile / rm-source / remove; retrieval primitives: index / grep / read |
98
+ | `kb` | 11 | Knowledge base lifecycle: query / new / add (md/dir/url) / schema / compile / rm-source / remove; retrieval primitives: list / index / grep / read |
99
99
  | `auth` / `config` | 2 | Authentication and host configuration |
100
100
 
101
101
  ### kb
@@ -111,8 +111,9 @@ Knowledge base lifecycle (`+new` → `+add` → `+schema` → `+compile` → `+s
111
111
  - **Remove source** (`+rm-source`): `--name`, `--display-name`
112
112
  - **Remove KB** (`+remove`): `--name`
113
113
 
114
- Retrieval primitives for external agents (`+index` → `+grep` → `+read`); these are deterministic file-search endpoints with no server-side LLM, designed for agents (Claude Code / Codex / Cursor) to explore a KB the way they explore a codebase:
114
+ Retrieval primitives for external agents (`+list` → `+index` → `+grep` → `+read`); these are deterministic file-search endpoints with no server-side LLM, designed for agents (Claude Code / Codex / Cursor) to explore a KB the way they explore a codebase:
115
115
 
116
+ - **List** (`+list`): optional `--build-status` (default `compiled`), optional `--locale`. Returns accessible knowledge base metadata including `buildStatus`, without `index.md` navigation maps.
116
117
  - **Index** (`+index`): optional `--sources` JSON refs (omit to list all accessible KBs), optional `--locale`. Returns each KB's metadata plus its `index.md` navigation map.
117
118
  - **Grep** (`+grep`): `--query` / `-q`, optional `--sources`, `--top-k` (1-50, default 10), `--locale`. Returns matched lines with path, line number, breadcrumb and context snippet.
118
119
  - **Read** (`+read`): `--source` JSON ref (exactly one KB), `--path` (page path relative to the KB root), optional `--offset` / `--limit` (line window), `--locale`. Returns the full page or a line window.
package/README.zh.md CHANGED
@@ -96,7 +96,7 @@ ae-cli auth logout
96
96
  | `analysis_common` | 2 | 跨模块通用约束:资源链接补全、项目 ID 门控 |
97
97
  | `agent` | 15 | Agent 平台资源管理:模型、MCP 服务、Skill、附件库的增删查和启停 |
98
98
  | `team` | 14 | AI Agent Team:团队管理(列表/创建/更新/删除/AI生成/模板/项目)和 TeamRun 执行(启动/监听/对话/回复/取消/结果/产物) |
99
- | `kb` | 10 | 知识库生命周期:查询 / 新建 / 添加源(md/目录/url)/ schema / 编译 / 删除源 / 删除;检索原语:index / grep / read |
99
+ | `kb` | 11 | 知识库生命周期:查询 / 新建 / 添加源(md/目录/url)/ schema / 编译 / 删除源 / 删除;检索原语:list / index / grep / read |
100
100
  | `auth` / `config` | 2 | 身份验证和主机配置 |
101
101
 
102
102
  ### kb(知识库)
@@ -112,8 +112,9 @@ ae-cli auth logout
112
112
  - **删除源** (`+rm-source`):`--name`,`--display-name`
113
113
  - **删除知识库** (`+remove`):`--name`
114
114
 
115
- 面向外部 agent 的检索原语(`+index` → `+grep` → `+read`);均为确定性文件检索端点、服务端零 LLM 调用,让 agent(Claude Code / Codex / Cursor)像翻代码库一样探索知识库:
115
+ 面向外部 agent 的检索原语(`+list` → `+index` → `+grep` → `+read`);均为确定性文件检索端点、服务端零 LLM 调用,让 agent(Claude Code / Codex / Cursor)像翻代码库一样探索知识库:
116
116
 
117
+ - **列表** (`+list`):可选 `--build-status`(默认 `compiled`)、`--locale`。返回可访问知识库的元信息(含 `buildStatus`),不含 `index.md` 导航地图。
117
118
  - **索引** (`+index`):可选 `--sources` JSON 引用(省略则列出全部可访问知识库),可选 `--locale`。返回每个知识库的元信息及其 `index.md` 导航地图。
118
119
  - **检索** (`+grep`):`--query` / `-q`,可选 `--sources`、`--top-k`(1-50,默认 10)、`--locale`。返回命中行的路径、行号、面包屑与上下文片段。
119
120
  - **读取** (`+read`):`--source` JSON 引用(精确指向一个知识库),`--path`(相对知识库根目录的页面路径),可选 `--offset` / `--limit`(行窗口)、`--locale`。返回页面全文或行窗口。
@@ -3,8 +3,9 @@ import {
3
3
  invalidateAccessTokenForRetry,
4
4
  resolveHost,
5
5
  validateToken
6
- } from "./chunk-AJTH7LT3.js";
7
- import "./chunk-YCLVYFK7.js";
6
+ } from "./chunk-IR4ZLVPW.js";
7
+ import "./chunk-V6FR6WTW.js";
8
+ import "./chunk-LYVNONC4.js";
8
9
  export {
9
10
  getToken,
10
11
  invalidateAccessTokenForRetry,
@@ -1,25 +1,31 @@
1
+ import {
2
+ getLocalCliPackageInfo
3
+ } from "./chunk-VTWMIC5L.js";
1
4
  import {
2
5
  printError,
3
- printOutput
4
- } from "./chunk-TNW2CI4W.js";
6
+ printOutput,
7
+ runHostCompatCheck
8
+ } from "./chunk-IMMGMU54.js";
5
9
  import {
6
10
  clearCliToken,
7
11
  mintCliToken
8
- } from "./chunk-2NDGFQHW.js";
12
+ } from "./chunk-E7UXXHO3.js";
9
13
  import {
10
14
  clear,
11
15
  load,
12
16
  resolveHost,
13
17
  save
14
- } from "./chunk-AJTH7LT3.js";
18
+ } from "./chunk-IR4ZLVPW.js";
15
19
  import {
16
20
  getFallbackCliToken,
17
21
  loadConfig,
18
- logger,
19
22
  normalizeUrl,
20
23
  removeHost,
21
24
  saveConfig
22
- } from "./chunk-YCLVYFK7.js";
25
+ } from "./chunk-V6FR6WTW.js";
26
+ import {
27
+ logger
28
+ } from "./chunk-LYVNONC4.js";
23
29
 
24
30
  // src/core/device-auth.ts
25
31
  import { execFileSync } from "child_process";
@@ -257,6 +263,7 @@ async function persistDeviceTokens(host, tokens) {
257
263
  accessExpiresAt: expiresAt
258
264
  });
259
265
  await mintCliToken(host);
266
+ await runHostCompatCheck(getLocalCliPackageInfo(), host);
260
267
  }
261
268
  function loginSummary(host, tokens) {
262
269
  return {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-OO6XR6LK.js";
5
5
  import {
6
6
  findGatewayDomain
7
- } from "./chunk-HL2AJQ4Q.js";
7
+ } from "./chunk-PTE56QPL.js";
8
8
  import {
9
9
  CapabilityGatewayError,
10
10
  dryRunCapability,
@@ -12,22 +12,23 @@ import {
12
12
  inspectCapability,
13
13
  listCapabilities,
14
14
  validateCapability
15
- } from "./chunk-I4A62X3N.js";
15
+ } from "./chunk-HQ2A7ITL.js";
16
16
  import {
17
17
  printError,
18
18
  printOutput
19
- } from "./chunk-TNW2CI4W.js";
20
- import {
21
- PermissionError
22
- } from "./chunk-NOO24N7W.js";
23
- import "./chunk-2NDGFQHW.js";
19
+ } from "./chunk-IMMGMU54.js";
20
+ import "./chunk-E7UXXHO3.js";
24
21
  import {
25
22
  SecureStoreAuthError,
26
23
  resolveHost
27
- } from "./chunk-AJTH7LT3.js";
24
+ } from "./chunk-IR4ZLVPW.js";
28
25
  import {
29
26
  safeJsonParse
30
- } from "./chunk-YCLVYFK7.js";
27
+ } from "./chunk-V6FR6WTW.js";
28
+ import {
29
+ PermissionError
30
+ } from "./chunk-24BAVOX3.js";
31
+ import "./chunk-LYVNONC4.js";
31
32
 
32
33
  // src/commands/capability/index.ts
33
34
  import * as readline from "readline";
@@ -55,6 +56,26 @@ function resolveCapabilityGatewayDomain(capabilityId, domainOverride) {
55
56
  }
56
57
  return findGatewayDomain(cliDomain) ?? cliDomain;
57
58
  }
59
+ function parseOptionalProjectId(raw) {
60
+ if (raw === void 0) {
61
+ return void 0;
62
+ }
63
+ const value = raw.trim();
64
+ if (!/^[1-9]\d*$/.test(value)) {
65
+ throw new CapabilityCommandValidationError(
66
+ "--project-id must be a positive integer.",
67
+ "Example: --project-id 1"
68
+ );
69
+ }
70
+ const projectId = Number(value);
71
+ if (!Number.isSafeInteger(projectId)) {
72
+ throw new CapabilityCommandValidationError(
73
+ "--project-id is outside the supported integer range.",
74
+ "Pass a positive safe integer."
75
+ );
76
+ }
77
+ return projectId;
78
+ }
58
79
  function normalizeCapabilityList(value) {
59
80
  if (!Array.isArray(value)) {
60
81
  throw new Error("Capability gateway returned an invalid catalog: expected an array.");
@@ -114,28 +135,39 @@ function registerCapability(program) {
114
135
  printError("validation", "Missing subcommand.", "Run: ae-cli capability --help");
115
136
  process.exitCode = 1;
116
137
  });
117
- capability.command("list").description("List capability summaries in a domain").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").action(async (opts) => {
138
+ capability.command("list").description("List capability summaries in a domain").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").option("--project-id <project-id>", "Filter by project membership, permissions, and enabled features").action(async (opts) => {
118
139
  await executeAndPrint(program, async (host) => {
119
140
  const gatewayDomain = findGatewayDomain(opts.domain) ?? opts.domain;
120
- const catalog = normalizeCapabilityList(await listCapabilities(host, gatewayDomain));
141
+ const projectId = parseOptionalProjectId(opts.projectId);
142
+ const catalog = normalizeCapabilityList(await listCapabilities(host, gatewayDomain, projectId));
121
143
  const capabilities = filterCapabilities(catalog, opts.domain);
122
144
  return { domain: opts.domain, count: capabilities.length, capabilities };
123
145
  });
124
- }).addHelpText("after", "\nExample:\n ae-cli capability list --domain analysis");
125
- capability.command("search").description("Search capability IDs and descriptions in a domain").argument("<query>", "Case-insensitive search terms").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").action(async (query, opts) => {
146
+ }).addHelpText(
147
+ "after",
148
+ "\nExamples:\n ae-cli capability list --domain analysis\n ae-cli capability list --domain analysis --project-id 1"
149
+ );
150
+ capability.command("search").description("Search capability IDs and descriptions in a domain").argument("<query>", "Case-insensitive search terms").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").option("--project-id <project-id>", "Filter by project membership, permissions, and enabled features").action(async (query, opts) => {
126
151
  await executeAndPrint(program, async (host) => {
127
152
  const gatewayDomain = findGatewayDomain(opts.domain) ?? opts.domain;
128
- const catalog = normalizeCapabilityList(await listCapabilities(host, gatewayDomain));
153
+ const projectId = parseOptionalProjectId(opts.projectId);
154
+ const catalog = normalizeCapabilityList(await listCapabilities(host, gatewayDomain, projectId));
129
155
  const capabilities = filterCapabilities(catalog, opts.domain, query);
130
156
  return { domain: opts.domain, query, count: capabilities.length, capabilities };
131
157
  });
132
- }).addHelpText("after", '\nExample:\n ae-cli capability search "dashboard list" --domain analysis');
133
- capability.command("inspect").description("Inspect one capability schema, risk, auth, and output metadata").argument("<capability-id>", "Capability ID, such as analysis.report.list").option("--domain <domain>", "Override the capability namespace used for gateway routing").action(async (capabilityId, opts) => {
158
+ }).addHelpText(
159
+ "after",
160
+ '\nExamples:\n ae-cli capability search "dashboard list" --domain analysis\n ae-cli capability search "dashboard list" --domain analysis --project-id 1'
161
+ );
162
+ capability.command("inspect").description("Inspect one capability schema, risk, auth, and output metadata").argument("<capability-id>", "Capability ID, such as analysis.report.list").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--project-id <project-id>", "Check availability in a project before returning metadata").action(async (capabilityId, opts) => {
134
163
  await executeAndPrint(program, async (host) => {
135
164
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
136
- return inspectCapability(host, gatewayDomain, capabilityId);
165
+ return inspectCapability(host, gatewayDomain, capabilityId, parseOptionalProjectId(opts.projectId));
137
166
  });
138
- }).addHelpText("after", "\nExample:\n ae-cli capability inspect analysis.dashboard.list");
167
+ }).addHelpText(
168
+ "after",
169
+ "\nExamples:\n ae-cli capability inspect analysis.dashboard.list\n ae-cli capability inspect analysis.dashboard.list --project-id 1"
170
+ );
139
171
  capability.command("validate").description(
140
172
  "Validate and normalize capability input only (schema/params). Does not execute business logic. Use when crafting complex payloads (nested objects, qp, share/member payloads) before dry-run/run. Success data: valid, capability_id, normalized_input. Unlike dry-run, does not return risk/output_mode/supports_cancel preview."
141
173
  ).argument("<capability-id>", "Capability ID, such as metadata.data_table.sql_write").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--input <json-or-path>", "Input JSON object, file path, @<path>, or - for stdin").action(async (capabilityId, opts) => {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-OO6XR6LK.js";
5
5
  import {
6
6
  findGatewayDomain
7
- } from "./chunk-HL2AJQ4Q.js";
7
+ } from "./chunk-PTE56QPL.js";
8
8
  import {
9
9
  CapabilityGatewayError,
10
10
  dryRunCapability,
@@ -12,22 +12,23 @@ import {
12
12
  inspectCapability,
13
13
  listCapabilities,
14
14
  validateCapability
15
- } from "./chunk-DYOS6YY7.js";
15
+ } from "./chunk-RGXCNC4N.js";
16
16
  import {
17
17
  printError,
18
18
  printOutput
19
- } from "./chunk-TNW2CI4W.js";
20
- import {
21
- PermissionError
22
- } from "./chunk-NOO24N7W.js";
23
- import "./chunk-2NDGFQHW.js";
19
+ } from "./chunk-IMMGMU54.js";
20
+ import "./chunk-E7UXXHO3.js";
24
21
  import {
25
22
  SecureStoreAuthError,
26
23
  resolveHost
27
- } from "./chunk-AJTH7LT3.js";
24
+ } from "./chunk-IR4ZLVPW.js";
28
25
  import {
29
26
  safeJsonParse
30
- } from "./chunk-YCLVYFK7.js";
27
+ } from "./chunk-V6FR6WTW.js";
28
+ import {
29
+ PermissionError
30
+ } from "./chunk-24BAVOX3.js";
31
+ import "./chunk-LYVNONC4.js";
31
32
 
32
33
  // src/commands/capability/index.ts
33
34
  import * as readline from "readline";
@@ -55,6 +56,26 @@ function resolveCapabilityGatewayDomain(capabilityId, domainOverride) {
55
56
  }
56
57
  return findGatewayDomain(cliDomain) ?? cliDomain;
57
58
  }
59
+ function parseOptionalProjectId(raw) {
60
+ if (raw === void 0) {
61
+ return void 0;
62
+ }
63
+ const value = raw.trim();
64
+ if (!/^[1-9]\d*$/.test(value)) {
65
+ throw new CapabilityCommandValidationError(
66
+ "--project-id must be a positive integer.",
67
+ "Example: --project-id 1"
68
+ );
69
+ }
70
+ const projectId = Number(value);
71
+ if (!Number.isSafeInteger(projectId)) {
72
+ throw new CapabilityCommandValidationError(
73
+ "--project-id is outside the supported integer range.",
74
+ "Pass a positive safe integer."
75
+ );
76
+ }
77
+ return projectId;
78
+ }
58
79
  function normalizeCapabilityList(value) {
59
80
  if (!Array.isArray(value)) {
60
81
  throw new Error("Capability gateway returned an invalid catalog: expected an array.");
@@ -114,28 +135,39 @@ function registerCapability(program) {
114
135
  printError("validation", "Missing subcommand.", "Run: ae-cli capability --help");
115
136
  process.exitCode = 1;
116
137
  });
117
- capability.command("list").description("List capability summaries in a domain").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").action(async (opts) => {
138
+ capability.command("list").description("List capability summaries in a domain").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").option("--project-id <project-id>", "Filter by project membership, permissions, and enabled features").action(async (opts) => {
118
139
  await executeAndPrint(program, async (host) => {
119
140
  const gatewayDomain = findGatewayDomain(opts.domain) ?? opts.domain;
120
- const catalog = normalizeCapabilityList(await listCapabilities(host, gatewayDomain));
141
+ const projectId = parseOptionalProjectId(opts.projectId);
142
+ const catalog = normalizeCapabilityList(await listCapabilities(host, gatewayDomain, projectId));
121
143
  const capabilities = filterCapabilities(catalog, opts.domain);
122
144
  return { domain: opts.domain, count: capabilities.length, capabilities };
123
145
  });
124
- }).addHelpText("after", "\nExample:\n ae-cli capability list --domain analysis");
125
- capability.command("search").description("Search capability IDs and descriptions in a domain").argument("<query>", "Case-insensitive search terms").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").action(async (query, opts) => {
146
+ }).addHelpText(
147
+ "after",
148
+ "\nExamples:\n ae-cli capability list --domain analysis\n ae-cli capability list --domain analysis --project-id 1"
149
+ );
150
+ capability.command("search").description("Search capability IDs and descriptions in a domain").argument("<query>", "Case-insensitive search terms").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").option("--project-id <project-id>", "Filter by project membership, permissions, and enabled features").action(async (query, opts) => {
126
151
  await executeAndPrint(program, async (host) => {
127
152
  const gatewayDomain = findGatewayDomain(opts.domain) ?? opts.domain;
128
- const catalog = normalizeCapabilityList(await listCapabilities(host, gatewayDomain));
153
+ const projectId = parseOptionalProjectId(opts.projectId);
154
+ const catalog = normalizeCapabilityList(await listCapabilities(host, gatewayDomain, projectId));
129
155
  const capabilities = filterCapabilities(catalog, opts.domain, query);
130
156
  return { domain: opts.domain, query, count: capabilities.length, capabilities };
131
157
  });
132
- }).addHelpText("after", '\nExample:\n ae-cli capability search "dashboard list" --domain analysis');
133
- capability.command("inspect").description("Inspect one capability schema, risk, auth, and output metadata").argument("<capability-id>", "Capability ID, such as analysis.report.list").option("--domain <domain>", "Override the capability namespace used for gateway routing").action(async (capabilityId, opts) => {
158
+ }).addHelpText(
159
+ "after",
160
+ '\nExamples:\n ae-cli capability search "dashboard list" --domain analysis\n ae-cli capability search "dashboard list" --domain analysis --project-id 1'
161
+ );
162
+ capability.command("inspect").description("Inspect one capability schema, risk, auth, and output metadata").argument("<capability-id>", "Capability ID, such as analysis.report.list").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--project-id <project-id>", "Check availability in a project before returning metadata").action(async (capabilityId, opts) => {
134
163
  await executeAndPrint(program, async (host) => {
135
164
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
136
- return inspectCapability(host, gatewayDomain, capabilityId);
165
+ return inspectCapability(host, gatewayDomain, capabilityId, parseOptionalProjectId(opts.projectId));
137
166
  });
138
- }).addHelpText("after", "\nExample:\n ae-cli capability inspect analysis.dashboard.list");
167
+ }).addHelpText(
168
+ "after",
169
+ "\nExamples:\n ae-cli capability inspect analysis.dashboard.list\n ae-cli capability inspect analysis.dashboard.list --project-id 1"
170
+ );
139
171
  capability.command("validate").description(
140
172
  "Validate and normalize capability input only (schema/params). Does not execute business logic. Use when crafting complex payloads (nested objects, qp, share/member payloads) before dry-run/run. Success data: valid, capability_id, normalized_input. Unlike dry-run, does not return risk/output_mode/supports_cancel preview."
141
173
  ).argument("<capability-id>", "Capability ID, such as metadata.data_table.sql_write").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--input <json-or-path>", "Input JSON object, file path, @<path>, or - for stdin").action(async (capabilityId, opts) => {
@@ -0,0 +1,51 @@
1
+ // src/core/errors.ts
2
+ var PermissionError = class extends Error {
3
+ constructor(message) {
4
+ super(message);
5
+ this.name = "PermissionError";
6
+ }
7
+ };
8
+ var CliValidationError = class extends Error {
9
+ code;
10
+ hint;
11
+ location;
12
+ constructor(message, options = {}) {
13
+ super(message);
14
+ this.name = "CliValidationError";
15
+ this.code = options.code;
16
+ this.hint = options.hint;
17
+ if (options.location) {
18
+ const location = {};
19
+ if (typeof options.location.segment === "number" && Number.isFinite(options.location.segment)) {
20
+ location.segment = options.location.segment;
21
+ }
22
+ if (typeof options.location.record === "number" && Number.isFinite(options.location.record)) {
23
+ location.record = options.location.record;
24
+ }
25
+ if (typeof options.location.field === "string" && options.location.field.length > 0) {
26
+ location.field = options.location.field;
27
+ }
28
+ if (Object.keys(location).length > 0) this.location = location;
29
+ }
30
+ }
31
+ };
32
+ var CommunityReportError = class extends Error {
33
+ code;
34
+ httpStatus;
35
+ hint;
36
+ meta;
37
+ constructor(message, options = {}) {
38
+ super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
39
+ this.name = "CommunityReportError";
40
+ this.code = options.code;
41
+ this.httpStatus = options.httpStatus;
42
+ this.hint = options.hint;
43
+ this.meta = options.meta;
44
+ }
45
+ };
46
+
47
+ export {
48
+ PermissionError,
49
+ CliValidationError,
50
+ CommunityReportError
51
+ };
@@ -1,12 +1,12 @@
1
- import {
2
- PermissionError
3
- } from "./chunk-NOO24N7W.js";
4
1
  import {
5
2
  getCliToken
6
- } from "./chunk-2NDGFQHW.js";
3
+ } from "./chunk-E7UXXHO3.js";
7
4
  import {
8
5
  safeJsonParse
9
- } from "./chunk-YCLVYFK7.js";
6
+ } from "./chunk-V6FR6WTW.js";
7
+ import {
8
+ PermissionError
9
+ } from "./chunk-24BAVOX3.js";
10
10
 
11
11
  // src/core/mcp-access.ts
12
12
  function buildUrl(host, path, params = {}) {
@@ -1,18 +1,20 @@
1
1
  import {
2
2
  getAnalysisMappingPathForClusterMode
3
- } from "./chunk-KGJQCYVC.js";
4
- import {
5
- PermissionError
6
- } from "./chunk-NOO24N7W.js";
3
+ } from "./chunk-LCXU3AAT.js";
7
4
  import {
8
5
  clearCliToken,
9
6
  getCliToken
10
- } from "./chunk-2NDGFQHW.js";
7
+ } from "./chunk-E7UXXHO3.js";
11
8
  import {
12
9
  getActiveHost,
13
- logger,
14
10
  safeJsonParse
15
- } from "./chunk-YCLVYFK7.js";
11
+ } from "./chunk-V6FR6WTW.js";
12
+ import {
13
+ PermissionError
14
+ } from "./chunk-24BAVOX3.js";
15
+ import {
16
+ logger
17
+ } from "./chunk-LYVNONC4.js";
16
18
 
17
19
  // src/core/mcp.ts
18
20
  async function permissionMessage(resp) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getActiveHost,
3
3
  getSandboxRuntimeRoot
4
- } from "./chunk-YCLVYFK7.js";
4
+ } from "./chunk-V6FR6WTW.js";
5
5
 
6
6
  // src/core/te-agent-credentials.ts
7
7
  import { readFileSync } from "fs";
@@ -147,8 +147,8 @@ async function signRequest(method, path, rawBody) {
147
147
  rawBody
148
148
  };
149
149
  }
150
- const { getToken } = await import("./auth-MEJ642P4.js");
151
- const { getCliToken } = await import("./cli-token-TVQRSE46.js");
150
+ const { getToken } = await import("./auth-ENM3FE6L.js");
151
+ const { getCliToken } = await import("./cli-token-4SBMXAUK.js");
152
152
  const baseUrl = sandboxCred?.url || teClaudeBaseFromActiveHost();
153
153
  const hostForToken = getActiveHost() || baseUrl;
154
154
  if (!baseUrl) {
@@ -338,7 +338,7 @@ async function uploadToMainApp(path, formData) {
338
338
  "X-Sandbox-Secret-Key": sandboxCred.sandboxSecretKey
339
339
  };
340
340
  } else {
341
- const { getToken } = await import("./auth-MEJ642P4.js");
341
+ const { getToken } = await import("./auth-ENM3FE6L.js");
342
342
  baseUrl = (sandboxCred?.url || teClaudeBaseFromActiveHost() || "").replace(/\/$/, "");
343
343
  if (!baseUrl) {
344
344
  throw new TeAgentCredentialsError(
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  resolveGatewayDomain
3
- } from "./chunk-HL2AJQ4Q.js";
3
+ } from "./chunk-PTE56QPL.js";
4
4
  import {
5
5
  dryRunCapability,
6
6
  executeCapabilityWithEnvelope,
7
7
  validateCapability
8
- } from "./chunk-I4A62X3N.js";
8
+ } from "./chunk-RGXCNC4N.js";
9
9
  import {
10
10
  withOutputMetadata
11
- } from "./chunk-TNW2CI4W.js";
11
+ } from "./chunk-IMMGMU54.js";
12
12
 
13
13
  // src/core/capability-command.ts
14
14
  import { randomBytes } from "crypto";
@@ -22,6 +22,9 @@ function createCapabilityCommand(config) {
22
22
  flags: config.flags,
23
23
  risk: config.risk,
24
24
  validate: config.validate,
25
+ preflight: (ctx) => {
26
+ config.buildInput(ctx);
27
+ },
25
28
  validateInput: async (ctx) => {
26
29
  const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
27
30
  const requestHost = config.requestHost ?? ctx.host();
@@ -40,7 +43,7 @@ function createCapabilityCommand(config) {
40
43
  const input = withLifecycleRequestId(config, config.buildInput(ctx));
41
44
  announceDispatch(config.capabilityId, input);
42
45
  const result = await executeCapabilityWithEnvelope(requestHost, gatewayDomain, config.capabilityId, input);
43
- const data = config.postProcess ? config.postProcess(result.data, input) : result.data;
46
+ const data = config.postProcess ? config.postProcess(result.data, input, ctx) : result.data;
44
47
  return withOutputMetadata(data, result.meta);
45
48
  }
46
49
  };
@@ -1,18 +1,20 @@
1
1
  import {
2
2
  getAnalysisMappingPathForClusterMode
3
- } from "./chunk-KGJQCYVC.js";
4
- import {
5
- PermissionError
6
- } from "./chunk-NOO24N7W.js";
3
+ } from "./chunk-LCXU3AAT.js";
7
4
  import {
8
5
  clearCliToken,
9
6
  getCliToken
10
- } from "./chunk-2NDGFQHW.js";
7
+ } from "./chunk-E7UXXHO3.js";
11
8
  import {
12
9
  getActiveHost,
13
- logger,
14
10
  safeJsonParse
15
- } from "./chunk-YCLVYFK7.js";
11
+ } from "./chunk-V6FR6WTW.js";
12
+ import {
13
+ PermissionError
14
+ } from "./chunk-24BAVOX3.js";
15
+ import {
16
+ logger
17
+ } from "./chunk-LYVNONC4.js";
16
18
 
17
19
  // src/core/mcp.ts
18
20
  async function permissionMessage(resp) {
@@ -3,11 +3,13 @@ import {
3
3
  getToken,
4
4
  invalidateAccessTokenForRetry,
5
5
  resolveHost
6
- } from "./chunk-AJTH7LT3.js";
6
+ } from "./chunk-IR4ZLVPW.js";
7
7
  import {
8
- logger,
9
8
  safeJsonParse
10
- } from "./chunk-YCLVYFK7.js";
9
+ } from "./chunk-V6FR6WTW.js";
10
+ import {
11
+ logger
12
+ } from "./chunk-LYVNONC4.js";
11
13
 
12
14
  // src/core/client.ts
13
15
  import WebSocket from "ws";
@@ -3,17 +3,19 @@ import {
3
3
  load,
4
4
  loadCliToken,
5
5
  save
6
- } from "./chunk-AJTH7LT3.js";
6
+ } from "./chunk-IR4ZLVPW.js";
7
7
  import {
8
8
  getActiveHost,
9
9
  getConfigDir,
10
10
  getFallbackCliToken,
11
11
  listHosts,
12
- logger,
13
12
  normalizeUrl,
14
13
  safeJsonParse,
15
14
  safeReadJsonFile
16
- } from "./chunk-YCLVYFK7.js";
15
+ } from "./chunk-V6FR6WTW.js";
16
+ import {
17
+ logger
18
+ } from "./chunk-LYVNONC4.js";
17
19
 
18
20
  // src/core/cli-token.ts
19
21
  import fs from "fs";
@@ -125,6 +127,11 @@ function clearPersistedCliToken(hostUrl) {
125
127
  save(hostUrl, { ...existing, cliToken: void 0 });
126
128
  }
127
129
  }
130
+ function peekCliToken(hostOverride) {
131
+ const hostUrl = hostOverride || getActiveHost();
132
+ if (!hostUrl) return void 0;
133
+ return _cliTokenCache.get(hostUrl) || loadCliToken(hostUrl) || getFallbackCliToken(hostUrl) || void 0;
134
+ }
128
135
  async function getCliToken(hostOverride) {
129
136
  const hostUrl = hostOverride || getActiveHost();
130
137
  let token = _cliTokenCache.get(hostUrl);
@@ -182,6 +189,7 @@ function _resetRenewMemoryForTest() {
182
189
 
183
190
  export {
184
191
  localRenewDate,
192
+ peekCliToken,
185
193
  getCliToken,
186
194
  mintCliToken,
187
195
  clearCliToken,
@@ -1,14 +1,16 @@
1
- import {
2
- PermissionError
3
- } from "./chunk-NOO24N7W.js";
4
1
  import {
5
2
  clearCliToken,
6
3
  getCliToken
7
- } from "./chunk-2NDGFQHW.js";
4
+ } from "./chunk-E7UXXHO3.js";
8
5
  import {
9
- logger,
10
6
  safeJsonParse
11
- } from "./chunk-YCLVYFK7.js";
7
+ } from "./chunk-V6FR6WTW.js";
8
+ import {
9
+ PermissionError
10
+ } from "./chunk-24BAVOX3.js";
11
+ import {
12
+ logger
13
+ } from "./chunk-LYVNONC4.js";
12
14
 
13
15
  // src/core/capability-api.ts
14
16
  import { readFile } from "fs/promises";
@@ -145,11 +147,11 @@ async function requestMultipartOnce(url, token, form) {
145
147
  body: form
146
148
  });
147
149
  }
148
- async function callGateway(host, domain, pathAfterV1, method, body) {
149
- return (await callGatewayWithEnvelope(host, domain, pathAfterV1, method, body)).data;
150
+ async function callGateway(host, domain, pathAfterV1, method, body, queryParams = {}) {
151
+ return (await callGatewayWithEnvelope(host, domain, pathAfterV1, method, body, queryParams)).data;
150
152
  }
151
- async function callGatewayWithEnvelope(host, domain, pathAfterV1, method, body) {
152
- const url = buildCapabilityGatewayUrl(host, domain, pathAfterV1);
153
+ async function callGatewayWithEnvelope(host, domain, pathAfterV1, method, body, queryParams = {}) {
154
+ const url = buildCapabilityGatewayUrl(host, domain, pathAfterV1, queryParams);
153
155
  const token = await getCliToken(host);
154
156
  let resp = await requestOnce(url, method, token, body);
155
157
  let permissionMsg;
@@ -210,11 +212,18 @@ async function requestCapabilityGatewayWithEnvelope(host, domain, pathAfterV1, m
210
212
  const resp = await fetchCapabilityGateway(host, domain, pathAfterV1, method, body);
211
213
  return parseCapabilityEnvelope(parseCapabilityResponse(await resp.text()));
212
214
  }
213
- async function listCapabilities(host, domain) {
214
- return callGateway(host, domain, "capabilities", "GET");
215
+ async function listCapabilities(host, domain, projectId) {
216
+ return callGateway(host, domain, "capabilities", "GET", void 0, { project_id: projectId });
215
217
  }
216
- async function inspectCapability(host, domain, capabilityId) {
217
- return callGateway(host, domain, `capabilities/${capabilityId}`, "GET");
218
+ async function inspectCapability(host, domain, capabilityId, projectId) {
219
+ return callGateway(
220
+ host,
221
+ domain,
222
+ `capabilities/${capabilityId}`,
223
+ "GET",
224
+ void 0,
225
+ { project_id: projectId }
226
+ );
218
227
  }
219
228
  async function executeCapability(host, domain, capabilityId, input = {}) {
220
229
  return callGateway(host, domain, `capabilities/${capabilityId}/execute`, "POST", { input });