agent-web-interface 4.3.0 → 4.5.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/dist/src/browser/browser-session-config.d.ts +33 -0
- package/dist/src/browser/browser-session-config.d.ts.map +1 -0
- package/dist/src/browser/browser-session-config.js +24 -0
- package/dist/src/browser/browser-session-config.js.map +1 -0
- package/dist/src/browser/connection-utils.d.ts +48 -0
- package/dist/src/browser/connection-utils.d.ts.map +1 -0
- package/dist/src/browser/connection-utils.js +129 -0
- package/dist/src/browser/connection-utils.js.map +1 -0
- package/dist/src/browser/ensure-browser.d.ts +12 -27
- package/dist/src/browser/ensure-browser.d.ts.map +1 -1
- package/dist/src/browser/ensure-browser.js +104 -37
- package/dist/src/browser/ensure-browser.js.map +1 -1
- package/dist/src/browser/index.d.ts +4 -1
- package/dist/src/browser/index.d.ts.map +1 -1
- package/dist/src/browser/index.js +3 -1
- package/dist/src/browser/index.js.map +1 -1
- package/dist/src/browser/session-manager.d.ts +21 -89
- package/dist/src/browser/session-manager.d.ts.map +1 -1
- package/dist/src/browser/session-manager.js +122 -132
- package/dist/src/browser/session-manager.js.map +1 -1
- package/dist/src/browser/session-manager.types.d.ts +102 -0
- package/dist/src/browser/session-manager.types.d.ts.map +1 -0
- package/dist/src/browser/session-manager.types.js +11 -0
- package/dist/src/browser/session-manager.types.js.map +1 -0
- package/dist/src/cli/args.d.ts +12 -18
- package/dist/src/cli/args.d.ts.map +1 -1
- package/dist/src/cli/args.js +35 -40
- package/dist/src/cli/args.js.map +1 -1
- package/dist/src/form/constraint-extraction.d.ts +36 -0
- package/dist/src/form/constraint-extraction.d.ts.map +1 -0
- package/dist/src/form/constraint-extraction.js +117 -0
- package/dist/src/form/constraint-extraction.js.map +1 -0
- package/dist/src/form/field-extractor.d.ts.map +1 -1
- package/dist/src/form/field-extractor.js +16 -450
- package/dist/src/form/field-extractor.js.map +1 -1
- package/dist/src/form/field-state-extractor.d.ts +22 -0
- package/dist/src/form/field-state-extractor.d.ts.map +1 -0
- package/dist/src/form/field-state-extractor.js +55 -0
- package/dist/src/form/field-state-extractor.js.map +1 -0
- package/dist/src/form/form-actions.d.ts +45 -0
- package/dist/src/form/form-actions.d.ts.map +1 -0
- package/dist/src/form/form-actions.js +108 -0
- package/dist/src/form/form-actions.js.map +1 -0
- package/dist/src/form/form-detector.d.ts +0 -36
- package/dist/src/form/form-detector.d.ts.map +1 -1
- package/dist/src/form/form-detector.js +11 -376
- package/dist/src/form/form-detector.js.map +1 -1
- package/dist/src/form/form-state.d.ts.map +1 -1
- package/dist/src/form/form-state.js +16 -4
- package/dist/src/form/form-state.js.map +1 -1
- package/dist/src/form/input-clustering.d.ts +15 -0
- package/dist/src/form/input-clustering.d.ts.map +1 -0
- package/dist/src/form/input-clustering.js +61 -0
- package/dist/src/form/input-clustering.js.map +1 -0
- package/dist/src/form/intent-inference.d.ts +28 -0
- package/dist/src/form/intent-inference.d.ts.map +1 -0
- package/dist/src/form/intent-inference.js +137 -0
- package/dist/src/form/intent-inference.js.map +1 -0
- package/dist/src/form/purpose-inference.d.ts +50 -0
- package/dist/src/form/purpose-inference.d.ts.map +1 -0
- package/dist/src/form/purpose-inference.js +313 -0
- package/dist/src/form/purpose-inference.js.map +1 -0
- package/dist/src/form/submit-detection.d.ts +36 -0
- package/dist/src/form/submit-detection.d.ts.map +1 -0
- package/dist/src/form/submit-detection.js +101 -0
- package/dist/src/form/submit-detection.js.map +1 -0
- package/dist/src/form/types.d.ts +2 -2
- package/dist/src/gateway/http-gateway.d.ts +56 -0
- package/dist/src/gateway/http-gateway.d.ts.map +1 -0
- package/dist/src/gateway/http-gateway.js +229 -0
- package/dist/src/gateway/http-gateway.js.map +1 -0
- package/dist/src/gateway/json-rpc-errors.d.ts +6 -0
- package/dist/src/gateway/json-rpc-errors.d.ts.map +1 -0
- package/dist/src/gateway/json-rpc-errors.js +11 -0
- package/dist/src/gateway/json-rpc-errors.js.map +1 -0
- package/dist/src/gateway/session-router.d.ts +80 -0
- package/dist/src/gateway/session-router.d.ts.map +1 -0
- package/dist/src/gateway/session-router.js +177 -0
- package/dist/src/gateway/session-router.js.map +1 -0
- package/dist/src/http-entry.d.ts +20 -0
- package/dist/src/http-entry.d.ts.map +1 -0
- package/dist/src/http-entry.js +112 -0
- package/dist/src/http-entry.js.map +1 -0
- package/dist/src/index.d.ts +1 -10
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +25 -227
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/text-utils.d.ts +0 -24
- package/dist/src/lib/text-utils.d.ts.map +1 -1
- package/dist/src/lib/text-utils.js +2 -38
- package/dist/src/lib/text-utils.js.map +1 -1
- package/dist/src/observation/eid-linker.d.ts.map +1 -1
- package/dist/src/observation/eid-linker.js +1 -21
- package/dist/src/observation/eid-linker.js.map +1 -1
- package/dist/src/observation/observation-accumulator.d.ts +1 -1
- package/dist/src/observation/observation-accumulator.js +1 -1
- package/dist/src/observation/observer-script.d.ts +1 -1
- package/dist/src/observation/observer-script.d.ts.map +1 -1
- package/dist/src/observation/observer-script.js +129 -7
- package/dist/src/observation/observer-script.js.map +1 -1
- package/dist/src/query/disambiguation.d.ts +18 -0
- package/dist/src/query/disambiguation.d.ts.map +1 -0
- package/dist/src/query/disambiguation.js +123 -0
- package/dist/src/query/disambiguation.js.map +1 -0
- package/dist/src/query/fuzzy-match.d.ts +17 -0
- package/dist/src/query/fuzzy-match.d.ts.map +1 -0
- package/dist/src/query/fuzzy-match.js +34 -0
- package/dist/src/query/fuzzy-match.js.map +1 -0
- package/dist/src/query/index.d.ts +3 -0
- package/dist/src/query/index.d.ts.map +1 -1
- package/dist/src/query/index.js +6 -0
- package/dist/src/query/index.js.map +1 -1
- package/dist/src/query/query-engine.d.ts +0 -35
- package/dist/src/query/query-engine.d.ts.map +1 -1
- package/dist/src/query/query-engine.js +9 -309
- package/dist/src/query/query-engine.js.map +1 -1
- package/dist/src/query/scoring.d.ts +52 -0
- package/dist/src/query/scoring.d.ts.map +1 -0
- package/dist/src/query/scoring.js +162 -0
- package/dist/src/query/scoring.js.map +1 -0
- package/dist/src/server/index.d.ts +0 -1
- package/dist/src/server/index.d.ts.map +1 -1
- package/dist/src/server/index.js +0 -1
- package/dist/src/server/index.js.map +1 -1
- package/dist/src/server/mcp-server.d.ts +6 -2
- package/dist/src/server/mcp-server.d.ts.map +1 -1
- package/dist/src/server/mcp-server.js +3 -91
- package/dist/src/server/mcp-server.js.map +1 -1
- package/dist/src/server/server-config.d.ts +4 -20
- package/dist/src/server/server-config.d.ts.map +1 -1
- package/dist/src/server/server-config.js +6 -50
- package/dist/src/server/server-config.js.map +1 -1
- package/dist/src/server/tool-registrar.types.d.ts +25 -0
- package/dist/src/server/tool-registrar.types.d.ts.map +1 -0
- package/dist/src/server/tool-registrar.types.js +10 -0
- package/dist/src/server/tool-registrar.types.js.map +1 -0
- package/dist/src/server/tool-result-handler.d.ts +61 -0
- package/dist/src/server/tool-result-handler.d.ts.map +1 -0
- package/dist/src/server/tool-result-handler.js +137 -0
- package/dist/src/server/tool-result-handler.js.map +1 -0
- package/dist/src/session/session-controller.d.ts +123 -0
- package/dist/src/session/session-controller.d.ts.map +1 -0
- package/dist/src/session/session-controller.js +273 -0
- package/dist/src/session/session-controller.js.map +1 -0
- package/dist/src/shared/services/index.d.ts +0 -2
- package/dist/src/shared/services/index.d.ts.map +1 -1
- package/dist/src/shared/services/index.js +0 -2
- package/dist/src/shared/services/index.js.map +1 -1
- package/dist/src/shared/version.d.ts +10 -0
- package/dist/src/shared/version.d.ts.map +1 -0
- package/dist/src/shared/version.js +32 -0
- package/dist/src/shared/version.js.map +1 -0
- package/dist/src/snapshot/element-resolver.d.ts +27 -15
- package/dist/src/snapshot/element-resolver.d.ts.map +1 -1
- package/dist/src/snapshot/element-resolver.js +196 -91
- package/dist/src/snapshot/element-resolver.js.map +1 -1
- package/dist/src/snapshot/extractors/attribute-extractor.d.ts.map +1 -1
- package/dist/src/snapshot/extractors/attribute-extractor.js +4 -0
- package/dist/src/snapshot/extractors/attribute-extractor.js.map +1 -1
- package/dist/src/snapshot/extractors/ax-extractor.d.ts +1 -1
- package/dist/src/snapshot/extractors/ax-extractor.d.ts.map +1 -1
- package/dist/src/snapshot/extractors/ax-extractor.js +4 -1
- package/dist/src/snapshot/extractors/ax-extractor.js.map +1 -1
- package/dist/src/snapshot/extractors/index.d.ts +1 -1
- package/dist/src/snapshot/extractors/index.d.ts.map +1 -1
- package/dist/src/snapshot/extractors/index.js +1 -1
- package/dist/src/snapshot/extractors/index.js.map +1 -1
- package/dist/src/snapshot/extractors/layout-extractor.d.ts +9 -7
- package/dist/src/snapshot/extractors/layout-extractor.d.ts.map +1 -1
- package/dist/src/snapshot/extractors/layout-extractor.js +34 -19
- package/dist/src/snapshot/extractors/layout-extractor.js.map +1 -1
- package/dist/src/snapshot/extractors/region-resolver.d.ts.map +1 -1
- package/dist/src/snapshot/extractors/region-resolver.js +8 -0
- package/dist/src/snapshot/extractors/region-resolver.js.map +1 -1
- package/dist/src/snapshot/extractors/state-extractor.d.ts +2 -2
- package/dist/src/snapshot/extractors/state-extractor.d.ts.map +1 -1
- package/dist/src/snapshot/extractors/state-extractor.js +22 -2
- package/dist/src/snapshot/extractors/state-extractor.js.map +1 -1
- package/dist/src/snapshot/extractors/types.d.ts +14 -0
- package/dist/src/snapshot/extractors/types.d.ts.map +1 -1
- package/dist/src/snapshot/extractors/types.js +16 -0
- package/dist/src/snapshot/extractors/types.js.map +1 -1
- package/dist/src/snapshot/frame-context.d.ts +68 -0
- package/dist/src/snapshot/frame-context.d.ts.map +1 -0
- package/dist/src/snapshot/frame-context.js +131 -0
- package/dist/src/snapshot/frame-context.js.map +1 -0
- package/dist/src/snapshot/heading-index.d.ts +28 -0
- package/dist/src/snapshot/heading-index.d.ts.map +1 -0
- package/dist/src/snapshot/heading-index.js +108 -0
- package/dist/src/snapshot/heading-index.js.map +1 -0
- package/dist/src/snapshot/index.d.ts +5 -3
- package/dist/src/snapshot/index.d.ts.map +1 -1
- package/dist/src/snapshot/index.js +3 -2
- package/dist/src/snapshot/index.js.map +1 -1
- package/dist/src/snapshot/kind-mapping.d.ts +30 -0
- package/dist/src/snapshot/kind-mapping.d.ts.map +1 -0
- package/dist/src/snapshot/kind-mapping.js +114 -0
- package/dist/src/snapshot/kind-mapping.js.map +1 -0
- package/dist/src/snapshot/node-filter.d.ts +31 -0
- package/dist/src/snapshot/node-filter.d.ts.map +1 -0
- package/dist/src/snapshot/node-filter.js +137 -0
- package/dist/src/snapshot/node-filter.js.map +1 -0
- package/dist/src/snapshot/node-synthesizer.d.ts +62 -0
- package/dist/src/snapshot/node-synthesizer.d.ts.map +1 -0
- package/dist/src/snapshot/node-synthesizer.js +185 -0
- package/dist/src/snapshot/node-synthesizer.js.map +1 -0
- package/dist/src/snapshot/snapshot-compiler.d.ts +2 -36
- package/dist/src/snapshot/snapshot-compiler.d.ts.map +1 -1
- package/dist/src/snapshot/snapshot-compiler.js +40 -549
- package/dist/src/snapshot/snapshot-compiler.js.map +1 -1
- package/dist/src/snapshot/snapshot.types.d.ts +17 -3
- package/dist/src/snapshot/snapshot.types.d.ts.map +1 -1
- package/dist/src/snapshot/snapshot.types.js +8 -0
- package/dist/src/snapshot/snapshot.types.js.map +1 -1
- package/dist/src/state/actionables-filter.d.ts +5 -0
- package/dist/src/state/actionables-filter.d.ts.map +1 -1
- package/dist/src/state/actionables-filter.js +28 -6
- package/dist/src/state/actionables-filter.js.map +1 -1
- package/dist/src/state/atoms-extractor.d.ts.map +1 -1
- package/dist/src/state/atoms-extractor.js +3 -23
- package/dist/src/state/atoms-extractor.js.map +1 -1
- package/dist/src/state/diff-engine.d.ts.map +1 -1
- package/dist/src/state/diff-engine.js +9 -36
- package/dist/src/state/diff-engine.js.map +1 -1
- package/dist/src/state/element-identity.d.ts +3 -6
- package/dist/src/state/element-identity.d.ts.map +1 -1
- package/dist/src/state/element-identity.js +10 -7
- package/dist/src/state/element-identity.js.map +1 -1
- package/dist/src/state/element-ref.types.d.ts +5 -27
- package/dist/src/state/element-ref.types.d.ts.map +1 -1
- package/dist/src/state/element-registry.d.ts.map +1 -1
- package/dist/src/state/element-registry.js +6 -4
- package/dist/src/state/element-registry.js.map +1 -1
- package/dist/src/state/hash-utils.d.ts +24 -0
- package/dist/src/state/hash-utils.d.ts.map +1 -0
- package/dist/src/state/hash-utils.js +41 -0
- package/dist/src/state/hash-utils.js.map +1 -0
- package/dist/src/state/layer-detector.d.ts.map +1 -1
- package/dist/src/state/layer-detector.js +15 -286
- package/dist/src/state/layer-detector.js.map +1 -1
- package/dist/src/state/layer-detectors/drawer-detector.d.ts +32 -0
- package/dist/src/state/layer-detectors/drawer-detector.d.ts.map +1 -0
- package/dist/src/state/layer-detectors/drawer-detector.js +96 -0
- package/dist/src/state/layer-detectors/drawer-detector.js.map +1 -0
- package/dist/src/state/layer-detectors/index.d.ts +10 -0
- package/dist/src/state/layer-detectors/index.d.ts.map +1 -0
- package/dist/src/state/layer-detectors/index.js +10 -0
- package/dist/src/state/layer-detectors/index.js.map +1 -0
- package/dist/src/state/layer-detectors/modal-detector.d.ts +30 -0
- package/dist/src/state/layer-detectors/modal-detector.d.ts.map +1 -0
- package/dist/src/state/layer-detectors/modal-detector.js +127 -0
- package/dist/src/state/layer-detectors/modal-detector.js.map +1 -0
- package/dist/src/state/layer-detectors/popover-detector.d.ts +20 -0
- package/dist/src/state/layer-detectors/popover-detector.d.ts.map +1 -0
- package/dist/src/state/layer-detectors/popover-detector.js +76 -0
- package/dist/src/state/layer-detectors/popover-detector.js.map +1 -0
- package/dist/src/state/layer-detectors/toast-detector.d.ts +24 -0
- package/dist/src/state/layer-detectors/toast-detector.d.ts.map +1 -0
- package/dist/src/state/layer-detectors/toast-detector.js +48 -0
- package/dist/src/state/layer-detectors/toast-detector.js.map +1 -0
- package/dist/src/state/region-mapping.d.ts +13 -0
- package/dist/src/state/region-mapping.d.ts.map +1 -0
- package/dist/src/state/region-mapping.js +25 -0
- package/dist/src/state/region-mapping.js.map +1 -0
- package/dist/src/state/state-manager.d.ts.map +1 -1
- package/dist/src/state/state-manager.js +11 -193
- package/dist/src/state/state-manager.js.map +1 -1
- package/dist/src/state/state-renderer.d.ts.map +1 -1
- package/dist/src/state/state-renderer.js +17 -3
- package/dist/src/state/state-renderer.js.map +1 -1
- package/dist/src/state/types.d.ts +10 -5
- package/dist/src/state/types.d.ts.map +1 -1
- package/dist/src/state/url-sanitization.d.ts +22 -0
- package/dist/src/state/url-sanitization.d.ts.map +1 -0
- package/dist/src/state/url-sanitization.js +76 -0
- package/dist/src/state/url-sanitization.js.map +1 -0
- package/dist/src/state/value-masking.d.ts +36 -0
- package/dist/src/state/value-masking.d.ts.map +1 -0
- package/dist/src/state/value-masking.js +86 -0
- package/dist/src/state/value-masking.js.map +1 -0
- package/dist/src/tools/action-context.d.ts +55 -0
- package/dist/src/tools/action-context.d.ts.map +1 -0
- package/dist/src/tools/action-context.js +69 -0
- package/dist/src/tools/action-context.js.map +1 -0
- package/dist/src/tools/action-stabilization.d.ts +48 -0
- package/dist/src/tools/action-stabilization.d.ts.map +1 -0
- package/dist/src/tools/action-stabilization.js +93 -0
- package/dist/src/tools/action-stabilization.js.map +1 -0
- package/dist/src/tools/browser-tools.d.ts +9 -167
- package/dist/src/tools/browser-tools.d.ts.map +1 -1
- package/dist/src/tools/browser-tools.js +15 -651
- package/dist/src/tools/browser-tools.js.map +1 -1
- package/dist/src/tools/canvas-tools.d.ts +2 -1
- package/dist/src/tools/canvas-tools.d.ts.map +1 -1
- package/dist/src/tools/canvas-tools.js +5 -7
- package/dist/src/tools/canvas-tools.js.map +1 -1
- package/dist/src/tools/effect-tracker.d.ts +25 -0
- package/dist/src/tools/effect-tracker.d.ts.map +1 -0
- package/dist/src/tools/effect-tracker.js +69 -0
- package/dist/src/tools/effect-tracker.js.map +1 -0
- package/dist/src/tools/errors.d.ts +2 -34
- package/dist/src/tools/errors.d.ts.map +1 -1
- package/dist/src/tools/errors.js +1 -44
- package/dist/src/tools/errors.js.map +1 -1
- package/dist/src/tools/execute-action.d.ts +5 -34
- package/dist/src/tools/execute-action.d.ts.map +1 -1
- package/dist/src/tools/execute-action.js +37 -297
- package/dist/src/tools/execute-action.js.map +1 -1
- package/dist/src/tools/form-tools.d.ts +5 -10
- package/dist/src/tools/form-tools.d.ts.map +1 -1
- package/dist/src/tools/form-tools.js +42 -22
- package/dist/src/tools/form-tools.js.map +1 -1
- package/dist/src/tools/index.d.ts +6 -6
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +16 -17
- package/dist/src/tools/index.js.map +1 -1
- package/dist/src/tools/interaction-tools.d.ts +47 -0
- package/dist/src/tools/interaction-tools.d.ts.map +1 -0
- package/dist/src/tools/interaction-tools.js +135 -0
- package/dist/src/tools/interaction-tools.js.map +1 -0
- package/dist/src/tools/navigation-detection.d.ts +31 -0
- package/dist/src/tools/navigation-detection.d.ts.map +1 -0
- package/dist/src/tools/navigation-detection.js +46 -0
- package/dist/src/tools/navigation-detection.js.map +1 -0
- package/dist/src/tools/navigation-tools.d.ts +51 -0
- package/dist/src/tools/navigation-tools.d.ts.map +1 -0
- package/dist/src/tools/navigation-tools.js +171 -0
- package/dist/src/tools/navigation-tools.js.map +1 -0
- package/dist/src/tools/observation-tools.d.ts +54 -0
- package/dist/src/tools/observation-tools.d.ts.map +1 -0
- package/dist/src/tools/observation-tools.js +243 -0
- package/dist/src/tools/observation-tools.js.map +1 -0
- package/dist/src/tools/readability-tools.d.ts +16 -0
- package/dist/src/tools/readability-tools.d.ts.map +1 -0
- package/dist/src/tools/readability-tools.js +45 -0
- package/dist/src/tools/readability-tools.js.map +1 -0
- package/dist/src/tools/response-builder.d.ts +20 -32
- package/dist/src/tools/response-builder.d.ts.map +1 -1
- package/dist/src/tools/response-builder.js +32 -48
- package/dist/src/tools/response-builder.js.map +1 -1
- package/dist/src/tools/stale-element-retry.d.ts +37 -0
- package/dist/src/tools/stale-element-retry.d.ts.map +1 -0
- package/dist/src/tools/stale-element-retry.js +103 -0
- package/dist/src/tools/stale-element-retry.js.map +1 -0
- package/dist/src/tools/tool-context.d.ts +4 -36
- package/dist/src/tools/tool-context.d.ts.map +1 -1
- package/dist/src/tools/tool-context.js +6 -75
- package/dist/src/tools/tool-context.js.map +1 -1
- package/dist/src/tools/tool-context.types.d.ts +141 -0
- package/dist/src/tools/tool-context.types.d.ts.map +1 -0
- package/dist/src/tools/tool-context.types.js +11 -0
- package/dist/src/tools/tool-context.types.js.map +1 -0
- package/dist/src/tools/tool-registration.d.ts +25 -0
- package/dist/src/tools/tool-registration.d.ts.map +1 -0
- package/dist/src/tools/tool-registration.js +180 -0
- package/dist/src/tools/tool-registration.js.map +1 -0
- package/dist/src/tools/tool-schemas.d.ts +176 -1950
- package/dist/src/tools/tool-schemas.d.ts.map +1 -1
- package/dist/src/tools/tool-schemas.js +80 -320
- package/dist/src/tools/tool-schemas.js.map +1 -1
- package/dist/src/tools/viewport-tools.d.ts +37 -0
- package/dist/src/tools/viewport-tools.d.ts.map +1 -0
- package/dist/src/tools/viewport-tools.js +101 -0
- package/dist/src/tools/viewport-tools.js.map +1 -0
- package/dist/src/worker/chrome-worker-process.d.ts +4 -0
- package/dist/src/worker/chrome-worker-process.d.ts.map +1 -1
- package/dist/src/worker/chrome-worker-process.js +1 -1
- package/dist/src/worker/chrome-worker-process.js.map +1 -1
- package/package.json +7 -3
- package/dist/src/factpack/action-selector.d.ts +0 -36
- package/dist/src/factpack/action-selector.d.ts.map +0 -1
- package/dist/src/factpack/action-selector.js +0 -367
- package/dist/src/factpack/action-selector.js.map +0 -1
- package/dist/src/factpack/dialog-detector.d.ts +0 -19
- package/dist/src/factpack/dialog-detector.d.ts.map +0 -1
- package/dist/src/factpack/dialog-detector.js +0 -354
- package/dist/src/factpack/dialog-detector.js.map +0 -1
- package/dist/src/factpack/form-detector.d.ts +0 -28
- package/dist/src/factpack/form-detector.d.ts.map +0 -1
- package/dist/src/factpack/form-detector.js +0 -555
- package/dist/src/factpack/form-detector.js.map +0 -1
- package/dist/src/factpack/index.d.ts +0 -32
- package/dist/src/factpack/index.d.ts.map +0 -1
- package/dist/src/factpack/index.js +0 -73
- package/dist/src/factpack/index.js.map +0 -1
- package/dist/src/factpack/page-classifier.d.ts +0 -22
- package/dist/src/factpack/page-classifier.d.ts.map +0 -1
- package/dist/src/factpack/page-classifier.js +0 -526
- package/dist/src/factpack/page-classifier.js.map +0 -1
- package/dist/src/factpack/types.d.ts +0 -307
- package/dist/src/factpack/types.d.ts.map +0 -1
- package/dist/src/factpack/types.js +0 -12
- package/dist/src/factpack/types.js.map +0 -1
- package/dist/src/lib/constants.d.ts +0 -27
- package/dist/src/lib/constants.d.ts.map +0 -1
- package/dist/src/lib/constants.js +0 -63
- package/dist/src/lib/constants.js.map +0 -1
- package/dist/src/lib/index.d.ts +0 -12
- package/dist/src/lib/index.d.ts.map +0 -1
- package/dist/src/lib/index.js +0 -17
- package/dist/src/lib/index.js.map +0 -1
- package/dist/src/lib/regions.d.ts +0 -29
- package/dist/src/lib/regions.d.ts.map +0 -1
- package/dist/src/lib/regions.js +0 -93
- package/dist/src/lib/regions.js.map +0 -1
- package/dist/src/lib/scoring.d.ts +0 -47
- package/dist/src/lib/scoring.d.ts.map +0 -1
- package/dist/src/lib/scoring.js +0 -79
- package/dist/src/lib/scoring.js.map +0 -1
- package/dist/src/lib/selectors.d.ts +0 -42
- package/dist/src/lib/selectors.d.ts.map +0 -1
- package/dist/src/lib/selectors.js +0 -138
- package/dist/src/lib/selectors.js.map +0 -1
- package/dist/src/renderer/budget-manager.d.ts +0 -46
- package/dist/src/renderer/budget-manager.d.ts.map +0 -1
- package/dist/src/renderer/budget-manager.js +0 -133
- package/dist/src/renderer/budget-manager.js.map +0 -1
- package/dist/src/renderer/constants.d.ts +0 -38
- package/dist/src/renderer/constants.d.ts.map +0 -1
- package/dist/src/renderer/constants.js +0 -29
- package/dist/src/renderer/constants.js.map +0 -1
- package/dist/src/renderer/index.d.ts +0 -12
- package/dist/src/renderer/index.d.ts.map +0 -1
- package/dist/src/renderer/index.js +0 -16
- package/dist/src/renderer/index.js.map +0 -1
- package/dist/src/renderer/section-renderers.d.ts +0 -42
- package/dist/src/renderer/section-renderers.d.ts.map +0 -1
- package/dist/src/renderer/section-renderers.js +0 -252
- package/dist/src/renderer/section-renderers.js.map +0 -1
- package/dist/src/renderer/token-counter.d.ts +0 -45
- package/dist/src/renderer/token-counter.d.ts.map +0 -1
- package/dist/src/renderer/token-counter.js +0 -65
- package/dist/src/renderer/token-counter.js.map +0 -1
- package/dist/src/renderer/types.d.ts +0 -71
- package/dist/src/renderer/types.d.ts.map +0 -1
- package/dist/src/renderer/types.js +0 -7
- package/dist/src/renderer/types.js.map +0 -1
- package/dist/src/renderer/xml-renderer.d.ts +0 -42
- package/dist/src/renderer/xml-renderer.d.ts.map +0 -1
- package/dist/src/renderer/xml-renderer.js +0 -103
- package/dist/src/renderer/xml-renderer.js.map +0 -1
- package/dist/src/server/session-store.d.ts +0 -163
- package/dist/src/server/session-store.d.ts.map +0 -1
- package/dist/src/server/session-store.js +0 -248
- package/dist/src/server/session-store.js.map +0 -1
- package/dist/src/session/session-worker-binding.d.ts +0 -57
- package/dist/src/session/session-worker-binding.d.ts.map +0 -1
- package/dist/src/session/session-worker-binding.js +0 -109
- package/dist/src/session/session-worker-binding.js.map +0 -1
- package/dist/src/shared/services/dom-transformer.service.d.ts +0 -71
- package/dist/src/shared/services/dom-transformer.service.d.ts.map +0 -1
- package/dist/src/shared/services/dom-transformer.service.js +0 -190
- package/dist/src/shared/services/dom-transformer.service.js.map +0 -1
- package/dist/src/shared/services/selector-builder.service.d.ts +0 -53
- package/dist/src/shared/services/selector-builder.service.d.ts.map +0 -1
- package/dist/src/shared/services/selector-builder.service.js +0 -240
- package/dist/src/shared/services/selector-builder.service.js.map +0 -1
- package/dist/src/state/constants.d.ts +0 -125
- package/dist/src/state/constants.d.ts.map +0 -1
- package/dist/src/state/constants.js +0 -131
- package/dist/src/state/constants.js.map +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Viewport Tools
|
|
3
|
+
*
|
|
4
|
+
* MCP tool handlers for viewport-level actions: drag, wheel, screenshot.
|
|
5
|
+
*/
|
|
6
|
+
import type { ToolContext } from './tool-context.types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Drag from one point to another.
|
|
9
|
+
*
|
|
10
|
+
* If eid is provided, coordinates are relative to the element's top-left corner.
|
|
11
|
+
* Otherwise, coordinates are absolute viewport coordinates.
|
|
12
|
+
*
|
|
13
|
+
* @param rawInput - Drag options (will be validated)
|
|
14
|
+
* @returns Drag result with updated snapshot
|
|
15
|
+
*/
|
|
16
|
+
export declare function drag(rawInput: unknown, ctx: ToolContext): Promise<import('./tool-schemas.js').DragOutput>;
|
|
17
|
+
/**
|
|
18
|
+
* Dispatch a mouse wheel event.
|
|
19
|
+
*
|
|
20
|
+
* If eid is provided, x/y coordinates are relative to the element's top-left corner.
|
|
21
|
+
* Otherwise, x/y are absolute viewport coordinates.
|
|
22
|
+
*
|
|
23
|
+
* @param rawInput - Wheel options (will be validated)
|
|
24
|
+
* @returns Wheel result with updated snapshot
|
|
25
|
+
*/
|
|
26
|
+
export declare function wheel(rawInput: unknown, ctx: ToolContext): Promise<import('./tool-schemas.js').WheelOutput>;
|
|
27
|
+
/**
|
|
28
|
+
* Take a screenshot of the page or a specific element.
|
|
29
|
+
*
|
|
30
|
+
* Observation tool - does not mutate page state.
|
|
31
|
+
* Returns inline image (<2MB) or temp file path (>=2MB).
|
|
32
|
+
*
|
|
33
|
+
* @param rawInput - Screenshot options (will be validated)
|
|
34
|
+
* @returns ImageResult or FileResult
|
|
35
|
+
*/
|
|
36
|
+
export declare function takeScreenshot(rawInput: unknown, ctx: ToolContext): Promise<import('./tool-schemas.js').TakeScreenshotOutput>;
|
|
37
|
+
//# sourceMappingURL=viewport-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/viewport-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D;;;;;;;;GAQG;AACH,wBAAsB,IAAI,CACxB,QAAQ,EAAE,OAAO,EACjB,GAAG,EAAE,WAAW,GACf,OAAO,CAAC,OAAO,mBAAmB,EAAE,UAAU,CAAC,CAuCjD;AAED;;;;;;;;GAQG;AACH,wBAAsB,KAAK,CACzB,QAAQ,EAAE,OAAO,EACjB,GAAG,EAAE,WAAW,GACf,OAAO,CAAC,OAAO,mBAAmB,EAAE,WAAW,CAAC,CAkClD;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,OAAO,EACjB,GAAG,EAAE,WAAW,GACf,OAAO,CAAC,OAAO,mBAAmB,EAAE,oBAAoB,CAAC,CA6B3D"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Viewport Tools
|
|
3
|
+
*
|
|
4
|
+
* MCP tool handlers for viewport-level actions: drag, wheel, screenshot.
|
|
5
|
+
*/
|
|
6
|
+
import { getElementTopLeft, dragBetweenCoordinates, dispatchWheelEvent, } from '../snapshot/index.js';
|
|
7
|
+
import { DragInputSchema, WheelInputSchema, TakeScreenshotInputSchema } from './tool-schemas.js';
|
|
8
|
+
import { captureScreenshot, getElementBoundingBox } from '../screenshot/index.js';
|
|
9
|
+
import { executeAction } from './execute-action.js';
|
|
10
|
+
import { prepareActionContext } from './action-context.js';
|
|
11
|
+
/**
|
|
12
|
+
* Drag from one point to another.
|
|
13
|
+
*
|
|
14
|
+
* If eid is provided, coordinates are relative to the element's top-left corner.
|
|
15
|
+
* Otherwise, coordinates are absolute viewport coordinates.
|
|
16
|
+
*
|
|
17
|
+
* @param rawInput - Drag options (will be validated)
|
|
18
|
+
* @returns Drag result with updated snapshot
|
|
19
|
+
*/
|
|
20
|
+
export async function drag(rawInput, ctx) {
|
|
21
|
+
const input = DragInputSchema.parse(rawInput);
|
|
22
|
+
const { handleRef, pageId, captureSnapshot } = await prepareActionContext(input.page_id, ctx);
|
|
23
|
+
let sourceX = input.source_x;
|
|
24
|
+
let sourceY = input.source_y;
|
|
25
|
+
let targetX = input.target_x;
|
|
26
|
+
let targetY = input.target_y;
|
|
27
|
+
if (input.eid) {
|
|
28
|
+
const snap = ctx.requireSnapshot(pageId);
|
|
29
|
+
const node = ctx.resolveElementByEid(pageId, input.eid, snap);
|
|
30
|
+
const { x, y } = await getElementTopLeft(handleRef.current.cdp, node.backend_node_id);
|
|
31
|
+
sourceX = x + input.source_x;
|
|
32
|
+
sourceY = y + input.source_y;
|
|
33
|
+
targetX = x + input.target_x;
|
|
34
|
+
targetY = y + input.target_y;
|
|
35
|
+
}
|
|
36
|
+
const result = await executeAction(handleRef.current, async () => {
|
|
37
|
+
await dragBetweenCoordinates(handleRef.current.cdp, sourceX, sourceY, targetX, targetY, 10, input.modifiers);
|
|
38
|
+
}, ctx, captureSnapshot);
|
|
39
|
+
ctx.getSnapshotStore().store(pageId, result.snapshot);
|
|
40
|
+
return result.state_response;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Dispatch a mouse wheel event.
|
|
44
|
+
*
|
|
45
|
+
* If eid is provided, x/y coordinates are relative to the element's top-left corner.
|
|
46
|
+
* Otherwise, x/y are absolute viewport coordinates.
|
|
47
|
+
*
|
|
48
|
+
* @param rawInput - Wheel options (will be validated)
|
|
49
|
+
* @returns Wheel result with updated snapshot
|
|
50
|
+
*/
|
|
51
|
+
export async function wheel(rawInput, ctx) {
|
|
52
|
+
const input = WheelInputSchema.parse(rawInput);
|
|
53
|
+
const { handleRef, pageId, captureSnapshot } = await prepareActionContext(input.page_id, ctx);
|
|
54
|
+
let x = input.x;
|
|
55
|
+
let y = input.y;
|
|
56
|
+
if (input.eid) {
|
|
57
|
+
const snap = ctx.requireSnapshot(pageId);
|
|
58
|
+
const node = ctx.resolveElementByEid(pageId, input.eid, snap);
|
|
59
|
+
const topLeft = await getElementTopLeft(handleRef.current.cdp, node.backend_node_id);
|
|
60
|
+
x = topLeft.x + input.x;
|
|
61
|
+
y = topLeft.y + input.y;
|
|
62
|
+
}
|
|
63
|
+
const result = await executeAction(handleRef.current, async () => {
|
|
64
|
+
await dispatchWheelEvent(handleRef.current.cdp, x, y, input.deltaX, input.deltaY, input.modifiers);
|
|
65
|
+
}, ctx, captureSnapshot);
|
|
66
|
+
ctx.getSnapshotStore().store(pageId, result.snapshot);
|
|
67
|
+
return result.state_response;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Take a screenshot of the page or a specific element.
|
|
71
|
+
*
|
|
72
|
+
* Observation tool - does not mutate page state.
|
|
73
|
+
* Returns inline image (<2MB) or temp file path (>=2MB).
|
|
74
|
+
*
|
|
75
|
+
* @param rawInput - Screenshot options (will be validated)
|
|
76
|
+
* @returns ImageResult or FileResult
|
|
77
|
+
*/
|
|
78
|
+
export async function takeScreenshot(rawInput, ctx) {
|
|
79
|
+
const input = TakeScreenshotInputSchema.parse(rawInput);
|
|
80
|
+
if (input.eid && input.fullPage) {
|
|
81
|
+
throw new Error("Cannot use both 'eid' and 'fullPage'. Use eid for element screenshots OR fullPage for full-page capture.");
|
|
82
|
+
}
|
|
83
|
+
let handle = ctx.resolveExistingPage(input.page_id);
|
|
84
|
+
const pageId = handle.page_id;
|
|
85
|
+
// Ensure CDP session is healthy (auto-repair if needed)
|
|
86
|
+
const ensureResult = await ctx.ensureCdpSession(handle);
|
|
87
|
+
handle = ensureResult.handle;
|
|
88
|
+
let clip;
|
|
89
|
+
if (input.eid) {
|
|
90
|
+
const snapshot = ctx.requireSnapshot(pageId);
|
|
91
|
+
const node = ctx.resolveElementByEid(pageId, input.eid, snapshot);
|
|
92
|
+
clip = await getElementBoundingBox(handle.cdp, node.backend_node_id);
|
|
93
|
+
}
|
|
94
|
+
return captureScreenshot(handle.cdp, {
|
|
95
|
+
format: input.format ?? 'png',
|
|
96
|
+
quality: input.quality,
|
|
97
|
+
clip,
|
|
98
|
+
captureBeyondViewport: input.fullPage ?? false,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=viewport-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport-tools.js","sourceRoot":"","sources":["../../../src/tools/viewport-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,QAAiB,EACjB,GAAgB;IAEhB,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9C,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,oBAAoB,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAE9F,IAAI,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC7B,IAAI,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC7B,IAAI,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC7B,IAAI,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC;IAE7B,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;QACd,MAAM,IAAI,GAAG,GAAG,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,IAA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AAG,CAAC,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;IAE9B,wDAAwD;IACxD,MAAM,YAAY,GAAG,MAAM,GAAG,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACxD,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;IAE7B,IAAI,IAAoE,CAAC;IACzE,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;QACd,MAAM,QAAQ,GAAG,GAAG,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAClE,IAAI,GAAG,MAAM,qBAAqB,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,iBAAiB,CAAC,MAAM,CAAC,GAAG,EAAE;QACnC,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,KAAK;QAC7B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,IAAI;QACJ,qBAAqB,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK;KAC/C,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -21,6 +21,10 @@ export interface ChromeWorkerProcessConfig {
|
|
|
21
21
|
/** Timeout for startup in milliseconds */
|
|
22
22
|
startupTimeoutMs?: number;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Default Chrome executable paths by platform
|
|
26
|
+
*/
|
|
27
|
+
export declare const DEFAULT_CHROME_PATHS: Record<string, string[]>;
|
|
24
28
|
/**
|
|
25
29
|
* Find Chrome executable on the system
|
|
26
30
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrome-worker-process.d.ts","sourceRoot":"","sources":["../../../src/worker/chrome-worker-process.ts"],"names":[],"mappings":"AAAA;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AW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyD5B;;;;OAIG;IACG,IAAI,CAAC,SAAS,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAiC3C;;OAEG;IACH,IAAI,IAAI,IAAI;IAMZ;;OAEG;IACH,OAAO,CAAC,SAAS;IASjB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA2C5B;;OAEG;YACW,UAAU;IAuBxB;;OAEG;IACH,OAAO,CAAC,OAAO;CAQhB"}
|
|
@@ -15,7 +15,7 @@ const logger = createLogger('ChromeWorkerProcess');
|
|
|
15
15
|
/**
|
|
16
16
|
* Default Chrome executable paths by platform
|
|
17
17
|
*/
|
|
18
|
-
const DEFAULT_CHROME_PATHS = {
|
|
18
|
+
export const DEFAULT_CHROME_PATHS = {
|
|
19
19
|
linux: [
|
|
20
20
|
'/usr/bin/google-chrome',
|
|
21
21
|
'/usr/bin/google-chrome-stable',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrome-worker-process.js","sourceRoot":"","sources":["../../../src/worker/chrome-worker-process.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAqB,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAA8C,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAErE,MAAM,MAAM,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAC;AAkBnD;;GAEG;AACH,MA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eAAe,EAAE;oBACzE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;iBAClC,CAAC,CAAC;gBAEH,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;oBAChB,OAAO;gBACT,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,sCAAsC;YACxC,CAAC;YAED,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;QACrE,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,gDAAgD,IAAI,CAAC,gBAAgB,IAAI,CAAC,CAAC;IAC7F,CAAC;IAED;;OAEG;IACK,OAAO;QACb,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;QACpC,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;IAChC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-web-interface",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "MCP server for AI-powered browser automation with semantic page snapshots",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"agent-web-interface": "./dist/src/index.js"
|
|
8
|
+
"agent-web-interface-dev": "./dist/src/index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc --project tsconfig.build.json",
|
|
@@ -50,7 +50,10 @@
|
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.25.2",
|
|
53
|
+
"@mozilla/readability": "^0.6.0",
|
|
53
54
|
"chrome-remote-interface": "^0.33.3",
|
|
55
|
+
"express": "^5.2.1",
|
|
56
|
+
"jsdom": "^27.4.0",
|
|
54
57
|
"puppeteer-core": "^24.36.1",
|
|
55
58
|
"zod": "^3.25.0"
|
|
56
59
|
},
|
|
@@ -58,13 +61,14 @@
|
|
|
58
61
|
"@eslint/js": "^9.39.0",
|
|
59
62
|
"@types/chrome-remote-interface": "^0.33.0",
|
|
60
63
|
"@types/eslint__js": "^8.42.3",
|
|
64
|
+
"@types/express": "^5.0.6",
|
|
65
|
+
"@types/jsdom": "^28.0.0",
|
|
61
66
|
"@types/node": "^20.19.0",
|
|
62
67
|
"@vitest/coverage-v8": "^4.0.17",
|
|
63
68
|
"@xenova/transformers": "^2.17.2",
|
|
64
69
|
"eslint": "^9.39.0",
|
|
65
70
|
"eslint-config-prettier": "^10.1.8",
|
|
66
71
|
"eslint-plugin-prettier": "^5.5.4",
|
|
67
|
-
"jsdom": "^27.4.0",
|
|
68
72
|
"prettier": "^3.7.0",
|
|
69
73
|
"typescript": "^5.0.0",
|
|
70
74
|
"typescript-eslint": "^8.53.0",
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Action Selector
|
|
3
|
-
*
|
|
4
|
-
* Selects and scores key actions from a BaseSnapshot.
|
|
5
|
-
*
|
|
6
|
-
* Design: Generic First, Specific Second
|
|
7
|
-
* 1. Score ALL interactive elements generically (works on any page)
|
|
8
|
-
* 2. Optionally categorize actions (may return 'generic')
|
|
9
|
-
* 3. Select top actions above threshold
|
|
10
|
-
*/
|
|
11
|
-
import type { BaseSnapshot } from '../snapshot/snapshot.types.js';
|
|
12
|
-
import type { ActionSelectionResult, DialogDetectionResult, FormDetectionResult, PageClassification } from './types.js';
|
|
13
|
-
/**
|
|
14
|
-
* Options for action selection.
|
|
15
|
-
*/
|
|
16
|
-
export interface ActionSelectionOptions {
|
|
17
|
-
/** Max actions to return (default: 12) */
|
|
18
|
-
max_actions?: number;
|
|
19
|
-
/** Min score threshold (default: 0.2) */
|
|
20
|
-
min_action_score?: number;
|
|
21
|
-
/** Form detection result for context */
|
|
22
|
-
forms?: FormDetectionResult;
|
|
23
|
-
/** Dialog detection result for context */
|
|
24
|
-
dialogs?: DialogDetectionResult;
|
|
25
|
-
/** Page classification for context */
|
|
26
|
-
pageType?: PageClassification;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Select key actions from a BaseSnapshot.
|
|
30
|
-
*
|
|
31
|
-
* @param snapshot - The snapshot to analyze
|
|
32
|
-
* @param options - Selection options
|
|
33
|
-
* @returns Selection result with top actions and metadata
|
|
34
|
-
*/
|
|
35
|
-
export declare function selectKeyActions(snapshot: BaseSnapshot, options?: ActionSelectionOptions): ActionSelectionResult;
|
|
36
|
-
//# sourceMappingURL=action-selector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-selector.d.ts","sourceRoot":"","sources":["../../../src/factpack/action-selector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAoC,MAAM,+BAA+B,CAAC;AAGpG,OAAO,KAAK,EACV,qBAAqB,EAIrB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAyTpB;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,wCAAwC;IACxC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAE5B,0CAA0C;IAC1C,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAEhC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,YAAY,EACtB,OAAO,GAAE,sBAA2B,GACnC,qBAAqB,CAyHvB"}
|
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Action Selector
|
|
3
|
-
*
|
|
4
|
-
* Selects and scores key actions from a BaseSnapshot.
|
|
5
|
-
*
|
|
6
|
-
* Design: Generic First, Specific Second
|
|
7
|
-
* 1. Score ALL interactive elements generically (works on any page)
|
|
8
|
-
* 2. Optionally categorize actions (may return 'generic')
|
|
9
|
-
* 3. Select top actions above threshold
|
|
10
|
-
*/
|
|
11
|
-
import { QueryEngine } from '../query/query-engine.js';
|
|
12
|
-
import { normalizeText } from '../lib/text-utils.js';
|
|
13
|
-
// ============================================================================
|
|
14
|
-
// Scoring Configuration
|
|
15
|
-
// ============================================================================
|
|
16
|
-
/** Default options */
|
|
17
|
-
const DEFAULT_MAX_ACTIONS = 12;
|
|
18
|
-
const DEFAULT_MIN_SCORE = 0.2;
|
|
19
|
-
/** Interactive kinds to consider */
|
|
20
|
-
const INTERACTIVE_KINDS = [
|
|
21
|
-
'button',
|
|
22
|
-
'link',
|
|
23
|
-
'input',
|
|
24
|
-
'checkbox',
|
|
25
|
-
'radio',
|
|
26
|
-
'select',
|
|
27
|
-
'combobox',
|
|
28
|
-
'tab',
|
|
29
|
-
'menuitem',
|
|
30
|
-
];
|
|
31
|
-
// ============================================================================
|
|
32
|
-
// Category Patterns
|
|
33
|
-
// ============================================================================
|
|
34
|
-
/** Patterns for cart-related actions */
|
|
35
|
-
const CART_PATTERNS = [
|
|
36
|
-
/\badd to cart\b/i,
|
|
37
|
-
/\badd to bag\b/i,
|
|
38
|
-
/\badd to basket\b/i,
|
|
39
|
-
/\bbuy now\b/i,
|
|
40
|
-
/\bpurchase\b/i,
|
|
41
|
-
/\bcheckout\b/i,
|
|
42
|
-
/\bproceed to/i,
|
|
43
|
-
/\bview cart\b/i,
|
|
44
|
-
/\bview bag\b/i,
|
|
45
|
-
];
|
|
46
|
-
/** Patterns for auth-related actions */
|
|
47
|
-
const AUTH_PATTERNS = [
|
|
48
|
-
/\bsign in\b/i,
|
|
49
|
-
/\blog in\b/i,
|
|
50
|
-
/\blogin\b/i,
|
|
51
|
-
/\bsign up\b/i,
|
|
52
|
-
/\bsignup\b/i,
|
|
53
|
-
/\bregister\b/i,
|
|
54
|
-
/\bcreate account\b/i,
|
|
55
|
-
/\bsign out\b/i,
|
|
56
|
-
/\blog out\b/i,
|
|
57
|
-
/\blogout\b/i,
|
|
58
|
-
];
|
|
59
|
-
/** Patterns for primary CTA actions */
|
|
60
|
-
const PRIMARY_CTA_PATTERNS = [
|
|
61
|
-
/\bsubmit\b/i,
|
|
62
|
-
/\bconfirm\b/i,
|
|
63
|
-
/\bcontinue\b/i,
|
|
64
|
-
/\bnext\b/i,
|
|
65
|
-
/\bsave\b/i,
|
|
66
|
-
/\bdone\b/i,
|
|
67
|
-
/\bget started\b/i,
|
|
68
|
-
/\bstart\b/i,
|
|
69
|
-
/\bapply\b/i,
|
|
70
|
-
/\bsend\b/i,
|
|
71
|
-
/\bsubscribe\b/i,
|
|
72
|
-
/\bjoin\b/i,
|
|
73
|
-
/\btry\b/i,
|
|
74
|
-
/\bdownload\b/i,
|
|
75
|
-
];
|
|
76
|
-
/** Patterns for secondary CTA actions */
|
|
77
|
-
const SECONDARY_CTA_PATTERNS = [
|
|
78
|
-
/\blearn more\b/i,
|
|
79
|
-
/\bread more\b/i,
|
|
80
|
-
/\bview\b/i,
|
|
81
|
-
/\bsee\b/i,
|
|
82
|
-
/\bexplore\b/i,
|
|
83
|
-
/\bdiscover\b/i,
|
|
84
|
-
/\bbrowse\b/i,
|
|
85
|
-
/\bdetails\b/i,
|
|
86
|
-
/\bmore info\b/i,
|
|
87
|
-
];
|
|
88
|
-
/** Patterns for search actions */
|
|
89
|
-
const SEARCH_PATTERNS = [/\bsearch\b/i, /\bfind\b/i];
|
|
90
|
-
/** Patterns for media control actions */
|
|
91
|
-
const MEDIA_PATTERNS = [/\bplay\b/i, /\bpause\b/i, /\bstop\b/i, /\bmute\b/i, /\bvolume\b/i];
|
|
92
|
-
// ============================================================================
|
|
93
|
-
// Helper Functions
|
|
94
|
-
// ============================================================================
|
|
95
|
-
/**
|
|
96
|
-
* Check if label matches any pattern.
|
|
97
|
-
*/
|
|
98
|
-
function matchesPatterns(label, patterns) {
|
|
99
|
-
const normalized = normalizeText(label);
|
|
100
|
-
return patterns.some((p) => p.test(normalized));
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Check if node is above the fold.
|
|
104
|
-
*/
|
|
105
|
-
function isAboveFold(node, viewport) {
|
|
106
|
-
const bbox = node.layout.bbox;
|
|
107
|
-
// Consider above fold if top of element is within viewport
|
|
108
|
-
return bbox.y < viewport.height && bbox.y >= 0;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Calculate element area.
|
|
112
|
-
*/
|
|
113
|
-
function getElementArea(node) {
|
|
114
|
-
const bbox = node.layout.bbox;
|
|
115
|
-
return bbox.w * bbox.h;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Categorize an action based on its label and context.
|
|
119
|
-
*/
|
|
120
|
-
function categorizeAction(node, isFormSubmit, isInDialog) {
|
|
121
|
-
const label = node.label;
|
|
122
|
-
// Check patterns in order of specificity
|
|
123
|
-
// Cart actions (highest priority for commerce)
|
|
124
|
-
if (matchesPatterns(label, CART_PATTERNS)) {
|
|
125
|
-
return { category: 'cart-action', confidence: 0.9 };
|
|
126
|
-
}
|
|
127
|
-
// Auth actions
|
|
128
|
-
if (matchesPatterns(label, AUTH_PATTERNS)) {
|
|
129
|
-
return { category: 'auth-action', confidence: 0.85 };
|
|
130
|
-
}
|
|
131
|
-
// Search actions
|
|
132
|
-
if (matchesPatterns(label, SEARCH_PATTERNS)) {
|
|
133
|
-
return { category: 'search', confidence: 0.8 };
|
|
134
|
-
}
|
|
135
|
-
// Media controls
|
|
136
|
-
if (matchesPatterns(label, MEDIA_PATTERNS)) {
|
|
137
|
-
return { category: 'media-control', confidence: 0.85 };
|
|
138
|
-
}
|
|
139
|
-
// Form submit (contextual)
|
|
140
|
-
if (isFormSubmit) {
|
|
141
|
-
return { category: 'form-submit', confidence: 0.9 };
|
|
142
|
-
}
|
|
143
|
-
// Dialog action (contextual)
|
|
144
|
-
if (isInDialog) {
|
|
145
|
-
return { category: 'dialog-action', confidence: 0.8 };
|
|
146
|
-
}
|
|
147
|
-
// Primary CTA patterns
|
|
148
|
-
if (matchesPatterns(label, PRIMARY_CTA_PATTERNS)) {
|
|
149
|
-
return { category: 'primary-cta', confidence: 0.75 };
|
|
150
|
-
}
|
|
151
|
-
// Secondary CTA patterns
|
|
152
|
-
if (matchesPatterns(label, SECONDARY_CTA_PATTERNS)) {
|
|
153
|
-
return { category: 'secondary-cta', confidence: 0.7 };
|
|
154
|
-
}
|
|
155
|
-
// Navigation (links in nav region)
|
|
156
|
-
if (node.kind === 'link' && (node.where.region === 'nav' || node.where.region === 'header')) {
|
|
157
|
-
return { category: 'navigation', confidence: 0.7 };
|
|
158
|
-
}
|
|
159
|
-
// Generic fallback
|
|
160
|
-
return { category: 'generic', confidence: 0.3 };
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Score an action based on various signals.
|
|
164
|
-
*/
|
|
165
|
-
function scoreAction(node, viewport, medianArea, formSubmitIds, dialogNodeIds) {
|
|
166
|
-
const signals = [];
|
|
167
|
-
let score = 0;
|
|
168
|
-
// Must be visible (baseline)
|
|
169
|
-
if (node.state?.visible) {
|
|
170
|
-
score += 0.1;
|
|
171
|
-
signals.push({ type: 'visible', weight: 0.1 });
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
// Not visible - return low score
|
|
175
|
-
return { score: 0, signals: [{ type: 'not-visible', weight: 0 }] };
|
|
176
|
-
}
|
|
177
|
-
// Enabled state
|
|
178
|
-
if (node.state?.enabled ?? true) {
|
|
179
|
-
score += 0.1;
|
|
180
|
-
signals.push({ type: 'enabled', weight: 0.1 });
|
|
181
|
-
}
|
|
182
|
-
// Above fold (high value)
|
|
183
|
-
if (isAboveFold(node, viewport)) {
|
|
184
|
-
score += 0.25;
|
|
185
|
-
signals.push({ type: 'above-fold', weight: 0.25 });
|
|
186
|
-
}
|
|
187
|
-
// Main region
|
|
188
|
-
if (node.where.region === 'main') {
|
|
189
|
-
score += 0.15;
|
|
190
|
-
signals.push({ type: 'main-region', weight: 0.15 });
|
|
191
|
-
}
|
|
192
|
-
else if (node.where.region === 'header') {
|
|
193
|
-
score += 0.1;
|
|
194
|
-
signals.push({ type: 'header-region', weight: 0.1 });
|
|
195
|
-
}
|
|
196
|
-
// Button kind (usually more important than links)
|
|
197
|
-
if (node.kind === 'button') {
|
|
198
|
-
score += 0.15;
|
|
199
|
-
signals.push({ type: 'button-kind', weight: 0.15 });
|
|
200
|
-
}
|
|
201
|
-
// Has meaningful label
|
|
202
|
-
if (node.label && node.label.trim().length > 0) {
|
|
203
|
-
score += 0.1;
|
|
204
|
-
signals.push({ type: 'has-label', weight: 0.1 });
|
|
205
|
-
// Action verb in label
|
|
206
|
-
const label = normalizeText(node.label);
|
|
207
|
-
if (matchesPatterns(label, PRIMARY_CTA_PATTERNS) ||
|
|
208
|
-
matchesPatterns(label, CART_PATTERNS) ||
|
|
209
|
-
matchesPatterns(label, AUTH_PATTERNS)) {
|
|
210
|
-
score += 0.15;
|
|
211
|
-
signals.push({ type: 'action-verb', weight: 0.15 });
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
// Large element (above median)
|
|
215
|
-
const area = getElementArea(node);
|
|
216
|
-
if (area > medianArea) {
|
|
217
|
-
score += 0.1;
|
|
218
|
-
signals.push({ type: 'large-element', weight: 0.1 });
|
|
219
|
-
}
|
|
220
|
-
// Form submit button bonus
|
|
221
|
-
if (formSubmitIds.has(node.node_id)) {
|
|
222
|
-
score += 0.2;
|
|
223
|
-
signals.push({ type: 'form-submit', weight: 0.2 });
|
|
224
|
-
}
|
|
225
|
-
// Dialog action bonus
|
|
226
|
-
if (dialogNodeIds.has(node.node_id)) {
|
|
227
|
-
score += 0.15;
|
|
228
|
-
signals.push({ type: 'dialog-action', weight: 0.15 });
|
|
229
|
-
}
|
|
230
|
-
return { score, signals };
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Calculate median element area from nodes.
|
|
234
|
-
*/
|
|
235
|
-
function calculateMedianArea(nodes) {
|
|
236
|
-
const areas = nodes.map(getElementArea).sort((a, b) => a - b);
|
|
237
|
-
if (areas.length === 0)
|
|
238
|
-
return 0;
|
|
239
|
-
const mid = Math.floor(areas.length / 2);
|
|
240
|
-
return areas.length % 2 !== 0 ? areas[mid] : (areas[mid - 1] + areas[mid]) / 2;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Collect form submit button IDs.
|
|
244
|
-
*/
|
|
245
|
-
function collectFormSubmitIds(formResult) {
|
|
246
|
-
const ids = new Set();
|
|
247
|
-
if (formResult) {
|
|
248
|
-
for (const form of formResult.forms) {
|
|
249
|
-
if (form.submit_button) {
|
|
250
|
-
ids.add(form.submit_button.node_id);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
return ids;
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Collect dialog action node IDs.
|
|
258
|
-
*/
|
|
259
|
-
function collectDialogNodeIds(dialogResult) {
|
|
260
|
-
const ids = new Set();
|
|
261
|
-
if (dialogResult) {
|
|
262
|
-
for (const dialog of dialogResult.dialogs) {
|
|
263
|
-
for (const action of dialog.actions) {
|
|
264
|
-
ids.add(action.node_id);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return ids;
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Select key actions from a BaseSnapshot.
|
|
272
|
-
*
|
|
273
|
-
* @param snapshot - The snapshot to analyze
|
|
274
|
-
* @param options - Selection options
|
|
275
|
-
* @returns Selection result with top actions and metadata
|
|
276
|
-
*/
|
|
277
|
-
export function selectKeyActions(snapshot, options = {}) {
|
|
278
|
-
const startTime = performance.now();
|
|
279
|
-
const engine = new QueryEngine(snapshot);
|
|
280
|
-
const maxActions = options.max_actions ?? DEFAULT_MAX_ACTIONS;
|
|
281
|
-
const minScore = options.min_action_score ?? DEFAULT_MIN_SCORE;
|
|
282
|
-
// Collect context
|
|
283
|
-
const formSubmitIds = collectFormSubmitIds(options.forms);
|
|
284
|
-
const dialogNodeIds = collectDialogNodeIds(options.dialogs);
|
|
285
|
-
// Step 1: Collect all interactive candidates
|
|
286
|
-
const candidates = [];
|
|
287
|
-
for (const kind of INTERACTIVE_KINDS) {
|
|
288
|
-
const matches = engine.find({
|
|
289
|
-
kind,
|
|
290
|
-
state: { visible: true },
|
|
291
|
-
limit: 100,
|
|
292
|
-
});
|
|
293
|
-
candidates.push(...matches.matches.map((m) => m.node));
|
|
294
|
-
}
|
|
295
|
-
// Deduplicate (in case of overlapping queries)
|
|
296
|
-
const seenIds = new Set();
|
|
297
|
-
const uniqueCandidates = candidates.filter((node) => {
|
|
298
|
-
if (seenIds.has(node.node_id))
|
|
299
|
-
return false;
|
|
300
|
-
seenIds.add(node.node_id);
|
|
301
|
-
return true;
|
|
302
|
-
});
|
|
303
|
-
// Step 2: Calculate median area for scoring
|
|
304
|
-
const medianArea = calculateMedianArea(uniqueCandidates);
|
|
305
|
-
// Step 3: Score each candidate
|
|
306
|
-
const scored = [];
|
|
307
|
-
for (const node of uniqueCandidates) {
|
|
308
|
-
const { score, signals } = scoreAction(node, snapshot.viewport, medianArea, formSubmitIds, dialogNodeIds);
|
|
309
|
-
// Skip below threshold
|
|
310
|
-
if (score < minScore)
|
|
311
|
-
continue;
|
|
312
|
-
const isFormSubmit = formSubmitIds.has(node.node_id);
|
|
313
|
-
const isInDialog = dialogNodeIds.has(node.node_id);
|
|
314
|
-
const { category, confidence: categoryConfidence } = categorizeAction(node, isFormSubmit, isInDialog);
|
|
315
|
-
scored.push({
|
|
316
|
-
node,
|
|
317
|
-
score,
|
|
318
|
-
signals,
|
|
319
|
-
category,
|
|
320
|
-
categoryConfidence,
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
// Step 4: Sort by score descending
|
|
324
|
-
scored.sort((a, b) => b.score - a.score);
|
|
325
|
-
// Step 5: Select top actions
|
|
326
|
-
const topScored = scored.slice(0, maxActions);
|
|
327
|
-
// Step 6: Build result
|
|
328
|
-
const actions = topScored.map((item) => ({
|
|
329
|
-
node_id: item.node.node_id,
|
|
330
|
-
backend_node_id: item.node.backend_node_id,
|
|
331
|
-
label: item.node.label,
|
|
332
|
-
kind: item.node.kind,
|
|
333
|
-
region: item.node.where.region,
|
|
334
|
-
locator: item.node.find?.primary ?? '',
|
|
335
|
-
enabled: item.node.state?.enabled ?? true,
|
|
336
|
-
score: item.score,
|
|
337
|
-
signals: item.signals,
|
|
338
|
-
category: item.category,
|
|
339
|
-
category_confidence: item.categoryConfidence,
|
|
340
|
-
}));
|
|
341
|
-
// Step 7: Identify primary CTA
|
|
342
|
-
let primaryCta;
|
|
343
|
-
const ctaCategories = [
|
|
344
|
-
'primary-cta',
|
|
345
|
-
'cart-action',
|
|
346
|
-
'form-submit',
|
|
347
|
-
'auth-action',
|
|
348
|
-
];
|
|
349
|
-
for (const action of actions) {
|
|
350
|
-
if (ctaCategories.includes(action.category)) {
|
|
351
|
-
primaryCta = action;
|
|
352
|
-
break;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
// If no specific CTA found, use highest-scored button
|
|
356
|
-
primaryCta ??= actions.find((a) => a.kind === 'button');
|
|
357
|
-
const selectionTimeMs = performance.now() - startTime;
|
|
358
|
-
return {
|
|
359
|
-
actions,
|
|
360
|
-
primary_cta: primaryCta,
|
|
361
|
-
meta: {
|
|
362
|
-
candidates_evaluated: uniqueCandidates.length,
|
|
363
|
-
selection_time_ms: selectionTimeMs,
|
|
364
|
-
},
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
//# sourceMappingURL=action-selector.js.map
|