@ai-zen/agents-sdk 1.0.0-alpha.1 → 1.0.0-alpha.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.0-alpha.3] - 2026-10-03
4
+
5
+ ### 🔧 Fixed
6
+
7
+ - **`generateImage` `model` parameter description no longer points at a host-CLI command** — the description used to read "配置中的图片模型可通过 'aiz config show' 查看" (the configured image models can be viewed via `aiz config show`). Since tool descriptions ship inside every request's `tools` payload, that hint propagated into **every layer** of the agent stack: the model would `exec("aiz config show")`, but the CLI resolves a bare `aiz config show` invocation as stdio mode with the instruction `config show` — i.e. a **brand-new agent** — whose own `generateImage` description repeats the very same hint, producing a self-referential recursion that keeps spawning nested agents. The parameter now reads "若指定的模型不存在,本工具会返回当前可用的模型列表" (if the specified model does not exist, this tool returns the list of currently available models), which matches the actual `!imageModel` branch in `call()` and stops the model from shelling out to the host CLI.
8
+
9
+ ### 📄 Docs
10
+
11
+ - Current-version references in `docs/zh` and `docs/en` updated to `1.0.0-alpha.3`.
12
+
13
+ ## [1.0.0-alpha.2] - 2026-10-03
14
+
15
+ ### 🚀 New Features
16
+
17
+ - **`chrome-devtools` added to the factory default MCP config** — `DEFAULT_MCP_CONFIG` now ships two servers instead of one: alongside `socket-pty`, a freshly released `~/.ai-zen/mcp.json` includes `chrome-devtools` (`npx -y chrome-devtools-mcp@latest`, Google's official `chrome-devtools-mcp`), so browser debugging and automation work out of the box — page navigation, performance traces, network and console inspection, screenshots. Existing `mcp.json` files are still never overwritten, so user configurations (including custom flags such as `--executablePath`) are untouched. Defined in `packages/sdk/src/config/constants.ts`, released by `ConfigManager.ensureDefaultMcpConfig()`.
18
+
19
+ ### ✅ Tests
20
+
21
+ - `ConfigManager.bootstrap.test.ts` now asserts the factory-default `mcp.json` carries both `socket-pty` and `chrome-devtools` (the latter resolved from the `chrome-devtools-mcp` package via `npx`), covering both the `bootstrap()` and `ensureDefaultMcpConfig()` paths.
22
+
23
+ ### 📄 Docs
24
+
25
+ - Factory-default MCP descriptions in `docs/zh/mcp.md` / `docs/en/mcp.md` and `docs/zh/sdk.md` / `docs/en/sdk.md` now list both `socket-pty` and `chrome-devtools`.
26
+ - Current-version references in `docs/zh` and `docs/en` updated to `1.0.0-alpha.2`.
27
+
3
28
  ## [1.0.0-alpha.1] - 2026-10-03
4
29
 
5
30
  ### 💥 Breaking Changes
@@ -55,7 +55,7 @@ export declare class ConfigManager {
55
55
  /** mcp.json 路径:{basePath}/mcp.json */
56
56
  get mcpPath(): string;
57
57
  /**
58
- * 确保 basePath/mcp.json 存在。不存在时写入出厂默认 MCP 配置(含 socket-pty)。
58
+ * 确保 basePath/mcp.json 存在。不存在时写入出厂默认 MCP 配置(含 socket-pty 与 chrome-devtools)。
59
59
  * 已有文件不被覆盖,尊重用户已配置的 MCP 服务器。
60
60
  * @returns 返回当前生效的 MCP 配置原始内容
61
61
  */
@@ -188,7 +188,7 @@ export class ConfigManager {
188
188
  return join(this.basePath, "mcp.json");
189
189
  }
190
190
  /**
191
- * 确保 basePath/mcp.json 存在。不存在时写入出厂默认 MCP 配置(含 socket-pty)。
191
+ * 确保 basePath/mcp.json 存在。不存在时写入出厂默认 MCP 配置(含 socket-pty 与 chrome-devtools)。
192
192
  * 已有文件不被覆盖,尊重用户已配置的 MCP 服务器。
193
193
  * @returns 返回当前生效的 MCP 配置原始内容
194
194
  */
@@ -11,7 +11,9 @@ export declare const DEFAULT_SUBAGENT_DEFINITION: Omit<AgentDefinition, "created
11
11
  export declare const DEFAULT_APP_CONFIG: AppConfig;
12
12
  /**
13
13
  * SDK 出厂默认 MCP 服务器配置(mcp.json 内容,业界标准格式)。
14
- * 首次初始化时释放到 ~/.ai-zen/mcp.json,让用户开箱即用 socket-pty 终端能力。
14
+ * 首次初始化时释放到 ~/.ai-zen/mcp.json,让用户开箱即用:
15
+ * - socket-pty 伪终端(pty)能力
16
+ * - chrome-devtools Chrome DevTools 浏览器调试/自动化能力(Google 官方 chrome-devtools-mcp)
15
17
  *
16
18
  * 若文件已存在则不覆盖(尊重用户已有配置)。
17
19
  */
@@ -214,11 +214,13 @@ export const DEFAULT_APP_CONFIG = {
214
214
  maxToolOutput: 32_768,
215
215
  };
216
216
  // ---------------------------------------------------------------------------
217
- // 默认 MCP 配置(socket-pty 终端 MCP)
217
+ // 默认 MCP 配置(socket-pty 终端 MCP + chrome-devtools 浏览器调试 MCP)
218
218
  // ---------------------------------------------------------------------------
219
219
  /**
220
220
  * SDK 出厂默认 MCP 服务器配置(mcp.json 内容,业界标准格式)。
221
- * 首次初始化时释放到 ~/.ai-zen/mcp.json,让用户开箱即用 socket-pty 终端能力。
221
+ * 首次初始化时释放到 ~/.ai-zen/mcp.json,让用户开箱即用:
222
+ * - socket-pty 伪终端(pty)能力
223
+ * - chrome-devtools Chrome DevTools 浏览器调试/自动化能力(Google 官方 chrome-devtools-mcp)
222
224
  *
223
225
  * 若文件已存在则不覆盖(尊重用户已有配置)。
224
226
  */
@@ -230,6 +232,12 @@ export const DEFAULT_MCP_CONFIG = {
230
232
  args: ["-y", "@ai-zen/socket-pty", "mcp"],
231
233
  description: "可托管的伪终端(pty):spawn/read/wait/write/resize/status/kill",
232
234
  },
235
+ "chrome-devtools": {
236
+ type: "stdio",
237
+ command: "npx",
238
+ args: ["-y", "chrome-devtools-mcp@latest"],
239
+ description: "Chrome DevTools 浏览器调试与自动化(Google chrome-devtools-mcp):页面导航、性能追踪、网络与控制台检查、截图等",
240
+ },
233
241
  },
234
242
  };
235
243
  // ---------------------------------------------------------------------------
@@ -25,7 +25,7 @@ export class GenerateImageTool extends SdkCallbackTool {
25
25
  },
26
26
  model: {
27
27
  type: "string",
28
- description: "图片模型 ID,不指定则使用配置中的默认图片模型。配置中的图片模型可通过 'aiz config show' 查看。",
28
+ description: "图片模型 ID,不指定则使用配置中的默认图片模型;若指定的模型不存在,本工具会返回当前可用的模型列表。",
29
29
  },
30
30
  size: {
31
31
  type: "string",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-zen/agents-sdk",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.3",
4
4
  "description": "AI-Zen Agents SDK — shared business logic for CLI and Desktop",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",