@thinkingai/ae-cli 6.1.28 → 6.1.29
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.
- package/README.md +24 -4
- package/README.zh.md +24 -4
- package/bin/ae-cli.js +5 -0
- package/bin/runtime-capabilities.json +5 -0
- package/cli-installation-guide.md +24 -3
- package/dist/{auth-NKD5Z5BQ.js → auth-OBQ5KVQM.js} +30 -12
- package/dist/{automation-K32V2NKP.js → automation-NAR5DDGL.js} +6 -6
- package/dist/{capability-4CGSL7PK.js → capability-LFSVNI5B.js} +54 -26
- package/dist/chunk-2UW3Y463.js +2289 -0
- package/dist/{chunk-QW3R6O7L.js → chunk-3SDHJOCR.js} +57 -15
- package/dist/chunk-6HAUVWOQ.js +132 -0
- package/dist/{chunk-KHS64JZQ.js → chunk-72NJKS7O.js} +4 -4
- package/dist/{chunk-UUD5RB36.js → chunk-7JAVT5TK.js} +3 -3
- package/dist/{chunk-GTPWDLTE.js → chunk-CVCTFLSO.js} +35 -14
- package/dist/{chunk-P7KL7IOH.js → chunk-H3K5UGYC.js} +2 -2
- package/dist/{chunk-P6VFCH3P.js → chunk-IN7KKL6K.js} +2 -2
- package/dist/{chunk-T44M3PLZ.js → chunk-JEUXDY3B.js} +1 -1
- package/dist/{chunk-LMCYSVVA.js → chunk-JNVVJ273.js} +51 -37
- package/dist/{chunk-JJJIP2XQ.js → chunk-N6XBLRB7.js} +2 -2
- package/dist/{chunk-QSAR3GHY.js → chunk-OAWPT7VP.js} +2 -2
- package/dist/{chunk-UF244C5C.js → chunk-PWXDWMCW.js} +7 -7
- package/dist/{chunk-2IYIYSUO.js → chunk-QVRIDN42.js} +2 -2
- package/dist/chunk-QZLRHGVH.js +222 -0
- package/dist/{chunk-GI5BMEZO.js → chunk-QZUVLFNR.js} +1 -1
- package/dist/{chunk-2UWS5CUP.js → chunk-RJHGDWSC.js} +3 -3
- package/dist/{chunk-UJ7UPRXK.js → chunk-VCZE3IWO.js} +10 -8
- package/dist/{chunk-X7DRLE62.js → chunk-YVG6QD3V.js} +1 -1
- package/dist/{chunk-ZW4VMY5H.js → chunk-Z3Q2AEIN.js} +152 -98
- package/dist/{community-report-client-S2K3A3Q6.js → community-report-client-TJVCLZ3K.js} +1 -1
- package/dist/compat-check-CII6B74E.js +32 -0
- package/dist/{config-ASSAAIOI.js → config-YZ6O2UQ2.js} +38 -6
- package/dist/{context-6RWLVOM5.js → context-F6FCGTF3.js} +4 -4
- package/dist/{data-integration-EXSUPUDZ.js → data-integration-6UAZO4GG.js} +207 -24
- package/dist/{evaluation-5YT4QLCL.js → evaluation-4LO2O4AF.js} +4 -4
- package/dist/index.js +297 -70
- package/dist/{local-data-upload-client-7HCPGIS3.js → local-data-upload-client-KCMG6J62.js} +1 -1
- package/dist/{memory-VCYLVPMI.js → memory-HHPX3NF2.js} +6 -6
- package/dist/{metadata-YGI5M6OF.js → metadata-TIFY24LW.js} +16 -8
- package/dist/{model-DPJHSD73.js → model-7UHGWYVR.js} +4 -4
- package/dist/{personal-semantic-preference-76TBKAPY.js → personal-semantic-preference-WKJEGPTM.js} +7 -6
- package/dist/{project-semantic-XOEBO2Q5.js → project-semantic-EIQVZNHW.js} +11 -10
- package/dist/{sync-7PP6KQ75.js → sync-RV3OPCTI.js} +8 -7
- package/dist/{te-agent-PJVAPKBD.js → te-agent-5ENVZJUH.js} +11 -7
- package/dist/{te-analysis-OX62G5VD.js → te-analysis-USIK6ZZG.js} +185 -33
- package/dist/{te-community-QN3WMPNT.js → te-community-WE2UU4XV.js} +720 -228
- package/dist/{te-dataops-UKD2XN3E.js → te-dataops-XNMO7MBF.js} +6 -5
- package/dist/{te-engage-X3DIXPRA.js → te-engage-6C3HCFQR.js} +13 -12
- package/dist/{te-experiment-MEIIK3DP.js → te-experiment-LVTRI3QK.js} +55 -21
- package/dist/{te-kb-73EWDFDF.js → te-kb-TUPGMVBY.js} +409 -85
- package/dist/{te-system-IE7NCKC3.js → te-system-YM657FKO.js} +6 -6
- package/dist/{te-team-MGQ5CNRW.js → te-team-G4VEJJNL.js} +7 -6
- package/dist/{things-4JIBCA55.js → things-22KQWC23.js} +7 -7
- package/dist/{update-AX66IFMJ.js → update-XX4ILU7X.js} +11 -7
- package/dist/{workspace-Q5NMEKEN.js → workspace-LYDAP647.js} +6 -6
- package/package.json +17 -7
- package/skills/ae-agent/references/resource-package.md +4 -0
- package/skills/ae-analysis/SKILL.md +14 -10
- package/skills/ae-analysis/references/agent_review_preflight.md +52 -11
- package/skills/ae-analysis/references/agent_review_priorities_comparisons.md +5 -3
- package/skills/ae-analysis/references/agent_review_submit_to_page.md +57 -25
- package/skills/ae-analysis/references/command_index.md +7 -3
- package/skills/ae-analysis/references/governance_recommendation_export.md +31 -17
- package/skills/ae-analysis/references/governance_recommendation_run_update.md +13 -0
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +9 -1
- package/skills/ae-analysis/references/scenario_append.md +6 -0
- package/skills/ae-analysis/references/scenario_begin.md +11 -0
- package/skills/ae-analysis/references/scenario_collect.md +10 -2
- package/skills/ae-analysis/references/scenario_evaluation.md +6 -18
- package/skills/ae-analysis/references/scenario_get.md +15 -0
- package/skills/ae-analysis/references/scenario_list.md +64 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +14 -1
- package/skills/ae-community/SKILL.md +77 -27
- package/skills/ae-community/references/community-analyzing-theme-comment.md +10 -8
- package/skills/ae-community/references/community-data-quality.md +68 -0
- package/skills/ae-community/references/community-query-evidence.md +85 -0
- package/skills/ae-community/references/community-scenario-capabilities.md +137 -0
- package/skills/ae-community/references/community-weekly-report.md +6 -3
- package/skills/ae-community/references/get_channel_info.md +7 -4
- package/skills/ae-community/references/get_comment_tag_analysis.md +3 -3
- package/skills/ae-community/references/get_comments_summary.md +4 -4
- package/skills/ae-community/references/get_corpus_tags.md +3 -3
- package/skills/ae-community/references/get_daily_summary.md +3 -3
- package/skills/ae-community/references/get_hot_topics.md +3 -3
- package/skills/ae-community/references/get_livestream_analysis.md +3 -3
- package/skills/ae-community/references/get_livestream_detail.md +4 -4
- package/skills/ae-community/references/get_livestream_list.md +3 -3
- package/skills/ae-community/references/get_livestream_overview.md +3 -3
- package/skills/ae-community/references/get_livestream_room_metrics.md +3 -3
- package/skills/ae-community/references/get_livestream_rooms.md +3 -3
- package/skills/ae-community/references/get_overview_metrics.md +3 -3
- package/skills/ae-community/references/get_post_detail.md +4 -4
- package/skills/ae-community/references/get_risk_content.md +5 -5
- package/skills/ae-community/references/get_sentiment_overview.md +4 -4
- package/skills/ae-community/references/get_tag_trends.md +3 -3
- package/skills/ae-community/references/get_topic_detail.md +3 -3
- package/skills/ae-community/references/list_sources.md +28 -0
- package/skills/ae-community/references/list_spaces.md +39 -0
- package/skills/ae-community/references/search_posts.md +21 -7
- package/skills/ae-data-integration/SKILL.md +6 -4
- package/skills/ae-data-integration/references/error-handling.md +1 -0
- package/skills/ae-data-integration/references/handoff.md +1 -1
- package/skills/ae-data-integration/references/sink-upload.md +11 -0
- package/skills/ae-data-integration/references/source-inspect.md +2 -1
- package/skills/ae-data-integration/references/transform.md +1 -1
- package/skills/ae-data-integration/references/ue-mapping.md +1 -1
- package/skills/ae-experiment/SKILL.md +7 -1
- package/skills/ae-experiment/references/manage_experiment.md +18 -1
- package/skills/ae-experiment/references/query_experiment_detail.md +7 -0
- package/skills/ae-experiment/references/save_experiment.md +76 -2
- package/skills/ae-experiment/references/save_submit_experiment.md +7 -0
- package/skills/ae-kb/SKILL.md +33 -6
- package/skills/ae-kb/references/publication.md +81 -0
- package/skills/ae-kb/references/query-workflow.md +14 -1
- package/skills/ae-metadata/SKILL.md +2 -2
- package/skills/ae-metadata/references/metadata_data_table_get.md +35 -0
- 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
|
|
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`.
|
|
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
|
|
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
|
|
|
@@ -158,8 +161,22 @@ The table covers every current root command individually. Use `ae-cli --help` fo
|
|
|
158
161
|
| Agent platform | `automation` | Automation configuration, execution, history, and results |
|
|
159
162
|
<!-- root-command-surface:end -->
|
|
160
163
|
|
|
164
|
+
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.
|
|
165
|
+
|
|
161
166
|
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).
|
|
162
167
|
|
|
168
|
+
### Scheduled Feature experiments
|
|
169
|
+
|
|
170
|
+
For a configured Feature experiment, save its start time and optional fixed deadline, check readiness, then submit it:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
ae-cli experiment experiment save --project-id 1 --req '{"expId":"exp_123"}' --start-time '2026-11-01T16:00:00+08:00' --fixed-end-time '2026-11-08T16:00:00+08:00'
|
|
174
|
+
ae-cli experiment experiment ready-check --project-id 1 --exp-id exp_123
|
|
175
|
+
ae-cli experiment experiment manage --project-id 1 --exp-id exp_123 --target-status pending
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Saving alone does not start an experiment. The server checks submitted experiments every half hour. Use `experiment experiment get` to verify status; see [Feature timing](skills/ae-experiment/references/save_experiment.md#feature-timing) for traffic checks, timing updates, and manual starts.
|
|
179
|
+
|
|
163
180
|
## Capability Gateway
|
|
164
181
|
|
|
165
182
|
Capability Gateway is the preferred entry point for operations that do not need a dedicated curated command:
|
|
@@ -272,6 +289,9 @@ JSON flags generally accept inline JSON, `@file`, a file path, or `-` for stdin.
|
|
|
272
289
|
|
|
273
290
|
## Knowledge Bases
|
|
274
291
|
|
|
292
|
+
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.
|
|
293
|
+
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.
|
|
294
|
+
|
|
275
295
|
Manage the server-side knowledge-base lifecycle:
|
|
276
296
|
|
|
277
297
|
```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
|
|
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
|
|
74
|
+
`ae-cli update` 安装当前 Host 要求的精确版本,不依赖 npm `latest`。Skills 从已验证的目标包同步;用户修改或来源不明的副本会保留并报告。
|
|
72
75
|
|
|
73
|
-
从 `6.0.37` 和 `6.1.9` 维护线开始,普通业务命令可以自动升级或降级到环境要求的版本,包括从 `6.0.x` 切换到 `6.1.x`。自动同步要求本地和目标均为 `主版本.次版本.补丁号`
|
|
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
|
|
|
@@ -162,8 +165,22 @@ ae-cli capability list --domain analysis --jq '.data.capabilities[] | .id'
|
|
|
162
165
|
| Agent 平台 | `automation` | 自动化配置、执行、历史和结果 |
|
|
163
166
|
<!-- root-command-surface:end -->
|
|
164
167
|
|
|
168
|
+
使用 `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` 查看关联命令执行明细的查询方式。
|
|
169
|
+
|
|
165
170
|
评测命令在普通终端和沙箱中均跟随当前 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)。
|
|
166
171
|
|
|
172
|
+
### Feature 实验定时开启
|
|
173
|
+
|
|
174
|
+
对于已完成配置的 Feature 实验,保存开始时间和可选的固定截止时间,检查就绪状态后提交:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
ae-cli experiment experiment save --project-id 1 --req '{"expId":"exp_123"}' --start-time '2026-11-01T16:00:00+08:00' --fixed-end-time '2026-11-08T16:00:00+08:00'
|
|
178
|
+
ae-cli experiment experiment ready-check --project-id 1 --exp-id exp_123
|
|
179
|
+
ae-cli experiment experiment manage --project-id 1 --exp-id exp_123 --target-status pending
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
仅保存不会开启实验,服务端每半小时检查已提交的实验。使用 `experiment experiment get` 确认状态;流量冲突检查、时间修改与手动开启规则见 [Feature 时间配置](skills/ae-experiment/references/save_experiment.md#feature-timing)。
|
|
183
|
+
|
|
167
184
|
## Capability Gateway
|
|
168
185
|
|
|
169
186
|
不需要独立精选命令的能力,应优先通过 Capability Gateway 调用:
|
|
@@ -276,6 +293,9 @@ JSON 参数通常支持内联 JSON、`@file`、文件路径或通过 `-` 从 std
|
|
|
276
293
|
|
|
277
294
|
## 知识库
|
|
278
295
|
|
|
296
|
+
公司知识库编译审批前,可用 `ae-cli kb candidate changes --name <name> --candidate <id>` 查看数据源、Wiki 和 Index 的变化。条目详情和文本差异用法见[审批预览](skills/ae-kb/references/publication.md)。
|
|
297
|
+
审批变化较多时,可用 `kb candidate changes --group wiki --search payment --offset 0 --limit 50` 分页检索;首次成功编译自动发布,后续公司知识库更新进入审批。
|
|
298
|
+
|
|
279
299
|
管理服务端知识库生命周期:
|
|
280
300
|
|
|
281
301
|
```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
|
}
|
|
@@ -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
|
-
|
|
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
|
|
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
|
|
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-6HAUVWOQ.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-
|
|
16
|
+
} from "./chunk-IN7KKL6K.js";
|
|
13
17
|
import {
|
|
14
|
-
getLocalCliPackageInfo,
|
|
15
18
|
printError,
|
|
16
|
-
printOutput
|
|
19
|
+
printOutput
|
|
20
|
+
} from "./chunk-QZLRHGVH.js";
|
|
21
|
+
import {
|
|
22
|
+
getLocalCliPackageInfo,
|
|
17
23
|
runHostCompatCheck
|
|
18
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-2UW3Y463.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-
|
|
40
|
+
} from "./chunk-H3K5UGYC.js";
|
|
35
41
|
import {
|
|
36
42
|
getFallbackCliToken,
|
|
37
43
|
loadConfig,
|
|
38
44
|
saveConfig
|
|
39
|
-
} from "./chunk-
|
|
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-
|
|
52
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
47
53
|
|
|
48
54
|
// src/core/device-auth.ts
|
|
49
55
|
import { execFileSync } from "child_process";
|
|
@@ -436,6 +442,7 @@ function promptHiddenCliToken() {
|
|
|
436
442
|
});
|
|
437
443
|
}
|
|
438
444
|
function activateHostAfterLogin(host, explicitHostOverride) {
|
|
445
|
+
invalidateBusinessSkillSynchronization();
|
|
439
446
|
if (!explicitHostOverride) return;
|
|
440
447
|
const normalized = normalizeUrl(host);
|
|
441
448
|
const config = loadConfig();
|
|
@@ -513,12 +520,15 @@ async function switchActiveAccount(program, opts) {
|
|
|
513
520
|
}
|
|
514
521
|
}
|
|
515
522
|
try {
|
|
523
|
+
invalidateBusinessSkillSynchronization();
|
|
516
524
|
const selected = activateCredential(host, account);
|
|
517
525
|
clearCliTokenCache(host);
|
|
526
|
+
const environment = await refreshEnvironmentAfterLogin(host);
|
|
518
527
|
await printOutput({
|
|
519
528
|
host,
|
|
520
529
|
active: true,
|
|
521
|
-
account: accountOutput(selected.account)
|
|
530
|
+
account: accountOutput(selected.account),
|
|
531
|
+
...environment ? { environment } : {}
|
|
522
532
|
}, program.opts().format || "json");
|
|
523
533
|
} catch (error) {
|
|
524
534
|
if (error instanceof CredentialStoreUnreadableError) throw error;
|
|
@@ -542,6 +552,7 @@ async function persistDeviceTokens(host, tokens, options = {}) {
|
|
|
542
552
|
}
|
|
543
553
|
let saved;
|
|
544
554
|
try {
|
|
555
|
+
invalidateBusinessSkillSynchronization();
|
|
545
556
|
saved = saveCredential(host, {
|
|
546
557
|
cliToken,
|
|
547
558
|
...validation.account ? { account: validation.account } : {},
|
|
@@ -560,6 +571,7 @@ async function persistManualCliToken(host, cliToken, options = {}) {
|
|
|
560
571
|
const validation = await validateCliTokenOnServer(host, cliToken);
|
|
561
572
|
let saved;
|
|
562
573
|
try {
|
|
574
|
+
invalidateBusinessSkillSynchronization();
|
|
563
575
|
saved = saveCredential(host, {
|
|
564
576
|
cliToken,
|
|
565
577
|
...validation.account ? { account: validation.account } : {},
|
|
@@ -635,8 +647,9 @@ function registerAuth(program) {
|
|
|
635
647
|
const tokens2 = await pollDeviceFlow(route.baseUrl, opts.deviceCode, { protocol: route.protocol }, emit);
|
|
636
648
|
const saved2 = await persistDeviceTokens(host, tokens2, { add: opts.add });
|
|
637
649
|
activateHostAfterLogin(host, explicitHost);
|
|
650
|
+
const environment2 = await refreshEnvironmentAfterLogin(host);
|
|
638
651
|
emit("Login successful! CLI token saved securely.");
|
|
639
|
-
await printOutput(loginSummary(host, saved2), format);
|
|
652
|
+
await printOutput({ ...loginSummary(host, saved2), ...environment2 ? { environment: environment2 } : {} }, format);
|
|
640
653
|
return;
|
|
641
654
|
}
|
|
642
655
|
const session = await authorizeLoginDevice(host);
|
|
@@ -660,8 +673,9 @@ function registerAuth(program) {
|
|
|
660
673
|
}, emit);
|
|
661
674
|
const saved = await persistDeviceTokens(host, tokens, { add: opts.add });
|
|
662
675
|
activateHostAfterLogin(host, explicitHost);
|
|
676
|
+
const environment = await refreshEnvironmentAfterLogin(host);
|
|
663
677
|
emit("Login successful! CLI token saved securely.");
|
|
664
|
-
await printOutput(loginSummary(host, saved), format);
|
|
678
|
+
await printOutput({ ...loginSummary(host, saved), ...environment ? { environment } : {} }, format);
|
|
665
679
|
} catch (error) {
|
|
666
680
|
if (error instanceof CredentialStoreUnreadableError) throw error;
|
|
667
681
|
if (error instanceof DeviceFlowUnsupportedError) {
|
|
@@ -704,9 +718,10 @@ function registerAuth(program) {
|
|
|
704
718
|
try {
|
|
705
719
|
const saved = await persistManualCliToken(host, cliToken, { add: opts.add });
|
|
706
720
|
activateHostAfterLogin(host, explicitHost);
|
|
721
|
+
const environment = await refreshEnvironmentAfterLogin(host);
|
|
707
722
|
process.stderr.write(`[ae-cli] CLI token verified and saved securely for ${host}
|
|
708
723
|
`);
|
|
709
|
-
await printOutput(manualTokenSummary(host, saved), program.opts().format || "json");
|
|
724
|
+
await printOutput({ ...manualTokenSummary(host, saved), ...environment ? { environment } : {} }, program.opts().format || "json");
|
|
710
725
|
} catch (error) {
|
|
711
726
|
if (error instanceof CredentialStoreUnreadableError) throw error;
|
|
712
727
|
if (error instanceof PermissionError) {
|
|
@@ -818,18 +833,21 @@ function registerAuth(program) {
|
|
|
818
833
|
process.exit(1);
|
|
819
834
|
}
|
|
820
835
|
clearCliTokenCache(host);
|
|
836
|
+
invalidateBusinessSkillSynchronization();
|
|
821
837
|
if (opts.all) {
|
|
822
838
|
clearAllCredentials(host);
|
|
823
839
|
await printOutput({ cleared: true, all: true, host }, program.opts().format || "json");
|
|
824
840
|
return;
|
|
825
841
|
}
|
|
826
842
|
const result = removeActiveCredential(host);
|
|
843
|
+
const environment = result.active ? await refreshEnvironmentAfterLogin(host) : void 0;
|
|
827
844
|
await printOutput({
|
|
828
845
|
cleared: !!result.removed,
|
|
829
846
|
all: false,
|
|
830
847
|
host,
|
|
831
848
|
remaining_accounts: listCredentials(host).length,
|
|
832
|
-
...result.active?.account ? { active_account: accountOutput(result.active.account) } : {}
|
|
849
|
+
...result.active?.account ? { active_account: accountOutput(result.active.account) } : {},
|
|
850
|
+
...environment ? { environment } : {}
|
|
833
851
|
}, program.opts().format || "json");
|
|
834
852
|
});
|
|
835
853
|
}
|
|
@@ -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-
|
|
4
|
+
} from "./chunk-7JAVT5TK.js";
|
|
5
5
|
import {
|
|
6
6
|
currentAgentSpaceId
|
|
7
7
|
} from "./chunk-RK6GLDGI.js";
|
|
8
|
-
import "./chunk-
|
|
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-
|
|
15
|
+
} from "./chunk-RJHGDWSC.js";
|
|
16
16
|
import "./chunk-Y74WTIKJ.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
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";
|
|
@@ -4,41 +4,47 @@ import {
|
|
|
4
4
|
requiresConfirmation
|
|
5
5
|
} from "./chunk-AMBFK2K3.js";
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
executeCapabilityWithEnvelope,
|
|
10
|
-
inspectCapability,
|
|
11
|
-
inspectCapabilityWithEnvelope,
|
|
12
|
-
listCapabilitiesWithEnvelope,
|
|
13
|
-
validateCapabilityWithEnvelope
|
|
14
|
-
} from "./chunk-QW3R6O7L.js";
|
|
7
|
+
resolveHost
|
|
8
|
+
} from "./chunk-IN7KKL6K.js";
|
|
15
9
|
import {
|
|
16
10
|
findGatewayDomain,
|
|
17
11
|
listCapabilityDiscoveryPrefixes,
|
|
18
12
|
listRegisteredCapabilityDomains,
|
|
19
13
|
resolveGatewayDomain
|
|
20
14
|
} from "./chunk-KPQY44JQ.js";
|
|
21
|
-
import {
|
|
22
|
-
resolveHost
|
|
23
|
-
} from "./chunk-P6VFCH3P.js";
|
|
24
15
|
import {
|
|
25
16
|
printError,
|
|
26
17
|
printOutput,
|
|
27
18
|
withOutputMetadata
|
|
28
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-QZLRHGVH.js";
|
|
20
|
+
import {
|
|
21
|
+
CapabilityGatewayError,
|
|
22
|
+
dryRunCapabilityWithEnvelope,
|
|
23
|
+
executeCapabilityWithEnvelope,
|
|
24
|
+
inspectCapability,
|
|
25
|
+
inspectCapabilityWithEnvelope,
|
|
26
|
+
listCapabilitiesWithEnvelope,
|
|
27
|
+
validateCapabilityWithEnvelope
|
|
28
|
+
} from "./chunk-3SDHJOCR.js";
|
|
29
29
|
import "./chunk-Y74WTIKJ.js";
|
|
30
|
+
import {
|
|
31
|
+
assertBusinessEnabled,
|
|
32
|
+
businessForCapability,
|
|
33
|
+
readBusinessConfigForExecution,
|
|
34
|
+
readCurrentBusinessConfig
|
|
35
|
+
} from "./chunk-2UW3Y463.js";
|
|
30
36
|
import {
|
|
31
37
|
CredentialStoreUnreadableError,
|
|
32
38
|
SecureStoreAuthError
|
|
33
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-H3K5UGYC.js";
|
|
34
40
|
import {
|
|
35
|
-
|
|
36
|
-
} from "./chunk-
|
|
41
|
+
parseJsonRequest
|
|
42
|
+
} from "./chunk-JNVVJ273.js";
|
|
37
43
|
import {
|
|
38
44
|
CliValidationError,
|
|
39
45
|
ExternalCliTokenError,
|
|
40
46
|
PermissionError
|
|
41
|
-
} from "./chunk-
|
|
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 =
|
|
175
|
+
parsed = parseJsonRequest(readFileSync(0, "utf8"));
|
|
165
176
|
} else if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
|
|
166
|
-
parsed =
|
|
177
|
+
parsed = parseJsonRequest(trimmed);
|
|
167
178
|
} else {
|
|
168
179
|
const path = trimmed.startsWith("@") ? trimmed.slice(1) : trimmed;
|
|
169
|
-
parsed =
|
|
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
|
|
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,
|
|
@@ -222,11 +238,16 @@ function registerCapability(program) {
|
|
|
222
238
|
"Capability namespace. One of: analysis, project, system, tracking, metadata, experiment, engage-flow, engage-task, engage-setting, engage-scene, engage-activity, engage-workbench, community"
|
|
223
239
|
).option("--project-id <project-id>", "Filter by project membership, permissions, and enabled features").action(async (query, opts) => {
|
|
224
240
|
await executeAndPrint(program, async (host) => {
|
|
225
|
-
const
|
|
241
|
+
const business = businessForCapability(opts.domain);
|
|
242
|
+
const businesses = business ? await readBusinessConfigForExecution(host) : readCurrentBusinessConfig(host);
|
|
243
|
+
const gatewayDomain = resolveCapabilityListDomain(opts.domain, businesses);
|
|
226
244
|
const projectId = parseOptionalProjectId(opts.projectId);
|
|
245
|
+
if (business && businesses[business] === false) {
|
|
246
|
+
return { domain: opts.domain, query, count: 0, capabilities: [], warning: `The '${business}' business is not enabled for the current environment.` };
|
|
247
|
+
}
|
|
227
248
|
const envelope = await listCapabilitiesWithEnvelope(host, gatewayDomain, projectId);
|
|
228
249
|
const catalog = normalizeCapabilityList(envelope.data);
|
|
229
|
-
const capabilities = filterCapabilities(catalog, opts.domain, query);
|
|
250
|
+
const capabilities = filterCapabilities(catalog, opts.domain, query, businesses);
|
|
230
251
|
const warning = emptyCapabilityCatalogWarning(catalog);
|
|
231
252
|
return withOutputMetadata({
|
|
232
253
|
domain: opts.domain,
|
|
@@ -243,6 +264,7 @@ function registerCapability(program) {
|
|
|
243
264
|
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) => {
|
|
244
265
|
await executeAndPrint(program, async (host) => {
|
|
245
266
|
assertCapabilityIsNotRetired(capabilityId);
|
|
267
|
+
await assertCapabilityBusinessEnabled(capabilityId, host);
|
|
246
268
|
const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
|
|
247
269
|
return gatewayOutput(await inspectCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseOptionalProjectId(opts.projectId)), host);
|
|
248
270
|
});
|
|
@@ -255,6 +277,7 @@ function registerCapability(program) {
|
|
|
255
277
|
).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) => {
|
|
256
278
|
await executeAndPrint(program, async (host) => {
|
|
257
279
|
assertCapabilityIsNotRetired(capabilityId);
|
|
280
|
+
await assertCapabilityBusinessEnabled(capabilityId, host);
|
|
258
281
|
const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
|
|
259
282
|
return gatewayOutput(await validateCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseCapabilityInput(opts.input)), host);
|
|
260
283
|
});
|
|
@@ -278,6 +301,7 @@ Examples:
|
|
|
278
301
|
).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) => {
|
|
279
302
|
await executeAndPrint(program, async (host) => {
|
|
280
303
|
assertCapabilityIsNotRetired(capabilityId);
|
|
304
|
+
await assertCapabilityBusinessEnabled(capabilityId, host);
|
|
281
305
|
const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
|
|
282
306
|
return gatewayOutput(await dryRunCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseCapabilityInput(opts.input)), host);
|
|
283
307
|
});
|
|
@@ -291,6 +315,7 @@ Examples:
|
|
|
291
315
|
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) => {
|
|
292
316
|
await executeAndPrint(program, async (host, globalOpts) => {
|
|
293
317
|
assertCapabilityIsNotRetired(capabilityId);
|
|
318
|
+
await assertCapabilityBusinessEnabled(capabilityId, host);
|
|
294
319
|
const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
|
|
295
320
|
const input = parseCapabilityInput(opts.input);
|
|
296
321
|
if (globalOpts.validate && globalOpts.dryRun) {
|
|
@@ -326,6 +351,9 @@ Examples:
|
|
|
326
351
|
ae-cli capability run analysis.dashboard.list --input input.json`
|
|
327
352
|
);
|
|
328
353
|
}
|
|
354
|
+
async function assertCapabilityBusinessEnabled(capabilityId, host) {
|
|
355
|
+
await assertBusinessEnabled(businessForCapability(capabilityId), host);
|
|
356
|
+
}
|
|
329
357
|
function gatewayOutput(envelope, host) {
|
|
330
358
|
return withOutputMetadata(withPageUrl(envelope.data, host), envelope.meta);
|
|
331
359
|
}
|