page-agent-sdk 3.42.0 → 3.43.1
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 +5 -6
- package/README.zh-CN.md +5 -6
- package/dist/page-agent-sdk.headless.js +1827 -1836
- package/dist/page-agent-sdk.iife.js +99 -99
- package/dist/page-agent-sdk.js +1153 -1162
- package/dist/page-agent-sdk.legacy.js +13888 -13891
- package/dist/page-agent-sdk.umd.cjs +61 -61
- package/package.json +1 -1
- package/types/headless.d.ts +4 -14
- package/types/index.d.ts +4 -14
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/page-agent-sdk)
|
|
10
10
|
[](https://github.com/whyymj/page-agent-sdk/blob/master/LICENSE)
|
|
11
|
-
[](#self-tests)
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -253,12 +253,11 @@ ChatDialog, MessageContent, CodePreview, SkillPanel, DebugDrawer, useChat
|
|
|
253
253
|
| | `summaryLlm` | `BaseChatModel \| LLMConfig` | Summary-dedicated LLM (defaults to main `llm`) |
|
|
254
254
|
| | `maxMemoryRounds` | `number` · default `30` | Dialog history memory round cap (`0` disables trim) |
|
|
255
255
|
| | `staleReadInvalidation` | `boolean` · default `true` | 3.42+ write-driven stale read invalidation: within one invoke's ReAct window, old `read`/`query_data`/`search_data` results hit by a later successful write are replaced with an invalidation placeholder (keeps the model from answering state from stale snapshots; anti-thrash copy references the write's own new value/hash). `false` = off for main + subagent stacks |
|
|
256
|
-
| | `vfs` | `{initialFiles?,maxBytes?,poolBytes
|
|
257
|
-
| | `data.tools` | `'high' \| string[]` | 3.41+ assembly-time dataOps tool whitelist. `'high'` drops the legacy quartet (`get/set/edit/delete_data` — superseded by `read`/`write`); an explicit name array filters exactly; opt-in families (draft/resource) always preserved when assembled
|
|
256
|
+
| | `vfs` | `{initialFiles?,maxBytes?,poolBytes?}` · default 4MB | In-memory workspace cap (LRU evict on overflow) |
|
|
258
257
|
| **Persistence** | `storage` | `'indexed' \| 'session' \| 'local' \| 'memory' \| config \| false` · default off | Assign to enable; multi-agent isolated by `id` |
|
|
259
258
|
| | `session` | `{id?,autoResume?,title?}` | Session control |
|
|
260
259
|
| | `shareContext` | `boolean` · default `false` | Same `id` instances share one agent |
|
|
261
|
-
| **Robustness/other** | `maxRetries` / `maxParallelTools` / `maxToolRounds` | `number` · 2 / 1 /
|
|
260
|
+
| **Robustness/other** | `maxRetries` / `maxParallelTools` / `maxToolRounds` | `number` · 2 / 1 / 30 | Model retries / per-round tool concurrency (>1 enables same-round parallel delegation with failure isolation + per-component mutex locks) / max rounds |
|
|
262
261
|
| | `roundTokenBudget` | `number` · default `0` (off) | Per-invocation cumulative token cap (3.11+; exceed → friendly wrap-up, partial work preserved; orthogonal to automation's `tokenBudget`, no automation capability needed) |
|
|
263
262
|
| | `mcp` | `McpServerConfig[]` | Remote MCP servers (http/sse/websocket) |
|
|
264
263
|
| | `middleware` | `Middleware[]` | Custom middleware (appended to built-in stack) |
|
|
@@ -496,8 +495,8 @@ function switchTo(i: number) {
|
|
|
496
495
|
## Self-tests
|
|
497
496
|
|
|
498
497
|
```bash
|
|
499
|
-
npm test #
|
|
500
|
-
npm run test:e2e #
|
|
498
|
+
npm test # 2810 assertions (tsx, source-level; no LLM dependency)
|
|
499
|
+
npm run test:e2e # 929 integration assertions (node, built dist; covers APIs/options/modules/simple&complex scenes: default systemPrompt(capability overview) / dynamic register + inspect sync / inspect(tools/middleware/subagent/verify/mcp/todos/lastCompression/checkpoints reflect config) / custom tools/middleware/skills/memory injection / runtime dynamic reconfiguration(setTools/addTool/removeTool/setLlm/setMemory/setSubagents reflect) / switchSession(on/off) / shareContext on/off sharing/independent / storage backends + object config / presets(3) / checkpoint / exports complete(39+ fns/components) / util fns usable(isQuotaError/estimateTokens/jpEval/searchJson) / source=builtin / mount boundary / hook multi-listener / llm config / hide/show / error scenes)
|
|
501
500
|
```
|
|
502
501
|
|
|
503
502
|
## Local npm package test
|
package/README.zh-CN.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/page-agent-sdk)
|
|
10
10
|
[](https://github.com/whyymj/page-agent-sdk/blob/master/LICENSE)
|
|
11
|
-
[](#自测)
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -249,12 +249,11 @@ ChatDialog, MessageContent, CodePreview, SkillPanel, DebugDrawer, useChat
|
|
|
249
249
|
| | `summaryLlm` | `BaseChatModel \| LLMConfig` | 摘要专用 LLM(不配用主 `llm`) |
|
|
250
250
|
| | `maxMemoryRounds` | `number` · 默认 `30` | 对话历史内存上限轮次(`0` 关裁剪) |
|
|
251
251
|
| | `staleReadInvalidation` | `boolean` · 默认 `true` | 3.42+ 写驱动过期读失效:单次 invoke 窗口内,后续成功写击中路径的旧 `read`/`query_data`/`search_data` 结果替换为失效占位(防模型凭旧快照答状态;占位引用写结果自带新值/hash 防 thrash)。`false` = 主/子栈一致关闭 |
|
|
252
|
-
| | `vfs` | `{initialFiles?,maxBytes?,poolBytes
|
|
253
|
-
| | `data.tools` | `'high' \| string[]` | 3.41+ dataOps 装配期工具白名单。`'high'` 裁掉旧四件(`get/set/edit/delete_data`,与高层 `read`/`write` 同职能二选一);具体名单按名精确过滤;opt-in 家族(draft/resource)装配了就保留 |
|
|
252
|
+
| | `vfs` | `{initialFiles?,maxBytes?,poolBytes?}` · 默认 4MB | 内存工作区上限(超限 LRU 淘汰) |
|
|
254
253
|
| **持久化** | `storage` | `'indexed' \| 'session' \| 'local' \| 'memory' \| 配置 \| false` · 默认关 | 赋值开启;多 agent 靠 `id` 隔离 |
|
|
255
254
|
| | `session` | `{id?,autoResume?,title?}` | 会话控制 |
|
|
256
255
|
| | `shareContext` | `boolean` · 默认 `false` | 同 `id` 多实例共享同一 agent |
|
|
257
|
-
| **鲁棒/其他** | `maxRetries` / `maxParallelTools` / `maxToolRounds` | `number` · 2 / 1 /
|
|
256
|
+
| **鲁棒/其他** | `maxRetries` / `maxParallelTools` / `maxToolRounds` | `number` · 2 / 1 / 30 | 模型重试 / 同轮工具并发(>1 启用同轮并行委派,失败隔离 + 同组件锁互斥)/ 最大轮次 |
|
|
258
257
|
| | `roundTokenBudget` | `number` · 默认 `0`(关) | 单次调用累计 token 上限(3.11+;超限友好收口,已完成部分保留;与 automation 的 `tokenBudget` 正交,无需开 automation) |
|
|
259
258
|
| | `mcp` | `McpServerConfig[]` | 远程 MCP server(http/sse/websocket) |
|
|
260
259
|
| | `middleware` | `Middleware[]` | 自定义中间件(拼到内置栈末尾) |
|
|
@@ -499,8 +498,8 @@ function switchTo(i: number) {
|
|
|
499
498
|
## 自测
|
|
500
499
|
|
|
501
500
|
```bash
|
|
502
|
-
npm test #
|
|
503
|
-
npm run test:e2e #
|
|
501
|
+
npm test # 2810 项断言(tsx 源码级,不依赖 LLM)
|
|
502
|
+
npm run test:e2e # 929 项集成断言(node 跑构建产物 dist;覆盖各 API/配置项/功能模块/简单与复杂场景:默认 systemPrompt(含能力概述) / 动态注册与 inspect 同步 / inspect(tools/middleware/subagent/verify/mcp/todos/lastCompression/checkpoints 反映配置) / 自定义 tools/middleware/skills/memory 注入 / 运行时动态重配置(setTools/addTool/removeTool/setLlm/setMemory/setSubagents 反映) / switchSession(开/未开) / shareContext 开/关共享独立 / storage 后端+对象配置 / presets 三预设 / checkpoint / 导出项完整(39+ 函数/组件) / 工具函数可用(isQuotaError/estimateTokens/jpEval/searchJson) / source=builtin / mount 边界 / hook 多监听器 / llm 配置 / 错误场景)
|
|
504
503
|
```
|
|
505
504
|
|
|
506
505
|
## 本地 npm 包测试
|