@thinkingai/ae-cli 1.0.22 → 1.0.27

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 (56) hide show
  1. package/README.md +39 -1
  2. package/README.zh.md +40 -1
  3. package/dist/{auth-YM7OI23X.js → auth-TXFJHPXU.js} +3 -2
  4. package/dist/{auth-5S7SPPEJ.js → auth-W2JZ3DKA.js} +11 -4
  5. package/dist/{chunk-MPFTXJFG.js → chunk-2NGWYMLB.js} +14 -2
  6. package/dist/chunk-6T7245YE.js +478 -0
  7. package/dist/{chunk-KM57HI5B.js → chunk-B4UL2VIJ.js} +7 -1
  8. package/dist/{chunk-TMMUBSKW.js → chunk-BI5ZVD6T.js} +8 -1
  9. package/dist/chunk-MNHE6SSI.js +79 -0
  10. package/dist/chunk-MWWYGZ76.js +130 -0
  11. package/dist/{chunk-24ZKQWG2.js → chunk-SRRUNQIM.js} +51 -4
  12. package/dist/chunk-TG64AQV4.js +262 -0
  13. package/dist/{chunk-NBFTPIAH.js → chunk-VT6VC4PA.js} +15 -4
  14. package/dist/{client-7S23DVHH.js → client-IU2E5IOL.js} +6 -3
  15. package/dist/{config-RVUESJRF.js → config-WH3R3IRY.js} +3 -2
  16. package/dist/index.js +195 -20
  17. package/dist/model-CC7U5XOJ.js +131 -0
  18. package/dist/{raw-5SYAUCJQ.js → raw-TUHZQ4UB.js} +5 -4
  19. package/dist/sync-EVEDS7YE.js +383 -0
  20. package/dist/te-agent-FLTDYV3L.js +522 -0
  21. package/dist/{te-analysis-RQST6AT3.js → te-analysis-CMXADIJM.js} +101 -12
  22. package/dist/{te-audience-TJ74UJI3.js → te-audience-LPZFFSXM.js} +4 -3
  23. package/dist/{te-common-W5URM2SH.js → te-common-BXQFKTB3.js} +4 -3
  24. package/dist/{te-community-YRV2VAD4.js → te-community-K5S3VOZY.js} +4 -3
  25. package/dist/{te-dataops-ZPH72BCK.js → te-dataops-567IMCQG.js} +4 -3
  26. package/dist/{te-engage-57UKFV74.js → te-engage-TBUTGW5F.js} +105 -49
  27. package/dist/{te-kb-GD7SJRYB.js → te-kb-XHVBWP5E.js} +227 -38
  28. package/dist/{te-meta-25SLZFXJ.js → te-meta-NQ4U3VJW.js} +25 -4
  29. package/dist/te-team-556APRIU.js +529 -0
  30. package/package.json +6 -1
  31. package/skills/ae-agent/SKILL.md +133 -0
  32. package/skills/ae-analysis/references/create_entity.md +39 -0
  33. package/skills/ae-analysis/references/create_space.md +34 -0
  34. package/skills/ae-analysis/references/drilldown_user_events.md +1 -1
  35. package/skills/ae-analysis/references/drilldown_users.md +2 -2
  36. package/skills/ae-analysis/references/query_adhoc.md +3 -2
  37. package/skills/ae-analysis/references/query_entity_details.md +1 -1
  38. package/skills/ae-engage/SKILL.md +25 -2
  39. package/skills/ae-engage/references/build-task-save-guide.md +283 -0
  40. package/skills/ae-engage/references/save-task.md +304 -0
  41. package/skills/ae-kb/SKILL.md +283 -0
  42. package/skills/ae-team/SKILL.md +164 -0
  43. package/skills/ae-team/references/ai-generate.md +39 -0
  44. package/skills/ae-team/references/create.md +94 -0
  45. package/skills/ae-team/references/delete.md +39 -0
  46. package/skills/ae-team/references/list-projects.md +45 -0
  47. package/skills/ae-team/references/list-templates.md +38 -0
  48. package/skills/ae-team/references/list.md +39 -0
  49. package/skills/ae-team/references/run-artifacts.md +51 -0
  50. package/skills/ae-team/references/run-cancel.md +38 -0
  51. package/skills/ae-team/references/run-chat.md +57 -0
  52. package/skills/ae-team/references/run-reply.md +41 -0
  53. package/skills/ae-team/references/run-result.md +75 -0
  54. package/skills/ae-team/references/run-start.md +73 -0
  55. package/skills/ae-team/references/run-watch.md +82 -0
  56. package/skills/ae-team/references/update.md +47 -0
package/README.md CHANGED
@@ -60,6 +60,21 @@ ae-cli analysis_meta +list_events --project_id 1 --format table
60
60
 
61
61
  # Raw API call
62
62
  ae-cli api GET /v1/ta/event/catalog/listEvent --params '{"projectId": 1}'
63
+
64
+ # Knowledge base (create → upload → compile → query)
65
+ ae-cli kb +new --scope company --name engineering-handbook --description "Team docs"
66
+ ae-cli kb +add --name engineering-handbook --files '["./docs/guide.md","https://example.com/page"]'
67
+ ae-cli kb +schema --name engineering-handbook
68
+ ae-cli kb +compile --name engineering-handbook
69
+ ae-cli kb +query -q "How to configure sandbox?" \
70
+ --sources '[{"scope":"company","name":"engineering-handbook"}]'
71
+
72
+ # Retrieval primitives for external agents (read index → grep → read page)
73
+ ae-cli kb +index --sources '[{"scope":"company","name":"engineering-handbook"}]'
74
+ ae-cli kb +grep -q "sandbox config" \
75
+ --sources '[{"scope":"company","name":"engineering-handbook"}]'
76
+ ae-cli kb +read --source '{"scope":"company","name":"engineering-handbook"}' \
77
+ --path "wiki/sandbox.md"
63
78
  ```
64
79
 
65
80
  ## Authentication
@@ -97,8 +112,29 @@ ae-cli auth logout
97
112
  | `dataops_integration` | 20+ | Data integration: datasource management, sync solutions, data synchronization |
98
113
  | `community` | 10+ | Community analysis: posts search, sentiment analysis, topic trends, livestream data |
99
114
  | `analysis_common` | 2 | Cross-module common constraints: resource link completion, project ID gate |
115
+ | `team` | 14 | AI Agent Team: manage teams (list/create/update/delete/ai-generate/templates/projects) and execute TeamRuns (start/watch/chat/reply/cancel/result/artifacts) |
116
+ | `kb` | 10 | Knowledge base lifecycle: query / new / add (md/dir/url) / schema / compile / rm-source / remove; retrieval primitives: index / grep / read |
100
117
  | `auth` / `config` | 2 | Authentication and host configuration |
101
118
 
119
+ ### kb
120
+
121
+ Knowledge base lifecycle (`+new` → `+add` → `+schema` → `+compile` → `+status` → `+query`):
122
+
123
+ - **Create** (`+new`): `--scope personal|company`, `--name`, optional `--description`, `--tags`, `--project-id`, `--project-name`
124
+ - **Upload** (`+add`): `--name`, `--files` JSON array (`.md` file, directory non-recursive scan, or http(s) URL with HTML-to-Markdown conversion)
125
+ - **Schema** (`+schema`): `--name`, optional `--force`, `--model`
126
+ - **Compile** (`+compile`): `--name`, `--mode incremental|full` (default: incremental)
127
+ - **Status** (`+status`): `--name`
128
+ - **Query** (`+query`): `--query` / `-q`, `--sources` JSON refs e.g. `[{"scope":"company","name":"engineering-handbook"}]`
129
+ - **Remove source** (`+rm-source`): `--name`, `--display-name`
130
+ - **Remove KB** (`+remove`): `--name`
131
+
132
+ Retrieval primitives for external agents (`+index` → `+grep` → `+read`); these are deterministic file-search endpoints with no server-side LLM, designed for agents (Claude Code / Codex / Cursor) to explore a KB the way they explore a codebase:
133
+
134
+ - **Index** (`+index`): optional `--sources` JSON refs (omit to list all accessible KBs), optional `--locale`. Returns each KB's metadata plus its `index.md` navigation map.
135
+ - **Grep** (`+grep`): `--query` / `-q`, optional `--sources`, `--top-k` (1-50, default 10), `--locale`. Returns matched lines with path, line number, breadcrumb and context snippet.
136
+ - **Read** (`+read`): `--source` JSON ref (exactly one KB), `--path` (page path relative to the KB root), optional `--offset` / `--limit` (line window), `--locale`. Returns the full page or a line window.
137
+
102
138
  ### Global Options
103
139
 
104
140
  | Option | Description | Default |
@@ -108,6 +144,7 @@ ae-cli auth logout
108
144
  | `--jq <expr>` | Filter expression | - |
109
145
  | `--dry-run` | Preview request | false |
110
146
  | `--yes` | Skip confirmation | false |
147
+ | `--no-update-check` | Skip checking for newer ae-cli versions | false |
111
148
 
112
149
  ## Skills
113
150
 
@@ -185,7 +222,8 @@ src/
185
222
  ├── te-engage/
186
223
  ├── te-dataops/
187
224
  ├── te-community/
188
- └── te-common/
225
+ ├── te-common/
226
+ └── te-kb/
189
227
  ```
190
228
 
191
229
  ## Verification Scripts
package/README.zh.md CHANGED
@@ -60,6 +60,21 @@ ae-cli analysis_meta +list_events --project_id 1 --format table
60
60
 
61
61
  # 原始 API 调用
62
62
  ae-cli api GET /v1/ta/event/catalog/listEvent --params '{"projectId": 1}'
63
+
64
+ # 知识库(新建 → 上传 → 编译 → 查询)
65
+ ae-cli kb +new --scope company --name engineering-handbook --description "Team docs"
66
+ ae-cli kb +add --name engineering-handbook --files '["./docs/guide.md","https://example.com/page"]'
67
+ ae-cli kb +schema --name engineering-handbook
68
+ ae-cli kb +compile --name engineering-handbook
69
+ ae-cli kb +query -q "如何配置 sandbox 容器?" \
70
+ --sources '[{"scope":"company","name":"engineering-handbook"}]'
71
+
72
+ # 面向外部 agent 的检索原语(读 index → grep 定位 → read 翻页)
73
+ ae-cli kb +index --sources '[{"scope":"company","name":"engineering-handbook"}]'
74
+ ae-cli kb +grep -q "sandbox 配置" \
75
+ --sources '[{"scope":"company","name":"engineering-handbook"}]'
76
+ ae-cli kb +read --source '{"scope":"company","name":"engineering-handbook"}' \
77
+ --path "wiki/sandbox.md"
63
78
  ```
64
79
 
65
80
  ## 身份验证
@@ -97,8 +112,30 @@ ae-cli auth logout
97
112
  | `dataops_integration` | 20+ | 数据集成:数据源管理、同步方案、数据同步 |
98
113
  | `community` | 10+ | 社区分析:帖子搜索、情感分析、话题趋势、直播数据 |
99
114
  | `analysis_common` | 2 | 跨模块通用约束:资源链接补全、项目 ID 门控 |
115
+ | `agent` | 15 | Agent 平台资源管理:模型、MCP 服务、Skill、附件库的增删查和启停 |
116
+ | `team` | 14 | AI Agent Team:团队管理(列表/创建/更新/删除/AI生成/模板/项目)和 TeamRun 执行(启动/监听/对话/回复/取消/结果/产物) |
117
+ | `kb` | 10 | 知识库生命周期:查询 / 新建 / 添加源(md/目录/url)/ schema / 编译 / 删除源 / 删除;检索原语:index / grep / read |
100
118
  | `auth` / `config` | 2 | 身份验证和主机配置 |
101
119
 
120
+ ### kb(知识库)
121
+
122
+ 知识库生命周期(`+new` → `+add` → `+schema` → `+compile` → `+status` → `+query`):
123
+
124
+ - **新建** (`+new`):`--scope personal|company`,`--name`,可选 `--description`、`--tags`、`--project-id`、`--project-name`
125
+ - **上传源** (`+add`):`--name`,`--files` JSON 数组(`.md` 文件、目录非递归扫描、或 http(s) URL 自动转 Markdown)
126
+ - **生成 schema** (`+schema`):`--name`,可选 `--force`、`--model`
127
+ - **编译** (`+compile`):`--name`,`--mode incremental|full`(默认 incremental)
128
+ - **查询状态** (`+status`):`--name`
129
+ - **查询** (`+query`):`--query` / `-q`,`--sources` JSON 引用,如 `[{"scope":"company","name":"engineering-handbook"}]`
130
+ - **删除源** (`+rm-source`):`--name`,`--display-name`
131
+ - **删除知识库** (`+remove`):`--name`
132
+
133
+ 面向外部 agent 的检索原语(`+index` → `+grep` → `+read`);均为确定性文件检索端点、服务端零 LLM 调用,让 agent(Claude Code / Codex / Cursor)像翻代码库一样探索知识库:
134
+
135
+ - **索引** (`+index`):可选 `--sources` JSON 引用(省略则列出全部可访问知识库),可选 `--locale`。返回每个知识库的元信息及其 `index.md` 导航地图。
136
+ - **检索** (`+grep`):`--query` / `-q`,可选 `--sources`、`--top-k`(1-50,默认 10)、`--locale`。返回命中行的路径、行号、面包屑与上下文片段。
137
+ - **读取** (`+read`):`--source` JSON 引用(精确指向一个知识库),`--path`(相对知识库根目录的页面路径),可选 `--offset` / `--limit`(行窗口)、`--locale`。返回页面全文或行窗口。
138
+
102
139
  ### 全局选项
103
140
 
104
141
  | 选项 | 描述 | 默认值 |
@@ -108,6 +145,7 @@ ae-cli auth logout
108
145
  | `--jq <expr>` | 过滤表达式 | - |
109
146
  | `--dry-run` | 预览请求 | false |
110
147
  | `--yes` | 跳过确认 | false |
148
+ | `--no-update-check` | 跳过 ae-cli 新版本检查 | false |
111
149
 
112
150
  ## Skills
113
151
 
@@ -185,7 +223,8 @@ src/
185
223
  ├── te-engage/
186
224
  ├── te-dataops/
187
225
  ├── te-community/
188
- └── te-common/
226
+ ├── te-common/
227
+ └── te-kb/
189
228
  ```
190
229
 
191
230
  ## 验证脚本
@@ -7,8 +7,9 @@ import {
7
7
  saveToken,
8
8
  setTokenManual,
9
9
  validateToken
10
- } from "./chunk-24ZKQWG2.js";
11
- import "./chunk-TMMUBSKW.js";
10
+ } from "./chunk-SRRUNQIM.js";
11
+ import "./chunk-BI5ZVD6T.js";
12
+ import "./chunk-MNHE6SSI.js";
12
13
  export {
13
14
  clearToken,
14
15
  getAuthStatus,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  printError,
3
3
  printOutput
4
- } from "./chunk-KM57HI5B.js";
4
+ } from "./chunk-B4UL2VIJ.js";
5
5
  import {
6
6
  clearMcpToken,
7
7
  loadMcpTokenStore,
8
8
  setMcpTokenManual,
9
9
  validateMcpToken
10
- } from "./chunk-MPFTXJFG.js";
10
+ } from "./chunk-2NGWYMLB.js";
11
11
  import {
12
12
  clearToken,
13
13
  getAuthStatus,
@@ -15,11 +15,14 @@ import {
15
15
  resolveHost,
16
16
  setTokenManual,
17
17
  validateToken
18
- } from "./chunk-24ZKQWG2.js";
18
+ } from "./chunk-SRRUNQIM.js";
19
19
  import {
20
20
  loadConfig,
21
21
  saveConfig
22
- } from "./chunk-TMMUBSKW.js";
22
+ } from "./chunk-BI5ZVD6T.js";
23
+ import {
24
+ logger
25
+ } from "./chunk-MNHE6SSI.js";
23
26
 
24
27
  // src/commands/auth.ts
25
28
  function registerAuth(program) {
@@ -37,11 +40,13 @@ function registerAuth(program) {
37
40
  config.activeHost = host;
38
41
  }
39
42
  saveConfig(config);
43
+ logger.info(`Host config auto-saved for ${host}`);
40
44
  process.stderr.write(`[ae-cli] Config saved for ${host}
41
45
  `);
42
46
  }
43
47
  try {
44
48
  const token = await getToken(host);
49
+ logger.info(`Auth login successful for ${host}`);
45
50
  process.stderr.write(`[ae-cli] Authenticated to ${host}
46
51
  `);
47
52
  printOutput({ authenticated: true, host, token: token.slice(0, 8) + "..." }, program.opts().format || "json");
@@ -71,12 +76,14 @@ function registerAuth(program) {
71
76
  `);
72
77
  const isValid = await validateToken(token, host);
73
78
  if (!isValid) {
79
+ logger.warn(`Token validation failed for ${host}`);
74
80
  process.stderr.write(`[ae-cli] Token validation failed
75
81
  `);
76
82
  printError("auth", "Invalid token", "Please check your token and try again");
77
83
  process.exit(1);
78
84
  }
79
85
  setTokenManual(token, host);
86
+ logger.info(`Token manually set and validated for ${host}`);
80
87
  process.stderr.write(`[ae-cli] Token verified and saved for ${host}
81
88
  `);
82
89
  printOutput({ saved: true, host, verified: true }, program.opts().format || "json");
@@ -1,13 +1,16 @@
1
1
  import {
2
2
  getToken
3
- } from "./chunk-24ZKQWG2.js";
3
+ } from "./chunk-SRRUNQIM.js";
4
4
  import {
5
5
  forceMigrateFromFallback,
6
6
  getActiveHost,
7
7
  getConfigDir,
8
8
  safeJsonParse,
9
9
  safeReadJsonFile
10
- } from "./chunk-TMMUBSKW.js";
10
+ } from "./chunk-BI5ZVD6T.js";
11
+ import {
12
+ logger
13
+ } from "./chunk-MNHE6SSI.js";
11
14
 
12
15
  // src/core/mcp.ts
13
16
  import fs from "fs";
@@ -98,9 +101,11 @@ async function getMcpToken(hostOverride) {
98
101
  if (store[hostUrl]) {
99
102
  return store[hostUrl];
100
103
  }
104
+ logger.info(`Generating MCP token for ${hostUrl}`);
101
105
  const mcpToken = await generateMcpToken(hostUrl);
102
106
  const updatedStore = { ...store, [hostUrl]: mcpToken };
103
107
  saveMcpTokenStore(updatedStore);
108
+ logger.info(`MCP token generated and cached for ${hostUrl}`);
104
109
  return mcpToken;
105
110
  }
106
111
  function clearMcpToken(hostUrl) {
@@ -118,6 +123,7 @@ function setMcpTokenManual(token, hostUrl) {
118
123
  const store = loadMcpTokenStore();
119
124
  store[hostUrl] = token;
120
125
  saveMcpTokenStore(store);
126
+ logger.info(`MCP token manually set for ${hostUrl}`);
121
127
  }
122
128
  async function validateMcpToken(token, hostUrl) {
123
129
  const mapping = getMcpMapping("analysis");
@@ -180,8 +186,10 @@ async function mcpRequest(url, method, params = {}, hostOverride) {
180
186
  body: JSON.stringify(body)
181
187
  });
182
188
  if (!resp.ok) {
189
+ logger.warn(`MCP request failed (HTTP ${resp.status}) for ${hostUrl}, trying fallback`);
183
190
  const migrated = forceMigrateFromFallback();
184
191
  if (migrated && migrated[hostUrl]) {
192
+ logger.info(`MCP token refreshed from fallback for ${hostUrl}`);
185
193
  process.stderr.write(`[ae-cli] MCP token refreshed from fallback for ${hostUrl}
186
194
  `);
187
195
  headers["mcp-token"] = migrated[hostUrl];
@@ -212,7 +220,11 @@ async function callMcpTool(url, toolName, args = {}, hostOverride) {
212
220
  name: toolName,
213
221
  arguments: args
214
222
  };
223
+ logger.info(`MCP tool call: ${toolName}`);
215
224
  const result = await mcpRequest(url, "tools/call", params, hostOverride);
225
+ if (result.isError) {
226
+ logger.warn(`MCP tool call failed: ${toolName}`);
227
+ }
216
228
  return {
217
229
  content: result.content.map((item) => {
218
230
  if (item.type === "text") {