page-agent-sdk 4.3.0 → 4.4.0
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 +2 -2
- package/README.zh-CN.md +2 -2
- package/dist/page-agent-sdk.headless.js +183 -177
- package/dist/page-agent-sdk.iife.js +101 -101
- package/dist/page-agent-sdk.js +1565 -1559
- package/dist/page-agent-sdk.legacy.js +982 -976
- package/dist/page-agent-sdk.umd.cjs +39 -39
- package/package.json +1 -1
- package/types/headless.d.ts +4 -1
- package/types/index.d.ts +4 -1
package/README.md
CHANGED
|
@@ -256,7 +256,7 @@ ChatDialog, MessageContent, CodePreview, SkillPanel, DebugDrawer, useChat
|
|
|
256
256
|
| | `maxMemoryRounds` | `number` · default `30` | Dialog history memory round cap (`0` disables trim) |
|
|
257
257
|
| | `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 |
|
|
258
258
|
| | `vfs` | `{initialFiles?,maxBytes?,poolBytes?}` · default 4MB | In-memory workspace cap (LRU evict on overflow) |
|
|
259
|
-
| **Persistence** | `storage` | `'indexed' \| 'session' \| 'local' \| 'memory' \| config \| false` · default off | Assign to enable; multi-agent isolated by `id` |
|
|
259
|
+
| **Persistence** | `storage` | `'indexed' \| 'session' \| 'local' \| 'memory' \| config (incl. custom backend instance) \| false` · default off | Assign to enable; multi-agent isolated by `id`; pass a `StorageBackend` instance as `backend` for server-side persistence (5 KV methods) |
|
|
260
260
|
| | `session` | `{id?,autoResume?,title?}` | Session control |
|
|
261
261
|
| | `shareContext` | `boolean` · default `false` | Same `id` instances share one agent |
|
|
262
262
|
| **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 |
|
|
@@ -500,7 +500,7 @@ function switchTo(i: number) {
|
|
|
500
500
|
|
|
501
501
|
```bash
|
|
502
502
|
npm test # 2894 assertions (tsx, source-level; no LLM dependency)
|
|
503
|
-
npm run test:e2e #
|
|
503
|
+
npm run test:e2e # 979 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)
|
|
504
504
|
```
|
|
505
505
|
|
|
506
506
|
## Local npm package test
|
package/README.zh-CN.md
CHANGED
|
@@ -252,7 +252,7 @@ ChatDialog, MessageContent, CodePreview, SkillPanel, DebugDrawer, useChat
|
|
|
252
252
|
| | `maxMemoryRounds` | `number` · 默认 `30` | 对话历史内存上限轮次(`0` 关裁剪) |
|
|
253
253
|
| | `staleReadInvalidation` | `boolean` · 默认 `true` | 3.42+ 写驱动过期读失效:单次 invoke 窗口内,后续成功写击中路径的旧 `read`/`query_data`/`search_data` 结果替换为失效占位(防模型凭旧快照答状态;占位引用写结果自带新值/hash 防 thrash)。`false` = 主/子栈一致关闭 |
|
|
254
254
|
| | `vfs` | `{initialFiles?,maxBytes?,poolBytes?}` · 默认 4MB | 内存工作区上限(超限 LRU 淘汰) |
|
|
255
|
-
| **持久化** | `storage` | `'indexed' \| 'session' \| 'local' \| 'memory' \| 配置 \| false` · 默认关 | 赋值开启;多 agent 靠 `id`
|
|
255
|
+
| **持久化** | `storage` | `'indexed' \| 'session' \| 'local' \| 'memory' \| 配置(含自定义后端实例) \| false` · 默认关 | 赋值开启;多 agent 靠 `id` 隔离;`backend` 传 `StorageBackend` 实例可接服务端 REST(5 个 KV 方法) |
|
|
256
256
|
| | `session` | `{id?,autoResume?,title?}` | 会话控制 |
|
|
257
257
|
| | `shareContext` | `boolean` · 默认 `false` | 同 `id` 多实例共享同一 agent |
|
|
258
258
|
| **鲁棒/其他** | `maxRetries` / `maxParallelTools` / `maxToolRounds` | `number` · 2 / 1 / 30 | 模型重试 / 同轮工具并发(>1 启用同轮并行委派,失败隔离 + 同组件锁互斥)/ 最大轮次 |
|
|
@@ -503,7 +503,7 @@ function switchTo(i: number) {
|
|
|
503
503
|
|
|
504
504
|
```bash
|
|
505
505
|
npm test # 2894 项断言(tsx 源码级,不依赖 LLM)
|
|
506
|
-
npm run test:e2e #
|
|
506
|
+
npm run test:e2e # 979 项集成断言(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 配置 / 错误场景)
|
|
507
507
|
```
|
|
508
508
|
|
|
509
509
|
## 本地 npm 包测试
|