page-agent-sdk 3.25.0 → 3.26.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 +4 -3
- package/README.zh-CN.md +4 -3
- package/dist/page-agent-sdk.headless.js +1413 -1404
- package/dist/page-agent-sdk.iife.js +44 -44
- package/dist/page-agent-sdk.js +109 -100
- package/dist/page-agent-sdk.legacy.js +84926 -0
- package/dist/page-agent-sdk.umd.cjs +5 -5
- package/dist/style.css +1 -1
- package/legacy.js +10 -0
- package/package.json +10 -3
- package/skills/page-agent-sdk-integrate/SKILL.md +8 -1
- package/style.css +2 -0
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
|
|
|
@@ -533,8 +533,8 @@ function switchTo(i: number) {
|
|
|
533
533
|
## Self-tests
|
|
534
534
|
|
|
535
535
|
```bash
|
|
536
|
-
npm test #
|
|
537
|
-
npm run test:e2e #
|
|
536
|
+
npm test # 2428 assertions (tsx, source-level; no LLM dependency)
|
|
537
|
+
npm run test:e2e # 764 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)
|
|
538
538
|
```
|
|
539
539
|
|
|
540
540
|
## Local npm package test
|
|
@@ -590,6 +590,7 @@ The package ships three builds — pick by integration scenario:
|
|
|
590
590
|
| UMD | `dist/page-agent-sdk.umd.cjs` | `require()` in Node/legacy bundlers | ~560 KB |
|
|
591
591
|
| IIFE (all-inlined, single file) | `dist/page-agent-sdk.iife.js` | `<script src>` CDN direct include, zero config | ~1.4 MB |
|
|
592
592
|
| **headless ESM** (no UI layer) | `dist/page-agent-sdk.headless.js` | `page-agent-sdk/headless` — pure core for `ui:false` custom UI | **~325 KB** |
|
|
593
|
+
| **legacy ESM** (es2017, all-inlined) | `dist/page-agent-sdk.legacy.js` | `page-agent-sdk/legacy` — **webpack ≤4 / vue-cli 2-3 hosts**: `await import('page-agent-sdk/legacy')` lazy chunk, zero transpile/peers | **~2.9 MB** |
|
|
593
594
|
|
|
594
595
|
### Import only what you need (subpath exports)
|
|
595
596
|
|
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
|
|
|
@@ -479,8 +479,8 @@ function switchTo(i: number) {
|
|
|
479
479
|
## 自测
|
|
480
480
|
|
|
481
481
|
```bash
|
|
482
|
-
npm test #
|
|
483
|
-
npm run test:e2e #
|
|
482
|
+
npm test # 2428 项断言(tsx 源码级,不依赖 LLM)
|
|
483
|
+
npm run test:e2e # 764 项集成断言(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 配置 / 错误场景)
|
|
484
484
|
```
|
|
485
485
|
|
|
486
486
|
## 本地 npm 包测试
|
|
@@ -536,6 +536,7 @@ createChatSdk({
|
|
|
536
536
|
| UMD | `dist/page-agent-sdk.umd.cjs` | Node/老 bundler `require` | ~560 KB |
|
|
537
537
|
| IIFE(全量单文件) | `dist/page-agent-sdk.iife.js` | CDN `<script>` 直引,零配置 | ~1.4 MB |
|
|
538
538
|
| **headless ESM**(无 UI 层) | `dist/page-agent-sdk.headless.js` | `page-agent-sdk/headless` —— `ui:false` 自建 UI 纯核心 | **~325 KB** |
|
|
539
|
+
| **legacy ESM**(es2017 全量打包) | `dist/page-agent-sdk.legacy.js` | `page-agent-sdk/legacy` —— **webpack ≤4 / vue-cli 2-3 老构建链宿主**:`await import('page-agent-sdk/legacy')` 懒加载 chunk,零 transpile/零 peer | **~2.9 MB** |
|
|
539
540
|
|
|
540
541
|
### 按需引入(subpath exports)
|
|
541
542
|
|