page-agent-sdk 2.29.0 → 2.30.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 +7 -4
- package/README.zh-CN.md +7 -4
- package/dist/page-agent-sdk.iife.js +126 -126
- package/dist/page-agent-sdk.js +3750 -3654
- package/dist/page-agent-sdk.umd.cjs +79 -79
- package/package.json +1 -1
- package/types/index.d.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "page-agent-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.30.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
|
@@ -163,6 +163,7 @@ export interface SubagentConfig {
|
|
|
163
163
|
skills?: SkillSpec[];
|
|
164
164
|
temperature?: number;
|
|
165
165
|
maxTokens?: number;
|
|
166
|
+
/** 子 agent 工具调用轮次上限(默认 10);大 JSON 子任务可调大 */
|
|
166
167
|
maxToolRounds?: number;
|
|
167
168
|
/** 子 agent 可写路径前缀白名单(给子 agent 写权限;写工具包 path guard,越界 PATH_OUT_OF_SCOPE;整体 set 禁)。subagent-writable Phase 2 */
|
|
168
169
|
writablePaths?: string[];
|
|
@@ -588,6 +589,7 @@ export interface ChatSdkOptions {
|
|
|
588
589
|
/** 内存中保留的对话轮数上限(默认 50);超限把最旧轮次压缩为摘要 system 消息(防 OOM);0 关闭 */
|
|
589
590
|
maxMemoryRounds?: number;
|
|
590
591
|
debug?: boolean;
|
|
592
|
+
/** agent 工具调用轮次上限(默认 10);大 JSON 分块构建(draft_write×N + draft_commit + read 确认)是多轮场景,可能触顶被截断,建议调大到 20-30 */
|
|
591
593
|
maxToolRounds?: number;
|
|
592
594
|
/** 规划阶段总轮次预算(默认 5);planning 状态下超限 → write_todos/update_todo 回灌,防"光规划不执行"死循环。与 maxIterations 正交 */
|
|
593
595
|
maxPlanRevisions?: number;
|
|
@@ -1158,6 +1160,9 @@ export interface ContextManagerOptions { [k: string]: any }
|
|
|
1158
1160
|
export interface CompressionStats { [k: string]: any }
|
|
1159
1161
|
|
|
1160
1162
|
// 模型能力 / token 估算 / offload 阈值
|
|
1163
|
+
export declare const MIN_CONTEXT_WINDOW: number;
|
|
1164
|
+
/** 判定错误是否为上下文超限(模型输入超 contextWindow);复用 langchain ContextOverflowError + 兜底正则。harden-context-resilience */
|
|
1165
|
+
export declare function isContextLengthError(err: unknown): boolean;
|
|
1161
1166
|
export declare function resolveModelCaps(model: string): any;
|
|
1162
1167
|
export declare function estimateTokens(text: string): number;
|
|
1163
1168
|
export declare function offloadThresholdChars(contextWindow: number): number;
|