@iflow-mcp/shaun0927-openchrome 1.7.13
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/LICENSE +21 -0
- package/README.md +387 -0
- package/assets/chart-tokens.svg +42 -0
- package/assets/demo.svg +278 -0
- package/assets/mascot.png +0 -0
- package/dist/cdp/client.d.ts +265 -0
- package/dist/cdp/client.d.ts.map +1 -0
- package/dist/cdp/client.js +1419 -0
- package/dist/cdp/client.js.map +1 -0
- package/dist/cdp/connection-pool.d.ts +117 -0
- package/dist/cdp/connection-pool.d.ts.map +1 -0
- package/dist/cdp/connection-pool.js +421 -0
- package/dist/cdp/connection-pool.js.map +1 -0
- package/dist/cdp/screenshot-scheduler.d.ts +55 -0
- package/dist/cdp/screenshot-scheduler.d.ts.map +1 -0
- package/dist/cdp/screenshot-scheduler.js +121 -0
- package/dist/cdp/screenshot-scheduler.js.map +1 -0
- package/dist/chrome/launcher.d.ts +113 -0
- package/dist/chrome/launcher.d.ts.map +1 -0
- package/dist/chrome/launcher.js +850 -0
- package/dist/chrome/launcher.js.map +1 -0
- package/dist/chrome/pool.d.ts +43 -0
- package/dist/chrome/pool.d.ts.map +1 -0
- package/dist/chrome/pool.js +219 -0
- package/dist/chrome/pool.js.map +1 -0
- package/dist/chrome/profile-manager.d.ts +156 -0
- package/dist/chrome/profile-manager.d.ts.map +1 -0
- package/dist/chrome/profile-manager.js +558 -0
- package/dist/chrome/profile-manager.js.map +1 -0
- package/dist/cli/claude-session.d.ts +11 -0
- package/dist/cli/claude-session.js +349 -0
- package/dist/cli/claude-session.js.map +1 -0
- package/dist/cli/index.d.ts +14 -0
- package/dist/cli/index.js +1013 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/install.d.ts +16 -0
- package/dist/cli/install.js +185 -0
- package/dist/cli/install.js.map +1 -0
- package/dist/cli/uninstall.d.ts +7 -0
- package/dist/cli/uninstall.js +126 -0
- package/dist/cli/uninstall.js.map +1 -0
- package/dist/cli/update-check.d.ts +10 -0
- package/dist/cli/update-check.js +187 -0
- package/dist/cli/update-check.js.map +1 -0
- package/dist/compression/snapshot-store.d.ts +54 -0
- package/dist/compression/snapshot-store.d.ts.map +1 -0
- package/dist/compression/snapshot-store.js +183 -0
- package/dist/compression/snapshot-store.js.map +1 -0
- package/dist/config/defaults.d.ts +102 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +102 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/global.d.ts +81 -0
- package/dist/config/global.d.ts.map +1 -0
- package/dist/config/global.js +30 -0
- package/dist/config/global.js.map +1 -0
- package/dist/config/index.d.ts +16 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +21 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/tool-tiers.d.ts +14 -0
- package/dist/config/tool-tiers.d.ts.map +1 -0
- package/dist/config/tool-tiers.js +69 -0
- package/dist/config/tool-tiers.js.map +1 -0
- package/dist/dashboard/activity-tracker.d.ts +95 -0
- package/dist/dashboard/activity-tracker.d.ts.map +1 -0
- package/dist/dashboard/activity-tracker.js +275 -0
- package/dist/dashboard/activity-tracker.js.map +1 -0
- package/dist/dashboard/ansi.d.ts +117 -0
- package/dist/dashboard/ansi.d.ts.map +1 -0
- package/dist/dashboard/ansi.js +199 -0
- package/dist/dashboard/ansi.js.map +1 -0
- package/dist/dashboard/index.d.ts +110 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +413 -0
- package/dist/dashboard/index.js.map +1 -0
- package/dist/dashboard/keyboard-handler.d.ts +43 -0
- package/dist/dashboard/keyboard-handler.d.ts.map +1 -0
- package/dist/dashboard/keyboard-handler.js +230 -0
- package/dist/dashboard/keyboard-handler.js.map +1 -0
- package/dist/dashboard/operation-controller.d.ts +76 -0
- package/dist/dashboard/operation-controller.d.ts.map +1 -0
- package/dist/dashboard/operation-controller.js +167 -0
- package/dist/dashboard/operation-controller.js.map +1 -0
- package/dist/dashboard/renderer.d.ts +76 -0
- package/dist/dashboard/renderer.d.ts.map +1 -0
- package/dist/dashboard/renderer.js +193 -0
- package/dist/dashboard/renderer.js.map +1 -0
- package/dist/dashboard/types.d.ts +74 -0
- package/dist/dashboard/types.d.ts.map +1 -0
- package/dist/dashboard/types.js +12 -0
- package/dist/dashboard/types.js.map +1 -0
- package/dist/dashboard/views/main-view.d.ts +23 -0
- package/dist/dashboard/views/main-view.d.ts.map +1 -0
- package/dist/dashboard/views/main-view.js +143 -0
- package/dist/dashboard/views/main-view.js.map +1 -0
- package/dist/dashboard/views/sessions-view.d.ts +22 -0
- package/dist/dashboard/views/sessions-view.d.ts.map +1 -0
- package/dist/dashboard/views/sessions-view.js +104 -0
- package/dist/dashboard/views/sessions-view.js.map +1 -0
- package/dist/dashboard/views/tabs-view.d.ts +21 -0
- package/dist/dashboard/views/tabs-view.d.ts.map +1 -0
- package/dist/dashboard/views/tabs-view.js +92 -0
- package/dist/dashboard/views/tabs-view.js.map +1 -0
- package/dist/dom/dom-serializer.d.ts +37 -0
- package/dist/dom/dom-serializer.d.ts.map +1 -0
- package/dist/dom/dom-serializer.js +429 -0
- package/dist/dom/dom-serializer.js.map +1 -0
- package/dist/dom/index.d.ts +2 -0
- package/dist/dom/index.d.ts.map +1 -0
- package/dist/dom/index.js +6 -0
- package/dist/dom/index.js.map +1 -0
- package/dist/errors/timeout.d.ts +20 -0
- package/dist/errors/timeout.d.ts.map +1 -0
- package/dist/errors/timeout.js +41 -0
- package/dist/errors/timeout.js.map +1 -0
- package/dist/hints/hint-engine.d.ts +117 -0
- package/dist/hints/hint-engine.d.ts.map +1 -0
- package/dist/hints/hint-engine.js +347 -0
- package/dist/hints/hint-engine.js.map +1 -0
- package/dist/hints/index.d.ts +8 -0
- package/dist/hints/index.d.ts.map +1 -0
- package/dist/hints/index.js +11 -0
- package/dist/hints/index.js.map +1 -0
- package/dist/hints/pattern-learner.d.ts +76 -0
- package/dist/hints/pattern-learner.d.ts.map +1 -0
- package/dist/hints/pattern-learner.js +254 -0
- package/dist/hints/pattern-learner.js.map +1 -0
- package/dist/hints/progress-tracker.d.ts +44 -0
- package/dist/hints/progress-tracker.d.ts.map +1 -0
- package/dist/hints/progress-tracker.js +118 -0
- package/dist/hints/progress-tracker.js.map +1 -0
- package/dist/hints/rules/blocking-page.d.ts +8 -0
- package/dist/hints/rules/blocking-page.d.ts.map +1 -0
- package/dist/hints/rules/blocking-page.js +58 -0
- package/dist/hints/rules/blocking-page.js.map +1 -0
- package/dist/hints/rules/composite-suggestions.d.ts +6 -0
- package/dist/hints/rules/composite-suggestions.d.ts.map +1 -0
- package/dist/hints/rules/composite-suggestions.js +138 -0
- package/dist/hints/rules/composite-suggestions.js.map +1 -0
- package/dist/hints/rules/error-recovery.d.ts +7 -0
- package/dist/hints/rules/error-recovery.d.ts.map +1 -0
- package/dist/hints/rules/error-recovery.js +59 -0
- package/dist/hints/rules/error-recovery.js.map +1 -0
- package/dist/hints/rules/learned-rules.d.ts +13 -0
- package/dist/hints/rules/learned-rules.d.ts.map +1 -0
- package/dist/hints/rules/learned-rules.js +27 -0
- package/dist/hints/rules/learned-rules.js.map +1 -0
- package/dist/hints/rules/pagination-detection.d.ts +7 -0
- package/dist/hints/rules/pagination-detection.d.ts.map +1 -0
- package/dist/hints/rules/pagination-detection.js +220 -0
- package/dist/hints/rules/pagination-detection.js.map +1 -0
- package/dist/hints/rules/repetition-detection.d.ts +7 -0
- package/dist/hints/rules/repetition-detection.d.ts.map +1 -0
- package/dist/hints/rules/repetition-detection.js +271 -0
- package/dist/hints/rules/repetition-detection.js.map +1 -0
- package/dist/hints/rules/sequence-detection.d.ts +6 -0
- package/dist/hints/rules/sequence-detection.d.ts.map +1 -0
- package/dist/hints/rules/sequence-detection.js +99 -0
- package/dist/hints/rules/sequence-detection.js.map +1 -0
- package/dist/hints/rules/setup-hints.d.ts +6 -0
- package/dist/hints/rules/setup-hints.d.ts.map +1 -0
- package/dist/hints/rules/setup-hints.js +24 -0
- package/dist/hints/rules/setup-hints.js.map +1 -0
- package/dist/hints/rules/success-hints.d.ts +6 -0
- package/dist/hints/rules/success-hints.d.ts.map +1 -0
- package/dist/hints/rules/success-hints.js +74 -0
- package/dist/hints/rules/success-hints.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +357 -0
- package/dist/index.js.map +1 -0
- package/dist/lightpanda/launcher.d.ts +58 -0
- package/dist/lightpanda/launcher.d.ts.map +1 -0
- package/dist/lightpanda/launcher.js +210 -0
- package/dist/lightpanda/launcher.js.map +1 -0
- package/dist/mcp-server.d.ts +154 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +962 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/memory/domain-memory.d.ts +68 -0
- package/dist/memory/domain-memory.d.ts.map +1 -0
- package/dist/memory/domain-memory.js +224 -0
- package/dist/memory/domain-memory.js.map +1 -0
- package/dist/orchestration/plan-executor.d.ts +19 -0
- package/dist/orchestration/plan-executor.d.ts.map +1 -0
- package/dist/orchestration/plan-executor.js +276 -0
- package/dist/orchestration/plan-executor.js.map +1 -0
- package/dist/orchestration/plan-registry.d.ts +55 -0
- package/dist/orchestration/plan-registry.d.ts.map +1 -0
- package/dist/orchestration/plan-registry.js +256 -0
- package/dist/orchestration/plan-registry.js.map +1 -0
- package/dist/orchestration/state-manager.d.ts +127 -0
- package/dist/orchestration/state-manager.d.ts.map +1 -0
- package/dist/orchestration/state-manager.js +438 -0
- package/dist/orchestration/state-manager.js.map +1 -0
- package/dist/orchestration/workflow-engine.d.ts +162 -0
- package/dist/orchestration/workflow-engine.d.ts.map +1 -0
- package/dist/orchestration/workflow-engine.js +748 -0
- package/dist/orchestration/workflow-engine.js.map +1 -0
- package/dist/resources/usage-guide.d.ts +13 -0
- package/dist/resources/usage-guide.d.ts.map +1 -0
- package/dist/resources/usage-guide.js +123 -0
- package/dist/resources/usage-guide.js.map +1 -0
- package/dist/router/browser-router.d.ts +47 -0
- package/dist/router/browser-router.d.ts.map +1 -0
- package/dist/router/browser-router.js +157 -0
- package/dist/router/browser-router.js.map +1 -0
- package/dist/router/cookie-sync.d.ts +48 -0
- package/dist/router/cookie-sync.d.ts.map +1 -0
- package/dist/router/cookie-sync.js +106 -0
- package/dist/router/cookie-sync.js.map +1 -0
- package/dist/router/index.d.ts +5 -0
- package/dist/router/index.d.ts.map +1 -0
- package/dist/router/index.js +10 -0
- package/dist/router/index.js.map +1 -0
- package/dist/router/tool-routing-registry.d.ts +21 -0
- package/dist/router/tool-routing-registry.d.ts.map +1 -0
- package/dist/router/tool-routing-registry.js +89 -0
- package/dist/router/tool-routing-registry.js.map +1 -0
- package/dist/security/audit-logger.d.ts +2 -0
- package/dist/security/audit-logger.d.ts.map +1 -0
- package/dist/security/audit-logger.js +109 -0
- package/dist/security/audit-logger.js.map +1 -0
- package/dist/security/domain-guard.d.ts +11 -0
- package/dist/security/domain-guard.d.ts.map +1 -0
- package/dist/security/domain-guard.js +98 -0
- package/dist/security/domain-guard.js.map +1 -0
- package/dist/session-manager.d.ts +325 -0
- package/dist/session-manager.d.ts.map +1 -0
- package/dist/session-manager.js +1402 -0
- package/dist/session-manager.js.map +1 -0
- package/dist/storage-state/index.d.ts +2 -0
- package/dist/storage-state/index.d.ts.map +1 -0
- package/dist/storage-state/index.js +6 -0
- package/dist/storage-state/index.js.map +1 -0
- package/dist/storage-state/storage-state-manager.d.ts +52 -0
- package/dist/storage-state/storage-state-manager.d.ts.map +1 -0
- package/dist/storage-state/storage-state-manager.js +135 -0
- package/dist/storage-state/storage-state-manager.js.map +1 -0
- package/dist/tools/batch-execute.d.ts +11 -0
- package/dist/tools/batch-execute.d.ts.map +1 -0
- package/dist/tools/batch-execute.js +218 -0
- package/dist/tools/batch-execute.js.map +1 -0
- package/dist/tools/batch-paginate.d.ts +10 -0
- package/dist/tools/batch-paginate.d.ts.map +1 -0
- package/dist/tools/batch-paginate.js +436 -0
- package/dist/tools/batch-paginate.js.map +1 -0
- package/dist/tools/click-element.d.ts +8 -0
- package/dist/tools/click-element.d.ts.map +1 -0
- package/dist/tools/click-element.js +281 -0
- package/dist/tools/click-element.js.map +1 -0
- package/dist/tools/computer.d.ts +6 -0
- package/dist/tools/computer.d.ts.map +1 -0
- package/dist/tools/computer.js +832 -0
- package/dist/tools/computer.js.map +1 -0
- package/dist/tools/console-capture.d.ts +6 -0
- package/dist/tools/console-capture.d.ts.map +1 -0
- package/dist/tools/console-capture.js +380 -0
- package/dist/tools/console-capture.js.map +1 -0
- package/dist/tools/cookies.d.ts +6 -0
- package/dist/tools/cookies.d.ts.map +1 -0
- package/dist/tools/cookies.js +366 -0
- package/dist/tools/cookies.js.map +1 -0
- package/dist/tools/drag-drop.d.ts +6 -0
- package/dist/tools/drag-drop.d.ts.map +1 -0
- package/dist/tools/drag-drop.js +263 -0
- package/dist/tools/drag-drop.js.map +1 -0
- package/dist/tools/emulate-device.d.ts +6 -0
- package/dist/tools/emulate-device.d.ts.map +1 -0
- package/dist/tools/emulate-device.js +219 -0
- package/dist/tools/emulate-device.js.map +1 -0
- package/dist/tools/file-upload.d.ts +6 -0
- package/dist/tools/file-upload.d.ts.map +1 -0
- package/dist/tools/file-upload.js +224 -0
- package/dist/tools/file-upload.js.map +1 -0
- package/dist/tools/fill-form.d.ts +8 -0
- package/dist/tools/fill-form.d.ts.map +1 -0
- package/dist/tools/fill-form.js +311 -0
- package/dist/tools/fill-form.js.map +1 -0
- package/dist/tools/find.d.ts +6 -0
- package/dist/tools/find.d.ts.map +1 -0
- package/dist/tools/find.js +163 -0
- package/dist/tools/find.js.map +1 -0
- package/dist/tools/form-input.d.ts +6 -0
- package/dist/tools/form-input.d.ts.map +1 -0
- package/dist/tools/form-input.js +219 -0
- package/dist/tools/form-input.js.map +1 -0
- package/dist/tools/geolocation.d.ts +6 -0
- package/dist/tools/geolocation.d.ts.map +1 -0
- package/dist/tools/geolocation.js +170 -0
- package/dist/tools/geolocation.js.map +1 -0
- package/dist/tools/http-auth.d.ts +6 -0
- package/dist/tools/http-auth.d.ts.map +1 -0
- package/dist/tools/http-auth.js +132 -0
- package/dist/tools/http-auth.js.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +107 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/inspect.d.ts +12 -0
- package/dist/tools/inspect.d.ts.map +1 -0
- package/dist/tools/inspect.js +483 -0
- package/dist/tools/inspect.js.map +1 -0
- package/dist/tools/interact.d.ts +9 -0
- package/dist/tools/interact.d.ts.map +1 -0
- package/dist/tools/interact.js +366 -0
- package/dist/tools/interact.js.map +1 -0
- package/dist/tools/javascript.d.ts +7 -0
- package/dist/tools/javascript.d.ts.map +1 -0
- package/dist/tools/javascript.js +214 -0
- package/dist/tools/javascript.js.map +1 -0
- package/dist/tools/lightweight-scroll.d.ts +11 -0
- package/dist/tools/lightweight-scroll.d.ts.map +1 -0
- package/dist/tools/lightweight-scroll.js +314 -0
- package/dist/tools/lightweight-scroll.js.map +1 -0
- package/dist/tools/list-profiles.d.ts +10 -0
- package/dist/tools/list-profiles.d.ts.map +1 -0
- package/dist/tools/list-profiles.js +79 -0
- package/dist/tools/list-profiles.js.map +1 -0
- package/dist/tools/memory.d.ts +13 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +159 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/navigate.d.ts +6 -0
- package/dist/tools/navigate.d.ts.map +1 -0
- package/dist/tools/navigate.js +422 -0
- package/dist/tools/navigate.js.map +1 -0
- package/dist/tools/network.d.ts +6 -0
- package/dist/tools/network.d.ts.map +1 -0
- package/dist/tools/network.js +229 -0
- package/dist/tools/network.js.map +1 -0
- package/dist/tools/orchestration.d.ts +6 -0
- package/dist/tools/orchestration.d.ts.map +1 -0
- package/dist/tools/orchestration.js +735 -0
- package/dist/tools/orchestration.js.map +1 -0
- package/dist/tools/page-content.d.ts +6 -0
- package/dist/tools/page-content.d.ts.map +1 -0
- package/dist/tools/page-content.js +129 -0
- package/dist/tools/page-content.js.map +1 -0
- package/dist/tools/page-pdf.d.ts +6 -0
- package/dist/tools/page-pdf.d.ts.map +1 -0
- package/dist/tools/page-pdf.js +268 -0
- package/dist/tools/page-pdf.js.map +1 -0
- package/dist/tools/page-reload.d.ts +6 -0
- package/dist/tools/page-reload.d.ts.map +1 -0
- package/dist/tools/page-reload.js +91 -0
- package/dist/tools/page-reload.js.map +1 -0
- package/dist/tools/performance-metrics.d.ts +6 -0
- package/dist/tools/performance-metrics.d.ts.map +1 -0
- package/dist/tools/performance-metrics.js +154 -0
- package/dist/tools/performance-metrics.js.map +1 -0
- package/dist/tools/profile-status.d.ts +10 -0
- package/dist/tools/profile-status.d.ts.map +1 -0
- package/dist/tools/profile-status.js +108 -0
- package/dist/tools/profile-status.js.map +1 -0
- package/dist/tools/query-dom.d.ts +8 -0
- package/dist/tools/query-dom.d.ts.map +1 -0
- package/dist/tools/query-dom.js +647 -0
- package/dist/tools/query-dom.js.map +1 -0
- package/dist/tools/read-page.d.ts +6 -0
- package/dist/tools/read-page.d.ts.map +1 -0
- package/dist/tools/read-page.js +544 -0
- package/dist/tools/read-page.js.map +1 -0
- package/dist/tools/request-intercept.d.ts +6 -0
- package/dist/tools/request-intercept.d.ts.map +1 -0
- package/dist/tools/request-intercept.js +537 -0
- package/dist/tools/request-intercept.js.map +1 -0
- package/dist/tools/shutdown.d.ts +12 -0
- package/dist/tools/shutdown.d.ts.map +1 -0
- package/dist/tools/shutdown.js +124 -0
- package/dist/tools/shutdown.js.map +1 -0
- package/dist/tools/storage.d.ts +6 -0
- package/dist/tools/storage.d.ts.map +1 -0
- package/dist/tools/storage.js +262 -0
- package/dist/tools/storage.js.map +1 -0
- package/dist/tools/tabs-close.d.ts +6 -0
- package/dist/tools/tabs-close.d.ts.map +1 -0
- package/dist/tools/tabs-close.js +124 -0
- package/dist/tools/tabs-close.js.map +1 -0
- package/dist/tools/tabs-context.d.ts +6 -0
- package/dist/tools/tabs-context.d.ts.map +1 -0
- package/dist/tools/tabs-context.js +117 -0
- package/dist/tools/tabs-context.js.map +1 -0
- package/dist/tools/tabs-create.d.ts +6 -0
- package/dist/tools/tabs-create.d.ts.map +1 -0
- package/dist/tools/tabs-create.js +90 -0
- package/dist/tools/tabs-create.js.map +1 -0
- package/dist/tools/user-agent.d.ts +6 -0
- package/dist/tools/user-agent.d.ts.map +1 -0
- package/dist/tools/user-agent.js +126 -0
- package/dist/tools/user-agent.js.map +1 -0
- package/dist/tools/wait-and-click.d.ts +8 -0
- package/dist/tools/wait-and-click.d.ts.map +1 -0
- package/dist/tools/wait-and-click.js +165 -0
- package/dist/tools/wait-and-click.js.map +1 -0
- package/dist/tools/wait-for.d.ts +6 -0
- package/dist/tools/wait-for.d.ts.map +1 -0
- package/dist/tools/wait-for.js +290 -0
- package/dist/tools/wait-for.js.map +1 -0
- package/dist/tools/worker.d.ts +8 -0
- package/dist/tools/worker.d.ts.map +1 -0
- package/dist/tools/worker.js +160 -0
- package/dist/tools/worker.js.map +1 -0
- package/dist/types/browser-backend.d.ts +30 -0
- package/dist/types/browser-backend.d.ts.map +1 -0
- package/dist/types/browser-backend.js +9 -0
- package/dist/types/browser-backend.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/mcp.d.ts +63 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +14 -0
- package/dist/types/mcp.js.map +1 -0
- package/dist/types/plan-cache.d.ts +121 -0
- package/dist/types/plan-cache.d.ts.map +1 -0
- package/dist/types/plan-cache.js +9 -0
- package/dist/types/plan-cache.js.map +1 -0
- package/dist/types/session.d.ts +65 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/session.js +6 -0
- package/dist/types/session.js.map +1 -0
- package/dist/types/tool-manifest.d.ts +52 -0
- package/dist/types/tool-manifest.d.ts.map +1 -0
- package/dist/types/tool-manifest.js +37 -0
- package/dist/types/tool-manifest.js.map +1 -0
- package/dist/utils/adaptive-screenshot.d.ts +57 -0
- package/dist/utils/adaptive-screenshot.d.ts.map +1 -0
- package/dist/utils/adaptive-screenshot.js +126 -0
- package/dist/utils/adaptive-screenshot.js.map +1 -0
- package/dist/utils/atomic-file.d.ts +50 -0
- package/dist/utils/atomic-file.d.ts.map +1 -0
- package/dist/utils/atomic-file.js +217 -0
- package/dist/utils/atomic-file.js.map +1 -0
- package/dist/utils/dom-delta.d.ts +36 -0
- package/dist/utils/dom-delta.d.ts.map +1 -0
- package/dist/utils/dom-delta.js +314 -0
- package/dist/utils/dom-delta.js.map +1 -0
- package/dist/utils/element-discovery.d.ts +115 -0
- package/dist/utils/element-discovery.d.ts.map +1 -0
- package/dist/utils/element-discovery.js +519 -0
- package/dist/utils/element-discovery.js.map +1 -0
- package/dist/utils/element-finder.d.ts +49 -0
- package/dist/utils/element-finder.d.ts.map +1 -0
- package/dist/utils/element-finder.js +130 -0
- package/dist/utils/element-finder.js.map +1 -0
- package/dist/utils/format-age.d.ts +5 -0
- package/dist/utils/format-age.d.ts.map +1 -0
- package/dist/utils/format-age.js +15 -0
- package/dist/utils/format-age.js.map +1 -0
- package/dist/utils/format-error.d.ts +5 -0
- package/dist/utils/format-error.d.ts.map +1 -0
- package/dist/utils/format-error.js +10 -0
- package/dist/utils/format-error.js.map +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +23 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/json-validator.d.ts +40 -0
- package/dist/utils/json-validator.d.ts.map +1 -0
- package/dist/utils/json-validator.js +295 -0
- package/dist/utils/json-validator.js.map +1 -0
- package/dist/utils/page-diagnostics.d.ts +23 -0
- package/dist/utils/page-diagnostics.d.ts.map +1 -0
- package/dist/utils/page-diagnostics.js +95 -0
- package/dist/utils/page-diagnostics.js.map +1 -0
- package/dist/utils/pagination-detector.d.ts +22 -0
- package/dist/utils/pagination-detector.d.ts.map +1 -0
- package/dist/utils/pagination-detector.js +292 -0
- package/dist/utils/pagination-detector.js.map +1 -0
- package/dist/utils/pid-manager.d.ts +6 -0
- package/dist/utils/pid-manager.d.ts.map +1 -0
- package/dist/utils/pid-manager.js +135 -0
- package/dist/utils/pid-manager.js.map +1 -0
- package/dist/utils/puppeteer-helpers.d.ts +8 -0
- package/dist/utils/puppeteer-helpers.d.ts.map +1 -0
- package/dist/utils/puppeteer-helpers.js +12 -0
- package/dist/utils/puppeteer-helpers.js.map +1 -0
- package/dist/utils/ref-id-manager.d.ts +72 -0
- package/dist/utils/ref-id-manager.d.ts.map +1 -0
- package/dist/utils/ref-id-manager.js +325 -0
- package/dist/utils/ref-id-manager.js.map +1 -0
- package/dist/utils/request-queue.d.ts +37 -0
- package/dist/utils/request-queue.d.ts.map +1 -0
- package/dist/utils/request-queue.js +114 -0
- package/dist/utils/request-queue.js.map +1 -0
- package/dist/utils/retry-with-fallback.d.ts +18 -0
- package/dist/utils/retry-with-fallback.d.ts.map +1 -0
- package/dist/utils/retry-with-fallback.js +39 -0
- package/dist/utils/retry-with-fallback.js.map +1 -0
- package/dist/utils/safe-title.d.ts +10 -0
- package/dist/utils/safe-title.d.ts.map +1 -0
- package/dist/utils/safe-title.js +24 -0
- package/dist/utils/safe-title.js.map +1 -0
- package/dist/utils/schema-validator.d.ts +12 -0
- package/dist/utils/schema-validator.d.ts.map +1 -0
- package/dist/utils/schema-validator.js +70 -0
- package/dist/utils/schema-validator.js.map +1 -0
- package/dist/utils/shadow-dom.d.ts +114 -0
- package/dist/utils/shadow-dom.d.ts.map +1 -0
- package/dist/utils/shadow-dom.js +385 -0
- package/dist/utils/shadow-dom.js.map +1 -0
- package/dist/utils/smart-goto.d.ts +39 -0
- package/dist/utils/smart-goto.d.ts.map +1 -0
- package/dist/utils/smart-goto.js +134 -0
- package/dist/utils/smart-goto.js.map +1 -0
- package/dist/utils/url-utils.d.ts +5 -0
- package/dist/utils/url-utils.d.ts.map +1 -0
- package/dist/utils/url-utils.js +15 -0
- package/dist/utils/url-utils.js.map +1 -0
- package/dist/utils/visual-summary.d.ts +17 -0
- package/dist/utils/visual-summary.d.ts.map +1 -0
- package/dist/utils/visual-summary.js +215 -0
- package/dist/utils/visual-summary.js.map +1 -0
- package/dist/utils/with-timeout.d.ts +5 -0
- package/dist/utils/with-timeout.d.ts.map +1 -0
- package/dist/utils/with-timeout.js +15 -0
- package/dist/utils/with-timeout.js.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +22 -0
- package/dist/version.js.map +1 -0
- package/package.json +1 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* PatternLearner — Adaptive memory system that learns error→recovery patterns.
|
|
4
|
+
*
|
|
5
|
+
* Flow:
|
|
6
|
+
* 1. Hint miss on error → start observing next 3 tool calls
|
|
7
|
+
* 2. If a different tool succeeds → record as recovery pattern
|
|
8
|
+
* 3. Same error→recovery seen N times → promote to learned rule
|
|
9
|
+
* 4. Persisted to JSON, survives across sessions
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
+
}) : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.PatternLearner = void 0;
|
|
46
|
+
const fs = __importStar(require("fs"));
|
|
47
|
+
const path = __importStar(require("path"));
|
|
48
|
+
class PatternLearner {
|
|
49
|
+
pending = [];
|
|
50
|
+
rawObservations = new Map();
|
|
51
|
+
patterns = [];
|
|
52
|
+
filePath = null;
|
|
53
|
+
dirty = false;
|
|
54
|
+
static WATCH_WINDOW = 3;
|
|
55
|
+
static PROMOTE_THRESHOLD = 3;
|
|
56
|
+
static CONFIDENCE_THRESHOLD = 0.6;
|
|
57
|
+
static MAX_PENDING = 10;
|
|
58
|
+
/**
|
|
59
|
+
* Enable persistence — load existing patterns and save new ones.
|
|
60
|
+
*/
|
|
61
|
+
enablePersistence(dirPath) {
|
|
62
|
+
try {
|
|
63
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
64
|
+
this.filePath = path.join(dirPath, 'learned-patterns.json');
|
|
65
|
+
this.load();
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// Best-effort
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Called when a hint miss occurs on an error (no static rule matched).
|
|
73
|
+
* Starts observing subsequent calls to detect recovery pattern.
|
|
74
|
+
*/
|
|
75
|
+
onMiss(toolName, errorText) {
|
|
76
|
+
const fingerprint = this.normalizeError(errorText);
|
|
77
|
+
if (!fingerprint)
|
|
78
|
+
return;
|
|
79
|
+
// Limit pending observations to prevent memory buildup
|
|
80
|
+
if (this.pending.length >= PatternLearner.MAX_PENDING) {
|
|
81
|
+
this.pending.shift();
|
|
82
|
+
}
|
|
83
|
+
this.pending.push({
|
|
84
|
+
errorTool: toolName,
|
|
85
|
+
errorFingerprint: fingerprint,
|
|
86
|
+
timestamp: Date.now(),
|
|
87
|
+
remainingSlots: PatternLearner.WATCH_WINDOW,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Called on every tool completion to observe potential recovery patterns.
|
|
92
|
+
*/
|
|
93
|
+
onToolComplete(toolName, isError) {
|
|
94
|
+
const resolved = [];
|
|
95
|
+
for (let i = 0; i < this.pending.length; i++) {
|
|
96
|
+
const obs = this.pending[i];
|
|
97
|
+
if (!isError && toolName !== obs.errorTool) {
|
|
98
|
+
// Success with different tool = potential recovery
|
|
99
|
+
this.recordRecovery(obs.errorFingerprint, obs.errorTool, toolName);
|
|
100
|
+
resolved.push(i);
|
|
101
|
+
}
|
|
102
|
+
else if (!isError && toolName === obs.errorTool) {
|
|
103
|
+
// Same tool succeeded = self-resolved, discard
|
|
104
|
+
resolved.push(i);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
// Another error, keep watching
|
|
108
|
+
obs.remainingSlots--;
|
|
109
|
+
if (obs.remainingSlots <= 0)
|
|
110
|
+
resolved.push(i);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Remove resolved observations (reverse order to preserve indices)
|
|
114
|
+
for (let i = resolved.length - 1; i >= 0; i--) {
|
|
115
|
+
this.pending.splice(resolved[i], 1);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Record an observed error→recovery correlation.
|
|
120
|
+
*/
|
|
121
|
+
recordRecovery(errorFingerprint, errorTool, recoveryTool) {
|
|
122
|
+
let raw = this.rawObservations.get(errorFingerprint);
|
|
123
|
+
if (!raw) {
|
|
124
|
+
raw = {
|
|
125
|
+
errorFingerprint,
|
|
126
|
+
errorTools: new Set(),
|
|
127
|
+
recoveryTools: new Map(),
|
|
128
|
+
totalObservations: 0,
|
|
129
|
+
};
|
|
130
|
+
this.rawObservations.set(errorFingerprint, raw);
|
|
131
|
+
}
|
|
132
|
+
raw.errorTools.add(errorTool);
|
|
133
|
+
raw.recoveryTools.set(recoveryTool, (raw.recoveryTools.get(recoveryTool) || 0) + 1);
|
|
134
|
+
raw.totalObservations++;
|
|
135
|
+
this.tryPromote(raw);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Check if a raw observation should be promoted to a learned pattern.
|
|
139
|
+
*/
|
|
140
|
+
tryPromote(raw) {
|
|
141
|
+
let bestTool = '';
|
|
142
|
+
let bestCount = 0;
|
|
143
|
+
for (const [tool, count] of raw.recoveryTools) {
|
|
144
|
+
if (count > bestCount) {
|
|
145
|
+
bestTool = tool;
|
|
146
|
+
bestCount = count;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const confidence = bestCount / raw.totalObservations;
|
|
150
|
+
if (bestCount < PatternLearner.PROMOTE_THRESHOLD || confidence < PatternLearner.CONFIDENCE_THRESHOLD) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const existing = this.patterns.find(p => p.errorFingerprint === raw.errorFingerprint);
|
|
154
|
+
if (existing) {
|
|
155
|
+
existing.occurrences = bestCount;
|
|
156
|
+
existing.confidence = confidence;
|
|
157
|
+
existing.recoveryTool = bestTool;
|
|
158
|
+
existing.lastSeen = Date.now();
|
|
159
|
+
existing.errorTools = Array.from(raw.errorTools);
|
|
160
|
+
existing.hint = PatternLearner.generateHint(bestTool, bestCount);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
this.patterns.push({
|
|
164
|
+
id: `learned-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`,
|
|
165
|
+
errorFingerprint: raw.errorFingerprint,
|
|
166
|
+
errorTools: Array.from(raw.errorTools),
|
|
167
|
+
recoveryTool: bestTool,
|
|
168
|
+
occurrences: bestCount,
|
|
169
|
+
confidence,
|
|
170
|
+
firstSeen: Date.now(),
|
|
171
|
+
lastSeen: Date.now(),
|
|
172
|
+
hint: PatternLearner.generateHint(bestTool, bestCount),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
this.dirty = true;
|
|
176
|
+
this.save();
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Match an error against learned patterns.
|
|
180
|
+
*/
|
|
181
|
+
matchPattern(errorText, toolName) {
|
|
182
|
+
const fingerprint = this.normalizeError(errorText);
|
|
183
|
+
for (const pattern of this.patterns) {
|
|
184
|
+
if (pattern.errorTools.includes(toolName) &&
|
|
185
|
+
(fingerprint.includes(pattern.errorFingerprint) || pattern.errorFingerprint.includes(fingerprint))) {
|
|
186
|
+
return pattern;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Normalize error text for fingerprinting.
|
|
193
|
+
* Strips dynamic values (IDs, large numbers) to group similar errors.
|
|
194
|
+
*/
|
|
195
|
+
normalizeError(text) {
|
|
196
|
+
return text
|
|
197
|
+
.toLowerCase()
|
|
198
|
+
.replace(/\b[0-9a-f]{8,}\b/g, '{id}')
|
|
199
|
+
.replace(/\d{4,}/g, '{n}')
|
|
200
|
+
.replace(/\s+/g, ' ')
|
|
201
|
+
.trim()
|
|
202
|
+
.slice(0, 100);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Get all learned patterns (for testing/inspection).
|
|
206
|
+
*/
|
|
207
|
+
getPatterns() {
|
|
208
|
+
return this.patterns;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Get pending observation count (for testing).
|
|
212
|
+
*/
|
|
213
|
+
getPendingCount() {
|
|
214
|
+
return this.pending.length;
|
|
215
|
+
}
|
|
216
|
+
static generateHint(recoveryTool, occurrences) {
|
|
217
|
+
return `Hint: Try ${recoveryTool} — learned from ${occurrences} previous recoveries.`;
|
|
218
|
+
}
|
|
219
|
+
load() {
|
|
220
|
+
if (!this.filePath)
|
|
221
|
+
return;
|
|
222
|
+
try {
|
|
223
|
+
const data = fs.readFileSync(this.filePath, 'utf-8');
|
|
224
|
+
const store = JSON.parse(data);
|
|
225
|
+
this.patterns = store.patterns || [];
|
|
226
|
+
}
|
|
227
|
+
catch {
|
|
228
|
+
this.patterns = [];
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Persist learned patterns to disk.
|
|
233
|
+
*/
|
|
234
|
+
save() {
|
|
235
|
+
if (!this.filePath || !this.dirty)
|
|
236
|
+
return;
|
|
237
|
+
try {
|
|
238
|
+
const dir = path.dirname(this.filePath);
|
|
239
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
240
|
+
const store = {
|
|
241
|
+
version: 1,
|
|
242
|
+
patterns: this.patterns,
|
|
243
|
+
updatedAt: Date.now(),
|
|
244
|
+
};
|
|
245
|
+
fs.writeFileSync(this.filePath, JSON.stringify(store, null, 2));
|
|
246
|
+
this.dirty = false;
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
// Best-effort
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
exports.PatternLearner = PatternLearner;
|
|
254
|
+
//# sourceMappingURL=pattern-learner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-learner.js","sourceRoot":"","sources":["../../src/hints/pattern-learner.ts"],"names":[],"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;QACvC,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACrB,CAAC;IACH,CAAC;IAED;;OAEG;IACH,IAAI;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO;QAC1C,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACxC,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACvC,MAAM,KAAK,GAAiB;gBAC1B,OAAO,EAAE,CAAC;gBACV,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;aACtB,CAAC;YACF,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAChE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,CAAC;QAAC,MAAM,CAAC;YACP,cAAc;QAChB,CAAC;IACH,CAAC;;AA3NH,wCA4NC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProgressTracker — Detects when the LLM agent is not making meaningful progress.
|
|
3
|
+
*
|
|
4
|
+
* Instead of matching specific error patterns, measures whether recent tool calls
|
|
5
|
+
* represent meaningful progress (URL change, content extraction, successful interaction)
|
|
6
|
+
* or spinning (auth redirects, stale refs, non-interactive clicks, timeouts).
|
|
7
|
+
*/
|
|
8
|
+
import type { ToolCallEvent } from '../dashboard/types.js';
|
|
9
|
+
export type ProgressStatus = 'progressing' | 'stalling' | 'stuck';
|
|
10
|
+
/**
|
|
11
|
+
* Signals in tool results that indicate NO meaningful progress was made,
|
|
12
|
+
* even if the tool call technically "succeeded".
|
|
13
|
+
*/
|
|
14
|
+
declare const NON_PROGRESS_SIGNALS: string[];
|
|
15
|
+
export declare class ProgressTracker {
|
|
16
|
+
/**
|
|
17
|
+
* Evaluate recent tool calls to determine if the agent is making progress.
|
|
18
|
+
*
|
|
19
|
+
* @param recentCalls - Last 5 tool calls from ActivityTracker (newest first)
|
|
20
|
+
* @param currentToolName - Current tool being evaluated
|
|
21
|
+
* @param currentResultText - Text content of current tool result
|
|
22
|
+
* @param currentIsError - Whether current tool call errored
|
|
23
|
+
* @returns ProgressStatus
|
|
24
|
+
*/
|
|
25
|
+
evaluate(recentCalls: ToolCallEvent[], _currentToolName: string, currentResultText: string, currentIsError: boolean): ProgressStatus;
|
|
26
|
+
/**
|
|
27
|
+
* Check if a tool result text contains non-progress signals.
|
|
28
|
+
* Used for the CURRENT tool call where we have the full result text.
|
|
29
|
+
*/
|
|
30
|
+
isProgressResult(resultText: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Check if a completed tool call was likely progress-producing.
|
|
33
|
+
* Used for PAST calls where we only have ToolCallEvent metadata.
|
|
34
|
+
*
|
|
35
|
+
* LIMITATION: For past calls with result='success' and no error field,
|
|
36
|
+
* this method returns true (progress) even if the actual result text
|
|
37
|
+
* contained non-progress signals. Only the CURRENT call's full result
|
|
38
|
+
* text is inspected by isProgressResult(). Past call evaluation is
|
|
39
|
+
* limited to the error field and tool metadata.
|
|
40
|
+
*/
|
|
41
|
+
private isLikelyProgressCall;
|
|
42
|
+
}
|
|
43
|
+
export { NON_PROGRESS_SIGNALS };
|
|
44
|
+
//# sourceMappingURL=progress-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-tracker.d.ts","sourceRoot":"","sources":["../../src/hints/progress-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,UAAU,GAAG,OAAO,CAAC;AAElE;;;GAGG;AACH,QAAA,MAAM,oBAAoB,UAmBzB,CAAC;AAEF,qBAAa,eAAe;IAC1B;;;;;;;;OAQG;IACH,QAAQ,CACN,WAAW,EAAE,aAAa,EAAE,EAC5B,gBAAgB,EAAE,MAAM,EACxB,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,OAAO,GACtB,cAAc;IAwCjB;;;OAGG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAM7C;;;;;;;;;OASG;IACH,OAAO,CAAC,oBAAoB;CAe7B;AAGD,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ProgressTracker — Detects when the LLM agent is not making meaningful progress.
|
|
4
|
+
*
|
|
5
|
+
* Instead of matching specific error patterns, measures whether recent tool calls
|
|
6
|
+
* represent meaningful progress (URL change, content extraction, successful interaction)
|
|
7
|
+
* or spinning (auth redirects, stale refs, non-interactive clicks, timeouts).
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.NON_PROGRESS_SIGNALS = exports.ProgressTracker = void 0;
|
|
11
|
+
/**
|
|
12
|
+
* Signals in tool results that indicate NO meaningful progress was made,
|
|
13
|
+
* even if the tool call technically "succeeded".
|
|
14
|
+
*/
|
|
15
|
+
const NON_PROGRESS_SIGNALS = [
|
|
16
|
+
'authRedirect', // Auth redirect detected
|
|
17
|
+
'not interactive', // Clicked non-interactive element
|
|
18
|
+
'is stale', // Stale ref
|
|
19
|
+
'timed out', // Timeout
|
|
20
|
+
'No significant visual change', // Screenshot unchanged
|
|
21
|
+
'element not found', // Element not found (tightened from 'not found')
|
|
22
|
+
'no longer available', // Tab gone
|
|
23
|
+
'Login page detected', // Login redirect (from hint)
|
|
24
|
+
'CAPTCHA', // CAPTCHA blocked
|
|
25
|
+
'404', // Page not found
|
|
26
|
+
'Access Denied', // Access denied
|
|
27
|
+
'Forbidden', // 403
|
|
28
|
+
'net::ERR_', // Chromium network errors
|
|
29
|
+
'Navigation timeout', // Puppeteer navigation timeout
|
|
30
|
+
'Protocol error', // CDP-level failures
|
|
31
|
+
'bot-check', // Bot verification page detected
|
|
32
|
+
'captcha detected', // CAPTCHA page detected
|
|
33
|
+
'Blocking page detected', // Any blocking page warning from navigate
|
|
34
|
+
];
|
|
35
|
+
exports.NON_PROGRESS_SIGNALS = NON_PROGRESS_SIGNALS;
|
|
36
|
+
class ProgressTracker {
|
|
37
|
+
/**
|
|
38
|
+
* Evaluate recent tool calls to determine if the agent is making progress.
|
|
39
|
+
*
|
|
40
|
+
* @param recentCalls - Last 5 tool calls from ActivityTracker (newest first)
|
|
41
|
+
* @param currentToolName - Current tool being evaluated
|
|
42
|
+
* @param currentResultText - Text content of current tool result
|
|
43
|
+
* @param currentIsError - Whether current tool call errored
|
|
44
|
+
* @returns ProgressStatus
|
|
45
|
+
*/
|
|
46
|
+
evaluate(recentCalls, _currentToolName, currentResultText, currentIsError) {
|
|
47
|
+
// Build a list of recent "progress" assessments including the current call
|
|
48
|
+
const currentIsProgress = !currentIsError && this.isProgressResult(currentResultText);
|
|
49
|
+
let consecutiveNonProgress = currentIsProgress ? 0 : 1;
|
|
50
|
+
let consecutiveErrors = currentIsError ? 1 : 0;
|
|
51
|
+
// Walk backward through recent calls
|
|
52
|
+
for (const call of recentCalls) {
|
|
53
|
+
if (call.result === 'error') {
|
|
54
|
+
consecutiveErrors++;
|
|
55
|
+
consecutiveNonProgress++;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
// Check if the successful call had non-progress signals
|
|
59
|
+
// We can only check error field; for successful calls we check the tool name pattern
|
|
60
|
+
const wasProgress = this.isLikelyProgressCall(call);
|
|
61
|
+
if (!wasProgress) {
|
|
62
|
+
consecutiveNonProgress++;
|
|
63
|
+
// Do NOT reset consecutiveErrors — a non-progress success
|
|
64
|
+
// is not evidence that the error streak ended
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
consecutiveErrors = 0; // Only reset on genuine progress
|
|
68
|
+
break; // Found progress, stop counting
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Stuck: 3+ consecutive errors, or 5+ non-progress calls
|
|
73
|
+
if (consecutiveErrors >= 3 || consecutiveNonProgress >= 5) {
|
|
74
|
+
return 'stuck';
|
|
75
|
+
}
|
|
76
|
+
// Stalling: 3+ non-progress calls (mix of errors and non-progress successes)
|
|
77
|
+
if (consecutiveNonProgress >= 3) {
|
|
78
|
+
return 'stalling';
|
|
79
|
+
}
|
|
80
|
+
return 'progressing';
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Check if a tool result text contains non-progress signals.
|
|
84
|
+
* Used for the CURRENT tool call where we have the full result text.
|
|
85
|
+
*/
|
|
86
|
+
isProgressResult(resultText) {
|
|
87
|
+
if (!resultText || resultText.trim().length === 0)
|
|
88
|
+
return false;
|
|
89
|
+
const lower = resultText.toLowerCase();
|
|
90
|
+
return !NON_PROGRESS_SIGNALS.some(signal => lower.includes(signal.toLowerCase()));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Check if a completed tool call was likely progress-producing.
|
|
94
|
+
* Used for PAST calls where we only have ToolCallEvent metadata.
|
|
95
|
+
*
|
|
96
|
+
* LIMITATION: For past calls with result='success' and no error field,
|
|
97
|
+
* this method returns true (progress) even if the actual result text
|
|
98
|
+
* contained non-progress signals. Only the CURRENT call's full result
|
|
99
|
+
* text is inspected by isProgressResult(). Past call evaluation is
|
|
100
|
+
* limited to the error field and tool metadata.
|
|
101
|
+
*/
|
|
102
|
+
isLikelyProgressCall(call) {
|
|
103
|
+
// Errors are never progress
|
|
104
|
+
if (call.result === 'error')
|
|
105
|
+
return false;
|
|
106
|
+
// If error field is set (even on "success"), check for non-progress signals
|
|
107
|
+
if (call.error) {
|
|
108
|
+
return !NON_PROGRESS_SIGNALS.some(signal => call.error.includes(signal));
|
|
109
|
+
}
|
|
110
|
+
// Tool-based heuristics for past calls without full result text:
|
|
111
|
+
// - navigate with very fast completion (~<500ms) might be a redirect
|
|
112
|
+
// - computer/click calls without errors are usually progress
|
|
113
|
+
// - read_page/find calls are usually progress (information gathering)
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.ProgressTracker = ProgressTracker;
|
|
118
|
+
//# sourceMappingURL=progress-tracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-tracker.js","sourceRoot":"","sources":["../../src/hints/progress-tracker.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAMH;;;GAGG;AACH,MAAM,oBAAoB,GAAG;IAC3B,cAAc,EAAqB,yBAAyB;IAC5D,iBAAiB,EAAkB,kCAAkC;IACrE,UAAU,EAAyB,YAAY;IAC/C,WAAW,EAAwB,UAAU;IAC7C,8BAA8B,EAAK,uBAAuB;IAC1D,mBAAmB,EAAgB,iDAAiD;IACpF,qBAAqB,EAAc,WAAW;IAC9C,qBAAqB,EAAc,6BAA6B;IAChE,SAAS,EAA0B,kBAAkB;IACrD,KAAK,EAA8B,iBAAiB;IACpD,eAAe,EAAoB,gBAAgB;IACnD,WAAW,EAAwB,MAAM;IACzC,WAAW,EAAwB,0BAA0B;IAC7D,oBAAoB,EAAe,+BAA+B;IAClE,gBAAgB,EAAmB,qBAAqB;IACxD,WAAW,EAAwB,iCAAiC;IACpE,kBAAkB,EAAiB,wBAAwB;IAC3D,wBAAwB,EAAW,0CAA0C;CAC9E,CAAC;AA+FO,oDAAoB;AA7F7B,MAAa,eAAe;IAC1B;;;;;;;;OAQG;IACH,QAAQ,CACN,WAA4B,EAC5B,gBAAwB,EACxB,iBAAyB,EACzB,cAAuB;QAEvB,2EAA2E;QAC3E,MAAM,iBAAiB,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;QAEt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AC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;;;OASG;IACK,oBAAoB,CAAC,IAAmB;QAC9C,4BAA4B;QAC5B,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC;QAE1C,4EAA4E;QAC5E,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,KAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;QAC5E,CAAC;QAED,iEAAiE;QACjE,qEAAqE;QACrE,6DAA6D;QAC7D,sEAAsE;QACtE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA1FD,0CA0FC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blocking Page Rules — detect CAPTCHAs, bot-checks, and access-denied pages.
|
|
3
|
+
* Fires on successful navigate results that contain a blockingPage field,
|
|
4
|
+
* providing immediate guidance instead of waiting for the progress tracker.
|
|
5
|
+
*/
|
|
6
|
+
import type { HintRule } from '../hint-engine';
|
|
7
|
+
export declare const blockingPageRules: HintRule[];
|
|
8
|
+
//# sourceMappingURL=blocking-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocking-page.d.ts","sourceRoot":"","sources":["../../../src/hints/rules/blocking-page.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,eAAO,MAAM,iBAAiB,EAAE,QAAQ,EAsDvC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Blocking Page Rules — detect CAPTCHAs, bot-checks, and access-denied pages.
|
|
4
|
+
* Fires on successful navigate results that contain a blockingPage field,
|
|
5
|
+
* providing immediate guidance instead of waiting for the progress tracker.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.blockingPageRules = void 0;
|
|
9
|
+
exports.blockingPageRules = [
|
|
10
|
+
{
|
|
11
|
+
name: 'captcha-detected',
|
|
12
|
+
priority: 120, // Higher than error-recovery (100-108), lower than navigate-to-login (150)
|
|
13
|
+
match(ctx) {
|
|
14
|
+
if (ctx.toolName !== 'navigate')
|
|
15
|
+
return null;
|
|
16
|
+
if (ctx.isError)
|
|
17
|
+
return null;
|
|
18
|
+
// Check for structured blockingPage field in navigate response
|
|
19
|
+
if (/"blockingPage"\s*:\s*\{[^}]*"type"\s*:\s*"captcha"/i.test(ctx.resultText)) {
|
|
20
|
+
return ('Hint: CAPTCHA detected on this page. OpenChrome cannot solve CAPTCHAs programmatically. ' +
|
|
21
|
+
'STOP all interaction attempts with this page. ' +
|
|
22
|
+
'Ask the user to solve the CAPTCHA in their Chrome browser, then use wait_for to detect when the page changes, and resume automation.');
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'bot-check-detected',
|
|
29
|
+
priority: 121,
|
|
30
|
+
match(ctx) {
|
|
31
|
+
if (ctx.toolName !== 'navigate')
|
|
32
|
+
return null;
|
|
33
|
+
if (ctx.isError)
|
|
34
|
+
return null;
|
|
35
|
+
if (/"blockingPage"\s*:\s*\{[^}]*"type"\s*:\s*"bot-check"/i.test(ctx.resultText)) {
|
|
36
|
+
return ('Hint: Bot verification detected. OpenChrome cannot bypass bot checks. ' +
|
|
37
|
+
'Ask the user to complete the verification in their Chrome browser, then retry navigation.');
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'access-denied-detected',
|
|
44
|
+
priority: 122,
|
|
45
|
+
match(ctx) {
|
|
46
|
+
if (ctx.toolName !== 'navigate')
|
|
47
|
+
return null;
|
|
48
|
+
if (ctx.isError)
|
|
49
|
+
return null;
|
|
50
|
+
if (/"blockingPage"\s*:\s*\{[^}]*"type"\s*:\s*"access-denied"/i.test(ctx.resultText)) {
|
|
51
|
+
return ('Hint: Access denied (403/Forbidden). The site may be blocking automated access. ' +
|
|
52
|
+
'Ask the user to verify they have permission to access this URL, or try navigating in their Chrome browser first.');
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
//# sourceMappingURL=blocking-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocking-page.js","sourceRoot":"","sources":["../../../src/hints/rules/blocking-page.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAIU,QAAA,iBAAiB,GAAe;IAC3C;QACE,IAAI,EAAE,kBAAkB;QACxB,QAAQ,EAAE,GAAG,EAAE,2EAA2E;QAC1F,KAAK,CAAC,GAAG;YACP,IAAI,GAAG,CAAC,QAAQ,KAAK,UAAU;gBAAE,OAAO,IAAI,CAAC;YAC7C,IAAI,GAAG,CAAC,OAAO;gBAAE,OAAO,IAAI,CAAC;YAE7B,+DAA+D;YAC/D,IAAI,qDAAqD,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC/E,OAAO,CACL,0FAA0F;oBAC1F,gDAAgD;oBAChD,sIAAsI,CACvI,CAAC;YACJ,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,QAAQ,EAAE,GAAG;QACb,KAAK,CAAC,GAAG;YACP,IAAI,GAAG,CAAC,QAAQ,KAAK,UAAU;gBAAE,OAAO,IAAI,CAAC;YAC7C,IAAI,GAAG,CAAC,OAAO;gBAAE,OAAO,IAAI,CAAC;YAE7B,IAAI,uDAAuD,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBACjF,OAAO,CACL,wEAAwE;oBACxE,2FAA2F,CAC5F,CAAC;YACJ,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,QAAQ,EAAE,GAAG;QACb,KAAK,CAAC,GAAG;YACP,IAAI,GAAG,CAAC,QAAQ,KAAK,UAAU;gBAAE,OAAO,IAAI,CAAC;YAC7C,IAAI,GAAG,CAAC,OAAO;gBAAE,OAAO,IAAI,CAAC;YAE7B,IAAI,2DAA2D,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBACrF,OAAO,CACL,kFAAkF;oBAClF,kHAAkH,CACnH,CAAC;YACJ,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composite-suggestions.d.ts","sourceRoot":"","sources":["../../../src/hints/rules/composite-suggestions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AAU5D,eAAO,MAAM,wBAAwB,EAAE,QAAQ,EAqH9C,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Composite Suggestions — suggests combining multi-step patterns into single calls.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.compositeSuggestionRules = void 0;
|
|
7
|
+
function lastToolWas(ctx, name) {
|
|
8
|
+
return ctx.recentCalls.length > 0 && ctx.recentCalls[0].toolName === name;
|
|
9
|
+
}
|
|
10
|
+
function recentToolCount(ctx, name) {
|
|
11
|
+
return ctx.recentCalls.filter(c => c.toolName === name).length;
|
|
12
|
+
}
|
|
13
|
+
exports.compositeSuggestionRules = [
|
|
14
|
+
{
|
|
15
|
+
name: 'find-then-click',
|
|
16
|
+
priority: 200,
|
|
17
|
+
maxSeverity: 'info',
|
|
18
|
+
match(ctx) {
|
|
19
|
+
if (ctx.toolName !== 'computer' && ctx.toolName !== 'click')
|
|
20
|
+
return null;
|
|
21
|
+
if (!lastToolWas(ctx, 'find'))
|
|
22
|
+
return null;
|
|
23
|
+
return 'Hint: Use click_element to find+click in one call.';
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'multiple-form-input',
|
|
28
|
+
priority: 201,
|
|
29
|
+
maxSeverity: 'warning',
|
|
30
|
+
match(ctx) {
|
|
31
|
+
if (ctx.toolName !== 'form_input')
|
|
32
|
+
return null;
|
|
33
|
+
if (recentToolCount(ctx, 'form_input') >= 1) {
|
|
34
|
+
return 'Hint: Use fill_form({fields:{...}}) for multiple fields.';
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'navigate-then-click',
|
|
41
|
+
priority: 202,
|
|
42
|
+
maxSeverity: 'info',
|
|
43
|
+
match(ctx) {
|
|
44
|
+
if (ctx.toolName !== 'computer' && ctx.toolName !== 'click' && ctx.toolName !== 'click_element')
|
|
45
|
+
return null;
|
|
46
|
+
if (!lastToolWas(ctx, 'navigate'))
|
|
47
|
+
return null;
|
|
48
|
+
// Don't match screenshot operations — handled by sequence-detection
|
|
49
|
+
if (/screenshot/i.test(ctx.resultText))
|
|
50
|
+
return null;
|
|
51
|
+
return 'Hint: Use wait_and_click to handle loading delays.';
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'read-page-truncated',
|
|
56
|
+
priority: 203,
|
|
57
|
+
maxSeverity: 'info',
|
|
58
|
+
match(ctx) {
|
|
59
|
+
if (ctx.toolName !== 'read_page')
|
|
60
|
+
return null;
|
|
61
|
+
if (ctx.isError)
|
|
62
|
+
return null;
|
|
63
|
+
if (/truncat|too (long|large)|content cut|\.\.\.$/i.test(ctx.resultText)) {
|
|
64
|
+
return 'Hint: Output was truncated. Use inspect(query) for targeted state checks, find(query) for element search, or read_page mode="dom" for compact output.';
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'contenteditable-click-hint',
|
|
71
|
+
priority: 204, // After existing composite rules (200-203)
|
|
72
|
+
maxSeverity: 'info',
|
|
73
|
+
match(ctx) {
|
|
74
|
+
if (ctx.toolName !== 'computer')
|
|
75
|
+
return null;
|
|
76
|
+
if (ctx.isError)
|
|
77
|
+
return null;
|
|
78
|
+
// Check if the hit info mentions contenteditable
|
|
79
|
+
if (/contenteditable|lexical|prosemirror|tiptap|slate|editor/i.test(ctx.resultText)) {
|
|
80
|
+
return ('Hint: Click inside a rich text editor (contenteditable). ' +
|
|
81
|
+
'Editor frameworks may intercept click events. ' +
|
|
82
|
+
'Prefer: (1) click_element with text query, (2) javascript_tool for direct element.click(), ' +
|
|
83
|
+
'(3) read_page mode="dom" to get backendNodeId then use computer ref parameter.');
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'coordinate-click-after-read',
|
|
90
|
+
priority: 205,
|
|
91
|
+
maxSeverity: 'warning',
|
|
92
|
+
match(ctx) {
|
|
93
|
+
if (ctx.toolName !== 'computer')
|
|
94
|
+
return null;
|
|
95
|
+
if (ctx.isError)
|
|
96
|
+
return null;
|
|
97
|
+
// Check if this is a coordinate click (not ref-based)
|
|
98
|
+
if (!/Clicked at \(\d/.test(ctx.resultText))
|
|
99
|
+
return null;
|
|
100
|
+
// Check if the hit was not interactive
|
|
101
|
+
if (/\[not interactive\]/.test(ctx.resultText)) {
|
|
102
|
+
return ('Hint: Clicked a non-interactive element. Use click_element with a text query ' +
|
|
103
|
+
'or read_page mode="dom" to find the correct target.');
|
|
104
|
+
}
|
|
105
|
+
return null;
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'state-check-after-action',
|
|
110
|
+
priority: 206,
|
|
111
|
+
maxSeverity: 'warning',
|
|
112
|
+
match(ctx) {
|
|
113
|
+
if (ctx.toolName !== 'read_page')
|
|
114
|
+
return null;
|
|
115
|
+
if (lastToolWas(ctx, 'navigate') ||
|
|
116
|
+
lastToolWas(ctx, 'click_element') ||
|
|
117
|
+
lastToolWas(ctx, 'wait_and_click') ||
|
|
118
|
+
lastToolWas(ctx, 'interact')) {
|
|
119
|
+
return 'Hint: Use inspect(query) for quick page state checks after actions — e.g. inspect("error messages") or inspect("form field values").';
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'repeated-read-page',
|
|
126
|
+
priority: 207,
|
|
127
|
+
maxSeverity: 'warning',
|
|
128
|
+
match(ctx) {
|
|
129
|
+
if (ctx.toolName !== 'read_page')
|
|
130
|
+
return null;
|
|
131
|
+
if (recentToolCount(ctx, 'read_page') >= 2) {
|
|
132
|
+
return 'Hint: Use inspect(query) for targeted extraction instead of repeated full page reads — e.g. inspect("what tabs are active") or inspect("visible errors").';
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
];
|
|
138
|
+
//# sourceMappingURL=composite-suggestions.js.map
|