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,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Value Masking
|
|
3
|
+
*
|
|
4
|
+
* Masks sensitive field values (passwords, tokens, SSNs) for safe display.
|
|
5
|
+
*
|
|
6
|
+
* @module state/value-masking
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Sensitive field name patterns (case-insensitive).
|
|
10
|
+
* Values in these fields will be masked.
|
|
11
|
+
*/
|
|
12
|
+
export declare const SENSITIVE_FIELD_PATTERNS: string[];
|
|
13
|
+
/**
|
|
14
|
+
* Input types that should always be masked.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MASKED_INPUT_TYPES: string[];
|
|
17
|
+
/**
|
|
18
|
+
* Input types with partial masking (show first/last chars).
|
|
19
|
+
*/
|
|
20
|
+
export declare const PARTIAL_MASK_TYPES: string[];
|
|
21
|
+
/**
|
|
22
|
+
* Mask sensitive values in val_hint.
|
|
23
|
+
*
|
|
24
|
+
* Rules:
|
|
25
|
+
* - password type: always full mask
|
|
26
|
+
* - sensitive field names: always full mask
|
|
27
|
+
* - email/tel: partial mask (show first/last chars)
|
|
28
|
+
* - default: truncate to 12 chars, mask middle
|
|
29
|
+
*/
|
|
30
|
+
export declare function maskValue(value: string, inputType?: string, label?: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Partial mask: show first 2 and last 2 chars.
|
|
33
|
+
* Example: "example@email.com" -> "ex•••om"
|
|
34
|
+
*/
|
|
35
|
+
export declare function partialMask(value: string): string;
|
|
36
|
+
//# sourceMappingURL=value-masking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-masking.d.ts","sourceRoot":"","sources":["../../../src/state/value-masking.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,UAkBpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,UAAe,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,kBAAkB,UAA4B,CAAC;AAE5D;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CA8BnF;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQjD"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Value Masking
|
|
3
|
+
*
|
|
4
|
+
* Masks sensitive field values (passwords, tokens, SSNs) for safe display.
|
|
5
|
+
*
|
|
6
|
+
* @module state/value-masking
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Sensitive field name patterns (case-insensitive).
|
|
10
|
+
* Values in these fields will be masked.
|
|
11
|
+
*/
|
|
12
|
+
export const SENSITIVE_FIELD_PATTERNS = [
|
|
13
|
+
'password',
|
|
14
|
+
'passwd',
|
|
15
|
+
'pass',
|
|
16
|
+
'secret',
|
|
17
|
+
'token',
|
|
18
|
+
'auth',
|
|
19
|
+
'key',
|
|
20
|
+
'api_key',
|
|
21
|
+
'apikey',
|
|
22
|
+
'otp',
|
|
23
|
+
'pin',
|
|
24
|
+
'cvv',
|
|
25
|
+
'cvc',
|
|
26
|
+
'ssn',
|
|
27
|
+
'social',
|
|
28
|
+
'credit',
|
|
29
|
+
'card',
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Input types that should always be masked.
|
|
33
|
+
*/
|
|
34
|
+
export const MASKED_INPUT_TYPES = ['password'];
|
|
35
|
+
/**
|
|
36
|
+
* Input types with partial masking (show first/last chars).
|
|
37
|
+
*/
|
|
38
|
+
export const PARTIAL_MASK_TYPES = ['email', 'tel', 'phone'];
|
|
39
|
+
/**
|
|
40
|
+
* Mask sensitive values in val_hint.
|
|
41
|
+
*
|
|
42
|
+
* Rules:
|
|
43
|
+
* - password type: always full mask
|
|
44
|
+
* - sensitive field names: always full mask
|
|
45
|
+
* - email/tel: partial mask (show first/last chars)
|
|
46
|
+
* - default: truncate to 12 chars, mask middle
|
|
47
|
+
*/
|
|
48
|
+
export function maskValue(value, inputType, label) {
|
|
49
|
+
// Strip newlines first
|
|
50
|
+
const cleanValue = value.replace(/[\r\n]/g, ' ').trim();
|
|
51
|
+
if (!cleanValue)
|
|
52
|
+
return '';
|
|
53
|
+
// Password type: always full mask
|
|
54
|
+
if (inputType && MASKED_INPUT_TYPES.includes(inputType.toLowerCase())) {
|
|
55
|
+
return '••••••••';
|
|
56
|
+
}
|
|
57
|
+
// Check sensitive field names
|
|
58
|
+
const lowerLabel = (label ?? '').toLowerCase();
|
|
59
|
+
for (const pattern of SENSITIVE_FIELD_PATTERNS) {
|
|
60
|
+
if (lowerLabel.includes(pattern)) {
|
|
61
|
+
return '***';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Email/tel: partial mask
|
|
65
|
+
if (inputType && PARTIAL_MASK_TYPES.includes(inputType.toLowerCase())) {
|
|
66
|
+
return partialMask(cleanValue);
|
|
67
|
+
}
|
|
68
|
+
// Default: truncate and partial mask if long
|
|
69
|
+
if (cleanValue.length <= 12) {
|
|
70
|
+
return cleanValue;
|
|
71
|
+
}
|
|
72
|
+
return partialMask(cleanValue.substring(0, 12));
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Partial mask: show first 2 and last 2 chars.
|
|
76
|
+
* Example: "example@email.com" -> "ex•••om"
|
|
77
|
+
*/
|
|
78
|
+
export function partialMask(value) {
|
|
79
|
+
if (value.length <= 4) {
|
|
80
|
+
return '••••';
|
|
81
|
+
}
|
|
82
|
+
const first = value.substring(0, 2);
|
|
83
|
+
const last = value.substring(value.length - 2);
|
|
84
|
+
return `${first}•••${last}`;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=value-masking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-masking.js","sourceRoot":"","sources":["../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AAO,WAAW,CAAC,UAAU,CAAC,CAAC;IACjC,CAAC;IAED,6CAA6C;IAC7C,IAAI,UAAU,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QAC5B,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,OAAO,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAClD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/C,OAAO,GAAG,KAAK,MAAM,IAAI,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action Context
|
|
3
|
+
*
|
|
4
|
+
* Shared action context helpers used by all tool handler modules.
|
|
5
|
+
* Provides snapshot capture with CDP recovery, action context preparation,
|
|
6
|
+
* runtime health building, and tool initialization.
|
|
7
|
+
*/
|
|
8
|
+
import type { PageHandle } from '../browser/page-registry.js';
|
|
9
|
+
import type { BaseSnapshot } from '../snapshot/snapshot.types.js';
|
|
10
|
+
import type { RuntimeHealth } from '../state/health.types.js';
|
|
11
|
+
import { type CaptureWithStabilizationResult } from '../snapshot/snapshot-health.js';
|
|
12
|
+
import type { CaptureSnapshotFn } from './execute-action.js';
|
|
13
|
+
import type { ToolContext } from './tool-context.types.js';
|
|
14
|
+
/**
|
|
15
|
+
* Build runtime health details from a capture attempt.
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildRuntimeHealth(cdpHealth: RuntimeHealth['cdp'], result: CaptureWithStabilizationResult): RuntimeHealth;
|
|
18
|
+
/**
|
|
19
|
+
* Capture a snapshot with stabilization and CDP recovery when empty.
|
|
20
|
+
*/
|
|
21
|
+
export declare function captureSnapshotWithRecovery(ctx: ToolContext, handle: PageHandle, pageId: string): Promise<{
|
|
22
|
+
snapshot: BaseSnapshot;
|
|
23
|
+
handle: PageHandle;
|
|
24
|
+
runtime_health: RuntimeHealth;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Create a capture function that keeps the handle updated after recovery.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createActionCapture(ctx: ToolContext, handleRef: {
|
|
30
|
+
current: PageHandle;
|
|
31
|
+
}, pageId: string): CaptureSnapshotFn;
|
|
32
|
+
/**
|
|
33
|
+
* Context for action execution.
|
|
34
|
+
*/
|
|
35
|
+
export interface ActionContext {
|
|
36
|
+
/** Mutable reference to page handle (updated on recovery) */
|
|
37
|
+
handleRef: {
|
|
38
|
+
current: PageHandle;
|
|
39
|
+
};
|
|
40
|
+
/** Resolved page ID */
|
|
41
|
+
pageId: string;
|
|
42
|
+
/** Snapshot capture function */
|
|
43
|
+
captureSnapshot: CaptureSnapshotFn;
|
|
44
|
+
/** Tool context instance */
|
|
45
|
+
ctx: ToolContext;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Prepare context for action execution.
|
|
49
|
+
* Resolves page, ensures CDP session health, and creates capture function.
|
|
50
|
+
*
|
|
51
|
+
* @param pageId - Optional page ID to resolve
|
|
52
|
+
* @returns Action context with handle, capture function, and session
|
|
53
|
+
*/
|
|
54
|
+
export declare function prepareActionContext(pageId: string | undefined, ctx: ToolContext): Promise<ActionContext>;
|
|
55
|
+
//# sourceMappingURL=action-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-context.d.ts","sourceRoot":"","sources":["../../../src/tools/action-context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CA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
1
|
+
/**
|
|
2
|
+
* Action Context
|
|
3
|
+
*
|
|
4
|
+
* Shared action context helpers used by all tool handler modules.
|
|
5
|
+
* Provides snapshot capture with CDP recovery, action context preparation,
|
|
6
|
+
* runtime health building, and tool initialization.
|
|
7
|
+
*/
|
|
8
|
+
import { captureWithStabilization, determineHealthCode, } from '../snapshot/snapshot-health.js';
|
|
9
|
+
/**
|
|
10
|
+
* Build runtime health details from a capture attempt.
|
|
11
|
+
*/
|
|
12
|
+
export function buildRuntimeHealth(cdpHealth, result) {
|
|
13
|
+
const code = determineHealthCode(result);
|
|
14
|
+
return {
|
|
15
|
+
cdp: cdpHealth,
|
|
16
|
+
snapshot: {
|
|
17
|
+
ok: code === 'HEALTHY',
|
|
18
|
+
code,
|
|
19
|
+
attempts: result.attempts,
|
|
20
|
+
message: result.health.message,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Capture a snapshot with stabilization and CDP recovery when empty.
|
|
26
|
+
*/
|
|
27
|
+
export async function captureSnapshotWithRecovery(ctx, handle, pageId) {
|
|
28
|
+
const ensureResult = await ctx.ensureCdpSession(handle);
|
|
29
|
+
handle = ensureResult.handle;
|
|
30
|
+
let result = await captureWithStabilization(handle.cdp, handle.page, pageId);
|
|
31
|
+
let runtime_health = buildRuntimeHealth(ensureResult.runtime_health.cdp, result);
|
|
32
|
+
if (!result.health.valid) {
|
|
33
|
+
const healthCode = determineHealthCode(result);
|
|
34
|
+
console.warn(`[RECOVERY] Empty snapshot for ${pageId} (${healthCode}); rebinding CDP session`);
|
|
35
|
+
handle = await ctx.getSessionManager().rebindCdpSession(pageId);
|
|
36
|
+
result = await captureWithStabilization(handle.cdp, handle.page, pageId, { maxRetries: 1 });
|
|
37
|
+
runtime_health = buildRuntimeHealth({ ok: true, recovered: true, recovery_method: 'rebind' }, result);
|
|
38
|
+
}
|
|
39
|
+
return { snapshot: result.snapshot, handle, runtime_health };
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Create a capture function that keeps the handle updated after recovery.
|
|
43
|
+
*/
|
|
44
|
+
export function createActionCapture(ctx, handleRef, pageId) {
|
|
45
|
+
return async () => {
|
|
46
|
+
const captureResult = await captureSnapshotWithRecovery(ctx, handleRef.current, pageId);
|
|
47
|
+
handleRef.current = captureResult.handle;
|
|
48
|
+
return {
|
|
49
|
+
snapshot: captureResult.snapshot,
|
|
50
|
+
runtime_health: captureResult.runtime_health,
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Prepare context for action execution.
|
|
56
|
+
* Resolves page, ensures CDP session health, and creates capture function.
|
|
57
|
+
*
|
|
58
|
+
* @param pageId - Optional page ID to resolve
|
|
59
|
+
* @returns Action context with handle, capture function, and session
|
|
60
|
+
*/
|
|
61
|
+
export async function prepareActionContext(pageId, ctx) {
|
|
62
|
+
const handleRef = { current: ctx.resolveExistingPage(pageId) };
|
|
63
|
+
const resolvedPageId = handleRef.current.page_id;
|
|
64
|
+
handleRef.current = (await ctx.ensureCdpSession(handleRef.current)).handle;
|
|
65
|
+
await handleRef.current.page.bringToFront();
|
|
66
|
+
const captureSnapshot = createActionCapture(ctx, handleRef, resolvedPageId);
|
|
67
|
+
return { handleRef, pageId: resolvedPageId, captureSnapshot, ctx };
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=action-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-context.js","sourceRoot":"","sources":["../../../src/tools/action-context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GAEpB,MAAM,gCAAgC,CAAC;AAIxC;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAA+B,EAC/B,MAAsC;IAEtC,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAEzC,OAAO;QACL,GAAG,EAAE,SAAS;QACd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cAAc,EAAE,CAAC;AAC/D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,GAAgB,EAChB,SAAkC,EAClC,MAAc;IAEd,OAAO,KAAK,IAAI,EAAE;QAChB,MAAM,aAAa,GAAG,MAAM,2BAA2B,CAAC,GAAG,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACxF,SAAS,CAAC,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC;QACzC,OAAO;YACL,QAAQ,EAAE,aAAa,CAAC,QAAQ;YAChC,cAAc,EAAE,aAAa,CAAC,cAAc;SAC7C,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAoBD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAA0B,EAC1B,GAAgB;IAEhB,MAAM,SAAS,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC;IAC/D,MAAM,cAAc,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC;IAEjD,SAAS,CAAC,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAC3E,MAAM,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;IAC5C,MAAM,eAAe,GAAG,mBAAmB,CAAC,GAAG,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;IAE5E,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action Stabilization
|
|
3
|
+
*
|
|
4
|
+
* Stabilizes the page after actions using tiered waiting (DOM + network).
|
|
5
|
+
*
|
|
6
|
+
* @module tools/action-stabilization
|
|
7
|
+
*/
|
|
8
|
+
import type { Page } from 'puppeteer-core';
|
|
9
|
+
import { type StabilizationResult } from '../delta/dom-stabilizer.js';
|
|
10
|
+
import type { PageHandle } from '../browser/page-registry.js';
|
|
11
|
+
import type { BaseSnapshot } from '../snapshot/snapshot.types.js';
|
|
12
|
+
import type { RuntimeHealth } from '../state/health.types.js';
|
|
13
|
+
/**
|
|
14
|
+
* Stabilize page after an action using tiered waiting strategy.
|
|
15
|
+
*
|
|
16
|
+
* This addresses the core issue: actions may trigger API calls that complete
|
|
17
|
+
* after DOM mutations settle. The tiered approach:
|
|
18
|
+
*
|
|
19
|
+
* 1. Wait for DOM to stabilize (MutationObserver) - catches SPA rendering
|
|
20
|
+
* 2. Wait for network to quiet down (networkidle) - catches pending API calls
|
|
21
|
+
* 3. If DOM stabilization fails (navigation), fall back to network idle wait
|
|
22
|
+
*
|
|
23
|
+
* Timeouts are generous but never throw - we proceed even if network stays busy
|
|
24
|
+
* (common with analytics, long-polling, websockets).
|
|
25
|
+
*
|
|
26
|
+
* @param page - Puppeteer Page instance
|
|
27
|
+
* @param networkTimeoutMs - Optional custom timeout for network idle (default: 3000ms)
|
|
28
|
+
* @returns Stabilization result with status
|
|
29
|
+
*/
|
|
30
|
+
export declare function stabilizeAfterAction(page: Page, networkTimeoutMs?: number): Promise<StabilizationResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Stabilize page after explicit navigation (goto, back, forward, reload).
|
|
33
|
+
*
|
|
34
|
+
* Uses a longer network timeout since navigations typically trigger more
|
|
35
|
+
* requests than in-page actions.
|
|
36
|
+
*
|
|
37
|
+
* @param page - Puppeteer Page instance
|
|
38
|
+
* @returns Stabilization result with status
|
|
39
|
+
*/
|
|
40
|
+
export declare function stabilizeAfterNavigation(page: Page): Promise<StabilizationResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Capture snapshot without recovery (fallback path).
|
|
43
|
+
*/
|
|
44
|
+
export declare function captureSnapshotFallback(handle: PageHandle): Promise<{
|
|
45
|
+
snapshot: BaseSnapshot;
|
|
46
|
+
runtime_health: RuntimeHealth;
|
|
47
|
+
}>;
|
|
48
|
+
//# sourceMappingURL=action-stabilization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-stabilization.d.ts","sourceRoot":"","sources":["../../../src/tools/action-stabilization.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAS9D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,gBAAgB,GAAE,MAAuC,GACxD,OAAO,CAAC,mBAAmB,CAAC,CAiD9B;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAEvF;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC;IAAE,QAAQ,EAAE,YAAY,CAAC;IAAC,cAAc,EAAE,aAAa,CAAA;CAAE,CAAC,CAGpE"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action Stabilization
|
|
3
|
+
*
|
|
4
|
+
* Stabilizes the page after actions using tiered waiting (DOM + network).
|
|
5
|
+
*
|
|
6
|
+
* @module tools/action-stabilization
|
|
7
|
+
*/
|
|
8
|
+
import { stabilizeDom } from '../delta/dom-stabilizer.js';
|
|
9
|
+
import { createHealthyRuntime } from '../state/health.types.js';
|
|
10
|
+
import { compileSnapshot } from '../snapshot/index.js';
|
|
11
|
+
import { waitForNetworkQuiet, ACTION_NETWORK_IDLE_TIMEOUT_MS, NAVIGATION_NETWORK_IDLE_TIMEOUT_MS, } from '../browser/page-stabilization.js';
|
|
12
|
+
/**
|
|
13
|
+
* Stabilize page after an action using tiered waiting strategy.
|
|
14
|
+
*
|
|
15
|
+
* This addresses the core issue: actions may trigger API calls that complete
|
|
16
|
+
* after DOM mutations settle. The tiered approach:
|
|
17
|
+
*
|
|
18
|
+
* 1. Wait for DOM to stabilize (MutationObserver) - catches SPA rendering
|
|
19
|
+
* 2. Wait for network to quiet down (networkidle) - catches pending API calls
|
|
20
|
+
* 3. If DOM stabilization fails (navigation), fall back to network idle wait
|
|
21
|
+
*
|
|
22
|
+
* Timeouts are generous but never throw - we proceed even if network stays busy
|
|
23
|
+
* (common with analytics, long-polling, websockets).
|
|
24
|
+
*
|
|
25
|
+
* @param page - Puppeteer Page instance
|
|
26
|
+
* @param networkTimeoutMs - Optional custom timeout for network idle (default: 3000ms)
|
|
27
|
+
* @returns Stabilization result with status
|
|
28
|
+
*/
|
|
29
|
+
export async function stabilizeAfterAction(page, networkTimeoutMs = ACTION_NETWORK_IDLE_TIMEOUT_MS) {
|
|
30
|
+
// Step 1: Try MutationObserver-based DOM stabilization first
|
|
31
|
+
const result = await stabilizeDom(page);
|
|
32
|
+
// Step 2: Handle based on DOM stabilization result
|
|
33
|
+
if (result.status === 'stable' || result.status === 'timeout') {
|
|
34
|
+
// DOM settled (or timed out) - now wait for network to quiet down
|
|
35
|
+
// This catches API calls that haven't rendered to DOM yet
|
|
36
|
+
const networkIdle = await waitForNetworkQuiet(page, networkTimeoutMs);
|
|
37
|
+
// Step 3: After network settled, briefly wait for any DOM renders triggered by API responses.
|
|
38
|
+
// Only needed when DOM was already stable and network actually reached idle
|
|
39
|
+
// (meaning data arrived that could trigger React/framework re-renders).
|
|
40
|
+
if (result.status === 'stable' && networkIdle) {
|
|
41
|
+
await stabilizeDom(page, { maxTimeoutMs: 500 });
|
|
42
|
+
}
|
|
43
|
+
if (!networkIdle && result.status === 'stable') {
|
|
44
|
+
// DOM was stable but network didn't idle - add a note
|
|
45
|
+
return {
|
|
46
|
+
...result,
|
|
47
|
+
warning: result.warning ?? 'Network did not reach idle state within timeout',
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
// status === 'error' means page.evaluate() failed, likely due to navigation
|
|
53
|
+
// Fall back to waiting for network idle on the new page
|
|
54
|
+
try {
|
|
55
|
+
// Wait for network to settle on the new page
|
|
56
|
+
await waitForNetworkQuiet(page, networkTimeoutMs);
|
|
57
|
+
return {
|
|
58
|
+
status: 'stable',
|
|
59
|
+
waitTimeMs: result.waitTimeMs,
|
|
60
|
+
warning: 'Navigation detected; waited for networkidle',
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
catch (waitError) {
|
|
64
|
+
// If network wait also fails, the page might be in an unusual state
|
|
65
|
+
// Return the original error but with additional context
|
|
66
|
+
const message = waitError instanceof Error ? waitError.message : String(waitError);
|
|
67
|
+
return {
|
|
68
|
+
status: 'error',
|
|
69
|
+
waitTimeMs: result.waitTimeMs,
|
|
70
|
+
warning: `${result.warning}. Fallback network wait also failed: ${message}`,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Stabilize page after explicit navigation (goto, back, forward, reload).
|
|
76
|
+
*
|
|
77
|
+
* Uses a longer network timeout since navigations typically trigger more
|
|
78
|
+
* requests than in-page actions.
|
|
79
|
+
*
|
|
80
|
+
* @param page - Puppeteer Page instance
|
|
81
|
+
* @returns Stabilization result with status
|
|
82
|
+
*/
|
|
83
|
+
export async function stabilizeAfterNavigation(page) {
|
|
84
|
+
return stabilizeAfterAction(page, NAVIGATION_NETWORK_IDLE_TIMEOUT_MS);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Capture snapshot without recovery (fallback path).
|
|
88
|
+
*/
|
|
89
|
+
export async function captureSnapshotFallback(handle) {
|
|
90
|
+
const snapshot = await compileSnapshot(handle.cdp, handle.page, handle.page_id);
|
|
91
|
+
return { snapshot, runtime_health: createHealthyRuntime() };
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=action-stabilization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-stabilization.js","sourceRoot":"","sources":["../../../src/tools/action-stabilization.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,YAAY,EAA4B,MAAM,4BAA4B,CAAC;AAIpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAC9B,kCAAkC,GACnC,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAAU,EACV,mBAA2B,8BAA8B;IAEzD,6DAA6D;IAC7D,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;IAExC,mDAAmD;IACnD,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC9D,kEAAkE;QAClE,0DAA0D;QAC1D,MAAM,WAAW,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QAEtE,8FAA8F;QAC9F,4EAA4E;QAC5E,wEAAwE;QACxE,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,WAAW,EAAE,CAAC;YAC9C,MAAM,YAAY,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,CAAC,WAAW,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/C,sDAAsD;YACtD,OAAO;gBACL,GA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-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export declare function initializeTools(manager: SessionManager): void;
|
|
14
|
-
/**
|
|
15
|
-
* List all open browser pages with their metadata.
|
|
16
|
-
*
|
|
17
|
-
* Syncs with browser context to ensure all tabs are registered,
|
|
18
|
-
* including tabs opened externally or after reconnection.
|
|
19
|
-
*
|
|
20
|
-
* @returns XML result with page list
|
|
21
|
-
*/
|
|
22
|
-
export declare function listPages(): Promise<import('./tool-schemas.js').ListPagesOutput>;
|
|
23
|
-
/**
|
|
24
|
-
* Close a specific page.
|
|
25
|
-
*
|
|
26
|
-
* @param rawInput - Close options (will be validated)
|
|
27
|
-
* @returns Close result
|
|
28
|
-
*/
|
|
29
|
-
export declare function closePage(rawInput: unknown): Promise<import('./tool-schemas.js').ClosePageOutput>;
|
|
30
|
-
/**
|
|
31
|
-
* Close the entire browser session.
|
|
32
|
-
*
|
|
33
|
-
* @param rawInput - Close options (will be validated)
|
|
34
|
-
* @returns Close result
|
|
35
|
-
*/
|
|
36
|
-
export declare function closeSession(rawInput: unknown): Promise<import('./tool-schemas.js').CloseSessionOutput>;
|
|
37
|
-
/**
|
|
38
|
-
* Navigate to a URL.
|
|
39
|
-
*
|
|
40
|
-
* @param rawInput - Navigation options (will be validated)
|
|
41
|
-
* @returns Navigation result with snapshot data
|
|
42
|
-
*/
|
|
43
|
-
export declare function navigate(rawInput: unknown): Promise<import('./tool-schemas.js').NavigateOutput>;
|
|
44
|
-
/**
|
|
45
|
-
* Go back in browser history.
|
|
46
|
-
*
|
|
47
|
-
* @param rawInput - Navigation options (will be validated)
|
|
48
|
-
* @returns Navigation result with snapshot data
|
|
49
|
-
*/
|
|
50
|
-
export declare function goBack(rawInput: unknown): Promise<import('./tool-schemas.js').GoBackOutput>;
|
|
51
|
-
/**
|
|
52
|
-
* Go forward in browser history.
|
|
53
|
-
*
|
|
54
|
-
* @param rawInput - Navigation options (will be validated)
|
|
55
|
-
* @returns Navigation result with snapshot data
|
|
56
|
-
*/
|
|
57
|
-
export declare function goForward(rawInput: unknown): Promise<import('./tool-schemas.js').GoForwardOutput>;
|
|
58
|
-
/**
|
|
59
|
-
* Reload the current page.
|
|
60
|
-
*
|
|
61
|
-
* @param rawInput - Navigation options (will be validated)
|
|
62
|
-
* @returns Navigation result with snapshot data
|
|
63
|
-
*/
|
|
64
|
-
export declare function reload(rawInput: unknown): Promise<import('./tool-schemas.js').ReloadOutput>;
|
|
65
|
-
/**
|
|
66
|
-
* Capture a fresh snapshot of the current page.
|
|
67
|
-
*
|
|
68
|
-
* @param rawInput - Capture options (will be validated)
|
|
69
|
-
* @returns Snapshot data for the current page
|
|
70
|
-
*/
|
|
71
|
-
export declare function captureSnapshot(rawInput: unknown): Promise<import('./tool-schemas.js').CaptureSnapshotOutput>;
|
|
72
|
-
/**
|
|
73
|
-
* Map schema kind values to internal NodeKind values.
|
|
74
|
-
*
|
|
75
|
-
* The find_elements schema uses user-friendly names that don't always match
|
|
76
|
-
* internal NodeKind values. For example, 'textbox' in the schema maps to
|
|
77
|
-
* both 'input' and 'textarea' internally.
|
|
78
|
-
*
|
|
79
|
-
* @param schemaKind - Kind value from the find_elements schema
|
|
80
|
-
* @returns Matching NodeKind value(s)
|
|
81
|
-
*/
|
|
82
|
-
export declare function mapSchemaKindToNodeKind(schemaKind: string): NodeKind | NodeKind[];
|
|
83
|
-
/**
|
|
84
|
-
* Find elements by semantic criteria.
|
|
85
|
-
*
|
|
86
|
-
* @param rawInput - Query filters (will be validated)
|
|
87
|
-
* @returns Matched nodes
|
|
88
|
-
*/
|
|
89
|
-
export declare function findElements(rawInput: unknown): import('./tool-schemas.js').FindElementsOutput;
|
|
90
|
-
/**
|
|
91
|
-
* Get full details for a specific node.
|
|
92
|
-
*
|
|
93
|
-
* @param rawInput - Node details request (will be validated)
|
|
94
|
-
* @returns Full node details
|
|
95
|
-
*/
|
|
96
|
-
export declare function getNodeDetails(rawInput: unknown): import('./tool-schemas.js').GetNodeDetailsOutput;
|
|
97
|
-
/**
|
|
98
|
-
* Scroll an element into view.
|
|
99
|
-
*
|
|
100
|
-
* @param rawInput - Scroll options (will be validated)
|
|
101
|
-
* @returns Scroll result with delta
|
|
102
|
-
*/
|
|
103
|
-
export declare function scrollElementIntoView(rawInput: unknown): Promise<import('./tool-schemas.js').ScrollElementIntoViewOutput>;
|
|
104
|
-
/**
|
|
105
|
-
* Scroll the page up or down.
|
|
106
|
-
*
|
|
107
|
-
* @param rawInput - Scroll options (will be validated)
|
|
108
|
-
* @returns Scroll result with delta
|
|
109
|
-
*/
|
|
110
|
-
export declare function scrollPage(rawInput: unknown): Promise<import('./tool-schemas.js').ScrollPageOutput>;
|
|
111
|
-
/**
|
|
112
|
-
* Click an element or at viewport coordinates.
|
|
113
|
-
*
|
|
114
|
-
* Three modes:
|
|
115
|
-
* 1. eid only → click element center (existing behavior)
|
|
116
|
-
* 2. eid + x/y → click at offset relative to element top-left
|
|
117
|
-
* 3. x/y only → click at absolute viewport coordinates
|
|
118
|
-
*
|
|
119
|
-
* @param rawInput - Click options (will be validated)
|
|
120
|
-
* @returns Click result with navigation-aware outcome
|
|
121
|
-
*/
|
|
122
|
-
export declare function click(rawInput: unknown): Promise<import('./tool-schemas.js').ClickOutput>;
|
|
123
|
-
/**
|
|
124
|
-
* Type text into an element.
|
|
125
|
-
*
|
|
126
|
-
* @param rawInput - Type options (will be validated)
|
|
127
|
-
* @returns Type result with delta
|
|
128
|
-
*/
|
|
129
|
-
export declare function type(rawInput: unknown): Promise<import('./tool-schemas.js').TypeOutput>;
|
|
130
|
-
/**
|
|
131
|
-
* Press a keyboard key (no agent_version).
|
|
132
|
-
*
|
|
133
|
-
* @param rawInput - Press options (will be validated)
|
|
134
|
-
* @returns Press result with delta
|
|
135
|
-
*/
|
|
136
|
-
export declare function press(rawInput: unknown): Promise<import('./tool-schemas.js').PressOutput>;
|
|
137
|
-
/**
|
|
138
|
-
* Select a dropdown option.
|
|
139
|
-
*
|
|
140
|
-
* @param rawInput - Select options (will be validated)
|
|
141
|
-
* @returns Select result with delta
|
|
142
|
-
*/
|
|
143
|
-
export declare function select(rawInput: unknown): Promise<import('./tool-schemas.js').SelectOutput>;
|
|
144
|
-
/**
|
|
145
|
-
* Hover over an element.
|
|
146
|
-
*
|
|
147
|
-
* @param rawInput - Hover options (will be validated)
|
|
148
|
-
* @returns Hover result with delta
|
|
149
|
-
*/
|
|
150
|
-
export declare function hover(rawInput: unknown): Promise<import('./tool-schemas.js').HoverOutput>;
|
|
151
|
-
/**
|
|
152
|
-
* Drag from one point to another.
|
|
153
|
-
*
|
|
154
|
-
* If eid is provided, coordinates are relative to the element's top-left corner.
|
|
155
|
-
* Otherwise, coordinates are absolute viewport coordinates.
|
|
156
|
-
*
|
|
157
|
-
* @param rawInput - Drag options (will be validated)
|
|
158
|
-
* @returns Drag result with updated snapshot
|
|
159
|
-
*/
|
|
160
|
-
export declare function drag(rawInput: unknown): Promise<import('./tool-schemas.js').DragOutput>;
|
|
161
|
-
/**
|
|
162
|
-
* Take a screenshot of the page or a specific element.
|
|
163
|
-
*
|
|
164
|
-
* Observation tool - does not mutate page state.
|
|
165
|
-
* Returns inline image (<2MB) or temp file path (>=2MB).
|
|
166
|
-
*
|
|
167
|
-
* @param rawInput - Screenshot options (will be validated)
|
|
168
|
-
* @returns ImageResult or FileResult
|
|
169
|
-
*/
|
|
170
|
-
export declare function takeScreenshot(rawInput: unknown): Promise<import('./tool-schemas.js').TakeScreenshotOutput>;
|
|
4
|
+
* Re-export barrel for all browser automation tool handlers.
|
|
5
|
+
* The actual implementations live in category-specific modules.
|
|
6
|
+
*/
|
|
7
|
+
export { type ActionContext, prepareActionContext, captureSnapshotWithRecovery, createActionCapture, buildRuntimeHealth, } from './action-context.js';
|
|
8
|
+
export { listPages, closePage, navigate, goBack, goForward, reload } from './navigation-tools.js';
|
|
9
|
+
export { captureSnapshot, findElements, getNodeDetails, scrollElementIntoView, scrollPage, mapSchemaKindToNodeKind, } from './observation-tools.js';
|
|
10
|
+
export { click, type, press, select, hover } from './interaction-tools.js';
|
|
11
|
+
export { drag, wheel, takeScreenshot } from './viewport-tools.js';
|
|
12
|
+
export { readPage } from './readability-tools.js';
|
|
171
13
|
//# sourceMappingURL=browser-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/browser-tools.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/browser-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,KAAK,aAAa,EAClB,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGlG,OAAO,EACL,eAAe,EACf,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,UAAU,EACV,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAG3E,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGlE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC"}
|