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/explorer.js
CHANGED
|
@@ -15,6 +15,7 @@ import { StateManager } from './state-manager.js';
|
|
|
15
15
|
import { RequestStore } from "./api/request-store.js";
|
|
16
16
|
import { XhrCapture } from "./api/xhr-capture.js";
|
|
17
17
|
import { createDebug, log, tag } from './utils/logger.js';
|
|
18
|
+
import { WebElement, extractElementData } from "./utils/web-element.js";
|
|
18
19
|
const debugLog = createDebug('explorbot:explorer');
|
|
19
20
|
const FATAL_BROWSER_ERRORS = /Frame was detached|Target closed|Execution context was destroyed|Protocol error|Session closed/i;
|
|
20
21
|
class Explorer {
|
|
@@ -243,19 +244,7 @@ class Explorer {
|
|
|
243
244
|
return action;
|
|
244
245
|
}
|
|
245
246
|
async annotateElements() {
|
|
246
|
-
|
|
247
|
-
const roles = ['button', 'link', 'textbox', 'searchbox', 'checkbox', 'radio', 'switch', 'combobox', 'tab', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'slider', 'spinbutton', 'treeitem'];
|
|
248
|
-
let idx = 1;
|
|
249
|
-
for (const role of roles) {
|
|
250
|
-
const elements = await page.getByRole(role).all();
|
|
251
|
-
for (const el of elements) {
|
|
252
|
-
await el.evaluate((node, i) => {
|
|
253
|
-
node.setAttribute('data-explorbot-eidx', String(i));
|
|
254
|
-
}, idx);
|
|
255
|
-
idx++;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
return idx - 1;
|
|
247
|
+
return annotatePageElements(this.playwrightHelper.page);
|
|
259
248
|
}
|
|
260
249
|
async visuallyAnnotateElements(opts) {
|
|
261
250
|
return visuallyAnnotateContainers(this.playwrightHelper.page, opts?.containers || []);
|
|
@@ -269,7 +258,7 @@ class Explorer {
|
|
|
269
258
|
for (const el of elements) {
|
|
270
259
|
const attr = await el.getAttribute('data-explorbot-eidx');
|
|
271
260
|
if (attr)
|
|
272
|
-
result.push(
|
|
261
|
+
result.push(attr);
|
|
273
262
|
}
|
|
274
263
|
return result;
|
|
275
264
|
}
|
|
@@ -286,8 +275,7 @@ class Explorer {
|
|
|
286
275
|
const page = this.playwrightHelper.page;
|
|
287
276
|
const base = container ? page.locator(container) : page;
|
|
288
277
|
const el = locator.startsWith('//') ? base.locator(`xpath=${locator}`) : base.locator(locator);
|
|
289
|
-
|
|
290
|
-
return eidx ? Number.parseInt(eidx, 10) : null;
|
|
278
|
+
return await el.first().getAttribute('data-explorbot-eidx');
|
|
291
279
|
}
|
|
292
280
|
catch (error) {
|
|
293
281
|
if (this.isFatalBrowserError(error)) {
|
|
@@ -607,5 +595,58 @@ function toCodeceptjsTest(test) {
|
|
|
607
595
|
codeceptjsTest.notes = test.getPrintableNotes();
|
|
608
596
|
return codeceptjsTest;
|
|
609
597
|
}
|
|
598
|
+
const REF_LINE_PATTERN = /^(\s*)-\s+(\w+)\s*(?:"([^"]*)")?.*?\[ref=(e\d+)\]/;
|
|
599
|
+
const ANNOTATABLE_ROLES = new Set(['button', 'link', 'textbox', 'searchbox', 'checkbox', 'radio', 'switch', 'combobox', 'tab', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'slider', 'spinbutton', 'treeitem']);
|
|
600
|
+
function parseAriaRefs(ariaSnapshot) {
|
|
601
|
+
const entries = [];
|
|
602
|
+
for (const line of ariaSnapshot.split('\n')) {
|
|
603
|
+
const match = line.match(REF_LINE_PATTERN);
|
|
604
|
+
if (!match)
|
|
605
|
+
continue;
|
|
606
|
+
if (!ANNOTATABLE_ROLES.has(match[2]))
|
|
607
|
+
continue;
|
|
608
|
+
entries.push({ role: match[2], name: match[3] || '', ref: match[4] });
|
|
609
|
+
}
|
|
610
|
+
return entries;
|
|
611
|
+
}
|
|
612
|
+
export async function annotatePageElements(page) {
|
|
613
|
+
const ariaSnapshot = await page.locator('body').ariaSnapshot({ forAI: true });
|
|
614
|
+
const refEntries = parseAriaRefs(ariaSnapshot);
|
|
615
|
+
const byRole = new Map();
|
|
616
|
+
for (const { role, name, ref } of refEntries) {
|
|
617
|
+
let list = byRole.get(role);
|
|
618
|
+
if (!list) {
|
|
619
|
+
list = [];
|
|
620
|
+
byRole.set(role, list);
|
|
621
|
+
}
|
|
622
|
+
list.push({ name, ref });
|
|
623
|
+
}
|
|
624
|
+
const elements = [];
|
|
625
|
+
for (const [role, entries] of byRole) {
|
|
626
|
+
try {
|
|
627
|
+
const rawList = await page.getByRole(role).evaluateAll((domElements, [data, extractFnStr]) => {
|
|
628
|
+
const extract = new Function(`return ${extractFnStr}`)();
|
|
629
|
+
const results = [];
|
|
630
|
+
let ariaIdx = 0;
|
|
631
|
+
for (const el of domElements) {
|
|
632
|
+
if (ariaIdx >= data.length)
|
|
633
|
+
break;
|
|
634
|
+
el.setAttribute('data-explorbot-eidx', data[ariaIdx].ref);
|
|
635
|
+
const elData = extract(el);
|
|
636
|
+
if (elData)
|
|
637
|
+
results.push(elData);
|
|
638
|
+
ariaIdx++;
|
|
639
|
+
}
|
|
640
|
+
return results;
|
|
641
|
+
}, [entries, extractElementData.toString()]);
|
|
642
|
+
for (const raw of rawList) {
|
|
643
|
+
elements.push(WebElement.fromRawData(raw, role));
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
catch {
|
|
647
|
+
debugLog(`Failed to annotate role=${role}`);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
return { ariaSnapshot, elements };
|
|
651
|
+
}
|
|
610
652
|
export default Explorer;
|
|
611
|
-
//# sourceMappingURL=explorer.js.map
|
package/dist/src/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { dirname, join } from 'node:path';
|
|
|
3
3
|
import matter from 'gray-matter';
|
|
4
4
|
import { ActionResult } from './action-result.js';
|
|
5
5
|
import { ConfigParser } from './config.js';
|
|
6
|
+
import { getCliName } from "./utils/cli-name.js";
|
|
6
7
|
import { createDebug } from './utils/logger.js';
|
|
7
8
|
const debugLog = createDebug('explorbot:knowledge-tracker');
|
|
8
9
|
export class KnowledgeTracker {
|
|
@@ -63,7 +64,7 @@ export class KnowledgeTracker {
|
|
|
63
64
|
const config = configParser.getConfig();
|
|
64
65
|
const configPath = configParser.getConfigPath();
|
|
65
66
|
if (!configPath) {
|
|
66
|
-
throw new Error(
|
|
67
|
+
throw new Error(`No explorbot configuration found. Please run "${getCliName()} init" first.`);
|
|
67
68
|
}
|
|
68
69
|
const projectRoot = dirname(configPath);
|
|
69
70
|
const knowledgeDir = join(projectRoot, config.dirs?.knowledge || 'knowledge');
|
|
@@ -181,4 +182,3 @@ export class KnowledgeTracker {
|
|
|
181
182
|
return result;
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
|
-
//# sourceMappingURL=knowledge-tracker.js.map
|
package/dist/src/reporter.js
CHANGED
package/dist/src/stats.js
CHANGED
package/dist/src/test-plan.js
CHANGED
package/dist/src/utils/aria.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
let cached;
|
|
3
|
+
export function getCliName() {
|
|
4
|
+
if (cached)
|
|
5
|
+
return cached;
|
|
6
|
+
const ua = process.env.npm_config_user_agent || '';
|
|
7
|
+
if (ua.includes('bun'))
|
|
8
|
+
cached = 'bunx explorbot';
|
|
9
|
+
else if (ua.includes('npm'))
|
|
10
|
+
cached = 'npx explorbot';
|
|
11
|
+
else if (process.argv[1]?.endsWith('.ts'))
|
|
12
|
+
cached = `bun ${path.relative(process.cwd(), process.argv[1])}`;
|
|
13
|
+
else
|
|
14
|
+
cached = 'explorbot';
|
|
15
|
+
return cached;
|
|
16
|
+
}
|
package/dist/src/utils/html.js
CHANGED
package/dist/src/utils/logger.js
CHANGED
package/dist/src/utils/loop.js
CHANGED
package/dist/src/utils/retry.js
CHANGED
|
@@ -101,4 +101,3 @@ function loadStyleFile(agentName, name) {
|
|
|
101
101
|
const builtInPath = join(BUILT_IN_DIR, agentName, 'styles', `${name}.md`);
|
|
102
102
|
throw new Error(`Style "${name}" not found for agent "${agentName}". Searched: ${userPath}, ${builtInPath}`);
|
|
103
103
|
}
|
|
104
|
-
//# sourceMappingURL=rules-loader.js.map
|
|
@@ -3,6 +3,7 @@ const KEY_DISPLAY_ATTRS = ['role', 'id', 'class', 'aria-label'];
|
|
|
3
3
|
const KEY_ATTRS = ['role', 'aria-label', 'id', 'name', 'type', 'href'];
|
|
4
4
|
export class WebElement {
|
|
5
5
|
tag;
|
|
6
|
+
role;
|
|
6
7
|
xpath;
|
|
7
8
|
clickXPath;
|
|
8
9
|
attrs;
|
|
@@ -12,6 +13,7 @@ export class WebElement {
|
|
|
12
13
|
y;
|
|
13
14
|
constructor(data) {
|
|
14
15
|
this.tag = data.tag;
|
|
16
|
+
this.role = data.role || data.attrs.role || '';
|
|
15
17
|
this.xpath = data.xpath;
|
|
16
18
|
this.clickXPath = data.clickXPath;
|
|
17
19
|
this.attrs = data.attrs;
|
|
@@ -33,8 +35,7 @@ export class WebElement {
|
|
|
33
35
|
return `(${this.x}, ${this.y})`;
|
|
34
36
|
}
|
|
35
37
|
get eidx() {
|
|
36
|
-
|
|
37
|
-
return val ? Number.parseInt(val, 10) : null;
|
|
38
|
+
return this.attrs['data-explorbot-eidx'] || this.attrs.eidx || null;
|
|
38
39
|
}
|
|
39
40
|
get isNavigationLink() {
|
|
40
41
|
if (this.tag !== 'a')
|
|
@@ -46,9 +47,10 @@ export class WebElement {
|
|
|
46
47
|
const cls = this.attrs.class || '';
|
|
47
48
|
return cls.split(/\s+/).filter((c) => c.length > 2 && !isDynamicId(c) && !isGenericClass(c));
|
|
48
49
|
}
|
|
49
|
-
static fromRawData(d) {
|
|
50
|
+
static fromRawData(d, role) {
|
|
50
51
|
return new WebElement({
|
|
51
52
|
tag: d.tag,
|
|
53
|
+
role,
|
|
52
54
|
xpath: '',
|
|
53
55
|
clickXPath: buildClickableXPath({ tag: d.tag, allAttrs: d.allAttrs, text: d.text }),
|
|
54
56
|
attrs: d.allAttrs,
|
|
@@ -111,7 +113,7 @@ export class WebElement {
|
|
|
111
113
|
return { totalFound: result.totalFound, elements: result.matches.map((m) => WebElement.fromXPathMatch(m)) };
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
|
-
function extractElementData(el) {
|
|
116
|
+
export function extractElementData(el) {
|
|
115
117
|
const rect = el.getBoundingClientRect();
|
|
116
118
|
if (rect.width === 0 && rect.height === 0)
|
|
117
119
|
return null;
|
|
@@ -128,4 +130,3 @@ function extractElementData(el) {
|
|
|
128
130
|
y: Math.round(rect.y + rect.height / 2),
|
|
129
131
|
};
|
|
130
132
|
}
|
|
131
|
-
//# sourceMappingURL=web-element.js.map
|
package/dist/src/utils/xpath.js
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "explorbot",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "CLI app built with React Ink, CodeceptJS, and Playwright",
|
|
5
5
|
"license": "Elastic-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"bun": "./src/index.tsx",
|
|
11
|
+
"import": "./dist/src/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
8
14
|
"bin": {
|
|
9
15
|
"explorbot": "./dist/bin/explorbot-cli.js"
|
|
10
16
|
},
|
|
11
|
-
"files": [
|
|
17
|
+
"files": [
|
|
18
|
+
"dist/",
|
|
19
|
+
"src/**/*.ts",
|
|
20
|
+
"src/**/*.tsx",
|
|
21
|
+
"bin/**/*.ts",
|
|
22
|
+
"boat/api-tester/src/**/*.ts",
|
|
23
|
+
"rules/",
|
|
24
|
+
"assets/sample-files/"
|
|
25
|
+
],
|
|
12
26
|
"scripts": {
|
|
13
27
|
"build": "bun run src/index.tsx build && bun run build:bin",
|
|
14
28
|
"build:bin": "bun build bin/explorbot-cli.ts --outdir bin --target node --external commander --format esm",
|
|
@@ -35,7 +49,17 @@
|
|
|
35
49
|
"check:fix": "biome check --write .",
|
|
36
50
|
"langfuse:export": "bun run .claude/skills/explorbot-debug/langfuse-export.ts"
|
|
37
51
|
},
|
|
38
|
-
"keywords": [
|
|
52
|
+
"keywords": [
|
|
53
|
+
"cli",
|
|
54
|
+
"react",
|
|
55
|
+
"ink",
|
|
56
|
+
"codeceptjs",
|
|
57
|
+
"playwright"
|
|
58
|
+
],
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "https://github.com/testomatio/explorbot"
|
|
62
|
+
},
|
|
39
63
|
"author": "",
|
|
40
64
|
"dependencies": {
|
|
41
65
|
"@ai-sdk/anthropic": "^3.0",
|
|
@@ -53,7 +77,7 @@
|
|
|
53
77
|
"@opentelemetry/sdk-trace-base": "^2.2.0",
|
|
54
78
|
"@opentelemetry/semantic-conventions": "^1.38.0",
|
|
55
79
|
"@scalar/openapi-parser": "^0.25.6",
|
|
56
|
-
"@testomatio/reporter": "2.7.
|
|
80
|
+
"@testomatio/reporter": "^2.7.6",
|
|
57
81
|
"ai": "^6.0.6",
|
|
58
82
|
"axe-core": "^4.11.1",
|
|
59
83
|
"bash-tool": "^1.3.15",
|