page-agent-sdk 2.26.0 → 2.27.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 +3 -3
- package/README.zh-CN.md +3 -3
- package/dist/page-agent-sdk.iife.js +201 -201
- package/dist/page-agent-sdk.js +6809 -6725
- package/dist/page-agent-sdk.umd.cjs +113 -113
- package/package.json +1 -1
- package/types/index.d.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "page-agent-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.27.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AI agent SDK for web pages — embed a chat assistant that edits page data via schema-validated tools. A lighter, framework-agnostic alternative to CopilotKit/LangChain for in-page JSON-editing agents. Vue-bundled; works with DeepSeek, OpenAI, MCP.",
|
|
6
6
|
"main": "./dist/page-agent-sdk.umd.cjs",
|
package/types/index.d.ts
CHANGED
|
@@ -78,7 +78,8 @@ export type SdkEvent =
|
|
|
78
78
|
| { type: 'session_restored'; sessionId: string; rounds: number }
|
|
79
79
|
| { type: 'usage'; round: number; usage: TokenUsage; cumulative: TokenUsage }
|
|
80
80
|
| { type: 'error'; message: string; severity?: 'recoverable' | 'fatal' | 'observable'; code?: string; context?: unknown }
|
|
81
|
-
| { type: 'trace'; spans: TraceSpan[]; metrics: TraceMetrics }
|
|
81
|
+
| { type: 'trace'; spans: TraceSpan[]; metrics: TraceMetrics }
|
|
82
|
+
| { type: 'context_trimmed'; dropped: { round: number; user: unknown; assistant: unknown[]; steps: unknown[] }[]; vfsResults: Record<string, string>; summary: string; reason: string };
|
|
82
83
|
|
|
83
84
|
/** token 用量(OpenAI 协议字段名) */
|
|
84
85
|
export interface TokenUsage {
|
|
@@ -453,6 +454,10 @@ export interface SessionSnapshot {
|
|
|
453
454
|
checkpoints?: unknown[];
|
|
454
455
|
/** automation 断点续跑:累计 token usage(刷新后续跑预算统计连续) */
|
|
455
456
|
usage?: TokenUsage;
|
|
457
|
+
/** 会话任务目标(context-persist-resilience:刷新后不丢;capabilities.missionAnchor 开启时写入) */
|
|
458
|
+
mission?: Mission;
|
|
459
|
+
/** 跨压缩工作记忆 path/hash 备忘(context-persist-resilience:刷新后少重复 read;capabilities.workingMemory 开启时写入) */
|
|
460
|
+
workingMemory?: WorkingMemory;
|
|
456
461
|
}
|
|
457
462
|
export type StorageEvent =
|
|
458
463
|
| { type: 'degraded'; reason: string }
|