@thinkingai/ae-cli 6.0.56 → 6.0.57

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 (111) hide show
  1. package/README.md +12 -4
  2. package/README.zh.md +12 -4
  3. package/bin/ae-cli.js +5 -0
  4. package/bin/runtime-capabilities.json +5 -0
  5. package/cli-installation-guide.md +24 -3
  6. package/dist/{auth-U7MNUUEF.js → auth-YEIJLBFY.js} +30 -12
  7. package/dist/{automation-K32V2NKP.js → automation-NAR5DDGL.js} +6 -6
  8. package/dist/{capability-VV7RHB3B.js → capability-P7DD4Q73.js} +48 -20
  9. package/dist/{chunk-KHS64JZQ.js → chunk-72NJKS7O.js} +4 -4
  10. package/dist/chunk-752BSLZC.js +222 -0
  11. package/dist/{chunk-W2PTY5NN.js → chunk-7ABK2PEJ.js} +3 -3
  12. package/dist/{chunk-UUD5RB36.js → chunk-7JAVT5TK.js} +3 -3
  13. package/dist/{chunk-P7KL7IOH.js → chunk-H3K5UGYC.js} +2 -2
  14. package/dist/{chunk-P6VFCH3P.js → chunk-IN7KKL6K.js} +2 -2
  15. package/dist/{chunk-MXV3PYC3.js → chunk-JCWM2TYP.js} +50 -12
  16. package/dist/{chunk-T44M3PLZ.js → chunk-JEUXDY3B.js} +1 -1
  17. package/dist/{chunk-LMCYSVVA.js → chunk-JNVVJ273.js} +51 -37
  18. package/dist/{chunk-JJJIP2XQ.js → chunk-N6XBLRB7.js} +2 -2
  19. package/dist/{chunk-QSAR3GHY.js → chunk-OAWPT7VP.js} +2 -2
  20. package/dist/{chunk-F6NIPIT5.js → chunk-QEMQKVHW.js} +35 -14
  21. package/dist/{chunk-2IYIYSUO.js → chunk-QVRIDN42.js} +2 -2
  22. package/dist/{chunk-GI5BMEZO.js → chunk-QZUVLFNR.js} +1 -1
  23. package/dist/{chunk-2UWS5CUP.js → chunk-RJHGDWSC.js} +3 -3
  24. package/dist/{chunk-3TQA5RXE.js → chunk-TKVVACEJ.js} +6 -4
  25. package/dist/chunk-TULINOLS.js +2283 -0
  26. package/dist/{chunk-X7DRLE62.js → chunk-YVG6QD3V.js} +1 -1
  27. package/dist/{chunk-ZW4VMY5H.js → chunk-Z3Q2AEIN.js} +152 -98
  28. package/dist/chunk-ZGIYG473.js +132 -0
  29. package/dist/{community-report-client-S2K3A3Q6.js → community-report-client-TJVCLZ3K.js} +1 -1
  30. package/dist/compat-check-PMEGUPZU.js +32 -0
  31. package/dist/{config-ASSAAIOI.js → config-VWVPR4WW.js} +38 -6
  32. package/dist/{context-6RWLVOM5.js → context-F6FCGTF3.js} +4 -4
  33. package/dist/{data-integration-EXSUPUDZ.js → data-integration-6UAZO4GG.js} +207 -24
  34. package/dist/{evaluation-5YT4QLCL.js → evaluation-4LO2O4AF.js} +4 -4
  35. package/dist/index.js +291 -71
  36. package/dist/{local-data-upload-client-7HCPGIS3.js → local-data-upload-client-KCMG6J62.js} +1 -1
  37. package/dist/{memory-VCYLVPMI.js → memory-HHPX3NF2.js} +6 -6
  38. package/dist/{metadata-TIWIOFTU.js → metadata-HEQQEEG3.js} +16 -8
  39. package/dist/{model-DPJHSD73.js → model-7UHGWYVR.js} +4 -4
  40. package/dist/{personal-semantic-preference-SBKU2LOK.js → personal-semantic-preference-V4L6ZWR2.js} +7 -6
  41. package/dist/{project-semantic-SKNWLH3I.js → project-semantic-NKHKJX6M.js} +7 -6
  42. package/dist/{sync-7PP6KQ75.js → sync-ZJMXCRIN.js} +8 -7
  43. package/dist/{te-agent-L2BYNPHM.js → te-agent-WBKIFEQD.js} +11 -7
  44. package/dist/{te-analysis-RJB6VJC4.js → te-analysis-ADX7RKO4.js} +179 -27
  45. package/dist/{te-community-QN3WMPNT.js → te-community-PREDRXG3.js} +720 -228
  46. package/dist/{te-dataops-UKD2XN3E.js → te-dataops-ITWJHO2U.js} +6 -5
  47. package/dist/{te-engage-KPTN4N2U.js → te-engage-VE2NUH5V.js} +7 -6
  48. package/dist/{te-kb-SFZI3W5T.js → te-kb-WSMOW7WS.js} +407 -83
  49. package/dist/{te-system-IE7NCKC3.js → te-system-YM657FKO.js} +6 -6
  50. package/dist/{te-team-4KHCFM2I.js → te-team-T2WRLOOD.js} +7 -6
  51. package/dist/{things-7JJUVAWL.js → things-6QOMFXOG.js} +7 -7
  52. package/dist/{update-AX66IFMJ.js → update-I4MOUYOX.js} +11 -7
  53. package/dist/{workspace-Q5NMEKEN.js → workspace-LYDAP647.js} +6 -6
  54. package/package.json +17 -7
  55. package/skills/ae-agent/SKILL.md +1 -1
  56. package/skills/ae-agent/references/resource-package.md +4 -0
  57. package/skills/ae-analysis/SKILL.md +14 -10
  58. package/skills/ae-analysis/references/agent_review_preflight.md +52 -11
  59. package/skills/ae-analysis/references/agent_review_priorities_comparisons.md +5 -3
  60. package/skills/ae-analysis/references/agent_review_submit_to_page.md +57 -25
  61. package/skills/ae-analysis/references/command_index.md +7 -3
  62. package/skills/ae-analysis/references/governance_recommendation_export.md +31 -17
  63. package/skills/ae-analysis/references/governance_recommendation_run_update.md +13 -0
  64. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +9 -1
  65. package/skills/ae-analysis/references/scenario_append.md +6 -0
  66. package/skills/ae-analysis/references/scenario_begin.md +11 -0
  67. package/skills/ae-analysis/references/scenario_collect.md +10 -2
  68. package/skills/ae-analysis/references/scenario_evaluation.md +6 -18
  69. package/skills/ae-analysis/references/scenario_get.md +15 -0
  70. package/skills/ae-analysis/references/scenario_list.md +64 -0
  71. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +14 -1
  72. package/skills/ae-community/SKILL.md +77 -27
  73. package/skills/ae-community/references/community-analyzing-theme-comment.md +10 -8
  74. package/skills/ae-community/references/community-data-quality.md +68 -0
  75. package/skills/ae-community/references/community-query-evidence.md +85 -0
  76. package/skills/ae-community/references/community-scenario-capabilities.md +137 -0
  77. package/skills/ae-community/references/community-weekly-report.md +6 -3
  78. package/skills/ae-community/references/get_channel_info.md +7 -4
  79. package/skills/ae-community/references/get_comment_tag_analysis.md +3 -3
  80. package/skills/ae-community/references/get_comments_summary.md +4 -4
  81. package/skills/ae-community/references/get_corpus_tags.md +3 -3
  82. package/skills/ae-community/references/get_daily_summary.md +3 -3
  83. package/skills/ae-community/references/get_hot_topics.md +3 -3
  84. package/skills/ae-community/references/get_livestream_analysis.md +3 -3
  85. package/skills/ae-community/references/get_livestream_detail.md +4 -4
  86. package/skills/ae-community/references/get_livestream_list.md +3 -3
  87. package/skills/ae-community/references/get_livestream_overview.md +3 -3
  88. package/skills/ae-community/references/get_livestream_room_metrics.md +3 -3
  89. package/skills/ae-community/references/get_livestream_rooms.md +3 -3
  90. package/skills/ae-community/references/get_overview_metrics.md +3 -3
  91. package/skills/ae-community/references/get_post_detail.md +4 -4
  92. package/skills/ae-community/references/get_risk_content.md +5 -5
  93. package/skills/ae-community/references/get_sentiment_overview.md +4 -4
  94. package/skills/ae-community/references/get_tag_trends.md +3 -3
  95. package/skills/ae-community/references/get_topic_detail.md +3 -3
  96. package/skills/ae-community/references/list_sources.md +28 -0
  97. package/skills/ae-community/references/list_spaces.md +39 -0
  98. package/skills/ae-community/references/search_posts.md +21 -7
  99. package/skills/ae-data-integration/SKILL.md +6 -4
  100. package/skills/ae-data-integration/references/error-handling.md +1 -0
  101. package/skills/ae-data-integration/references/handoff.md +1 -1
  102. package/skills/ae-data-integration/references/sink-upload.md +11 -0
  103. package/skills/ae-data-integration/references/source-inspect.md +2 -1
  104. package/skills/ae-data-integration/references/transform.md +1 -1
  105. package/skills/ae-data-integration/references/ue-mapping.md +1 -1
  106. package/skills/ae-kb/SKILL.md +33 -6
  107. package/skills/ae-kb/references/publication.md +81 -0
  108. package/skills/ae-kb/references/query-workflow.md +14 -1
  109. package/skills/ae-metadata/SKILL.md +2 -2
  110. package/skills/ae-metadata/references/metadata_data_table_get.md +35 -0
  111. package/dist/chunk-ELCR235M.js +0 -1429
package/README.md CHANGED
@@ -17,7 +17,6 @@ The CLI is designed around:
17
17
  - Node.js 20 or later.
18
18
  - macOS, Linux, or native Windows (PowerShell / Command Prompt); WSL is optional.
19
19
  - Access to the npm registry for CLI installation.
20
- - Access to GitHub only when the bundled Skills source cannot be used.
21
20
 
22
21
  ## Installation
23
22
 
@@ -30,7 +29,7 @@ npx @thinkingai/ae-cli@latest install
30
29
  npx @thinkingai/ae-cli@latest install --format json
31
30
  ```
32
31
 
33
- The installer checks Node.js 20+, installs and verifies the CLI, then installs matching Skills globally in `~/.agents/skills`, writing the shared files once before automatically distributing copies to clients that need their own directory. No Agent selection is needed; Codex and Cursor can share these Skills even when installed later. `--dry-run`, `--format json`, and optional `--host <AE_HOST>` are supported. Unrelated project-only client warnings are hidden after successful verification; missing files and YAML errors remain failures. Being logged out is not an installation failure. See the [installation guide](./cli-installation-guide.md).
32
+ The installer checks Node.js 20+, installs and verifies the CLI, then uses the bundled Skills tool to install matching global Skills for supported clients. First installation includes all bundled Skills when no business state has been confirmed. `--dry-run`, `--format json`, and optional `--host <AE_HOST>` are supported. Being logged out is not an installation failure. See the [installation guide](./cli-installation-guide.md).
34
33
 
35
34
  The Skills teach supported coding Agents, including Claude Code, Codex, Cursor, and similar tools, how to discover and call `ae-cli`.
36
35
 
@@ -51,6 +50,10 @@ ae-cli auth status
51
50
 
52
51
  Use the AE URL supplied by your AgenticEngine administrator. If no Host is configured, `ae-cli` guides existing customers to obtain that URL first. Only users without an AgenticEngine environment are directed to [request a trial](https://thinkingai.cn/request-demo).
53
52
 
53
+ Business-based command filtering and Skill selection apply only to local CLI use by external Agents; built-in TE Agent sandboxes keep the complete command and Skill sets. After successful login, the CLI filters `--help` and capability discovery by the active environment’s enabled businesses and synchronizes managed global Skills. Analysis remains available by default. Run `ae-cli config refresh` after enabling a business to fetch its state and restore its Skills. Switching the active environment or account synchronizes again; a one-off `--host` query does not change global Skills.
54
+
55
+ Only explicitly disabled businesses are removed. Older servers, missing states, and network failures do not trigger removal. Legacy client links to a verified, unmodified managed shared Skill are migrated automatically; other modified or unrecognized copies are preserved and reported. Start a new Agent session after synchronization; existing conversation context is retained.
56
+
54
57
  ## Environment-Bound Updates
55
58
 
56
59
  Each AE environment returns the exact `aeCliVersion` it expects. Use the unified update command to install that CLI version and its matching Skills:
@@ -64,9 +67,9 @@ Updates use the same global Skills installation and verification as `install`. O
64
67
 
65
68
  Automatic synchronization runs during normal commands after login; host version checks are cached for up to one hour. `ae-cli update --host <AE_HOST>` checks immediately. After a downgrade, future updates run the older CLI's own updater, including its historical limitations. To use the new installer logic while following an older host, run `npx @thinkingai/ae-cli@latest update --host <AE_HOST>`; the target remains the host-required version.
66
69
 
67
- `ae-cli update` installs the exact version required by the active host rather than npm `latest`. It synchronizes Skills from the installed npm package first and uses the matching GitHub tag only as a fallback.
70
+ `ae-cli update` installs the exact version required by the active host rather than npm `latest`. Skills are synchronized from the verified target package; modified or unrecognized copies are preserved and reported.
68
71
 
69
- Starting with the `6.0.37` and `6.1.9` release lines, ordinary business commands can automatically upgrade or downgrade the CLI to the host-required version, including switching from `6.0.x` to `6.1.x`. Automatic synchronization requires stable `major.minor.patch` versions at both ends; development and other nonstandard versions are skipped. After a successful synchronization, the old process exits with `AE_CLI_VERSION_SYNCED`; re-run the original command so it executes with the new CLI and Skills. Installation failures are reported without replacing the business command's JSON output.
72
+ Starting with the `6.0.37` and `6.1.9` release lines, ordinary business commands can automatically upgrade or downgrade the CLI to the host-required version, including switching from `6.0.x` to `6.1.x`. Automatic synchronization requires stable `major.minor.patch` versions at both ends; development and other nonstandard versions are skipped. After successful synchronization, the new CLI automatically executes the original command once and returns its result and exit code. Arguments, piped input, working directory, and confirmation behavior are preserved. If the new CLI cannot start, `AE_CLI_VERSION_SYNCED` asks you to re-run manually; an executed command is never retried automatically. Installation failures are reported without replacing the business command's JSON output.
70
73
 
71
74
  Useful controls:
72
75
 
@@ -157,6 +160,8 @@ The table covers every current root command individually. Use `ae-cli --help` fo
157
160
  | Agent platform | `automation` | Automation configuration, execution, history, and results |
158
161
  <!-- root-command-surface:end -->
159
162
 
163
+ Review collected analysis questions with `ae-cli analysis scenario list --project-id 1 --days 7`. The `ae-analysis` Skill can deduplicate questions and assess badcases with concise, evidence-based reasons. See the [scenario review guide](skills/ae-analysis/references/scenario_list.md). Answers can include elapsed time; use `ae-cli analysis scenario get --help` to query linked command execution details.
164
+
160
165
  Evaluation commands follow the current AE Host in personal terminals and sandboxes; use `--host` to select another host. Evaluation requests use the HTTP or HTTPS scheme configured for that AE Host, consistent with other AE commands. Legacy `--endpoint` and `AE_EVAL_BASE_URL` values may only match the current AE Host; other values fail before credentials are sent. Remove these settings and use `--host` to select a host. Outside a sandbox, export `AE_EVAL_ACCESS_TOKEN` with a platform session token; sandboxes can obtain a session automatically. See [endpoint and authentication rules](skills/ae-evaluation/SKILL.md#endpoint-and-authentication).
161
166
 
162
167
  ## Capability Gateway
@@ -266,6 +271,9 @@ JSON flags generally accept inline JSON, `@file`, a file path, or `-` for stdin.
266
271
 
267
272
  ## Knowledge Bases
268
273
 
274
+ Use `ae-cli kb candidate changes --name <name> --candidate <id>` to review changed sources, Wiki and Index before approving a company compilation. See [Publication previews](skills/ae-kb/references/publication.md) for entry details and bounded text diffs.
275
+ For large approval previews, use `kb candidate changes --group wiki --search payment --offset 0 --limit 50`. The first successful compilation publishes automatically; later company KB updates require approval.
276
+
269
277
  Manage the server-side knowledge-base lifecycle:
270
278
 
271
279
  ```bash
package/README.zh.md CHANGED
@@ -17,7 +17,6 @@ CLI 的核心设计包括:
17
17
  - Node.js 20 或更高版本。
18
18
  - 支持 macOS、Linux 和原生 Windows(PowerShell / CMD),无需安装 WSL。
19
19
  - 安装 CLI 时能够访问 npm 仓库。
20
- - 内置 Skills 来源不可用时,能够访问 GitHub。
21
20
 
22
21
  ## 安装
23
22
 
@@ -34,7 +33,7 @@ npx @thinkingai/ae-cli@latest install
34
33
  npx @thinkingai/ae-cli@latest install --format json
35
34
  ```
36
35
 
37
- 安装器检查 Node.js 20+、安装并验证 CLI,再将同版本 Skills 全局安装到 `~/.agents/skills`,公共文件只写入一次,再自动向需要独立目录的客户端分发副本,无需选择 Agent;之后安装的 Codex、Cursor 也可共享这些 Skills。支持 `--dry-run`、`--format json` 和可选的 `--host <AE_HOST>`。验证成功后不显示无关的项目级客户端告警;文件缺失和 YAML 错误仍判为失败。未登录不算安装失败。详见[安装指南](./cli-installation-guide.md)。
36
+ 安装器检查 Node.js 20+、安装并验证 CLI,再通过内置的 Skills 工具向支持的客户端安装同版本全局 Skills。首次安装且尚无已确认业务状态时安装全量内置 Skills。支持 `--dry-run`、`--format json` 和可选的 `--host <AE_HOST>`。未登录不算安装失败。详见[安装指南](./cli-installation-guide.md)。
38
37
 
39
38
  Skills 会帮助 Claude Code、Codex、Cursor 等编码 Agent 理解、发现并调用 `ae-cli`。
40
39
 
@@ -55,6 +54,10 @@ ae-cli auth status
55
54
 
56
55
  请使用 AgenticEngine 管理员提供的 AE 地址。未配置 Host 时,`ae-cli` 会先引导已有客户向管理员获取地址;只有确认尚无 AgenticEngine 环境的用户,才会看到[申请试用](https://thinkingai.cn/request-demo)入口。
57
56
 
57
+ 按业务过滤命令和剪裁 Skills 仅适用于外部 Agent 使用的本机 CLI;TE Agent 内置沙箱始终保留完整命令与全部 Skills。登录成功后,CLI 按当前环境已开通的业务过滤 `--help` 和能力发现,并同步受管的全局 Skills;分析能力默认保留。后续开通业务时,执行 `ae-cli config refresh` 即可重新获取状态并补装对应 Skills。切换活动环境或账号会重新同步;单次 `--host` 查询不改变全局 Skills。
58
+
59
+ 仅明确关闭的业务会被移除;旧服务端、缺失状态或网络失败不会触发删除。指向已核验、未修改的受管共享 Skill 的客户端历史链接会自动迁移;其他用户修改和来源不明的副本保留并报告。同步后请新开 Agent 会话,已有会话的上下文不会被撤回。
60
+
58
61
  ## 环境版本同步
59
62
 
60
63
  每个 AE 环境都会返回其要求的精确 `aeCliVersion`。使用统一更新命令安装对应版本的 CLI 和 Skills:
@@ -68,9 +71,9 @@ ae-cli update --dry-run
68
71
 
69
72
  自动同步在登录后的普通命令中触发,集群版本检查最长缓存 1 小时;`ae-cli update --host <AE_HOST>` 可立即查询。降级后,后续更新由旧版 CLI 自身执行,也受旧版实现限制。需要用新安装逻辑匹配旧集群时,可运行 `npx @thinkingai/ae-cli@latest update --host <AE_HOST>`,目标仍是集群要求的版本。
70
73
 
71
- `ae-cli update` 安装当前 Host 要求的精确版本,不依赖 npm `latest`。更新时优先从已安装的 npm 包同步 Skills,本地来源失败后才回退到对应的 GitHub tag。
74
+ `ae-cli update` 安装当前 Host 要求的精确版本,不依赖 npm `latest`。Skills 从已验证的目标包同步;用户修改或来源不明的副本会保留并报告。
72
75
 
73
- 从 `6.0.37` 和 `6.1.9` 维护线开始,普通业务命令可以自动升级或降级到环境要求的版本,包括从 `6.0.x` 切换到 `6.1.x`。自动同步要求本地和目标均为 `主版本.次版本.补丁号` 格式的正式版本,开发版等不规则版本会跳过。同步成功后,旧进程会返回 `AE_CLI_VERSION_SYNCED`;重新执行原命令,即可使用新的 CLI 和 Skills。安装失败会给出提示,但不会用安装输出污染业务命令的 JSON 结果。
76
+ 从 `6.0.37` 和 `6.1.9` 维护线开始,普通业务命令可以自动升级或降级到环境要求的版本,包括从 `6.0.x` 切换到 `6.1.x`。自动同步要求本地和目标均为 `主版本.次版本.补丁号` 格式的正式版本,开发版等不规则版本会跳过。同步成功后,新版 CLI 会自动执行原命令一次,并返回该命令的结果和退出码;参数、管道输入、工作目录和确认行为保持不变。如果新版 CLI 无法启动,会返回 `AE_CLI_VERSION_SYNCED` 并提示手动重跑;已经执行的命令不会自动重试。安装失败会给出提示,但不会用安装输出污染业务命令的 JSON 结果。
74
77
 
75
78
  常用控制方式:
76
79
 
@@ -161,6 +164,8 @@ ae-cli capability list --domain analysis --jq '.data.capabilities[] | .id'
161
164
  | Agent 平台 | `automation` | 自动化配置、执行、历史和结果 |
162
165
  <!-- root-command-surface:end -->
163
166
 
167
+ 使用 `ae-cli analysis scenario list --project-id 1 --days 7` 查询已采集的分析问题,由 `ae-analysis` Skill 指导 Agent 去重、判断 badcase 并简要说明原因和证据。详见[分析问题复盘指南](skills/ae-analysis/references/scenario_list.md)。 回答可附带耗时;使用 `ae-cli analysis scenario get --help` 查看关联命令执行明细的查询方式。
168
+
164
169
  评测命令在普通终端和沙箱中均跟随当前 AE Host,可通过 `--host` 切换。评测请求沿用该 AE Host 配置的 HTTP 或 HTTPS 协议,与其他 AE 命令一致。旧 `--endpoint` 和 `AE_EVAL_BASE_URL` 只能与当前 AE Host 一致,其他值会在发送凭证前报错;请移除这些配置,统一使用 `--host` 切换。沙箱外需设置 `AE_EVAL_ACCESS_TOKEN` 平台 session token,沙箱内可自动获取会话。详见 [地址与鉴权规则](skills/ae-evaluation/SKILL.md#endpoint-and-authentication)。
165
170
 
166
171
  ## Capability Gateway
@@ -270,6 +275,9 @@ JSON 参数通常支持内联 JSON、`@file`、文件路径或通过 `-` 从 std
270
275
 
271
276
  ## 知识库
272
277
 
278
+ 公司知识库编译审批前,可用 `ae-cli kb candidate changes --name <name> --candidate <id>` 查看数据源、Wiki 和 Index 的变化。条目详情和文本差异用法见[审批预览](skills/ae-kb/references/publication.md)。
279
+ 审批变化较多时,可用 `kb candidate changes --group wiki --search payment --offset 0 --limit 50` 分页检索;首次成功编译自动发布,后续公司知识库更新进入审批。
280
+
273
281
  管理服务端知识库生命周期:
274
282
 
275
283
  ```bash
package/bin/ae-cli.js CHANGED
@@ -1,7 +1,12 @@
1
1
  #!/usr/bin/env node
2
+ import { readFileSync } from 'node:fs';
2
3
  if (Number(process.versions.node.split('.')[0]) < 20) {
3
4
  console.error('AE CLI requires Node.js 20 or later. Select a supported Node.js runtime and rerun.');
4
5
  process.exitCode = 1;
6
+ } else if (process.argv.length === 3 && process.argv[2] === '--runtime-capabilities') {
7
+ // Keep discovery independent of application imports and credential initialization.
8
+ const capabilities = JSON.parse(readFileSync(new URL('./runtime-capabilities.json', import.meta.url), 'utf8'));
9
+ process.stdout.write(JSON.stringify(capabilities) + '\n');
5
10
  } else {
6
11
  await import('../dist/index.js');
7
12
  }
@@ -0,0 +1,5 @@
1
+ {
2
+ "protocol": "ae-cli-runtime-capabilities",
3
+ "version": 1,
4
+ "features": ["kb_read_context_v1"]
5
+ }
@@ -20,13 +20,13 @@ Node.js 20 or later, npm, and npx must be available. The installer does not chan
20
20
 
21
21
  The running package determines the exact CLI version to install. The global executable is verified with `ae-cli --version`; PATH problems include the verified absolute path. Local npm links are protected by a small guard. Other installation conflicts use normal npm errors; the installer does not migrate existing installations.
22
22
 
23
- Skills are installed globally in `~/.agents/skills`. The shared files are installed once, then the Skills tool automatically distributes copies to detected clients that require their own directory. Shared-directory targets are skipped during distribution. Existing per-Skill links are replaced with copies when needed. Codex and Cursor support this shared directory, so installing Cursor later does not require a separate copy of the Skills. A client that only reads its own directory may need the same install command run again after that client is installed. User-global installation does not promise availability in remote/cloud clients or for every future client.
23
+ The pinned Skills tool resolves supported global client directories, including the shared `~/.agents/skills` directory. AE does not maintain a separate client path table. A client that only reads its own directory may need the same install command run again after that client is installed. Project-only clients, unknown clients, remote/cloud clients, and manually imported Skills are outside automatic global synchronization. Overlapping source directories and unverified links are protected rather than replaced.
24
24
 
25
25
  The external tool is pinned to `skills@1.5.12` to preserve Node 20 support and skip copying a Skill onto its own source directory. The installer does not maintain its own Agent catalog, ask users to select clients, or select clients based on the invoking AI. Unrelated user Skills are retained.
26
26
 
27
27
  ## Verification and output
28
28
 
29
- The installed CLI package's `skills/` directory defines the expected Skills and contents at runtime, including for historical packages without an installer or generated manifest. A failed shared-directory installation can retry the exact release tag `ThinkingAIAgenticEngine/ae-cli#v<CLI_VERSION>`; it never falls back to the default branch. Missing or invalid bundled Skills are reported rather than guessing the expected set from another version. Client distribution failures do not trigger a source download retry. If the local source and fallback both fail, the top-level error retains the first cause, and `skills.attempts` records both attempts with their stage, source, cause, and failures.
29
+ The verified target CLI package's complete `skills/` directory defines the expected contents, including for historical packages without an installer or generated manifest. The synchronizer uses this source for installation and restoration. Missing or invalid package sources, modified copies, ownership conflicts, and tool failures are reported; they do not trigger an unrestricted remote installation retry. `skills.attempts` retains the attempted source and failure details.
30
30
 
31
31
  Verification parses YAML/frontmatter and compares expected files in the shared global directory with the target package. Merely finding a directory, an `ae-*` name, or an exit code of zero is insufficient. Failures reported by the pinned tool for supported clients are also treated as failures, even when shared files exist.
32
32
 
@@ -37,6 +37,12 @@ Verification parses YAML/frontmatter and compares expected files in the shared g
37
37
 
38
38
  `--format json` emits one report on stdout. Progress goes to stderr; raw subprocess logs are not forwarded. Reports include `ok`, `dry_run`, `cli.package/version/path/verified`, `skills.directory/expected_count/installed_count/missing/source/version/failures/attempts`, `auth.host/authenticated`, and `next_steps`. Counts refer to unique Skills in the global directory. Use `--format table` for a human summary. Dry runs make no subprocess calls or installation/configuration writes.
39
39
 
40
+ `install --dry-run --format json` returns that report directly, with a root-level `commands` array. `update --dry-run --format json` keeps the command envelope (`ok` and `data`); its `data` includes `action`, `dryRun`, `target`, optional `host`, `commands`, and `skillsSources`.
41
+
42
+ Each `commands` array describes the current installation plan; `skillsSources` lists the current source choices. Array lengths and contents can change with the installer. Automation should run the complete `install` or `update` command, check its exit code and `ok`, and inspect the installation report. Do not depend on fixed array indexes or execute individual entries as a replacement for the installer.
43
+
44
+ The managed synchronizer uses the verified package source. Replaying historical GitHub fallback or `skills add --copy` commands would bypass business selection and copy protection.
45
+
40
46
  ## Host and login
41
47
 
42
48
  `--host` is optional. It delegates status checks to the existing auth command; it does not independently save credentials or change the active host. Being logged out does not make a verified installation fail.
@@ -54,6 +60,21 @@ ae-cli auth status --host <AE_HOST>
54
60
 
55
61
  Never print, copy, or manually save any token.
56
62
 
63
+ ## Business selection after login
64
+
65
+ First installation without confirmed business state installs all bundled Skills. After successful login, `config refresh`, an account switch, or an active-environment switch, config determines the optional business selection. Analysis and foundation Skills remain available. Only pristine managed copies of explicitly disabled businesses are removed; enabled businesses are restored from the package. Unknown states preserve existing copies. Installation, update, and automatic version synchronization reuse this selection, so an upgrade does not restore disabled Skills.
66
+
67
+ ```bash
68
+ ae-cli config refresh
69
+ ae-cli config show
70
+ ```
71
+
72
+ The global selection follows one active local environment. An explicit `--host` refresh reads that environment's config without changing global Skills, even when its URL matches the active host. External-token and sandbox invocations do not manage local global Skills. Failed config or Skill synchronization does not revoke successful authentication. Partial synchronization reports protected or failed paths; resolve the reported conflict and retry. Existing copies are adopted once only when they exactly match a known package source. No regular backup is needed because the CLI package retains the complete resources.
73
+
74
+ Older Skills installations may have created client links to the shared global directory. The synchronizer migrates an existing same-name link only when its destination is a managed shared Skill whose contents still match both its ownership record and the installed package. A confirmed disabled business removes the verified links before its shared copy; an enabled business replaces them with managed copies. Unknown business states leave links unchanged. Custom targets, modified shared contents, and links to package sources remain protected.
75
+
76
+ Start a new Agent session after synchronization. Descriptions already loaded into a conversation cannot be withdrawn.
77
+
57
78
  ## Host-compatible upgrades and downgrades
58
79
 
59
80
  ```bash
@@ -73,7 +94,7 @@ To use the newer installer while still respecting the current host version, incl
73
94
  npx @thinkingai/ae-cli@latest update --host <AE_HOST>
74
95
  ```
75
96
 
76
- The newer command orchestrates the work; the installed target remains the host-required version. Required package versions and fallback tags must be published and accessible. Global CLI installation follows one target at a time; switching between differently versioned hosts can switch that installation again.
97
+ The newer command orchestrates the work; the installed target remains the host-required version. Required package versions must be published and accessible. Global CLI installation follows one target at a time; switching between differently versioned hosts can switch that installation again.
77
98
 
78
99
  ## Advanced manual troubleshooting
79
100
 
@@ -1,4 +1,8 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ invalidateBusinessSkillSynchronization,
4
+ refreshEnvironmentAfterLogin
5
+ } from "./chunk-ZGIYG473.js";
2
6
  import {
3
7
  MultiselectCancelled,
4
8
  promptSingleSelect
@@ -9,13 +13,15 @@ import {
9
13
  } from "./chunk-6ZIQV5GW.js";
10
14
  import {
11
15
  resolveHost
12
- } from "./chunk-P6VFCH3P.js";
16
+ } from "./chunk-IN7KKL6K.js";
13
17
  import {
14
- getLocalCliPackageInfo,
15
18
  printError,
16
- printOutput,
19
+ printOutput
20
+ } from "./chunk-752BSLZC.js";
21
+ import {
22
+ getLocalCliPackageInfo,
17
23
  runHostCompatCheck
18
- } from "./chunk-ELCR235M.js";
24
+ } from "./chunk-TULINOLS.js";
19
25
  import {
20
26
  CliTokenValidationUnavailableError,
21
27
  CredentialStoreUnreadableError,
@@ -31,19 +37,19 @@ import {
31
37
  saveCredential,
32
38
  updateCredentialMetadata,
33
39
  validateCliTokenOnServer
34
- } from "./chunk-P7KL7IOH.js";
40
+ } from "./chunk-H3K5UGYC.js";
35
41
  import {
36
42
  getFallbackCliToken,
37
43
  loadConfig,
38
44
  saveConfig
39
- } from "./chunk-LMCYSVVA.js";
45
+ } from "./chunk-JNVVJ273.js";
40
46
  import {
41
47
  ExternalCliTokenError,
42
48
  PermissionError,
43
49
  logger,
44
50
  normalizeUrl,
45
51
  readExternalCliToken
46
- } from "./chunk-ZW4VMY5H.js";
52
+ } from "./chunk-Z3Q2AEIN.js";
47
53
 
48
54
  // src/core/device-auth.ts
49
55
  import { execFileSync } from "child_process";
@@ -351,6 +357,7 @@ function promptHiddenCliToken() {
351
357
  });
352
358
  }
353
359
  function activateHostAfterLogin(host, explicitHostOverride) {
360
+ invalidateBusinessSkillSynchronization();
354
361
  if (!explicitHostOverride) return;
355
362
  const normalized = normalizeUrl(host);
356
363
  const config = loadConfig();
@@ -428,12 +435,15 @@ async function switchActiveAccount(program, opts) {
428
435
  }
429
436
  }
430
437
  try {
438
+ invalidateBusinessSkillSynchronization();
431
439
  const selected = activateCredential(host, account);
432
440
  clearCliTokenCache(host);
441
+ const environment = await refreshEnvironmentAfterLogin(host);
433
442
  await printOutput({
434
443
  host,
435
444
  active: true,
436
- account: accountOutput(selected.account)
445
+ account: accountOutput(selected.account),
446
+ ...environment ? { environment } : {}
437
447
  }, program.opts().format || "json");
438
448
  } catch (error) {
439
449
  if (error instanceof CredentialStoreUnreadableError) throw error;
@@ -457,6 +467,7 @@ async function persistDeviceTokens(host, tokens, options = {}) {
457
467
  }
458
468
  let saved;
459
469
  try {
470
+ invalidateBusinessSkillSynchronization();
460
471
  saved = saveCredential(host, {
461
472
  cliToken,
462
473
  ...validation.account ? { account: validation.account } : {},
@@ -475,6 +486,7 @@ async function persistManualCliToken(host, cliToken, options = {}) {
475
486
  const validation = await validateCliTokenOnServer(host, cliToken);
476
487
  let saved;
477
488
  try {
489
+ invalidateBusinessSkillSynchronization();
478
490
  saved = saveCredential(host, {
479
491
  cliToken,
480
492
  ...validation.account ? { account: validation.account } : {},
@@ -552,8 +564,9 @@ function registerAuth(program) {
552
564
  const tokens2 = await pollDeviceFlow(teClaudeBase, opts.deviceCode, {}, emit);
553
565
  const saved2 = await persistDeviceTokens(host, tokens2, { add: opts.add });
554
566
  activateHostAfterLogin(host, explicitHost);
567
+ const environment2 = await refreshEnvironmentAfterLogin(host);
555
568
  emit("Login successful! CLI token saved securely.");
556
- await printOutput(loginSummary(host, saved2), format);
569
+ await printOutput({ ...loginSummary(host, saved2), ...environment2 ? { environment: environment2 } : {} }, format);
557
570
  return;
558
571
  }
559
572
  if (opts.wait === false) {
@@ -572,8 +585,9 @@ function registerAuth(program) {
572
585
  const tokens = await runDeviceFlow(teClaudeBase, { noBrowser }, emit);
573
586
  const saved = await persistDeviceTokens(host, tokens, { add: opts.add });
574
587
  activateHostAfterLogin(host, explicitHost);
588
+ const environment = await refreshEnvironmentAfterLogin(host);
575
589
  emit("Login successful! CLI token saved securely.");
576
- await printOutput(loginSummary(host, saved), format);
590
+ await printOutput({ ...loginSummary(host, saved), ...environment ? { environment } : {} }, format);
577
591
  } catch (error) {
578
592
  if (error instanceof CredentialStoreUnreadableError) throw error;
579
593
  if (error instanceof DeviceFlowUnsupportedError) {
@@ -616,9 +630,10 @@ function registerAuth(program) {
616
630
  try {
617
631
  const saved = await persistManualCliToken(host, cliToken, { add: opts.add });
618
632
  activateHostAfterLogin(host, explicitHost);
633
+ const environment = await refreshEnvironmentAfterLogin(host);
619
634
  process.stderr.write(`[ae-cli] CLI token verified and saved securely for ${host}
620
635
  `);
621
- await printOutput(manualTokenSummary(host, saved), program.opts().format || "json");
636
+ await printOutput({ ...manualTokenSummary(host, saved), ...environment ? { environment } : {} }, program.opts().format || "json");
622
637
  } catch (error) {
623
638
  if (error instanceof CredentialStoreUnreadableError) throw error;
624
639
  if (error instanceof PermissionError) {
@@ -730,18 +745,21 @@ function registerAuth(program) {
730
745
  process.exit(1);
731
746
  }
732
747
  clearCliTokenCache(host);
748
+ invalidateBusinessSkillSynchronization();
733
749
  if (opts.all) {
734
750
  clearAllCredentials(host);
735
751
  await printOutput({ cleared: true, all: true, host }, program.opts().format || "json");
736
752
  return;
737
753
  }
738
754
  const result = removeActiveCredential(host);
755
+ const environment = result.active ? await refreshEnvironmentAfterLogin(host) : void 0;
739
756
  await printOutput({
740
757
  cleared: !!result.removed,
741
758
  all: false,
742
759
  host,
743
760
  remaining_accounts: listCredentials(host).length,
744
- ...result.active?.account ? { active_account: accountOutput(result.active.account) } : {}
761
+ ...result.active?.account ? { active_account: accountOutput(result.active.account) } : {},
762
+ ...environment ? { environment } : {}
745
763
  }, program.opts().format || "json");
746
764
  });
747
765
  }
@@ -1,22 +1,22 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  resolveWorkspaceTarget
4
- } from "./chunk-UUD5RB36.js";
4
+ } from "./chunk-7JAVT5TK.js";
5
5
  import {
6
6
  currentAgentSpaceId
7
7
  } from "./chunk-RK6GLDGI.js";
8
- import "./chunk-JJJIP2XQ.js";
8
+ import "./chunk-N6XBLRB7.js";
9
9
  import {
10
10
  TeAgentApiError,
11
11
  deleteFromMainApp,
12
12
  getFromMainApp,
13
13
  patchToMainApp,
14
14
  postToMainApp
15
- } from "./chunk-2UWS5CUP.js";
15
+ } from "./chunk-RJHGDWSC.js";
16
16
  import "./chunk-Y74WTIKJ.js";
17
- import "./chunk-P7KL7IOH.js";
18
- import "./chunk-LMCYSVVA.js";
19
- import "./chunk-ZW4VMY5H.js";
17
+ import "./chunk-H3K5UGYC.js";
18
+ import "./chunk-JNVVJ273.js";
19
+ import "./chunk-Z3Q2AEIN.js";
20
20
 
21
21
  // src/commands/automation/index.ts
22
22
  import { randomUUID } from "crypto";
@@ -9,9 +9,6 @@ import {
9
9
  listRegisteredCapabilityDomains,
10
10
  resolveGatewayDomain
11
11
  } from "./chunk-KPQY44JQ.js";
12
- import {
13
- resolveHost
14
- } from "./chunk-P6VFCH3P.js";
15
12
  import {
16
13
  CapabilityGatewayError,
17
14
  dryRunCapabilityWithEnvelope,
@@ -20,25 +17,34 @@ import {
20
17
  inspectCapabilityWithEnvelope,
21
18
  listCapabilitiesWithEnvelope,
22
19
  validateCapabilityWithEnvelope
23
- } from "./chunk-MXV3PYC3.js";
20
+ } from "./chunk-JCWM2TYP.js";
21
+ import {
22
+ resolveHost
23
+ } from "./chunk-IN7KKL6K.js";
24
24
  import {
25
25
  printError,
26
26
  printOutput,
27
27
  withOutputMetadata
28
- } from "./chunk-ELCR235M.js";
28
+ } from "./chunk-752BSLZC.js";
29
29
  import "./chunk-Y74WTIKJ.js";
30
+ import {
31
+ assertBusinessEnabled,
32
+ businessForCapability,
33
+ readBusinessConfigForExecution,
34
+ readCurrentBusinessConfig
35
+ } from "./chunk-TULINOLS.js";
30
36
  import {
31
37
  CredentialStoreUnreadableError,
32
38
  SecureStoreAuthError
33
- } from "./chunk-P7KL7IOH.js";
39
+ } from "./chunk-H3K5UGYC.js";
34
40
  import {
35
- safeJsonParse
36
- } from "./chunk-LMCYSVVA.js";
41
+ parseJsonRequest
42
+ } from "./chunk-JNVVJ273.js";
37
43
  import {
38
44
  CliValidationError,
39
45
  ExternalCliTokenError,
40
46
  PermissionError
41
- } from "./chunk-ZW4VMY5H.js";
47
+ } from "./chunk-Z3Q2AEIN.js";
42
48
 
43
49
  // src/commands/capability/index.ts
44
50
  import * as readline from "readline";
@@ -82,7 +88,7 @@ function resolveCapabilityGatewayDomain(capabilityId, domainOverride) {
82
88
  }
83
89
  return resolveGatewayDomain(cliDomain, findGatewayDomain(cliDomain) ?? cliDomain);
84
90
  }
85
- function resolveCapabilityListDomain(cliDomain) {
91
+ function resolveCapabilityListDomain(cliDomain, businesses = {}) {
86
92
  if (!cliDomain) {
87
93
  throw new CapabilityCommandValidationError(
88
94
  "Cannot determine the capability domain.",
@@ -91,7 +97,10 @@ function resolveCapabilityListDomain(cliDomain) {
91
97
  }
92
98
  const gatewayDomain = findGatewayDomain(cliDomain);
93
99
  if (gatewayDomain === void 0) {
94
- const registeredDomains = listRegisteredCapabilityDomains();
100
+ const registeredDomains = listRegisteredCapabilityDomains().filter((domain) => {
101
+ const business = businessForCapability(domain);
102
+ return !business || businesses[business] !== false;
103
+ });
95
104
  const registeredHint = registeredDomains.length > 0 ? `Registered domains: ${registeredDomains.join(", ")}.` : "No capability domains are registered in this ae-cli process.";
96
105
  throw new CapabilityCommandValidationError(
97
106
  `Capability domain '${cliDomain}' is not registered.`,
@@ -135,10 +144,12 @@ function normalizeCapabilityList(value) {
135
144
  return item !== null && typeof item === "object" && typeof item.id === "string";
136
145
  });
137
146
  }
138
- function filterCapabilities(capabilities, domain, query) {
147
+ function filterCapabilities(capabilities, domain, query, businesses = {}) {
139
148
  const prefixes = listCapabilityDiscoveryPrefixes(domain);
140
149
  const terms = query?.trim().toLowerCase().split(/\s+/).filter(Boolean) ?? [];
141
150
  return capabilities.filter((capability) => {
151
+ const business = businessForCapability(capability.id);
152
+ if (business && businesses[business] === false) return false;
142
153
  if (RETIRED_CAPABILITY_REPLACEMENTS[capability.id.toLowerCase()]) {
143
154
  return false;
144
155
  }
@@ -161,12 +172,12 @@ function parseCapabilityInput(raw) {
161
172
  let parsed;
162
173
  try {
163
174
  if (trimmed === "-") {
164
- parsed = safeJsonParse(readFileSync(0, "utf8"));
175
+ parsed = parseJsonRequest(readFileSync(0, "utf8"));
165
176
  } else if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
166
- parsed = safeJsonParse(trimmed);
177
+ parsed = parseJsonRequest(trimmed);
167
178
  } else {
168
179
  const path = trimmed.startsWith("@") ? trimmed.slice(1) : trimmed;
169
- parsed = safeJsonParse(readFileSync(path, "utf8"));
180
+ parsed = parseJsonRequest(readFileSync(path, "utf8"));
170
181
  }
171
182
  } catch (error) {
172
183
  const message = error instanceof Error ? error.message : String(error);
@@ -200,11 +211,16 @@ function registerCapability(program) {
200
211
  });
201
212
  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) => {
202
213
  await executeAndPrint(program, async (host) => {
203
- const gatewayDomain = resolveCapabilityListDomain(opts.domain);
214
+ const business = businessForCapability(opts.domain);
215
+ const businesses = business ? await readBusinessConfigForExecution(host) : readCurrentBusinessConfig(host);
216
+ const gatewayDomain = resolveCapabilityListDomain(opts.domain, businesses);
204
217
  const projectId = parseOptionalProjectId(opts.projectId);
218
+ if (business && businesses[business] === false) {
219
+ return { domain: opts.domain, count: 0, capabilities: [], warning: `The '${business}' business is not enabled for the current environment.` };
220
+ }
205
221
  const envelope = await listCapabilitiesWithEnvelope(host, gatewayDomain, projectId);
206
222
  const catalog = normalizeCapabilityList(envelope.data);
207
- const capabilities = filterCapabilities(catalog, opts.domain);
223
+ const capabilities = filterCapabilities(catalog, opts.domain, void 0, businesses);
208
224
  const warning = emptyCapabilityCatalogWarning(catalog);
209
225
  return withOutputMetadata({
210
226
  domain: opts.domain,
@@ -219,11 +235,16 @@ function registerCapability(program) {
219
235
  );
220
236
  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) => {
221
237
  await executeAndPrint(program, async (host) => {
222
- const gatewayDomain = resolveCapabilityListDomain(opts.domain);
238
+ const business = businessForCapability(opts.domain);
239
+ const businesses = business ? await readBusinessConfigForExecution(host) : readCurrentBusinessConfig(host);
240
+ const gatewayDomain = resolveCapabilityListDomain(opts.domain, businesses);
223
241
  const projectId = parseOptionalProjectId(opts.projectId);
242
+ if (business && businesses[business] === false) {
243
+ return { domain: opts.domain, query, count: 0, capabilities: [], warning: `The '${business}' business is not enabled for the current environment.` };
244
+ }
224
245
  const envelope = await listCapabilitiesWithEnvelope(host, gatewayDomain, projectId);
225
246
  const catalog = normalizeCapabilityList(envelope.data);
226
- const capabilities = filterCapabilities(catalog, opts.domain, query);
247
+ const capabilities = filterCapabilities(catalog, opts.domain, query, businesses);
227
248
  const warning = emptyCapabilityCatalogWarning(catalog);
228
249
  return withOutputMetadata({
229
250
  domain: opts.domain,
@@ -240,6 +261,7 @@ function registerCapability(program) {
240
261
  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) => {
241
262
  await executeAndPrint(program, async (host) => {
242
263
  assertCapabilityIsNotRetired(capabilityId);
264
+ await assertCapabilityBusinessEnabled(capabilityId, host);
243
265
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
244
266
  return gatewayOutput(await inspectCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseOptionalProjectId(opts.projectId)), host);
245
267
  });
@@ -252,6 +274,7 @@ function registerCapability(program) {
252
274
  ).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) => {
253
275
  await executeAndPrint(program, async (host) => {
254
276
  assertCapabilityIsNotRetired(capabilityId);
277
+ await assertCapabilityBusinessEnabled(capabilityId, host);
255
278
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
256
279
  return gatewayOutput(await validateCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseCapabilityInput(opts.input)), host);
257
280
  });
@@ -275,6 +298,7 @@ Examples:
275
298
  ).argument("<capability-id>", "Capability ID, such as analysis.query.export").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--input <json-or-path>", "Input JSON object, file path, @<path>, or - for stdin").action(async (capabilityId, opts) => {
276
299
  await executeAndPrint(program, async (host) => {
277
300
  assertCapabilityIsNotRetired(capabilityId);
301
+ await assertCapabilityBusinessEnabled(capabilityId, host);
278
302
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
279
303
  return gatewayOutput(await dryRunCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseCapabilityInput(opts.input)), host);
280
304
  });
@@ -288,6 +312,7 @@ Examples:
288
312
  capability.command("run").description("Execute one capability by ID").argument("<capability-id>", "Capability ID, such as analysis.report.list").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--input <json-or-path>", "Input JSON object, file path, @<path>, or - for stdin").action(async (capabilityId, opts) => {
289
313
  await executeAndPrint(program, async (host, globalOpts) => {
290
314
  assertCapabilityIsNotRetired(capabilityId);
315
+ await assertCapabilityBusinessEnabled(capabilityId, host);
291
316
  const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
292
317
  const input = parseCapabilityInput(opts.input);
293
318
  if (globalOpts.validate && globalOpts.dryRun) {
@@ -323,6 +348,9 @@ Examples:
323
348
  ae-cli capability run analysis.dashboard.list --input input.json`
324
349
  );
325
350
  }
351
+ async function assertCapabilityBusinessEnabled(capabilityId, host) {
352
+ await assertBusinessEnabled(businessForCapability(capabilityId), host);
353
+ }
326
354
  function gatewayOutput(envelope, host) {
327
355
  return withOutputMetadata(withPageUrl(envelope.data, host), envelope.meta);
328
356
  }
@@ -375,7 +403,7 @@ function printCapabilityError(error, host) {
375
403
  return;
376
404
  }
377
405
  if (error instanceof PermissionError) {
378
- printError("permission", error.message, void 0, error.code);
406
+ printError("permission", error.message, error.hint, error.code);
379
407
  return;
380
408
  }
381
409
  if (error instanceof CapabilityGatewayError) {
@@ -1,20 +1,20 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  require_lib
4
- } from "./chunk-2IYIYSUO.js";
4
+ } from "./chunk-QVRIDN42.js";
5
5
  import {
6
6
  require_archiver,
7
7
  require_string_decoder
8
- } from "./chunk-QSAR3GHY.js";
8
+ } from "./chunk-OAWPT7VP.js";
9
9
  import {
10
10
  require_inherits,
11
11
  require_node
12
- } from "./chunk-T44M3PLZ.js";
12
+ } from "./chunk-JEUXDY3B.js";
13
13
  import {
14
14
  __commonJS,
15
15
  __require,
16
16
  __toESM
17
- } from "./chunk-ZW4VMY5H.js";
17
+ } from "./chunk-Z3Q2AEIN.js";
18
18
 
19
19
  // node_modules/exceljs/lib/utils/under-dash.js
20
20
  var require_under_dash = __commonJS({