@thinkingai/ae-cli 6.1.12 → 6.1.14
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 +0 -2
- package/README.zh.md +0 -2
- package/dist/{auth-NN55553T.js → auth-GBMV6TEJ.js} +2 -2
- package/dist/{auth-GDV3H5I4.js → auth-NDSXE54J.js} +4 -4
- package/dist/{capability-DRLGDVS4.js → capability-TAMDRZYV.js} +18 -8
- package/dist/{capability-P6GK3AQH.js → capability-U7TDEEEG.js} +18 -8
- package/dist/{chunk-GJJA4CQZ.js → chunk-3FY3RJ26.js} +0 -4
- package/dist/{chunk-GS2P7LFD.js → chunk-5XUSIK27.js} +2 -2
- package/dist/{chunk-7KQWSBSL.js → chunk-753BUTNZ.js} +3 -3
- package/dist/{chunk-VTXHDCBW.js → chunk-AFXA7BRK.js} +2 -2
- package/dist/chunk-IBH3LDAH.js +556 -0
- package/dist/{chunk-RBNKI5ZW.js → chunk-JUW4AJXN.js} +2 -2
- package/dist/{chunk-TS6BUGUY.js → chunk-QATA32VR.js} +3 -3
- package/dist/{chunk-Z3OXWCIA.js → chunk-S5NTSDBS.js} +2 -2
- package/dist/chunk-UIHQJK5E.js +556 -0
- package/dist/{chunk-VKD5WQKN.js → chunk-VLWOLBGZ.js} +142 -24
- package/dist/{chunk-YTG6Q75E.js → chunk-WZRX4KOH.js} +25 -3
- package/dist/{chunk-YV52FB5G.js → chunk-ZQKDZXDO.js} +1 -1
- package/dist/{cli-token-GL5MS5FK.js → cli-token-4UPER74P.js} +3 -3
- package/dist/{chunk-6A2FUCIS.js → client-L2YDMHQ6.js} +5 -6
- package/dist/{config-4VZNLBKF.js → config-OL2LWGBV.js} +4 -33
- package/dist/index.js +25 -38
- package/dist/{memory-RWJW4XFO.js → memory-MUP7PPL7.js} +4 -4
- package/dist/{memory-VO2ZJCRT.js → memory-U4O5PMXH.js} +4 -4
- package/dist/{metadata-ZRN2GHPN.js → metadata-5MIMNIMT.js} +33 -20
- package/dist/{metadata-YGTHR2XJ.js → metadata-LERKDJN6.js} +33 -20
- package/dist/{model-CLUIK3K5.js → model-JTUEO5M4.js} +2 -2
- package/dist/{sync-3REDHGY6.js → sync-MOSFNBVR.js} +5 -5
- package/dist/{te-agent-XNPELAKX.js → te-agent-IFKZDHZI.js} +25 -18
- package/dist/{te-analysis-GJI5FZUL.js → te-analysis-FCHRTNIY.js} +1267 -492
- package/dist/{te-analysis-N2BRDJZ5.js → te-analysis-QG7UKGDA.js} +1267 -492
- package/dist/{te-community-SQXKE5OO.js → te-community-HNKVTERD.js} +207 -12
- package/dist/{te-community-TYSNU3NQ.js → te-community-IWE5B7W6.js} +208 -12
- package/dist/{te-dataops-OWIADNSM.js → te-dataops-KQPYNAE3.js} +262 -145
- package/dist/{te-dataops-5TM7WZDI.js → te-dataops-KXCEB4CS.js} +262 -145
- package/dist/{te-engage-L72HWRGO.js → te-engage-D6EG3NOR.js} +951 -17
- package/dist/{te-engage-QWM4GFS7.js → te-engage-ZSMIJLUW.js} +951 -17
- package/dist/{te-experiment-2T2HEZML.js → te-experiment-K5US7RMG.js} +6 -6
- package/dist/{te-experiment-PVEY7AEZ.js → te-experiment-WA7TFMEL.js} +6 -6
- package/dist/{te-kb-VRMEY3D4.js → te-kb-OIH3T6CS.js} +4 -4
- package/dist/{te-system-XGS5EQIQ.js → te-system-AZ3URMUO.js} +515 -11
- package/dist/{te-team-BZRDV2CM.js → te-team-GZPU6UWA.js} +5 -5
- package/dist/{update-HEDXGOJH.js → update-TOBFXF2V.js} +4 -4
- package/package.json +5 -5
- package/skills/ae-agent/SKILL.md +3 -3
- package/skills/ae-agent/references/list-skill-references.md +4 -4
- package/skills/ae-agent/references/read-skill-reference.md +10 -7
- package/skills/ae-agent/references/upload-skill-reference.md +11 -9
- package/skills/ae-analysis/SKILL.md +15 -12
- package/skills/ae-analysis/metadata_resolution.md +150 -0
- package/skills/ae-analysis/references/adhoc_export.md +17 -2
- package/skills/ae-analysis/references/adhoc_run.md +12 -8
- package/skills/ae-analysis/references/ai_models.md +35 -6
- package/skills/ae-analysis/references/alert_list.md +2 -3
- package/skills/ae-analysis/references/analysis_data_retrieval.md +104 -16
- package/skills/ae-analysis/references/analysis_drilldown_contract.md +4 -4
- package/skills/ae-analysis/references/analysis_gateway_assets.md +17 -15
- package/skills/ae-analysis/references/artifact_download.md +4 -3
- package/skills/ae-analysis/references/asset_abnormal_list.md +5 -3
- package/skills/ae-analysis/references/asset_authentication_list.md +5 -3
- package/skills/ae-analysis/references/asset_search.md +5 -3
- package/skills/ae-analysis/references/bi_panel_list.md +2 -2
- package/skills/ae-analysis/references/bi_panel_page_data_export.md +1 -1
- package/skills/ae-analysis/references/bi_panel_page_data_run.md +4 -4
- package/skills/ae-analysis/references/catalog_export.md +28 -0
- package/skills/ae-analysis/references/catalog_list.md +44 -0
- package/skills/ae-analysis/references/command_index.md +78 -69
- package/skills/ae-analysis/references/dashboard_list.md +2 -2
- package/skills/ae-analysis/references/dashboard_report_data_run.md +11 -4
- package/skills/ae-analysis/references/datatable_version_list.md +5 -3
- package/skills/ae-analysis/references/drilldown_entities_run.md +4 -4
- package/skills/ae-analysis/references/drilldown_events_run.md +2 -2
- package/skills/ae-analysis/references/drilldown_user_events_export.md +1 -1
- package/skills/ae-analysis/references/drilldown_user_events_run.md +2 -2
- package/skills/ae-analysis/references/entity_detail_run.md +4 -4
- package/skills/ae-analysis/references/entity_id_import_options.md +1 -1
- package/skills/ae-analysis/references/event_detail_run.md +4 -4
- package/skills/ae-analysis/references/event_export.md +21 -0
- package/skills/ae-analysis/references/event_list.md +7 -6
- package/skills/ae-analysis/references/exchange_rule_list.md +5 -3
- package/skills/ae-analysis/references/favorite_add.md +2 -2
- package/skills/ae-analysis/references/favorite_remove.md +2 -2
- package/skills/ae-analysis/references/history_tag_data_drilldown_export.md +4 -2
- package/skills/ae-analysis/references/history_tag_data_drilldown_run.md +2 -2
- package/skills/ae-analysis/references/history_tag_data_run.md +2 -2
- package/skills/ae-analysis/references/metric_create.md +7 -8
- package/skills/ae-analysis/references/metric_export.md +21 -0
- package/skills/ae-analysis/references/metric_list.md +8 -7
- package/skills/ae-analysis/references/project_space_list.md +2 -2
- package/skills/ae-analysis/references/property_export.md +21 -0
- package/skills/ae-analysis/references/property_list.md +9 -8
- package/skills/ae-analysis/references/public_link_list.md +2 -2
- package/skills/ae-analysis/references/query_context_get.md +20 -0
- package/skills/ae-analysis/references/query_create_result_cluster.md +1 -1
- package/skills/ae-analysis/references/report_change_log_list.md +1 -1
- package/skills/ae-analysis/references/report_create.md +3 -3
- package/skills/ae-analysis/references/report_data_run.md +8 -8
- package/skills/ae-analysis/references/report_list.md +3 -3
- package/skills/ae-analysis/references/report_list_export.md +2 -2
- package/skills/ae-analysis/references/report_update.md +3 -3
- package/skills/ae-analysis/references/report_version_rollback.md +1 -1
- package/skills/ae-analysis/references/rule_list.md +6 -4
- package/skills/ae-analysis/references/run_inspect.md +8 -5
- package/skills/ae-analysis/references/run_wait.md +37 -0
- package/skills/ae-analysis/references/sql_table_list.md +3 -2
- package/skills/ae-analysis/references/user_cluster_export.md +13 -0
- package/skills/ae-analysis/references/user_cluster_list.md +6 -2
- package/skills/ae-analysis/references/user_cluster_member_export.md +5 -3
- package/skills/ae-analysis/references/user_cluster_member_list.md +4 -4
- package/skills/ae-analysis/references/user_cluster_update.md +4 -2
- package/skills/ae-analysis/references/user_tag_export.md +13 -0
- package/skills/ae-analysis/references/user_tag_list.md +6 -2
- package/skills/ae-analysis/references/user_tag_member_export.md +5 -3
- package/skills/ae-analysis/references/user_tag_member_list.md +4 -4
- package/skills/ae-analysis/references/user_tag_update.md +4 -2
- package/skills/ae-analysis/references/virtual_property_create.md +2 -2
- package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +3 -3
- package/skills/ae-community/SKILL.md +2 -2
- package/skills/ae-dataops/SKILL.md +4 -3
- package/skills/ae-dataops/references/dataops-flow-create.md +47 -3
- package/skills/ae-engage/SKILL.md +55 -7
- package/skills/ae-engage/references/build-task-save-guide.md +12 -0
- package/skills/ae-engage/references/cancel-query-run.md +31 -0
- package/skills/ae-engage/references/config-item-analysis-report.md +14 -1
- package/skills/ae-engage/references/config-item-strategy-comparison.md +11 -1
- package/skills/ae-engage/references/config-item-trigger-report.md +15 -1
- package/skills/ae-engage/references/flow-metric-detail-report.md +134 -0
- package/skills/ae-engage/references/flow-metric-update.md +77 -0
- package/skills/ae-engage/references/flow-metric-user.md +119 -0
- package/skills/ae-engage/references/flow-node-metric-user.md +123 -0
- package/skills/ae-engage/references/flow-node-user.md +123 -0
- package/skills/ae-engage/references/push-record-query.md +32 -1
- package/skills/ae-engage/references/save-task.md +9 -0
- package/skills/ae-engage/references/task-data-detail.md +9 -2
- package/skills/ae-engage/references/task-indicator-user.md +104 -0
- package/skills/ae-engage/references/task-metric-detail.md +9 -2
- package/skills/ae-engage/references/task-submit-approval.md +3 -0
- package/skills/ae-engage/references/task-user-detail-export.md +31 -0
- package/skills/ae-experiment/references/save_experiment.md +4 -0
- package/skills/ae-experiment-design/SKILL.md +1 -1
- package/skills/ae-experiment-design/references/platform-operations.md +1 -1
- package/skills/ae-experiment-insight/references/platform-operations.md +1 -1
- package/skills/ae-metadata/SKILL.md +2 -1
- package/skills/ae-metadata/references/metadata_data_table_download.md +10 -2
- package/skills/ae-metadata/references/metadata_data_table_list.md +5 -2
- package/skills/ae-metadata/references/metadata_property_dimension_table_bind_existing.md +1 -1
- package/skills/ae-system/SKILL.md +66 -3
- package/dist/chunk-DT6Y3TD7.js +0 -232
- package/dist/chunk-MVDZ7DBQ.js +0 -231
- package/dist/chunk-NBPKWKRA.js +0 -51
- package/dist/client-DAIPF7XN.js +0 -23
- package/dist/raw-52B4UKO4.js +0 -71
- package/dist/te-meta-53BVXPFI.js +0 -95
- package/dist/te-meta-TOCBPBXI.js +0 -95
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ae-metadata
|
|
3
|
-
version: 1.0.
|
|
3
|
+
version: 1.0.1
|
|
4
4
|
description: "AE/TE metadata capability-gateway CLI: metadata data-table management and property dimension-table binding. Metadata CLI routes through the analysis gateway. Input-file upload and event/property detail belong to ae-analysis."
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -30,6 +30,7 @@ Safety:
|
|
|
30
30
|
- Ordinary writes (`data-table *-write`, `property-bindings-update`, dimension-table bind/create) execute without `--yes`. Delete commands are `high-risk-write`: dry-run first, summarize impact, wait for explicit confirmation, then execute with `--yes`.
|
|
31
31
|
- **Before any command**, read the matching `references/<name>.md` (filename = command with spaces → underscores, e.g. `metadata data-table list` → `metadata_data_table_list.md`).
|
|
32
32
|
- Never invent `project_id`, event/property names, `input_file_id`, or `data_table_id`. Discover names via `ae-analysis` and data table IDs via `metadata data-table list`.
|
|
33
|
+
- `metadata data-table download` is an async artifact command: plain invocation submits, `--wait` waits, and `--output <file>` waits then streams atomically. Resume with `analysis run wait`; local interruption never cancels the remote run.
|
|
33
34
|
|
|
34
35
|
## When to Use
|
|
35
36
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
```bash
|
|
6
6
|
ae-cli metadata data-table download --project-id <project_id> --data-table-id <id>
|
|
7
7
|
ae-cli metadata data-table download --project-id <project_id> --data-table-id <id> --request-id cli_0123456789abcdef0123456789abcdef --timeout-seconds 120
|
|
8
|
+
ae-cli metadata data-table download --project-id <project_id> --data-table-id <id> --output <file>
|
|
8
9
|
```
|
|
9
10
|
|
|
10
11
|
| Parameter | Required | Description |
|
|
@@ -12,6 +13,13 @@ ae-cli metadata data-table download --project-id <project_id> --data-table-id <i
|
|
|
12
13
|
| `--project-id` / `-p` | Yes | Numeric project ID. |
|
|
13
14
|
| `--data-table-id` | Yes | Data table ID. |
|
|
14
15
|
| `--request-id` | No | Optional `cli_<32 lowercase hex>` request ID. |
|
|
15
|
-
| `--timeout-seconds` | No |
|
|
16
|
+
| `--timeout-seconds` | No | Remote runtime in seconds, 1 to 21600. |
|
|
17
|
+
| `--wait` | No | Wait for run `SUCCEEDED` and artifact `COMPLETED`. |
|
|
18
|
+
| `--output` | No | Wait, then stream and atomically publish the artifact to this file. |
|
|
19
|
+
| `--force` | No | Replace an existing `--output` file atomically; invalid without `--output`. |
|
|
16
20
|
|
|
17
|
-
Use this command when the user needs an exported data-table artifact.
|
|
21
|
+
Use this command when the user needs an exported data-table artifact. Plain
|
|
22
|
+
invocation submits only. `--output` implies `--wait`; resume an interrupted
|
|
23
|
+
wait with `ae-cli analysis run wait --run-id <run_id> [--output <file>]`.
|
|
24
|
+
Local interruption never cancels the remote run. Do not use this command for
|
|
25
|
+
inline data-table metadata; use `metadata data-table get` instead.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
## Command
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
ae-cli metadata data-table list --project-id <project_id>
|
|
8
|
+
ae-cli metadata data-table list --project-id <project_id> --limit 50 --offset 0
|
|
9
9
|
ae-cli metadata data-table list --project-id <project_id> --dry-run
|
|
10
10
|
```
|
|
11
11
|
|
|
@@ -14,14 +14,17 @@ ae-cli metadata data-table list --project-id <project_id> --dry-run
|
|
|
14
14
|
| Parameter | Required | Description |
|
|
15
15
|
|---|---|---|
|
|
16
16
|
| `--project-id` / `-p` | Yes | Numeric project ID. |
|
|
17
|
+
| `--limit` / `-l` | No | Page size. Default: 50, maximum: 200. |
|
|
18
|
+
| `--offset` / `-o` | No | Zero-based page offset. Default: 0. |
|
|
17
19
|
|
|
18
20
|
## Request Body
|
|
19
21
|
|
|
20
22
|
```json
|
|
21
|
-
{ "project_id": 1 }
|
|
23
|
+
{ "project_id": 1, "limit": 50, "offset": 0 }
|
|
22
24
|
```
|
|
23
25
|
|
|
24
26
|
## Decision Rules
|
|
25
27
|
|
|
26
28
|
- Use this command to discover `data_table_id` before get, delete, download, or property binding.
|
|
27
29
|
- If the list is empty, do not invent IDs; create/upload a table first or ask for the target table.
|
|
30
|
+
- Read rows from `data.items`; pagination metadata is always `total`, `limit`, `offset`, `has_more`, and `next_offset`.
|
|
@@ -18,7 +18,7 @@ ae-cli metadata property bind-existing-dimension-table --project-id <project_id>
|
|
|
18
18
|
| `--property-scope` | Yes | Property owner table, for example `event` or `user`. |
|
|
19
19
|
| `--data-table-id` | Yes | Existing dimension data table ID. |
|
|
20
20
|
| `--timestamp-join-format` | No | Timestamp join format. |
|
|
21
|
-
| `--dict-columns` | No | Dictionary column names JSON array. |
|
|
21
|
+
| `--dict-columns` | No | Dictionary column names JSON array. The CLI converts each string to the canonical `{"column_name":"..."}` object required by the capability. |
|
|
22
22
|
|
|
23
23
|
## Decision Rules
|
|
24
24
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ae-system
|
|
3
|
-
version: 1.
|
|
4
|
-
description: "AE Agent system administration CLI for root and agent administrators. Use when the user asks to manage Agent members, sandboxes, company model visibility/defaults, usage statistics, cost quotas, balance alerts, or IM channels. Must use ae-cli system commands, discover real IDs before writes, and never attempt to bypass a permission denial."
|
|
3
|
+
version: 1.1.0
|
|
4
|
+
description: "AE Agent system administration CLI for root and agent administrators. Use when the user asks to manage Agent members, sandboxes and shared tools, company model visibility/defaults/pricing, usage statistics and exports, cost quotas, balance alerts, or IM channels. Must use ae-cli system commands, discover real IDs before writes, and never attempt to bypass a permission denial."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# ae-system
|
|
@@ -19,11 +19,13 @@ ae-cli system +<command> [options]
|
|
|
19
19
|
- Run `ae-cli auth login --host <host>` before using this domain. System administration requires a user access-token session; sandbox identity headers are not an authorization substitute.
|
|
20
20
|
- `+npm-install` is the exception that must also run inside a Linux te-agent sandbox because it packages the installed Linux files. It still requires the logged-in user to be `root` or `agent_admin`.
|
|
21
21
|
- Discover real IDs with a list command before any update or delete. Never guess a user, sandbox, model, quota rule, or channel ID.
|
|
22
|
-
-
|
|
22
|
+
- Before every write, run `--dry-run`, show the target and effect, and obtain explicit user confirmation. The CLI itself prompts only for `high-risk-write`; `--yes` can bypass that prompt and is not a security boundary.
|
|
23
23
|
- Use `--dry-run` to inspect method, path, query, and redacted body without executing.
|
|
24
24
|
- JSON inputs accept inline JSON, `@file`, or `-` for stdin. Prefer `@file` for channel credentials and other sensitive values.
|
|
25
25
|
- Successful output is JSON by default. Use `--format table` only when a human-readable table is more useful.
|
|
26
26
|
- After each command, check stderr and `_notice.host_compat`. If present, show the version warning and its update commands before the business result.
|
|
27
|
+
- Do not treat an absent ae-cli command as proof that an HTTP endpoint is unreachable. An Agent with Bash/network access can construct requests directly; server authentication, role checks, company isolation, and resource ownership are the actual controls.
|
|
28
|
+
- Do not call `DELETE /api/admin/members?openId=...` or `/api/internal/sandboxes/**` through ad-hoc HTTP. They are intentionally excluded from this Skill because other systems own those integration contracts.
|
|
27
29
|
|
|
28
30
|
## Command Groups
|
|
29
31
|
|
|
@@ -37,6 +39,7 @@ ae-cli system +<command> [options]
|
|
|
37
39
|
| `+set-member-status` | write | Enable or disable a member. |
|
|
38
40
|
| `+set-member-role` | write | Change a non-root member between `agent_admin` and `member`. |
|
|
39
41
|
| `+remove-member` | high-risk-write | Remove a non-root member. |
|
|
42
|
+
| `+get-member-stats` | read | Get one member's token usage and recent conversation count. |
|
|
40
43
|
|
|
41
44
|
Examples:
|
|
42
45
|
|
|
@@ -77,6 +80,7 @@ Optional flags are `--rule-id` and `--create-sandbox true|false`.
|
|
|
77
80
|
| Command | Risk | Purpose |
|
|
78
81
|
| --- | --- | --- |
|
|
79
82
|
| `+list-sandboxes` | read | List company sandboxes. |
|
|
83
|
+
| `+get-sandbox-config` | read | Read feature status and create/active seat limits. |
|
|
80
84
|
| `+batch-create-sandboxes` | write | Create personal sandboxes for 1-100 users. |
|
|
81
85
|
| `+update-sandbox` | write | Update a sandbox description. |
|
|
82
86
|
| `+set-sandbox-enabled` | write | Enable or disable a sandbox. |
|
|
@@ -106,9 +110,33 @@ Use Agent database user IDs from `+list-members`, not TE openIds, for sandbox co
|
|
|
106
110
|
| --- | --- | --- |
|
|
107
111
|
| `+upload-sandbox-tool` | write | Validate, ZIP, and upload an existing tool directory. |
|
|
108
112
|
| `+npm-install` | write | Install one exact npm CLI version in a temporary sandbox directory, generate `tool.json`, and upload it. |
|
|
113
|
+
| `+list-sandbox-tools` | read | List preset and custom tools for the current company. |
|
|
114
|
+
| `+sync-sandbox-tools` | write | Synchronize preset tools from the server manifest. |
|
|
115
|
+
| `+get-sandbox-tool-distribution` | read | Read the sandboxes currently receiving one tool. |
|
|
116
|
+
| `+set-sandbox-tool-enabled` | write | Enable or disable one registered tool. |
|
|
117
|
+
| `+remove-sandbox-tool` | high-risk-write | Delete a fully reclaimed tool registration. |
|
|
118
|
+
| `+activate-sandbox-tools` | write | Activate selected commands on selected or all running sandboxes. |
|
|
119
|
+
| `+deactivate-sandbox-tools` | write | Remove managed command shims from selected or all running sandboxes. |
|
|
120
|
+
| `+refresh-sandbox-tool-status` | write | Refresh observed tool state on target sandboxes. |
|
|
121
|
+
| `+list-sandbox-tool-operations` | read | List activation/deactivation history. |
|
|
109
122
|
|
|
110
123
|
Uploaded tools are registered for the current company with `enabled=false`. Upload does not activate the tool in any running sandbox. Review and enable/activate it through sandbox tool management after upload.
|
|
111
124
|
|
|
125
|
+
For activate/deactivate/status operations:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
ae-cli system +activate-sandbox-tools \
|
|
129
|
+
--target-mode selected \
|
|
130
|
+
--sandbox-ids '["<sandbox-id>"]' \
|
|
131
|
+
--tool-ids '["<tool-id>"]'
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
- `--target-mode selected` requires 1-50 `--sandbox-ids`; `all-running` forbids them.
|
|
135
|
+
- `--tool-ids` contains 1-20 real IDs from `+list-sandbox-tools`.
|
|
136
|
+
- `--command-names-by-tool-id` optionally limits an operation to named commands.
|
|
137
|
+
- `--expected-tool-snapshots-by-id` carries the version/package/command snapshot returned by the server for optimistic concurrency checks.
|
|
138
|
+
- JSON maps accept inline JSON, `@file`, or stdin. Use dry-run and user confirmation before distribution changes.
|
|
139
|
+
|
|
112
140
|
#### Preferred npm Flow
|
|
113
141
|
|
|
114
142
|
Run this inside the target Linux te-agent sandbox:
|
|
@@ -189,6 +217,9 @@ Upload contract:
|
|
|
189
217
|
| --- | --- | --- |
|
|
190
218
|
| `+list-system-models` | read | List system models and company visibility. |
|
|
191
219
|
| `+set-system-model-enabled` | write | Toggle a system model for the current company. |
|
|
220
|
+
| `+get-model-sync-settings` | read | Read the default visibility policy for newly synchronized system models. |
|
|
221
|
+
| `+set-model-sync-settings` | write | Update the new-system-model visibility policy. |
|
|
222
|
+
| `+get-system-model-price-rules` | read | Read one managed system model's stored pricing snapshot. |
|
|
192
223
|
| `+list-company-models` | read | List company models, including disabled models. |
|
|
193
224
|
| `+set-company-model-enabled` | write | Toggle a company model for all company users. |
|
|
194
225
|
| `+get-default-models` | read | Read the `AE_AGENT` and `AI_QA` default slots. |
|
|
@@ -211,11 +242,16 @@ ae-cli system +set-default-model --model-id <model-id> --biz-type AE_AGENT
|
|
|
211
242
|
| --- | --- | --- |
|
|
212
243
|
| `+get-usage-summary` | read | Get token/cost summary for a relative or absolute range. |
|
|
213
244
|
| `+get-usage-details` | read | Get paginated usage grouped by user, model, date, or application type. |
|
|
245
|
+
| `+get-agent-tool-calls` | read | Get Agent tool-call count for a range, optionally refreshing the cache. |
|
|
246
|
+
| `+get-usage-combinations` | read | Drill one parent group into the remaining dimensions. |
|
|
247
|
+
| `+export-usage` | read | Stream filtered one-dimension usage groups to CSV. |
|
|
248
|
+
| `+export-usage-details` | read | Stream full or drill-down multi-dimension details to CSV. |
|
|
214
249
|
|
|
215
250
|
Examples:
|
|
216
251
|
|
|
217
252
|
```bash
|
|
218
253
|
ae-cli system +get-usage-summary --days 30
|
|
254
|
+
ae-cli system +get-usage-summary --days 30 --refresh true
|
|
219
255
|
|
|
220
256
|
ae-cli system +get-usage-details \
|
|
221
257
|
--start-date 2026-07-01 \
|
|
@@ -223,12 +259,26 @@ ae-cli system +get-usage-details \
|
|
|
223
259
|
--group-by user \
|
|
224
260
|
--page 1 \
|
|
225
261
|
--page-size 20
|
|
262
|
+
|
|
263
|
+
ae-cli system +get-usage-combinations \
|
|
264
|
+
--start-date 2026-07-01 \
|
|
265
|
+
--end-date 2026-07-24 \
|
|
266
|
+
--parent-dimension user \
|
|
267
|
+
--open-id <open-id>
|
|
268
|
+
|
|
269
|
+
ae-cli system +export-usage \
|
|
270
|
+
--start-date 2026-07-01 \
|
|
271
|
+
--end-date 2026-07-24 \
|
|
272
|
+
--group-by user \
|
|
273
|
+
--output ./system-usage.csv
|
|
226
274
|
```
|
|
227
275
|
|
|
228
276
|
Summary range:
|
|
229
277
|
|
|
230
278
|
- Use `--days 1..365`, or provide both `--start-date` and `--end-date`.
|
|
231
279
|
- Dates use `YYYY-MM-DD`.
|
|
280
|
+
- Do not combine `--days` with an absolute date pair.
|
|
281
|
+
- `--refresh true` is available on `+get-usage-summary` and `+get-agent-tool-calls` and bypasses the overview cache.
|
|
232
282
|
|
|
233
283
|
Details flags:
|
|
234
284
|
|
|
@@ -239,11 +289,22 @@ Details flags:
|
|
|
239
289
|
- `--sort-by`: `totalTokens | cost | share | requestCount`.
|
|
240
290
|
- `--sort-dir`: `asc | desc`.
|
|
241
291
|
|
|
292
|
+
Combination drill-down requires exactly one parent selector:
|
|
293
|
+
|
|
294
|
+
- `user` → `--open-id` only.
|
|
295
|
+
- `model` → `--model-id` and `--model-scope` only.
|
|
296
|
+
- `app_type` → `--app-type` only.
|
|
297
|
+
- `date` → `--date` only, inside the selected range.
|
|
298
|
+
|
|
299
|
+
CSV exports require an explicit `--output`. The target is created exclusively: an existing file is never overwritten, and an HTTP or stream failure removes the incomplete file. The JSON result reports the absolute local path, bytes written, server filename, and content type.
|
|
300
|
+
|
|
242
301
|
### Cost Control
|
|
243
302
|
|
|
244
303
|
| Command | Risk | Purpose |
|
|
245
304
|
| --- | --- | --- |
|
|
246
305
|
| `+get-cost-summary` | read | Get company cost, quota, and usage summary. |
|
|
306
|
+
| `+get-balance` | read | Get the current model account balance and currency. |
|
|
307
|
+
| `+list-over-limit-users` | read | List members over cost or token quota limits. |
|
|
247
308
|
| `+get-balance-alert` | read | Get balance alert config and current status. |
|
|
248
309
|
| `+set-balance-alert` | write | Enable, update, or disable the balance alert. |
|
|
249
310
|
| `+list-quota-rules` | read | List cost/token quota rules. |
|
|
@@ -347,6 +408,8 @@ On this response:
|
|
|
347
408
|
2. Do not recommend re-login unless the server returned 401 instead.
|
|
348
409
|
3. Tell the user that `root` or `agent_admin` is required.
|
|
349
410
|
|
|
411
|
+
An authenticated `root` or `agent_admin` is still scoped to their own company. The current service checks the database role and company against the session, and audited member, channel, sandbox-tool, and sandbox-management routes apply company/resource ownership checks. Never use that statement as a claim that every unreviewed admin route is safe.
|
|
412
|
+
|
|
350
413
|
## Transport Status
|
|
351
414
|
|
|
352
415
|
This is a Transitional L2 domain backed by te-agent `/api/admin/**`.
|
package/dist/chunk-DT6Y3TD7.js
DELETED
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getAnalysisMappingPathForClusterMode
|
|
3
|
-
} from "./chunk-NBPKWKRA.js";
|
|
4
|
-
import {
|
|
5
|
-
clearCliToken,
|
|
6
|
-
getCliToken
|
|
7
|
-
} from "./chunk-Z3OXWCIA.js";
|
|
8
|
-
import {
|
|
9
|
-
getActiveHost,
|
|
10
|
-
safeJsonParse
|
|
11
|
-
} from "./chunk-GJJA4CQZ.js";
|
|
12
|
-
import {
|
|
13
|
-
PermissionError
|
|
14
|
-
} from "./chunk-AXDXJTPC.js";
|
|
15
|
-
import {
|
|
16
|
-
logger
|
|
17
|
-
} from "./chunk-JHENBQ5B.js";
|
|
18
|
-
|
|
19
|
-
// src/core/mcp.ts
|
|
20
|
-
async function permissionMessage(resp) {
|
|
21
|
-
const text = await resp.text().catch(() => "");
|
|
22
|
-
try {
|
|
23
|
-
const d = safeJsonParse(text);
|
|
24
|
-
const msg = d && (d.error?.message || (typeof d.error === "string" ? d.error : void 0) || d.message);
|
|
25
|
-
if (msg && typeof msg === "string") return msg;
|
|
26
|
-
} catch {
|
|
27
|
-
}
|
|
28
|
-
return "Permission denied for this resource (HTTP 403)";
|
|
29
|
-
}
|
|
30
|
-
function isInvalidCliTokenMessage(message) {
|
|
31
|
-
return /\b(cli[-_\s]?token|token)\b.*\binvalid\b/i.test(message) || /\binvalid\b.*\b(cli[-_\s]?token|token)\b/i.test(message);
|
|
32
|
-
}
|
|
33
|
-
var MCP_PROTOCOL_VERSION = "2025-11-25";
|
|
34
|
-
var JSONRPC_VERSION = "2.0";
|
|
35
|
-
var serviceMappingMap = /* @__PURE__ */ new Map();
|
|
36
|
-
registerMcpMapping("analysis", {
|
|
37
|
-
componentName: "analysis",
|
|
38
|
-
mappingPath: "analysis"
|
|
39
|
-
});
|
|
40
|
-
registerMcpMapping("te_analysis_extend", {
|
|
41
|
-
componentName: "analysis",
|
|
42
|
-
mappingPath: "analysis-extend"
|
|
43
|
-
});
|
|
44
|
-
function registerMcpMapping(serviceName, mapping) {
|
|
45
|
-
serviceMappingMap.set(serviceName, mapping);
|
|
46
|
-
}
|
|
47
|
-
function registerMcpMappings(mappings) {
|
|
48
|
-
for (const [serviceName, mapping] of Object.entries(mappings)) {
|
|
49
|
-
serviceMappingMap.set(serviceName, mapping);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function getMcpMapping(serviceName) {
|
|
53
|
-
const mapping = serviceMappingMap.get(serviceName);
|
|
54
|
-
if (!mapping) {
|
|
55
|
-
throw new Error(`MCP mapping not found for service: '${serviceName}'. Please register it using registerMcpMapping() first.`);
|
|
56
|
-
}
|
|
57
|
-
if (serviceName === "analysis") {
|
|
58
|
-
return { ...mapping, mappingPath: getAnalysisMappingPathForClusterMode() };
|
|
59
|
-
}
|
|
60
|
-
return mapping;
|
|
61
|
-
}
|
|
62
|
-
function buildMcpUrl(host, serviceName) {
|
|
63
|
-
const mapping = getMcpMapping(serviceName);
|
|
64
|
-
const base = host.replace(/\/+$/, "");
|
|
65
|
-
return `${base}/mcp/${mapping.componentName}/http/${mapping.mappingPath}`;
|
|
66
|
-
}
|
|
67
|
-
function resolveMcpUrl(mcpUrlOverride, host, serviceName) {
|
|
68
|
-
if (mcpUrlOverride) {
|
|
69
|
-
return mcpUrlOverride;
|
|
70
|
-
}
|
|
71
|
-
return buildMcpUrl(host, serviceName);
|
|
72
|
-
}
|
|
73
|
-
var requestIdCounter = 1;
|
|
74
|
-
function genRequestId() {
|
|
75
|
-
return requestIdCounter++;
|
|
76
|
-
}
|
|
77
|
-
function buildAuthHeaders(cliToken) {
|
|
78
|
-
return {
|
|
79
|
-
"cli-token": cliToken
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
async function mcpRequest(url, method, params = {}, hostOverride) {
|
|
83
|
-
const hostUrl = hostOverride || getActiveHost();
|
|
84
|
-
const token = await getCliToken(hostUrl);
|
|
85
|
-
const requestId = genRequestId();
|
|
86
|
-
const paramsWithMeta = {
|
|
87
|
-
...params,
|
|
88
|
-
_meta: { progressToken: requestId }
|
|
89
|
-
};
|
|
90
|
-
const body = {
|
|
91
|
-
jsonrpc: JSONRPC_VERSION,
|
|
92
|
-
id: requestId,
|
|
93
|
-
method,
|
|
94
|
-
params: paramsWithMeta
|
|
95
|
-
};
|
|
96
|
-
const headers = {
|
|
97
|
-
"Content-Type": "application/json",
|
|
98
|
-
"Accept": "application/json, text/event-stream",
|
|
99
|
-
"mcp-protocol-version": MCP_PROTOCOL_VERSION,
|
|
100
|
-
"X-Source": "ae-cli",
|
|
101
|
-
...buildAuthHeaders(token)
|
|
102
|
-
};
|
|
103
|
-
const resp = await fetch(url, {
|
|
104
|
-
method: "POST",
|
|
105
|
-
headers,
|
|
106
|
-
body: JSON.stringify(body)
|
|
107
|
-
});
|
|
108
|
-
if (!resp.ok) {
|
|
109
|
-
let permissionMsg;
|
|
110
|
-
if (resp.status === 403) {
|
|
111
|
-
permissionMsg = await permissionMessage(resp);
|
|
112
|
-
if (!isInvalidCliTokenMessage(permissionMsg)) {
|
|
113
|
-
throw new PermissionError(permissionMsg);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (resp.status === 401 || resp.status === 403 && permissionMsg) {
|
|
117
|
-
logger.warn(`MCP request failed (${resp.status === 403 ? permissionMsg : "HTTP 401"}) for ${hostUrl}, refreshing CLI token`);
|
|
118
|
-
clearCliToken(hostUrl);
|
|
119
|
-
const newToken = await getCliToken(hostUrl);
|
|
120
|
-
logger.info(`CLI token refreshed for ${hostUrl}`);
|
|
121
|
-
process.stderr.write(`[ae-cli] CLI token refreshed for ${hostUrl}
|
|
122
|
-
`);
|
|
123
|
-
Object.assign(headers, buildAuthHeaders(newToken));
|
|
124
|
-
const retryResp = await fetch(url, {
|
|
125
|
-
method: "POST",
|
|
126
|
-
headers,
|
|
127
|
-
body: JSON.stringify(body)
|
|
128
|
-
});
|
|
129
|
-
if (retryResp.status === 403) {
|
|
130
|
-
throw new PermissionError(await permissionMessage(retryResp));
|
|
131
|
-
}
|
|
132
|
-
if (!retryResp.ok) {
|
|
133
|
-
throw new Error(`MCP HTTP error: ${retryResp.status} ${retryResp.statusText}`);
|
|
134
|
-
}
|
|
135
|
-
const retryData = safeJsonParse(await retryResp.text());
|
|
136
|
-
if (retryData.error) {
|
|
137
|
-
throw new Error(`MCP error: ${retryData.error.message || JSON.stringify(retryData.error)}`);
|
|
138
|
-
}
|
|
139
|
-
return retryData.result;
|
|
140
|
-
}
|
|
141
|
-
throw new Error(`MCP HTTP error: ${resp.status} ${resp.statusText}`);
|
|
142
|
-
}
|
|
143
|
-
const data = safeJsonParse(await resp.text());
|
|
144
|
-
if (data.error) {
|
|
145
|
-
throw new Error(`MCP error: ${data.error.message || JSON.stringify(data.error)}`);
|
|
146
|
-
}
|
|
147
|
-
return data.result;
|
|
148
|
-
}
|
|
149
|
-
async function callMcpTool(url, toolName, args = {}, hostOverride) {
|
|
150
|
-
const params = {
|
|
151
|
-
name: toolName,
|
|
152
|
-
arguments: args
|
|
153
|
-
};
|
|
154
|
-
logger.info(`MCP tool call: ${toolName}`);
|
|
155
|
-
const result = await mcpRequest(url, "tools/call", params, hostOverride);
|
|
156
|
-
if (result.isError) {
|
|
157
|
-
logger.warn(`MCP tool call failed: ${toolName}`);
|
|
158
|
-
}
|
|
159
|
-
return {
|
|
160
|
-
content: result.content.map((item) => {
|
|
161
|
-
if (item.type === "text") {
|
|
162
|
-
return { type: "text", text: item.text };
|
|
163
|
-
} else if (item.type === "image") {
|
|
164
|
-
return { type: "image", data: item.data, mimeType: item.mimeType };
|
|
165
|
-
} else {
|
|
166
|
-
return { type: "resource", ...item };
|
|
167
|
-
}
|
|
168
|
-
}),
|
|
169
|
-
isError: result.isError
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
function parseMcpResult(result) {
|
|
173
|
-
if (result.isError) {
|
|
174
|
-
const firstText = result.content.find((item) => item.type === "text")?.text || "";
|
|
175
|
-
let errorMessage = firstText.trim() || "MCP tool call failed";
|
|
176
|
-
try {
|
|
177
|
-
const parsed = safeJsonParse(firstText);
|
|
178
|
-
errorMessage = mcpResultErrorMessage(parsed) || errorMessage;
|
|
179
|
-
} catch {
|
|
180
|
-
}
|
|
181
|
-
throwMcpError(errorMessage);
|
|
182
|
-
}
|
|
183
|
-
if (result.content.length > 0 && result.content[0].type === "text") {
|
|
184
|
-
const text = result.content[0].text || "";
|
|
185
|
-
let parsed;
|
|
186
|
-
try {
|
|
187
|
-
parsed = safeJsonParse(text);
|
|
188
|
-
} catch {
|
|
189
|
-
return text;
|
|
190
|
-
}
|
|
191
|
-
const errMsg = mcpResultErrorMessage(parsed);
|
|
192
|
-
if (errMsg !== null) {
|
|
193
|
-
throwMcpError(errMsg);
|
|
194
|
-
}
|
|
195
|
-
return parsed;
|
|
196
|
-
}
|
|
197
|
-
return result;
|
|
198
|
-
}
|
|
199
|
-
function mcpResultErrorMessage(parsed) {
|
|
200
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
201
|
-
if (parsed.success === true || parsed.ok === true) return null;
|
|
202
|
-
const explicitlyFailed = parsed.success === false || parsed.ok === false;
|
|
203
|
-
const e = parsed.error;
|
|
204
|
-
if (typeof e === "string" && e.trim()) return e;
|
|
205
|
-
if (e && typeof e === "object") {
|
|
206
|
-
const msg = typeof e.message === "string" && e.message || void 0;
|
|
207
|
-
const code = typeof e.code === "string" && e.code || void 0;
|
|
208
|
-
if (msg && code) return `${code}: ${msg}`;
|
|
209
|
-
if (msg || code) return msg || code;
|
|
210
|
-
}
|
|
211
|
-
if (explicitlyFailed) {
|
|
212
|
-
const msg = typeof parsed.message === "string" && parsed.message.trim() ? parsed.message.trim() : void 0;
|
|
213
|
-
const codeValue = parsed.errorCode ?? parsed.error_code ?? parsed.code;
|
|
214
|
-
const code = typeof codeValue === "string" && codeValue.trim() ? codeValue.trim() : void 0;
|
|
215
|
-
if (msg && code) return `${code}: ${msg}`;
|
|
216
|
-
return msg || code || "MCP tool call failed";
|
|
217
|
-
}
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
220
|
-
function throwMcpError(message) {
|
|
221
|
-
if (/no_auth|auth_error|permission|forbidden|unauthor|\u65e0\u6743/i.test(message)) {
|
|
222
|
-
throw new PermissionError(message);
|
|
223
|
-
}
|
|
224
|
-
throw new Error(message);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
export {
|
|
228
|
-
registerMcpMappings,
|
|
229
|
-
resolveMcpUrl,
|
|
230
|
-
callMcpTool,
|
|
231
|
-
parseMcpResult
|
|
232
|
-
};
|