agentpage 0.0.35 → 0.0.37

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 CHANGED
@@ -1173,6 +1173,7 @@ loop 对本轮返回做以下处理:
1173
1173
  - `Current remaining instruction`
1174
1174
  - `Done steps (do NOT repeat)`
1175
1175
  - `Previous round planned task array`
1176
+ - `Effect verification` — 要求 AI 对比上轮操作与当前快照,确认每个操作是否生效;未生效时从同区域找其他目标而非重复
1176
1177
  - `Previous round model output (normalized)`
1177
1178
  - `Latest DOM snapshot`
1178
1179
 
package/dist/index.mjs CHANGED
@@ -499,7 +499,10 @@ function buildCompactMessages(userMessage, trace, latestSnapshot, currentUrl, hi
499
499
  ];
500
500
  if (hasErrors) contextParts.push("", "The last step failed. Retry with a different approach, or skip and continue with other visible targets.");
501
501
  else contextParts.push("", "If the goal is fully done, reply with a short summary (no tool calls).");
502
- if (previousRoundTasks && previousRoundTasks.length > 0) contextParts.push("", "Previous round planned task array (already executed):", ...previousRoundTasks.map((task, index) => `${index + 1}. ${task}`));
502
+ if (previousRoundTasks && previousRoundTasks.length > 0) {
503
+ contextParts.push("", "Previous round planned task array (already executed):", ...previousRoundTasks.map((task, index) => `${index + 1}. ${task}`));
504
+ contextParts.push("", "## Effect verification (MANDATORY before planning new actions)", "Compare the above executed actions against the CURRENT snapshot below:", "- Did each action produce the expected result? (e.g., click opened a dialog/navigated; fill changed the input value; select_option updated the selected item)", "- If an action had NO visible effect (page unchanged near the target area), do NOT repeat the same target.", " Instead, look for a different actionable element nearby (sibling/ancestor in the same row/card/group) that has stronger interaction signals (click listeners, button/link semantics).", "- Only after confirming which previous actions succeeded, plan this round's new actions on the remaining unfinished parts.");
505
+ }
503
506
  if (previousRoundPlannedTasks && previousRoundPlannedTasks.length > 0) contextParts.push("", "Previous round model planned task array (before execution):", ...previousRoundPlannedTasks.map((task, index) => `${index + 1}. ${task}`));
504
507
  if (previousRoundModelOutput) contextParts.push("", "Previous round model output (normalized, for task reduction input):", previousRoundModelOutput);
505
508
  contextParts.push("", "After this round, include one plain text line:", "REMAINING: <new remaining instruction after this-round actions>", "or REMAINING: DONE");