@gt-fe/eap-cli 0.2.5 → 0.2.6

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  这个模板模拟一个真实的前端智能体页面后端:Node.js 进程内嵌 `@gt-fe/eap-sdk`,启动后直接提供 Agent HTTP API。前端只需要知道 Agent code、服务地址和 SSE 事件协议,就可以完成能力发现、会话管理、历史消息、同步调用和流式对话。
4
4
 
5
- SDK 仍然是执行核心,模板里的 HTTP 层只是宿主适配器。它不重新实现 Graph、Tool 路由或 Runtime 事件;流式接口原样转发 Runtime `SSEEvent`。
5
+ SDK 仍然是执行核心,模板里的 HTTP 层只是宿主适配器。它不重新实现 Graph、Tool 路由或 Runtime 事件;流式接口原样转发 Runtime `SSEEvent`。整图超时:图上未写 `config.timeout` 时为 20 分钟。
6
6
 
7
7
  ## 启动
8
8
 
@@ -232,7 +232,7 @@ await resourceService.applyAndReload([ref]);
232
232
 
233
233
  ## RAG 检索模块
234
234
 
235
- `graph.json` 在作答节点之前增加了一个 `type: "rag"` 的检索节点,构成 `__start__ → rag → respond → __end__` 的多源检索编排。rag 节点负责检索决策、降噪判分、多源融合和空结果重写,把结果放进上下文(`[rag]` 消息)供下游 llm 节点作答。
235
+ `graph.json` 在作答节点之前放了一个 `type: "rag"` 节点,路径是 `__start__ → rag → respond → __end__`。这是节点形态示例:未配置 `retrievalSources` 时检索面为空,rag 节点结束后仍由 `respond` 作答。要做多源检索,按下面补 `retrievalSources`(以及会话勾选 `ragSources`)。
236
236
 
237
237
  ### 节点配置
238
238
 
@@ -242,7 +242,7 @@ rag 节点的 config 字段均可省略,各有缺省:
242
242
  | --- | --- | --- |
243
243
  | `model` | `default` | 决策/降噪判分/空结果重写共用的主力模型 |
244
244
  | `totalK` | `10` | 融合降噪后最终进上下文的总条数 |
245
- | `maxIterations` | `5` | ReAct 决策轮硬上限(同轮并发 tool_call 只计 1 轮) |
245
+ | `maxIterations` | `5` | 本节点检索轮次上限(同轮并发 tool_call 只计 1)。到上限该节点结束,后续图节点继续 |
246
246
  | `quota` | — | 融合主辅配额:源桶 → 占比(合计 1) |
247
247
  | `nearDupThreshold` | `0.8` | 近重去重阈值(字符 3-gram Jaccard) |
248
248
  | `retrievalSources.sources` | — | 检索面数据源目录(会话勾选 `ragSources` 在此基础上过滤) |
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.2.5",
2
+ "version": "0.2.6",
3
3
  "localToolDirectories": [
4
4
  "./tools"
5
5
  ],
@@ -5,6 +5,14 @@
5
5
  "response": "string"
6
6
  },
7
7
  "nodes": [
8
+ {
9
+ "id": "rag",
10
+ "type": "rag",
11
+ "config": {
12
+ "model": "DeepSeek-V4-Pro",
13
+ "maxIterations": 5
14
+ }
15
+ },
8
16
  {
9
17
  "id": "respond",
10
18
  "type": "llm",
@@ -16,15 +24,14 @@
16
24
  }
17
25
  ],
18
26
  "edges": [
19
- { "from": "__start__", "to": "respond" },
27
+ { "from": "__start__", "to": "rag" },
28
+ { "from": "rag", "to": "respond" },
20
29
  { "from": "respond", "to": "__end__" }
21
30
  ],
22
- "entryPoint": "respond",
31
+ "entryPoint": "rag",
23
32
  "finishPoints": ["__end__"],
24
33
  "config": {
25
- "maxIterations": 50,
26
34
  "maxRetries": 3,
27
- "timeout": 120000,
28
35
  "checkpointStore": "memory"
29
36
  }
30
37
  }
@@ -14,7 +14,7 @@
14
14
  "type-check": "tsc --noEmit"
15
15
  },
16
16
  "dependencies": {
17
- "@gt-fe/eap-sdk": "^0.2.5",
17
+ "@gt-fe/eap-sdk": "^0.2.6",
18
18
  "dotenv": "^17.2.2",
19
19
  "express": "^4.21.2"
20
20
  },
@@ -2,7 +2,7 @@
2
2
 
3
3
  `split` 两条普通出边同时进入 `branch-report` 与 `branch-task`,再在 `merge` 汇合。本模板按无环图交付。
4
4
 
5
- 并行扇出就是多条普通边。条件分支把这两条出边改成 `conditionalEdges`,一次只走一条。装配 Skill 见 `skills/README.md`。
5
+ 并行扇出就是多条普通边。条件分支把这两条出边改成 `conditionalEdges`,一次只走一条。装配 Skill 见 `skills/README.md`。整图超时:图上未写 `config.timeout` 时为 20 分钟。
6
6
 
7
7
  ## 图结构
8
8
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.2.5",
2
+ "version": "0.2.6",
3
3
  "localToolDirectories": [
4
4
  "./tools"
5
5
  ],
@@ -48,9 +48,7 @@
48
48
  "entryPoint": "split",
49
49
  "finishPoints": ["merge"],
50
50
  "config": {
51
- "maxIterations": 50,
52
51
  "maxRetries": 3,
53
- "timeout": 120000,
54
52
  "checkpointStore": "memory"
55
53
  }
56
54
  }
@@ -103,7 +103,7 @@ eap chat
103
103
  | 提示先执行 `eap login` | 升级 CLI。本地 `eap chat` 不要求登录 |
104
104
  | 启动失败,提示 `no API key resolved` | 把 `eap.config.json` 的 `sk-example-token` 换成有效 Token |
105
105
  | executor 未调用工具 | 确认启动摘要为 `Runtime openai-http · mcp · dev`,且 Key 有效 |
106
- | 执行中途 recursion limit | 图上 `config.maxIterations` 为 50。计划更长时再加大 |
106
+ | 执行中途超时 | 整图超时:请求 `config.timeout`,否则图 `config.timeout`,否则 20 分钟。短任务可在图上写更短 |
107
107
  | 计划写出后图就结束 | 不要把 `planner` 写进 `finishPoints`,保持 `["__end__"]` |
108
108
  | 请求进入 Foundation 模型路由 | `platform.foundationServiceUrl` 设为 `null`,并取消 `FOUNDATION_SERVICE_URL` |
109
109
  | 工具未执行 / `NOT_CONFIGURED` | 清单缺 MCP / HTTP / code handler |
@@ -3,7 +3,9 @@
3
3
  "name": "my-agent",
4
4
  "version": "1.0.0",
5
5
  "description": "先规划,再按计划逐步执行",
6
- "toolRefs": [],
6
+ "toolRefs": [
7
+ { "code": "echo-tool", "version": "1.0.0" }
8
+ ],
7
9
  "skillRefs": [],
8
10
  "prompts": {
9
11
  "system": "先规划,再按计划逐步执行。用中文回答。"
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.2.5",
2
+ "version": "0.2.6",
3
3
  "localToolDirectories": [
4
4
  "./tools"
5
5
  ],
@@ -1,5 +1,9 @@
1
1
  lockfileVersion: 2
2
2
  resources:
3
- tools: []
3
+ tools:
4
+ - code: echo-tool
5
+ version: 1.0.0
6
+ source: local
7
+ path: tools/echo-tool
4
8
  skills: []
5
9
  subagents: []
@@ -45,9 +45,7 @@
45
45
  "entryPoint": "planner",
46
46
  "finishPoints": ["__end__"],
47
47
  "config": {
48
- "maxIterations": 50,
49
48
  "maxRetries": 3,
50
- "timeout": 120000,
51
49
  "checkpointStore": "memory"
52
50
  }
53
51
  }
@@ -24,6 +24,8 @@ flowchart LR
24
24
 
25
25
  **不适用**:模型按需选择工具。此类场景使用「单智能体与工具」模板。
26
26
 
27
+ 整图超时:图上未写 `config.timeout` 时为 20 分钟。短任务可在图上写更短。
28
+
27
29
  ## 1. 配置
28
30
 
29
31
  本地 `eap chat` 不要求 `eap login`。`runtime.llm` 会设置 `EAP_LLM_MODE=local`,用 `eap.config.json` 里的网关和 Token,不走 Foundation 模型路由。`platform.foundationServiceUrl` 默认是测试环境地址,给登录/发布用;纯本地可改为 `null`。
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.2.5",
2
+ "version": "0.2.6",
3
3
  "localToolDirectories": [
4
4
  "./tools"
5
5
  ],
@@ -27,9 +27,7 @@
27
27
  "entryPoint": "normalize",
28
28
  "finishPoints": ["respond"],
29
29
  "config": {
30
- "maxIterations": 50,
31
30
  "maxRetries": 3,
32
- "timeout": 120000,
33
31
  "checkpointStore": "memory"
34
32
  }
35
33
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  单 LLM 经 ReAct 循环调用已装配工具。`shouldContinue` 返回 `call_tools` 时进入 `tools` 节点,执行后回到 `agent`。
4
4
 
5
- 工具由 `toolRefs` 加载,经模型 API 的 `tools` 参数下发。平台默认另有 `read_file` / `write_file` / `execute_command`(不写进清单)。
5
+ 工具由 `toolRefs` 加载,经模型 API 的 `tools` 参数下发。平台默认另有 `read_file` / `write_file` / `execute_command`(不写进清单)。整图超时:图上未写 `config.timeout` 时为 20 分钟。
6
6
 
7
7
  预期:Agent 决定进入某个已装配 Skill,按该 Skill 的 workflow 执行后再回到推理。`shouldContinue` 的 `call_tools` 只能进入 `type: tool`,不能进入 subgraph。当前默认图:已装配 Skill 的名称与 SKILL.md 路径注入模型。详见 `skills/README.md`。
8
8
 
@@ -3,7 +3,10 @@
3
3
  "name": "my-agent",
4
4
  "version": "1.0.0",
5
5
  "description": "单智能体 ReAct 循环,按需调用本地工具",
6
- "toolRefs": [],
6
+ "toolRefs": [
7
+ { "code": "echo-tool", "version": "1.0.0" },
8
+ { "code": "http-weather", "version": "1.0.0" }
9
+ ],
7
10
  "skillRefs": [],
8
11
  "prompts": {
9
12
  "system": "你是助手。用中文回答。需要时调用已提供的工具,不要调用未提供的工具。"
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.2.5",
2
+ "version": "0.2.6",
3
3
  "localToolDirectories": [
4
4
  "./tools"
5
5
  ],
@@ -1,5 +1,13 @@
1
1
  lockfileVersion: 2
2
2
  resources:
3
- tools: []
3
+ tools:
4
+ - code: echo-tool
5
+ version: 1.0.0
6
+ source: local
7
+ path: tools/echo-tool
8
+ - code: http-weather
9
+ version: 1.0.0
10
+ source: local
11
+ path: tools/http-weather
4
12
  skills: []
5
13
  subagents: []
@@ -38,9 +38,7 @@
38
38
  "entryPoint": "agent",
39
39
  "finishPoints": ["__end__"],
40
40
  "config": {
41
- "maxIterations": 50,
42
41
  "maxRetries": 3,
43
- "timeout": 120000,
44
42
  "checkpointStore": "memory"
45
43
  }
46
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gt-fe/eap-cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "EAP CLI 工具 — Agent 项目创建、开发、测试、发布",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,7 @@
12
12
  "dist"
13
13
  ],
14
14
  "dependencies": {
15
- "@gt-fe/eap-contracts": "0.0.13",
15
+ "@gt-fe/eap-contracts": "0.0.14",
16
16
  "@inkjs/ui": "^2.0.0",
17
17
  "chalk": "^5.3.0",
18
18
  "commander": "^12.0.0",
@@ -23,7 +23,7 @@
23
23
  "react": "^18.3.1",
24
24
  "react-markdown": "^9.0.1",
25
25
  "remark-gfm": "^4.0.0",
26
- "@gt-fe/eap-sdk": "0.2.5"
26
+ "@gt-fe/eap-sdk": "0.2.6"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "^20.0.0",