page-agent-sdk 2.34.0 → 2.36.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 -6
- package/README.zh-CN.md +7 -6
- package/dist/page-agent-sdk.headless.js +9748 -0
- package/dist/page-agent-sdk.iife.js +168 -168
- package/dist/page-agent-sdk.js +18419 -18387
- package/dist/page-agent-sdk.umd.cjs +108 -108
- package/package.json +7 -2
- package/types/headless.d.ts +1349 -0
- package/types/index.d.ts +19 -0
package/types/index.d.ts
CHANGED
|
@@ -312,6 +312,19 @@ export declare const QueuedBar: DefineComponent<any>;
|
|
|
312
312
|
export declare const ApprovalBar: DefineComponent<any>;
|
|
313
313
|
export declare const ConflictBar: DefineComponent<any>;
|
|
314
314
|
export declare const FocusBar: DefineComponent<any>;
|
|
315
|
+
/** DebugDrawer props(纯 props 驱动,不耦合 ChatDialog;headless 自建对话框可复用) */
|
|
316
|
+
export interface DebugDrawerProps {
|
|
317
|
+
logs?: DebugLog[];
|
|
318
|
+
visible: boolean;
|
|
319
|
+
/** 取 agent 详情(「Agent 信息」tab) */
|
|
320
|
+
getInfo?: () => AgentInfo;
|
|
321
|
+
/** 刷新 tick(watch 后重拉 getInfo;setSkills/setData 后 ++ 实时反映) */
|
|
322
|
+
infoTick?: Ref<number>;
|
|
323
|
+
/** 读 skill 全文(展开 skill 时调;返回 null 表示无内容) */
|
|
324
|
+
getSkillContent?: (name: string) => Promise<string | null>;
|
|
325
|
+
}
|
|
326
|
+
/** 调试抽屉(7 类日志筛选 / Agent 信息 / 上下文构成 / 上轮压缩 / skill 展开);v-model:visible 显隐,emit clear 清日志 */
|
|
327
|
+
export declare const DebugDrawer: DefineComponent<DebugDrawerProps>;
|
|
315
328
|
// chatContext 枢纽(L2 自建根组件调 createChatContext + provide(chatContextKey);原子组件 useChatContext inject)
|
|
316
329
|
export interface ChatContextOptions {
|
|
317
330
|
fetchResponse?: (messages: AgentMessage[], signal?: AbortSignal) => Promise<string>;
|
|
@@ -832,6 +845,12 @@ export interface ChatSdk {
|
|
|
832
845
|
/** 当前会话 id(switchSession/onClear 后实时反映;供历史列表高亮当前项) */
|
|
833
846
|
readonly sessionId: string;
|
|
834
847
|
stream: (messages: AgentMessage[], onEvent: StreamHandler, signal?: AbortSignal) => Promise<string>;
|
|
848
|
+
/** 显式持久化当前轮(headless 用 sdk.stream 时需手动调:把 messages/vfs/todos 存 store;内置 useChat 经 onPersist 自动调。storage 未开启 → no-op) */
|
|
849
|
+
afterRound(): void;
|
|
850
|
+
/** 调试日志(LLM 请求/响应/工具调用/中间件/错误;switchSession/onClear 清空;供 DebugDrawer 或外部消费) */
|
|
851
|
+
readonly debugLogs: Ref<DebugLog[]>;
|
|
852
|
+
/** Agent 信息刷新 tick(setSkills/setData/setFocus 后 ++);传给 DebugDrawer watch 后重拉 inspect() 实时反映 */
|
|
853
|
+
readonly infoTick: Ref<number>;
|
|
835
854
|
/** 检视 agent 详细信息(tools/skills/data/middleware/todos) */
|
|
836
855
|
inspect(): AgentInfo;
|
|
837
856
|
/** 读取最近一次上下文构成快照(每轮 wrapModelCall 覆盖;capabilities.contextInspector:false → undefined) */
|