@autobest-ui/agent 1.0.13 → 1.0.14
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.
|
@@ -43,7 +43,7 @@ npm start
|
|
|
43
43
|
|
|
44
44
|
录制超时后服务自动停止并自动上传(无需人工确认),随后第一次人工调用 `stop_trace_recording` 会取回自动停止的结果;再调用则返回没有活动会话。
|
|
45
45
|
|
|
46
|
-
画面探测默认每 500ms 执行一次,像素差异比例达到 0.5% 后进入防抖冷却;画面连续稳定 800ms
|
|
46
|
+
画面探测默认每 500ms 执行一次,像素差异比例达到 0.5% 后进入防抖冷却;画面连续稳定 800ms 才写入一个轻量 `waitForTimeout(1)` Trace Action,持续变化超过 3 秒时强制写入一个。Trace 自带的 screenshots/snapshots 会记录这些 Action 前后的页面状态,停止录制时会补一个最终 Action。探测截图不会写入 Trace,因此静止页面和连续滚动不会产生大量重复图片。
|
|
47
47
|
|
|
48
48
|
## 后端接口契约
|
|
49
49
|
|
|
@@ -378,7 +378,10 @@ export class TraceRecorder {
|
|
|
378
378
|
|
|
379
379
|
async recordPendingVisual(session) {
|
|
380
380
|
if (session.state !== 'recording' || !session.visualPendingSince) return;
|
|
381
|
-
|
|
381
|
+
// waitForTimeout is a traceable Playwright action. The trace screenshots and
|
|
382
|
+
// snapshots captured around it represent the changed page state, while the
|
|
383
|
+
// native Trace Viewer can advance through this action during playback.
|
|
384
|
+
await session.page.waitForTimeout(1);
|
|
382
385
|
session.lastRecordedFrameAt = Date.now();
|
|
383
386
|
session.visualPendingSince = undefined;
|
|
384
387
|
}
|
|
@@ -397,7 +400,7 @@ export class TraceRecorder {
|
|
|
397
400
|
await session.visualRecordPromise?.catch(() => {});
|
|
398
401
|
session.visualPendingSince = undefined;
|
|
399
402
|
if (recordFinalFrame && session.page) {
|
|
400
|
-
await session.page.
|
|
403
|
+
await session.page.waitForTimeout(1).catch(() => {});
|
|
401
404
|
}
|
|
402
405
|
await session.cdpSession?.detach().catch(() => {});
|
|
403
406
|
session.cdpSession = undefined;
|