page-agent-sdk 2.21.0 → 2.22.1
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 -7
- package/README.zh-CN.md +3 -3
- package/dist/page-agent-sdk.iife.js +128 -128
- package/dist/page-agent-sdk.js +528 -420
- package/dist/page-agent-sdk.umd.cjs +17 -17
- package/package.json +1 -1
- package/types/index.d.ts +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "page-agent-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.22.1",
|
|
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
|
@@ -826,6 +826,13 @@ export interface ConflictManager {
|
|
|
826
826
|
}
|
|
827
827
|
export declare function createConflictManager(getEmit?: () => (((e: any) => void) | undefined)): ConflictManager;
|
|
828
828
|
// ============ 配置解析 + 事件系统(optionsResolver/events,refactor-module-extraction 期三)============
|
|
829
|
+
// capabilities 能力开关注册表 + 单一解析(p2-refactor 子项 4:消除 11/17 开关 ===true/!==false 混)
|
|
830
|
+
export interface Capability { name: string; defaultOn: boolean; requires?: readonly string[] }
|
|
831
|
+
export type CapabilityFlags = Partial<Record<string, boolean>>;
|
|
832
|
+
export type ResolvedCapabilities = Record<string, boolean>;
|
|
833
|
+
export declare const CAPABILITIES: readonly Capability[];
|
|
834
|
+
/** 单一解析:集成方原始 caps(Partial)→ 全量 boolean(opt-out 默认开 !==false / opt-in 默认关 ===true;requires 依赖未满足强制关)。参数宽松 Record<string,unknown>(兼容含 subagents 等非 boolean 字段的 caps 对象;只读已知 capability 的 boolean) */
|
|
835
|
+
export declare function resolveCapabilities(caps?: Record<string, unknown>): ResolvedCapabilities;
|
|
829
836
|
export declare function resolveStorage(storage: any): any | null;
|
|
830
837
|
export declare function resolveDialogConfig(opts: any): any;
|
|
831
838
|
export interface SdkEvents {
|
|
@@ -973,7 +980,7 @@ export declare function agentError(severity: ErrorSeverity, message: string, cod
|
|
|
973
980
|
// === 与 src/core/index.ts 导出对齐(消费者类型完整;复杂内部类型用宽松声明,消费者主要消费工厂返回值) ===
|
|
974
981
|
// 上下文压缩预设
|
|
975
982
|
export declare function resolveContextOptions(options: any, modelContextWindow: number): any;
|
|
976
|
-
export type ContextPreset = 'auto' | 'conservative' | 'aggressive';
|
|
983
|
+
export type ContextPreset = 'auto' | 'conservative' | 'aggressive' | 'complex';
|
|
977
984
|
export declare const CONTEXT_PRESETS: Record<string, any>;
|
|
978
985
|
|
|
979
986
|
// MCP
|