explorbot 0.0.1 → 0.1.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 +80 -26
- package/bin/explorbot-cli.ts +680 -0
- package/boat/api-tester/src/ai/chief/styles.ts +15 -0
- package/boat/api-tester/src/ai/chief.ts +335 -0
- package/boat/api-tester/src/ai/curler-tools.ts +278 -0
- package/boat/api-tester/src/ai/curler.ts +306 -0
- package/boat/api-tester/src/api-client.ts +28 -0
- package/boat/api-tester/src/apibot.ts +203 -0
- package/boat/api-tester/src/cli.ts +301 -0
- package/boat/api-tester/src/config.ts +190 -0
- package/dist/bin/explorbot-cli.js +23 -101
- package/dist/boat/api-tester/bin/apibot-cli.js +0 -1
- package/dist/boat/api-tester/src/ai/chief/styles.js +0 -1
- package/dist/boat/api-tester/src/ai/chief.js +0 -1
- package/dist/boat/api-tester/src/ai/curler-tools.js +0 -1
- package/dist/boat/api-tester/src/ai/curler.js +0 -1
- package/dist/boat/api-tester/src/api-client.js +0 -1
- package/dist/boat/api-tester/src/apibot.js +0 -1
- package/dist/boat/api-tester/src/cli.js +0 -1
- package/dist/boat/api-tester/src/config.js +0 -1
- package/dist/src/action-result.js +0 -1
- package/dist/src/action.js +14 -12
- package/dist/src/activity.js +0 -1
- package/dist/src/ai/agent.js +0 -1
- package/dist/src/ai/bosun.js +0 -1
- package/dist/src/ai/captain/idle-mode.js +0 -1
- package/dist/src/ai/captain/mixin.js +0 -1
- package/dist/src/ai/captain/test-mode.js +0 -1
- package/dist/src/ai/captain/web-mode.js +0 -1
- package/dist/src/ai/captain.js +0 -1
- package/dist/src/ai/conversation.js +0 -1
- package/dist/src/ai/experience-compactor.js +0 -1
- package/dist/src/ai/fisherman-tools.js +0 -1
- package/dist/src/ai/fisherman.js +0 -1
- package/dist/src/ai/historian.js +0 -1
- package/dist/src/ai/navigator.js +0 -1
- package/dist/src/ai/pilot.js +0 -1
- package/dist/src/ai/planner/session-dedup.js +0 -1
- package/dist/src/ai/planner/styles.js +0 -1
- package/dist/src/ai/planner/subpages.js +42 -7
- package/dist/src/ai/planner.js +15 -4
- package/dist/src/ai/provider.js +0 -1
- package/dist/src/ai/quartermaster.js +0 -1
- package/dist/src/ai/researcher/cache.js +13 -9
- package/dist/src/ai/researcher/coordinates.js +4 -3
- package/dist/src/ai/researcher/deep-analysis.js +16 -20
- package/dist/src/ai/researcher/fingerprint-worker.js +0 -1
- package/dist/src/ai/researcher/focus.js +0 -1
- package/dist/src/ai/researcher/locators.js +1 -2
- package/dist/src/ai/researcher/mixin.js +0 -1
- package/dist/src/ai/researcher/parser.js +4 -4
- package/dist/src/ai/researcher/research-result.js +2 -1
- package/dist/src/ai/researcher.js +6 -6
- package/dist/src/ai/rules.js +0 -1
- package/dist/src/ai/task-agent.js +0 -1
- package/dist/src/ai/tester.js +0 -1
- package/dist/src/ai/tools.js +4 -1
- package/dist/src/api/api-client.js +0 -1
- package/dist/src/api/request-result.js +0 -1
- package/dist/src/api/request-store.js +0 -1
- package/dist/src/api/spec-reader.js +0 -1
- package/dist/src/api/xhr-capture.js +0 -1
- package/dist/src/browser-server.js +0 -1
- package/dist/src/command-handler.js +0 -1
- package/dist/src/commands/add-rule-command.js +0 -1
- package/dist/src/commands/base-command.js +0 -1
- package/dist/src/commands/clean-command.js +0 -1
- package/dist/src/commands/context-aria-command.js +0 -1
- package/dist/src/commands/context-command.js +2 -3
- package/dist/src/commands/context-data-command.js +0 -1
- package/dist/src/commands/context-experience-command.js +0 -1
- package/dist/src/commands/context-html-command.js +0 -1
- package/dist/src/commands/context-knowledge-command.js +0 -1
- package/dist/src/commands/debug-command.js +0 -1
- package/dist/src/commands/drill-command.js +0 -1
- package/dist/src/commands/exit-command.js +0 -1
- package/dist/src/commands/explore-command.js +3 -3
- package/dist/src/commands/freesail-command.js +0 -1
- package/dist/src/commands/help-command.js +0 -1
- package/dist/src/commands/index.js +0 -1
- package/dist/src/commands/init-command.js +117 -0
- package/dist/src/commands/knows-command.js +0 -1
- package/dist/src/commands/learn-command.js +0 -1
- package/dist/src/commands/navigate-command.js +0 -1
- package/dist/src/commands/path-command.js +0 -1
- package/dist/src/commands/plan-clear-command.js +0 -1
- package/dist/src/commands/plan-command.js +6 -2
- package/dist/src/commands/plan-edit-command.js +0 -1
- package/dist/src/commands/plan-load-command.js +0 -1
- package/dist/src/commands/plan-reload-command.js +0 -1
- package/dist/src/commands/plan-save-command.js +0 -1
- package/dist/src/commands/research-command.js +0 -1
- package/dist/src/commands/start-command.js +0 -1
- package/dist/src/commands/status-command.js +0 -1
- package/dist/src/commands/test-command.js +0 -1
- package/dist/src/components/ActivityPane.js +0 -1
- package/dist/src/components/AddKnowledge.js +0 -1
- package/dist/src/components/AddRule.js +0 -1
- package/dist/src/components/App.js +0 -1
- package/dist/src/components/Autocomplete.js +0 -1
- package/dist/src/components/InputPane.js +0 -1
- package/dist/src/components/InputReadline.js +0 -1
- package/dist/src/components/LogPane.js +0 -1
- package/dist/src/components/PlanEditor.js +0 -1
- package/dist/src/components/PlanPane.js +0 -1
- package/dist/src/components/SessionTimer.js +0 -1
- package/dist/src/components/StateTransitionPane.js +0 -1
- package/dist/src/components/StatusPane.js +0 -1
- package/dist/src/components/TaskPane.js +0 -1
- package/dist/src/components/Welcome.js +0 -1
- package/dist/src/components/WelcomeChecklist.js +0 -1
- package/dist/src/components/WelcomeCommands.js +0 -1
- package/dist/src/components/autocomplete-store.js +0 -1
- package/dist/src/components/parse-keypress.js +0 -1
- package/dist/src/config.js +0 -1
- package/dist/src/execution-controller.js +0 -1
- package/dist/src/experience-tracker.js +0 -1
- package/dist/src/explorbot.js +1 -2
- package/dist/src/explorer.js +58 -17
- package/dist/src/index.js +0 -1
- package/dist/src/knowledge-tracker.js +2 -2
- package/dist/src/observability.js +0 -1
- package/dist/src/reporter.js +0 -1
- package/dist/src/state-manager.js +0 -1
- package/dist/src/stats.js +0 -1
- package/dist/src/test-plan.js +0 -1
- package/dist/src/utils/aria.js +0 -1
- package/dist/src/utils/cli-name.js +16 -0
- package/dist/src/utils/code-extractor.js +0 -1
- package/dist/src/utils/context-formatter.js +0 -1
- package/dist/src/utils/error-page.js +0 -1
- package/dist/src/utils/expandable.js +0 -1
- package/dist/src/utils/hooks-runner.js +0 -1
- package/dist/src/utils/html-diff.js +0 -1
- package/dist/src/utils/html.js +0 -1
- package/dist/src/utils/logger.js +0 -1
- package/dist/src/utils/loop.js +0 -1
- package/dist/src/utils/markdown-parser.js +0 -1
- package/dist/src/utils/markdown-query.js +0 -1
- package/dist/src/utils/markdown-terminal.js +0 -1
- package/dist/src/utils/research-parser.js +0 -1
- package/dist/src/utils/retry.js +0 -1
- package/dist/src/utils/rules-loader.js +0 -1
- package/dist/src/utils/strings.js +0 -1
- package/dist/src/utils/test-plan-markdown.js +0 -1
- package/dist/src/utils/throttle.js +0 -1
- package/dist/src/utils/unique-names.js +0 -1
- package/dist/src/utils/url-matcher.js +0 -1
- package/dist/src/utils/web-element.js +6 -5
- package/dist/src/utils/xpath.js +0 -1
- package/package.json +28 -4
- package/src/action-result.ts +694 -0
- package/src/action.ts +449 -0
- package/src/activity.ts +111 -0
- package/src/ai/agent.ts +3 -0
- package/src/ai/bosun.ts +557 -0
- package/src/ai/captain/idle-mode.ts +116 -0
- package/src/ai/captain/mixin.ts +22 -0
- package/src/ai/captain/test-mode.ts +262 -0
- package/src/ai/captain/web-mode.ts +136 -0
- package/src/ai/captain.ts +504 -0
- package/src/ai/conversation.ts +205 -0
- package/src/ai/experience-compactor.ts +284 -0
- package/src/ai/fisherman-tools.ts +181 -0
- package/src/ai/fisherman.ts +223 -0
- package/src/ai/historian.ts +457 -0
- package/src/ai/navigator.ts +572 -0
- package/src/ai/pilot.ts +776 -0
- package/src/ai/planner/session-dedup.ts +35 -0
- package/src/ai/planner/styles.ts +17 -0
- package/src/ai/planner/subpages.ts +171 -0
- package/src/ai/planner.ts +549 -0
- package/src/ai/provider.ts +613 -0
- package/src/ai/quartermaster.ts +286 -0
- package/src/ai/researcher/cache.ts +109 -0
- package/src/ai/researcher/coordinates.ts +239 -0
- package/src/ai/researcher/deep-analysis.ts +412 -0
- package/src/ai/researcher/fingerprint-worker.ts +59 -0
- package/src/ai/researcher/focus.ts +42 -0
- package/src/ai/researcher/locators.ts +282 -0
- package/src/ai/researcher/mixin.ts +4 -0
- package/src/ai/researcher/parser.ts +186 -0
- package/src/ai/researcher/research-result.ts +116 -0
- package/src/ai/researcher.ts +858 -0
- package/src/ai/rules.ts +376 -0
- package/src/ai/task-agent.ts +141 -0
- package/src/ai/tester.ts +939 -0
- package/src/ai/tools.ts +1122 -0
- package/src/api/api-client.ts +109 -0
- package/src/api/request-result.ts +212 -0
- package/src/api/request-store.ts +130 -0
- package/src/api/spec-reader.ts +174 -0
- package/src/api/xhr-capture.ts +100 -0
- package/src/browser-server.ts +74 -0
- package/src/command-handler.ts +454 -0
- package/src/commands/add-rule-command.ts +63 -0
- package/src/commands/base-command.ts +27 -0
- package/src/commands/clean-command.ts +73 -0
- package/src/commands/context-aria-command.ts +22 -0
- package/src/commands/context-command.ts +67 -0
- package/src/commands/context-data-command.ts +30 -0
- package/src/commands/context-experience-command.ts +48 -0
- package/src/commands/context-html-command.ts +33 -0
- package/src/commands/context-knowledge-command.ts +43 -0
- package/src/commands/debug-command.ts +13 -0
- package/src/commands/drill-command.ts +34 -0
- package/src/commands/exit-command.ts +32 -0
- package/src/commands/explore-command.ts +129 -0
- package/src/commands/freesail-command.ts +95 -0
- package/src/commands/help-command.ts +8 -0
- package/src/commands/index.ts +69 -0
- package/src/commands/init-command.ts +131 -0
- package/src/commands/knows-command.ts +68 -0
- package/src/commands/learn-command.ts +44 -0
- package/src/commands/navigate-command.ts +18 -0
- package/src/commands/path-command.ts +83 -0
- package/src/commands/plan-clear-command.ts +14 -0
- package/src/commands/plan-command.ts +46 -0
- package/src/commands/plan-edit-command.ts +9 -0
- package/src/commands/plan-load-command.ts +18 -0
- package/src/commands/plan-reload-command.ts +28 -0
- package/src/commands/plan-save-command.ts +25 -0
- package/src/commands/research-command.ts +45 -0
- package/src/commands/start-command.ts +13 -0
- package/src/commands/status-command.tsx +23 -0
- package/src/commands/test-command.ts +84 -0
- package/src/components/ActivityPane.tsx +80 -0
- package/src/components/AddKnowledge.tsx +169 -0
- package/src/components/AddRule.tsx +174 -0
- package/src/components/App.tsx +377 -0
- package/src/components/Autocomplete.tsx +63 -0
- package/src/components/InputPane.tsx +259 -0
- package/src/components/InputReadline.tsx +704 -0
- package/src/components/LogPane.tsx +187 -0
- package/src/components/PlanEditor.tsx +150 -0
- package/src/components/PlanPane.tsx +71 -0
- package/src/components/SessionTimer.tsx +35 -0
- package/src/components/StateTransitionPane.tsx +149 -0
- package/src/components/StatusPane.tsx +62 -0
- package/src/components/TaskPane.tsx +119 -0
- package/src/components/Welcome.tsx +83 -0
- package/src/components/WelcomeChecklist.tsx +118 -0
- package/src/components/WelcomeCommands.tsx +102 -0
- package/src/components/autocomplete-store.ts +35 -0
- package/src/components/parse-keypress.ts +170 -0
- package/src/config.ts +491 -0
- package/src/execution-controller.ts +109 -0
- package/src/experience-tracker.ts +350 -0
- package/src/explorbot.ts +405 -0
- package/src/explorer.ts +760 -0
- package/src/index.tsx +62 -0
- package/src/knowledge-tracker.ts +230 -0
- package/src/observability.ts +150 -0
- package/src/reporter.ts +224 -0
- package/src/state-manager.ts +556 -0
- package/src/stats.ts +53 -0
- package/src/test-plan.ts +432 -0
- package/src/utils/aria.ts +629 -0
- package/src/utils/cli-name.ts +13 -0
- package/src/utils/code-extractor.ts +22 -0
- package/src/utils/context-formatter.ts +239 -0
- package/src/utils/error-page.ts +23 -0
- package/src/utils/expandable.ts +38 -0
- package/src/utils/hooks-runner.ts +79 -0
- package/src/utils/html-diff.ts +918 -0
- package/src/utils/html.ts +1316 -0
- package/src/utils/logger.ts +534 -0
- package/src/utils/loop.ts +176 -0
- package/src/utils/markdown-parser.ts +127 -0
- package/src/utils/markdown-query.ts +466 -0
- package/src/utils/markdown-terminal.ts +43 -0
- package/src/utils/research-parser.ts +11 -0
- package/src/utils/retry.ts +73 -0
- package/src/utils/rules-loader.ts +118 -0
- package/src/utils/strings.ts +13 -0
- package/src/utils/test-plan-markdown.ts +332 -0
- package/src/utils/throttle.ts +18 -0
- package/src/utils/unique-names.ts +14 -0
- package/src/utils/url-matcher.ts +45 -0
- package/src/utils/web-element.ts +147 -0
- package/src/utils/xpath.ts +129 -0
- package/dist/bin/explorbot-cli.js.map +0 -1
- package/dist/boat/api-tester/bin/apibot-cli.js.map +0 -1
- package/dist/boat/api-tester/example/apibot.config.js +0 -31
- package/dist/boat/api-tester/example/apibot.config.js.map +0 -1
- package/dist/boat/api-tester/src/ai/chief/styles.js.map +0 -1
- package/dist/boat/api-tester/src/ai/chief.js.map +0 -1
- package/dist/boat/api-tester/src/ai/curler-tools.js.map +0 -1
- package/dist/boat/api-tester/src/ai/curler.js.map +0 -1
- package/dist/boat/api-tester/src/api-client.js.map +0 -1
- package/dist/boat/api-tester/src/apibot.js.map +0 -1
- package/dist/boat/api-tester/src/cli.js.map +0 -1
- package/dist/boat/api-tester/src/config.js.map +0 -1
- package/dist/prompts/audit-rules.md +0 -124
- package/dist/src/action-result.js.map +0 -1
- package/dist/src/action.js.map +0 -1
- package/dist/src/activity.js.map +0 -1
- package/dist/src/ai/agent.js.map +0 -1
- package/dist/src/ai/bosun.js.map +0 -1
- package/dist/src/ai/captain/idle-mode.js.map +0 -1
- package/dist/src/ai/captain/mixin.js.map +0 -1
- package/dist/src/ai/captain/test-mode.js.map +0 -1
- package/dist/src/ai/captain/web-mode.js.map +0 -1
- package/dist/src/ai/captain.js.map +0 -1
- package/dist/src/ai/conversation.js.map +0 -1
- package/dist/src/ai/experience-compactor.js.map +0 -1
- package/dist/src/ai/fisherman-tools.js.map +0 -1
- package/dist/src/ai/fisherman.js.map +0 -1
- package/dist/src/ai/historian.js.map +0 -1
- package/dist/src/ai/navigator.js.map +0 -1
- package/dist/src/ai/pilot.js.map +0 -1
- package/dist/src/ai/planner/session-dedup.js.map +0 -1
- package/dist/src/ai/planner/styles.js.map +0 -1
- package/dist/src/ai/planner/subpages.js.map +0 -1
- package/dist/src/ai/planner.js.map +0 -1
- package/dist/src/ai/provider.js.map +0 -1
- package/dist/src/ai/quartermaster.js.map +0 -1
- package/dist/src/ai/researcher/cache.js.map +0 -1
- package/dist/src/ai/researcher/coordinates.js.map +0 -1
- package/dist/src/ai/researcher/deep-analysis.js.map +0 -1
- package/dist/src/ai/researcher/fingerprint-worker.js.map +0 -1
- package/dist/src/ai/researcher/focus.js.map +0 -1
- package/dist/src/ai/researcher/locators.js.map +0 -1
- package/dist/src/ai/researcher/mixin.js.map +0 -1
- package/dist/src/ai/researcher/parser.js.map +0 -1
- package/dist/src/ai/researcher/research-result.js.map +0 -1
- package/dist/src/ai/researcher.js.map +0 -1
- package/dist/src/ai/rules.js.map +0 -1
- package/dist/src/ai/task-agent.js.map +0 -1
- package/dist/src/ai/tester.js.map +0 -1
- package/dist/src/ai/tools.js.map +0 -1
- package/dist/src/api/api-client.js.map +0 -1
- package/dist/src/api/request-result.js.map +0 -1
- package/dist/src/api/request-store.js.map +0 -1
- package/dist/src/api/spec-reader.js.map +0 -1
- package/dist/src/api/xhr-capture.js.map +0 -1
- package/dist/src/browser-server.js.map +0 -1
- package/dist/src/command-handler.js.map +0 -1
- package/dist/src/commands/add-rule-command.js.map +0 -1
- package/dist/src/commands/base-command.js.map +0 -1
- package/dist/src/commands/clean-command.js.map +0 -1
- package/dist/src/commands/context-aria-command.js.map +0 -1
- package/dist/src/commands/context-command.js.map +0 -1
- package/dist/src/commands/context-data-command.js.map +0 -1
- package/dist/src/commands/context-experience-command.js.map +0 -1
- package/dist/src/commands/context-html-command.js.map +0 -1
- package/dist/src/commands/context-knowledge-command.js.map +0 -1
- package/dist/src/commands/debug-command.js.map +0 -1
- package/dist/src/commands/drill-command.js.map +0 -1
- package/dist/src/commands/exit-command.js.map +0 -1
- package/dist/src/commands/explore-command.js.map +0 -1
- package/dist/src/commands/freesail-command.js.map +0 -1
- package/dist/src/commands/help-command.js.map +0 -1
- package/dist/src/commands/index.js.map +0 -1
- package/dist/src/commands/knows-command.js.map +0 -1
- package/dist/src/commands/learn-command.js.map +0 -1
- package/dist/src/commands/navigate-command.js.map +0 -1
- package/dist/src/commands/path-command.js.map +0 -1
- package/dist/src/commands/plan-clear-command.js.map +0 -1
- package/dist/src/commands/plan-command.js.map +0 -1
- package/dist/src/commands/plan-edit-command.js.map +0 -1
- package/dist/src/commands/plan-load-command.js.map +0 -1
- package/dist/src/commands/plan-reload-command.js.map +0 -1
- package/dist/src/commands/plan-save-command.js.map +0 -1
- package/dist/src/commands/research-command.js.map +0 -1
- package/dist/src/commands/start-command.js.map +0 -1
- package/dist/src/commands/status-command.js.map +0 -1
- package/dist/src/commands/test-command.js.map +0 -1
- package/dist/src/components/ActivityPane.js.map +0 -1
- package/dist/src/components/AddKnowledge.js.map +0 -1
- package/dist/src/components/AddRule.js.map +0 -1
- package/dist/src/components/App.js.map +0 -1
- package/dist/src/components/Autocomplete.js.map +0 -1
- package/dist/src/components/InputPane.js.map +0 -1
- package/dist/src/components/InputReadline.js.map +0 -1
- package/dist/src/components/LogPane.js.map +0 -1
- package/dist/src/components/PlanEditor.js.map +0 -1
- package/dist/src/components/PlanPane.js.map +0 -1
- package/dist/src/components/SessionTimer.js.map +0 -1
- package/dist/src/components/StateTransitionPane.js.map +0 -1
- package/dist/src/components/StatusPane.js.map +0 -1
- package/dist/src/components/TaskPane.js.map +0 -1
- package/dist/src/components/Welcome.js.map +0 -1
- package/dist/src/components/WelcomeChecklist.js.map +0 -1
- package/dist/src/components/WelcomeCommands.js.map +0 -1
- package/dist/src/components/autocomplete-store.js.map +0 -1
- package/dist/src/components/parse-keypress.js.map +0 -1
- package/dist/src/config.js.map +0 -1
- package/dist/src/execution-controller.js.map +0 -1
- package/dist/src/experience-tracker.js.map +0 -1
- package/dist/src/explorbot.js.map +0 -1
- package/dist/src/explorer.js.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/knowledge-tracker.js.map +0 -1
- package/dist/src/observability.js.map +0 -1
- package/dist/src/reporter.js.map +0 -1
- package/dist/src/state-manager.js.map +0 -1
- package/dist/src/stats.js.map +0 -1
- package/dist/src/test-plan.js.map +0 -1
- package/dist/src/utils/aria.js.map +0 -1
- package/dist/src/utils/code-extractor.js.map +0 -1
- package/dist/src/utils/context-formatter.js.map +0 -1
- package/dist/src/utils/error-page.js.map +0 -1
- package/dist/src/utils/expandable.js.map +0 -1
- package/dist/src/utils/hooks-runner.js.map +0 -1
- package/dist/src/utils/html-diff.js.map +0 -1
- package/dist/src/utils/html.js.map +0 -1
- package/dist/src/utils/logger.js.map +0 -1
- package/dist/src/utils/loop.js.map +0 -1
- package/dist/src/utils/markdown-parser.js.map +0 -1
- package/dist/src/utils/markdown-query.js.map +0 -1
- package/dist/src/utils/markdown-terminal.js.map +0 -1
- package/dist/src/utils/research-parser.js.map +0 -1
- package/dist/src/utils/retry.js.map +0 -1
- package/dist/src/utils/rules-loader.js.map +0 -1
- package/dist/src/utils/strings.js.map +0 -1
- package/dist/src/utils/test-plan-markdown.js.map +0 -1
- package/dist/src/utils/throttle.js.map +0 -1
- package/dist/src/utils/unique-names.js.map +0 -1
- package/dist/src/utils/url-matcher.js.map +0 -1
- package/dist/src/utils/web-element.js.map +0 -1
- package/dist/src/utils/xpath.js.map +0 -1
- package/prompts/audit-rules.md +0 -124
package/dist/src/action.js
CHANGED
|
@@ -50,7 +50,7 @@ class Action {
|
|
|
50
50
|
return undefined;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
async capturePageState({ includeScreenshot = false } = {}) {
|
|
53
|
+
async capturePageState({ includeScreenshot = false, ariaSnapshot: preCapuredAria } = {}) {
|
|
54
54
|
try {
|
|
55
55
|
const currentState = this.stateManager.getCurrentState();
|
|
56
56
|
const stateHash = currentState?.hash || 'screenshot';
|
|
@@ -90,20 +90,23 @@ class Action {
|
|
|
90
90
|
debugLog('Page:', { url, title, size: html.length, html: html.substring(0, 100) });
|
|
91
91
|
// Capture iframe HTML snapshots
|
|
92
92
|
const iframeSnapshots = await this.captureIframeSnapshots(html);
|
|
93
|
-
let ariaSnapshot = null;
|
|
93
|
+
let ariaSnapshot = preCapuredAria || null;
|
|
94
94
|
let ariaSnapshotFile = undefined;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
if (!ariaSnapshot) {
|
|
96
|
+
try {
|
|
97
|
+
const page = this.playwrightHelper.page;
|
|
98
|
+
ariaSnapshot = await page.locator('body').ariaSnapshot();
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
debugLog('ARIA snapshot failed:', err instanceof Error ? `${err.message}\n${err.stack}` : err);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (ariaSnapshot) {
|
|
98
105
|
const ariaFileName = `${stateHash}_${timestamp}.aria.yaml`;
|
|
99
106
|
const ariaPath = join(statesDir, ariaFileName);
|
|
100
|
-
fs.writeFileSync(ariaPath,
|
|
101
|
-
ariaSnapshot = serializedSnapshot;
|
|
107
|
+
fs.writeFileSync(ariaPath, ariaSnapshot, 'utf8');
|
|
102
108
|
ariaSnapshotFile = ariaFileName;
|
|
103
109
|
}
|
|
104
|
-
catch (err) {
|
|
105
|
-
debugLog('ARIA snapshot failed:', err instanceof Error ? `${err.message}\n${err.stack}` : err);
|
|
106
|
-
}
|
|
107
110
|
const result = new ActionResult({
|
|
108
111
|
html,
|
|
109
112
|
title,
|
|
@@ -115,7 +118,7 @@ class Action {
|
|
|
115
118
|
iframeSnapshots,
|
|
116
119
|
ariaSnapshot,
|
|
117
120
|
ariaSnapshotFile,
|
|
118
|
-
iframeURL: frame
|
|
121
|
+
iframeURL: frame ? frame.url?.() || 'iframe' : undefined,
|
|
119
122
|
});
|
|
120
123
|
this.stateManager.updateState(result);
|
|
121
124
|
return result;
|
|
@@ -385,4 +388,3 @@ const unregisterStepLogger = () => {
|
|
|
385
388
|
codeceptjs.event.dispatcher.off(codeceptjs.event.step.passed, stepLogger);
|
|
386
389
|
codeceptjs.event.dispatcher.off(codeceptjs.event.step.failed, stepLogger);
|
|
387
390
|
};
|
|
388
|
-
//# sourceMappingURL=action.js.map
|
package/dist/src/activity.js
CHANGED
package/dist/src/ai/agent.js
CHANGED
package/dist/src/ai/bosun.js
CHANGED
package/dist/src/ai/captain.js
CHANGED
package/dist/src/ai/fisherman.js
CHANGED
package/dist/src/ai/historian.js
CHANGED
package/dist/src/ai/navigator.js
CHANGED
package/dist/src/ai/pilot.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import dedent from 'dedent';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { ConfigParser } from "../../config.js";
|
|
3
4
|
import { normalizeUrl } from "../../state-manager.js";
|
|
4
5
|
const planRegistry = new Map();
|
|
5
|
-
export function registerPlan(url, plan, feature) {
|
|
6
|
+
export function registerPlan(url, plan, feature, stateHash) {
|
|
6
7
|
const key = buildKey(url, feature);
|
|
7
|
-
planRegistry.set(key, { plan, feature, url });
|
|
8
|
+
planRegistry.set(key, { plan, feature, url, stateHash });
|
|
8
9
|
}
|
|
9
10
|
export function getRegisteredPlan(url, feature) {
|
|
10
11
|
return planRegistry.get(buildKey(url, feature));
|
|
@@ -26,7 +27,36 @@ function buildKey(url, feature) {
|
|
|
26
27
|
return `${normalized}::${feature}`;
|
|
27
28
|
return normalized;
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
export function isDynamicSegment(segment) {
|
|
31
|
+
try {
|
|
32
|
+
const configRegex = ConfigParser.getInstance().getConfig().dynamicPageRegex;
|
|
33
|
+
if (configRegex)
|
|
34
|
+
return new RegExp(configRegex, 'i').test(segment);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
/* config not loaded yet */
|
|
38
|
+
}
|
|
39
|
+
// numeric: /users/123
|
|
40
|
+
if (/^\d+$/.test(segment))
|
|
41
|
+
return true;
|
|
42
|
+
// UUID: /items/550e8400-e29b-41d4-a716-446655440000
|
|
43
|
+
if (/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(segment))
|
|
44
|
+
return true;
|
|
45
|
+
// ULID: /items/01ARZ3NDEKTSV4RRFFQ69G5FAV
|
|
46
|
+
if (/^[0-9A-HJKMNP-TV-Z]{26}$/.test(segment))
|
|
47
|
+
return true;
|
|
48
|
+
// hex ID (4+ chars): /suite/70dae98a
|
|
49
|
+
if (/^[a-f0-9]{4,}$/i.test(segment))
|
|
50
|
+
return true;
|
|
51
|
+
// hex-prefixed slug (8+ hex before dash): /suite/95ef0c94-mobile
|
|
52
|
+
if (/^[a-f0-9]{8,}-/i.test(segment))
|
|
53
|
+
return true;
|
|
54
|
+
// short mixed alphanumeric (digits + letters, ≤8 chars, no dash): /item/x7f2
|
|
55
|
+
if (segment.length <= 8 && !segment.includes('-') && /\d/.test(segment) && /[a-z]/i.test(segment))
|
|
56
|
+
return true;
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
export function isTemplateMatch(urlA, urlB) {
|
|
30
60
|
const partsA = normalizeUrl(urlA).split('/');
|
|
31
61
|
const partsB = normalizeUrl(urlB).split('/');
|
|
32
62
|
if (partsA.length !== partsB.length)
|
|
@@ -38,12 +68,18 @@ function isTemplateMatch(urlA, urlB) {
|
|
|
38
68
|
diffCount++;
|
|
39
69
|
if (diffCount > 1)
|
|
40
70
|
return false;
|
|
41
|
-
|
|
42
|
-
if (!isNumericOrShortId.test(partsA[i]) && !isNumericOrShortId.test(partsB[i]))
|
|
71
|
+
if (!isDynamicSegment(partsA[i]) && !isDynamicSegment(partsB[i]))
|
|
43
72
|
return false;
|
|
44
73
|
}
|
|
45
74
|
return diffCount === 1;
|
|
46
75
|
}
|
|
76
|
+
export function getPlannedByStateHash(hash) {
|
|
77
|
+
for (const record of planRegistry.values()) {
|
|
78
|
+
if (record.stateHash === hash)
|
|
79
|
+
return record;
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
47
83
|
const SubPagePickSchema = z.object({
|
|
48
84
|
url: z.string().nullable(),
|
|
49
85
|
reason: z.string(),
|
|
@@ -58,7 +94,7 @@ export function WithSubPages(Base) {
|
|
|
58
94
|
const pagePath = normalizeUrl(page.url);
|
|
59
95
|
if (!pagePath.startsWith(currentPath) || pagePath === currentPath)
|
|
60
96
|
continue;
|
|
61
|
-
if (
|
|
97
|
+
if (this.findSimilarPlan(page.url))
|
|
62
98
|
continue;
|
|
63
99
|
if (candidates.some((c) => normalizeUrl(c.url) === pagePath))
|
|
64
100
|
continue;
|
|
@@ -115,4 +151,3 @@ export function WithSubPages(Base) {
|
|
|
115
151
|
}
|
|
116
152
|
};
|
|
117
153
|
}
|
|
118
|
-
//# sourceMappingURL=subpages.js.map
|
package/dist/src/ai/planner.js
CHANGED
|
@@ -14,7 +14,8 @@ import { mdq } from '../utils/markdown-query.js';
|
|
|
14
14
|
import { Conversation } from "./conversation.js";
|
|
15
15
|
import { getActiveStyle, getStyles } from "./planner/styles.js";
|
|
16
16
|
import { WithSessionDedup } from "./planner/session-dedup.js";
|
|
17
|
-
import { WithSubPages, getRegisteredPlan, registerPlan } from "./planner/subpages.js";
|
|
17
|
+
import { WithSubPages, getPlannedByStateHash, getRegisteredPlan, registerPlan } from "./planner/subpages.js";
|
|
18
|
+
import { findSimilarStateHash } from "./researcher/cache.js";
|
|
18
19
|
import { hasFocusedSection } from "./researcher/focus.js";
|
|
19
20
|
import { POSSIBLE_SECTIONS, Researcher } from "./researcher.js";
|
|
20
21
|
import { fileUploadRule, protectionRule } from "./rules.js";
|
|
@@ -108,13 +109,24 @@ export class Planner extends PlannerBase {
|
|
|
108
109
|
debugLog('Planning:', state?.url);
|
|
109
110
|
if (!state)
|
|
110
111
|
throw new Error('No state found');
|
|
111
|
-
if (!
|
|
112
|
+
if (!feature && !this.currentPlan && state.url) {
|
|
112
113
|
const similar = this.findSimilarPlan(state.url);
|
|
113
114
|
if (similar) {
|
|
114
115
|
tag('info').log(`Similar page already planned: ${similar.url} (${similar.plan.tests.length} tests)`);
|
|
115
116
|
this.registerPlanInSession(similar.plan);
|
|
116
117
|
return similar.plan;
|
|
117
118
|
}
|
|
119
|
+
const actionResult = ActionResult.fromState(state);
|
|
120
|
+
const combinedHtml = await actionResult.combinedHtml();
|
|
121
|
+
const similarHash = await findSimilarStateHash(combinedHtml);
|
|
122
|
+
if (similarHash) {
|
|
123
|
+
const planned = getPlannedByStateHash(similarHash);
|
|
124
|
+
if (planned) {
|
|
125
|
+
tag('info').log(`Page content similar to already-planned: ${planned.url} — skipping`);
|
|
126
|
+
this.registerPlanInSession(planned.plan);
|
|
127
|
+
return planned.plan;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
118
130
|
}
|
|
119
131
|
if (!this.freshStart && !this.currentPlan && state.url) {
|
|
120
132
|
this.currentPlan = Planner.getCachedPlan(state.url);
|
|
@@ -185,7 +197,7 @@ export class Planner extends PlannerBase {
|
|
|
185
197
|
tag('success').log(`Planning complete! ${this.currentPlan.tests.length} tests in plan: ${this.currentPlan.title}`);
|
|
186
198
|
tag('info').log(`Planning style: ${this.lastStyleName} (available: ${availableStyles})`);
|
|
187
199
|
if (state.url)
|
|
188
|
-
registerPlan(state.url, this.currentPlan, feature);
|
|
200
|
+
registerPlan(state.url, this.currentPlan, feature, state.hash);
|
|
189
201
|
this.registerPlanInSession(this.currentPlan);
|
|
190
202
|
return this.currentPlan;
|
|
191
203
|
}
|
|
@@ -483,4 +495,3 @@ export class Planner extends PlannerBase {
|
|
|
483
495
|
return conversation;
|
|
484
496
|
}
|
|
485
497
|
}
|
|
486
|
-
//# sourceMappingURL=planner.js.map
|
package/dist/src/ai/provider.js
CHANGED
|
@@ -59,7 +59,7 @@ export function saveResearch(hash, text, combinedHtml) {
|
|
|
59
59
|
}
|
|
60
60
|
return researchFile;
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
function findSimilarMatch(combinedHtml) {
|
|
63
63
|
const statesDir = getStatesDir();
|
|
64
64
|
if (!existsSync(statesDir))
|
|
65
65
|
return Promise.resolve(null);
|
|
@@ -76,13 +76,8 @@ export function findSimilarResearch(combinedHtml) {
|
|
|
76
76
|
resolve(null);
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
debugLog(`Similar
|
|
80
|
-
|
|
81
|
-
if (research) {
|
|
82
|
-
resolve(research);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
resolve(null);
|
|
79
|
+
debugLog(`Similar fingerprint found: ${matchHash} (${similarity}% similar)`);
|
|
80
|
+
resolve({ hash: matchHash, similarity });
|
|
86
81
|
};
|
|
87
82
|
worker.postMessage({
|
|
88
83
|
html: combinedHtml,
|
|
@@ -92,4 +87,13 @@ export function findSimilarResearch(combinedHtml) {
|
|
|
92
87
|
});
|
|
93
88
|
});
|
|
94
89
|
}
|
|
95
|
-
|
|
90
|
+
export async function findSimilarResearch(combinedHtml) {
|
|
91
|
+
const match = await findSimilarMatch(combinedHtml);
|
|
92
|
+
if (!match)
|
|
93
|
+
return null;
|
|
94
|
+
return getCachedResearch(match.hash) || null;
|
|
95
|
+
}
|
|
96
|
+
export async function findSimilarStateHash(combinedHtml) {
|
|
97
|
+
const match = await findSimilarMatch(combinedHtml);
|
|
98
|
+
return match?.hash || null;
|
|
99
|
+
}
|
|
@@ -115,9 +115,11 @@ export function WithCoordinates(Base) {
|
|
|
115
115
|
const text = aiResult.text || '';
|
|
116
116
|
const rows = mdq(text).query('table').toJson();
|
|
117
117
|
for (const row of rows) {
|
|
118
|
-
|
|
119
|
-
if (
|
|
118
|
+
let eidx = (row.eidx || '').trim();
|
|
119
|
+
if (!eidx || eidx === '-')
|
|
120
120
|
continue;
|
|
121
|
+
if (/^\d+$/.test(eidx))
|
|
122
|
+
eidx = `e${eidx}`;
|
|
121
123
|
const val = (v) => (v && v !== '-' ? v : null);
|
|
122
124
|
elements.set(eidx, {
|
|
123
125
|
coordinates: val(row.Coordinates),
|
|
@@ -207,4 +209,3 @@ export function WithCoordinates(Base) {
|
|
|
207
209
|
}
|
|
208
210
|
};
|
|
209
211
|
}
|
|
210
|
-
//# sourceMappingURL=coordinates.js.map
|
|
@@ -68,7 +68,7 @@ export function WithDeepAnalysis(Base) {
|
|
|
68
68
|
From this UI research, identify elements that could reveal hidden UI when clicked
|
|
69
69
|
(dropdown menus, popups, expandable panels, accordion sections, overflow menus, tab switches).
|
|
70
70
|
|
|
71
|
-
Available eidx
|
|
71
|
+
Available eidx refs: ${eidxList}
|
|
72
72
|
|
|
73
73
|
${researchText}
|
|
74
74
|
|
|
@@ -76,7 +76,7 @@ export function WithDeepAnalysis(Base) {
|
|
|
76
76
|
- Only pick elements that HIDE content until clicked (menus, dropdowns, accordions, tabs)
|
|
77
77
|
- Skip regular links, data items, and navigation
|
|
78
78
|
- For repeated elements (same expand button on every row), pick only the FIRST one
|
|
79
|
-
- Respond with comma-separated eidx
|
|
79
|
+
- Respond with comma-separated eidx refs only, e.g.: e3, e7, e15
|
|
80
80
|
`;
|
|
81
81
|
const model = this.provider.getModelForAgent('researcher');
|
|
82
82
|
const textCall = this.provider.chat([{ role: 'user', content: textPrompt }], model, {
|
|
@@ -87,7 +87,7 @@ export function WithDeepAnalysis(Base) {
|
|
|
87
87
|
const screenshot = this.actionResult?.screenshot;
|
|
88
88
|
if (screenshot && this.provider.hasVision()) {
|
|
89
89
|
const visionPrompt = dedent `
|
|
90
|
-
This screenshot has interactive elements labeled with eidx
|
|
90
|
+
This screenshot has interactive elements labeled with eidx refs (solid bordered boxes with labels).
|
|
91
91
|
Identify elements that could reveal hidden UI when clicked.
|
|
92
92
|
|
|
93
93
|
Look for: overflow/ellipsis menus, chevron dropdowns, hamburger menus,
|
|
@@ -96,30 +96,27 @@ export function WithDeepAnalysis(Base) {
|
|
|
96
96
|
Rules:
|
|
97
97
|
- For repeated icons (same icon on every list row), pick only the FIRST one
|
|
98
98
|
- Skip regular text buttons, links, and navigation items
|
|
99
|
-
- Respond with comma-separated eidx
|
|
99
|
+
- Respond with comma-separated eidx refs only, e.g.: e3, e7, e15
|
|
100
100
|
`;
|
|
101
101
|
visionCall = this.provider.processImage(visionPrompt, screenshot.toString('base64'));
|
|
102
102
|
}
|
|
103
103
|
const [textRes, visionRes] = await Promise.all([textCall, visionCall]);
|
|
104
104
|
const eidxSet = new Set();
|
|
105
|
+
const parseRefs = (text) => {
|
|
106
|
+
if (!text)
|
|
107
|
+
return [];
|
|
108
|
+
const matches = text.match(/e?\d+/g) || [];
|
|
109
|
+
const refs = matches.map((m) => (m.startsWith('e') ? m : `e${m}`));
|
|
110
|
+
return refs.filter((r) => allElements.has(r));
|
|
111
|
+
};
|
|
105
112
|
for (const res of [textRes, visionRes]) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const nums = res.text.match(/\d+/g)?.map(Number) || [];
|
|
109
|
-
for (const n of nums) {
|
|
110
|
-
if (allElements.has(n))
|
|
111
|
-
eidxSet.add(n);
|
|
113
|
+
for (const ref of parseRefs(res?.text)) {
|
|
114
|
+
eidxSet.add(ref);
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
.filter((n) => allElements.has(n)) || [];
|
|
118
|
-
const visionNums = visionRes?.text
|
|
119
|
-
?.match(/\d+/g)
|
|
120
|
-
?.map(Number)
|
|
121
|
-
.filter((n) => allElements.has(n)) || [];
|
|
122
|
-
debugLog(`Text model picked eidx: [${textNums.join(', ')}], Vision model picked eidx: [${visionNums.join(', ')}]`);
|
|
117
|
+
const textRefs = parseRefs(textRes?.text);
|
|
118
|
+
const visionRefs = parseRefs(visionRes?.text);
|
|
119
|
+
debugLog(`Text model picked eidx: [${textRefs.join(', ')}], Vision model picked eidx: [${visionRefs.join(', ')}]`);
|
|
123
120
|
return [...eidxSet].map((eidx) => allElements.get(eidx));
|
|
124
121
|
}
|
|
125
122
|
_buildClickCommands(el) {
|
|
@@ -361,4 +358,3 @@ export function WithDeepAnalysis(Base) {
|
|
|
361
358
|
}
|
|
362
359
|
};
|
|
363
360
|
}
|
|
364
|
-
//# sourceMappingURL=deep-analysis.js.map
|
|
@@ -126,7 +126,7 @@ export function WithLocators(Base) {
|
|
|
126
126
|
for (const fixedSection of fixedSections) {
|
|
127
127
|
const originalSections = parseResearchSections(result.text);
|
|
128
128
|
const original = originalSections.find((s) => s.name === fixedSection.name);
|
|
129
|
-
if (!original)
|
|
129
|
+
if (!original || original.elements.length === 0)
|
|
130
130
|
continue;
|
|
131
131
|
if (fixedSection.containerCss && fixedSection.containerCss !== original.containerCss) {
|
|
132
132
|
debugLog(`Fixed container for "${fixedSection.name}": '${original.containerCss}' → '${fixedSection.containerCss}'`);
|
|
@@ -239,4 +239,3 @@ export function WithLocators(Base) {
|
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
|
-
//# sourceMappingURL=locators.js.map
|
|
@@ -37,8 +37,9 @@ export function mapRowToElement(row) {
|
|
|
37
37
|
const name = stripQuotes(colMap.element || '');
|
|
38
38
|
if (!name)
|
|
39
39
|
return null;
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
let eidxRaw = (colMap.eidx || '').trim();
|
|
41
|
+
if (eidxRaw && /^\d+$/.test(eidxRaw))
|
|
42
|
+
eidxRaw = `e${eidxRaw}`;
|
|
42
43
|
const aria = parseAriaLocator(colMap.aria || '-');
|
|
43
44
|
return {
|
|
44
45
|
name,
|
|
@@ -49,7 +50,7 @@ export function mapRowToElement(row) {
|
|
|
49
50
|
coordinates: (colMap.coordinates || '-').trim() === '-' ? null : colMap.coordinates.trim(),
|
|
50
51
|
color: (colMap.color || '-').trim() === '-' || (colMap.color || '').trim() === '' ? null : colMap.color.trim(),
|
|
51
52
|
icon: (colMap.icon || '-').trim() === '-' || (colMap.icon || '').trim() === '' ? null : colMap.icon.trim(),
|
|
52
|
-
eidx:
|
|
53
|
+
eidx: eidxRaw && eidxRaw !== '-' ? eidxRaw : null,
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
56
|
export function extractContainerFromBlockquote(sectionMarkdown) {
|
|
@@ -157,4 +158,3 @@ function formatSectionLine(s) {
|
|
|
157
158
|
parts.push('**Focused**');
|
|
158
159
|
return parts.join(' ');
|
|
159
160
|
}
|
|
160
|
-
//# sourceMappingURL=parser.js.map
|
|
@@ -62,6 +62,8 @@ export class ResearchResult {
|
|
|
62
62
|
this.rebuildSectionInText(section);
|
|
63
63
|
}
|
|
64
64
|
rebuildSectionInText(section) {
|
|
65
|
+
if (section.elements.length === 0)
|
|
66
|
+
return;
|
|
65
67
|
const newTable = rebuildSectionMarkdown(section);
|
|
66
68
|
const escaped = section.name.replace(/"/g, '\\"');
|
|
67
69
|
let sectionQuery = mdq(this.text).query(`section2(~"${escaped}")`);
|
|
@@ -107,4 +109,3 @@ export class ResearchResult {
|
|
|
107
109
|
return [...ordered, ...rest];
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
|
-
//# sourceMappingURL=research-result.js.map
|
|
@@ -98,9 +98,9 @@ export class Researcher extends ResearcherBase {
|
|
|
98
98
|
setActivity(`${this.emoji} Researching...`, 'action');
|
|
99
99
|
await this.ensureNavigated(state.url, screenshot && this.provider.hasVision());
|
|
100
100
|
await this.hooksRunner.runBeforeHook('researcher', state.url);
|
|
101
|
-
const
|
|
102
|
-
debugLog(`Annotated ${
|
|
103
|
-
this.actionResult = await this.explorer.createAction().capturePageState({ includeScreenshot: screenshot && this.provider.hasVision() });
|
|
101
|
+
const { ariaSnapshot, elements: annotatedElements } = await this.explorer.annotateElements();
|
|
102
|
+
debugLog(`Annotated ${annotatedElements.length} interactive elements with eidx`);
|
|
103
|
+
this.actionResult = await this.explorer.createAction().capturePageState({ includeScreenshot: screenshot && this.provider.hasVision(), ariaSnapshot });
|
|
104
104
|
if (isErrorPage(this.actionResult)) {
|
|
105
105
|
const recovered = await this.waitForPageLoad(screenshot);
|
|
106
106
|
if (!recovered) {
|
|
@@ -117,7 +117,7 @@ export class Researcher extends ResearcherBase {
|
|
|
117
117
|
}
|
|
118
118
|
debugLog('Researching web page:', this.actionResult.url);
|
|
119
119
|
const combinedHtml = await this.actionResult.combinedHtml();
|
|
120
|
-
if (!deep) {
|
|
120
|
+
if (!deep && !force) {
|
|
121
121
|
const similar = await findSimilarResearch(combinedHtml);
|
|
122
122
|
if (similar) {
|
|
123
123
|
tag('info').log('Similar research found, reusing cached result');
|
|
@@ -325,9 +325,10 @@ export class Researcher extends ResearcherBase {
|
|
|
325
325
|
return false;
|
|
326
326
|
try {
|
|
327
327
|
await withRetry(async () => {
|
|
328
|
-
await this.explorer.annotateElements();
|
|
328
|
+
const { ariaSnapshot } = await this.explorer.annotateElements();
|
|
329
329
|
this.actionResult = await this.explorer.createAction().capturePageState({
|
|
330
330
|
includeScreenshot: screenshot && this.provider.hasVision(),
|
|
331
|
+
ariaSnapshot,
|
|
331
332
|
});
|
|
332
333
|
if (isErrorPage(this.actionResult))
|
|
333
334
|
throw new Error('Error page detected');
|
|
@@ -773,4 +774,3 @@ export class Researcher extends ResearcherBase {
|
|
|
773
774
|
await action.execute(`I.pressKey('Escape')`);
|
|
774
775
|
}
|
|
775
776
|
}
|
|
776
|
-
//# sourceMappingURL=researcher.js.map
|
package/dist/src/ai/rules.js
CHANGED
package/dist/src/ai/tester.js
CHANGED
package/dist/src/ai/tools.js
CHANGED
|
@@ -301,7 +301,11 @@ export function createCodeceptJSTools(explorer, task) {
|
|
|
301
301
|
const previousState = ActionResult.fromState(stateManager.getCurrentState());
|
|
302
302
|
const formLocator = codeLines[0] || 'form';
|
|
303
303
|
const action = explorer.createAction();
|
|
304
|
+
const wasInIframe = await explorer.isInsideIframe();
|
|
304
305
|
await action.attempt(codeBlock, explanation);
|
|
306
|
+
if (action.lastError && !wasInIframe && (await explorer.isInsideIframe())) {
|
|
307
|
+
await explorer.switchToMainFrame();
|
|
308
|
+
}
|
|
305
309
|
const toolResult = await ActionResult.fromState(stateManager.getCurrentState()).toToolResult(previousState, formLocator);
|
|
306
310
|
if (action.lastError) {
|
|
307
311
|
const message = action.lastError ? String(action.lastError) : 'Unknown error';
|
|
@@ -977,4 +981,3 @@ function getNotFoundSuggestion(errorMessage) {
|
|
|
977
981
|
4. Prefer ARIA locators: { "role": "button", "text": "visible text" }
|
|
978
982
|
`;
|
|
979
983
|
}
|
|
980
|
-
//# sourceMappingURL=tools.js.map
|