claude-chrome-parallel 1.0.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/LICENSE +21 -0
- package/README.md +501 -0
- package/assets/demo.svg +278 -0
- package/dist/cdp/client.d.ts +218 -0
- package/dist/cdp/client.d.ts.map +1 -0
- package/dist/cdp/client.js +797 -0
- package/dist/cdp/client.js.map +1 -0
- package/dist/cdp/connection-pool.d.ts +125 -0
- package/dist/cdp/connection-pool.d.ts.map +1 -0
- package/dist/cdp/connection-pool.js +443 -0
- package/dist/cdp/connection-pool.js.map +1 -0
- package/dist/cdp/screenshot-scheduler.d.ts +54 -0
- package/dist/cdp/screenshot-scheduler.d.ts.map +1 -0
- package/dist/cdp/screenshot-scheduler.js +87 -0
- package/dist/cdp/screenshot-scheduler.js.map +1 -0
- package/dist/chrome/launcher.d.ts +55 -0
- package/dist/chrome/launcher.d.ts.map +1 -0
- package/dist/chrome/launcher.js +383 -0
- package/dist/chrome/launcher.js.map +1 -0
- package/dist/chrome/pool.d.ts +54 -0
- package/dist/chrome/pool.d.ts.map +1 -0
- package/dist/chrome/pool.js +301 -0
- package/dist/chrome/pool.js.map +1 -0
- package/dist/chrome/profile-detector.d.ts +52 -0
- package/dist/chrome/profile-detector.d.ts.map +1 -0
- package/dist/chrome/profile-detector.js +246 -0
- package/dist/chrome/profile-detector.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 +858 -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 +9 -0
- package/dist/cli/update-check.js +141 -0
- package/dist/cli/update-check.js.map +1 -0
- package/dist/config/config-recovery.d.ts +69 -0
- package/dist/config/config-recovery.d.ts.map +1 -0
- package/dist/config/config-recovery.js +302 -0
- package/dist/config/config-recovery.js.map +1 -0
- package/dist/config/global.d.ts +49 -0
- package/dist/config/global.d.ts.map +1 -0
- package/dist/config/global.js +24 -0
- package/dist/config/global.js.map +1 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +23 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/session-isolator.d.ts +76 -0
- package/dist/config/session-isolator.d.ts.map +1 -0
- package/dist/config/session-isolator.js +268 -0
- package/dist/config/session-isolator.js.map +1 -0
- package/dist/dashboard/activity-tracker.d.ts +76 -0
- package/dist/dashboard/activity-tracker.d.ts.map +1 -0
- package/dist/dashboard/activity-tracker.js +219 -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 +412 -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 +215 -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 +56 -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/hints/hint-engine.d.ts +77 -0
- package/dist/hints/hint-engine.d.ts.map +1 -0
- package/dist/hints/hint-engine.js +191 -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/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 +66 -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 +55 -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/repetition-detection.d.ts +7 -0
- package/dist/hints/rules/repetition-detection.d.ts.map +1 -0
- package/dist/hints/rules/repetition-detection.js +82 -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 +89 -0
- package/dist/hints/rules/sequence-detection.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 +62 -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 +272 -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 +199 -0
- package/dist/lightpanda/launcher.js.map +1 -0
- package/dist/mcp-server.d.ts +129 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +641 -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 +227 -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 +284 -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 +255 -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 +731 -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 +101 -0
- package/dist/resources/usage-guide.js.map +1 -0
- package/dist/router/browser-router.d.ts +51 -0
- package/dist/router/browser-router.d.ts.map +1 -0
- package/dist/router/browser-router.js +178 -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 +90 -0
- package/dist/router/tool-routing-registry.js.map +1 -0
- package/dist/session-manager.d.ts +251 -0
- package/dist/session-manager.d.ts.map +1 -0
- package/dist/session-manager.js +912 -0
- package/dist/session-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 +226 -0
- package/dist/tools/batch-execute.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 +455 -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 +638 -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 +320 -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 +263 -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 +252 -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 +221 -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 +208 -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 +342 -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 +330 -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 +181 -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 +172 -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 +136 -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 +104 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/javascript.d.ts +6 -0
- package/dist/tools/javascript.d.ts.map +1 -0
- package/dist/tools/javascript.js +138 -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 +266 -0
- package/dist/tools/lightweight-scroll.js.map +1 -0
- package/dist/tools/memory.d.ts +10 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +141 -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 +241 -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 +215 -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 +746 -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 +120 -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 +245 -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 +89 -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 +158 -0
- package/dist/tools/performance-metrics.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 +287 -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 +439 -0
- package/dist/tools/request-intercept.js.map +1 -0
- package/dist/tools/selector-query.d.ts +6 -0
- package/dist/tools/selector-query.d.ts.map +1 -0
- package/dist/tools/selector-query.js +206 -0
- package/dist/tools/selector-query.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 +120 -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 +264 -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 +92 -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 +73 -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 +128 -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 +290 -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 +248 -0
- package/dist/tools/wait-for.js.map +1 -0
- package/dist/tools/worker-create.d.ts +7 -0
- package/dist/tools/worker-create.d.ts.map +1 -0
- package/dist/tools/worker-create.js +62 -0
- package/dist/tools/worker-create.js.map +1 -0
- package/dist/tools/worker-delete.d.ts +6 -0
- package/dist/tools/worker-delete.d.ts.map +1 -0
- package/dist/tools/worker-delete.js +80 -0
- package/dist/tools/worker-delete.js.map +1 -0
- package/dist/tools/worker-list.d.ts +6 -0
- package/dist/tools/worker-list.d.ts.map +1 -0
- package/dist/tools/worker-list.js +67 -0
- package/dist/tools/worker-list.js.map +1 -0
- package/dist/tools/xpath-query.d.ts +6 -0
- package/dist/tools/xpath-query.d.ts.map +1 -0
- package/dist/tools/xpath-query.js +230 -0
- package/dist/tools/xpath-query.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 +54 -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/profile.d.ts +76 -0
- package/dist/types/profile.d.ts.map +1 -0
- package/dist/types/profile.js +35 -0
- package/dist/types/profile.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/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/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +22 -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/ref-id-manager.d.ts +26 -0
- package/dist/utils/ref-id-manager.d.ts.map +1 -0
- package/dist/utils/ref-id-manager.js +81 -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 +110 -0
- package/dist/utils/request-queue.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Error Recovery Rules — highest priority
|
|
4
|
+
* Maps error patterns to actionable recovery hints.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.errorRecoveryRules = void 0;
|
|
8
|
+
const patterns = [
|
|
9
|
+
{
|
|
10
|
+
test: /ref[^a-z]*not found|invalid ref|stale ref/i,
|
|
11
|
+
hint: 'Hint: Refs expire after page changes. Use read_page or find for fresh refs.',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
test: /tab[^a-z]*not found|invalid tab|no such tab/i,
|
|
15
|
+
hint: 'Hint: Use tabs_context_mcp to list valid tabIds.',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
test: /selector[^a-z]*(failed|not found|no match)|querySelectorAll.*returned 0|no elements? match/i,
|
|
19
|
+
hint: 'Hint: Try find(query) with natural language instead.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
test: /click_element[^a-z]*(no match|not found|could not find)/i,
|
|
23
|
+
hint: 'Hint: Element may not be loaded. Try wait_and_click.',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
test: /timeout|timed?\s*out|navigation timeout/i,
|
|
27
|
+
hint: 'Hint: Page may require login or different navigation.',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
test: /cannot read propert|null is not|undefined is not|is null|is undefined/i,
|
|
31
|
+
hint: 'Hint: Element is null. Use find or read_page to verify.',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
test: /coordinate|click at position|x,?\s*y/i,
|
|
35
|
+
hint: 'Hint: Use click_element(query) instead — finds and clicks in one step.',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
test: /^\s*\{\s*\}\s*$|"result":\s*\{\s*\}/,
|
|
39
|
+
hint: 'Hint: Empty object may indicate an async result. Wrap code in async IIFE: (async () => { return await ... })()',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
test: /await is only valid in async/i,
|
|
43
|
+
hint: 'Hint: Top-level await is not supported in javascript_tool. Use Promise chaining instead: new Promise(r => setTimeout(r, ms)).then(() => yourCode). Or wrap in async IIFE: (async () => { await ...; return result; })()',
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
exports.errorRecoveryRules = patterns.map((p, i) => ({
|
|
47
|
+
name: `error-recovery-${i}`,
|
|
48
|
+
priority: 100 + i,
|
|
49
|
+
match(ctx) {
|
|
50
|
+
if (!ctx.isError)
|
|
51
|
+
return null;
|
|
52
|
+
return p.test.test(ctx.resultText) ? p.hint : null;
|
|
53
|
+
},
|
|
54
|
+
}));
|
|
55
|
+
//# sourceMappingURL=error-recovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-recovery.js","sourceRoot":"","sources":["../../../src/hints/rules/error-recovery.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,MAAM,QAAQ,GAA0C;IACtD;QACE,IAAI,EAAE,4CAA4C;QAClD,IAAI,EAAE,6EAA6E;KACpF;IACD;QACE,IAAI,EAAE,8CAA8C;QACpD,IAAI,EAAE,kDAAkD;KACzD;IACD;QACE,IAAI,EAAE,6FAA6F;QACnG,IAAI,EAAE,sDAAsD;KAC7D;IACD;QACE,IAAI,EAAE,0DAA0D;QAChE,IAAI,EAAE,sDAAsD;KAC7D;IACD;QACE,IAAI,EAAE,0CAA0C;QAChD,IAAI,EAAE,uDAAuD;KAC9D;IACD;QACE,IAAI,EAAE,wEAAwE;QAC9E,IAAI,EAAE,yDAAyD;KAChE;IACD;QACE,IAAI,EAAE,uCAAuC;QAC7C,IAAI,EAAE,wEAAwE;KAC/E;IACD;QACE,IAAI,EAAE,qCAAqC;QAC3C,IAAI,EAAE,gHAAgH;KACvH;IACD;QACE,IAAI,EAAE,+BAA+B;QACrC,IAAI,EAAE,yNAAyN;KAChO;CACF,CAAC;AAEW,QAAA,kBAAkB,GAAe,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACpE,IAAI,EAAE,kBAAkB,CAAC,EAAE;IAC3B,QAAQ,EAAE,GAAG,GAAG,CAAC;IACjB,KAAK,CAAC,GAAG;QACP,IAAI,CAAC,GAAG,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAC9B,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACrD,CAAC;CACF,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Learned Rules — dynamically matches against patterns discovered by PatternLearner.
|
|
3
|
+
* Priority 350: between repetition detection (250) and success hints (400).
|
|
4
|
+
*/
|
|
5
|
+
import type { HintRule } from '../hint-engine';
|
|
6
|
+
import type { PatternLearner } from '../pattern-learner';
|
|
7
|
+
/**
|
|
8
|
+
* Create a HintRule that delegates to the PatternLearner.
|
|
9
|
+
* The rule's match function reads current patterns at evaluation time,
|
|
10
|
+
* so newly learned patterns are immediately available.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createLearnedRules(learner: PatternLearner): HintRule[];
|
|
13
|
+
//# sourceMappingURL=learned-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learned-rules.d.ts","sourceRoot":"","sources":["../../../src/hints/rules/learned-rules.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,QAAQ,EAAE,CAYtE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Learned Rules — dynamically matches against patterns discovered by PatternLearner.
|
|
4
|
+
* Priority 350: between repetition detection (250) and success hints (400).
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.createLearnedRules = createLearnedRules;
|
|
8
|
+
/**
|
|
9
|
+
* Create a HintRule that delegates to the PatternLearner.
|
|
10
|
+
* The rule's match function reads current patterns at evaluation time,
|
|
11
|
+
* so newly learned patterns are immediately available.
|
|
12
|
+
*/
|
|
13
|
+
function createLearnedRules(learner) {
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
name: 'learned-pattern',
|
|
17
|
+
priority: 350,
|
|
18
|
+
match(ctx) {
|
|
19
|
+
if (!ctx.isError)
|
|
20
|
+
return null;
|
|
21
|
+
const pattern = learner.matchPattern(ctx.resultText, ctx.toolName);
|
|
22
|
+
return pattern ? pattern.hint : null;
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=learned-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learned-rules.js","sourceRoot":"","sources":["../../../src/hints/rules/learned-rules.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAUH,gDAYC;AAjBD;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,OAAuB;IACxD,OAAO;QACL;YACE,IAAI,EAAE,iBAAiB;YACvB,QAAQ,EAAE,GAAG;YACb,KAAK,CAAC,GAAG;gBACP,IAAI,CAAC,GAAG,CAAC,OAAO;oBAAE,OAAO,IAAI,CAAC;gBAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;gBACnE,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YACvC,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repetition Detection — generic patterns that catch inefficiency without hardcoded rules.
|
|
3
|
+
* Priority 250: between composite suggestions (200) and sequence detection (300).
|
|
4
|
+
*/
|
|
5
|
+
import type { HintRule } from '../hint-engine';
|
|
6
|
+
export declare const repetitionDetectionRules: HintRule[];
|
|
7
|
+
//# sourceMappingURL=repetition-detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repetition-detection.d.ts","sourceRoot":"","sources":["../../../src/hints/rules/repetition-detection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AA4C5D,eAAO,MAAM,wBAAwB,EAAE,QAAQ,EA8B9C,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Repetition Detection — generic patterns that catch inefficiency without hardcoded rules.
|
|
4
|
+
* Priority 250: between composite suggestions (200) and sequence detection (300).
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.repetitionDetectionRules = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Check if the last N recent calls are all the same tool with errors.
|
|
10
|
+
*/
|
|
11
|
+
function sameToolErrorStreak(ctx, minStreak) {
|
|
12
|
+
if (ctx.recentCalls.length < minStreak)
|
|
13
|
+
return false;
|
|
14
|
+
for (let i = 0; i < minStreak; i++) {
|
|
15
|
+
const call = ctx.recentCalls[i];
|
|
16
|
+
if (call.toolName !== ctx.toolName || call.result !== 'error')
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Detect A→B→A→B oscillation pattern in recent calls.
|
|
23
|
+
*/
|
|
24
|
+
function detectOscillation(ctx) {
|
|
25
|
+
if (ctx.recentCalls.length < 3)
|
|
26
|
+
return false;
|
|
27
|
+
const [a, b, c] = ctx.recentCalls;
|
|
28
|
+
// Current tool = X, recent = [A, B, C, ...]
|
|
29
|
+
// Oscillation: current=X, A=Y, B=X, C=Y (X→Y→X→Y)
|
|
30
|
+
return (a.toolName !== ctx.toolName &&
|
|
31
|
+
b.toolName === ctx.toolName &&
|
|
32
|
+
c.toolName === a.toolName);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Detect same tool called repeatedly with same result (non-error).
|
|
36
|
+
*/
|
|
37
|
+
function sameToolSameResult(ctx) {
|
|
38
|
+
if (ctx.recentCalls.length < 2)
|
|
39
|
+
return false;
|
|
40
|
+
const prev = ctx.recentCalls[0];
|
|
41
|
+
const prevPrev = ctx.recentCalls[1];
|
|
42
|
+
return (prev.toolName === ctx.toolName &&
|
|
43
|
+
prevPrev.toolName === ctx.toolName &&
|
|
44
|
+
prev.result === 'success' &&
|
|
45
|
+
prevPrev.result === 'success');
|
|
46
|
+
}
|
|
47
|
+
exports.repetitionDetectionRules = [
|
|
48
|
+
{
|
|
49
|
+
name: 'same-tool-error-streak',
|
|
50
|
+
priority: 250,
|
|
51
|
+
match(ctx) {
|
|
52
|
+
if (!ctx.isError)
|
|
53
|
+
return null;
|
|
54
|
+
if (sameToolErrorStreak(ctx, 2)) {
|
|
55
|
+
return `Hint: ${ctx.toolName} failed ${2 + 1} times in a row. Try a different approach or tool.`;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'tool-oscillation',
|
|
62
|
+
priority: 251,
|
|
63
|
+
match(ctx) {
|
|
64
|
+
if (!detectOscillation(ctx))
|
|
65
|
+
return null;
|
|
66
|
+
const otherTool = ctx.recentCalls[0].toolName;
|
|
67
|
+
return `Hint: ${ctx.toolName}↔${otherTool} oscillation detected. Break the loop with a different strategy.`;
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'same-tool-same-result',
|
|
72
|
+
priority: 252,
|
|
73
|
+
match(ctx) {
|
|
74
|
+
if (ctx.isError)
|
|
75
|
+
return null;
|
|
76
|
+
if (!sameToolSameResult(ctx))
|
|
77
|
+
return null;
|
|
78
|
+
return `Hint: ${ctx.toolName} called 3+ times. Consider find or javascript_tool for a targeted approach.`;
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
//# sourceMappingURL=repetition-detection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repetition-detection.js","sourceRoot":"","sources":["../../../src/hints/rules/repetition-detection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACH,SAAS,mBAAmB,CAAC,GAAgB,EAAE,SAAiB;IAC9D,IAAI,GAAG,CAAC,WAAW,CAAC,MAAM,GAAG,SAAS;QAAE,OAAO,KAAK,CAAC;IACrD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,IAAI,CAAC,QAAQ,KAAK,GAAG,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC;IAC9E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;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AAI,CAAC;QACd,CAAC;KACF;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,QAAQ,EAAE,GAAG;QACb,KAAK,CAAC,GAAG;YACP,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC;YACzC,MAAM,SAAS,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;YAC9C,OAAO,SAAS,GAAG,CAAC,QAAQ,IAAI,SAAS,kEAAkE,CAAC;QAC9G,CAAC;KACF;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B,QAAQ,EAAE,GAAG;QACb,KAAK,CAAC,GAAG;YACP,IAAI,GAAG,CAAC,OAAO;gBAAE,OAAO,IAAI,CAAC;YAC7B,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC;YAC1C,OAAO,SAAS,GAAG,CAAC,QAAQ,6EAA6E,CAAC;QAC5G,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequence-detection.d.ts","sourceRoot":"","sources":["../../../src/hints/rules/sequence-detection.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AAe5D,eAAO,MAAM,sBAAsB,EAAE,QAAQ,EA0D5C,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Sequence Detection — detects inefficient multi-call patterns.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.sequenceDetectionRules = void 0;
|
|
7
|
+
function lastToolWas(ctx, name) {
|
|
8
|
+
return ctx.recentCalls.length > 0 && ctx.recentCalls[0].toolName === name;
|
|
9
|
+
}
|
|
10
|
+
function consecutiveCount(ctx, name) {
|
|
11
|
+
let count = 0;
|
|
12
|
+
for (const call of ctx.recentCalls) {
|
|
13
|
+
if (call.toolName === name)
|
|
14
|
+
count++;
|
|
15
|
+
else
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
return count;
|
|
19
|
+
}
|
|
20
|
+
exports.sequenceDetectionRules = [
|
|
21
|
+
{
|
|
22
|
+
name: 'navigate-to-login',
|
|
23
|
+
priority: 300,
|
|
24
|
+
match(ctx) {
|
|
25
|
+
if (ctx.toolName !== 'navigate')
|
|
26
|
+
return null;
|
|
27
|
+
if (ctx.isError)
|
|
28
|
+
return null;
|
|
29
|
+
if (/login|sign.?in|log.?in|auth/i.test(ctx.resultText)) {
|
|
30
|
+
return 'Hint: Login page detected. Use fill_form({fields:{...}, submit:"Login"}) for credentials.';
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'repeated-read-page',
|
|
37
|
+
priority: 301,
|
|
38
|
+
match(ctx) {
|
|
39
|
+
if (ctx.toolName !== 'read_page')
|
|
40
|
+
return null;
|
|
41
|
+
if (consecutiveCount(ctx, 'read_page') >= 1) {
|
|
42
|
+
return 'Hint: Use find(query) or javascript_tool for specific elements.';
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'navigate-then-screenshot',
|
|
49
|
+
priority: 302,
|
|
50
|
+
match(ctx) {
|
|
51
|
+
if (ctx.toolName !== 'computer')
|
|
52
|
+
return null;
|
|
53
|
+
if (!ctx.resultText.includes('screenshot'))
|
|
54
|
+
return null;
|
|
55
|
+
if (!lastToolWas(ctx, 'navigate'))
|
|
56
|
+
return null;
|
|
57
|
+
return 'Hint: Page may not be loaded. Add wait_for before screenshot.';
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'modal-close-failure',
|
|
62
|
+
priority: 303,
|
|
63
|
+
match(ctx) {
|
|
64
|
+
if (ctx.toolName !== 'find' && ctx.toolName !== 'read_page')
|
|
65
|
+
return null;
|
|
66
|
+
if (!lastToolWas(ctx, 'click_element'))
|
|
67
|
+
return null;
|
|
68
|
+
if (/modal|overlay|dialog|backdrop|popup|drawer/i.test(ctx.resultText)) {
|
|
69
|
+
return 'Hint: Modal may still be open. Try Escape key via computer(action:"key", text:"Escape") or javascript_tool to remove overlay.';
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'navigate-to-demo',
|
|
76
|
+
priority: 304,
|
|
77
|
+
match(ctx) {
|
|
78
|
+
if (ctx.toolName !== 'navigate')
|
|
79
|
+
return null;
|
|
80
|
+
if (ctx.isError)
|
|
81
|
+
return null;
|
|
82
|
+
if (/demo\.|staging\.|sandbox\.|test\.|localhost|127\.0\.0\.1/i.test(ctx.resultText)) {
|
|
83
|
+
return 'Hint: URL appears to be a non-production environment (demo/staging). Verify this is the intended target.';
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
//# sourceMappingURL=sequence-detection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequence-detection.js","sourceRoot":"","sources":["../../../src/hints/rules/sequence-detection.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAIH,SAAS,WAAW,CAAC,GAAgB,EAAE,IAAY;IACjD,OAAO,GAAG,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC;AAC5E,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAgB,EAAE,IAAY;IACtD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;QACnC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI;YAAE,KA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,KAAK,MAAM,IAAI,GAAG,CAAC,QAAQ,KAAK,WAAW;gBAAE,OAAO,IAAI,CAAC;YACzE,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,eAAe,CAAC;gBAAE,OAAO,IAAI,CAAC;YACpD,IAAI,6CAA6C,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBACvE,OAAO,+HAA+H,CAAC;YACzI,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,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;YAC7B,IAAI,2DAA2D,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBACrF,OAAO,0GAA0G,CAAC;YACpH,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"success-hints.d.ts","sourceRoot":"","sources":["../../../src/hints/rules/success-hints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,eAAO,MAAM,gBAAgB,EAAE,QAAQ,EA8CtC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Success Hints — lowest priority, guides next action after success.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.successHintRules = void 0;
|
|
7
|
+
exports.successHintRules = [
|
|
8
|
+
{
|
|
9
|
+
name: 'navigate-error-page',
|
|
10
|
+
priority: 400,
|
|
11
|
+
match(ctx) {
|
|
12
|
+
if (ctx.toolName !== 'navigate')
|
|
13
|
+
return null;
|
|
14
|
+
if (ctx.isError)
|
|
15
|
+
return null;
|
|
16
|
+
if (/404|not found|error|forbidden|403|500|internal server/i.test(ctx.resultText)) {
|
|
17
|
+
return 'Hint: Page title suggests error. Verify URL.';
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'find-no-results',
|
|
24
|
+
priority: 401,
|
|
25
|
+
match(ctx) {
|
|
26
|
+
if (ctx.toolName !== 'find')
|
|
27
|
+
return null;
|
|
28
|
+
if (ctx.isError)
|
|
29
|
+
return null;
|
|
30
|
+
if (/no results?|0 (results?|matches|elements)|empty|not found|\[\]/i.test(ctx.resultText)) {
|
|
31
|
+
return 'Hint: Try broader query or javascript_tool for custom search.';
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'click-element-success',
|
|
38
|
+
priority: 402,
|
|
39
|
+
match(ctx) {
|
|
40
|
+
if (ctx.toolName !== 'click_element')
|
|
41
|
+
return null;
|
|
42
|
+
if (ctx.isError)
|
|
43
|
+
return null;
|
|
44
|
+
return 'Hint: Click may trigger navigation. Use wait_for to verify.';
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'fill-form-submitted',
|
|
49
|
+
priority: 403,
|
|
50
|
+
match(ctx) {
|
|
51
|
+
if (ctx.toolName !== 'fill_form')
|
|
52
|
+
return null;
|
|
53
|
+
if (ctx.isError)
|
|
54
|
+
return null;
|
|
55
|
+
if (/submit|submitted|success/i.test(ctx.resultText)) {
|
|
56
|
+
return 'Hint: Form submitted. Use wait_for(navigation) to verify.';
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
//# sourceMappingURL=success-hints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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YAC9C,IAAI,GAAG,CAAC,OAAO;gBAAE,OAAO,IAAI,CAAC;YAC7B,IAAI,2BAA2B,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBACrD,OAAO,2DAA2D,CAAC;YACrE,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KACF;CACF,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* CLI Entry Point for claude-chrome-parallel
|
|
4
|
+
* MCP Server for parallel Claude Code browser sessions
|
|
5
|
+
*
|
|
6
|
+
* Uses puppeteer-core to directly connect to Chrome DevTools Protocol,
|
|
7
|
+
* enabling multiple Claude Code sessions to control Chrome simultaneously.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG"}
|