page-agent-sdk 3.41.0 → 3.42.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "page-agent-sdk",
3
- "version": "3.41.0",
3
+ "version": "3.42.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",
@@ -328,6 +328,8 @@ export interface AgentInfo {
328
328
  actions?: Record<string, { description: string; hasParams: boolean }>;
329
329
  /** 跨压缩工作记忆(workingMemory 中间件;pin 最近 read/query/search 定位 path + read hash,≤10 LRU) */
330
330
  workingMemory?: WorkingMemory;
331
+ /** 写驱动过期读失效会话累计(stale-read-invalidation;写后旧 read/query/search 结果被替换为占位的次数) */
332
+ staleReadsInvalidated?: number;
331
333
  /** 当前上下文聚焦焦点(focus 中间件;兼容:首个;未聚焦/未开启 → undefined) */
332
334
  focus?: Focus;
333
335
  /** 全部聚焦焦点(multi-focus;空数组=未聚焦) */
@@ -838,6 +840,8 @@ export interface ChatSdkOptions {
838
840
  tokenBudget?: number;
839
841
  /** 单次 invoke 的 token 预算上限(opt-in,默认关):本次 agent 调用累计 total_tokens 超限 → 中断收口(observable emit + 友好文本,已完成部分保留);与 automation 全局 tokenBudget 正交 */
840
842
  roundTokenBudget?: number;
843
+ /** 写驱动过期读失效(stale-read-invalidation,默认 true):单次 invoke 窗口内,本批成功写之后被击中路径的旧 read/query/search 结果替换为失效占位(防模型凭旧快照答状态/用错位索引)。false = 主/子一致关闭零变化 */
844
+ staleReadInvalidation?: boolean;
841
845
  /** 时间预算 ms(从 agent 开始计时,超过 → 停止;需 capabilities.automation:true) */
842
846
  timeBudgetMs?: number;
843
847
  /** 无人值守错误恢复:致命错误(invoke 抛错)自动 restore_last_checkpoint + 重试次数(默认 1;防单点错误永久中断批量/长任务)。需 capabilities.automation:true */
package/types/index.d.ts CHANGED
@@ -666,6 +666,8 @@ export interface AgentInfo {
666
666
  actions?: Record<string, { description: string; hasParams: boolean }>;
667
667
  /** 跨压缩工作记忆(workingMemory 中间件;pin 最近 read/query/search 定位 path + read hash,≤10 LRU) */
668
668
  workingMemory?: WorkingMemory;
669
+ /** 写驱动过期读失效会话累计(stale-read-invalidation;写后旧 read/query/search 结果被替换为占位的次数) */
670
+ staleReadsInvalidated?: number;
669
671
  /** 当前上下文聚焦焦点(focus 中间件;兼容:首个;未聚焦/未开启 → undefined) */
670
672
  focus?: Focus;
671
673
  /** 全部聚焦焦点(multi-focus;空数组=未聚焦) */
@@ -1229,6 +1231,8 @@ export interface ChatSdkOptions {
1229
1231
  tokenBudget?: number;
1230
1232
  /** 单次 invoke 的 token 预算上限(opt-in,默认关):本次 agent 调用累计 total_tokens 超限 → 中断收口(observable emit + 友好文本,已完成部分保留);与 automation 全局 tokenBudget 正交 */
1231
1233
  roundTokenBudget?: number;
1234
+ /** 写驱动过期读失效(stale-read-invalidation,默认 true):单次 invoke 窗口内,本批成功写之后被击中路径的旧 read/query/search 结果替换为失效占位(防模型凭旧快照答状态/用错位索引)。false = 主/子一致关闭零变化 */
1235
+ staleReadInvalidation?: boolean;
1232
1236
  /** 时间预算 ms(从 agent 开始计时,超过 → 停止;需 capabilities.automation:true) */
1233
1237
  timeBudgetMs?: number;
1234
1238
  /** 无人值守错误恢复:致命错误(invoke 抛错)自动 restore_last_checkpoint + 重试次数(默认 1;防单点错误永久中断批量/长任务)。需 capabilities.automation:true */